%PDF- %PDF-
Direktori : /proc/985914/root/data/old/home/stash/stash-home/tmp/webresources/ |
Current File : //proc/985914/root/data/old/home/stash/stash-home/tmp/webresources/20.cachedfile |
;/* module-key = 'com.hgh.color-commits-for-stash:color-commits-resources', location = '/js/color-commits-min.js' */ jQuery(function(h){function g(){h("#commits-table .commit-row").each(function(){var k=h(this);var j=k.children(".author").text();var i=b(j+" : "+e(j));k.css("background-color",d(i));k.attr("commit-color","true")})}function e(i){return i.split("").reverse().join("")}function d(o){var m=o%55;var n=o%75;var l=o%95;var k=180+m;var j=180+n;var i=160+l;return"rgb( "+k+", "+j+", "+i+" )"}var a=function f(){var k=h("#commits-table .commit-row").length;if(k>0){var j=h("#commits-table .commit-row:last");if(j.attr("commit-color")!="true"){try{g()}catch(i){}}}};setInterval(a,100);function c(l){var m="";var j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var k=0;k<l;k++){m+=j.charAt(Math.floor(Math.random()*j.length))}return m}function b(m){var l=0,k,j;if(m.length==0){return l}for(k=0;k<m.length;k++){j=m.charCodeAt(k);l=((l<<5)-l)+j;l=l&l}return Math.abs(l)}});; ;/* module-key = 'com.atlassian.stash.stash-scm-tags-plugin:scm-tags-commit-list-ui-resources', location = '/feature/tags/commit-list/tags-commit-list.soy' */ // This file was automatically generated from tags-commit-list.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.tags.commitList. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.tags == 'undefined') { stash.feature.tags = {}; } if (typeof stash.feature.tags.commitList == 'undefined') { stash.feature.tags.commitList = {}; } stash.feature.tags.commitList.panel = function(opt_data, opt_ignored) { var output = ''; var count__soy3 = opt_data.tags.length; output += '<span class="tags-container"><span class="tag' + ((count__soy3 > 1) ? ' aggregate' : '') + '" data-names="'; if (count__soy3 == 1) { output += soy.$$escapeHtml(opt_data.tags[0].displayId); } else { var tagList13 = opt_data.tags; var tagListLen13 = tagList13.length; for (var tagIndex13 = 0; tagIndex13 < tagListLen13; tagIndex13++) { var tagData13 = tagList13[tagIndex13]; output += (tagIndex13 < 9) ? ((! (tagIndex13 == 0)) ? ':' : '') + soy.$$escapeHtml(tagData13.displayId) : ''; } output += (opt_data.tags.length > 9) ? ':' + soy.$$escapeHtml("and more...") : ''; } output += '"><span class="aui-icon aui-icon-small aui-iconfont-devtools-tag-small"></span>' + ((count__soy3 == 1) ? '<a href="' + soy.$$escapeHtml(require('stash/api/util/navbuilder').project(opt_data.project).repo(opt_data.repository).commits().until(opt_data.tags[0]).build()) + '" data-id="' + soy.$$escapeHtml(opt_data.tags[0].id) + '" data-csid="' + soy.$$escapeHtml(opt_data.tags[0].latestChangeset) + '">' + soy.$$escapeHtml(opt_data.tags[0].displayId) + '</a>' : (opt_data.tags) ? '<span>' + soy.$$escapeHtml(AJS.format("{0,choice,1#1 tag|1\x3c{0,number} tags|10\x3c9+ tags}",opt_data.tags.length)) + '</span>' : '') + '</span></span>'; return output; }; if (goog.DEBUG) { stash.feature.tags.commitList.panel.soyTemplateName = 'stash.feature.tags.commitList.panel'; } ; ;/* module-key = 'com.atlassian.stash.stash-scm-tags-plugin:scm-tags-commit-list-ui-resources', location = '/feature/tags/commit-list/tags-commit-list.js' */ define("feature/tags/commit-list",["aui","jquery","lodash","memoir","stash/api/util/navbuilder","util/ajax","util/events","model/page-state","model/revision-reference"],function(g,b,i,h,j,e,k,f,a){function l(m){return i.map(m,function(n){return b(n).data("changesetid")})}function d(n,m){return j.rest("scm-tags").addPathComponents("projects",n.getKey(),"repos",m.getSlug(),"tags").build()}function c(m){var o=f.getProject();var n=f.getRepository();e.rest({data:l(m),type:"POST",url:d(o,n)}).done(function(q){if(q.values){var p=i.groupBy(q.values,"latestChangeset");i.each(p,function(s,r){m.filter("[data-changesetid="+r+"]").addClass("has-tags").find(".message").append(stash.feature.tags.commitList.panel({project:o,repository:n,tags:i.sortBy(s)}))});m.find(".tag").tooltip({delayIn:0,gravity:"n",hoverable:false,html:true,live:false,title:function(){var r=b(this).attr("data-names");return i.map(r.split(":"),g.escapeHtml).join("<br>")}})}})}return{onReady:function(){var m=b("#commits-table");c(m.find(".commit-row"));k.on("stash.widget.commitsTable.contentAdded",function(n){c(n.values)});if(h.nativeSupport()){m.on("click",".tags-container .tag a",function(p){p.preventDefault();var o=b(this);var n=new a({id:o.attr("data-id"),displayId:o.text(),latestChangeset:o.attr("data-csid"),type:a.type.TAG});h.pushState(n.toJSON(),null,o.attr("href"))})}}}});jQuery(document).ready(function(){require("feature/tags/commit-list").onReady()});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:time', location = '/static/widget/date/time.soy' */ // This file was automatically generated from time.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.date. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.date == 'undefined') { stash.widget.date = {}; } stash.widget.date.shortAge = function(opt_data, opt_ignored) { return '' + stash.widget.date.time({date: opt_data.date, title: opt_data.title, extraClasses: opt_data.extraClasses, type: 'shortAge'}); }; if (goog.DEBUG) { stash.widget.date.shortAge.soyTemplateName = 'stash.widget.date.shortAge'; } stash.widget.date.short = function(opt_data, opt_ignored) { return '' + stash.widget.date.time({date: opt_data.date, title: opt_data.title, extraClasses: opt_data.extraClasses, type: 'short'}); }; if (goog.DEBUG) { stash.widget.date.short.soyTemplateName = 'stash.widget.date.short'; } stash.widget.date.time = function(opt_data, opt_ignored) { return '' + ((opt_data.date) ? '<time title="' + soy.$$escapeHtml(opt_data.title ? opt_data.title : require('util/time').format(opt_data.date, 'full')) + '" datetime="' + soy.$$escapeHtml(require('util/time').format(opt_data.date, 'timestamp')) + '"' + ((opt_data.extraClasses) ? ' class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + '>' + soy.$$escapeHtml(require('util/time').format(opt_data.date, opt_data.type)) + '</time>' : '<time' + ((opt_data.extraClasses) ? ' class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + '>' + soy.$$escapeHtml("Unknown Date") + '</time>'); }; if (goog.DEBUG) { stash.widget.date.time.soyTemplateName = 'stash.widget.date.time'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:time', location = '/static/widget/date/deprecated-time.soy' */ // This file was automatically generated from deprecated-time.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace widget.date. */ if (typeof widget == 'undefined') { var widget = {}; } if (typeof widget.date == 'undefined') { widget.date = {}; } widget.date.shortAge = function(opt_data, opt_ignored) { return '' + widget.date.time({date: opt_data.date, title: opt_data.title, extraClasses: opt_data.extraClasses, type: 'shortAge'}); }; if (goog.DEBUG) { widget.date.shortAge.soyTemplateName = 'widget.date.shortAge'; } widget.date.short = function(opt_data, opt_ignored) { return '' + widget.date.time({date: opt_data.date, title: opt_data.title, extraClasses: opt_data.extraClasses, type: 'short'}); }; if (goog.DEBUG) { widget.date.short.soyTemplateName = 'widget.date.short'; } widget.date.time = function(opt_data, opt_ignored) { return '' + ((opt_data.date) ? '<time title="' + soy.$$escapeHtml(opt_data.title ? opt_data.title : require('util/time').format(opt_data.date, 'full')) + '" datetime="' + soy.$$escapeHtml(require('util/time').format(opt_data.date, 'timestamp')) + '" class="deprecated' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '">' + soy.$$escapeHtml(require('util/time').format(opt_data.date, opt_data.type)) + '</time>' : '<time class="deprecated' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '">' + soy.$$escapeHtml("Unknown Date") + '</time>'); }; if (goog.DEBUG) { widget.date.time.soyTemplateName = 'widget.date.time'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:focus-message', location = '/static/widget/focus-message/focus-message.soy' */ // This file was automatically generated from focus-message.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.focusMessage. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.focusMessage == 'undefined') { stash.widget.focusMessage = {}; } stash.widget.focusMessage.message = function(opt_data, opt_ignored) { return '<div class="focus-message' + aui.renderExtraClasses(opt_data) + '"' + aui.renderExtraAttributes(opt_data) + '>' + ((opt_data.iconClass) ? '<div class="focus-message-icon aui-icon' + ((opt_data.iconClass) ? ' ' + soy.$$escapeHtml(opt_data.iconClass) : '') + '">' + soy.$$escapeHtml(opt_data.accessibilityText ? opt_data.accessibilityText : '') + '</div>' : '') + '<h2>' + soy.$$escapeHtml(opt_data.title) + '</h2>' + ((opt_data.text) ? '<p>' + soy.$$escapeHtml(opt_data.text) + '</p>' : '') + ((opt_data.content) ? soy.$$filterNoAutoescape(opt_data.content) : '') + '</div>'; }; if (goog.DEBUG) { stash.widget.focusMessage.message.soyTemplateName = 'stash.widget.focusMessage.message'; } stash.widget.focusMessage.error = function(opt_data, opt_ignored) { return '' + stash.widget.focusMessage.message({title: opt_data.title, text: opt_data.text, content: opt_data.content, extraClasses: opt_data.extraClasses, iconClass: 'icon-skull'}); }; if (goog.DEBUG) { stash.widget.focusMessage.error.soyTemplateName = 'stash.widget.focusMessage.error'; } ; ;/* module-key = 'com.atlassian.stash.stash-build-integration:build-status-common-resources', location = '/static/common/build-status-common.soy' */ // This file was automatically generated from build-status-common.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.build.status. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.build == 'undefined') { stash.build = {}; } if (typeof stash.build.status == 'undefined') { stash.build.status = {}; } stash.build.status.summaryIcon = function(opt_data, opt_ignored) { return '' + ((opt_data.stats.failed > 0) ? stash.build.status.failedBuildIcon({clickable: true, title: '' + stash.build.status.title(opt_data)}) : (opt_data.stats.inProgress > 0) ? stash.build.status.inProgressBuildIcon({clickable: true, title: '' + stash.build.status.title(opt_data)}) : (opt_data.stats.successful > 0) ? stash.build.status.successfulBuildIcon({clickable: true, title: '' + stash.build.status.title(opt_data)}) : ''); }; if (goog.DEBUG) { stash.build.status.summaryIcon.soyTemplateName = 'stash.build.status.summaryIcon'; } stash.build.status.title = function(opt_data, opt_ignored) { return '' + ((opt_data.stats.failed >= 1) ? soy.$$escapeHtml(AJS.format("{0} {0,choice,1#build|1\x3cbuilds} failed",opt_data.stats.failed)) : (opt_data.stats.inProgress >= 1) ? soy.$$escapeHtml(AJS.format("{0} {0,choice,1#build|1\x3cbuilds} in progress",opt_data.stats.inProgress)) : (opt_data.stats.successful >= 1) ? soy.$$escapeHtml(AJS.format("{0} {0,choice,1#build|1\x3cbuilds} passed",opt_data.stats.successful)) : ''); }; if (goog.DEBUG) { stash.build.status.title.soyTemplateName = 'stash.build.status.title'; } stash.build.status.dialogList = function(opt_data, opt_ignored) { var output = ''; if (opt_data.statuses.length == 0) { output += stash.widget.focusMessage.message({title: "None found", text: "There are no build results available for this changeset."}); } else { output += '<ul class="build-status-list">'; var statusList38 = opt_data.statuses; var statusListLen38 = statusList38.length; for (var statusIndex38 = 0; statusIndex38 < statusListLen38; statusIndex38++) { var statusData38 = statusList38[statusIndex38]; output += '<li>'; switch (statusData38.state) { case 'SUCCESSFUL': output += stash.build.status.successfulBuildIcon({content: "Build successful", title: "Build successful"}); break; case 'FAILED': output += stash.build.status.failedBuildIcon({content: "Build failed", title: "Build failed"}); break; case 'INPROGRESS': output += stash.build.status.inProgressBuildIcon({content: "Build in progress", title: "Build in progress"}); break; } output += '<div class="summary"><span class="name"><a href="' + soy.$$escapeHtml(statusData38.url) + '" target="_blank" title="' + stash.build.status.buildName({status: statusData38}) + '">' + stash.build.status.buildName({status: statusData38}) + '</a></span>' + stash.widget.date.shortAge({date: statusData38.dateAdded, extraClasses: 'date-added'}) + '</div>' + stash.build.status.buildDescription({status: statusData38}) + '</li>'; } output += '</ul>'; } return output; }; if (goog.DEBUG) { stash.build.status.dialogList.soyTemplateName = 'stash.build.status.dialogList'; } stash.build.status.buildLabel = function(opt_data, opt_ignored) { var output = ''; switch (opt_data.status) { case 'FAILED': output += soy.$$escapeHtml(AJS.format("{0,choice,1#build|1\x3cbuilds} failed",opt_data.count)); break; case 'INPROGRESS': output += soy.$$escapeHtml(AJS.format("{0,choice,1#build|1\x3cbuilds} in progress",opt_data.count)); break; case 'SUCCESSFUL': output += soy.$$escapeHtml(AJS.format("{0,choice,1#build|1\x3cbuilds}",opt_data.count)); break; } return output; }; if (goog.DEBUG) { stash.build.status.buildLabel.soyTemplateName = 'stash.build.status.buildLabel'; } stash.build.status.successfulBuildIcon = function(opt_data, opt_ignored) { return '' + stash.build.status.buildIcon(soy.$$augmentMap(opt_data, {iconClasses: 'aui-iconfont-approve successful-build-icon'})); }; if (goog.DEBUG) { stash.build.status.successfulBuildIcon.soyTemplateName = 'stash.build.status.successfulBuildIcon'; } stash.build.status.failedBuildIcon = function(opt_data, opt_ignored) { return '' + stash.build.status.buildIcon(soy.$$augmentMap(opt_data, {iconClasses: 'aui-iconfont-error failed-build-icon'})); }; if (goog.DEBUG) { stash.build.status.failedBuildIcon.soyTemplateName = 'stash.build.status.failedBuildIcon'; } stash.build.status.inProgressBuildIcon = function(opt_data, opt_ignored) { return '' + stash.build.status.buildIcon(soy.$$augmentMap(opt_data, {iconClasses: 'aui-iconfont-time inprogress-build-icon'})); }; if (goog.DEBUG) { stash.build.status.inProgressBuildIcon.soyTemplateName = 'stash.build.status.inProgressBuildIcon'; } stash.build.status.buildIcon = function(opt_data, opt_ignored) { return '<' + soy.$$filterNoAutoescape(opt_data.clickable ? 'a href="#"' : 'span') + ' class="aui-icon aui-icon-small build-icon ' + soy.$$escapeHtml(opt_data.iconClasses) + '"' + ((opt_data.title) ? ' title="' + soy.$$escapeHtml(opt_data.title) + '"' : '') + '>' + ((opt_data.content) ? soy.$$escapeHtml(opt_data.content) : '') + '</' + soy.$$filterNoAutoescape(opt_data.clickable ? 'a' : 'span') + '>'; }; if (goog.DEBUG) { stash.build.status.buildIcon.soyTemplateName = 'stash.build.status.buildIcon'; } stash.build.status.buildName = function(opt_data, opt_ignored) { return '' + soy.$$escapeHtml(opt_data.status.name ? opt_data.status.name : opt_data.status.key); }; if (goog.DEBUG) { stash.build.status.buildName.soyTemplateName = 'stash.build.status.buildName'; } stash.build.status.buildDescription = function(opt_data, opt_ignored) { return '<div class="description" title="' + soy.$$escapeHtml(opt_data.status.description ? opt_data.status.description : '') + '">' + soy.$$escapeHtml(opt_data.status.description ? opt_data.status.description : '') + '</div>'; }; if (goog.DEBUG) { stash.build.status.buildDescription.soyTemplateName = 'stash.build.status.buildDescription'; } stash.build.status.placeholder = function(opt_data, opt_ignored) { return '<div id="build-status-placeholder" class="hidden"></div>'; }; if (goog.DEBUG) { stash.build.status.placeholder.soyTemplateName = 'stash.build.status.placeholder'; } stash.build.status.stats = function(opt_data, opt_ignored) { return '' + stash.build.status.statsPanel({stats: opt_data.stats, build: opt_data.stats.results && opt_data.stats.results.length == 1 ? opt_data.stats.results[0] : null}); }; if (goog.DEBUG) { stash.build.status.stats.soyTemplateName = 'stash.build.status.stats'; } stash.build.status.statsPanel = function(opt_data, opt_ignored) { return '' + ((opt_data.stats.failed > 0) ? stash.build.status.summary({build: opt_data.build, buildIconContent: '' + stash.build.status.failedBuildIcon({clickable: true}), count: opt_data.stats.failed, status: 'FAILED'}) : (opt_data.stats.inProgress > 0) ? stash.build.status.summary({build: opt_data.build, buildIconContent: '' + stash.build.status.inProgressBuildIcon({clickable: true}), count: opt_data.stats.inProgress, status: 'INPROGRESS'}) : (opt_data.stats.successful > 0) ? stash.build.status.summary({build: opt_data.build, buildIconContent: '' + stash.build.status.successfulBuildIcon({clickable: true}), count: opt_data.stats.successful, status: 'SUCCESSFUL'}) : ''); }; if (goog.DEBUG) { stash.build.status.statsPanel.soyTemplateName = 'stash.build.status.statsPanel'; } stash.build.status.summary = function(opt_data, opt_ignored) { return '' + stash.widget.summaryPanel.relatedEntitiesWebPanel({iconClass: 'aui-icon-small aui-iconfont-build', iconText: "Build status", iconTooltip: "Builds", linkHref: opt_data.build ? opt_data.build.url : null, linkExtraAttributes: opt_data.build ? 'data-single-build=true' : null, linkText: '' + stash.build.status.buildLabel(opt_data), count: opt_data.count, extraClasses: 'build-status-summary', extraContent: '' + soy.$$filterNoAutoescape(opt_data.buildIconContent)}); }; if (goog.DEBUG) { stash.build.status.summary.soyTemplateName = 'stash.build.status.summary'; } ; ;/* module-key = 'com.atlassian.stash.stash-build-integration:build-status-common-resources', location = '/static/common/build-status-dialog.js' */ define("build/status/dialog",["aui","jquery","util/ajax","util/dom-event"],function(j,d,i,b){var k="build-status-dialog",e="build-status-dialog-panel";function n(){this._instance=null;this._xhr=null}n.prototype.bindTo=function(p,s,q,r){var o=this;d(p).on(q,s,function(t){if(!b.openInSameTab(t)&&!!d(this).data("single-build")){return}t.preventDefault();o.showFor(r(d(this)))})};n.prototype.showFor=function(o){if(this._instance){this._instance.remove()}var p=d('<div class="spinner"></div>');this._instance=l(this,p);this._instance.show();p.show().spin("large");h(this,o).always(function(){p.spinStop().remove()})};function c(o){if(o._instance){o._instance.hide()}}function m(o){if(o._xhr){o._xhr.abort()}}function l(o,p){var q=new j.Dialog({closeOnOutsideClick:true,id:k,height:240,width:600,keypressListener:function(r){if(r.keyCode===j.keyCode.ESCAPE){c(o)}}}).addHeader("Builds").addPanel("",p,e).addLink("Close",function(){c(o)});d(document).one("hideLayer",function(){f(o)});return q}function h(p,o){p._xhr=i.rest({url:g(o)}).fail(function(){c(p)}).done(function(q){a(p,stash.build.status.dialogList({statuses:q.values}))}).always(function(){p._xhr=null});return p._xhr}function g(o){return j.contextPath()+"/rest/build-status/latest/commits/"+encodeURIComponent(o)}function f(o){m(o);if(o._instance){o._instance.remove();o._instance=null}}function a(o,p){o._instance.getCurrentPanel().html(p);o._instance.updateHeight()}return n});; ;/* module-key = 'com.atlassian.stash.stash-build-integration:build-status-common-resources', location = '/static/common/build-status-common.js' */ define("build/status/build-status",["aui","build/status/dialog","jquery","util/ajax","exports"],function(d,a,h,g,c){var e=new a();var b=false;function f(i){return d.contextPath()+"/rest/build-status/latest/commits/stats/"+encodeURIComponent(i)}c.fetchContext=function(i){c.queryBuildStatusAndDecorate(i,"#build-status-placeholder",".build-status-summary a",stash.build.status.stats)};c.queryBuildStatusAndDecorate=function(j,m,n,k,o){var i=j.csid,l=j.includeUnique;g.rest({url:f(i),data:{includeUnique:!!l},statusCode:{"*":function(){return false}}}).done(function(q){var p=h(m);if(q.failed||q.inProgress||q.successful){b=true;p.replaceWith(k({stats:q}));e.bindTo(n,"","click",function(){return i});if(o){o(p)}}else{p.remove()}});return j};c.showDialogIfHasBuildStatus=function(i){if(b){e.showFor(i)}}});; ;/* module-key = 'com.atlassian.stash.stash-build-integration:build-status-commit-list', location = '/static/commit-list/build-status-commit-list.js' */ define("build/status/commit-list",["aui","build/status/dialog","jquery","util/ajax","util/events","model/page-state"],function(l,o,d,j,n,k){var a=".build-status-commit-list-col",f=".commits-table thead .build-status-commit-list-col",m=".build-icon",c=new o(),i="changesetid",h="data-"+i;function g(){return l.contextPath()+"/rest/build-status/latest/commits/stats"}function e(r,q){var p=false;q.each(function(){var s=d(this),v=s.find(a),t=s.data(i),u=r[t];if(u){v.html(stash.build.status.summaryIcon({stats:u})).find(m).tooltip({gravity:"ne",html:false});p=true}});if(p){d(f).show()}}function b(p){return p.map(function(){return d(this).data(i)}).toArray()}c.bindTo(d(document),".build-status-commit-list-col .build-icon","click",function(p){return d(p).closest("["+h+"]").data(i)});n.on("stash.widget.commitsTable.contentAdded",function(q){if(!k.getCurrentUser()){return}var p=q.values;j.rest({url:g(),type:"POST",data:b(p),statusCode:{"*":function(){return false}}}).done(function(r){e(r,p)})})});require("build/status/commit-list");; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:person-model', location = '/static/model/person.js' */ define("model/person",["backbone-brace"],function(A){return A.Model.extend({namedAttributes:{emailAddress:"string",name:"string"},idAttribute:"name",initialize:function(){if(this.namedAttributes.id==null){this.setId(this.attributes[this.idAttribute])}}})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:stash-user-model', location = '/static/model/stash-user.js' */ define("model/stash-user",["model/person"],function(B){var A=B.extend({namedAttributes:{active:"boolean",avatarUrl:"string",displayName:"string",id:"number",isAdmin:"boolean",link:Object,links:Object,type:"string",slug:"string"}});return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:project-model', location = '/static/model/project.js' */ define("model/project",["backbone-brace","model/stash-user"],function(B,A){var C=B.Model.extend({namedAttributes:{id:"number",name:"string",key:"string",description:"string",type:"string",owner:A,avatarUrl:"string",link:Object,links:Object,"public":"boolean"},isEqual:function(D){return !!(D&&D instanceof C&&this.id===D.id)}},{projectType:{NORMAL:"NORMAL",PERSONAL:"PERSONAL"}});return C});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-model', location = '/static/model/repository.js' */ define("model/repository",["backbone-brace","model/project"],function(B,C){var A=B.Model.extend({namedAttributes:{id:"number",name:"string",slug:"string",project:C,"public":"boolean",scmId:"string",state:"string",statusMessage:"string",forkable:"boolean",cloneUrl:"string",link:Object,links:Object,origin:null},isEqual:function(D){return !!(D&&D instanceof A&&this.id===D.id)}});B.Mixins.applyMixin(A,{namedAttributes:{origin:A}});return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:revision-reference', location = '/static/model/revision-reference.js' */ define("model/revision-reference",["aui","backbone-brace","lodash","model/page-state","model/repository"],function(C,F,D,E,A){var B={TAG:{id:"tag",name:"Tag"},BRANCH:{id:"branch",name:"Branch"},COMMIT:{id:"commit",name:"Commit"},isTag:function(H){return H&&(H===B.TAG.id||H.id===B.TAG.id)},isBranch:function(H){return H&&(H===B.BRANCH.id||H.id===B.BRANCH.id)},isCommit:function(H){return H&&(H===B.COMMIT.id||H.id===B.COMMIT.id)},from:function(H){if(B.isTag(H)){return B.TAG}else{if(B.isBranch(H)){return B.BRANCH}else{if(B.isCommit(H)){return B.COMMIT}}}window.console&&console.error("Unknown RevisionReference type "+H);return null}};var G=F.Model.extend({namedAttributes:{id:"string",displayId:"string",type:B.from,isDefault:"boolean",latestChangeset:"string",latestCommit:"string",hash:"string",repository:A},initialize:function(){if(!this.getDisplayId()){this.setDisplayId(this.getId())}if(!this.getIsDefault()){this.setIsDefault(false)}if(!this.getRepository()){this.setRepository(E.getRepository())}},getTypeName:function(){return this.getType().name},isDefault:function(){return this.get("isDefault")||false},isTag:function(){return B.isTag(this.getType())},isBranch:function(){return B.isBranch(this.getType())},isCommit:function(){return B.isCommit(this.getType())},isEqual:function(H){return(H instanceof G)&&this.getId()===H.getId()&&this.getType().id===H.getType().id&&this.getRepository().isEqual(H.getRepository())}},{fromChangeset:function(H){return new G({id:H.id,displayId:H.displayId,type:B.COMMIT,isDefault:false})},hydrateRefFromId:function(N,M,K,L){if(!D.isString(N)){return null}var H=/^refs\/(heads|tags)\/(.+)/;var J=N.replace(H,"$2");if(!K){K=G.type.BRANCH;var I=N.match(H);if(I&&I[1]==="tags"){K=G.type.TAG}}return new G({id:N,displayId:J,type:K,isDefault:M,latestChangeset:L})},hydrateDeprecated:function(H){if(!H.__json){return new G(H.toJSON())}return new G(H.__json)}});G.type=B;return G});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:abbreviate-commit-message-util', location = '/static/util/abbreviate-commit-message.js' */ define("util/abbreviate-commit-message",[],function(){return function A(E,C){C=parseInt(C,10);var D="...";if(E.length<=C){return E}var B=E.indexOf("\n");if(B>0&&B<=C){return E.substring(0,B+D.length>C?C-D.length:B)+D}return E.substring(0,C-D.length)+D}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:lozenge-internal', location = '/static/widget/lozenge/lozenge.soy' */ // This file was automatically generated from lozenge.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.lozenge. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.lozenge == 'undefined') { stash.widget.lozenge = {}; } stash.widget.lozenge.lozenge = function(opt_data, opt_ignored) { var output = ''; var tag__soy3 = opt_data.href ? 'a' : opt_data.htmlElement ? opt_data.htmlElement : opt_data.clickable ? 'button' : 'span'; output += '<' + soy.$$escapeHtml(tag__soy3) + ' class="aui-lozenge' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + ((opt_data.monospace) ? ' monospace-lozenge' : '') + '"' + ((opt_data.href) ? ' href="' + soy.$$escapeHtml(opt_data.href) + '"' : '') + ((opt_data.tooltip) ? ' title="' + soy.$$escapeHtml(opt_data.tooltip) + '"' : '') + '>' + ((opt_data.maxLength) ? soy.$$escapeHtml(soy.$$truncate(opt_data.text, opt_data.maxLength, true)) : soy.$$escapeHtml(opt_data.text)) + '</' + soy.$$escapeHtml(tag__soy3) + '>'; return output; }; if (goog.DEBUG) { stash.widget.lozenge.lozenge.soyTemplateName = 'stash.widget.lozenge.lozenge'; } stash.widget.lozenge.htmlLozenge = function(opt_data, opt_ignored) { return '<' + ((opt_data.htmlElement) ? soy.$$escapeHtml(opt_data.htmlElement) : 'a') + ' class="aui-lozenge' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + ((opt_data.monospace) ? ' monospace-lozenge' : '') + '"' + ((opt_data.href) ? ' href="' + soy.$$escapeHtml(opt_data.href) + '"' : '') + ((opt_data.tooltip) ? ' title="' + soy.$$escapeHtml(opt_data.tooltip) + '"' : '') + ((opt_data.extraAttributes) ? aui.renderExtraAttributes(opt_data) : '') + '>' + soy.$$filterNoAutoescape(opt_data.content) + '</' + ((opt_data.htmlElement) ? soy.$$escapeHtml(opt_data.htmlElement) : 'a') + '>'; }; if (goog.DEBUG) { stash.widget.lozenge.htmlLozenge.soyTemplateName = 'stash.widget.lozenge.htmlLozenge'; } stash.widget.lozenge.merge = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '' + stash.widget.lozenge.lozenge({extraClasses: 'merge-lozenge' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : '') + (opt_data.abbreviated ? ' abbreviated' : ''), text: '' + soy.$$escapeHtml(opt_data.abbreviated ? "M" : "Merge"), tooltip: '' + soy.$$escapeHtml("This commit is a merge.")}); }; if (goog.DEBUG) { stash.widget.lozenge.merge.soyTemplateName = 'stash.widget.lozenge.merge'; } stash.widget.lozenge.pullRequestState = function(opt_data, opt_ignored) { var output = ''; var commonClasses__soy84 = opt_data.extraClasses ? opt_data.extraClasses + ' pull-request-state-lozenge' : ' pull-request-state-lozenge'; switch (opt_data.state) { case 'OPEN': output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-complete open' + commonClasses__soy84, text: "OPEN", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request is in progress.", clickable: opt_data.clickable, href: opt_data.href}); break; case 'OPENED': output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-complete opened' + commonClasses__soy84, text: opt_data.isActivityContext ? "opened" : "OPENED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request is in progress.", clickable: opt_data.clickable, href: opt_data.href}); break; case 'MERGED': output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-success merged' + commonClasses__soy84, text: opt_data.isActivityContext ? "merged" : "MERGED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been merged.", clickable: opt_data.clickable, href: opt_data.href}); break; case 'DECLINED': output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-error declined' + commonClasses__soy84, text: opt_data.isActivityContext ? "declined" : "DECLINED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been declined.", clickable: opt_data.clickable, href: opt_data.href}); break; case 'REOPENED': output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-complete reopened' + commonClasses__soy84, text: opt_data.isActivityContext ? "reopened" : "REOPENED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been reopened.", clickable: opt_data.clickable, href: opt_data.href}); break; case 'UPDATED': case 'RESCOPED': output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-current updated' + commonClasses__soy84, text: opt_data.isActivityContext ? "updated" : "UPDATED", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been updated.", clickable: opt_data.clickable, href: opt_data.href}); break; case 'APPROVED': output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-success approved' + commonClasses__soy84, text: opt_data.isActivityContext ? "approved" : "Approved", tooltip: opt_data.tooltip ? opt_data.tooltip : "This pull request has been approved.", clickable: opt_data.clickable, href: opt_data.href}); break; case 'UNAPPROVED': output += stash.widget.lozenge.lozenge({extraClasses: 'aui-lozenge-error unapproved' + commonClasses__soy84, text: opt_data.isActivityContext ? "unapproved" : "Unapproved", tooltip: opt_data.tooltip ? opt_data.tooltip : "The approval has been withdrawn from this pull request.", clickable: opt_data.clickable, href: opt_data.href}); break; } return output; }; if (goog.DEBUG) { stash.widget.lozenge.pullRequestState.soyTemplateName = 'stash.widget.lozenge.pullRequestState'; } stash.widget.lozenge.enabled = function(opt_data, opt_ignored) { return '' + stash.widget.lozenge.lozenge({extraClasses: opt_data.isEnabled ? 'lozenge-enabled' : 'lozenge-disabled', text: opt_data.isEnabled ? "Enabled" : "Disabled", tooltip: opt_data.tooltip}); }; if (goog.DEBUG) { stash.widget.lozenge.enabled.soyTemplateName = 'stash.widget.lozenge.enabled'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:changeset-link', location = '/static/feature/changeset/changeset-link/changeset-link.soy' */ // This file was automatically generated from changeset-link.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.changeset. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.changeset == 'undefined') { stash.feature.changeset = {}; } stash.feature.changeset.link = function(opt_data, opt_ignored) { return '<' + soy.$$escapeHtml(opt_data.repository ? 'a' : 'span') + ' class="changesetid" ' + ((opt_data.repository) ? 'href="' + soy.$$escapeHtml(require('stash/api/util/navbuilder').project(opt_data.repository.project).repo(opt_data.repository).changeset(opt_data.changeset.id).withParams(null).withFragment(opt_data.filePath).build()) + '"' : '') + ' ' + ((opt_data.showTooltip && opt_data.changeset.message) ? 'title="' + soy.$$escapeHtml(require('util/abbreviate-commit-message')(opt_data.changeset.message, 100)) + '"' : '') + ' data-changeset-id="' + soy.$$escapeHtml(opt_data.changeset.id) + '">' + soy.$$escapeHtml(opt_data.changeset.displayId) + '</' + soy.$$escapeHtml(opt_data.repository ? 'a' : 'span') + '>'; }; if (goog.DEBUG) { stash.feature.changeset.link.soyTemplateName = 'stash.feature.changeset.link'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:user-link', location = '/static/widget/user/user-link.soy' */ // This file was automatically generated from user-link.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.userLink = function(opt_data, opt_ignored) { var output = ''; var displayName__soy3 = opt_data.user.displayName || opt_data.user.name; output += (opt_data.href || opt_data.user.type == 'NORMAL' && opt_data.user.slug && !!(require('model/page-state').getCurrentUser())) ? '<a href="' + soy.$$escapeHtml(opt_data.href ? opt_data.href : require('stash/api/util/navbuilder').user(opt_data.user.slug).build()) + '" ' + ((opt_data.extraClasses) ? 'class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + ((! opt_data.skipTitle) ? 'title="' + soy.$$escapeHtml(displayName__soy3) + '"' : '') + '>' + soy.$$escapeHtml(soy.$$truncate(displayName__soy3, 100, true)) + '</a>' : '<span' + ((opt_data.extraClasses) ? ' class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + ((! opt_data.skipTitle) ? ' title="' + soy.$$escapeHtml(displayName__soy3) + '"' : '') + '>' + soy.$$escapeHtml(soy.$$truncate(displayName__soy3, 100, true)) + '</span>'; return output; }; if (goog.DEBUG) { stash.widget.userLink.soyTemplateName = 'stash.widget.userLink'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:avatar', location = '/static/widget/avatar/avatar.soy' */ // This file was automatically generated from avatar.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.avatar = function(opt_data, opt_ignored) { return '' + aui.avatar.avatar({size: opt_data.size, avatarImageUrl: require('stash/api/util/navbuilder')._avatarUrl(opt_data.person, ({XSMALL:32,SMALL:48,MEDIUM:64,LARGE:96,XLARGE:128,XXLARGE:192,XXXLARGE:256})[opt_data.size.toUpperCase()]).build(), accessibilityText: opt_data.person.displayName || opt_data.person.name, title: opt_data.tooltip, badgeContent: opt_data.badgeContent, extraClasses: 'user-avatar' + (opt_data.hideBadge ? ' badge-hidden' : '') + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), imageClasses: opt_data.imageClasses, extraAttributes: {'data-username': opt_data.person.name}, id: opt_data.id}); }; if (goog.DEBUG) { stash.widget.avatar.soyTemplateName = 'stash.widget.avatar'; } stash.widget.avatarWithName = function(opt_data, opt_ignored) { var output = ''; var personName__soy14 = opt_data.person.displayName || opt_data.person.name; output += '<div class="avatar-with-name' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '" title="' + soy.$$escapeHtml(personName__soy14) + '">' + stash.widget.avatar({size: opt_data.size, person: opt_data.person, imageClasses: opt_data.imageClasses, extraClasses: opt_data.avatarClasses, badgeContent: opt_data.badgeContent, hideBadge: opt_data.hideBadge, id: opt_data.id}) + ((opt_data.link) ? stash.widget.userLink({user: opt_data.person, href: opt_data.href, extraClasses: opt_data.linkExtraClasses, skipTitle: true}) : soy.$$escapeHtml(personName__soy14)) + '</div>'; return output; }; if (goog.DEBUG) { stash.widget.avatarWithName.soyTemplateName = 'stash.widget.avatarWithName'; } stash.widget.avatarWithNameAndEmail = function(opt_data, opt_ignored) { return stash.widget.avatarWithName(opt_data) + '<span class="email-address" title="' + soy.$$escapeHtml(opt_data.person.emailAddress) + '">' + soy.$$escapeHtml(opt_data.person.emailAddress) + '</span>'; }; if (goog.DEBUG) { stash.widget.avatarWithNameAndEmail.soyTemplateName = 'stash.widget.avatarWithNameAndEmail'; } stash.widget.avatarSizeInPx = function(opt_data, opt_ignored) { return '' + soy.$$escapeHtml(({XSMALL:32,SMALL:48,MEDIUM:64,LARGE:96,XLARGE:128,XXLARGE:192,XXXLARGE:256})[opt_data.size.toUpperCase()]) + ((opt_data.showPx) ? 'px' : ''); }; if (goog.DEBUG) { stash.widget.avatarSizeInPx.soyTemplateName = 'stash.widget.avatarSizeInPx'; } stash.widget.avatarWithBadge = function(opt_data, opt_ignored) { return '' + stash.widget.avatar({size: opt_data.size, person: opt_data.person, tooltip: opt_data.tooltip, imageClasses: opt_data.imageClasses, extraClasses: opt_data.extraClasses, id: opt_data.id, hideBadge: opt_data.hideBadge, badgeContent: '<span class="badge' + soy.$$escapeHtml(opt_data.badgeClasses ? ' ' + opt_data.badgeClasses : '') + '">' + soy.$$escapeHtml(opt_data.badgeText) + '</span>'}); }; if (goog.DEBUG) { stash.widget.avatarWithBadge.soyTemplateName = 'stash.widget.avatarWithBadge'; } stash.widget.avatarWithNameAndBadge = function(opt_data, opt_ignored) { return '' + stash.widget.avatarWithName({size: opt_data.size, person: opt_data.person, extraClasses: opt_data.extraClasses, avatarClasses: opt_data.avatarClasses, imageClasses: opt_data.imageClasses, id: opt_data.id, hideBadge: opt_data.hideBadge, badgeContent: '<span class="badge' + soy.$$escapeHtml(opt_data.badgeClasses ? ' ' + opt_data.badgeClasses : '') + '">' + soy.$$escapeHtml(opt_data.badgeText) + '</span>'}); }; if (goog.DEBUG) { stash.widget.avatarWithNameAndBadge.soyTemplateName = 'stash.widget.avatarWithNameAndBadge'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:avatar', location = '/static/widget/avatar/group-avatar.soy' */ // This file was automatically generated from group-avatar.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.groupAvatar = function(opt_data, opt_ignored) { return '<span class="aui-avatar aui-avatar-' + soy.$$escapeHtml(opt_data.size) + ' group-avatar' + soy.$$escapeHtml(opt_data.extraClasses ? ' ' + opt_data.extraClasses : '') + '" data-groupname="' + soy.$$escapeHtml(opt_data.name) + '"></span>'; }; if (goog.DEBUG) { stash.widget.groupAvatar.soyTemplateName = 'stash.widget.groupAvatar'; } stash.widget.groupAvatarWithName = function(opt_data, opt_ignored) { return '<span title="' + soy.$$escapeHtml(opt_data.name) + '"' + ((opt_data.extraClasses) ? ' class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + '><span class="aui-avatar aui-avatar-' + soy.$$escapeHtml(opt_data.size) + ' group-avatar' + soy.$$escapeHtml(opt_data.avatarClasses ? ' ' + opt_data.avatarClasses : '') + '" data-groupname="' + soy.$$escapeHtml(opt_data.name) + '"></span>' + soy.$$escapeHtml(opt_data.name) + '</span>'; }; if (goog.DEBUG) { stash.widget.groupAvatarWithName.soyTemplateName = 'stash.widget.groupAvatarWithName'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:loaded-range', location = '/static/widget/loaded-range.js' */ define("widget/loaded-range",function(){function A(B){this.start=undefined;this.nextPageStart=undefined;this._reachedStart=false;this._reachedEnd=false;this._reachedCapacity=false;this._capacity=B||Infinity}A.prototype.isEmpty=function(){return this.start===undefined};A.prototype.isBeforeStart=function(B){return B<this.start};A.prototype.isAfterNextPageStart=function(B){return B>this.nextPageStart};A.prototype.isLoaded=function(B){return !(this.isEmpty()||this.isBeforeStart(B)||this.isAfterNextPageStart(B))};A.prototype.getAttachmentMethod=function(C,B){return this.isEmpty()?"html":this.isBeforeStart(C)?"prepend":"append"};A.prototype.add=function(G,C,B,E){var F=this.isEmpty();E=E||(G+C);if(F||this.isBeforeStart(G)){this.start=G}if(F||this.isAfterNextPageStart(E)){this.nextPageStart=E}this._reachedStart=this._reachedStart||G<=0;var D=this._reachedEnd=this._reachedEnd||B;if(!D&&this.nextPageStart>=this._capacity){this._reachedCapacity=this._reachedEnd=true}return this};A.prototype.reachedStart=function(){return this._reachedStart};A.prototype.reachedEnd=function(){return this._reachedEnd};A.prototype.reachedCapacity=function(){return this._reachedCapacity};A.prototype.pageBefore=function(B){if(this.reachedStart()){return null}var C=Math.max(0,this.start-B);return{start:C,limit:this.start-C}};A.prototype.pageAfter=function(B){if(this.reachedEnd()){return null}return{start:this.nextPageStart,limit:B}};return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:paged-scrollable', location = '/static/widget/paged-scrollable.js' */ define("widget/paged-scrollable",["aui","jquery","lodash","util/events","util/function","util/navigator","widget/loaded-range"],function(H,C,I,J,E,F,B){var A=F.isIE();function G(L,K){this.options=C.extend({},G.defaults,K);this.$scrollElement=C(L||window);if(C.isWindow(this.$scrollElement[0])){var M=window.document.documentElement;this.getPaneHeight=function(){return M.clientHeight};this.getContentHeight=function(){return M.scrollHeight}}this._eventHandlers=[]}G.defaults={pageSize:50,scrollDelay:250,bufferPixels:0,precedingSpaceMaintained:true,suspendOnFailure:true,dataLoadedEvent:"stash.widget.pagedscrollable.dataLoaded",autoLoad:true,preventOverscroll:false,idForEntity:null};G.prototype.init=function(M){G.prototype.reset.call(this);M=M||{};this.loadedRange=M.loadedRange||new B();var L=this;var K=this.options.pageSize;var N=M.targetedItem?Math.floor(M.targetedItem/K)*K:0;if(M.suspended){this.suspend()}if(this.loadedRange.isLoaded(N)){return(this.loadIfRequired()||C.Deferred().resolve()).done(function(){L.onFirstDataLoaded()})}return D(this,N,K).then(undefined,function(){var O=N!==0;if(O){return D(L,0,K)}else{return C.Deferred().rejectWith(this,arguments)}}).fail(function(R,Q,O,P){if(P&&P.errors&&P.errors.length){L.handleErrors(P.errors)}})};G.prototype.reset=function(){if(this.currentXHR){this.cancelRequest()}this.clearListeners();if(this._resizeHandler){C(window).off("resize",this._resizeHandler);this._resizeHandler=null}if(this.options.idForEntity){this._ids={}}this._suspended=false};G.prototype.destroy=function(){this.reset();delete this.$scrollElement};G.prototype.suspend=function(){this._suspended=true};G.prototype.resume=function(){this._suspended=false;return this.loadIfRequired()};G.prototype.isSuspended=function(){return this._suspended};G.prototype.getScrollTop=function(){return this.$scrollElement.scrollTop()};G.prototype.setScrollTop=function(K){this.$scrollElement.scrollTop(K)};G.prototype.getPane=function(){return this.$scrollElement};G.prototype.getPaneHeight=function(){return this.$scrollElement[0].clientHeight};G.prototype.getContentHeight=function(){return this.$scrollElement[0].scrollHeight};G.prototype.getOption=function(K){if(Object.prototype.hasOwnProperty.call(this.options,K)){return this.options[K]}return undefined};G.prototype.setOptions=function(K){if(C.isPlainObject(K)){this.options=C.extend(this.options,K)}};G.prototype.addScrollListener=function(L){var K=this.scrollDelay?I.debounce(L,this.scrollDelay):L;this._eventHandlers.push(K);this.$scrollElement.on("scroll.paged-scrollable",K)};G.prototype._bindOverscrollPrevention=function(){function K(N,O){var L=C(this).outerHeight();var M=this.scrollHeight;if((this.scrollTop===(M-L)&&O<0)||(this.scrollTop===0&&O>0)){N.preventDefault()}}this._eventHandlers.push(K);this.$scrollElement.on("mousewheel.paged-scrollable",K)};G.prototype.clearListeners=function(){var K=this;I.each(this._eventHandlers,function(L){K.$scrollElement.unbind(".paged-scrollable",L)});this._eventHandlers.length=0};G.prototype.loadIfRequired=function(){if(this.isSuspended()||(this.loadedRange.reachedEnd()&&this.loadedRange.reachedStart())){return }var P=this.getScrollTop(),L=this.getPaneHeight(),N=this.getContentHeight(),O=L+P;if(!C.isWindow(this.getPane()[0])&&this.getPane().is(":hidden")){return }if(I.any([true,"previous"],E.eq(this.options.autoLoad))&&P<this.options.bufferPixels+(this.loadedRange.start/this.loadedRange.nextPageStart)*N){var K=this.loadedRange.pageBefore(this.options.pageSize);if(K){return this.load(K.start,K.limit)}}var Q=1;if(I.any([true,"next"],E.eq(this.options.autoLoad))&&O+Q>=N-this.options.bufferPixels){var M=this.loadedRange.pageAfter(this.options.pageSize);if(M){return this.load(M.start,M.limit)}}};function D(L,M,K){if(L.currentXHR){return C.Deferred().reject()}L.currentXHR=L.requestData(M,K);return L.currentXHR.always(function(){L.currentXHR=null}).done(function(N){L.onDataLoaded(M,K,N)}).fail(function(){L.suspend()})}G.prototype.load=function(M,K){var L=this;return D(this,M,K).fail(function(Q,P,N,O){if(O&&O.errors){L.handleErrors(O.errors)}})};G.prototype.loadAfter=function(){var K=this.loadedRange.pageAfter(this.options.pageSize);return K&&this.load(K.start,K.limit)};G.prototype.loadBefore=function(){var K=this.loadedRange.pageBefore(this.options.pageSize);return K&&this.load(K.start,K.limit)};G.prototype.onDataLoaded=function(M,N,P){if(P.start!==undefined){M=P.start}var R=this.loadedRange.isEmpty(),K=this.loadedRange.getAttachmentMethod(M,P.size),Q=K==="prepend";this.loadedRange.add(M,P.size,P.isLastPage,P.nextPageStart);var S,O;if(Q||A){O=this.getScrollTop();S=this.getContentHeight()}P=this._addPage(P,K);if(Q||A){var L=Q?this.getContentHeight()-S:0;this.setScrollTop(O+L)}if(R){this.onFirstDataLoaded(M,N,P)}J.trigger(this.options.dataLoadedEvent,this,M,N,P);this.loadIfRequired()};G.prototype._addPage=function(L,K){L=this._dedupe(L);this.attachNewContent(L,K);return L};G.prototype._dedupe=function(M){if(M&&M.values&&this.options.idForEntity){var L=this._ids;var K=this.options.idForEntity;M=C.extend({},M,{values:I.filter(M.values,function(N){var O=K(N);if(!I.has(L,O)){L[O]=true;return true}return false})})}return M};G.prototype.onFirstDataLoaded=function(){var K=this;this.addScrollListener(function(){K.loadIfRequired()});if(this.options.preventOverscroll){this._bindOverscrollPrevention()}C(window).on("resize",this._resizeHandler=function(){K.loadIfRequired()})};G.prototype.cancelRequest=function(){if(this.currentXHR){if(this.currentXHR.abort){this.currentXHR.abort()}else{if(this.currentXHR.reject){this.currentXHR.reject()}else{H.log("Couldn't cancel the current request.")}}this.currentXHR=null}};G.prototype.add=function(L,K){if(L.length){L=this._addPage({values:L,size:L.length},K||"prepend");return true}return false};G.prototype.remove=function(K){if(this.options.idForEntity){var L=this.options.idForEntity(K);if(I.has(this._ids,L)){delete this._ids[L];if(typeof this.loadedRange.nextPageStart==="number"){this.loadedRange.nextPageStart=Math.max(0,this.loadedRange.nextPageStart-1)}return true}}return false};G.prototype.attachNewContent=function(L,K){throw new Error("attachNewContent is abstract and must be implemented.")};G.prototype.requestData=function(L,K){throw new Error("requestData is abstract and must be implemented. It must return a promise. It is preferred to return a jqXHR.")};G.prototype.handleErrors=function(K){throw new Error("handleErrors is abstract and must be implemented.")};return G});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:paged-table', location = '/static/widget/paged-table/paged-table.js' */ define("widget/paged-table",["aui","jquery","lodash","util/ajax","widget/error-dialog","widget/paged-scrollable"],function(B,F,C,E,A,G){function D(H){H=F.extend(true,{},D.defaults,H);G.call(this,H.scrollPane,H);this.$table=F(H.target);if(H.filterable){this.$filter=H.filter?F(H.filter):this.$table.prev(".paged-table-filter").find(".paged-table-filter-input");this._currentFilterText=F.trim(this.$filter.val());var I=C.debounce(C.bind(this._onFilterChanged,this),H.filterDebounce);this.$filter.on("keyup.paged-table-filter",function(J){if(J.which===B.keyCode.ESCAPE){F(this).blur()}else{I(J)}}).on("paste.paged-table-filter",I)}this.$spinner=F("<div class='spinner'/>").hide().insertAfter(this.$table);this.spinnerShowing=false;this.processedDomData=(this.$table.attr("data-lastpage")==null)}D.defaults={ajaxDataType:"json",spinnerSize:"large",filterable:false,bufferPixels:150,filterDebounce:350,rowSelector:"> tbody > tr",focusOptions:{escToCancel:false,focusedClass:"focused",rowSelector:"> tbody > tr",wrapAround:false}};F.extend(D.prototype,G.prototype);D.prototype.init=function(){return G.prototype.init.apply(this,arguments).done(C.bind(function(){if(this.shortcutsInitialised){this.focusInitialRow()}},this))};D.prototype.getFilterText=function(){return this._currentFilterText};D.prototype._onFilterChanged=function(){var H=F.trim(this.$filter.val());if(this._currentFilterText!==H){this._currentFilterText=H;this.update()}};D.prototype.requestData=function(J,H){if(!this.processedDomData){return F.Deferred().resolve(this.createDataFromJQuery(J,H,this.$table))}var I=this;I.spinnerShowing=true;I.$spinner.show().spin(I.options.spinnerSize,{zIndex:10});return I.performAjax(J,H).always(function(){I._hideSpinnerTimeout=setTimeout(function(){I.spinnerShowing&&I.$spinner.spinStop().hide();I.spinnerShowing=false},0)})};D.prototype.performAjax=function(J,H){var I=this;return E.ajax({url:I.buildUrl(J,H,I.getFilterText()),dataType:I.options.ajaxDataType,statusCode:I.options.statusCode})};D.prototype.cancelRequest=function(){G.prototype.cancelRequest.call(this);if(this._hideSpinnerTimeout){clearTimeout(this._hideSpinnerTimeout)}};D.prototype.reset=function(){G.prototype.reset.call(this);if(this.processedDomData){this.$table.find(this.options.rowSelector).remove().end().next(".paged-table-message").remove().end()}this.$table.addClass("no-rows")};D.prototype.update=function(H){this.reset();return this.init(H)};D.prototype.createDataFromJQuery=function(N,H,K){var J=K.find(this.options.rowSelector);var I=K.attr("data-lastpage")==="true";var M=K.attr("data-nextpagestart");var L={start:Number(K.attr("data-start")),size:Number(K.attr("data-size")),values:J,isLastPage:I};if(M!=null){L.nextPageStart=Number(M)}return L};D.prototype.attachNewContent=function(I,H){if(I.size){if(this.processedDomData){if(I&&I.errors){this.handleErrors(I.errors);return }this.handleNewRows(I,H)}if(I.start>0&&I.isLastPage){this.handleLastPage()}this.$table.removeClass("no-rows")}else{if(I.isLastPage){this.handleNoData()}}this.updateTimestamp();this.processedDomData=true};D.prototype.updateTimestamp=function(){this.$table.attr("data-last-updated",new Date().getTime())};D.prototype.focusInitialRow=function(){this.$table.find(this.options.focusOptions.rowSelector).first().addClass(this.options.focusOptions.focusedClass)};D.prototype.initShortcuts=function(){this.shortcutsInitialised=true;this.focusInitialRow();return{destroy:C.bind(this.resetShortcuts,this)}};D.prototype.resetShortcuts=function(){this.shortcutsInitialised=false};D.prototype._new$Message=function(H){return F('<div class="paged-table-message"/>').addClass(this.options.tableMessageClass).html(H||"")};D.prototype.handleLastPage=function(){this.$table.after(this._new$Message(this.options.allFetchedMessageHtml))};D.prototype.handleNoData=function(){var I=this.getFilterText();var H=I&&I.length?this.options.noneMatchingMessageHtml:this.options.noneFoundMessageHtml;this.$table.addClass("no-rows").after(this._new$Message(H))};D.prototype.handleErrors=function(H){new A({panelContent:"<p>"+B.escapeHtml(H[0].message)+"</p>"}).show()};D.prototype.buildUrl=function(J,H,I){throw new Error("buildUrl is abstract and must be implemented.")};D.prototype.handleNewRows=function(I,H){throw new Error("handleNewRows is abstract and must be implemented.")};return D});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:paged-table', location = '/static/widget/paged-table/paged-table.soy' */ // This file was automatically generated from paged-table.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.pagedTable = function(opt_data, opt_ignored) { var output = '' + ((opt_data.filterable) ? stash.widget.pagedTableFilter({forId: opt_data.id, filter: opt_data.filter, filterPlaceholder: opt_data.filterPlaceholder}) : ''); var pageAttributes__soy9 = opt_data.page ? atl_soy.concat({start: opt_data.page.start, size: opt_data.page.size, lastpage: opt_data.page.isLastPage}, opt_data.page.nextPageRequest ? {nextpagestart: opt_data.page.nextPageRequest.start} : {}) : {}; output += widget.aui.table({id: opt_data.id, dataAttributes: atl_soy.concat(pageAttributes__soy9, opt_data.extraDataAttributes ? opt_data.extraDataAttributes : {}), extraClasses: 'paged-table' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + ((! opt_data.page || opt_data.page.size == 0) ? ' no-rows' : ''), theadContent: opt_data.theadContent, content: opt_data.content}) + ((opt_data.page && opt_data.page.size == 0) ? stash.widget.pagedTableMessage({content: opt_data.filterable && opt_data.filter ? (opt_data.noneMatchingMessageContent ? opt_data.noneMatchingMessageContent : '') : opt_data.noneFoundMessageContent ? opt_data.noneFoundMessageContent : ''}) : ''); return output; }; if (goog.DEBUG) { stash.widget.pagedTable.soyTemplateName = 'stash.widget.pagedTable'; } stash.widget.pagedTableMessage = function(opt_data, opt_ignored) { return '<div class="paged-table-message">' + soy.$$filterNoAutoescape(opt_data.content) + '</div>'; }; if (goog.DEBUG) { stash.widget.pagedTableMessage.soyTemplateName = 'stash.widget.pagedTableMessage'; } stash.widget.pagedTableFilter = function(opt_data, opt_ignored) { return '' + aui.group.group({extraClasses: 'paged-table-filter', content: '' + aui.group.item({content: '' + stash.widget.pagedTableFilterField(opt_data)})}); }; if (goog.DEBUG) { stash.widget.pagedTableFilter.soyTemplateName = 'stash.widget.pagedTableFilter'; } stash.widget.pagedTableFilterField = function(opt_data, opt_ignored) { return '<label class="assistive" for="paged-table-input-for-' + soy.$$escapeHtml(opt_data.forId) + '">' + soy.$$escapeHtml(opt_data.filterPlaceholder ? opt_data.filterPlaceholder : "Search") + '</label><input type="text" id="paged-table-input-for-' + soy.$$escapeHtml(opt_data.forId) + '" class="paged-table-filter-input" data-for="' + soy.$$escapeHtml(opt_data.forId) + '" autocomplete="off" placeholder="' + soy.$$escapeHtml(opt_data.filterPlaceholder ? opt_data.filterPlaceholder : "Search") + '" value="' + soy.$$escapeHtml(opt_data.filter ? opt_data.filter : '') + '">'; }; if (goog.DEBUG) { stash.widget.pagedTableFilterField.soyTemplateName = 'stash.widget.pagedTableFilterField'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:submit-spinner', location = '/static/widget/submit-spinner/submit-spinner.js' */ define("widget/submit-spinner",["jquery"],function(B){function A(D,C){if(!(this instanceof A)){return new A(D)}this.$button=B(D);this.$spinner=B('<div class="submit-spinner invisible" />');if(C==="before"){this.$spinner.insertBefore(this.$button)}else{this.$spinner.insertAfter(this.$button)}}A.prototype.show=function(){this.$spinner.removeClass("invisible");this.$spinner.spin();return this};A.prototype.hide=function(){this.$spinner.addClass("invisible");this.$spinner.spinStop();return this};A.prototype.remove=function(){this.$spinner.remove();return this};return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:confirm-dialog', location = '/static/widget/confirm-dialog.js' */ define("widget/confirm-dialog",["aui","jquery","lodash","util/ajax","widget/submit-spinner"],function(B,F,C,E,D){function A(H,G){this.dialogOptions=F.extend({},A.dialogDefaults,H);this.ajaxOptions=G||{};this._selectors=[];this._okCallbacks=F.Callbacks();this._cancelCallback=F.Callbacks();this._detachers=F.Callbacks();this._attached=false}A.prototype.getConfirmButton=function(){return F("#"+this.dialogOptions.id+" ."+this.dialogOptions.confirmButtonClass)};A.prototype.getButtons=function(){var H=this.getConfirmButton(),G=this.dialogOptions.id;C.each(this._selectors,function(I){H=H.add(F("#"+G+" "+I))});return H};A.prototype.setButtonsDisabled=function(G){this.getButtons().each(function(){var H=F(this);H.prop("disabled",G).toggleClass("disabled",G);if(G){H.attr("aria-disabled","true")}else{H.removeAttr("aria-disabled")}})};A.prototype.destroy=function(){this._detachers.fire();this._detachers=null};A.prototype.attachTo=function(G,N,H){var Q=this,I=this.dialogOptions,K=this.ajaxOptions,L=this._okCallbacks,J=this._cancelCallback;H=H||document;var P=F(H);this._selectors.push(G);var O=function(){Q.setButtonsDisabled(false)};P.on("hideLayer",O);var M=function(U){U.preventDefault();var S=F(this);if(!S.is(":disabled")){var R=function(V){Q.setButtonsDisabled(false);V.remove()},T=new B.Dialog({width:I.width,height:I.height,id:I.id,focusSelector:I.focusSelector,closeOnOutsideClick:false,keypressListener:function(V){V.stopImmediatePropagation();if(V.keyCode===B.keyCode.ENTER){V.preventDefault();Q.getConfirmButton().click()}else{if(V.keyCode===B.keyCode.ESCAPE){V.preventDefault();R(T)}}}});T.addHeader(I.titleText,I.titleClass);T.addPanel("",I.panelContent,I.panelClass);T.addButton(I.submitText,function(V){Q.setButtonsDisabled(true);var X=null;var W=new D(Q.getConfirmButton(),"before");if(Q.dialogOptions.submitToHref){W.show();if(S[0].tagName==="A"){X=E.rest(F.extend({url:S.attr("href")},K)).always(function(){W.hide();R(V)})}else{S.closest("form")[0].submit()}}L.fire(X,S,function(){R(V)},V,W)},"button "+(I.confirmButtonClass||""));T.addCancel("Cancel",function(V){R(V);J.fire(S)});if(N){N(this,T,Q)}T.show();Q._attached=true}};P.on("click",G,M);this._detachers.add(function(){P.off("hideLayer",O);P.off("click",G,M)})};A.prototype.addConfirmListener=function(G){this._okCallbacks.add(G)};A.prototype.addCancelListener=function(G){this._cancelCallback.add(G)};A.dialogDefaults={id:undefined,titleText:"Confirm",titleClass:"confirm-header",confirmButtonClass:"confirm-button",panelContent:"<p>"+"Are you sure you want to do that?"+"</p>",panelClass:"panel-body",submitText:"Confirm",submitToHref:true,height:230,width:433,focusSelector:".confirm-button"};return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:performance-util', location = '/static/util/performance.js' */ define("util/performance",["jquery"],function(D){function F(I,L){var G=new D.Callbacks();var H=false;var J=null;function K(){J=null;H=true;G.fire();G=new D.Callbacks();H=false;L()}return{name:I,forceExecute:function(){if(J){clearTimeout(J);K()}},queue:function(M){if(H){M()}else{G.add(M);if(!J){J=setTimeout(K,0)}}}}}var A=F("READ",function(){C.forceExecute()});var C=F("WRITE",function(){A.forceExecute()});function B(G,J,I){I=I||1;var K=0;return function H(){if(K>=I){return }K++;G(function L(){try{return J.apply(this,arguments)}finally{K--}})}}function E(I,G,H){G=D.extend({initial:500,min:10,max:Infinity},G);H=H||function(K){K()};function J(K){return Math.min(G.max,Math.max(G.min,K))}return function(K){var P=G.initial;var M=D.Deferred();var O=0;var N=[];function Q(){for(var R=Math.min(O+P,K.length);O<R;O++){N[O]=I(K[O])}}requestAnimationFrame(function L(){if(M.state()!=="pending"){return }var T=new Date().getTime();H(Q);var R=new Date().getTime();var S=R-T;P=J(Math.ceil(P*(15/S)));if(O===K.length){M.resolve(N)}else{requestAnimationFrame(L)}});return M}}return{queueDOMRead:A.queue.bind(A),queueDOMWrite:C.queue.bind(C),enqueueCapped:B,frameBatchedMap:E}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:client-storage', location = '/static/util/client-storage.js' */ define("util/client-storage",["jquery","lodash","util/feature-detect","model/page-state","exports"],function(F,Y,P,M,Z){var U={SESSION:"session",LOCAL:"local"};var O="_flash.";var L="_",R="lastCleanup",I="hasCheckedCleanUp",T=1000*60*60*24*30;var W={};Z._resetDummy=function(){W={}};function A(b,a){if(Y.isString(b)){b=[b]}if(!Y.isArray(b)){throw new Error("keyBuilder requires an array of components")}if(a){b.push(a);switch(a){case"pull-request":b.push(M.getPullRequest()&&M.getPullRequest().getId());case"repo":b.push(M.getRepository()&&M.getRepository().getSlug());case"project":b.push(M.getProject()&&M.getProject().getKey());case"user":b.push(M.getCurrentUser()&&M.getCurrentUser().getName());break}}return b.join(L)}function Q(b,c){var e,d;if(P.localStorage()){e=window[(c||U.LOCAL)+"Storage"].getItem(b)}else{e=Y.has(W,b)?W[b]:null}try{d=JSON.parse(e)}catch(a){d=e}return d}function K(a,b){var c=Q(a,b);return F.isPlainObject(c)&&Y.has(c,"data")?c.data:c}function N(a){return K(a,U.SESSION)}function H(a){var b=K(O+a,U.SESSION);G(a);return b}function D(a,c,b){if(P.localStorage()){window[(b||U.LOCAL)+"Storage"].setItem(a,JSON.stringify(c))}else{W[a]=JSON.stringify(c)}}function C(a,e,d,b){var c=Y.extend({},d,{timestamp:new Date().getTime(),data:e});D(a,c,b);if(!b||b===U.LOCAL){Y.defer(J)}}function B(a,c,b){C.call(this,a,c,b,U.SESSION)}function S(a,c,b){C.call(this,O+a,c,b,U.SESSION)}function V(a,b){if(P.localStorage()){window[(b||U.LOCAL)+"Storage"].removeItem(a)}else{delete W[a]}}function E(a){V(a,U.SESSION)}function G(a){V(O+a,U.SESSION)}function J(){if(!!Q(I,U.SESSION)){return }var a=Q(R);if(!a||new Date().getTime()-a>T){X()}D(I,true,U.SESSION)}function X(){var a=new Date().getTime();Y.each(Y.keys(localStorage),function(b){if(b!==R){var c=Q(b);if(c&&c.timestamp&&!c.noCleanup&&(a-c.timestamp>T)){V(b)}}});D(R,new Date().getTime())}Z.LOCAL=U.LOCAL;Z.SESSION=U.SESSION;Z.buildKey=A;Z.getItem=K;Z.getFlashItem=H;Z.getSessionItem=N;Z.setItem=C;Z.setFlashItem=S;Z.setSessionItem=B;Z.removeItem=V;Z.removeFlashItem=G;Z.removeSessionItem=E});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:imagesloaded', location = '/static/bower/imagesloaded/jquery.imagesloaded.js' */ /* * jQuery imagesLoaded plugin v2.1.2 * http://github.com/desandro/imagesloaded * * MIT License. by Paul Irish et al. */ (function(A,B){var C="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";A.fn.imagesLoaded=function(L){var I=this,N=A.isFunction(A.Deferred)?A.Deferred():0,M=A.isFunction(N.notify),F=I.find("img").add(I.filter("img")),G=[],K=[],H=[];if(A.isPlainObject(L)){A.each(L,function(O,P){if(O==="callback"){L=P}else{if(N){N[O](P)}}})}function J(){var O=A(K),P=A(H);if(N){if(H.length){N.reject(F,O,P)}else{N.resolve(F)}}if(A.isFunction(L)){L.call(I,F,O,P)}}function E(O){D(O.target,O.type==="error")}function D(O,P){if(O.src===C||A.inArray(O,G)!==-1){return }G.push(O);if(P){H.push(O)}else{K.push(O)}A.data(O,"imagesLoaded",{isBroken:P,src:O.src});if(M){N.notifyWith(A(O),[P,F,A(K),A(H)])}if(F.length===G.length){setTimeout(J);F.unbind(".imagesLoaded",E)}}if(!F.length){J()}else{F.bind("load.imagesLoaded error.imagesLoaded",E).each(function(O,Q){var R=Q.src;var P=A.data(Q,"imagesLoaded");if(P&&P.src===R){D(Q,P.isBroken);return }if(Q.complete&&Q.naturalWidth!==B){D(Q,Q.naturalWidth===0||Q.naturalHeight===0);return }if(Q.readyState||Q.complete){Q.src=C;Q.src=R}})}return N?N.promise(I):I}})(jQuery);; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:imagesloaded', location = '/static/lib/imagesloaded-AMD.js' */ define("imagesloaded",function(){});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:scroll', location = '/static/util/scroll.js' */ define("util/scroll",["jquery","lodash","util/feature-detect","exports"],function(G,E,B,D){var H={waitForImages:false,cancelIfScrolled:false,duration:400,getScrollPadding:function(){return document.documentElement.clientHeight/4}};function A(I,K,J){G("html, body").animate({scrollTop:Math.max(0,I-K)},J)}function C(K,J){var L=G.extend({},H,J);var M=false;if(L.cancelIfScrolled){G(document).one("scroll",function(){M=true})}function I(){if(!M){var N=K.offset();if(N){A(N.top,L.getScrollPadding(),L.duration)}}}if(L.waitForImages){G(document).imagesLoaded(I)}else{I()}}function F(N,M){var K=B.cssTransform();var J={left:0,top:0};var O=-1;if(M&&M.withDocument===true){O=1}function L(Q,P){J.left=(Q==null?J.left:Q);J.top=(P==null?J.top:P);return(J.left===0&&J.top===0)?null:J}var I;switch(K){case"msTransform":I=function(P){N.style[K]=P===null?"":"translate("+(Math.round(P.left)*O)+"px, "+(Math.round(P.top)*O)+"px)"};break;case undefined:I=function(P){N.style.left=P===null?"":(Math.round(P.left)*O);N.style.top=P===null?"":(Math.round(P.top)*O)};break;default:I=function(P){N.style[K]=P===null?"":"translate3d("+(Math.round(P.left)*O)+"px, "+(Math.round(P.top)*O)+"px, 0)"}}return E.compose(I,L)}D.scrollTo=C;D.fakeScroll=F});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-view-segment-types', location = '/static/feature/file-content/diff-view-segment-types.js' */ define("feature/file-content/diff-view-segment-types",[],function(){return{ADDED:"ADDED",REMOVED:"REMOVED",CONTEXT:"CONTEXT"}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-view-file-types', location = '/static/feature/file-content/diff-view-file-types.js' */ define("feature/file-content/diff-view-file-types",[],function(){return{FROM:"FROM",TO:"TO"}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:expanding-textarea', location = '/static/bower/ExpandingTextareas/expanding.js' */ (function(A){if(typeof define==="function"&&define.amd){define(["jquery"],A)}else{A(jQuery)}}(function(E){E.expandingTextarea=E.extend({autoInitialize:true,initialSelector:"textarea.expanding",opts:{resize:function(){}}},E.expandingTextarea||{});var D=["lineHeight","textDecoration","letterSpacing","fontSize","fontFamily","fontStyle","fontWeight","textTransform","textAlign","direction","wordSpacing","fontSizeAdjust","wordWrap","word-break","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","boxSizing","webkitBoxSizing","mozBoxSizing","msBoxSizing"];var C={position:"absolute",height:"100%",resize:"none"};var F={visibility:"hidden",border:"0 solid",whiteSpace:"pre-wrap"};var B={position:"relative"};function A(){E(this).closest(".expandingText").find("div").text(this.value.replace(/\r\n/g,"\n")+" ");E(this).trigger("resize.expanding")}E.fn.expandingTextarea=function(H){var G=E.extend({},E.expandingTextarea.opts,H);if(H==="resize"){return this.trigger("input.expanding")}if(H==="destroy"){this.filter(".expanding-init").each(function(){var J=E(this).removeClass("expanding-init");var I=J.closest(".expandingText");I.before(J).remove();J.attr("style",J.data("expanding-styles")||"").removeData("expanding-styles")});return this}this.filter("textarea").not(".expanding-init").addClass("expanding-init").each(function(){var J=E(this);J.wrap("<div class='expandingText'></div>");J.after("<pre class='textareaClone'><div></div></pre>");var I=J.parent().css(B);var K=I.find("pre").css(F);J.data("expanding-styles",J.attr("style"));J.css(C);E.each(D,function(L,M){var N=J.css(M);if(K.css(M)!==N){K.css(M,N)}});J.bind("input.expanding propertychange.expanding keyup.expanding",A);A.apply(this);if(G.resize){J.bind("resize.expanding",G.resize)}});return this};E(function(){if(E.expandingTextarea.autoInitialize){E(E.expandingTextarea.initialSelector).expandingTextarea()}})}));; ;/* module-key = 'com.atlassian.auiplugin:aui-experimental-data-handlers', location = 'js/experimental-autocomplete/progressive-data-set.js' */ AJS.ProgressiveDataSet=Backbone.Collection.extend({initialize:function(B,A){A||(A={});if(A.matcher){this.matcher=A.matcher}if(A.model){this.model=A.model}this._idAttribute=(new this.model()).idAttribute;this._maxResults=A.maxResults||5;this._queryData=A.queryData||{};this._queryParamKey=A.queryParamKey||"q";this._queryEndpoint=A.queryEndpoint||"";this.value=null;this.queryCache={};this.activeQueryCount=0;_.bindAll(this,"query","respond")},url:function(){return this._queryEndpoint},query:function(C){var B,A;this.value=C;A=this.getFilteredResults(C);this.respond(C,A);if(!C||!this._queryEndpoint||this.hasQueryCache(C)||!this.shouldGetMoreResults(A)){return }B=this.fetch(C);this.activeQueryCount++;this.trigger("activity",{activity:true});B.always(_.bind(function(){this.activeQueryCount--;this.trigger("activity",{activity:!!this.activeQueryCount})},this));B.done(_.bind(function(F,D,E){this.addQueryCache(C,F,E)},this));B.done(_.bind(function(){C=this.value;A=this.getFilteredResults(C);this.respond(C,A)},this))},getQueryData:function(B){var C=_.isFunction(this._queryData)?this._queryData(B):this._queryData;var A=_.extend({},C);A[this._queryParamKey]=B;return A},fetch:function(C){var B=this.getQueryData(C);var D={add:true,update:true,remove:false,data:B};var A=Backbone.Collection.prototype.fetch.call(this,D);return A},respond:function(B,A){this.trigger("respond",{query:B,results:A});return A},matcher:function(A,B){},getFilteredResults:function(B){var A=[];if(!B){return A}A=this.filter(function(C){return !!this.matcher(C,B)},this);if(this._maxResults){A=_.first(A,this._maxResults)}return A},addQueryCache:function(D,B,E){var A=this.queryCache;var C=this.parse(B,E);A[D]=_.pluck(C,this._idAttribute)},hasQueryCache:function(A){return this.queryCache.hasOwnProperty(A)},findQueryCache:function(A){return this.queryCache[A]},shouldGetMoreResults:function(A){return A.length<this._maxResults},setMaxResults:function(A){this._maxResults=A;this.value&&this.respond(this.value,this.getFilteredResults(this.value))}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:ajs-progressive-dataset', location = '/static/lib/AJS.progressive-dataset-AMD.js' */ define("aui/progressive-dataset",["aui"],function(A){return A.ProgressiveDataSet});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:autocomplete-dialog', location = '/static/widget/autocomplete-dialog/autocomplete-dialog.js' */ define("widget/autocomplete-dialog",["backbone","jquery","lodash"],function(C,B,A){return C.View.extend({className:"aui-dropdown2 aui-style-default aui-dropdown2-tailed",initialize:function(){var D=parseInt(this.options.minZIndex,10);if(D){this.$el.css("z-index",D+1)}B(document.body).append(this.el);if(this.options.anchor){this.updateAnchorPosition(this.options.anchor)}this.template=this.options.template||B.noop;this.highlighter=this.options.highlighter;this.collection=this.collection||new C.Collection();this.collection.bind("reset",this.render,this);this.render()},events:{"click li.result":"onClickItem"},render:function(){var F=this.collection.toJSON(),G=this.collection.query,E=this.collection.indexOf(this.selectedResult);var D=B(this.template({query:G,results:F,activeItemIndex:(E>=0)?E:0}));if(G&&F.length&&A.isFunction(this.highlighter)){D=this.highlighter(D,G)}this.$el.html(D);if(this.$spinner){this.$spinner.appendTo(this.$("ul"))}return this},toggleSpinner:function(D){if(D){if(!this.$spinner){this.$spinner=B("<li/>").addClass("spinContainer").appendTo(this.$("ul")).spin("small")}}else{this.$spinner&&this.$spinner.spinStop().remove();this.$spinner=null}},moveSelectionUp:function(){this.moveSelection(this.DIRECTION_UP)},moveSelectionDown:function(){this.moveSelection(this.DIRECTION_DOWN)},moveSelection:function(G){var H=this.$("li");if(H.length<=1){return }var F=H.filter(".active"),D=B.inArray(F.get(0),H),E="active";if((G===this.DIRECTION_DOWN)?(D<H.length-1):(D>0)){D=D+G;H.removeClass(E).eq(D).addClass(E);this.selectedResult=this.collection.at(D)}},getSelectedItemIndex:function(){return this.$("li.active").index()},onClickItem:function(D){this.trigger("itemSelected",this.$(D.currentTarget).index())},anchorOptions:{dropdownTailBufferLeft:25,dropdownTailBufferRight:35,viewportWidth:B(window).width(),bufferTop:2},updateAnchorPosition:function(D){if(this.anchorOptions.viewportWidth-D.left>this.$el.outerWidth()){this.$el.css({top:D.top+this.anchorOptions.bufferTop,left:D.left-this.anchorOptions.dropdownTailBufferLeft}).attr("data-dropdown2-alignment","left")}else{this.$el.css({top:D.top+this.anchorOptions.bufferTop,left:D.left-this.$el.outerWidth()+this.anchorOptions.dropdownTailBufferRight}).attr("data-dropdown2-alignment","right")}},DIRECTION_UP:-1,DIRECTION_DOWN:1})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:textarea-caret-position', location = '/static/bower/textarea-caret-position/index.js' */ define("textarea-caret-position",function(){var B=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"];var C=!(window.mozInnerScreenX==null);var A=function(F,D,E){var K=document.createElement("div");K.id="input-textarea-caret-position-mirror-div";document.body.appendChild(K);var H=K.style;var I=window.getComputedStyle?getComputedStyle(F):F.currentStyle;H.whiteSpace="pre-wrap";if(F.nodeName!=="INPUT"){H.wordWrap="break-word"}H.position="absolute";H.visibility="hidden";B.forEach(function(L){H[L]=I[L]});if(C){H.width=parseInt(I.width)-2+"px";if(F.scrollHeight>parseInt(I.height)){H.overflowY="scroll"}}else{H.overflow="hidden"}K.textContent=F.value.substring(0,D);if(F.nodeName==="INPUT"){K.textContent=K.textContent.replace(/\s/g,"\u00a0")}var G=document.createElement("span");G.textContent=F.value.substring(D)||".";K.appendChild(G);var J={top:G.offsetTop+parseInt(I.borderTopWidth),left:G.offsetLeft+parseInt(I.borderLeftWidth)};document.body.removeChild(K);return J};if(typeof Package!=="undefined"){getCaretCoordinates=A}else{if(typeof module!=="undefined"&&module.exports){module.exports=A}else{return A}}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:xregexp', location = '/static/bower/xregexp/src/xregexp.js' */ /* * XRegExp 3.0.0-pre * <http://xregexp.com/> * Steven Levithan � 2007-2012 MIT License */ var XRegExp=(function(I){var L="xregexp",U,J={astral:false,natives:false},a={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},F={},S={},B={},R=[],C="default",O="class",g={"default":/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,"class":/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|[\s\S]/},f=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,b=a.exec.call(/()??/,"")[1]===I,N=RegExp.prototype.sticky!==I,e={g:true,i:true,m:true,y:N},Z={}.toString,T;function d(j,h,i){var k;if(i){if(j.__proto__){j.__proto__=U.prototype}else{for(k in U.prototype){j[k]=U.prototype[k]}}}j[L]={captureNames:h};return j}function M(h){return a.replace.call(h,/([\s\S])(?=[\s\S]*\1)/g,"")}function Y(j,i){if(!U.isRegExp(j)){throw new TypeError("Type RegExp expected")}var h=a.exec.call(/\/([a-z]*)$/i,String(j))[1];i=i||{};if(i.add){h=M(h+i.add)}if(i.remove){h=a.replace.call(h,new RegExp("["+i.remove+"]+","g"),"")}j=d(new RegExp(j.source,h),K(j)?j[L].captureNames.slice(0):null,i.addProto);return j}function V(){return{captureNames:null}}function K(h){return !!(h[L]&&h[L].captureNames)}function A(l,k){if(Array.prototype.indexOf){return l.indexOf(k)}var h=l.length,j;for(j=0;j<h;++j){if(l[j]===k){return j}}return -1}function G(i,h){return Z.call(i)==="[object "+h+"]"}function X(i,j,h){return a.test.call(h.indexOf("x")>-1?/^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,i.slice(j))}function E(k,h){var j;if(M(h)!==h){throw new SyntaxError("Invalid duplicate regex flag "+h)}k=a.replace.call(k,/^\(\?([\w$]+)\)/,function(l,i){if(a.test.call(/[gy]/,i)){throw new SyntaxError("Cannot use flag g or y in mode modifier "+l)}h=M(h+i);return""});for(j=0;j<h.length;++j){if(!e[h.charAt(j)]){throw new SyntaxError("Unknown regex flag "+h.charAt(j))}}return{pattern:k,flags:h}}function P(h){h=h||{};if(G(h,"String")){h=U.forEach(h,/[^\s,]+/,function(i){this[i]=true},{})}return h}function H(h){if(!/^[\w$]$/.test(h)){throw new Error("Flag must be a single character A-Za-z0-9_$")}e[h]=true}function D(m,j,n,p,h){var k=R.length,q=null,l,o;while(k--){o=R[k];if((o.scope===p||o.scope==="all")&&(!o.flag||j.indexOf(o.flag)>-1)){l=U.exec(m,o.regex,n,"sticky");if(l){q={matchLength:l[0].length,output:o.handler.call(h,l,p,j),reparse:o.reparse};break}}}return q}function Q(h){U.cache.flush("patterns");J.astral=h}function c(h){RegExp.prototype.exec=(h?F:a).exec;RegExp.prototype.test=(h?F:a).test;String.prototype.match=(h?F:a).match;String.prototype.replace=(h?F:a).replace;String.prototype.split=(h?F:a).split;J.natives=h}function W(h){if(h==null){throw new TypeError("Cannot convert null or undefined to object")}return h}U=function(l,j){var h={hasNamedCapture:false,captureNames:[]},o=C,i="",m=0,p,k,n;if(U.isRegExp(l)){if(j!==I){throw new TypeError("Cannot supply flags when copying a RegExp")}return Y(l,{addProto:true})}l=l===I?"":String(l);j=j===I?"":String(j);n=l+"***"+j;if(!B[n]){p=E(l,j);l=p.pattern;j=p.flags;while(m<l.length){do{p=D(l,j,m,o,h);if(p&&p.reparse){l=l.slice(0,m)+p.output+l.slice(m+p.matchLength)}}while(p&&p.reparse);if(p){i+=p.output;m+=(p.matchLength||1)}else{k=U.exec(l,g[o],m,"sticky")[0];i+=k;m+=k.length;if(k==="["&&o===C){o=O}else{if(k==="]"&&o===O){o=C}}}}B[n]={pattern:a.replace.call(i,/\(\?:\)(?=\(\?:\))|^\(\?:\)|\(\?:\)$/g,""),flags:a.replace.call(j,/[^gimy]+/g,""),captures:h.hasNamedCapture?h.captureNames:null}}n=B[n];return d(new RegExp(n.pattern,n.flags),n.captures,true)};U.prototype=new RegExp;U.version="3.0.0-pre";U.addToken=function(m,l,j){j=j||{};var h=j.optionalFlags,k;if(j.flag){H(j.flag)}if(h){h=a.split.call(h,"");for(k=0;k<h.length;++k){H(h[k])}}R.push({regex:Y(m,{add:"g"+(N?"y":"")}),handler:l,scope:j.scope||C,flag:j.flag,reparse:j.reparse});U.cache.flush("patterns")};U.cache=function(j,h){var i=j+"***"+(h||"");return S[i]||(S[i]=U(j,h))};U.cache.flush=function(h){if(h==="patterns"){B={}}else{S={}}};U.escape=function(h){return a.replace.call(W(h),/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")};U.exec=function(m,k,n,l){var j="g",i,h;if(N&&(l||(k.sticky&&l!==false))){j+="y"}k[L]=k[L]||V();h=k[L][j]||(k[L][j]=Y(k,{add:j,remove:l===false?"y":""}));h.lastIndex=n=n||0;i=F.exec.call(h,m);if(l&&i&&i.index!==n){i=null}if(k.global){k.lastIndex=i?h.lastIndex:0}return i};U.forEach=function(m,l,o,k){var n=0,j=-1,h;while((h=U.exec(m,l,n))){o.call(k,h,++j,m,l);n=h.index+(h[0].length||1)}return k};U.globalize=function(h){return Y(h,{add:"g",addProto:true})};U.install=function(h){h=P(h);if(!J.astral&&h.astral){Q(true)}if(!J.natives&&h.natives){c(true)}};U.isInstalled=function(h){return !!(J[h])};U.isRegExp=function(h){return Z.call(h)==="[object RegExp]"};U.match=function(n,m,k){var l=(m.global&&k!=="one")||k==="all",j=(l?"g":"")+(m.sticky?"y":""),h,i;m[L]=m[L]||V();i=m[L][j||"noGY"]||(m[L][j||"noGY"]=Y(m,{add:j,remove:k==="one"?"g":""}));h=a.match.call(W(n),i);if(m.global){m.lastIndex=((k==="one"&&h)?(h.index+h[0].length):0)}return l?(h||[]):(h&&h[0])};U.matchChain=function(i,h){return(function j(k,p){var n=h[p].regex?h[p]:{regex:h[p]},o=[],l=function(q){if(n.backref){if(!(q.hasOwnProperty(n.backref)||+n.backref<q.length)){throw new ReferenceError("Backreference to undefined group: "+n.backref)}o.push(q[n.backref]||"")}else{o.push(q[0])}},m;for(m=0;m<k.length;++m){U.forEach(k[m],n.regex,l)}return((p===h.length-1)||!o.length)?o:j(o,p+1)}([i],0))};U.replace=function(k,p,i,n){var l=U.isRegExp(p),h=(p.global&&n!=="one")||n==="all",j=(h?"g":"")+(p.sticky?"y":""),m=p,o;if(l){p[L]=p[L]||V();m=p[L][j||"noGY"]||(p[L][j||"noGY"]=Y(p,{add:j,remove:n==="one"?"g":""}))}else{if(h){m=new RegExp(U.escape(String(p)),"g")}}o=F.replace.call(W(k),m,i);if(l&&p.global){p.lastIndex=0}return o};U.replaceEach=function(l,j){var h,k;for(h=0;h<j.length;++h){k=j[h];l=U.replace(l,k[0],k[1],k[2])}return l};U.split=function(j,i,h){return F.split.call(W(j),i,h)};U.test=function(j,h,k,i){return !!U.exec(j,h,k,i)};U.uninstall=function(h){h=P(h);if(J.astral&&h.astral){Q(false)}if(J.natives&&h.natives){c(false)}};U.union=function(h,k){var l=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,j=[],n=0,p,q,o,r=function(s,t,u){var i=q[n-p];if(t){++n;if(i){return"(?<"+i+">"}}else{if(u){return"\\"+(+u+p)}}return s},m;if(!(G(h,"Array")&&h.length)){throw new TypeError("Must provide a nonempty array of patterns to merge")}for(m=0;m<h.length;++m){o=h[m];if(U.isRegExp(o)){p=n;q=(o[L]&&o[L].captureNames)||[];j.push(a.replace.call(U(o.source).source,l,r))}else{j.push(U.escape(o))}}return U(j.join("|"),k)};F.exec=function(n){var h=this.lastIndex,l=a.exec.apply(this,arguments),k,j,m;if(l){if(!b&&l.length>1&&A(l,"")>-1){j=Y(this,{remove:"g"});a.replace.call(String(n).slice(l.index),j,function(){var o=arguments.length,p;for(p=1;p<o-2;++p){if(arguments[p]===I){l[p]=I}}})}if(this[L]&&this[L].captureNames){for(m=1;m<l.length;++m){k=this[L].captureNames[m-1];if(k){l[k]=l[m]}}}if(this.global&&!l[0].length&&(this.lastIndex>l.index)){this.lastIndex=l.index}}if(!this.global){this.lastIndex=h}return l};F.test=function(h){return !!F.exec.call(this,h)};F.match=function(i){var h;if(!U.isRegExp(i)){i=new RegExp(i)}else{if(i.global){h=a.match.apply(this,arguments);i.lastIndex=0;return h}}return F.exec.call(i,W(this))};F.replace=function(k,l){var m=U.isRegExp(k),i,j,h;if(m){if(k[L]){j=k[L].captureNames}i=k.lastIndex}else{k+=""}if(G(l,"Function")){h=a.replace.call(String(this),k,function(){var n=arguments,o;if(j){n[0]=new String(n[0]);for(o=0;o<j.length;++o){if(j[o]){n[0][j[o]]=n[o+1]}}}if(m&&k.global){k.lastIndex=n[n.length-2]+n[0].length}return l.apply(I,n)})}else{h=a.replace.call(this==null?this:String(this),k,function(){var n=arguments;return a.replace.call(String(l),f,function(p,o,r){var q;if(o){q=+o;if(q<=n.length-3){return n[q]||""}q=j?A(j,o):-1;if(q<0){throw new SyntaxError("Backreference to undefined group "+p)}return n[q+1]||""}if(r==="$"){return"$"}if(r==="&"||+r===0){return n[0]}if(r==="`"){return n[n.length-1].slice(0,n[n.length-2])}if(r==="'"){return n[n.length-1].slice(n[n.length-2]+n[0].length)}r=+r;if(!isNaN(r)){if(r>n.length-3){throw new SyntaxError("Backreference to undefined group "+p)}return n[r]||""}throw new SyntaxError("Invalid token "+p)})})}if(m){if(k.global){k.lastIndex=0}else{k.lastIndex=i}}return h};F.split=function(l,i){if(!U.isRegExp(l)){return a.split.apply(this,arguments)}var n=String(this),k=[],h=l.lastIndex,m=0,j;i=(i===I?-1:i)>>>0;U.forEach(n,l,function(o){if((o.index+o[0].length)>m){k.push(n.slice(m,o.index));if(o.length>1&&o.index<n.length){Array.prototype.push.apply(k,o.slice(1))}j=o[0].length;m=o.index+j}});if(m===n.length){if(!a.test.call(l,"")||j){k.push("")}}else{k.push(n.slice(m))}l.lastIndex=h;return k.length>i?k.slice(0,i):k};T=U.addToken;T(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(h,i){if(h[1]==="B"&&i===C){return h[0]}throw new SyntaxError("Invalid escape "+h[0])},{scope:"all"});T(/\[(\^?)]/,function(h){return h[1]?"[\\s\\S]":"\\b\\B"});T(/\(\?#[^)]*\)/,function(i,j,h){return X(i.input,i.index+i[0].length,h)?"":"(?:)"});T(/\s+|#.*/,function(i,j,h){return X(i.input,i.index+i[0].length,h)?"":"(?:)"},{flag:"x"});T(/\./,function(){return"[\\s\\S]"},{flag:"s"});T(/\\k<([\w$]+)>/,function(i){var h=isNaN(i[1])?(A(this.captureNames,i[1])+1):+i[1],j=i.index+i[0].length;if(!h||h>this.captureNames.length){throw new SyntaxError("Backreference to undefined group "+i[0])}return"\\"+h+(j===i.input.length||isNaN(i.input.charAt(j))?"":"(?:)")});T(/\\(\d+)/,function(h,i){if(!(i===C&&/^[1-9]/.test(h[1])&&+h[1]<=this.captureNames.length)&&h[1]!=="0"){throw new SyntaxError("Cannot use octal escape or backreference to undefined group "+h[0])}return h[0]},{scope:"all"});T(/\(\?P?<([\w$]+)>/,function(h){if(!isNaN(h[1])){throw new SyntaxError("Cannot use integer as capture name "+h[0])}if(h[1]==="length"||h[1]==="__proto__"){throw new SyntaxError("Cannot use reserved word as capture name "+h[0])}if(A(this.captureNames,h[1])>-1){throw new SyntaxError("Cannot use same name for multiple groups "+h[0])}this.captureNames.push(h[1]);this.hasNamedCapture=true;return"("});T(/\((?!\?)/,function(i,j,h){if(h.indexOf("n")>-1){return"(?:"}this.captureNames.push(null);return"("},{optionalFlags:"n"});return U}());; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:xregexp', location = '/static/lib/xregexp/xregexp-AMD.js' */ define("xregexp",[],function(){return XRegExp});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:xregexp', location = '/static/bower/xregexp/src/addons/unicode/unicode-base.js' */ /* * XRegExp Unicode Base 3.0.0-pre * <http://xregexp.com/> * Steven Levithan � 2008-2012 MIT License * Uses Unicode 6.2.0 <http://unicode.org/> * Unicode data generated by Mathias Bynens <http://mathiasbynens.be/> */ (function(H){var A={};function F(L){return L.replace(/[- _]+/g,"").toLowerCase()}function I(L){while(L.length<4){L="0"+L}return L}function D(L){return parseInt(L,16)}function C(L){return parseInt(L,10).toString(16)}function J(M){var L=/^\\[xu](.+)/.exec(M);return L?D(L[1]):M.charCodeAt(M.charAt(0)==="\\"?1:0)}function B(M){var L="",N=-1,O;H.forEach(M,/(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/,function(P){O=J(P[1]);if(O>(N+1)){L+="\\u"+I(C(N+1));if(O>(N+2)){L+="-\\u"+I(C(O-1))}}N=J(P[2]||P[1])});if(N<65535){L+="\\u"+I(C(N+1));if(N<65534){L+="-\\uFFFF"}}return L}function E(L){var M="b!";return A[L][M]||(A[L][M]=B(A[L].bmp))}function G(L,M){var O=A[L],N="";if(O.bmp&&!O.isBmpLast){N="["+O.bmp+"]"+(O.astral?"|":"")}if(O.astral){N+=O.astral}if(O.isBmpLast&&O.bmp){N+=(O.astral?"|":"")+"["+O.bmp+"]"}return M?"(?:(?!"+N+")(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))":"(?:"+N+")"}function K(L,M){var N=M?"a!":"a=";return A[L][N]||(A[L][N]=G(L,M))}H.addToken(/\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/,function(S,W,O){var U="Invalid double negation ",P="Unknown Unicode token ",M="Unicode token missing data ",N="Astral mode required for Unicode token ",L="Astral mode does not support Unicode tokens within character classes",T=S[1]==="P"||!!S[2],R=O.indexOf("A")>-1||H.isInstalled("astral"),Q=F(S[4]||S[3]),V=A[Q];if(S[1]==="P"&&S[2]){throw new SyntaxError(U+S[0])}if(!A.hasOwnProperty(Q)){throw new SyntaxError(P+S[0])}if(V.inverseOf){Q=F(V.inverseOf);if(!A.hasOwnProperty(Q)){throw new ReferenceError(M+S[0]+" -> "+V.inverseOf)}V=A[Q];T=!T}if(!(V.bmp||R)){throw new SyntaxError(N+S[0])}if(R){if(W==="class"){throw new SyntaxError(L)}return K(Q,T)}return W==="class"?(T?E(Q):V.bmp):(T?"[^":"[")+V.bmp+"]"},{scope:"all",optionalFlags:"A"});H.addUnicodeData=function(P){var L="Unicode token requires name",O="Unicode token has no character data ",N,M;for(M=0;M<P.length;++M){N=P[M];if(!N.name){throw new Error(L)}if(!(N.inverseOf||N.bmp||N.astral)){throw new Error(O+N.name)}A[F(N.name)]=N;if(N.alias){A[F(N.alias)]=N}}H.cache.flush("patterns")};H.addUnicodeData([{name:"L",alias:"Letter",bmp:"A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",astral:"\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72]|\uD801[\uDC00-\uDC9D]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1E\uDF30-\uDF40\uDF42-\uDF49\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD81A[\uDC00-\uDE38]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD83-\uDDB2\uDDC1-\uDDC4]|\uD86E[\uDC00-\uDC1D]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD803[\uDC00-\uDC48]|\uD80D[\uDC00-\uDC2E]|\uD805[\uDE80-\uDEAA]|\uD87E[\uDC00-\uDE1D]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD82C[\uDC00\uDC01]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD808[\uDC00-\uDF6E]"}])}(XRegExp));; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:xregexp', location = '/static/bower/xregexp/src/addons/unicode/unicode-categories.js' */ /* * XRegExp Unicode Categories 3.0.0-pre * <http://xregexp.com/> * Steven Levithan � 2010-2012 MIT License * Uses Unicode 6.2.0 <http://unicode.org/> * Unicode data generated by Mathias Bynens <http://mathiasbynens.be/> */ (function(A){if(!A.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Categories")}A.addUnicodeData([{name:"C",alias:"Other",isBmpLast:true,bmp:"\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF",astral:"\uD808[\uDF6F-\uDFFF]|\uD809[\uDC63-\uDC6F\uDC74-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7F\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD7F\uDDC9-\uDDCF\uDDDA-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC60-\uDCFF\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDE80-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF80-\uDFFF]|\uD86D[\uDF35-\uDF3F]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFFF]|\uD86E[\uDC1E-\uDFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8B-\uDD8F\uDD9C-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF1F\uDF24-\uDF2F\uDF4B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]|\uD803[\uDC49-\uDE5F\uDE7F-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|[\uD806\uD807\uD80A\uD80B\uD80E-\uD819\uD81C-\uD82B\uD82D-\uD833\uD836-\uD83A\uD83E\uD83F\uD86F-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD83D[\uDC3F\uDC41\uDCF8\uDCFD-\uDCFF\uDD3E\uDD3F\uDD44-\uDD4F\uDD68-\uDDFA\uDE41-\uDE44\uDE50-\uDE7F\uDEC6-\uDEFF\uDF74-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCBF\uDCC0\uDCD0\uDCE0-\uDCFF\uDD0B-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF\uDF21-\uDF2F\uDF36\uDF7D-\uDF7F\uDF94-\uDF9F\uDFC5\uDFCB-\uDFDF\uDFF1-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD81A[\uDE39-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDDE-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDFFF]|\uD805[\uDC00-\uDE7F\uDEB8-\uDEBF\uDECA-\uDFFF]|\uD82C[\uDC02-\uDFFF]"},{name:"Cc",alias:"Control",bmp:"\0-\x1F\x7F-\x9F"},{name:"Cf",alias:"Format",bmp:"\xAD\u0600-\u0604\u06DD\u070F\u200B-\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\uFEFF\uFFF9-\uFFFB",astral:"\uDB40[\uDC01\uDC20-\uDC7F]|\uD834[\uDD73-\uDD7A]|\uD804\uDCBD"},{name:"Cn",alias:"Unassigned",bmp:"\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u0605\u061C\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065-\u2069\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF",astral:"\uD808[\uDF6F-\uDFFF]|\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDDE-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC60-\uDCFF\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDE80-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF80-\uDFFF]|\uD86D[\uDF35-\uDF3F]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFFF]|\uD809[\uDC63-\uDC6F\uDC74-\uDFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8B-\uDD8F\uDD9C-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEFF\uDF1F\uDF24-\uDF2F\uDF4B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7F\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD7F\uDDC9-\uDDCF\uDDDA-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD803[\uDC49-\uDE5F\uDE7F-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|[\uD806\uD807\uD80A\uD80B\uD80E-\uD819\uD81C-\uD82B\uD82D-\uD833\uD836-\uD83A\uD83E\uD83F\uD86F-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD83D[\uDC3F\uDC41\uDCF8\uDCFD-\uDCFF\uDD3E\uDD3F\uDD44-\uDD4F\uDD68-\uDDFA\uDE41-\uDE44\uDE50-\uDE7F\uDEC6-\uDEFF\uDF74-\uDFFF]|\uD86E[\uDC1E-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCBF\uDCC0\uDCD0\uDCE0-\uDCFF\uDD0B-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF\uDF21-\uDF2F\uDF36\uDF7D-\uDF7F\uDF94-\uDF9F\uDFC5\uDFCB-\uDFDF\uDFF1-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD81A[\uDE39-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDFFF]|\uD805[\uDC00-\uDE7F\uDEB8-\uDEBF\uDECA-\uDFFF]|\uD82C[\uDC02-\uDFFF]"},{name:"Co",alias:"Private_Use",bmp:"\uE000-\uF8FF",astral:"[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]"},{name:"Cs",alias:"Surrogate",bmp:"\uD800-\uDFFF"},{name:"Ll",alias:"Lowercase_Letter",bmp:"a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0561-\u0587\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7FA\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A",astral:"\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD801[\uDC28-\uDC4F]"},{name:"Lm",alias:"Modifier_Letter",bmp:"\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uAA70\uAADD\uAAF3\uAAF4\uFF70\uFF9E\uFF9F",astral:"\uD81B[\uDF93-\uDF9F]"},{name:"Lo",alias:"Other_Letter",bmp:"\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",astral:"\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1E\uDF30-\uDF40\uDF42-\uDF49\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD81A[\uDC00-\uDE38]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD83-\uDDB2\uDDC1-\uDDC4]|\uD86E[\uDC00-\uDC1D]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD803[\uDC00-\uDC48]|\uD80D[\uDC00-\uDC2E]|\uD805[\uDE80-\uDEAA]|\uD87E[\uDC00-\uDE1D]|\uD81B[\uDF00-\uDF44\uDF50]|\uD801[\uDC50-\uDC9D]|\uD82C[\uDC00\uDC01]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD808[\uDC00-\uDF6E]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]"},{name:"Lt",alias:"Titlecase_Letter",bmp:"\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC"},{name:"Lu",alias:"Uppercase_Letter",bmp:"A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA\uFF21-\uFF3A",astral:"\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD801[\uDC00-\uDC27]"},{name:"M",alias:"Mark",bmp:"\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u08FE\u0900-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1DC0-\u1DE6\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26",astral:"\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC80-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD80-\uDD82\uDDB3-\uDDC0]|\uD805[\uDEAB-\uDEB7]|\uD800\uDDFD|\uDB40[\uDD00-\uDDEF]"},{name:"Mc",alias:"Spacing_Mark",bmp:"\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u19B0-\u19C0\u19C8\u19C9\u1A19-\u1A1B\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BAC\u1BAD\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC",astral:"\uD834[\uDD65\uDD66\uDD6D-\uDD72]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0]|\uD805[\uDEAC\uDEAE\uDEAF\uDEB6]|\uD81B[\uDF51-\uDF7E]"},{name:"Me",alias:"Enclosing_Mark",bmp:"\u0488\u0489\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672"},{name:"Mn",alias:"Nonspacing_Mark",bmp:"\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u08FE\u0900-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1DC0-\u1DE6\u1DFC-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26",astral:"\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD81B[\uDF8F-\uDF92]|\uD805[\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7]|\uD804[\uDC01\uDC38-\uDC46\uDC80\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD80\uDD81\uDDB6-\uDDBE]|\uD800\uDDFD|\uDB40[\uDD00-\uDDEF]"},{name:"N",alias:"Number",bmp:"0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19",astral:"\uD802[\uDC58-\uDC5F\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDF58-\uDF5F\uDF78-\uDF7F]|\uD801[\uDCA0-\uDCA9]|\uD809[\uDC00-\uDC62]|\uD835[\uDFCE-\uDFFF]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD834[\uDF60-\uDF71]|\uD803[\uDE60-\uDE7E]|\uD83C[\uDD00-\uDD0A]|\uD805[\uDEC0-\uDEC9]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9]"},{name:"Nd",alias:"Decimal_Number",bmp:"0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19",astral:"\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9]|\uD805[\uDEC0-\uDEC9]|\uD801[\uDCA0-\uDCA9]|\uD835[\uDFCE-\uDFFF]"},{name:"Nl",alias:"Letter_Number",bmp:"\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF",astral:"\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC62]"},{name:"No",alias:"Other_Number",bmp:"\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D70-\u0D75\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835",astral:"\uD802[\uDC58-\uDC5F\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDF58-\uDF5F\uDF78-\uDF7F]|\uD834[\uDF60-\uDF71]|\uD803[\uDE60-\uDE7E]|\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDF20-\uDF23]|\uD83C[\uDD00-\uDD0A]|\uD804[\uDC52-\uDC65]"},{name:"P",alias:"Punctuation",bmp:"\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65",astral:"\uD809[\uDC70-\uDC73]|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDF39-\uDF3F]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDDC5-\uDDC8]"},{name:"Pc",alias:"Connector_Punctuation",bmp:"\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F"},{name:"Pd",alias:"Dash_Punctuation",bmp:"\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D"},{name:"Pe",alias:"Close_Punctuation",bmp:"\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3F\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63"},{name:"Pf",alias:"Final_Punctuation",bmp:"\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21"},{name:"Pi",alias:"Initial_Punctuation",bmp:"\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20"},{name:"Po",alias:"Other_Punctuation",bmp:"\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65",astral:"\uD809[\uDC70-\uDC73]|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDF39-\uDF3F]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDDC5-\uDDC8]"},{name:"Ps",alias:"Open_Punctuation",bmp:"\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3E\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62"},{name:"S",alias:"Symbol",bmp:"\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BA\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u2190-\u2328\u232B-\u23F3\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u26FF\u2701-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B4C\u2B50-\u2B59\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD",astral:"\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCF7\uDCF9-\uDCFC\uDD00-\uDD3D\uDD40-\uDD43\uDD50-\uDD67\uDDFB-\uDE40\uDE45-\uDE4F\uDE80-\uDEC5\uDF00-\uDF73]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBE\uDCC1-\uDCCF\uDCD1-\uDCDF\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDD9A\uDDE6-\uDE02\uDE10-\uDE3A\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDF20\uDF30-\uDF35\uDF37-\uDF7C\uDF80-\uDF93\uDFA0-\uDFC4\uDFC6-\uDFCA\uDFE0-\uDFF0]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDDD\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD90-\uDD9B\uDDD0-\uDDFC]|\uD83B[\uDEF0\uDEF1]"},{name:"Sc",alias:"Currency_Symbol",bmp:"\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BA\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6"},{name:"Sk",alias:"Modifier_Symbol",bmp:"\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3"},{name:"Sm",alias:"Math_Symbol",bmp:"\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2308-\u230B\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC",astral:"\uD83B[\uDEF0\uDEF1]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]"},{name:"So",alias:"Other_Symbol",bmp:"\xA6\xA9\xAE\xB0\u0482\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23F3\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u26FF\u2701-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B50-\u2B59\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD",astral:"\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCF7\uDCF9-\uDCFC\uDD00-\uDD3D\uDD40-\uDD43\uDD50-\uDD67\uDDFB-\uDE40\uDE45-\uDE4F\uDE80-\uDEC5\uDF00-\uDF73]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDDD\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBE\uDCC1-\uDCCF\uDCD1-\uDCDF\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDD9A\uDDE6-\uDE02\uDE10-\uDE3A\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDF20\uDF30-\uDF35\uDF37-\uDF7C\uDF80-\uDF93\uDFA0-\uDFC4\uDFC6-\uDFCA\uDFE0-\uDFF0]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD90-\uDD9B\uDDD0-\uDDFC]"},{name:"Z",alias:"Separator",bmp:"\x20\xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000"},{name:"Zl",alias:"Line_Separator",bmp:"\u2028"},{name:"Zp",alias:"Paragraph_Separator",bmp:"\u2029"},{name:"Zs",alias:"Space_Separator",bmp:"\x20\xA0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000"}])}(XRegExp));; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:rangy-inputs', location = '/static/lib/rangy-inputs.js' */ (function(C){var L="undefined";var D,G,Q,F,B;var N,I,M,P;function J(S,U){var T=typeof S[U];return T==="function"||(!!(T=="object"&&S[U]))||T=="unknown"}function K(S,T){return typeof (S[T])!=L}function E(S,T){return !!(typeof (S[T])=="object"&&S[T])}function H(S){if(window.console&&window.console.log){window.console.log("TextInputs module for Rangy not supported in your browser. Reason: "+S)}}function O(T,U,S){if(U<0){U+=T.value.length}if(typeof S==L){S=U}if(S<0){S+=T.value.length}return{start:U,end:S}}function A(T,U,S){return{start:U,end:S,length:S-U,text:T.value.slice(U,S)}}function R(){return E(document,"body")?document.body:document.getElementsByTagName("body")[0]}C(document).ready(function(){var T=document.createElement("textarea");R().appendChild(T);if(K(T,"selectionStart")&&K(T,"selectionEnd")){D=function(W){var X=W.selectionStart,V=W.selectionEnd;return A(W,X,V)};G=function(X,V,W){var Y=O(X,V,W);X.selectionStart=Y.start;X.selectionEnd=Y.end};P=function(W,V){if(V){W.selectionEnd=W.selectionStart}else{W.selectionStart=W.selectionEnd}}}else{if(J(T,"createTextRange")&&E(document,"selection")&&J(document.selection,"createRange")){D=function(Z){var c=0,X=0,b,W,V,a;var Y=document.selection.createRange();if(Y&&Y.parentElement()==Z){b=Z.value.replace(/\r\n/g,"\n");V=b.length;W=Z.createTextRange();W.moveToBookmark(Y.getBookmark());a=Z.createTextRange();a.collapse(false);if(W.compareEndPoints("StartToEnd",a)>-1){c=X=V}else{c=-W.moveStart("character",-V);c+=b.slice(0,c).split("\n").length-1;if(W.compareEndPoints("EndToEnd",a)>-1){X=V}else{X=-W.moveEnd("character",-V);X+=b.slice(0,X).split("\n").length-1}}}return A(Z,c,X)};var U=function(V,W){return W-(V.value.slice(0,W).split("\r\n").length-1)};G=function(Z,V,Y){var a=O(Z,V,Y);var X=Z.createTextRange();var W=U(Z,a.start);X.collapse(true);if(a.start==a.end){X.move("character",W)}else{X.moveEnd("character",U(Z,a.end));X.moveStart("character",W)}X.select()};P=function(X,W){var V=document.selection.createRange();V.collapse(W);V.select()}}else{R().removeChild(T);H("No means of finding text input caret position");return }}R().removeChild(T);F=function(W,Z,V,X){var Y;if(Z!=V){Y=W.value;W.value=Y.slice(0,Z)+Y.slice(V)}if(X){G(W,Z,Z)}};Q=function(V){var W=D(V);F(V,W.start,W.end,true)};M=function(V){var W=D(V),X;if(W.start!=W.end){X=V.value;V.value=X.slice(0,W.start)+X.slice(W.end)}G(V,W.start,W.start);return W.text};B=function(W,Z,V,X){var Y=W.value,a;W.value=Y.slice(0,V)+Z+Y.slice(V);if(X){a=V+Z.length;G(W,a,a)}};N=function(V,Y){var W=D(V),X=V.value;V.value=X.slice(0,W.start)+Y+X.slice(W.end);var Z=W.start+Y.length;G(V,Z,Z)};I=function(V,Y,b){var X=D(V),a=V.value;V.value=a.slice(0,X.start)+Y+X.text+b+a.slice(X.end);var Z=X.start+Y.length;var W=Z+X.length;G(V,Z,W)};function S(V,W){return function(){var Z=this.jquery?this[0]:this;var a=Z.nodeName.toLowerCase();if(Z.nodeType==1&&(a=="textarea"||(a=="input"&&Z.type=="text"))){var Y=[Z].concat(Array.prototype.slice.call(arguments));var X=V.apply(this,Y);if(!W){return X}}if(W){return this}}}C.fn.extend({getSelection:S(D,false),setSelection:S(G,true),collapseSelection:S(P,true),deleteSelectedText:S(Q,true),deleteText:S(F,true),extractSelectedText:S(M,false),insertText:S(B,true),replaceSelectedText:S(N,true),surroundSelectedText:S(I,true)})})})(jQuery);; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:mentionable-textarea', location = '/static/widget/mentionable-textarea/mentionable-textarea.soy' */ // This file was automatically generated from mentionable-textarea.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.mentionableTextarea. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.mentionableTextarea == 'undefined') { stash.widget.mentionableTextarea = {}; } stash.widget.mentionableTextarea.dialog = function(opt_data, opt_ignored) { opt_data = opt_data || {}; var output = '<ul>'; if (opt_data.results && opt_data.results.length) { var resultList6 = opt_data.results; var resultListLen6 = resultList6.length; for (var resultIndex6 = 0; resultIndex6 < resultListLen6; resultIndex6++) { var resultData6 = resultList6[resultIndex6]; output += stash.widget.mentionableTextarea.result({result: resultData6, isActive: opt_data.activeItemIndex ? resultIndex6 == opt_data.activeItemIndex : resultIndex6 == 0}); } } else { output += (opt_data.query) ? '<li class="no-results"><span>' + soy.$$escapeHtml("No matching users found") + '</span></li>' : '<li class="mentions-help"><span>' + soy.$$escapeHtml("Start typing to search for people") + '</span></li>'; } output += '</ul>'; return output; }; if (goog.DEBUG) { stash.widget.mentionableTextarea.dialog.soyTemplateName = 'stash.widget.mentionableTextarea.dialog'; } stash.widget.mentionableTextarea.result = function(opt_data, opt_ignored) { return '<li class="result ' + soy.$$escapeHtml(opt_data.isActive ? 'active' : '') + '">' + stash.widget.avatarWithNameAndEmail({size: 'small', person: opt_data.result}) + '</li>'; }; if (goog.DEBUG) { stash.widget.mentionableTextarea.result.soyTemplateName = 'stash.widget.mentionableTextarea.result'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:mentionable-textarea', location = '/static/widget/mentionable-textarea/mentionable-textarea.js' */ define("widget/mentionable-textarea",["aui","aui/progressive-dataset","backbone","jquery","lodash","textarea-caret-position","xregexp","stash/api/util/navbuilder","util/events","util/function","model/page-state","model/stash-user","widget/autocomplete-dialog"],function(I,M,K,C,L,J,F,A,O,G,H,E,N){function B(){this.init.apply(this,arguments)}B.defaults={$container:C(document.body),selector:"textarea",dialogId:"mention-autocomplete-dialog"};B.prototype.init=function(P){if(this.options){this.reset()}this.options=C.extend({},B.defaults,P);L.bindAll(this,"onKeyDown","onKeyPress","onPaste","onDocumentClick","updateDialogAnchorPosition","updateResults","onActivity","selectItem","highlightMatches");var Q=[];if(H.getPullRequest()){Q=L.map([H.getPullRequest().getAuthor()].concat(H.getPullRequest().getReviewers().models,H.getPullRequest().getParticipants().models),function(R){return R.getUser()})}else{if(H.getCommitParticipants&&H.getCommitParticipants()){Q=H.getCommitParticipants().pluck("user")}}this.dataSource=D(Q,this.matcher);this.dataSource.on("respond",this.updateResults);this.dataSource.on("activity",this.onActivity);this.isMentioningSelector=L.map(this.options.selector.split(","),function(R){return C.trim(R)+".isMentioning"}).join(", ");this.options.$container.on("keypress",this.options.selector,this.onKeyPress);this.options.$container.on("keydown",this.isMentioningSelector,this.onKeyDown);this.options.$container.on("paste",this.isMentioningSelector,this.onPaste)};B.prototype.onKeyDown=function(P){if(!this.dialog){return }switch(P.which){case I.keyCode.ENTER:case I.keyCode.TAB:this.selectHighlightedItem();P.preventDefault();break;case I.keyCode.UP:this.dialog.moveSelectionUp();P.preventDefault();break;case I.keyCode.DOWN:this.dialog.moveSelectionDown();P.preventDefault();break;case I.keyCode.ESCAPE:this.endAutocomplete();P.preventDefault();P.stopPropagation();break;case I.keyCode.BACKSPACE:case I.keyCode.DELETE:this.onKeyPress(P);break}};B.prototype.onKeyPress=function(P){if(P.which){L.defer(L.bind(function(Q){var R=C(Q.target);if(!R.hasClass("isMentioning")){if(String.fromCharCode(Q.which)==="@"){this.beginAutocomplete(R)}}else{this.updateAutocomplete()}},this),P)}};B.prototype.onPaste=function(){L.defer(L.bind(this.updateAutocomplete,this))};B.prototype.onDocumentClick=function(S){var R=S.target;var P=[];this.$textarea&&P.push(this.$textarea);this.dialog&&P.push(this.dialog.$el);var Q=L.any(P,function(T){return T.is(R)||C.contains(T[0],R)});if(!Q){this.endAutocomplete()}};B.prototype.beginAutocomplete=function(Q){var P=Q.getSelection().start-1;if(P>0&&/^\w$/.test(Q.val().substr(P-1,1))){return }this.$textarea=Q;this.$textarea.addClass("isMentioning");this.mentionTriggerPos=P;this.resultsCollection=new K.Collection();this.dialog=new N({id:this.options.dialogId,collection:this.resultsCollection,minZIndex:this.options.$container.zIndex(),anchor:this.getCaretDocumentCoordinates(this.$textarea),template:stash.widget.mentionableTextarea.dialog,highlighter:this.highlightMatches});this.dialog.on("itemSelected",this.selectItem);O.on("window.resize.debounced",this.updateDialogAnchorPosition);C(document).on("click focusin mousedown",this.onDocumentClick);this.updateAutocomplete()};B.prototype.updateAutocomplete=function(){if(!this.$textarea){return }this.currentCaretPos=this.$textarea.getSelection().start;var P=this.$textarea.val().substring(this.mentionTriggerPos,this.currentCaretPos);if(!P||P.indexOf("@")!==0||P.indexOf("\n")!==-1){this.endAutocomplete()}else{P=P.substr(1);this.dataSource.query(P)}};B.prototype.updateDialogAnchorPosition=function(){L.defer(L.bind(function(){if(this.dialog&&this.$textarea){this.dialog.updateAnchorPosition(this.getCaretDocumentCoordinates(this.$textarea))}},this))};B.prototype.updateResults=function(P){if(this.resultsCollection){this.resultsCollection.query=P.query;this.resultsCollection.reset(P.results)}};B.prototype.onActivity=function(P){this.dialog&&this.dialog.toggleSpinner(P.activity)};B.prototype.endAutocomplete=function(){if(this.$textarea){this.$textarea.removeClass("isMentioning");this.$textarea=null}this.mentionTriggerPos=undefined;this.currentCaretPos=undefined;if(this.dialog){this.dialog.off("itemSelected",this.selectItem);this.dialog.remove();this.dialog=null}this.resultsCollection=null;O.off("window.resize.debounced",this.updateDialogAnchorPosition);C(document).off("click focusin mousedown",this.onDocumentClick)};B.prototype.selectHighlightedItem=function(){this.selectItem(this.dialog.getSelectedItemIndex())};B.prototype.selectItem=function(R){var Q=this.resultsCollection.at(R);if(Q){var P=this.escapeUsername(Q.getName()),V=this.$textarea.val(),U=V.substring(0,this.mentionTriggerPos+1),T=V.substring(this.currentCaretPos,V.length),S=U.length+P.length+1;if(T.charAt(0)!==" "){T=" "+T}this.$textarea.val(U+P+T);this.$textarea.setSelection(S,S)}this.endAutocomplete()};B.prototype.matcher=function(Q,R){if(H.getCurrentUser()&&Q.getName()===H.getCurrentUser().getName()){return false}var P=F.cache("(\\b|^|[^\\p{L}\\p{N}])"+F.escape(R),"i"),S=[Q.getName(),Q.getEmailAddress(),Q.getDisplayName()];return L.any(S,function(T){return !!(T&&P.test(T))})};B.prototype.getMatchParts=function(S,R){var Q=F.cache("(^|.*?(\\b|\\())("+F.escape(R)+")(.*)","i"),P={text:S};if(S.toLowerCase().indexOf(R.toLowerCase())>-1){S.replace(Q,function(U,W,V,T,X){P={prefix:W,match:T,suffix:X}})}return P};B.prototype.highlightMatches=function(P,R){var Q=this;P.find(".avatar-with-name, .email-address").each(function(){var S=C(this).contents().filter(function(){return this.nodeType===Node.TEXT_NODE}),T=L.reduce(Q.getMatchParts(S.text(),R),function(U,V,W){return U+((W==="match")?"<b>"+I.escapeHtml(V)+"</b>":I.escapeHtml(V))},"");S.replaceWith(T)});return P};B.prototype.getCaretDocumentCoordinates=function(S){var P=S.offset();var R=J(S[0],S[0].selectionStart);var Q=parseInt(S.css("font-size"),10);R.top+=(P.top+Q);R.left+=P.left;return R};B.prototype.escapeUsername=function(P){if(/^\w*$/.test(P)){return P}else{return'"'+P.replace(/"/g,'\\"')+'"'}};B.prototype.reset=function(){this.destroy();delete this.options;delete this.dataSource;delete this.$textarea;delete this.dialog;delete this.resultsCollection;delete this.mentionTriggerPos;delete this.currentCaretPos};B.prototype.destroy=function(){if(this.dialog){this.dialog.off("itemSelected",this.selectItem);this.dialog.remove()}this.dataSource.off("respond",this.updateResults);this.dataSource.off("activity",this.onActivity);this.options.$container.off("keypress",this.options.selector,this.onKeyPress);this.options.$container.off("keydown",this.isMentioningSelector,this.onKeyDown);this.options.$container.off("paste",this.isMentioningSelector,this.onPaste);O.off("window.resize.debounced",this.updateDialogAnchorPosition);C(document).off("click focusin mousedown",this.onDocumentClick)};var D=L.once(function(Q,P){var R=new M(Q,{queryEndpoint:A.rest().users().build(),queryParamKey:"filter",queryData:{avatarSize:stash.widget.avatarSizeInPx({size:"small"})},maxResults:5,model:E,matcher:P});R.parse=G.dot("values");R.getFilteredResults=function(T){var S=this.filter(function(U){return(!!this.matcher(U,T))},this);if(this._maxResults){S=L.take(S,this._maxResults)}return S};return R});return B});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:codemirror-raw', location = '/static/bower/CodeMirror/lib/codemirror.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){module.exports=A()}else{if(typeof define=="function"&&define.amd){return define([],A)}else{this.CodeMirror=A()}}})(function(){var CN=/gecko\/\d/i.test(navigator.userAgent);var Ee=/MSIE \d/.test(navigator.userAgent);var Bh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);var De=Ee||Bh;var K=De&&(Ee?document.documentMode||6:Bh[1]);var Cx=/WebKit\//.test(navigator.userAgent);var Dh=Cx&&/Qt\/\d+\.\d+/.test(navigator.userAgent);var C9=/Chrome\//.test(navigator.userAgent);var Dw=/Opera\//.test(navigator.userAgent);var AZ=/Apple Computer/.test(navigator.vendor);var A7=/KHTML\//.test(navigator.userAgent);var C4=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);var FP=/PhantomJS/.test(navigator.userAgent);var Ev=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var EA=Ev||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);var B5=Ev||/Mac/.test(navigator.platform);var Al=/win/i.test(navigator.platform);var Au=Dw&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);if(Au){Au=Number(Au[1])}if(Au&&Au>=15){Dw=false;Cx=true}var Bo=B5&&(Dh||Dw&&(Au==null||Au<12.11));var Fy=CN||(De&&K>=9);var F1=false,A3=false;function i(F6,F7){if(!(this instanceof i)){return new i(F6,F7)}this.options=F7=F7?Aj(F7):{};Aj(Ex,F7,false);CC(F7);var GB=F7.value;if(typeof GB=="string"){GB=new AR(GB,F7.mode)}this.doc=GB;var GA=this.display=new Ec(F6,GB);GA.wrapper.CodeMirror=this;D6(this);Cl(this);if(F7.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}if(F7.autofocus&&!EA){ET(this)}Aa(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,draggingText:false,highlight:new F5(),keySeq:null};if(De&&K<11){setTimeout(CU(FJ,this,true),20)}Fk(this);BF();Cf(this);this.curOp.forceUpdate=true;D5(this,GB);if((F7.autofocus&&!EA)||Di()==GA.input){setTimeout(CU(CZ,this),20)}else{Ar(this)}for(var F9 in BB){if(BB.hasOwnProperty(F9)){BB[F9](this,F7[F9],CA)}}Dz(this);for(var F8=0;F8<A4.length;++F8){A4[F8](this)}AL(this);if(Cx&&F7.lineWrapping&&getComputedStyle(GA.lineDiv).textRendering=="optimizelegibility"){GA.lineDiv.style.textRendering="auto"}}function Ec(F6,F8){var F9=this;var F7=F9.input=Fr("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");if(Cx){F7.style.width="1000px"}else{F7.setAttribute("wrap","off")}if(Ev){F7.style.border="1px solid black"}F7.setAttribute("autocorrect","off");F7.setAttribute("autocapitalize","off");F7.setAttribute("spellcheck","false");F9.inputDiv=Fr("div",[F7],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");F9.scrollbarFiller=Fr("div",null,"CodeMirror-scrollbar-filler");F9.scrollbarFiller.setAttribute("not-content","true");F9.gutterFiller=Fr("div",null,"CodeMirror-gutter-filler");F9.gutterFiller.setAttribute("not-content","true");F9.lineDiv=Fr("div",null,"CodeMirror-code");F9.selectionDiv=Fr("div",null,null,"position: relative; z-index: 1");F9.cursorDiv=Fr("div",null,"CodeMirror-cursors");F9.measure=Fr("div",null,"CodeMirror-measure");F9.lineMeasure=Fr("div",null,"CodeMirror-measure");F9.lineSpace=Fr("div",[F9.measure,F9.lineMeasure,F9.selectionDiv,F9.cursorDiv,F9.lineDiv],null,"position: relative; outline: none");F9.mover=Fr("div",[Fr("div",[F9.lineSpace],"CodeMirror-lines")],null,"position: relative");F9.sizer=Fr("div",[F9.mover],"CodeMirror-sizer");F9.sizerWidth=null;F9.heightForcer=Fr("div",null,null,"position: absolute; height: "+Dd+"px; width: 1px;");F9.gutters=Fr("div",null,"CodeMirror-gutters");F9.lineGutter=null;F9.scroller=Fr("div",[F9.sizer,F9.heightForcer,F9.gutters],"CodeMirror-scroll");F9.scroller.setAttribute("tabIndex","-1");F9.wrapper=Fr("div",[F9.inputDiv,F9.scrollbarFiller,F9.gutterFiller,F9.scroller],"CodeMirror");if(De&&K<8){F9.gutters.style.zIndex=-1;F9.scroller.style.paddingRight=0}if(Ev){F7.style.width="0px"}if(!Cx){F9.scroller.draggable=true}if(A7){F9.inputDiv.style.height="1px";F9.inputDiv.style.position="absolute"}if(F6){if(F6.appendChild){F6.appendChild(F9.wrapper)}else{F6(F9.wrapper)}}F9.viewFrom=F9.viewTo=F8.first;F9.reportedViewFrom=F9.reportedViewTo=F8.first;F9.view=[];F9.renderedView=null;F9.externalMeasured=null;F9.viewOffset=0;F9.lastWrapHeight=F9.lastWrapWidth=0;F9.updateLineNumbers=null;F9.nativeBarWidth=F9.barHeight=F9.barWidth=0;F9.scrollbarsClipped=false;F9.lineNumWidth=F9.lineNumInnerWidth=F9.lineNumChars=null;F9.prevInput="";F9.alignWidgets=false;F9.pollingFast=false;F9.poll=new F5();F9.cachedCharWidth=F9.cachedTextHeight=F9.cachedPaddingH=null;F9.inaccurateSelection=false;F9.maxLine=null;F9.maxLineLength=0;F9.maxLineChanged=false;F9.wheelDX=F9.wheelDY=F9.wheelStartX=F9.wheelStartY=null;F9.shift=false;F9.selForContextMenu=null}function BP(F6){F6.doc.mode=i.getMode(F6.options,F6.doc.modeOption);EF(F6)}function EF(F6){F6.doc.iter(function(F7){if(F7.stateAfter){F7.stateAfter=null}if(F7.styles){F7.styles=null}});F6.doc.frontier=F6.doc.first;D9(F6,100);F6.state.modeGen++;if(F6.curOp){AG(F6)}}function Ea(F6){if(F6.options.lineWrapping){FV(F6.display.wrapper,"CodeMirror-wrap");F6.display.sizer.style.minWidth="";F6.display.sizerWidth=null}else{F(F6.display.wrapper,"CodeMirror-wrap");G(F6)}y(F6);AG(F6);AJ(F6);setTimeout(function(){Es(F6)},100)}function BA(F6){var F8=At(F6.display),F7=F6.options.lineWrapping;var F9=F7&&Math.max(5,F6.display.scroller.clientWidth/DX(F6.display)-3);return function(GB){if(FR(F6.doc,GB)){return 0}var GA=0;if(GB.widgets){for(var GC=0;GC<GB.widgets.length;GC++){if(GB.widgets[GC].height){GA+=GB.widgets[GC].height}}}if(F7){return GA+(Math.ceil(GB.text.length/F9)||1)*F8}else{return GA+F8}}}function y(F6){var F8=F6.doc,F7=BA(F6);F8.iter(function(F9){var GA=F7(F9);if(GA!=F9.height){Fu(F9,GA)}})}function Cl(F6){F6.display.wrapper.className=F6.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+F6.options.theme.replace(/(^|\s)\s*/g," cm-s-");AJ(F6)}function DQ(F6){D6(F6);AG(F6);setTimeout(function(){EY(F6)},20)}function D6(F6){var F7=F6.display.gutters,GB=F6.options.gutters;Dv(F7);for(var F8=0;F8<GB.length;++F8){var F9=GB[F8];var GA=F7.appendChild(Fr("div",null,"CodeMirror-gutter "+F9));if(F9=="CodeMirror-linenumbers"){F6.display.lineGutter=GA;GA.style.width=(F6.display.lineNumWidth||1)+"px"}}F7.style.display=F8?"":"none";C1(F6)}function C1(F6){var F7=F6.display.gutters.offsetWidth;F6.display.sizer.style.marginLeft=F7+"px"}function EH(F8){if(F8.height==0){return 0}var F7=F8.text.length,F6,GA=F8;while(F6=Ei(GA)){var F9=F6.find(0,true);GA=F9.from.line;F7+=F9.from.ch-F9.to.ch}GA=F8;while(F6=EP(GA)){var F9=F6.find(0,true);F7-=GA.text.length-F9.from.ch;GA=F9.to.line;F7+=GA.text.length-F9.to.ch}return F7}function G(F6){var F8=F6.display,F7=F6.doc;F8.maxLine=E9(F7,F7.first);F8.maxLineLength=EH(F8.maxLine);F8.maxLineChanged=true;F7.iter(function(GA){var F9=EH(GA);if(F9>F8.maxLineLength){F8.maxLineLength=F9;F8.maxLine=GA}})}function CC(F6){var F7=DE(F6.gutters,"CodeMirror-linenumbers");if(F7==-1&&F6.lineNumbers){F6.gutters=F6.gutters.concat(["CodeMirror-linenumbers"])}else{if(F7>-1&&!F6.lineNumbers){F6.gutters=F6.gutters.slice(0);F6.gutters.splice(F7,1)}}}function DU(F6){var F9=F6.display,F8=F9.gutters.offsetWidth;var F7=Math.round(F6.doc.height+Bg(F6.display));return{clientHeight:F9.scroller.clientHeight,viewHeight:F9.wrapper.clientHeight,scrollWidth:F9.scroller.scrollWidth,clientWidth:F9.scroller.clientWidth,viewWidth:F9.wrapper.clientWidth,barLeft:F6.options.fixedGutter?F8:0,docHeight:F7,scrollHeight:F7+Cq(F6)+F9.barHeight,nativeBarWidth:F9.nativeBarWidth,gutterWidth:F8}}function DG(F8,F7,F6){this.cm=F6;var F9=this.vert=Fr("div",[Fr("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var GA=this.horiz=Fr("div",[Fr("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");F8(F9);F8(GA);Bv(F9,"scroll",function(){if(F9.clientHeight){F7(F9.scrollTop,"vertical")}});Bv(GA,"scroll",function(){if(GA.clientWidth){F7(GA.scrollLeft,"horizontal")}});this.checkedOverlay=false;if(De&&K<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}}DG.prototype=Aj({update:function(F9){var GA=F9.scrollWidth>F9.clientWidth+1;var F8=F9.scrollHeight>F9.clientHeight+1;var GB=F9.nativeBarWidth;if(F8){this.vert.style.display="block";this.vert.style.bottom=GA?GB+"px":"0";var F7=F9.viewHeight-(GA?GB:0);this.vert.firstChild.style.height=Math.max(0,F9.scrollHeight-F9.clientHeight+F7)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(GA){this.horiz.style.display="block";this.horiz.style.right=F8?GB+"px":"0";this.horiz.style.left=F9.barLeft+"px";var F6=F9.viewWidth-F9.barLeft-(F8?GB:0);this.horiz.firstChild.style.width=(F9.scrollWidth-F9.clientWidth+F6)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&F9.clientHeight>0){if(GB==0){this.overlayHack()}this.checkedOverlay=true}return{right:F8?GB:0,bottom:GA?GB:0}},setScrollLeft:function(F6){if(this.horiz.scrollLeft!=F6){this.horiz.scrollLeft=F6}},setScrollTop:function(F6){if(this.vert.scrollTop!=F6){this.vert.scrollTop=F6}},overlayHack:function(){var F6=B5&&!C4?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=F6;var F7=this;var F8=function(F9){if(m(F9)!=F7.vert&&m(F9)!=F7.horiz){Cz(F7.cm,EN)(F9)}};Bv(this.vert,"mousedown",F8);Bv(this.horiz,"mousedown",F8)},clear:function(){var F6=this.horiz.parentNode;F6.removeChild(this.horiz);F6.removeChild(this.vert)}},DG.prototype);function Ey(){}Ey.prototype=Aj({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},Ey.prototype);i.scrollbarModel={"native":DG,"null":Ey};function Aa(F6){if(F6.display.scrollbars){F6.display.scrollbars.clear();if(F6.display.scrollbars.addClass){F(F6.display.wrapper,F6.display.scrollbars.addClass)}}F6.display.scrollbars=new i.scrollbarModel[F6.options.scrollbarStyle](function(F7){F6.display.wrapper.insertBefore(F7,F6.display.scrollbarFiller);Bv(F7,"mousedown",function(){if(F6.state.focused){setTimeout(CU(ET,F6),0)}});F7.setAttribute("not-content","true")},function(F8,F7){if(F7=="horizontal"){Bc(F6,F8)}else{o(F6,F8)}},F6);if(F6.display.scrollbars.addClass){FV(F6.display.wrapper,F6.display.scrollbars.addClass)}}function Es(F8,GA){if(!GA){GA=DU(F8)}var F7=F8.display.barWidth,F6=F8.display.barHeight;Aq(F8,GA);for(var F9=0;F9<4&&F7!=F8.display.barWidth||F6!=F8.display.barHeight;F9++){if(F7!=F8.display.barWidth&&F8.options.lineWrapping){A5(F8)}Aq(F8,DU(F8));F7=F8.display.barWidth;F6=F8.display.barHeight}}function Aq(F6,F7){var F9=F6.display;var F8=F9.scrollbars.update(F7);F9.sizer.style.paddingRight=(F9.barWidth=F8.right)+"px";F9.sizer.style.paddingBottom=(F9.barHeight=F8.bottom)+"px";if(F8.right&&F8.bottom){F9.scrollbarFiller.style.display="block";F9.scrollbarFiller.style.height=F8.bottom+"px";F9.scrollbarFiller.style.width=F8.right+"px"}else{F9.scrollbarFiller.style.display=""}if(F8.bottom&&F6.options.coverGutterNextToScrollbar&&F6.options.fixedGutter){F9.gutterFiller.style.display="block";F9.gutterFiller.style.height=F8.bottom+"px";F9.gutterFiller.style.width=F7.gutterWidth+"px"}else{F9.gutterFiller.style.display=""}}function B4(F9,GD,F8){var GA=F8&&F8.top!=null?Math.max(0,F8.top):F9.scroller.scrollTop;GA=Math.floor(GA-E2(F9));var F6=F8&&F8.bottom!=null?F8.bottom:GA+F9.wrapper.clientHeight;var GB=Be(GD,GA),GC=Be(GD,F6);if(F8&&F8.ensure){var F7=F8.ensure.from.line,GE=F8.ensure.to.line;if(F7<GB){GB=F7;GC=Be(GD,Bk(E9(GD,F7))+F9.wrapper.clientHeight)}else{if(Math.min(GE,GD.lastLine())>=GC){GB=Be(GD,Bk(E9(GD,GE))-F9.wrapper.clientHeight);GC=GE}}}return{from:GB,to:Math.max(GC,GB+1)}}function EY(GE){var GC=GE.display,GD=GC.view;if(!GC.alignWidgets&&(!GC.gutters.firstChild||!GE.options.fixedGutter)){return }var GA=Dr(GC)-GC.scroller.scrollLeft+GE.doc.scrollLeft;var F6=GC.gutters.offsetWidth,F7=GA+"px";for(var F9=0;F9<GD.length;F9++){if(!GD[F9].hidden){if(GE.options.fixedGutter&&GD[F9].gutter){GD[F9].gutter.style.left=F7}var GB=GD[F9].alignable;if(GB){for(var F8=0;F8<GB.length;F8++){GB[F8].style.left=F7}}}}if(GE.options.fixedGutter){GC.gutters.style.left=(GA+F6)+"px"}}function Dz(F6){if(!F6.options.lineNumbers){return false}var GB=F6.doc,F7=EM(F6.options,GB.first+GB.size-1),GA=F6.display;if(F7.length!=GA.lineNumChars){var GC=GA.measure.appendChild(Fr("div",[Fr("div",F7)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var F8=GC.firstChild.offsetWidth,F9=GC.offsetWidth-F8;GA.lineGutter.style.width="";GA.lineNumInnerWidth=Math.max(F8,GA.lineGutter.offsetWidth-F9);GA.lineNumWidth=GA.lineNumInnerWidth+F9;GA.lineNumChars=GA.lineNumInnerWidth?F7.length:-1;GA.lineGutter.style.width=GA.lineNumWidth+"px";C1(F6);return true}return false}function EM(F6,F7){return String(F6.lineNumberFormatter(F7+F6.firstLineNumber))}function Dr(F6){return F6.scroller.getBoundingClientRect().left-F6.sizer.getBoundingClientRect().left}function Af(F7,F6,F8){var F9=F7.display;this.viewport=F6;this.visible=B4(F9,F7.doc,F6);this.editorIsHidden=!F9.wrapper.offsetWidth;this.wrapperHeight=F9.wrapper.clientHeight;this.wrapperWidth=F9.wrapper.clientWidth;this.oldDisplayWidth=DH(F7);this.force=F8;this.dims=E7(F7)}function k(F6){var F7=F6.display;if(!F7.scrollbarsClipped&&F7.scroller.offsetWidth){F7.nativeBarWidth=F7.scroller.offsetWidth-F7.scroller.clientWidth;F7.heightForcer.style.height=Cq(F6)+"px";F7.sizer.style.marginBottom=-F7.nativeBarWidth+"px";F7.sizer.style.borderRightWidth=Cq(F6)+"px";F7.scrollbarsClipped=true}}function c(GF,F9){var GA=GF.display,GE=GF.doc;if(F9.editorIsHidden){EQ(GF);return false}if(!F9.force&&F9.visible.from>=GA.viewFrom&&F9.visible.to<=GA.viewTo&&(GA.updateLineNumbers==null||GA.updateLineNumbers>=GA.viewTo)&&GA.renderedView==GA.view&&C8(GF)==0){return false}if(Dz(GF)){EQ(GF);F9.dims=E7(GF)}var F8=GE.first+GE.size;var GC=Math.max(F9.visible.from-GF.options.viewportMargin,GE.first);var GD=Math.min(F8,F9.visible.to+GF.options.viewportMargin);if(GA.viewFrom<GC&&GC-GA.viewFrom<20){GC=Math.max(GE.first,GA.viewFrom)}if(GA.viewTo>GD&&GA.viewTo-GD<20){GD=Math.min(F8,GA.viewTo)}if(A3){GC=As(GF.doc,GC);GD=Dx(GF.doc,GD)}var F7=GC!=GA.viewFrom||GD!=GA.viewTo||GA.lastWrapHeight!=F9.wrapperHeight||GA.lastWrapWidth!=F9.wrapperWidth;Co(GF,GC,GD);GA.viewOffset=Bk(E9(GF.doc,GA.viewFrom));GF.display.mover.style.top=GA.viewOffset+"px";var F6=C8(GF);if(!F7&&F6==0&&!F9.force&&GA.renderedView==GA.view&&(GA.updateLineNumbers==null||GA.updateLineNumbers>=GA.viewTo)){return false}var GB=Di();if(F6>4){GA.lineDiv.style.display="none"}CL(GF,GA.updateLineNumbers,F9.dims);if(F6>4){GA.lineDiv.style.display=""}GA.renderedView=GA.view;if(GB&&Di()!=GB&&GB.offsetHeight){GB.focus()}Dv(GA.cursorDiv);Dv(GA.selectionDiv);GA.gutters.style.height=0;if(F7){GA.lastWrapHeight=F9.wrapperHeight;GA.lastWrapWidth=F9.wrapperWidth;D9(GF,400)}GA.updateLineNumbers=null;return true}function CI(F7,GB){var F9=GB.force,F6=GB.viewport;for(var GA=true;;GA=false){if(GA&&F7.options.lineWrapping&&GB.oldDisplayWidth!=DH(F7)){F9=true}else{F9=false;if(F6&&F6.top!=null){F6={top:Math.min(F7.doc.height+Bg(F7.display)-Cs(F7),F6.top)}}GB.visible=B4(F7.display,F7.doc,F6);if(GB.visible.from>=F7.display.viewFrom&&GB.visible.to<=F7.display.viewTo){break}}if(!c(F7,GB)){break}A5(F7);var F8=DU(F7);Ba(F7);DT(F7,F8);Es(F7,F8)}AD(F7,"update",F7);if(F7.display.viewFrom!=F7.display.reportedViewFrom||F7.display.viewTo!=F7.display.reportedViewTo){AD(F7,"viewportChange",F7,F7.display.viewFrom,F7.display.viewTo);F7.display.reportedViewFrom=F7.display.viewFrom;F7.display.reportedViewTo=F7.display.viewTo}}function Dn(F7,F6){var F9=new Af(F7,F6);if(c(F7,F9)){A5(F7);CI(F7,F9);var F8=DU(F7);Ba(F7);DT(F7,F8);Es(F7,F8)}}function DT(F6,F7){F6.display.sizer.style.minHeight=F7.docHeight+"px";var F8=F7.docHeight+F6.display.barHeight;F6.display.heightForcer.style.top=F8+"px";F6.display.gutters.style.height=Math.max(F8+Cq(F6),F7.clientHeight)+"px"}function A5(GD){var GB=GD.display;var F7=GB.lineDiv.offsetTop;for(var F8=0;F8<GB.view.length;F8++){var GE=GB.view[F8],GF;if(GE.hidden){continue}if(De&&K<8){var GA=GE.node.offsetTop+GE.node.offsetHeight;GF=GA-F7;F7=GA}else{var F9=GE.node.getBoundingClientRect();GF=F9.bottom-F9.top}var GC=GE.line.height-GF;if(GF<2){GF=At(GB)}if(GC>0.001||GC<-0.001){Fu(GE.line,GF);B9(GE.line);if(GE.rest){for(var F6=0;F6<GE.rest.length;F6++){B9(GE.rest[F6])}}}}}function B9(F6){if(F6.widgets){for(var F7=0;F7<F6.widgets.length;++F7){F6.widgets[F7].height=F6.widgets[F7].node.offsetHeight}}}function E7(F6){var GB=F6.display,F9={},F8={};var GA=GB.gutters.clientLeft;for(var GC=GB.gutters.firstChild,F7=0;GC;GC=GC.nextSibling,++F7){F9[F6.options.gutters[F7]]=GC.offsetLeft+GC.clientLeft+GA;F8[F6.options.gutters[F7]]=GC.clientWidth}return{fixedPos:Dr(GB),gutterTotalWidth:GB.gutters.offsetWidth,gutterLeft:F9,gutterWidth:F8,wrapperWidth:GB.wrapper.clientWidth}}function CL(GH,F8,GG){var GD=GH.display,GJ=GH.options.lineNumbers;var F6=GD.lineDiv,GI=F6.firstChild;function GC(GL){var GK=GL.nextSibling;if(Cx&&B5&&GH.display.currentWheelTarget==GL){GL.style.display="none"}else{GL.parentNode.removeChild(GL)}return GK}var GE=GD.view,GB=GD.viewFrom;for(var F9=0;F9<GE.length;F9++){var GA=GE[F9];if(GA.hidden){}else{if(!GA.node){var F7=Ac(GH,GA,GB,GG);F6.insertBefore(F7,GI)}else{while(GI!=GA.node){GI=GC(GI)}var GF=GJ&&F8!=null&&F8<=GB&&GA.lineNumber;if(GA.changes){if(DE(GA.changes,"gutter")>-1){GF=false}AA(GH,GA,GB,GG)}if(GF){Dv(GA.lineNumber);GA.lineNumber.appendChild(document.createTextNode(EM(GH.options,GB)))}GI=GA.node.nextSibling}}GB+=GA.size}while(GI){GI=GC(GI)}}function AA(F6,F8,GA,GB){for(var F7=0;F7<F8.changes.length;F7++){var F9=F8.changes[F7];if(F9=="text"){FF(F6,F8)}else{if(F9=="gutter"){DC(F6,F8,GA,GB)}else{if(F9=="class"){Da(F8)}else{if(F9=="widget"){AN(F8,GB)}}}}}F8.changes=null}function Fd(F6){if(F6.node==F6.text){F6.node=Fr("div",null,null,"position: relative");if(F6.text.parentNode){F6.text.parentNode.replaceChild(F6.node,F6.text)}F6.node.appendChild(F6.text);if(De&&K<8){F6.node.style.zIndex=2}}return F6.node}function EO(F7){var F6=F7.bgClass?F7.bgClass+" "+(F7.line.bgClass||""):F7.line.bgClass;if(F6){F6+=" CodeMirror-linebackground"}if(F7.background){if(F6){F7.background.className=F6}else{F7.background.parentNode.removeChild(F7.background);F7.background=null}}else{if(F6){var F8=Fd(F7);F7.background=F8.insertBefore(Fr("div",null,F6),F8.firstChild)}}}function Dp(F6,F7){var F8=F6.display.externalMeasured;if(F8&&F8.line==F7.line){F6.display.externalMeasured=null;F7.measure=F8.measure;return F8.built}return El(F6,F7)}function FF(F6,F9){var F7=F9.text.className;var F8=Dp(F6,F9);if(F9.text==F9.node){F9.node=F8.pre}F9.text.parentNode.replaceChild(F8.pre,F9.text);F9.text=F8.pre;if(F8.bgClass!=F9.bgClass||F8.textClass!=F9.textClass){F9.bgClass=F8.bgClass;F9.textClass=F8.textClass;Da(F9)}else{if(F7){F9.text.className=F7}}}function Da(F7){EO(F7);if(F7.line.wrapClass){Fd(F7).className=F7.line.wrapClass}else{if(F7.node!=F7.text){F7.node.className=""}}var F6=F7.textClass?F7.textClass+" "+(F7.line.textClass||""):F7.line.textClass;F7.text.className=F6||""}function DC(GE,GC,GB,GD){if(GC.gutter){GC.node.removeChild(GC.gutter);GC.gutter=null}var F9=GC.line.gutterMarkers;if(GE.options.lineNumbers||F9){var F7=Fd(GC);var GA=GC.gutter=F7.insertBefore(Fr("div",null,"CodeMirror-gutter-wrapper","left: "+(GE.options.fixedGutter?GD.fixedPos:-GD.gutterTotalWidth)+"px; width: "+GD.gutterTotalWidth+"px"),GC.text);if(GC.line.gutterClass){GA.className+=" "+GC.line.gutterClass}if(GE.options.lineNumbers&&(!F9||!F9["CodeMirror-linenumbers"])){GC.lineNumber=GA.appendChild(Fr("div",EM(GE.options,GB),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+GD.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+GE.display.lineNumInnerWidth+"px"))}if(F9){for(var F8=0;F8<GE.options.gutters.length;++F8){var F6=GE.options.gutters[F8],GF=F9.hasOwnProperty(F6)&&F9[F6];if(GF){GA.appendChild(Fr("div",[GF],"CodeMirror-gutter-elt","left: "+GD.gutterLeft[F6]+"px; width: "+GD.gutterWidth[F6]+"px"))}}}}}function AN(F6,F9){if(F6.alignable){F6.alignable=null}for(var F8=F6.node.firstChild,F7;F8;F8=F7){var F7=F8.nextSibling;if(F8.className=="CodeMirror-linewidget"){F6.node.removeChild(F8)}}FO(F6,F9)}function Ac(F6,F8,F9,GA){var F7=Dp(F6,F8);F8.text=F8.node=F7.pre;if(F7.bgClass){F8.bgClass=F7.bgClass}if(F7.textClass){F8.textClass=F7.textClass}Da(F8);DC(F6,F8,F9,GA);FO(F8,GA);return F8.node}function FO(F7,F8){Fw(F7.line,F7,F8,true);if(F7.rest){for(var F6=0;F6<F7.rest.length;F6++){Fw(F7.rest[F6],F7,F8,false)}}}function Fw(GE,GB,GD,F9){if(!GE.widgets){return }var F6=Fd(GB);for(var F8=0,GC=GE.widgets;F8<GC.length;++F8){var GA=GC[F8],F7=Fr("div",[GA.node],"CodeMirror-linewidget");if(!GA.handleMouseEvents){F7.setAttribute("cm-ignore-events","true")}Bd(GA,F7,GB,GD);if(F9&&GA.above){F6.insertBefore(F7,GB.gutter||GB.text)}else{F6.appendChild(F7)}AD(GA,"redraw")}}function Bd(F9,F8,F6,GA){if(F9.noHScroll){(F6.alignable||(F6.alignable=[])).push(F8);var F7=GA.wrapperWidth;F8.style.left=GA.fixedPos+"px";if(!F9.coverGutter){F7-=GA.gutterTotalWidth;F8.style.paddingLeft=GA.gutterTotalWidth+"px"}F8.style.width=F7+"px"}if(F9.coverGutter){F8.style.zIndex=5;F8.style.position="relative";if(!F9.noHScroll){F8.style.marginLeft=-GA.gutterTotalWidth+"px"}}}var x=i.Pos=function(F6,F7){if(!(this instanceof x)){return new x(F6,F7)}this.line=F6;this.ch=F7};var CD=i.cmpPos=function(F7,F6){return F7.line-F6.line||F7.ch-F6.ch};function CH(F6){return x(F6.line,F6.ch)}function BV(F7,F6){return CD(F7,F6)<0?F6:F7}function AQ(F7,F6){return CD(F7,F6)<0?F7:F6}function Fs(F6,F7){this.ranges=F6;this.primIndex=F7}Fs.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(F6){if(F6==this){return true}if(F6.primIndex!=this.primIndex||F6.ranges.length!=this.ranges.length){return false}for(var F8=0;F8<this.ranges.length;F8++){var F7=this.ranges[F8],F9=F6.ranges[F8];if(CD(F7.anchor,F9.anchor)!=0||CD(F7.head,F9.head)!=0){return false}}return true},deepCopy:function(){for(var F6=[],F7=0;F7<this.ranges.length;F7++){F6[F7]=new Ds(CH(this.ranges[F7].anchor),CH(this.ranges[F7].head))}return new Fs(F6,this.primIndex)},somethingSelected:function(){for(var F6=0;F6<this.ranges.length;F6++){if(!this.ranges[F6].empty()){return true}}return false},contains:function(F9,F6){if(!F6){F6=F9}for(var F8=0;F8<this.ranges.length;F8++){var F7=this.ranges[F8];if(CD(F6,F7.from())>=0&&CD(F9,F7.to())<=0){return F8}}return -1}};function Ds(F6,F7){this.anchor=F6;this.head=F7}Ds.prototype={from:function(){return AQ(this.anchor,this.head)},to:function(){return BV(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};function CV(F6,GD){var F8=F6[GD];F6.sort(function(GG,GF){return CD(GG.from(),GF.from())});GD=DE(F6,F8);for(var GA=1;GA<F6.length;GA++){var GE=F6[GA],F7=F6[GA-1];if(CD(F7.to(),GE.from())>=0){var GB=AQ(F7.from(),GE.from()),GC=BV(F7.to(),GE.to());var F9=F7.empty()?GE.from()==GE.head:F7.from()==F7.head;if(GA<=GD){--GD}F6.splice(--GA,2,new Ds(F9?GC:GB,F9?GB:GC))}}return new Fs(F6,GD)}function Em(F6,F7){return new Fs([new Ds(F6,F7||F6)],0)}function C2(F6,F7){return Math.max(F6.first,Math.min(F7,F6.first+F6.size-1))}function Fe(F7,F8){if(F8.line<F7.first){return x(F7.first,0)}var F6=F7.first+F7.size-1;if(F8.line>F6){return x(F6,E9(F7,F6).text.length)}return FN(F8,E9(F7,F8.line).text.length)}function FN(F8,F7){var F6=F8.ch;if(F6==null||F6>F7){return x(F8.line,F7)}else{if(F6<0){return x(F8.line,0)}else{return F8}}}function B7(F7,F6){return F6>=F7.first&&F6<F7.first+F7.size}function Dt(F8,F9){for(var F6=[],F7=0;F7<F9.length;F7++){F6[F7]=Fe(F8,F9[F7])}return F6}function FQ(GB,F7,GA,F6){if(GB.cm&&GB.cm.display.shift||GB.extend){var F9=F7.anchor;if(F6){var F8=CD(GA,F9)<0;if(F8!=(CD(F6,F9)<0)){F9=GA;GA=F6}else{if(F8!=(CD(GA,F6)<0)){GA=F6}}}return new Ds(F9,GA)}else{return new Ds(F6||GA,GA)}}function Fo(F9,F8,F6,F7){Bs(F9,new Fs([FQ(F9,F9.sel.primary(),F8,F6)],0),F7)}function AU(GB,GA,F8){for(var F7=[],F9=0;F9<GB.sel.ranges.length;F9++){F7[F9]=FQ(GB,GB.sel.ranges[F9],GA[F9],null)}var F6=CV(F7,GB.sel.primIndex);Bs(GB,F6,F8)}function E(GA,F9,F7,F8){var F6=GA.sel.ranges.slice(0);F6[F9]=F7;Bs(GA,CV(F6,GA.sel.primIndex),F8)}function g(F9,F7,F8,F6){Bs(F9,Em(F7,F8),F6)}function C(F8,F6){var F7={ranges:F6.ranges,update:function(F9){this.ranges=[];for(var GA=0;GA<F9.length;GA++){this.ranges[GA]=new Ds(Fe(F8,F9[GA].anchor),Fe(F8,F9[GA].head))}}};Ab(F8,"beforeSelectionChange",F8,F7);if(F8.cm){Ab(F8.cm,"beforeSelectionChange",F8.cm,F7)}if(F7.ranges!=F6.ranges){return CV(F7.ranges,F7.ranges.length-1)}else{return F6}}function E1(GA,F9,F7){var F6=GA.history.done,F8=Fc(F6);if(F8&&F8.ranges){F6[F6.length-1]=F9;EJ(GA,F9,F7)}else{Bs(GA,F9,F7)}}function Bs(F8,F7,F6){EJ(F8,F7,F6);F0(F8,F8.sel,F8.cm?F8.cm.curOp.id:NaN,F6)}function EJ(F9,F8,F7){if(FC(F9,"beforeSelectionChange")||F9.cm&&FC(F9.cm,"beforeSelectionChange")){F8=C(F9,F8)}var F6=F7&&F7.bias||(CD(F8.primary().head,F9.sel.primary().head)<0?-1:1);C6(F9,N(F9,F8,F6,true));if(!(F7&&F7.scroll===false)&&F9.cm){Fb(F9.cm)}}function C6(F7,F6){if(F6.equals(F7.sel)){return }F7.sel=F6;if(F7.cm){F7.cm.curOp.updateInput=F7.cm.curOp.selectionChanged=true;w(F7.cm)}AD(F7,"cursorActivity",F7)}function ER(F6){C6(F6,N(F6,F6.sel,null,false),z)}function N(GE,F6,GB,GC){var F8;for(var F9=0;F9<F6.ranges.length;F9++){var GA=F6.ranges[F9];var GD=Bt(GE,GA.anchor,GB,GC);var F7=Bt(GE,GA.head,GB,GC);if(F8||GD!=GA.anchor||F7!=GA.head){if(!F8){F8=F6.ranges.slice(0,F9)}F8[F9]=new Ds(GD,F7)}}return F8?CV(F8,F6.primIndex):F6}function Bt(GF,GE,GB,GC){var GG=false,F8=GE;var F9=GB||1;GF.cantEdit=false;search:for(;;){var GH=E9(GF,F8.line);if(GH.markedSpans){for(var GA=0;GA<GH.markedSpans.length;++GA){var F6=GH.markedSpans[GA],F7=F6.marker;if((F6.from==null||(F7.inclusiveLeft?F6.from<=F8.ch:F6.from<F8.ch))&&(F6.to==null||(F7.inclusiveRight?F6.to>=F8.ch:F6.to>F8.ch))){if(GC){Ab(F7,"beforeCursorEnter");if(F7.explicitlyCleared){if(!GH.markedSpans){break}else{--GA;continue}}}if(!F7.atomic){continue}var GD=F7.find(F9<0?-1:1);if(CD(GD,F8)==0){GD.ch+=F9;if(GD.ch<0){if(GD.line>GF.first){GD=Fe(GF,x(GD.line-1))}else{GD=null}}else{if(GD.ch>GH.text.length){if(GD.line<GF.first+GF.size-1){GD=x(GD.line+1,0)}else{GD=null}}}if(!GD){if(GG){if(!GC){return Bt(GF,GE,GB,true)}GF.cantEdit=true;return x(GF.first,0)}GG=true;GD=GE;F9=-F9}}F8=GD;continue search}}}return F8}}function BJ(GG){var GC=GG.display,GF=GG.doc,GH={};var GE=GH.cursors=document.createDocumentFragment();var F8=GH.selection=document.createDocumentFragment();for(var GA=0;GA<GF.sel.ranges.length;GA++){var GB=GF.sel.ranges[GA];var F9=GB.empty();if(F9||GG.options.showCursorWhenSelecting){a(GG,GB,GE)}if(!F9){Bb(GG,GB,F8)}}if(GG.options.moveInputWithCursor){var GD=Do(GG,GF.sel.primary().head,"div");var F6=GC.wrapper.getBoundingClientRect(),F7=GC.lineDiv.getBoundingClientRect();GH.teTop=Math.max(0,Math.min(GC.wrapper.clientHeight-10,GD.top+F7.top-F6.top));GH.teLeft=Math.max(0,Math.min(GC.wrapper.clientWidth-10,GD.left+F7.left-F6.left))}return GH}function AK(F6,F7){Bp(F6.display.cursorDiv,F7.cursors);Bp(F6.display.selectionDiv,F7.selection);if(F7.teTop!=null){F6.display.inputDiv.style.top=F7.teTop+"px";F6.display.inputDiv.style.left=F7.teLeft+"px"}}function Ba(F6){AK(F6,BJ(F6))}function a(F6,F9,F8){var GB=Do(F6,F9.head,"div",null,null,!F6.options.singleCursorHeightPerLine);var GA=F8.appendChild(Fr("div","\u00a0","CodeMirror-cursor"));GA.style.left=GB.left+"px";GA.style.top=GB.top+"px";GA.style.height=Math.max(0,GB.bottom-GB.top)*F6.options.cursorHeight+"px";if(GB.other){var F7=F8.appendChild(Fr("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor"));F7.style.display="";F7.style.left=GB.other.left+"px";F7.style.top=GB.other.top+"px";F7.style.height=(GB.other.bottom-GB.other.top)*0.85+"px"}}function Bb(GA,GG,GB){var GJ=GA.display,GN=GA.doc;var F6=document.createDocumentFragment();var GF=Ez(GA.display),F9=GF.left;var GK=Math.max(GJ.sizerWidth,DH(GA)-GJ.sizer.offsetLeft)-GF.right;function GH(GR,GQ,GP,GO){if(GQ<0){GQ=0}GQ=Math.round(GQ);GO=Math.round(GO);F6.appendChild(Fr("div",null,"CodeMirror-selected","position: absolute; left: "+GR+"px; top: "+GQ+"px; width: "+(GP==null?GK-GR:GP)+"px; height: "+(GO-GQ)+"px"))}function F7(GP,GR,GU){var GQ=E9(GN,GP);var GS=GQ.text.length;var GV,GO;function GT(GX,GW){return Cg(GA,x(GP,GX),"div",GQ,GW)}Dy(A(GQ),GR||0,GU==null?GS:GU,function(Gd,Gc,GW){var GZ=GT(Gd,"left"),Ga,Gb,GY;if(Gd==Gc){Ga=GZ;Gb=GY=GZ.left}else{Ga=GT(Gc-1,"right");if(GW=="rtl"){var GX=GZ;GZ=Ga;Ga=GX}Gb=GZ.left;GY=Ga.right}if(GR==null&&Gd==0){Gb=F9}if(Ga.top-GZ.top>3){GH(Gb,GZ.top,null,GZ.bottom);Gb=F9;if(GZ.bottom<Ga.top){GH(Gb,GZ.bottom,null,Ga.top)}}if(GU==null&&Gc==GS){GY=GK}if(!GV||GZ.top<GV.top||GZ.top==GV.top&&GZ.left<GV.left){GV=GZ}if(!GO||Ga.bottom>GO.bottom||Ga.bottom==GO.bottom&&Ga.right>GO.right){GO=Ga}if(Gb<F9+1){Gb=F9}GH(Gb,Ga.top,GY-Gb,Ga.bottom)});return{start:GV,end:GO}}var GM=GG.from(),GL=GG.to();if(GM.line==GL.line){F7(GM.line,GM.ch,GL.ch)}else{var F8=E9(GN,GM.line),GD=E9(GN,GL.line);var GC=Y(F8)==Y(GD);var GE=F7(GM.line,GM.ch,GC?F8.text.length+1:null).end;var GI=F7(GL.line,GC?0:null,GL.ch).start;if(GC){if(GE.top<GI.top-2){GH(GE.right,GE.top,null,GE.bottom);GH(F9,GI.top,GI.left,GI.bottom)}else{GH(GE.right,GE.top,GI.left-GE.right,GE.bottom)}}if(GE.bottom<GI.top){GH(F9,GE.bottom,null,GI.top)}}GB.appendChild(F6)}function O(F6){if(!F6.state.focused){return }var F8=F6.display;clearInterval(F8.blinker);var F7=true;F8.cursorDiv.style.visibility="";if(F6.options.cursorBlinkRate>0){F8.blinker=setInterval(function(){F8.cursorDiv.style.visibility=(F7=!F7)?"":"hidden"},F6.options.cursorBlinkRate)}else{if(F6.options.cursorBlinkRate<0){F8.cursorDiv.style.visibility="hidden"}}}function D9(F6,F7){if(F6.doc.mode.startState&&F6.doc.frontier<F6.display.viewTo){F6.state.highlight.set(F7,CU(Cm,F6))}}function Cm(F6){var GA=F6.doc;if(GA.frontier<GA.first){GA.frontier=GA.first}if(GA.frontier>=F6.display.viewTo){return }var F8=+new Date+F6.options.workTime;var F9=B1(GA.mode,DV(F6,GA.frontier));var F7=[];GA.iter(GA.frontier,Math.min(GA.first+GA.size,F6.display.viewTo+500),function(GB){if(GA.frontier>=F6.display.viewFrom){var GE=GB.styles;var GG=FU(F6,GB,F9,true);GB.styles=GG.styles;var GD=GB.styleClasses,GF=GG.classes;if(GF){GB.styleClasses=GF}else{if(GD){GB.styleClasses=null}}var GH=!GE||GE.length!=GB.styles.length||GD!=GF&&(!GD||!GF||GD.bgClass!=GF.bgClass||GD.textClass!=GF.textClass);for(var GC=0;!GH&&GC<GE.length;++GC){GH=GE[GC]!=GB.styles[GC]}if(GH){F7.push(GA.frontier)}GB.stateAfter=B1(GA.mode,F9)}else{DR(F6,GB.text,F9);GB.stateAfter=GA.frontier%5==0?B1(GA.mode,F9):null}++GA.frontier;if(+new Date>F8){D9(F6,F6.options.workDelay);return true}});if(F7.length){Cj(F6,function(){for(var GB=0;GB<F7.length;GB++){s(F6,F7[GB],"text")}})}}function CX(GC,F6,F9){var F7,GA,GB=GC.doc;var F8=F9?-1:F6-(GC.doc.mode.innerMode?1000:100);for(var GF=F6;GF>F8;--GF){if(GF<=GB.first){return GB.first}var GE=E9(GB,GF-1);if(GE.stateAfter&&(!F9||GF<=GB.frontier)){return GF}var GD=Br(GE.text,null,GC.options.tabSize);if(GA==null||F7>GD){GA=GF-1;F7=GD}}return GA}function DV(F6,GC,F7){var GA=F6.doc,F9=F6.display;if(!GA.mode.startState){return true}var GB=CX(F6,GC,F7),F8=GB>GA.first&&E9(GA,GB-1).stateAfter;if(!F8){F8=By(GA.mode)}else{F8=B1(GA.mode,F8)}GA.iter(GB,GC,function(GD){DR(F6,GD.text,F8);var GE=GB==GC-1||GB%5==0||GB>=F9.viewFrom&&GB<F9.viewTo;GD.stateAfter=GE?B1(GA.mode,F8):null;++GB});if(F7){GA.frontier=GB}return F8}function E2(F6){return F6.lineSpace.offsetTop}function Bg(F6){return F6.mover.offsetHeight-F6.lineSpace.offsetHeight}function Ez(F9){if(F9.cachedPaddingH){return F9.cachedPaddingH}var F8=Bp(F9.measure,Fr("pre","x"));var F6=window.getComputedStyle?window.getComputedStyle(F8):F8.currentStyle;var F7={left:parseInt(F6.paddingLeft),right:parseInt(F6.paddingRight)};if(!isNaN(F7.left)&&!isNaN(F7.right)){F9.cachedPaddingH=F7}return F7}function Cq(F6){return Dd-F6.display.nativeBarWidth}function DH(F6){return F6.display.scroller.clientWidth-Cq(F6)-F6.display.barWidth}function Cs(F6){return F6.display.scroller.clientHeight-Cq(F6)-F6.display.barHeight}function CG(GD,F9,GC){var F8=GD.options.lineWrapping;var GA=F8&&DH(GD);if(!F9.measure.heights||F8&&F9.measure.width!=GA){var GB=F9.measure.heights=[];if(F8){F9.measure.width=GA;var GF=F9.text.firstChild.getClientRects();for(var F6=0;F6<GF.length-1;F6++){var GE=GF[F6],F7=GF[F6+1];if(Math.abs(GE.bottom-F7.bottom)>2){GB.push((GE.bottom+F7.top)/2-GC.top)}}}GB.push(GC.bottom-GC.top)}}function CS(F8,F6,F9){if(F8.line==F6){return{map:F8.measure.map,cache:F8.measure.cache}}for(var F7=0;F7<F8.rest.length;F7++){if(F8.rest[F7]==F6){return{map:F8.measure.maps[F7],cache:F8.measure.caches[F7]}}}for(var F7=0;F7<F8.rest.length;F7++){if(Bl(F8.rest[F7])>F9){return{map:F8.measure.maps[F7],cache:F8.measure.caches[F7],before:true}}}}function Cy(F6,F8){F8=Y(F8);var GA=Bl(F8);var F7=F6.display.externalMeasured=new BT(F6.doc,F8,GA);F7.lineN=GA;var F9=F7.built=El(F6,F7);F7.text=F9.pre;Bp(F6.display.lineMeasure,F9.pre);return F7}function EB(F6,F7,F9,F8){return d(F6,A0(F6,F7),F9,F8)}function E5(F6,F8){if(F8>=F6.display.viewFrom&&F8<F6.display.viewTo){return F6.display.view[DM(F6,F8)]}var F7=F6.display.externalMeasured;if(F7&&F8>=F7.lineN&&F8<F7.lineN+F7.size){return F7}}function A0(F6,F8){var F9=Bl(F8);var F7=E5(F6,F9);if(F7&&!F7.text){F7=null}else{if(F7&&F7.changes){AA(F6,F7,F9,E7(F6))}}if(!F7){F7=Cy(F6,F8)}var GA=CS(F7,F8,F9);return{line:F8,view:F7,rect:null,map:GA.map,cache:GA.cache,before:GA.before,hasHeights:false}}function d(F6,GC,GA,F7,F9){if(GC.before){GA=-1}var F8=GA+(F7||""),GB;if(GC.cache.hasOwnProperty(F8)){GB=GC.cache[F8]}else{if(!GC.rect){GC.rect=GC.view.text.getBoundingClientRect()}if(!GC.hasHeights){CG(F6,GC.view,GC.rect);GC.hasHeights=true}GB=J(F6,GC,GA,F7);if(!GB.bogus){GC.cache[F8]=GB}}return{left:GB.left,right:GB.right,top:F9?GB.rtop:GB.top,bottom:F9?GB.rbottom:GB.bottom}}var EV={left:0,right:0,top:0,bottom:0};function J(GD,GN,GF,GB){var GR=GN.map;var GK,GA,F9,F6;for(var GM=0;GM<GR.length;GM+=3){var GP=GR[GM],GL=GR[GM+1];if(GF<GP){GA=0;F9=1;F6="left"}else{if(GF<GL){GA=GF-GP;F9=GA+1}else{if(GM==GR.length-3||GF==GL&&GR[GM+3]>GF){F9=GL-GP;GA=F9-1;if(GF>=GL){F6="right"}}}}if(GA!=null){GK=GR[GM+2];if(GP==GL&&GB==(GK.insertLeft?"left":"right")){F6=GB}if(GB=="left"&&GA==0){while(GM&&GR[GM-2]==GR[GM-3]&&GR[GM-1].insertLeft){GK=GR[(GM-=3)+2];F6="left"}}if(GB=="right"&&GA==GL-GP){while(GM<GR.length-3&&GR[GM+3]==GR[GM+4]&&!GR[GM+5].insertLeft){GK=GR[(GM+=3)+2];F6="right"}}break}}var F7;if(GK.nodeType==3){for(var GM=0;GM<4;GM++){while(GA&&FK(GN.line.text.charAt(GP+GA))){--GA}while(GP+F9<GL&&FK(GN.line.text.charAt(GP+F9))){++F9}if(De&&K<9&&GA==0&&F9==GL-GP){F7=GK.parentNode.getBoundingClientRect()}else{if(De&&GD.options.lineWrapping){var F8=CK(GK,GA,F9).getClientRects();if(F8.length){F7=F8[GB=="right"?F8.length-1:0]}else{F7=EV}}else{F7=CK(GK,GA,F9).getBoundingClientRect()||EV}}if(F7.left||F7.right||GA==0){break}F9=GA;GA=GA-1;F6="right"}if(De&&K<11){F7=Eh(GD.display.measure,F7)}}else{if(GA>0){F6=GB="right"}var F8;if(GD.options.lineWrapping&&(F8=GK.getClientRects()).length>1){F7=F8[GB=="right"?F8.length-1:0]}else{F7=GK.getBoundingClientRect()}}if(De&&K<9&&!GA&&(!F7||!F7.left&&!F7.right)){var GC=GK.parentNode.getClientRects()[0];if(GC){F7={left:GC.left,right:GC.left+DX(GD.display),top:GC.top,bottom:GC.bottom}}else{F7=EV}}var GI=F7.top-GN.rect.top,GG=F7.bottom-GN.rect.top;var GQ=(GI+GG)/2;var GO=GN.view.measure.heights;for(var GM=0;GM<GO.length-1;GM++){if(GQ<GO[GM]){break}}var GJ=GM?GO[GM-1]:0,GH=GO[GM];var GE={left:(F6=="right"?F7.right:F7.left)-GN.rect.left,right:(F6=="left"?F7.left:F7.right)-GN.rect.left,top:GJ,bottom:GH};if(!F7.left&&!F7.right){GE.bogus=true}if(!GD.options.singleCursorHeightPerLine){GE.rtop=GI;GE.rbottom=GG}return GE}function Eh(F8,F9){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ah(F8)){return F9}var F7=screen.logicalXDPI/screen.deviceXDPI;var F6=screen.logicalYDPI/screen.deviceYDPI;return{left:F9.left*F7,right:F9.right*F7,top:F9.top*F6,bottom:F9.bottom*F6}}function AS(F7){if(F7.measure){F7.measure.cache={};F7.measure.heights=null;if(F7.rest){for(var F6=0;F6<F7.rest.length;F6++){F7.measure.caches[F6]={}}}}}function Ak(F6){F6.display.externalMeasure=null;Dv(F6.display.lineMeasure);for(var F7=0;F7<F6.display.view.length;F7++){AS(F6.display.view[F7])}}function AJ(F6){Ak(F6);F6.display.cachedCharWidth=F6.display.cachedTextHeight=F6.display.cachedPaddingH=null;if(!F6.options.lineWrapping){F6.display.maxLineChanged=true}F6.display.lineNumChars=null}function CT(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function CR(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ek(GC,F9,GB,F7){if(F9.widgets){for(var F8=0;F8<F9.widgets.length;++F8){if(F9.widgets[F8].above){var GE=Cv(F9.widgets[F8]);GB.top+=GE;GB.bottom+=GE}}}if(F7=="line"){return GB}if(!F7){F7="local"}var GA=Bk(F9);if(F7=="local"){GA+=E2(GC.display)}else{GA-=GC.display.viewOffset}if(F7=="page"||F7=="window"){var F6=GC.display.lineSpace.getBoundingClientRect();GA+=F6.top+(F7=="window"?0:CR());var GD=F6.left+(F7=="window"?0:CT());GB.left+=GD;GB.right+=GD}GB.top+=GA;GB.bottom+=GA;return GB}function F3(F7,GA,F8){if(F8=="div"){return GA}var GC=GA.left,GB=GA.top;if(F8=="page"){GC-=CT();GB-=CR()}else{if(F8=="local"||!F8){var F9=F7.display.sizer.getBoundingClientRect();GC+=F9.left;GB+=F9.top}}var F6=F7.display.lineSpace.getBoundingClientRect();return{left:GC-F6.left,top:GB-F6.top}}function Cg(F6,GA,F9,F8,F7){if(!F8){F8=E9(F6.doc,GA.line)}return Ek(F6,F8,EB(F6,F8,GA.ch,F7),F9)}function Do(GF,GE,F8,GC,GH,GD){GC=GC||E9(GF.doc,GE.line);if(!GH){GH=A0(GF,GC)}function GA(GK,GJ){var GI=d(GF,GH,GK,GJ?"right":"left",GD);if(GJ){GI.left=GI.right}else{GI.right=GI.left}return Ek(GF,GC,GI,F8)}function GG(GL,GI){var GJ=GB[GI],GK=GJ.level%2;if(GL==DS(GJ)&&GI&&GJ.level<GB[GI-1].level){GJ=GB[--GI];GL=F2(GJ)-(GJ.level%2?0:1);GK=true}else{if(GL==F2(GJ)&&GI<GB.length-1&&GJ.level<GB[GI+1].level){GJ=GB[++GI];GL=DS(GJ)-GJ.level%2;GK=false}}if(GK&&GL==GJ.to&&GL>GJ.from){return GA(GL-1)}return GA(GL,GK)}var GB=A(GC),F6=GE.ch;if(!GB){return GA(F6)}var F7=Ad(GB,F6);var F9=GG(F6,F7);if(Ew!=null){F9.other=GG(F6,Ew)}return F9}function Db(F6,GA){var F9=0,GA=Fe(F6.doc,GA);if(!F6.options.lineWrapping){F9=DX(F6.display)*GA.ch}var F7=E9(F6.doc,GA.line);var F8=Bk(F7)+E2(F6.display);return{left:F9,right:F9,top:F8,bottom:F8+F7.height}}function Fq(F6,F7,F8,GA){var F9=x(F6,F7);F9.xRel=GA;if(F8){F9.outside=true}return F9}function Fj(GD,GA,F9){var GC=GD.doc;F9+=GD.display.viewOffset;if(F9<0){return Fq(GC.first,0,true,-1)}var F8=Be(GC,F9),GE=GC.first+GC.size-1;if(F8>GE){return Fq(GC.first+GC.size-1,E9(GC,GE).text.length,true,1)}if(GA<0){GA=0}var F7=E9(GC,F8);for(;;){var GF=Cw(GD,F7,F8,GA,F9);var GB=EP(F7);var F6=GB&&GB.find(0,true);if(GB&&(GF.ch>F6.from.ch||GF.ch==F6.from.ch&&GF.xRel>0)){F8=Bl(F7=F6.to.line)}else{return GF}}}function Cw(GG,F8,GJ,GI,GH){var GF=GH-Bk(F8);var GC=false,GP=2*GG.display.wrapper.clientWidth;var GM=A0(GG,F8);function GT(GV){var GW=Do(GG,x(GJ,GV),"line",F8,GM);GC=true;if(GF>GW.bottom){return GW.left-GP}else{if(GF<GW.top){return GW.left+GP}else{GC=false}}return GW.left}var GL=A(F8),GO=F8.text.length;var GQ=Cc(F8),F9=Cp(F8);var GN=GT(GQ),F6=GC,F7=GT(F9),GB=GC;if(GI>F7){return Fq(GJ,F9,GB,1)}for(;;){if(GL?F9==GQ||F9==U(F8,GQ,1):F9-GQ<=1){var GK=GI<GN||GI-GN<=F7-GI?GQ:F9;var GS=GI-(GK==GQ?GN:F7);while(FK(F8.text.charAt(GK))){++GK}var GE=Fq(GJ,GK,GK==GQ?F6:GB,GS<-1?-1:GS>1?1:0);return GE}var GD=Math.ceil(GO/2),GU=GQ+GD;if(GL){GU=GQ;for(var GR=0;GR<GD;++GR){GU=U(F8,GU,1)}}var GA=GT(GU);if(GA>GI){F9=GU;F7=GA;if(GB=GC){F7+=1000}GO=GD}else{GQ=GU;GN=GA;F6=GC;GO-=GD}}}var Ae;function At(F8){if(F8.cachedTextHeight!=null){return F8.cachedTextHeight}if(Ae==null){Ae=Fr("pre");for(var F7=0;F7<49;++F7){Ae.appendChild(document.createTextNode("x"));Ae.appendChild(Fr("br"))}Ae.appendChild(document.createTextNode("x"))}Bp(F8.measure,Ae);var F6=Ae.offsetHeight/50;if(F6>3){F8.cachedTextHeight=F6}Dv(F8.measure);return F6||1}function DX(GA){if(GA.cachedCharWidth!=null){return GA.cachedCharWidth}var F6=Fr("span","xxxxxxxxxx");var F9=Fr("pre",[F6]);Bp(GA.measure,F9);var F8=F6.getBoundingClientRect(),F7=(F8.right-F8.left)/10;if(F7>2){GA.cachedCharWidth=F7}return F7||10}var BN=null;var D2=0;function Cf(F6){F6.curOp={cm:F6,viewChanged:false,startHeight:F6.doc.height,forceUpdate:false,updateInput:null,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++D2};if(BN){BN.ops.push(F6.curOp)}else{F6.curOp.ownsGroup=BN={ops:[F6.curOp],delayedCallbacks:[]}}}function Cr(F9){var F8=F9.delayedCallbacks,F7=0;do{for(;F7<F8.length;F7++){F8[F7]()}for(var F6=0;F6<F9.ops.length;F6++){var GA=F9.ops[F6];if(GA.cursorActivityHandlers){while(GA.cursorActivityCalled<GA.cursorActivityHandlers.length){GA.cursorActivityHandlers[GA.cursorActivityCalled++](GA.cm)}}}}while(F7<F8.length)}function AL(F6){var F9=F6.curOp,F8=F9.ownsGroup;if(!F8){return }try{Cr(F8)}finally{BN=null;for(var F7=0;F7<F8.ops.length;F7++){F8.ops[F7].cm.curOp=null}Ch(F8)}}function Ch(F8){var F7=F8.ops;for(var F6=0;F6<F7.length;F6++){B3(F7[F6])}for(var F6=0;F6<F7.length;F6++){AP(F7[F6])}for(var F6=0;F6<F7.length;F6++){B0(F7[F6])}for(var F6=0;F6<F7.length;F6++){AO(F7[F6])}for(var F6=0;F6<F7.length;F6++){Eu(F7[F6])}}function B3(F8){var F6=F8.cm,F7=F6.display;k(F6);if(F8.updateMaxLine){G(F6)}F8.mustUpdate=F8.viewChanged||F8.forceUpdate||F8.scrollTop!=null||F8.scrollToPos&&(F8.scrollToPos.from.line<F7.viewFrom||F8.scrollToPos.to.line>=F7.viewTo)||F7.maxLineChanged&&F6.options.lineWrapping;F8.update=F8.mustUpdate&&new Af(F6,F8.mustUpdate&&{top:F8.scrollTop,ensure:F8.scrollToPos},F8.forceUpdate)}function AP(F6){F6.updatedDisplay=F6.mustUpdate&&c(F6.cm,F6.update)}function B0(F8){var F6=F8.cm,F7=F6.display;if(F8.updatedDisplay){A5(F6)}F8.barMeasure=DU(F6);if(F7.maxLineChanged&&!F6.options.lineWrapping){F8.adjustWidthTo=EB(F6,F7.maxLine,F7.maxLine.text.length).left+3;F6.display.sizerWidth=F8.adjustWidthTo;F8.barMeasure.scrollWidth=Math.max(F7.scroller.clientWidth,F7.sizer.offsetLeft+F8.adjustWidthTo+Cq(F6)+F6.display.barWidth);F8.maxScrollLeft=Math.max(0,F7.sizer.offsetLeft+F8.adjustWidthTo-DH(F6))}if(F8.updatedDisplay||F8.selectionChanged){F8.newSelectionNodes=BJ(F6)}}function AO(F7){var F6=F7.cm;if(F7.adjustWidthTo!=null){F6.display.sizer.style.minWidth=F7.adjustWidthTo+"px";if(F7.maxScrollLeft<F6.doc.scrollLeft){Bc(F6,Math.min(F6.display.scroller.scrollLeft,F7.maxScrollLeft),true)}F6.display.maxLineChanged=false}if(F7.newSelectionNodes){AK(F6,F7.newSelectionNodes)}if(F7.updatedDisplay){DT(F6,F7.barMeasure)}if(F7.updatedDisplay||F7.startHeight!=F6.doc.height){Es(F6,F7.barMeasure)}if(F7.selectionChanged){O(F6)}if(F6.state.focused&&F7.updateInput){FJ(F6,F7.typing)}}function Eu(GD){var F6=GD.cm,GB=F6.display,GA=F6.doc;if(GD.updatedDisplay){CI(F6,GD.update)}if(GB.wheelStartX!=null&&(GD.scrollTop!=null||GD.scrollLeft!=null||GD.scrollToPos)){GB.wheelStartX=GB.wheelStartY=null}if(GD.scrollTop!=null&&(GB.scroller.scrollTop!=GD.scrollTop||GD.forceScroll)){GA.scrollTop=Math.max(0,Math.min(GB.scroller.scrollHeight-GB.scroller.clientHeight,GD.scrollTop));GB.scrollbars.setScrollTop(GA.scrollTop);GB.scroller.scrollTop=GA.scrollTop}if(GD.scrollLeft!=null&&(GB.scroller.scrollLeft!=GD.scrollLeft||GD.forceScroll)){GA.scrollLeft=Math.max(0,Math.min(GB.scroller.scrollWidth-DH(F6),GD.scrollLeft));GB.scrollbars.setScrollLeft(GA.scrollLeft);GB.scroller.scrollLeft=GA.scrollLeft;EY(F6)}if(GD.scrollToPos){var F9=e(F6,Fe(GA,GD.scrollToPos.from),Fe(GA,GD.scrollToPos.to),GD.scrollToPos.margin);if(GD.scrollToPos.isCursor&&F6.state.focused){D0(F6,F9)}}var F8=GD.maybeHiddenMarkers,GC=GD.maybeUnhiddenMarkers;if(F8){for(var F7=0;F7<F8.length;++F7){if(!F8[F7].lines.length){Ab(F8[F7],"hide")}}}if(GC){for(var F7=0;F7<GC.length;++F7){if(GC[F7].lines.length){Ab(GC[F7],"unhide")}}}if(GB.wrapper.offsetHeight){GA.scrollTop=F6.display.scroller.scrollTop}if(GD.changeObjs){Ab(F6,"changes",F6,GD.changeObjs)}}function Cj(F6,F7){if(F6.curOp){return F7()}Cf(F6);try{return F7()}finally{AL(F6)}}function Cz(F6,F7){return function(){if(F6.curOp){return F7.apply(F6,arguments)}Cf(F6);try{return F7.apply(F6,arguments)}finally{AL(F6)}}}function C5(F6){return function(){if(this.curOp){return F6.apply(this,arguments)}Cf(this);try{return F6.apply(this,arguments)}finally{AL(this)}}}function Cb(F6){return function(){var F7=this.cm;if(!F7||F7.curOp){return F6.apply(this,arguments)}Cf(F7);try{return F6.apply(this,arguments)}finally{AL(F7)}}}function BT(F8,F6,F7){this.line=F6;this.rest=H(F6);this.size=this.rest?Bl(Fc(this.rest))-F7+1:1;this.node=this.text=null;this.hidden=FR(F8,F6)}function Ep(F6,GC,GB){var GA=[],F8;for(var F9=GC;F9<GB;F9=F8){var F7=new BT(F6.doc,E9(F6.doc,F9),F9);F8=F9+F7.size;GA.push(F7)}return GA}function AG(GD,GB,GC,GE){if(GB==null){GB=GD.doc.first}if(GC==null){GC=GD.doc.first+GD.doc.size}if(!GE){GE=0}var F8=GD.display;if(GE&&GC<F8.viewTo&&(F8.updateLineNumbers==null||F8.updateLineNumbers>GB)){F8.updateLineNumbers=GB}GD.curOp.viewChanged=true;if(GB>=F8.viewTo){if(A3&&As(GD.doc,GB)<F8.viewTo){EQ(GD)}}else{if(GC<=F8.viewFrom){if(A3&&Dx(GD.doc,GC+GE)>F8.viewFrom){EQ(GD)}else{F8.viewFrom+=GE;F8.viewTo+=GE}}else{if(GB<=F8.viewFrom&&GC>=F8.viewTo){EQ(GD)}else{if(GB<=F8.viewFrom){var GA=DB(GD,GC,GC+GE,1);if(GA){F8.view=F8.view.slice(GA.index);F8.viewFrom=GA.lineN;F8.viewTo+=GE}else{EQ(GD)}}else{if(GC>=F8.viewTo){var GA=DB(GD,GB,GB,-1);if(GA){F8.view=F8.view.slice(0,GA.index);F8.viewTo=GA.lineN}else{EQ(GD)}}else{var F9=DB(GD,GB,GB,-1);var F7=DB(GD,GC,GC+GE,1);if(F9&&F7){F8.view=F8.view.slice(0,F9.index).concat(Ep(GD,F9.lineN,F7.lineN)).concat(F8.view.slice(F7.index));F8.viewTo+=GE}else{EQ(GD)}}}}}}var F6=F8.externalMeasured;if(F6){if(GC<F6.lineN){F6.lineN+=GE}else{if(GB<F6.lineN+F6.size){F8.externalMeasured=null}}}}function s(F7,F8,GB){F7.curOp.viewChanged=true;var GC=F7.display,GA=F7.display.externalMeasured;if(GA&&F8>=GA.lineN&&F8<GA.lineN+GA.size){GC.externalMeasured=null}if(F8<GC.viewFrom||F8>=GC.viewTo){return }var F9=GC.view[DM(F7,F8)];if(F9.node==null){return }var F6=F9.changes||(F9.changes=[]);if(DE(F6,GB)==-1){F6.push(GB)}}function EQ(F6){F6.display.viewFrom=F6.display.viewTo=F6.doc.first;F6.display.view=[];F6.display.viewOffset=0}function DM(F6,F9){if(F9>=F6.display.viewTo){return null}F9-=F6.display.viewFrom;if(F9<0){return null}var F7=F6.display.view;for(var F8=0;F8<F7.length;F8++){F9-=F7[F8].size;if(F9<0){return F8}}}function DB(GE,F8,GA,F7){var GB=DM(GE,F8),GD,GC=GE.display.view;if(!A3||GA==GE.doc.first+GE.doc.size){return{index:GB,lineN:GA}}for(var F9=0,F6=GE.display.viewFrom;F9<GB;F9++){F6+=GC[F9].size}if(F6!=F8){if(F7>0){if(GB==GC.length-1){return null}GD=(F6+GC[GB].size)-F8;GB++}else{GD=F6-F8}F8+=GD;GA+=GD}while(As(GE.doc,GA)!=GA){if(GB==(F7<0?0:GC.length-1)){return null}GA+=F7*GC[GB-(F7<0?1:0)].size;GB+=F7}return{index:GB,lineN:GA}}function Co(F6,GA,F9){var F8=F6.display,F7=F8.view;if(F7.length==0||GA>=F8.viewTo||F9<=F8.viewFrom){F8.view=Ep(F6,GA,F9);F8.viewFrom=GA}else{if(F8.viewFrom>GA){F8.view=Ep(F6,GA,F8.viewFrom).concat(F8.view)}else{if(F8.viewFrom<GA){F8.view=F8.view.slice(DM(F6,GA))}}F8.viewFrom=GA;if(F8.viewTo<F9){F8.view=F8.view.concat(Ep(F6,F8.viewTo,F9))}else{if(F8.viewTo>F9){F8.view=F8.view.slice(0,DM(F6,F9))}}}F8.viewTo=F9}function C8(F6){var F7=F6.display.view,GA=0;for(var F9=0;F9<F7.length;F9++){var F8=F7[F9];if(!F8.hidden&&(!F8.node||F8.changes)){++GA}}return GA}function BK(F6){if(F6.display.pollingFast){return }F6.display.poll.set(F6.options.pollInterval,function(){CF(F6);if(F6.state.focused){BK(F6)}})}function b(F6){var F7=false;F6.display.pollingFast=true;function F8(){var F9=CF(F6);if(!F9&&!F7){F7=true;F6.display.poll.set(60,F8)}else{F6.display.pollingFast=false;BK(F6)}}F6.display.poll.set(20,F8)}var BI=null;function CF(GA){var GB=GA.display.input,GE=GA.display.prevInput,GP=GA.doc;if(!GA.state.focused||(BQ(GB)&&!GE)||AI(GA)||GA.options.disableInput||GA.state.keySeq){return false}if(GA.state.pasteIncoming&&GA.state.fakedLastChar){GB.value=GB.value.substring(0,GB.value.length-1);GA.state.fakedLastChar=false}var GD=GB.value;if(GD==GE&&!GA.somethingSelected()){return false}if(De&&K>=9&&GA.display.inputHasSelection===GD||B5&&/[\uf700-\uf7ff]/.test(GD)){FJ(GA);return false}var GL=!GA.curOp;if(GL){Cf(GA)}GA.display.shift=false;if(GD.charCodeAt(0)==8203&&GP.sel==GA.display.selForContextMenu&&!GE){GE="\u200b"}var GK=0,GH=Math.min(GE.length,GD.length);while(GK<GH&&GE.charCodeAt(GK)==GD.charCodeAt(GK)){++GK}var F7=GD.slice(GK),GF=Aw(F7);var GO=null;if(GA.state.pasteIncoming&&GP.sel.ranges.length>1){if(BI&&BI.join("\n")==F7){GO=GP.sel.ranges.length%BI.length==0&&Bq(BI,Aw)}else{if(GF.length==GP.sel.ranges.length){GO=Bq(GF,function(GQ){return[GQ]})}}}for(var GM=GP.sel.ranges.length-1;GM>=0;GM--){var GG=GP.sel.ranges[GM];var GI=GG.from(),F6=GG.to();if(GK<GE.length){GI=x(GI.line,GI.ch-(GE.length-GK))}else{if(GA.state.overwrite&&GG.empty()&&!GA.state.pasteIncoming){F6=x(F6.line,Math.min(E9(GP,F6.line).text.length,F6.ch+Fc(GF).length))}}var F9=GA.curOp.updateInput;var GN={from:GI,to:F6,text:GO?GO[GM%GO.length]:GF,origin:GA.state.pasteIncoming?"paste":GA.state.cutIncoming?"cut":"+input"};BC(GA.doc,GN);AD(GA,"inputRead",GA,GN);if(F7&&!GA.state.pasteIncoming&&GA.options.electricChars&&GA.options.smartIndent&&GG.head.ch<100&&(!GM||GP.sel.ranges[GM-1].head.line!=GG.head.line)){var GC=GA.getModeAt(GG.head);var F8=Cu(GN);if(GC.electricChars){for(var GJ=0;GJ<GC.electricChars.length;GJ++){if(F7.indexOf(GC.electricChars.charAt(GJ))>-1){AC(GA,F8.line,"smart");break}}}else{if(GC.electricInput){if(GC.electricInput.test(E9(GP,F8.line).text.slice(0,F8.ch))){AC(GA,F8.line,"smart")}}}}}Fb(GA);GA.curOp.updateInput=F9;GA.curOp.typing=true;if(GD.length>1000||GD.indexOf("\n")>-1){GB.value=GA.display.prevInput=""}else{GA.display.prevInput=GD}if(GL){AL(GA)}GA.state.pasteIncoming=GA.state.cutIncoming=false;return true}function FJ(F6,GA){if(F6.display.contextMenuPending){return }var F7,F9,GC=F6.doc;if(F6.somethingSelected()){F6.display.prevInput="";var F8=GC.sel.primary();F7=C7&&(F8.to().line-F8.from().line>100||(F9=F6.getSelection()).length>1000);var GB=F7?"-":F9||F6.getSelection();F6.display.input.value=GB;if(F6.state.focused){Df(F6.display.input)}if(De&&K>=9){F6.display.inputHasSelection=GB}}else{if(!GA){F6.display.prevInput=F6.display.input.value="";if(De&&K>=9){F6.display.inputHasSelection=null}}}F6.display.inaccurateSelection=F7}function ET(F6){if(F6.options.readOnly!="nocursor"&&(!EA||Di()!=F6.display.input)){F6.display.input.focus()}}function R(F6){if(!F6.state.focused){ET(F6);CZ(F6)}}function AI(F6){return F6.options.readOnly||F6.doc.cantEdit}function Fk(F6){var F8=F6.display;Bv(F8.scroller,"mousedown",Cz(F6,EN));if(De&&K<11){Bv(F8.scroller,"dblclick",Cz(F6,function(GB){if(An(F6,GB)){return }var GC=CM(F6,GB);if(!GC||L(F6,GB)||A6(F6.display,GB)){return }Cd(GB);var GA=F6.findWordAt(GC);Fo(F6.doc,GA.anchor,GA.head)}))}else{Bv(F8.scroller,"dblclick",function(GA){An(F6,GA)||Cd(GA)})}Bv(F8.lineSpace,"selectstart",function(GA){if(!A6(F8,GA)){Cd(GA)}});if(!Fy){Bv(F8.scroller,"contextmenu",function(GA){AW(F6,GA)})}Bv(F8.scroller,"scroll",function(){if(F8.scroller.clientHeight){o(F6,F8.scroller.scrollTop);Bc(F6,F8.scroller.scrollLeft,true);Ab(F6,"scroll",F6)}});Bv(F8.scroller,"mousewheel",function(GA){B(F6,GA)});Bv(F8.scroller,"DOMMouseScroll",function(GA){B(F6,GA)});Bv(F8.wrapper,"scroll",function(){F8.wrapper.scrollTop=F8.wrapper.scrollLeft=0});Bv(F8.input,"keyup",function(GA){BE.call(F6,GA)});Bv(F8.input,"input",function(){if(De&&K>=9&&F6.display.inputHasSelection){F6.display.inputHasSelection=null}CF(F6)});Bv(F8.input,"keydown",Cz(F6,P));Bv(F8.input,"keypress",Cz(F6,CW));Bv(F8.input,"focus",CU(CZ,F6));Bv(F8.input,"blur",CU(Ar,F6));function F7(GA){if(!An(F6,GA)){EL(GA)}}if(F6.options.dragDrop){Bv(F8.scroller,"dragstart",function(GA){r(F6,GA)});Bv(F8.scroller,"dragenter",F7);Bv(F8.scroller,"dragover",F7);Bv(F8.scroller,"drop",Cz(F6,BG))}Bv(F8.scroller,"paste",function(GA){if(A6(F8,GA)){return }F6.state.pasteIncoming=true;ET(F6);b(F6)});Bv(F8.input,"paste",function(){if(Cx&&!F6.state.fakedLastChar&&!(new Date-F6.state.lastMiddleDown<200)){var GB=F8.input.selectionStart,GA=F8.input.selectionEnd;F8.input.value+="$";F8.input.selectionEnd=GA;F8.input.selectionStart=GB;F6.state.fakedLastChar=true}F6.state.pasteIncoming=true;b(F6)});function F9(GE){if(F6.somethingSelected()){BI=F6.getSelections();if(F8.inaccurateSelection){F8.prevInput="";F8.inaccurateSelection=false;F8.input.value=BI.join("\n");Df(F8.input)}}else{var GF=[],GB=[];for(var GC=0;GC<F6.doc.sel.ranges.length;GC++){var GA=F6.doc.sel.ranges[GC].head.line;var GD={anchor:x(GA,0),head:x(GA+1,0)};GB.push(GD);GF.push(F6.getRange(GD.anchor,GD.head))}if(GE.type=="cut"){F6.setSelections(GB,null,z)}else{F8.prevInput="";F8.input.value=GF.join("\n");Df(F8.input)}BI=GF}if(GE.type=="cut"){F6.state.cutIncoming=true}}Bv(F8.input,"cut",F9);Bv(F8.input,"copy",F9);if(A7){Bv(F8.sizer,"mouseup",function(){if(Di()==F8.input){F8.input.blur()}ET(F6)})}}function Ap(F6){var F7=F6.display;if(F7.lastWrapHeight==F7.wrapper.clientHeight&&F7.lastWrapWidth==F7.wrapper.clientWidth){return }F7.cachedCharWidth=F7.cachedTextHeight=F7.cachedPaddingH=null;F7.scrollbarsClipped=false;F6.setSize()}function A6(F7,F6){for(var F8=m(F6);F8!=F7.wrapper;F8=F8.parentNode){if(!F8||(F8.nodeType==1&&F8.getAttribute("cm-ignore-events")=="true")||(F8.parentNode==F7.sizer&&F8!=F7.mover)){return true}}}function CM(GF,GA,F7,F8){var GB=GF.display;if(!F7&&m(GA).getAttribute("not-content")=="true"){return null}var GE,GC,F6=GB.lineSpace.getBoundingClientRect();try{GE=GA.clientX-F6.left;GC=GA.clientY-F6.top}catch(GA){return null}var GD=Fj(GF,GE,GC),GG;if(F8&&GD.xRel==1&&(GG=E9(GF.doc,GD.line).text).length==GD.ch){var F9=Br(GG,GG.length,GF.options.tabSize)-GG.length;GD=x(GD.line,Math.max(0,Math.round((GE-Ez(GF.display).left)/DX(GF.display))-F9))}return GD}function EN(F8){if(An(this,F8)){return }var F6=this,F7=F6.display;F7.shift=F8.shiftKey;if(A6(F7,F8)){if(!Cx){F7.scroller.draggable=false;setTimeout(function(){F7.scroller.draggable=true},100)}return }if(L(F6,F8)){return }var F9=CM(F6,F8);window.focus();switch(Fi(F8)){case 1:if(F9){AV(F6,F8,F9)}else{if(m(F8)==F7.scroller){Cd(F8)}}break;case 2:if(Cx){F6.state.lastMiddleDown=+new Date}if(F9){Fo(F6.doc,F9)}setTimeout(CU(ET,F6),20);Cd(F8);break;case 3:if(Fy){AW(F6,F8)}break}}var DJ,DA;function AV(F7,GC,GD){setTimeout(CU(R,F7),0);var F8=+new Date,GA;if(DA&&DA.time>F8-400&&CD(DA.pos,GD)==0){GA="triple"}else{if(DJ&&DJ.time>F8-400&&CD(DJ.pos,GD)==0){GA="double";DA={time:F8,pos:GD}}else{GA="single";DJ={time:F8,pos:GD}}}var GB=F7.doc.sel,F6=B5?GC.metaKey:GC.ctrlKey,F9;if(F7.options.dragDrop&&Ef&&!AI(F7)&&GA=="single"&&(F9=GB.contains(GD))>-1&&!GB.ranges[F9].empty()){Az(F7,GC,GD,F6)}else{M(F7,GC,GD,GA,F6)}}function Az(F8,GA,GB,F7){var F9=F8.display;var F6=Cz(F8,function(GC){if(Cx){F9.scroller.draggable=false}F8.state.draggingText=false;D7(document,"mouseup",F6);D7(F9.scroller,"drop",F6);if(Math.abs(GA.clientX-GC.clientX)+Math.abs(GA.clientY-GC.clientY)<10){Cd(GC);if(!F7){Fo(F8.doc,GB)}ET(F8);if(De&&K==9){setTimeout(function(){document.body.focus();ET(F8)},20)}}});if(Cx){F9.scroller.draggable=true}F8.state.draggingText=F6;if(F9.scroller.dragDrop){F9.scroller.dragDrop()}Bv(document,"mouseup",F6);Bv(F9.scroller,"drop",F6)}function M(GA,GO,F9,F7,GC){var GL=GA.display,GQ=GA.doc;Cd(GO);var F8,GP,GB=GQ.sel,F6=GB.ranges;if(GC&&!GO.shiftKey){GP=GQ.sel.contains(F9);if(GP>-1){F8=F6[GP]}else{F8=new Ds(F9,F9)}}else{F8=GQ.sel.primary()}if(GO.altKey){F7="rect";if(!GC){F8=new Ds(F9,F9)}F9=CM(GA,GO,true,true);GP=-1}else{if(F7=="double"){var GM=GA.findWordAt(F9);if(GA.display.shift||GQ.extend){F8=FQ(GQ,F8,GM.anchor,GM.head)}else{F8=GM}}else{if(F7=="triple"){var GF=new Ds(x(F9.line,0),Fe(GQ,x(F9.line+1,0)));if(GA.display.shift||GQ.extend){F8=FQ(GQ,F8,GF.anchor,GF.head)}else{F8=GF}}else{F8=FQ(GQ,F8,F9)}}}if(!GC){GP=0;Bs(GQ,new Fs([F8],0),n);GB=GQ.sel}else{if(GP==-1){GP=F6.length;Bs(GQ,CV(F6.concat([F8]),GP),{scroll:false,origin:"*mouse"})}else{if(F6.length>1&&F6[GP].empty()&&F7=="single"){Bs(GQ,CV(F6.slice(0,GP).concat(F6.slice(GP+1)),0));GB=GQ.sel}else{E(GQ,GP,F8,n)}}}var GK=F9;function GJ(Gb){if(CD(GK,Gb)==0){return }GK=Gb;if(F7=="rect"){var GS=[],GY=GA.options.tabSize;var GR=Br(E9(GQ,F9.line).text,F9.ch,GY);var Ge=Br(E9(GQ,Gb.line).text,Gb.ch,GY);var GT=Math.min(GR,Ge),Gc=Math.max(GR,Ge);for(var Gf=Math.min(F9.line,Gb.line),GV=Math.min(GA.lastLine(),Math.max(F9.line,Gb.line));Gf<=GV;Gf++){var Gd=E9(GQ,Gf).text,GU=EK(Gd,GT,GY);if(GT==Gc){GS.push(new Ds(x(Gf,GU),x(Gf,GU)))}else{if(Gd.length>GU){GS.push(new Ds(x(Gf,GU),x(Gf,EK(Gd,Gc,GY))))}}}if(!GS.length){GS.push(new Ds(F9,F9))}Bs(GQ,CV(GB.ranges.slice(0,GP).concat(GS),GP),{origin:"*mouse",scroll:false});GA.scrollIntoView(Gb)}else{var GZ=F8;var GW=GZ.anchor,Ga=Gb;if(F7!="single"){if(F7=="double"){var GX=GA.findWordAt(Gb)}else{var GX=new Ds(x(Gb.line,0),Fe(GQ,x(Gb.line+1,0)))}if(CD(GX.anchor,GW)>0){Ga=GX.head;GW=AQ(GZ.from(),GX.anchor)}else{Ga=GX.anchor;GW=BV(GZ.to(),GX.head)}}var GS=GB.ranges.slice(0);GS[GP]=new Ds(Fe(GQ,GW),Ga);Bs(GQ,CV(GS,GP),n)}}var GH=GL.wrapper.getBoundingClientRect();var GD=0;function GN(GT){var GR=++GD;var GV=CM(GA,GT,true,F7=="rect");if(!GV){return }if(CD(GV,GK)!=0){R(GA);GJ(GV);var GU=B4(GL,GQ);if(GV.line>=GU.to||GV.line<GU.from){setTimeout(Cz(GA,function(){if(GD==GR){GN(GT)}}),150)}}else{var GS=GT.clientY<GH.top?-20:GT.clientY>GH.bottom?20:0;if(GS){setTimeout(Cz(GA,function(){if(GD!=GR){return }GL.scroller.scrollTop+=GS;GN(GT)}),50)}}}function GG(GR){GD=Infinity;Cd(GR);ET(GA);D7(document,"mousemove",GI);D7(document,"mouseup",GE);GQ.history.lastSelOrigin=null}var GI=Cz(GA,function(GR){if(!Fi(GR)){GG(GR)}else{GN(GR)}});var GE=Cz(GA,GG);Bv(document,"mousemove",GI);Bv(document,"mouseup",GE)}function F4(GH,GD,GF,GG,F9){try{var F7=GD.clientX,F6=GD.clientY}catch(GD){return false}if(F7>=Math.floor(GH.display.gutters.getBoundingClientRect().right)){return false}if(GG){Cd(GD)}var GE=GH.display;var GC=GE.lineDiv.getBoundingClientRect();if(F6>GC.bottom||!FC(GH,GF)){return Bj(GD)}F6-=GC.top-GE.viewOffset;for(var GA=0;GA<GH.options.gutters.length;++GA){var GB=GE.gutters.childNodes[GA];if(GB&&GB.getBoundingClientRect().right>=F7){var GI=Be(GH.doc,F6);var F8=GH.options.gutters[GA];F9(GH,GF,GH,GI,F8,GD);return Bj(GD)}}}function L(F6,F7){return F4(F6,F7,"gutterClick",true,AD)}var AF=0;function BG(GC){var GE=this;if(An(GE,GC)||A6(GE.display,GC)){return }Cd(GC);if(De){AF=+new Date}var GD=CM(GE,GC,true),F6=GC.dataTransfer.files;if(!GD||AI(GE)){return }if(F6&&F6.length&&window.FileReader&&window.File){var F8=F6.length,GF=Array(F8),F7=0;var GA=function(GI,GH){var GG=new FileReader;GG.onload=Cz(GE,function(){GF[GH]=GG.result;if(++F7==F8){GD=Fe(GE.doc,GD);var GJ={from:GD,to:GD,text:Aw(GF.join("\n")),origin:"paste"};BC(GE.doc,GJ);E1(GE.doc,Em(GD,Cu(GJ)))}});GG.readAsText(GI)};for(var GB=0;GB<F8;++GB){GA(F6[GB],GB)}}else{if(GE.state.draggingText&&GE.doc.sel.contains(GD)>-1){GE.state.draggingText(GC);setTimeout(CU(ET,GE),20);return }try{var GF=GC.dataTransfer.getData("Text");if(GF){if(GE.state.draggingText&&!(B5?GC.metaKey:GC.ctrlKey)){var F9=GE.listSelections()}EJ(GE.doc,Em(GD,GD));if(F9){for(var GB=0;GB<F9.length;++GB){Ax(GE.doc,"",F9[GB].anchor,F9[GB].head,"drag")}}GE.replaceSelection(GF,"around","paste");ET(GE)}}catch(GC){}}}function r(F6,F8){if(De&&(!F6.state.draggingText||+new Date-AF<100)){EL(F8);return }if(An(F6,F8)||A6(F6.display,F8)){return }F8.dataTransfer.setData("Text",F6.getSelection());if(F8.dataTransfer.setDragImage&&!AZ){var F7=Fr("img",null,null,"position: fixed; left: 0; top: 0;");F7.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(Dw){F7.width=F7.height=1;F6.display.wrapper.appendChild(F7);F7._top=F7.offsetTop}F8.dataTransfer.setDragImage(F7,0,0);if(Dw){F7.parentNode.removeChild(F7)}}}function o(F6,F7){if(Math.abs(F6.doc.scrollTop-F7)<2){return }F6.doc.scrollTop=F7;if(!CN){Dn(F6,{top:F7})}if(F6.display.scroller.scrollTop!=F7){F6.display.scroller.scrollTop=F7}F6.display.scrollbars.setScrollTop(F7);if(CN){Dn(F6)}D9(F6,100)}function Bc(F6,F8,F7){if(F7?F8==F6.doc.scrollLeft:Math.abs(F6.doc.scrollLeft-F8)<2){return }F8=Math.min(F8,F6.display.scroller.scrollWidth-F6.display.scroller.clientWidth);F6.doc.scrollLeft=F8;EY(F6);if(F6.display.scroller.scrollLeft!=F8){F6.display.scroller.scrollLeft=F8}F6.display.scrollbars.setScrollLeft(F8)}var FG=0,CE=null;if(De){CE=-0.53}else{if(CN){CE=15}else{if(C9){CE=-0.7}else{if(AZ){CE=-1/3}}}}var Cn=function(F8){var F7=F8.wheelDeltaX,F6=F8.wheelDeltaY;if(F7==null&&F8.detail&&F8.axis==F8.HORIZONTAL_AXIS){F7=F8.detail}if(F6==null&&F8.detail&&F8.axis==F8.VERTICAL_AXIS){F6=F8.detail}else{if(F6==null){F6=F8.wheelDelta}}return{x:F7,y:F6}};i.wheelEventPixels=function(F6){var F7=Cn(F6);F7.x*=CE;F7.y*=CE;return F7};function B(GE,F8){var GF=Cn(F8),GI=GF.x,GH=GF.y;var GA=GE.display,GD=GA.scroller;if(!(GI&&GD.scrollWidth>GD.clientWidth||GH&&GD.scrollHeight>GD.clientHeight)){return }if(GH&&B5&&Cx){outer:for(var GG=F8.target,GC=GA.view;GG!=GD;GG=GG.parentNode){for(var F7=0;F7<GC.length;F7++){if(GC[F7].node==GG){GE.display.currentWheelTarget=GG;break outer}}}}if(GI&&!CN&&!Dw&&CE!=null){if(GH){o(GE,Math.max(0,Math.min(GD.scrollTop+GH*CE,GD.scrollHeight-GD.clientHeight)))}Bc(GE,Math.max(0,Math.min(GD.scrollLeft+GI*CE,GD.scrollWidth-GD.clientWidth)));Cd(F8);GA.wheelStartX=null;return }if(GH&&CE!=null){var F6=GH*CE;var GB=GE.doc.scrollTop,F9=GB+GA.wrapper.clientHeight;if(F6<0){GB=Math.max(0,GB+F6-50)}else{F9=Math.min(GE.doc.height,F9+F6+50)}Dn(GE,{top:GB,bottom:F9})}if(FG<20){if(GA.wheelStartX==null){GA.wheelStartX=GD.scrollLeft;GA.wheelStartY=GD.scrollTop;GA.wheelDX=GI;GA.wheelDY=GH;setTimeout(function(){if(GA.wheelStartX==null){return }var GJ=GD.scrollLeft-GA.wheelStartX;var GL=GD.scrollTop-GA.wheelStartY;var GK=(GL&&GA.wheelDY&&GL/GA.wheelDY)||(GJ&&GA.wheelDX&&GJ/GA.wheelDX);GA.wheelStartX=GA.wheelStartY=null;if(!GK){return }CE=(CE*FG+GK)/(FG+1);++FG},200)}else{GA.wheelDX+=GI;GA.wheelDY+=GH}}}function Fl(F7,GA,F6){if(typeof GA=="string"){GA=EX[GA];if(!GA){return false}}if(F7.display.pollingFast&&CF(F7)){F7.display.pollingFast=false}var F9=F7.display.shift,F8=false;try{if(AI(F7)){F7.state.suppressEdits=true}if(F6){F7.display.shift=false}F8=GA(F7)!=B8}finally{F7.display.shift=F9;F7.state.suppressEdits=false}return F8}function D4(F7,F8,GA){for(var F9=0;F9<F7.state.keyMaps.length;F9++){var F6=I(F8,F7.state.keyMaps[F9],GA,F7);if(F6){return F6}}return(F7.options.extraKeys&&I(F8,F7.options.extraKeys,GA,F7))||I(F8,F7.options.keyMap,GA,F7)}var Dg=new F5;function A9(F7,F9,GB,GA){var F8=F7.state.keySeq;if(F8){if(EW(F9)){return"handled"}Dg.set(50,function(){if(F7.state.keySeq==F8){F7.state.keySeq=null;FJ(F7)}});F9=F8+" "+F9}var F6=D4(F7,F9,GA);if(F6=="multi"){F7.state.keySeq=F9}if(F6=="handled"){AD(F7,"keyHandled",F7,F9,GB)}if(F6=="handled"||F6=="multi"){Cd(GB);O(F7)}if(F8&&!F6&&/\'$/.test(F9)){Cd(GB);return true}return !!F6}function FD(F6,F8){var F7=FM(F8,true);if(!F7){return false}if(F8.shiftKey&&!F6.state.keySeq){return A9(F6,"Shift-"+F7,F8,function(F9){return Fl(F6,F9,true)})||A9(F6,F7,F8,function(F9){if(typeof F9=="string"?/^go[A-Z]/.test(F9):F9.motion){return Fl(F6,F9)}})}else{return A9(F6,F7,F8,function(F9){return Fl(F6,F9)})}}function ED(F6,F8,F7){return A9(F6,"'"+F7+"'",F8,function(F9){return Fl(F6,F9,true)})}var DI=null;function P(F9){var F6=this;R(F6);if(An(F6,F9)){return }if(De&&K<11&&F9.keyCode==27){F9.returnValue=false}var F7=F9.keyCode;F6.display.shift=F7==16||F9.shiftKey;var F8=FD(F6,F9);if(Dw){DI=F8?F7:null;if(!F8&&F7==88&&!C7&&(B5?F9.metaKey:F9.ctrlKey)){F6.replaceSelection("",null,"cut")}}if(F7==18&&!/\bCodeMirror-crosshair\b/.test(F6.display.lineDiv.className)){AT(F6)}}function AT(F7){var F8=F7.display.lineDiv;FV(F8,"CodeMirror-crosshair");function F6(F9){if(F9.keyCode==18||!F9.altKey){F(F8,"CodeMirror-crosshair");D7(document,"keyup",F6);D7(document,"mouseover",F6)}}Bv(document,"keyup",F6);Bv(document,"mouseover",F6)}function BE(F6){if(F6.keyCode==16){this.doc.sel.shift=false}An(this,F6)}function CW(GA){var F6=this;if(An(F6,GA)||GA.ctrlKey&&!GA.altKey||B5&&GA.metaKey){return }var F9=GA.keyCode,F7=GA.charCode;if(Dw&&F9==DI){DI=null;Cd(GA);return }if(((Dw&&(!GA.which||GA.which<10))||A7)&&FD(F6,GA)){return }var F8=String.fromCharCode(F7==null?F9:F7);if(ED(F6,GA,F8)){return }if(De&&K>=9){F6.display.inputHasSelection=null}b(F6)}function CZ(F6){if(F6.options.readOnly=="nocursor"){return }if(!F6.state.focused){Ab(F6,"focus",F6);F6.state.focused=true;FV(F6.display.wrapper,"CodeMirror-focused");if(!F6.curOp&&F6.display.selForContextMenu!=F6.doc.sel){FJ(F6);if(Cx){setTimeout(CU(FJ,F6,true),0)}}}BK(F6);O(F6)}function Ar(F6){if(F6.state.focused){Ab(F6,"blur",F6);F6.state.focused=false;F(F6.display.wrapper,"CodeMirror-focused")}clearInterval(F6.display.blinker);setTimeout(function(){if(!F6.state.focused){F6.display.shift=false}},150)}function AW(GF,GA){if(An(GF,GA,"contextmenu")){return }var GC=GF.display;if(A6(GC,GA)||DD(GF,GA)){return }var GE=CM(GF,GA),F6=GC.scroller.scrollTop;if(!GE||Dw){return }var F9=GF.options.resetSelectionOnContextMenu;if(F9&&GF.doc.sel.contains(GE)==-1){Cz(GF,Bs)(GF.doc,Em(GE),z)}var GB=GC.input.style.cssText;GC.inputDiv.style.position="absolute";GC.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(GA.clientY-5)+"px; left: "+(GA.clientX-5)+"px; z-index: 1000; background: "+(De?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(Cx){var GG=window.scrollY}ET(GF);if(Cx){window.scrollTo(null,GG)}FJ(GF);if(!GF.somethingSelected()){GC.input.value=GC.prevInput=" "}GC.contextMenuPending=true;GC.selForContextMenu=GF.doc.sel;clearTimeout(GC.detectingSelectAll);function F8(){if(GC.input.selectionStart!=null){var GH=GF.somethingSelected();var GI=GC.input.value="\u200b"+(GH?GC.input.value:"");GC.prevInput=GH?"":"\u200b";GC.input.selectionStart=1;GC.input.selectionEnd=GI.length;GC.selForContextMenu=GF.doc.sel}}function GD(){GC.contextMenuPending=false;GC.inputDiv.style.position="relative";GC.input.style.cssText=GB;if(De&&K<9){GC.scrollbars.setScrollTop(GC.scroller.scrollTop=F6)}BK(GF);if(GC.input.selectionStart!=null){if(!De||(De&&K<9)){F8()}var GH=0,GI=function(){if(GC.selForContextMenu==GF.doc.sel&&GC.input.selectionStart==0){Cz(GF,EX.selectAll)(GF)}else{if(GH++<10){GC.detectingSelectAll=setTimeout(GI,500)}else{FJ(GF)}}};GC.detectingSelectAll=setTimeout(GI,200)}}if(De&&K>=9){F8()}if(Fy){EL(GA);var F7=function(){D7(window,"mouseup",F7);setTimeout(GD,20)};Bv(window,"mouseup",F7)}else{setTimeout(GD,50)}}function DD(F6,F7){if(!FC(F6,"gutterContextMenu")){return false}return F4(F6,F7,"gutterContextMenu",false,Ab)}var Cu=i.changeEnd=function(F6){if(!F6.text){return F6.to}return x(F6.from.line+F6.text.length-1,Fc(F6.text).length+(F6.text.length==1?F6.from.ch:0))};function Bx(F9,F8){if(CD(F9,F8.from)<0){return F9}if(CD(F9,F8.to)<=0){return Cu(F8)}var F6=F9.line+F8.text.length-(F8.to.line-F8.from.line)-1,F7=F9.ch;if(F9.line==F8.to.line){F7+=Cu(F8).ch-F8.to.ch}return x(F6,F7)}function FE(F9,GA){var F7=[];for(var F8=0;F8<F9.sel.ranges.length;F8++){var F6=F9.sel.ranges[F8];F7.push(new Ds(Bx(F6.anchor,GA),Bx(F6.head,GA)))}return CV(F7,F9.sel.primIndex)}function BS(F8,F7,F6){if(F8.line==F7.line){return x(F6.line,F8.ch-F7.ch+F6.ch)}else{return x(F6.line+(F8.line-F7.line),F8.ch)}}function AE(GG,GD,F7){var F8=[];var F6=x(GG.first,0),GH=F6;for(var GA=0;GA<GD.length;GA++){var GC=GD[GA];var GF=BS(GC.from,F6,GH);var GE=BS(Cu(GC),F6,GH);F6=GC.to;GH=GE;if(F7=="around"){var GB=GG.sel.ranges[GA],F9=CD(GB.head,GB.anchor)<0;F8[GA]=new Ds(F9?GE:GF,F9?GF:GE)}else{F8[GA]=new Ds(GF,GF)}}return new Fs(F8,GG.sel.primIndex)}function Dl(F7,F9,F8){var F6={canceled:false,from:F9.from,to:F9.to,text:F9.text,origin:F9.origin,cancel:function(){this.canceled=true}};if(F8){F6.update=function(GD,GC,GB,GA){if(GD){this.from=Fe(F7,GD)}if(GC){this.to=Fe(F7,GC)}if(GB){this.text=GB}if(GA!==undefined){this.origin=GA}}}Ab(F7,"beforeChange",F7,F6);if(F7.cm){Ab(F7.cm,"beforeChange",F7.cm,F6)}if(F6.canceled){return null}return{from:F6.from,to:F6.to,text:F6.text,origin:F6.origin}}function BC(F9,GA,F8){if(F9.cm){if(!F9.cm.curOp){return Cz(F9.cm,BC)(F9,GA,F8)}if(F9.cm.state.suppressEdits){return }}if(FC(F9,"beforeChange")||F9.cm&&FC(F9.cm,"beforeChange")){GA=Dl(F9,GA,true);if(!GA){return }}var F7=F1&&!F8&&Ce(F9,GA.from,GA.to);if(F7){for(var F6=F7.length-1;F6>=0;--F6){l(F9,{from:F7[F6].from,to:F7[F6].to,text:F6?[""]:GA.text})}}else{l(F9,GA)}}function l(F8,F9){if(F9.text.length==1&&F9.text[0]==""&&CD(F9.from,F9.to)==0){return }var F7=FE(F8,F9);Fh(F8,F9,F7,F8.cm?F8.cm.curOp.id:NaN);D8(F8,F9,F7,EE(F8,F9));var F6=[];D1(F8,function(GB,GA){if(!GA&&DE(F6,GB.history)==-1){DY(GB.history,F9);F6.push(GB.history)}D8(GB,F9,null,EE(GB,F9))})}function B6(GH,GF,GJ){if(GH.cm&&GH.cm.state.suppressEdits){return }var GE=GH.history,F8,GA=GH.sel;var F6=GF=="undo"?GE.done:GE.undone,GI=GF=="undo"?GE.undone:GE.done;for(var GB=0;GB<F6.length;GB++){F8=F6[GB];if(GJ?F8.ranges&&!F8.equals(GH.sel):!F8.ranges){break}}if(GB==F6.length){return }GE.lastOrigin=GE.lastSelOrigin=null;for(;;){F8=F6.pop();if(F8.ranges){Ck(F8,GI);if(GJ&&!F8.equals(GH.sel)){Bs(GH,F8,{clearRedo:false});return }GA=F8}else{break}}var GD=[];Ck(GA,GI);GI.push({changes:GD,generation:GE.generation});GE.generation=F8.generation||++GE.maxGeneration;var F9=FC(GH,"beforeChange")||GH.cm&&FC(GH.cm,"beforeChange");for(var GB=F8.changes.length-1;GB>=0;--GB){var GG=F8.changes[GB];GG.origin=GF;if(F9&&!Dl(GH,GG,false)){F6.length=0;return }GD.push(DP(GH,GG));var F7=GB?FE(GH,GG):Fc(F6);D8(GH,GG,F7,D3(GH,GG));if(!GB&&GH.cm){GH.cm.scrollIntoView({from:GG.from,to:Cu(GG)})}var GC=[];D1(GH,function(GL,GK){if(!GK&&DE(GC,GL.history)==-1){DY(GL.history,GG);GC.push(GL.history)}D8(GL,GG,null,D3(GL,GG))})}}function FH(F7,F9){if(F9==0){return }F7.first+=F9;F7.sel=new Fs(Bq(F7.sel.ranges,function(GA){return new Ds(x(GA.anchor.line+F9,GA.anchor.ch),x(GA.head.line+F9,GA.head.ch))}),F7.sel.primIndex);if(F7.cm){AG(F7.cm,F7.first,F7.first-F9,F9);for(var F8=F7.cm.display,F6=F8.viewFrom;F6<F8.viewTo;F6++){s(F7.cm,F6,"gutter")}}}function D8(GA,GB,F9,F7){if(GA.cm&&!GA.cm.curOp){return Cz(GA.cm,D8)(GA,GB,F9,F7)}if(GB.to.line<GA.first){FH(GA,GB.text.length-1-(GB.to.line-GB.from.line));return }if(GB.from.line>GA.lastLine()){return }if(GB.from.line<GA.first){var F6=GB.text.length-1-(GA.first-GB.from.line);FH(GA,F6);GB={from:x(GA.first,0),to:x(GB.to.line+F6,GB.to.ch),text:[Fc(GB.text)],origin:GB.origin}}var F8=GA.lastLine();if(GB.to.line>F8){GB={from:GB.from,to:x(F8,E9(GA,F8).text.length),text:[GB.text[0]],origin:GB.origin}}GB.removed=Ft(GA,GB.from,GB.to);if(!F9){F9=FE(GA,GB)}if(GA.cm){Ag(GA.cm,GB,F7)}else{FT(GA,GB,F7)}EJ(GA,F9,z)}function Ag(GH,GD,GB){var GG=GH.doc,GC=GH.display,GE=GD.from,GF=GD.to;var F6=false,GA=GE.line;if(!GH.options.lineWrapping){GA=Bl(Y(E9(GG,GE.line)));GG.iter(GA,GF.line+1,function(GJ){if(GJ==GC.maxLine){F6=true;return true}})}if(GG.sel.contains(GD.from,GD.to)>-1){w(GH)}FT(GG,GD,GB,BA(GH));if(!GH.options.lineWrapping){GG.iter(GA,GE.line+GD.text.length,function(GK){var GJ=EH(GK);if(GJ>GC.maxLineLength){GC.maxLine=GK;GC.maxLineLength=GJ;GC.maxLineChanged=true;F6=false}});if(F6){GH.curOp.updateMaxLine=true}}GG.frontier=Math.min(GG.frontier,GE.line);D9(GH,400);var GI=GD.text.length-(GF.line-GE.line)-1;if(GD.full){AG(GH)}else{if(GE.line==GF.line&&GD.text.length==1&&!Dm(GH.doc,GD)){s(GH,GE.line,"text")}else{AG(GH,GE.line,GF.line+1,GI)}}var F8=FC(GH,"changes"),F9=FC(GH,"change");if(F9||F8){var F7={from:GE,to:GF,text:GD.text,removed:GD.removed,origin:GD.origin};if(F9){AD(GH,"change",GH,F7)}if(F8){(GH.curOp.changeObjs||(GH.curOp.changeObjs=[])).push(F7)}}GH.display.selForContextMenu=null}function Ax(F9,F8,GB,GA,F6){if(!GA){GA=GB}if(CD(GA,GB)<0){var F7=GA;GA=GB;GB=F7}if(typeof F8=="string"){F8=Aw(F8)}BC(F9,{from:GB,to:GA,text:F8,origin:F6})}function D0(F7,GA){if(An(F7,"scrollCursorIntoView")){return }var GB=F7.display,F8=GB.sizer.getBoundingClientRect(),F6=null;if(GA.top+F8.top<0){F6=true}else{if(GA.bottom+F8.top>(window.innerHeight||document.documentElement.clientHeight)){F6=false}}if(F6!=null&&!FP){var F9=Fr("div","\u200b",null,"position: absolute; top: "+(GA.top-GB.viewOffset-E2(F7.display))+"px; height: "+(GA.bottom-GA.top+Cq(F7)+GB.barHeight)+"px; left: "+GA.left+"px; width: 2px;");F7.display.lineSpace.appendChild(F9);F9.scrollIntoView(F6);F7.display.lineSpace.removeChild(F9)}}function e(GG,GE,GA,F9){if(F9==null){F9=0}for(var GB=0;GB<5;GB++){var GC=false,GF=Do(GG,GE);var F6=!GA||GA==GE?GF:Do(GG,GA);var F8=h(GG,Math.min(GF.left,F6.left),Math.min(GF.top,F6.top)-F9,Math.max(GF.left,F6.left),Math.max(GF.bottom,F6.bottom)+F9);var GD=GG.doc.scrollTop,F7=GG.doc.scrollLeft;if(F8.scrollTop!=null){o(GG,F8.scrollTop);if(Math.abs(GG.doc.scrollTop-GD)>1){GC=true}}if(F8.scrollLeft!=null){Bc(GG,F8.scrollLeft);if(Math.abs(GG.doc.scrollLeft-F7)>1){GC=true}}if(!GC){break}}return GF}function f(F6,F8,GA,F7,F9){var GB=h(F6,F8,GA,F7,F9);if(GB.scrollTop!=null){o(F6,GB.scrollTop)}if(GB.scrollLeft!=null){Bc(F6,GB.scrollLeft)}}function h(GI,F9,GH,F7,GG){var GE=GI.display,GC=At(GI.display);if(GH<0){GH=0}var GA=GI.curOp&&GI.curOp.scrollTop!=null?GI.curOp.scrollTop:GE.scroller.scrollTop;var GK=Cs(GI),GM={};if(GG-GH>GK){GG=GH+GK}var F8=GI.doc.height+Bg(GE);var F6=GH<GC,GD=GG>F8-GC;if(GH<GA){GM.scrollTop=F6?0:GH}else{if(GG>GA+GK){var GF=Math.min(GH,(GD?F8:GG)-GK);if(GF!=GA){GM.scrollTop=GF}}}var GL=GI.curOp&&GI.curOp.scrollLeft!=null?GI.curOp.scrollLeft:GE.scroller.scrollLeft;var GJ=DH(GI)-(GI.options.fixedGutter?GE.gutters.offsetWidth:0);var GB=F7-F9>GJ;if(GB){F7=F9+GJ}if(F9<10){GM.scrollLeft=0}else{if(F9<GL){GM.scrollLeft=Math.max(0,F9-(GB?0:10))}else{if(F7>GJ+GL-3){GM.scrollLeft=F7+(GB?0:10)-GJ}}}return GM}function Ci(F6,F8,F7){if(F8!=null||F7!=null){FX(F6)}if(F8!=null){F6.curOp.scrollLeft=(F6.curOp.scrollLeft==null?F6.doc.scrollLeft:F6.curOp.scrollLeft)+F8}if(F7!=null){F6.curOp.scrollTop=(F6.curOp.scrollTop==null?F6.doc.scrollTop:F6.curOp.scrollTop)+F7}}function Fb(F6){FX(F6);var F7=F6.getCursor(),F9=F7,F8=F7;if(!F6.options.lineWrapping){F9=F7.ch?x(F7.line,F7.ch-1):F7;F8=x(F7.line,F7.ch+1)}F6.curOp.scrollToPos={from:F9,to:F8,margin:F6.options.cursorScrollMargin,isCursor:true}}function FX(F6){var F8=F6.curOp.scrollToPos;if(F8){F6.curOp.scrollToPos=null;var GA=Db(F6,F8.from),F9=Db(F6,F8.to);var F7=h(F6,Math.min(GA.left,F9.left),Math.min(GA.top,F9.top)-F8.margin,Math.max(GA.right,F9.right),Math.max(GA.bottom,F9.bottom)+F8.margin);F6.scrollTo(F7.scrollLeft,F7.scrollTop)}}function AC(GJ,F9,GI,F8){var GH=GJ.doc,F7;if(GI==null){GI="add"}if(GI=="smart"){if(!GH.mode.indent){GI="prev"}else{F7=DV(GJ,F9)}}var GD=GJ.options.tabSize;var GK=E9(GH,F9),GC=Br(GK.text,null,GD);if(GK.stateAfter){GK.stateAfter=null}var F6=GK.text.match(/^\s*/)[0],GF;if(!F8&&!/\S/.test(GK.text)){GF=0;GI="not"}else{if(GI=="smart"){GF=GH.mode.indent(F7,GK.text.slice(F6.length),GK.text);if(GF==B8||GF>150){if(!F8){return }GI="prev"}}}if(GI=="prev"){if(F9>GH.first){GF=Br(E9(GH,F9-1).text,null,GD)}else{GF=0}}else{if(GI=="add"){GF=GC+GJ.options.indentUnit}else{if(GI=="subtract"){GF=GC-GJ.options.indentUnit}else{if(typeof GI=="number"){GF=GC+GI}}}}GF=Math.max(0,GF);var GG="",GE=0;if(GJ.options.indentWithTabs){for(var GA=Math.floor(GF/GD);GA;--GA){GE+=GD;GG+="\t"}}if(GE<GF){GG+=CO(GF-GE)}if(GG!=F6){Ax(GH,GG,x(F9,0),x(F9,F6.length),"+input")}else{for(var GA=0;GA<GH.sel.ranges.length;GA++){var GB=GH.sel.ranges[GA];if(GB.head.line==F9&&GB.head.ch<F6.length){var GE=x(F9,F6.length);E(GH,GA,new Ds(GE,GE));break}}}GK.stateAfter=null}function ES(F9,F8,F6,GB){var GA=F8,F7=F8;if(typeof F8=="number"){F7=E9(F9,C2(F9,F8))}else{GA=Bl(F8)}if(GA==null){return null}if(GB(F7,GA)&&F9.cm){s(F9.cm,GA,F6)}return F7}function Er(F6,GC){var F7=F6.doc.sel.ranges,GA=[];for(var F9=0;F9<F7.length;F9++){var F8=GC(F7[F9]);while(GA.length&&CD(F8.from,Fc(GA).to)<=0){var GB=GA.pop();if(CD(GB.from,F8.from)<0){F8.from=GB.from;break}}GA.push(F8)}Cj(F6,function(){for(var GD=GA.length-1;GD>=0;GD--){Ax(F6.doc,"",GA[GD].from,GA[GD].to,"+delete")}Fb(F6)})}function BU(GO,GA,GI,GH,GC){var GF=GA.line,GG=GA.ch,GN=GI;var F7=E9(GO,GF);var GL=true;function GM(){var GP=GF+GI;if(GP<GO.first||GP>=GO.first+GO.size){return(GL=false)}GF=GP;return F7=E9(GO,GP)}function GK(GQ){var GP=(GC?U:AH)(F7,GG,GI,true);if(GP==null){if(!GQ&&GM()){if(GC){GG=(GI<0?Cp:Cc)(F7)}else{GG=GI<0?F7.text.length:0}}else{return(GL=false)}}else{GG=GP}return true}if(GH=="char"){GK()}else{if(GH=="column"){GK(true)}else{if(GH=="word"||GH=="group"){var GJ=null,GD=GH=="group";var F6=GO.cm&&GO.cm.getHelper(GA,"wordChars");for(var GB=true;;GB=false){if(GI<0&&!GK(!GB)){break}var F8=F7.text.charAt(GG)||"\n";var F9=CY(F8,F6)?"w":GD&&F8=="\n"?"n":!GD||/\s/.test(F8)?null:"p";if(GD&&!GB&&!F9){F9="s"}if(GJ&&GJ!=F9){if(GI<0){GI=1;GK()}break}if(F9){GJ=F9}if(GI>0&&!GK(!GB)){break}}}}}var GE=Bt(GO,x(GF,GG),GN,true);if(!GL){GE.hitSide=true}return GE}function BO(GE,F9,F6,GD){var GC=GE.doc,GB=F9.left,GA;if(GD=="page"){var F8=Math.min(GE.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);GA=F9.top+F6*(F8-(F6<0?1.5:0.5)*At(GE.display))}else{if(GD=="line"){GA=F6>0?F9.bottom+3:F9.top-3}}for(;;){var F7=Fj(GE,GB,GA);if(!F7.outside){break}if(F6<0?GA<=0:GA>=GC.height){F7.hitSide=true;break}GA+=F6*5}return F7}i.prototype={constructor:i,focus:function(){window.focus();ET(this);b(this)},setOption:function(F8,F9){var F7=this.options,F6=F7[F8];if(F7[F8]==F9&&F8!="mode"){return }F7[F8]=F9;if(BB.hasOwnProperty(F8)){Cz(this,BB[F8])(this,F9,F6)}},getOption:function(F6){return this.options[F6]},getDoc:function(){return this.doc},addKeyMap:function(F7,F6){this.state.keyMaps[F6?"push":"unshift"](Fp(F7))},removeKeyMap:function(F7){var F8=this.state.keyMaps;for(var F6=0;F6<F8.length;++F6){if(F8[F6]==F7||F8[F6].name==F7){F8.splice(F6,1);return true}}},addOverlay:C5(function(F6,F7){var F8=F6.token?F6:i.getMode(this.options,F6);if(F8.startState){throw new Error("Overlays may not be stateful.")}this.state.overlays.push({mode:F8,modeSpec:F6,opaque:F7&&F7.opaque});this.state.modeGen++;AG(this)}),removeOverlay:C5(function(F6){var F8=this.state.overlays;for(var F7=0;F7<F8.length;++F7){var F9=F8[F7].modeSpec;if(F9==F6||typeof F6=="string"&&F9.name==F6){F8.splice(F7,1);this.state.modeGen++;AG(this);return }}}),indentLine:C5(function(F8,F6,F7){if(typeof F6!="string"&&typeof F6!="number"){if(F6==null){F6=this.options.smartIndent?"smart":"prev"}else{F6=F6?"add":"subtract"}}if(B7(this.doc,F8)){AC(this,F8,F6,F7)}}),indentSelection:C5(function(GF){var F6=this.doc.sel.ranges,F9=-1;for(var GB=0;GB<F6.length;GB++){var GC=F6[GB];if(!GC.empty()){var GD=GC.from(),GE=GC.to();var F7=Math.max(F9,GD.line);F9=Math.min(this.lastLine(),GE.line-(GE.ch?0:1))+1;for(var GA=F7;GA<F9;++GA){AC(this,GA,GF)}var F8=this.doc.sel.ranges;if(GD.ch==0&&F6.length==F8.length&&F8[GB].from().ch>0){E(this.doc,GB,new Ds(GD,F8[GB].to()),z)}}else{if(GC.head.line>F9){AC(this,GC.head.line,GF,true);F9=GC.head.line;if(GB==this.doc.sel.primIndex){Fb(this)}}}}}),getTokenAt:function(F7,F6){return CP(this,F7,F6)},getLineTokens:function(F7,F6){return CP(this,x(F7),F6,true)},getTokenTypeAt:function(GD){GD=Fe(this.doc,GD);var F9=C3(this,E9(this.doc,GD.line));var GB=0,GC=(F9.length-1)/2,F8=GD.ch;var F7;if(F8==0){F7=F9[2]}else{for(;;){var F6=(GB+GC)>>1;if((F6?F9[F6*2-1]:0)>=F8){GC=F6}else{if(F9[F6*2+1]<F8){GB=F6+1}else{F7=F9[F6*2+2];break}}}}var GA=F7?F7.indexOf("cm-overlay "):-1;return GA<0?F7:GA==0?null:F7.slice(0,GA-1)},getModeAt:function(F7){var F6=this.doc.mode;if(!F6.innerMode){return F6}return i.innerMode(F6,this.getTokenAt(F7).state).mode},getHelper:function(F7,F6){return this.getHelpers(F7,F6)[0]},getHelpers:function(GD,F8){var F9=[];if(!FI.hasOwnProperty(F8)){return FI}var F6=FI[F8],GC=this.getModeAt(GD);if(typeof GC[F8]=="string"){if(F6[GC[F8]]){F9.push(F6[GC[F8]])}}else{if(GC[F8]){for(var F7=0;F7<GC[F8].length;F7++){var GB=F6[GC[F8][F7]];if(GB){F9.push(GB)}}}else{if(GC.helperType&&F6[GC.helperType]){F9.push(F6[GC.helperType])}else{if(F6[GC.name]){F9.push(F6[GC.name])}}}}for(var F7=0;F7<F6._global.length;F7++){var GA=F6._global[F7];if(GA.pred(GC,this)&&DE(F9,GA.val)==-1){F9.push(GA.val)}}return F9},getStateAfter:function(F7,F6){var F8=this.doc;F7=C2(F8,F7==null?F8.first+F8.size-1:F7);return DV(this,F7+1,F6)},cursorCoords:function(F9,F7){var F8,F6=this.doc.sel.primary();if(F9==null){F8=F6.head}else{if(typeof F9=="object"){F8=Fe(this.doc,F9)}else{F8=F9?F6.from():F6.to()}}return Do(this,F8,F7||"page")},charCoords:function(F7,F6){return Cg(this,Fe(this.doc,F7),F6||"page")},coordsChar:function(F6,F7){F6=F3(this,F6,F7||"page");return Fj(this,F6.left,F6.top)},lineAtHeight:function(F6,F7){F6=F3(this,{top:F6,left:0},F7||"page").top;return Be(this.doc,F6+this.display.viewOffset)},heightAtLine:function(F7,GA){var F6=false,F9=this.doc.first+this.doc.size-1;if(F7<this.doc.first){F7=this.doc.first}else{if(F7>F9){F7=F9;F6=true}}var F8=E9(this.doc,F7);return Ek(this,F8,{top:0,left:0},GA||"page").top+(F6?this.doc.height-Bk(F8):0)},defaultTextHeight:function(){return At(this.display)},defaultCharWidth:function(){return DX(this.display)},setGutterMarker:C5(function(F6,F7,F8){return ES(this.doc,F6,"gutter",function(F9){var GA=F9.gutterMarkers||(F9.gutterMarkers={});GA[F7]=F8;if(!F8&&Eo(GA)){F9.gutterMarkers=null}return true})}),clearGutter:C5(function(F8){var F6=this,F9=F6.doc,F7=F9.first;F9.iter(function(GA){if(GA.gutterMarkers&&GA.gutterMarkers[F8]){GA.gutterMarkers[F8]=null;s(F6,F7,"gutter");if(Eo(GA.gutterMarkers)){GA.gutterMarkers=null}}++F7})}),addLineWidget:C5(function(F8,F7,F6){return Bf(this,F8,F7,F6)}),removeLineWidget:function(F6){F6.clear()},lineInfo:function(F6){if(typeof F6=="number"){if(!B7(this.doc,F6)){return null}var F7=F6;F6=E9(this.doc,F6);if(!F6){return null}}else{var F7=Bl(F6);if(F7==null){return null}}return{line:F7,handle:F6,text:F6.text,gutterMarkers:F6.gutterMarkers,textClass:F6.textClass,bgClass:F6.bgClass,wrapClass:F6.wrapClass,widgets:F6.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(GB,F8,GD,F9,GF){var GA=this.display;GB=Do(this,Fe(this.doc,GB));var GC=GB.bottom,F7=GB.left;F8.style.position="absolute";F8.setAttribute("cm-ignore-events","true");GA.sizer.appendChild(F8);if(F9=="over"){GC=GB.top}else{if(F9=="above"||F9=="near"){var F6=Math.max(GA.wrapper.clientHeight,this.doc.height),GE=Math.max(GA.sizer.clientWidth,GA.lineSpace.clientWidth);if((F9=="above"||GB.bottom+F8.offsetHeight>F6)&&GB.top>F8.offsetHeight){GC=GB.top-F8.offsetHeight}else{if(GB.bottom+F8.offsetHeight<=F6){GC=GB.bottom}}if(F7+F8.offsetWidth>GE){F7=GE-F8.offsetWidth}}}F8.style.top=GC+"px";F8.style.left=F8.style.right="";if(GF=="right"){F7=GA.sizer.clientWidth-F8.offsetWidth;F8.style.right="0px"}else{if(GF=="left"){F7=0}else{if(GF=="middle"){F7=(GA.sizer.clientWidth-F8.offsetWidth)/2}}F8.style.left=F7+"px"}if(GD){f(this,F7,GC,F7+F8.offsetWidth,GC+F8.offsetHeight)}},triggerOnKeyDown:C5(P),triggerOnKeyPress:C5(CW),triggerOnKeyUp:BE,execCommand:function(F6){if(EX.hasOwnProperty(F6)){return EX[F6](this)}},findPosH:function(GC,F9,GA,F7){var F6=1;if(F9<0){F6=-1;F9=-F9}for(var F8=0,GB=Fe(this.doc,GC);F8<F9;++F8){GB=BU(this.doc,GB,F6,GA,F7);if(GB.hitSide){break}}return GB},moveH:C5(function(F7,F8){var F6=this;F6.extendSelectionsBy(function(F9){if(F6.display.shift||F6.doc.extend||F9.empty()){return BU(F6.doc,F9.head,F7,F8,F6.options.rtlMoveVisually)}else{return F7<0?F9.from():F9.to()}},Ct)}),deleteH:C5(function(F6,F7){var F8=this.doc.sel,F9=this.doc;if(F8.somethingSelected()){F9.replaceSelection("",null,"+delete")}else{Er(this,function(GB){var GA=BU(F9,GB.head,F6,F7,false);return F6<0?{from:GA,to:GB.head}:{from:GB.head,to:GA}})}}),findPosV:function(GB,F8,GC,GE){var F6=1,GA=GE;if(F8<0){F6=-1;F8=-F8}for(var F7=0,GD=Fe(this.doc,GB);F7<F8;++F7){var F9=Do(this,GD,"div");if(GA==null){GA=F9.left}else{F9.left=GA}GD=BO(this,F9,F6,GC);if(GD.hitSide){break}}return GD},moveV:C5(function(F7,F9){var F6=this,GB=this.doc,GA=[];var GC=!F6.display.shift&&!GB.extend&&GB.sel.somethingSelected();GB.extendSelectionsBy(function(GD){if(GC){return F7<0?GD.from():GD.to()}var GF=Do(F6,GD.head,"div");if(GD.goalColumn!=null){GF.left=GD.goalColumn}GA.push(GF.left);var GE=BO(F6,GF,F7,F9);if(F9=="page"&&GD==GB.sel.primary()){Ci(F6,null,Cg(F6,GE,"div").top-GF.top)}return GE},Ct);if(GA.length){for(var F8=0;F8<GB.sel.ranges.length;F8++){GB.sel.ranges[F8].goalColumn=GA[F8]}}}),findWordAt:function(GD){var GB=this.doc,F9=E9(GB,GD.line).text;var GC=GD.ch,F8=GD.ch;if(F9){var GA=this.getHelper(GD,"wordChars");if((GD.xRel<0||F8==F9.length)&&GC){--GC}else{++F8}var F7=F9.charAt(GC);var F6=CY(F7,GA)?function(GE){return CY(GE,GA)}:/\s/.test(F7)?function(GE){return/\s/.test(GE)}:function(GE){return !/\s/.test(GE)&&!CY(GE)};while(GC>0&&F6(F9.charAt(GC-1))){--GC}while(F8<F9.length&&F6(F9.charAt(F8))){++F8}}return new Ds(x(GD.line,GC),x(GD.line,F8))},toggleOverwrite:function(F6){if(F6!=null&&F6==this.state.overwrite){return }if(this.state.overwrite=!this.state.overwrite){FV(this.display.cursorDiv,"CodeMirror-overwrite")}else{F(this.display.cursorDiv,"CodeMirror-overwrite")}Ab(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return Di()==this.display.input},scrollTo:C5(function(F6,F7){if(F6!=null||F7!=null){FX(this)}if(F6!=null){this.curOp.scrollLeft=F6}if(F7!=null){this.curOp.scrollTop=F7}}),getScrollInfo:function(){var F6=this.display.scroller;return{left:F6.scrollLeft,top:F6.scrollTop,height:F6.scrollHeight-Cq(this)-this.display.barHeight,width:F6.scrollWidth-Cq(this)-this.display.barWidth,clientHeight:Cs(this),clientWidth:DH(this)}},scrollIntoView:C5(function(F7,F8){if(F7==null){F7={from:this.doc.sel.primary().head,to:null};if(F8==null){F8=this.options.cursorScrollMargin}}else{if(typeof F7=="number"){F7={from:x(F7,0),to:null}}else{if(F7.from==null){F7={from:F7,to:null}}}}if(!F7.to){F7.to=F7.from}F7.margin=F8||0;if(F7.from.line!=null){FX(this);this.curOp.scrollToPos=F7}else{var F6=h(this,Math.min(F7.from.left,F7.to.left),Math.min(F7.from.top,F7.to.top)-F7.margin,Math.max(F7.from.right,F7.to.right),Math.max(F7.from.bottom,F7.to.bottom)+F7.margin);this.scrollTo(F6.scrollLeft,F6.scrollTop)}}),setSize:C5(function(F9,F7){var F6=this;function F8(GB){return typeof GB=="number"||/^\d+$/.test(String(GB))?GB+"px":GB}if(F9!=null){F6.display.wrapper.style.width=F8(F9)}if(F7!=null){F6.display.wrapper.style.height=F8(F7)}if(F6.options.lineWrapping){Ak(this)}var GA=F6.display.viewFrom;F6.doc.iter(GA,F6.display.viewTo,function(GB){if(GB.widgets){for(var GC=0;GC<GB.widgets.length;GC++){if(GB.widgets[GC].noHScroll){s(F6,GA,"widget");break}}}++GA});F6.curOp.forceUpdate=true;Ab(F6,"refresh",this)}),operation:function(F6){return Cj(this,F6)},refresh:C5(function(){var F6=this.display.cachedTextHeight;AG(this);this.curOp.forceUpdate=true;AJ(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);C1(this);if(F6==null||Math.abs(F6-At(this.display))>0.5){y(this)}Ab(this,"refresh",this)}),swapDoc:C5(function(F7){var F6=this.doc;F6.cm=null;D5(this,F7);AJ(this);FJ(this);this.scrollTo(F7.scrollLeft,F7.scrollTop);this.curOp.forceScroll=true;AD(this,"swapDoc",this,F6);return F6}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};BW(i);var Ex=i.defaults={};var BB=i.optionHandlers={};function S(F6,F9,F8,F7){i.defaults[F6]=F9;if(F8){BB[F6]=F7?function(GA,GC,GB){if(GB!=CA){F8(GA,GC,GB)}}:F8}}var CA=i.Init={toString:function(){return"CodeMirror.Init"}};S("value","",function(F6,F7){F6.setValue(F7)},true);S("mode",null,function(F6,F7){F6.doc.modeOption=F7;BP(F6)},true);S("indentUnit",2,BP,true);S("indentWithTabs",false);S("smartIndent",true);S("tabSize",4,function(F6){EF(F6);AJ(F6);AG(F6)},true);S("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(F6,F7){F6.options.specialChars=new RegExp(F7.source+(F7.test("\t")?"":"|\t"),"g");F6.refresh()},true);S("specialCharPlaceholder",E6,function(F6){F6.refresh()},true);S("electricChars",true);S("rtlMoveVisually",!Al);S("wholeLineUpdateBefore",true);S("theme","default",function(F6){Cl(F6);DQ(F6)},true);S("keyMap","default",function(F6,GA,F7){var F8=Fp(GA);var F9=F7!=i.Init&&Fp(F7);if(F9&&F9.detach){F9.detach(F6,F8)}if(F8.attach){F8.attach(F6,F9||null)}});S("extraKeys",null);S("lineWrapping",false,Ea,true);S("gutters",[],function(F6){CC(F6.options);DQ(F6)},true);S("fixedGutter",true,function(F6,F7){F6.display.gutters.style.left=F7?Dr(F6.display)+"px":"0";F6.refresh()},true);S("coverGutterNextToScrollbar",false,function(F6){Es(F6)},true);S("scrollbarStyle","native",function(F6){Aa(F6);Es(F6);F6.display.scrollbars.setScrollTop(F6.doc.scrollTop);F6.display.scrollbars.setScrollLeft(F6.doc.scrollLeft)},true);S("lineNumbers",false,function(F6){CC(F6.options);DQ(F6)},true);S("firstLineNumber",1,DQ,true);S("lineNumberFormatter",function(F6){return F6},DQ,true);S("showCursorWhenSelecting",false,Ba,true);S("resetSelectionOnContextMenu",true);S("readOnly",false,function(F6,F7){if(F7=="nocursor"){Ar(F6);F6.display.input.blur();F6.display.disabled=true}else{F6.display.disabled=false;if(!F7){FJ(F6)}}});S("disableInput",false,function(F6,F7){if(!F7){FJ(F6)}},true);S("dragDrop",true);S("cursorBlinkRate",530);S("cursorScrollMargin",0);S("cursorHeight",1,Ba,true);S("singleCursorHeightPerLine",true,Ba,true);S("workTime",100);S("workDelay",100);S("flattenSpans",true,EF,true);S("addModeClass",false,EF,true);S("pollInterval",100);S("undoDepth",200,function(F6,F7){F6.doc.history.undoDepth=F7});S("historyEventDelay",1250);S("viewportMargin",10,function(F6){F6.refresh()},true);S("maxHighlightLength",10000,EF,true);S("moveInputWithCursor",true,function(F6,F7){if(!F7){F6.display.inputDiv.style.top=F6.display.inputDiv.style.left=0}});S("tabindex",null,function(F6,F7){F6.display.input.tabIndex=F7||""});S("autofocus",null);var DN=i.modes={},Ao=i.mimeModes={};i.defineMode=function(F6,F7){if(!i.defaults.mode&&F6!="null"){i.defaults.mode=F6}if(arguments.length>2){F7.dependencies=Array.prototype.slice.call(arguments,2)}DN[F6]=F7};i.defineMIME=function(F7,F6){Ao[F7]=F6};i.resolveMode=function(F6){if(typeof F6=="string"&&Ao.hasOwnProperty(F6)){F6=Ao[F6]}else{if(F6&&typeof F6.name=="string"&&Ao.hasOwnProperty(F6.name)){var F7=Ao[F6.name];if(typeof F7=="string"){F7={name:F7}}F6=CJ(F7,F6);F6.name=F7.name}else{if(typeof F6=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(F6)){return i.resolveMode("application/xml")}}}if(typeof F6=="string"){return{name:F6}}else{return F6||{name:"null"}}};i.getMode=function(F7,F6){var F6=i.resolveMode(F6);var F9=DN[F6.name];if(!F9){return i.getMode(F7,"text/plain")}var GA=F9(F7,F6);if(DK.hasOwnProperty(F6.name)){var F8=DK[F6.name];for(var GB in F8){if(!F8.hasOwnProperty(GB)){continue}if(GA.hasOwnProperty(GB)){GA["_"+GB]=GA[GB]}GA[GB]=F8[GB]}}GA.name=F6.name;if(F6.helperType){GA.helperType=F6.helperType}if(F6.modeProps){for(var GB in F6.modeProps){GA[GB]=F6.modeProps[GB]}}return GA};i.defineMode("null",function(){return{token:function(F6){F6.skipToEnd()}}});i.defineMIME("text/plain","null");var DK=i.modeExtensions={};i.extendMode=function(F8,F7){var F6=DK.hasOwnProperty(F8)?DK[F8]:(DK[F8]={});Aj(F7,F6)};i.defineExtension=function(F6,F7){i.prototype[F6]=F7};i.defineDocExtension=function(F6,F7){AR.prototype[F6]=F7};i.defineOption=S;var A4=[];i.defineInitHook=function(F6){A4.push(F6)};var FI=i.helpers={};i.registerHelper=function(F7,F6,F8){if(!FI.hasOwnProperty(F7)){FI[F7]=i[F7]={_global:[]}}FI[F7][F6]=F8};i.registerGlobalHelper=function(F8,F7,F6,F9){i.registerHelper(F8,F7,F9);FI[F8]._global.push({pred:F6,val:F9})};var B1=i.copyState=function(F9,F6){if(F6===true){return F6}if(F9.copyState){return F9.copyState(F6)}var F8={};for(var GA in F6){var F7=F6[GA];if(F7 instanceof Array){F7=F7.concat([])}F8[GA]=F7}return F8};var By=i.startState=function(F8,F7,F6){return F8.startState?F8.startState(F7,F6):true};i.innerMode=function(F8,F6){while(F8.innerMode){var F7=F8.innerMode(F6);if(!F7||F7.mode==F8){break}F6=F7.state;F8=F7.mode}return F7||{mode:F8,state:F6}};var EX=i.commands={selectAll:function(F6){F6.setSelection(x(F6.firstLine(),0),x(F6.lastLine()),z)},singleSelection:function(F6){F6.setSelection(F6.getCursor("anchor"),F6.getCursor("head"),z)},killLine:function(F6){Er(F6,function(F8){if(F8.empty()){var F7=E9(F6.doc,F8.head.line).text.length;if(F8.head.ch==F7&&F8.head.line<F6.lastLine()){return{from:F8.head,to:x(F8.head.line+1,0)}}else{return{from:F8.head,to:x(F8.head.line,F7)}}}else{return{from:F8.from(),to:F8.to()}}})},deleteLine:function(F6){Er(F6,function(F7){return{from:x(F7.from().line,0),to:Fe(F6.doc,x(F7.to().line+1,0))}})},delLineLeft:function(F6){Er(F6,function(F7){return{from:x(F7.from().line,0),to:F7.from()}})},delWrappedLineLeft:function(F6){Er(F6,function(F7){var F9=F6.charCoords(F7.head,"div").top+5;var F8=F6.coordsChar({left:0,top:F9},"div");return{from:F8,to:F7.from()}})},delWrappedLineRight:function(F6){Er(F6,function(F7){var F9=F6.charCoords(F7.head,"div").top+5;var F8=F6.coordsChar({left:F6.display.lineDiv.offsetWidth+100,top:F9},"div");return{from:F7.from(),to:F8}})},undo:function(F6){F6.undo()},redo:function(F6){F6.redo()},undoSelection:function(F6){F6.undoSelection()},redoSelection:function(F6){F6.redoSelection()},goDocStart:function(F6){F6.extendSelection(x(F6.firstLine(),0))},goDocEnd:function(F6){F6.extendSelection(x(F6.lastLine()))},goLineStart:function(F6){F6.extendSelectionsBy(function(F7){return BR(F6,F7.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(F6){F6.extendSelectionsBy(function(F7){return Dc(F6,F7.head)},{origin:"+move",bias:1})},goLineEnd:function(F6){F6.extendSelectionsBy(function(F7){return Dj(F6,F7.head.line)},{origin:"+move",bias:-1})},goLineRight:function(F6){F6.extendSelectionsBy(function(F7){var F8=F6.charCoords(F7.head,"div").top+5;return F6.coordsChar({left:F6.display.lineDiv.offsetWidth+100,top:F8},"div")},Ct)},goLineLeft:function(F6){F6.extendSelectionsBy(function(F7){var F8=F6.charCoords(F7.head,"div").top+5;return F6.coordsChar({left:0,top:F8},"div")},Ct)},goLineLeftSmart:function(F6){F6.extendSelectionsBy(function(F7){var F8=F6.charCoords(F7.head,"div").top+5;var F9=F6.coordsChar({left:0,top:F8},"div");if(F9.ch<F6.getLine(F9.line).search(/\S/)){return Dc(F6,F7.head)}return F9},Ct)},goLineUp:function(F6){F6.moveV(-1,"line")},goLineDown:function(F6){F6.moveV(1,"line")},goPageUp:function(F6){F6.moveV(-1,"page")},goPageDown:function(F6){F6.moveV(1,"page")},goCharLeft:function(F6){F6.moveH(-1,"char")},goCharRight:function(F6){F6.moveH(1,"char")},goColumnLeft:function(F6){F6.moveH(-1,"column")},goColumnRight:function(F6){F6.moveH(1,"column")},goWordLeft:function(F6){F6.moveH(-1,"word")},goGroupRight:function(F6){F6.moveH(1,"group")},goGroupLeft:function(F6){F6.moveH(-1,"group")},goWordRight:function(F6){F6.moveH(1,"word")},delCharBefore:function(F6){F6.deleteH(-1,"char")},delCharAfter:function(F6){F6.deleteH(1,"char")},delWordBefore:function(F6){F6.deleteH(-1,"word")},delWordAfter:function(F6){F6.deleteH(1,"word")},delGroupBefore:function(F6){F6.deleteH(-1,"group")},delGroupAfter:function(F6){F6.deleteH(1,"group")},indentAuto:function(F6){F6.indentSelection("smart")},indentMore:function(F6){F6.indentSelection("add")},indentLess:function(F6){F6.indentSelection("subtract")},insertTab:function(F6){F6.replaceSelection("\t")},insertSoftTab:function(F6){var F8=[],F7=F6.listSelections(),GB=F6.options.tabSize;for(var GA=0;GA<F7.length;GA++){var GC=F7[GA].from();var F9=Br(F6.getLine(GC.line),GC.ch,GB);F8.push(new Array(GB-F9%GB+1).join(" "))}F6.replaceSelections(F8)},defaultTab:function(F6){if(F6.somethingSelected()){F6.indentSelection("add")}else{F6.execCommand("insertTab")}},transposeChars:function(F6){Cj(F6,function(){var F9=F6.listSelections(),F8=[];for(var GA=0;GA<F9.length;GA++){var GC=F9[GA].head,F7=E9(F6.doc,GC.line).text;if(F7){if(GC.ch==F7.length){GC=new x(GC.line,GC.ch-1)}if(GC.ch>0){GC=new x(GC.line,GC.ch+1);F6.replaceRange(F7.charAt(GC.ch-1)+F7.charAt(GC.ch-2),x(GC.line,GC.ch-2),GC,"+transpose")}else{if(GC.line>F6.doc.first){var GB=E9(F6.doc,GC.line-1).text;if(GB){F6.replaceRange(F7.charAt(0)+"\n"+GB.charAt(GB.length-1),x(GC.line-1,GB.length-1),x(GC.line,1),"+transpose")}}}}F8.push(new Ds(GC,GC))}F6.setSelections(F8)})},newlineAndIndent:function(F6){Cj(F6,function(){var F7=F6.listSelections().length;for(var F9=0;F9<F7;F9++){var F8=F6.listSelections()[F9];F6.replaceRange("\n",F8.anchor,F8.head,"+input");F6.indentLine(F8.from().line+1,null,true);Fb(F6)}})},toggleOverwrite:function(F6){F6.toggleOverwrite()}};var E4=i.keyMap={};E4.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};E4.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};E4.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};E4.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};E4["default"]=B5?E4.macDefault:E4.pcDefault;function DO(F7){var GD=F7.split(/-(?!$)/),F7=GD[GD.length-1];var GC,GB,F6,GA;for(var F9=0;F9<GD.length-1;F9++){var F8=GD[F9];if(/^(cmd|meta|m)$/i.test(F8)){GA=true}else{if(/^a(lt)?$/i.test(F8)){GC=true}else{if(/^(c|ctrl|control)$/i.test(F8)){GB=true}else{if(/^s(hift)$/i.test(F8)){F6=true}else{throw new Error("Unrecognized modifier name: "+F8)}}}}}if(GC){F7="Alt-"+F7}if(GB){F7="Ctrl-"+F7}if(GA){F7="Cmd-"+F7}if(F6){F7="Shift-"+F7}return F7}i.normalizeKeyMap=function(GD){var F7={};for(var GC in GD){if(GD.hasOwnProperty(GC)){var GE=GD[GC];if(/^(name|fallthrough|(de|at)tach)$/.test(GC)){continue}if(GE=="..."){delete GD[GC];continue}var GF=Bq(GC.split(" "),DO);for(var GB=0;GB<GF.length;GB++){var F9,F8;if(GB==GF.length-1){F8=GC;F9=GE}else{F8=GF.slice(0,GB+1).join(" ");F9="..."}var GA=F7[F8];if(!GA){F7[F8]=F9}else{if(GA!=F9){throw new Error("Inconsistent bindings for "+F8)}}}delete GD[GC]}}for(var F6 in F7){GD[F6]=F7[F6]}return GD};var I=i.lookupKey=function(F9,GC,GB,F8){GC=Fp(GC);var GA=GC.call?GC.call(F9,F8):GC[F9];if(GA===false){return"nothing"}if(GA==="..."){return"multi"}if(GA!=null&&GB(GA)){return"handled"}if(GC.fallthrough){if(Object.prototype.toString.call(GC.fallthrough)!="[object Array]"){return I(F9,GC.fallthrough,GB,F8)}for(var F7=0;F7<GC.fallthrough.length;F7++){var F6=I(F9,GC.fallthrough[F7],GB,F8);if(F6){return F6}}}};var EW=i.isModifierKey=function(F7){var F6=typeof F7=="string"?F7:FA[F7.keyCode];return F6=="Ctrl"||F6=="Alt"||F6=="Shift"||F6=="Mod"};var FM=i.keyName=function(F7,F9){if(Dw&&F7.keyCode==34&&F7["char"]){return false}var F8=FA[F7.keyCode],F6=F8;if(F6==null||F7.altGraphKey){return false}if(F7.altKey&&F8!="Alt"){F6="Alt-"+F6}if((Bo?F7.metaKey:F7.ctrlKey)&&F8!="Ctrl"){F6="Ctrl-"+F6}if((Bo?F7.ctrlKey:F7.metaKey)&&F8!="Cmd"){F6="Cmd-"+F6}if(!F9&&F7.shiftKey&&F8!="Shift"){F6="Shift-"+F6}return F6};function Fp(F6){return typeof F6=="string"?E4[F6]:F6}i.fromTextArea=function(GD,GE){if(!GE){GE={}}GE.value=GD.value;if(!GE.tabindex&&GD.tabindex){GE.tabindex=GD.tabindex}if(!GE.placeholder&&GD.placeholder){GE.placeholder=GD.placeholder}if(GE.autofocus==null){var F6=Di();GE.autofocus=F6==GD||GD.getAttribute("autofocus")!=null&&F6==document.body}function GA(){GD.value=GC.getValue()}if(GD.form){Bv(GD.form,"submit",GA);if(!GE.leaveSubmitMethodAlone){var F7=GD.form,GB=F7.submit;try{var F9=F7.submit=function(){GA();F7.submit=GB;F7.submit();F7.submit=F9}}catch(F8){}}}GD.style.display="none";var GC=i(function(GF){GD.parentNode.insertBefore(GF,GD.nextSibling)},GE);GC.save=GA;GC.getTextArea=function(){return GD};GC.toTextArea=function(){GC.toTextArea=isNaN;GA();GD.parentNode.removeChild(GC.getWrapperElement());GD.style.display="";if(GD.form){D7(GD.form,"submit",GA);if(typeof GD.form.submit=="function"){GD.form.submit=GB}}};return GC};var En=i.StringStream=function(F6,F7){this.pos=this.start=0;this.string=F6;this.tabSize=F7||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0};En.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}},eat:function(F6){var F8=this.string.charAt(this.pos);if(typeof F6=="string"){var F7=F8==F6}else{var F7=F8&&(F6.test?F6.test(F8):F6(F8))}if(F7){++this.pos;return F8}},eatWhile:function(F6){var F7=this.pos;while(this.eat(F6)){}return this.pos>F7},eatSpace:function(){var F6=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>F6},skipToEnd:function(){this.pos=this.string.length},skipTo:function(F6){var F7=this.string.indexOf(F6,this.pos);if(F7>-1){this.pos=F7;return true}},backUp:function(F6){this.pos-=F6},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=Br(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?Br(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Br(this.string,null,this.tabSize)-(this.lineStart?Br(this.string,this.lineStart,this.tabSize):0)},match:function(GA,F7,F6){if(typeof GA=="string"){var GB=function(GC){return F6?GC.toLowerCase():GC};var F9=this.string.substr(this.pos,GA.length);if(GB(F9)==GB(GA)){if(F7!==false){this.pos+=GA.length}return true}}else{var F8=this.string.slice(this.pos).match(GA);if(F8&&F8.index>0){return null}if(F8&&F7!==false){this.pos+=F8[0].length}return F8}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(F7,F6){this.lineStart+=F7;try{return F6()}finally{this.lineStart-=F7}}};var q=i.TextMarker=function(F7,F6){this.lines=[];this.type=F6;this.doc=F7};BW(q);q.prototype.clear=function(){if(this.explicitlyCleared){return }var GD=this.doc.cm,F7=GD&&!GD.curOp;if(F7){Cf(GD)}if(FC(this,"clear")){var GE=this.find();if(GE){AD(this,"clear",GE.from,GE.to)}}var F8=null,GB=null;for(var F9=0;F9<this.lines.length;++F9){var GF=this.lines[F9];var GC=E3(GF.markedSpans,this);if(GD&&!this.collapsed){s(GD,Bl(GF),"text")}else{if(GD){if(GC.to!=null){GB=Bl(GF)}if(GC.from!=null){F8=Bl(GF)}}}GF.markedSpans=Eb(GF.markedSpans,GC);if(GC.from==null&&this.collapsed&&!FR(this.doc,GF)&&GD){Fu(GF,At(GD.display))}}if(GD&&this.collapsed&&!GD.options.lineWrapping){for(var F9=0;F9<this.lines.length;++F9){var F6=Y(this.lines[F9]),GA=EH(F6);if(GA>GD.display.maxLineLength){GD.display.maxLine=F6;GD.display.maxLineLength=GA;GD.display.maxLineChanged=true}}}if(F8!=null&&GD&&this.collapsed){AG(GD,F8,GB+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(GD){ER(GD.doc)}}if(GD){AD(GD,"markerCleared",GD,this)}if(F7){AL(GD)}if(this.parent){this.parent.clear()}};q.prototype.find=function(F9,F7){if(F9==null&&this.type=="bookmark"){F9=1}var GC,GB;for(var F8=0;F8<this.lines.length;++F8){var F6=this.lines[F8];var GA=E3(F6.markedSpans,this);if(GA.from!=null){GC=x(F7?F6:Bl(F6),GA.from);if(F9==-1){return GC}}if(GA.to!=null){GB=x(F7?F6:Bl(F6),GA.to);if(F9==1){return GB}}}return GC&&{from:GC,to:GB}};q.prototype.changed=function(){var F8=this.find(-1,true),F7=this,F6=this.doc.cm;if(!F8||!F6){return }Cj(F6,function(){var GA=F8.line,GB=Bl(F8.line);var F9=E5(F6,GB);if(F9){AS(F9);F6.curOp.selectionChanged=F6.curOp.forceUpdate=true}F6.curOp.updateMaxLine=true;if(!FR(F7.doc,GA)&&F7.height!=null){var GD=F7.height;F7.height=null;var GC=Cv(F7)-GD;if(GC){Fu(GA,GA.height+GC)}}})};q.prototype.attachLine=function(F6){if(!this.lines.length&&this.doc.cm){var F7=this.doc.cm.curOp;if(!F7.maybeHiddenMarkers||DE(F7.maybeHiddenMarkers,this)==-1){(F7.maybeUnhiddenMarkers||(F7.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(F6)};q.prototype.detachLine=function(F6){this.lines.splice(DE(this.lines,F6),1);if(!this.lines.length&&this.doc.cm){var F7=this.doc.cm.curOp;(F7.maybeHiddenMarkers||(F7.maybeHiddenMarkers=[])).push(this)}};var A1=0;function EZ(GE,GC,GD,GG,GA){if(GG&&GG.shared){return p(GE,GC,GD,GG,GA)}if(GE.cm&&!GE.cm.curOp){return Cz(GE.cm,EZ)(GE,GC,GD,GG,GA)}var F9=new q(GE,GA),GF=CD(GC,GD);if(GG){Aj(GG,F9,false)}if(GF>0||GF==0&&F9.clearWhenEmpty!==false){return F9}if(F9.replacedWith){F9.collapsed=true;F9.widgetNode=Fr("span",[F9.replacedWith],"CodeMirror-widget");if(!GG.handleMouseEvents){F9.widgetNode.setAttribute("cm-ignore-events","true")}if(GG.insertLeft){F9.widgetNode.insertLeft=true}}if(F9.collapsed){if(Z(GE,GC.line,GC,GD,F9)||GC.line!=GD.line&&Z(GE,GD.line,GC,GD,F9)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}A3=true}if(F9.addToHistory){Fh(GE,{from:GC,to:GD,origin:"markText"},GE.sel,NaN)}var F7=GC.line,GB=GE.cm,F6;GE.iter(F7,GD.line+1,function(GH){if(GB&&F9.collapsed&&!GB.options.lineWrapping&&Y(GH)==GB.display.maxLine){F6=true}if(F9.collapsed&&F7!=GC.line){Fu(GH,0)}CB(GH,new EC(F9,F7==GC.line?GC.ch:null,F7==GD.line?GD.ch:null));++F7});if(F9.collapsed){GE.iter(GC.line,GD.line+1,function(GH){if(FR(GE,GH)){Fu(GH,0)}})}if(F9.clearOnEnter){Bv(F9,"beforeCursorEnter",function(){F9.clear()})}if(F9.readOnly){F1=true;if(GE.history.done.length||GE.history.undone.length){GE.clearHistory()}}if(F9.collapsed){F9.id=++A1;F9.atomic=true}if(GB){if(F6){GB.curOp.updateMaxLine=true}if(F9.collapsed){AG(GB,GC.line,GD.line+1)}else{if(F9.className||F9.title||F9.startStyle||F9.endStyle||F9.css){for(var F8=GC.line;F8<=GD.line;F8++){s(GB,F8,"text")}}}if(F9.atomic){ER(GB.doc)}AD(GB,"markerAdded",GB,F9)}return F9}var X=i.SharedTextMarker=function(F8,F7){this.markers=F8;this.primary=F7;for(var F6=0;F6<F8.length;++F6){F8[F6].parent=this}};BW(X);X.prototype.clear=function(){if(this.explicitlyCleared){return }this.explicitlyCleared=true;for(var F6=0;F6<this.markers.length;++F6){this.markers[F6].clear()}AD(this,"clear")};X.prototype.find=function(F7,F6){return this.primary.find(F7,F6)};function p(GA,GD,GC,F6,F8){F6=Aj(F6);F6.shared=false;var GB=[EZ(GA,GD,GC,F6,F8)],F7=GB[0];var F9=F6.widgetNode;D1(GA,function(GF){if(F9){F6.widgetNode=F9.cloneNode(true)}GB.push(EZ(GF,Fe(GF,GD),Fe(GF,GC),F6,F8));for(var GE=0;GE<GF.linked.length;++GE){if(GF.linked[GE].isParent){return }}F7=Fc(GB)});return new X(GB,F7)}function Ej(F6){return F6.findMarks(x(F6.first,0),F6.clipPos(x(F6.lastLine())),function(F7){return F7.parent})}function DZ(GB,GC){for(var F9=0;F9<GC.length;F9++){var F7=GC[F9],GD=F7.find();var F6=GB.clipPos(GD.from),GA=GB.clipPos(GD.to);if(CD(F6,GA)){var F8=EZ(GB,F6,GA,F7.primary,F7.primary.type);F7.markers.push(F8);F8.parent=F7}}}function EI(F9){for(var F8=0;F8<F9.length;F8++){var F6=F9[F8],GB=[F6.primary.doc];D1(F6.primary.doc,function(GC){GB.push(GC)});for(var F7=0;F7<F6.markers.length;F7++){var GA=F6.markers[F7];if(DE(GB,GA.doc)==-1){GA.parent=null;F6.markers.splice(F7--,1)}}}}function EC(F6,F8,F7){this.marker=F6;this.from=F8;this.to=F7}function E3(F8,F6){if(F8){for(var F7=0;F7<F8.length;++F7){var F9=F8[F7];if(F9.marker==F6){return F9}}}}function Eb(F7,F8){for(var F9,F6=0;F6<F7.length;++F6){if(F7[F6]!=F8){(F9||(F9=[])).push(F7[F6])}}return F9}function CB(F6,F7){F6.markedSpans=F6.markedSpans?F6.markedSpans.concat([F7]):[F7];F7.marker.attachLine(F6)}function Am(F7,F8,GC){if(F7){for(var GA=0,GD;GA<F7.length;++GA){var GE=F7[GA],GB=GE.marker;var F6=GE.from==null||(GB.inclusiveLeft?GE.from<=F8:GE.from<F8);if(F6||GE.from==F8&&GB.type=="bookmark"&&(!GC||!GE.marker.insertLeft)){var F9=GE.to==null||(GB.inclusiveRight?GE.to>=F8:GE.to>F8);(GD||(GD=[])).push(new EC(GB,GE.from,F9?null:GE.to))}}}return GD}function AY(F7,F9,GC){if(F7){for(var GA=0,GD;GA<F7.length;++GA){var GE=F7[GA],GB=GE.marker;var F8=GE.to==null||(GB.inclusiveRight?GE.to>=F9:GE.to>F9);if(F8||GE.from==F9&&GB.type=="bookmark"&&(!GC||GE.marker.insertLeft)){var F6=GE.from==null||(GB.inclusiveLeft?GE.from<=F9:GE.from<F9);(GD||(GD=[])).push(new EC(GB,F6?null:GE.from-F9,GE.to==null?null:GE.to-F9))}}}return GD}function EE(GI,GF){if(GF.full){return null}var GE=B7(GI,GF.from.line)&&E9(GI,GF.from.line).markedSpans;var GL=B7(GI,GF.to.line)&&E9(GI,GF.to.line).markedSpans;if(!GE&&!GL){return null}var F7=GF.from.ch,GA=GF.to.ch,GD=CD(GF.from,GF.to)==0;var GC=Am(GE,F7,GD);var GK=AY(GL,GA,GD);var GJ=GF.text.length==1,F8=Fc(GF.text).length+(GJ?F7:0);if(GC){for(var F9=0;F9<GC.length;++F9){var GH=GC[F9];if(GH.to==null){var GM=E3(GK,GH.marker);if(!GM){GH.to=F7}else{if(GJ){GH.to=GM.to==null?null:GM.to+F8}}}}}if(GK){for(var F9=0;F9<GK.length;++F9){var GH=GK[F9];if(GH.to!=null){GH.to+=F8}if(GH.from==null){var GM=E3(GC,GH.marker);if(!GM){GH.from=F8;if(GJ){(GC||(GC=[])).push(GH)}}}else{GH.from+=F8;if(GJ){(GC||(GC=[])).push(GH)}}}}if(GC){GC=Q(GC)}if(GK&&GK!=GC){GK=Q(GK)}var GB=[GC];if(!GJ){var GG=GF.text.length-2,F6;if(GG>0&&GC){for(var F9=0;F9<GC.length;++F9){if(GC[F9].to==null){(F6||(F6=[])).push(new EC(GC[F9].marker,null,null))}}}for(var F9=0;F9<GG;++F9){GB.push(F6)}GB.push(GK)}return GB}function Q(F7){for(var F6=0;F6<F7.length;++F6){var F8=F7[F6];if(F8.from!=null&&F8.from==F8.to&&F8.marker.clearWhenEmpty!==false){F7.splice(F6--,1)}}if(!F7.length){return null}return F7}function D3(GE,GC){var F6=B2(GE,GC);var GF=EE(GE,GC);if(!F6){return GF}if(!GF){return F6}for(var F9=0;F9<F6.length;++F9){var GA=F6[F9],GB=GF[F9];if(GA&&GB){spans:for(var F8=0;F8<GB.length;++F8){var GD=GB[F8];for(var F7=0;F7<GA.length;++F7){if(GA[F7].marker==GD.marker){continue spans}}GA.push(GD)}}else{if(GB){F6[F9]=GB}}}return F6}function Ce(GI,GG,GH){var GA=null;GI.iter(GG.line,GH.line+1,function(GJ){if(GJ.markedSpans){for(var GK=0;GK<GJ.markedSpans.length;++GK){var GL=GJ.markedSpans[GK].marker;if(GL.readOnly&&(!GA||DE(GA,GL)==-1)){(GA||(GA=[])).push(GL)}}}});if(!GA){return null}var GB=[{from:GG,to:GH}];for(var GC=0;GC<GA.length;++GC){var GD=GA[GC],F8=GD.find(0);for(var F9=0;F9<GB.length;++F9){var F7=GB[F9];if(CD(F7.to,F8.from)<0||CD(F7.from,F8.to)>0){continue}var GF=[F9,1],F6=CD(F7.from,F8.from),GE=CD(F7.to,F8.to);if(F6<0||!GD.inclusiveLeft&&!F6){GF.push({from:F7.from,to:F8.from})}if(GE>0||!GD.inclusiveRight&&!GE){GF.push({from:F8.to,to:F7.to})}GB.splice.apply(GB,GF);F9+=GF.length-1}}return GB}function Fx(F6){var F8=F6.markedSpans;if(!F8){return }for(var F7=0;F7<F8.length;++F7){F8[F7].marker.detachLine(F6)}F6.markedSpans=null}function C0(F6,F8){if(!F8){return }for(var F7=0;F7<F8.length;++F7){F8[F7].marker.attachLine(F6)}F6.markedSpans=F8}function V(F6){return F6.inclusiveLeft?-1:0}function Bu(F6){return F6.inclusiveRight?1:0}function Dk(F9,F7){var GB=F9.lines.length-F7.lines.length;if(GB!=0){return GB}var F8=F9.find(),GC=F7.find();var F6=CD(F8.from,GC.from)||V(F9)-V(F7);if(F6){return -F6}var GA=CD(F8.to,GC.to)||Bu(F9)-Bu(F7);if(GA){return GA}return F7.id-F9.id}function A2(F7,GB){var F6=A3&&F7.markedSpans,GA;if(F6){for(var F9,F8=0;F8<F6.length;++F8){F9=F6[F8];if(F9.marker.collapsed&&(GB?F9.from:F9.to)==null&&(!GA||Dk(GA,F9.marker)<0)){GA=F9.marker}}}return GA}function Ei(F6){return A2(F6,true)}function EP(F6){return A2(F6,false)}function Z(GE,F8,GC,GD,GA){var GH=E9(GE,F8);var F6=A3&&GH.markedSpans;if(F6){for(var F9=0;F9<F6.length;++F9){var F7=F6[F9];if(!F7.marker.collapsed){continue}var GG=F7.marker.find(0);var GF=CD(GG.from,GC)||V(F7.marker)-V(GA);var GB=CD(GG.to,GD)||Bu(F7.marker)-Bu(GA);if(GF>=0&&GB<=0||GF<=0&&GB>=0){continue}if(GF<=0&&(CD(GG.to,GC)>0||(F7.marker.inclusiveRight&&GA.inclusiveLeft))||GF>=0&&(CD(GG.from,GD)<0||(F7.marker.inclusiveLeft&&GA.inclusiveRight))){return true}}}}function Y(F7){var F6;while(F6=Ei(F7)){F7=F6.find(-1,true).line}return F7}function H(F8){var F6,F7;while(F6=EP(F8)){F8=F6.find(1,true).line;(F7||(F7=[])).push(F8)}return F7}function As(F9,F7){var F6=E9(F9,F7),F8=Y(F6);if(F6==F8){return F7}return Bl(F8)}function Dx(F9,F8){if(F8>F9.lastLine()){return F8}var F7=E9(F9,F8),F6;if(!FR(F9,F7)){return F8}while(F6=EP(F7)){F7=F6.find(1,true).line}return Bl(F7)+1}function FR(GA,F7){var F6=A3&&F7.markedSpans;if(F6){for(var F9,F8=0;F8<F6.length;++F8){F9=F6[F8];if(!F9.marker.collapsed){continue}if(F9.from==null){return true}if(F9.marker.widgetNode){continue}if(F9.from==0&&F9.marker.inclusiveLeft&&u(GA,F7,F9)){return true}}}}function u(GB,F7,F9){if(F9.to==null){var F6=F9.marker.find(1,true);return u(GB,F6.line,E3(F6.line.markedSpans,F9.marker))}if(F9.marker.inclusiveRight&&F9.to==F7.text.length){return true}for(var GA,F8=0;F8<F7.markedSpans.length;++F8){GA=F7.markedSpans[F8];if(GA.marker.collapsed&&!GA.marker.widgetNode&&GA.from==F9.to&&(GA.to==null||GA.to!=F9.from)&&(GA.marker.inclusiveLeft||F9.marker.inclusiveRight)&&u(GB,F7,GA)){return true}}}var DW=i.LineWidget=function(F6,F9,F7){if(F7){for(var F8 in F7){if(F7.hasOwnProperty(F8)){this[F8]=F7[F8]}}}this.cm=F6;this.node=F9};BW(DW);function Du(F6,F7,F8){if(Bk(F7)<((F6.curOp&&F6.curOp.scrollTop)||F6.doc.scrollTop)){Ci(F6,null,F8)}}DW.prototype.clear=function(){var F7=this.cm,F9=this.line.widgets,F8=this.line,GB=Bl(F8);if(GB==null||!F9){return }for(var GA=0;GA<F9.length;++GA){if(F9[GA]==this){F9.splice(GA--,1)}}if(!F9.length){F8.widgets=null}var F6=Cv(this);Cj(F7,function(){Du(F7,F8,-F6);s(F7,GB,"widget");Fu(F8,Math.max(0,F8.height-F6))})};DW.prototype.changed=function(){var F7=this.height,F6=this.cm,F8=this.line;this.height=null;var F9=Cv(this)-F7;if(!F9){return }Cj(F6,function(){F6.curOp.forceUpdate=true;Du(F6,F8,F9);Fu(F8,F8.height+F9)})};function Cv(F7){if(F7.height!=null){return F7.height}if(!Fz(document.body,F7.node)){var F6="position: relative;";if(F7.coverGutter){F6+="margin-left: -"+F7.cm.display.gutters.offsetWidth+"px;"}if(F7.noHScroll){F6+="width: "+F7.cm.display.wrapper.clientWidth+"px;"}Bp(F7.cm.display.measure,Fr("div",[F7.node],null,F6))}return F7.height=F7.node.offsetHeight}function Bf(F6,GA,F8,F7){var F9=new DW(F6,F8,F7);if(F9.noHScroll){F6.display.alignWidgets=true}ES(F6.doc,GA,"widget",function(GC){var GD=GC.widgets||(GC.widgets=[]);if(F9.insertAt==null){GD.push(F9)}else{GD.splice(Math.min(GD.length-1,Math.max(0,F9.insertAt)),0,F9)}F9.line=GC;if(!FR(F6.doc,GC)){var GB=Bk(GC)<F6.doc.scrollTop;Fu(GC,GC.height+Cv(F9));if(GB){Ci(F6,null,F9.height)}F6.curOp.forceUpdate=true}return true});return F9}var Fv=i.Line=function(F8,F7,F6){this.text=F8;C0(this,F7);this.height=F6?F6(this):1};BW(Fv);Fv.prototype.lineNo=function(){return Bl(this)};function EG(F7,GA,F8,F6){F7.text=GA;if(F7.stateAfter){F7.stateAfter=null}if(F7.styles){F7.styles=null}if(F7.order!=null){F7.order=null}Fx(F7);C0(F7,F8);var F9=F6?F6(F7):1;if(F9!=F7.height){Fu(F7,F9)}}function BZ(F6){F6.parent=null;Fx(F6)}function DF(F8,F7){if(F8){for(;;){var F6=F8.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!F6){break}F8=F8.slice(0,F6.index)+F8.slice(F6.index+F6[0].length);var F9=F6[1]?"bgClass":"textClass";if(F7[F9]==null){F7[F9]=F6[2]}else{if(!(new RegExp("(?:^|s)"+F6[2]+"(?:$|s)")).test(F7[F9])){F7[F9]+=" "+F6[2]}}}}return F8}function FL(F8,F7){if(F8.blankLine){return F8.blankLine(F7)}if(!F8.innerMode){return }var F6=i.innerMode(F8,F7);if(F6.mode.blankLine){return F6.mode.blankLine(F6.state)}}function EU(GB,GA,F9,F6){for(var F7=0;F7<10;F7++){if(F6){F6[0]=i.innerMode(GB,F9).mode}var F8=GB.token(GA,F9);if(GA.pos>GA.start){return F8}}throw new Error("Mode "+GB.name+" failed to advance stream.")}function CP(GF,GD,GA,F9){function F6(GI){return{start:GG.start,end:GG.pos,string:GG.current(),type:F8||null,state:GI?B1(GE.mode,F7):F7}}var GE=GF.doc,GB=GE.mode,F8;GD=Fe(GE,GD);var GH=E9(GE,GD.line),F7=DV(GF,GD.line,GA);var GG=new En(GH.text,GF.options.tabSize),GC;if(F9){GC=[]}while((F9||GG.pos<GD.ch)&&!GG.eol()){GG.start=GG.pos;F8=EU(GB,GG,F7);if(F9){GC.push(F6(true))}}return F9?GC:F6()}function W(GG,GI,GB,F7,GC,F9,GA){var F8=GB.flattenSpans;if(F8==null){F8=GG.options.flattenSpans}var GE=0,GD=null;var GH=new En(GI,GG.options.tabSize),F6;var GK=GG.options.addModeClass&&[null];if(GI==""){DF(FL(GB,F7),F9)}while(!GH.eol()){if(GH.pos>GG.options.maxHighlightLength){F8=false;if(GA){DR(GG,GI,F7,GH.pos)}GH.pos=GI.length;F6=null}else{F6=DF(EU(GB,GH,F7,GK),F9)}if(GK){var GJ=GK[0].name;if(GJ){F6="m-"+(F6?GJ+" "+F6:GJ)}}if(!F8||GD!=F6){while(GE<GH.start){GE=Math.min(GH.start,GE+50000);GC(GE,GD)}GD=F6}GH.start=GH.pos}while(GE<GH.pos){var GF=Math.min(GH.pos,GE+50000);GC(GF,GD);GE=GF}}function FU(GD,GF,F6,GA){var GE=[GD.state.modeGen],F9={};W(GD,GF.text,GD.doc.mode,F6,function(GG,GH){GE.push(GG,GH)},F9,GA);for(var F7=0;F7<GD.state.overlays.length;++F7){var GB=GD.state.overlays[F7],GC=1,F8=0;W(GD,GF.text,GB.mode,true,function(GG,GI){var GK=GC;while(F8<GG){var GH=GE[GC];if(GH>GG){GE.splice(GC,1,GG,GE[GC+1],GH)}GC+=2;F8=Math.min(GG,GH)}if(!GI){return }if(GB.opaque){GE.splice(GK,GC-GK,GG,"cm-overlay "+GI);GC=GK+2}else{for(;GK<GC;GK+=2){var GJ=GE[GK+1];GE[GK+1]=(GJ?GJ+" ":"")+"cm-overlay "+GI}}},F9)}return{styles:GE,classes:F9.bgClass||F9.textClass?F9:null}}function C3(F7,F8,F9){if(!F8.styles||F8.styles[0]!=F7.state.modeGen){var F6=FU(F7,F8,F8.stateAfter=DV(F7,Bl(F8)));F8.styles=F6.styles;if(F6.classes){F8.styleClasses=F6.classes}else{if(F8.styleClasses){F8.styleClasses=null}}if(F9===F7.doc.frontier){F7.doc.frontier++}}return F8.styles}function DR(F6,GB,F8,F7){var GA=F6.doc.mode;var F9=new En(GB,F6.options.tabSize);F9.start=F9.pos=F7||0;if(GB==""){FL(GA,F8)}while(!F9.eol()&&F9.pos<=F6.options.maxHighlightLength){EU(GA,F9,F8);F9.start=F9.pos}}var Dq={},Bz={};function Eq(F8,F7){if(!F8||/^\s*$/.test(F8)){return null}var F6=F7.addModeClass?Bz:Dq;return F6[F8]||(F6[F8]=F8.replace(/\S+/g,"cm-$&"))}function El(F7,GB){var GC=Fr("span",null,null,Cx?"padding-right: .1px":null);var F9={pre:Fr("pre",[GC]),content:GC,col:0,pos:0,cm:F7};GB.measure={};for(var GA=0;GA<=(GB.rest?GB.rest.length:0);GA++){var F8=GA?GB.rest[GA-1]:GB.line,F6;F9.pos=0;F9.addToken=T;if((De||Cx)&&F7.getOption("lineWrapping")){F9.addToken=Fa(F9.addToken)}if(Bm(F7.display.measure)&&(F6=A(F8))){F9.addToken=v(F9.addToken,F6)}F9.map=[];var GD=GB!=F7.display.externalMeasured&&Bl(F8);BM(F8,F9,C3(F7,F8,GD));if(F8.styleClasses){if(F8.styleClasses.bgClass){F9.bgClass=Fm(F8.styleClasses.bgClass,F9.bgClass||"")}if(F8.styleClasses.textClass){F9.textClass=Fm(F8.styleClasses.textClass,F9.textClass||"")}}if(F9.map.length==0){F9.map.push(0,0,F9.content.appendChild(BL(F7.display.measure)))}if(GA==0){GB.measure.map=F9.map;GB.measure.cache={}}else{(GB.measure.maps||(GB.measure.maps=[])).push(F9.map);(GB.measure.caches||(GB.measure.caches=[])).push({})}}if(Cx&&/\bcm-tab\b/.test(F9.content.lastChild.className)){F9.content.className="cm-tab-wrap-hack"}Ab(F7,"renderLine",F7,GB.line,F9.pre);if(F9.pre.className){F9.textClass=Fm(F9.pre.className,F9.textClass||"")}return F9}function E6(F7){var F6=Fr("span","\u2022","cm-invalidchar");F6.title="\\u"+F7.charCodeAt(0).toString(16);return F6}function T(GH,GC,GL,GJ,GF,GN,GB){if(!GC){return }var F6=GH.cm.options.specialChars,F7=false;if(!F6.test(GC)){GH.col+=GC.length;var GK=document.createTextNode(GC);GH.map.push(GH.pos,GH.pos+GC.length,GK);if(De&&K<9){F7=true}GH.pos+=GC.length}else{var GK=document.createDocumentFragment(),F9=0;while(true){F6.lastIndex=F9;var GI=F6.exec(GC);var GM=GI?GI.index-F9:GC.length-F9;if(GM){var GE=document.createTextNode(GC.slice(F9,F9+GM));if(De&&K<9){GK.appendChild(Fr("span",[GE]))}else{GK.appendChild(GE)}GH.map.push(GH.pos,GH.pos+GM,GE);GH.col+=GM;GH.pos+=GM}if(!GI){break}F9+=GM+1;if(GI[0]=="\t"){var GG=GH.cm.options.tabSize,GD=GG-GH.col%GG;var GE=GK.appendChild(Fr("span",CO(GD),"cm-tab"));GH.col+=GD}else{var GE=GH.cm.options.specialCharPlaceholder(GI[0]);if(De&&K<9){GK.appendChild(Fr("span",[GE]))}else{GK.appendChild(GE)}GH.col+=1}GH.map.push(GH.pos,GH.pos+1,GE);GH.pos++}}if(GL||GJ||GF||F7||GB){var F8=GL||"";if(GJ){F8+=GJ}if(GF){F8+=GF}var GA=Fr("span",[GK],F8,GB);if(GN){GA.title=GN}return GH.content.appendChild(GA)}GH.content.appendChild(GK)}function Fa(F6){function F7(F8){var F9=" ";for(var GA=0;GA<F8.length-2;++GA){F9+=GA%2?" ":"\u00a0"}F9+=" ";return F9}return function(F9,GD,GA,F8,GC,GB){F6(F9,GD.replace(/ {3,}/g,F7),GA,F8,GC,GB)}}function v(F7,F6){return function(GE,GG,F8,GC,GH,GF){F8=F8?F8+" cm-force-border":"cm-force-border";var F9=GE.pos,GB=F9+GG.length;for(;;){for(var GD=0;GD<F6.length;GD++){var GA=F6[GD];if(GA.to>F9&&GA.from<=F9){break}}if(GA.to>=GB){return F7(GE,GG,F8,GC,GH,GF)}F7(GE,GG.slice(0,GA.to-F9),F8,GC,null,GF);GC=null;GG=GG.slice(GA.to-F9);F9=GA.to}}}function AB(F7,F9,F6,F8){var GA=!F8&&F6.widgetNode;if(GA){F7.map.push(F7.pos,F7.pos+F9,GA);F7.content.appendChild(GA)}F7.pos+=F9}function BM(GF,GM,GE){var GB=GF.markedSpans,GD=GF.text,GK=0;if(!GB){for(var GP=1;GP<GE.length;GP+=2){GM.addToken(GM,GD.slice(GK,GK=GE[GP]),Eq(GE[GP+1],GM.cm.options))}return }var GQ=GD.length,GA=0,GP=1,GI="",GR,GG;var GT=0,F6,GS,GJ,GU,F8;for(;;){if(GT==GA){F6=GS=GJ=GU=GG="";F8=null;GT=Infinity;var GC=[];for(var GN=0;GN<GB.length;++GN){var GO=GB[GN],GL=GO.marker;if(GO.from<=GA&&(GO.to==null||GO.to>GA)){if(GO.to!=null&>>GO.to){GT=GO.to;GS=""}if(GL.className){F6+=" "+GL.className}if(GL.css){GG=GL.css}if(GL.startStyle&&GO.from==GA){GJ+=" "+GL.startStyle}if(GL.endStyle&&GO.to==GT){GS+=" "+GL.endStyle}if(GL.title&&!GU){GU=GL.title}if(GL.collapsed&&(!F8||Dk(F8.marker,GL)<0)){F8=GO}}else{if(GO.from>GA&>>GO.from){GT=GO.from}}if(GL.type=="bookmark"&&GO.from==GA&&GL.widgetNode){GC.push(GL)}}if(F8&&(F8.from||0)==GA){AB(GM,(F8.to==null?GQ+1:F8.to)-GA,F8.marker,F8.from==null);if(F8.to==null){return }}if(!F8&&GC.length){for(var GN=0;GN<GC.length;++GN){AB(GM,0,GC[GN])}}}if(GA>=GQ){break}var GH=Math.min(GQ,GT);while(true){if(GI){var F7=GA+GI.length;if(!F8){var F9=F7>GH?GI.slice(0,GH-GA):GI;GM.addToken(GM,F9,GR?GR+F6:F6,GJ,GA+F9.length==GT?GS:"",GU,GG)}if(F7>=GH){GI=GI.slice(GH-GA);GA=GH;break}GA=F7;GJ=""}GI=GD.slice(GK,GK=GE[GP++]);GR=Eq(GE[GP++],GM.cm.options)}}}function Dm(F6,F7){return F7.from.ch==0&&F7.to.ch==0&&Fc(F7.text)==""&&(!F6.cm||F6.cm.options.wholeLineUpdateBefore)}function FT(GJ,GE,F7,GA){function GK(GM){return F7?F7[GM]:null}function F8(GM,GO,GN){EG(GM,GO,GN,GA);AD(GM,"change",GM,GE)}function F6(GP,GN){for(var GO=GP,GM=[];GO<GN;++GO){GM.push(new Fv(GL[GO],GK(GO),GA))}return GM}var GI=GE.from,GH=GE.to,GL=GE.text;var GF=E9(GJ,GI.line),GG=E9(GJ,GH.line);var GD=Fc(GL),F9=GK(GL.length-1),GC=GH.line-GI.line;if(GE.full){GJ.insert(0,F6(0,GL.length));GJ.remove(GL.length,GJ.size-GL.length)}else{if(Dm(GJ,GE)){var GB=F6(0,GL.length-1);F8(GG,GG.text,F9);if(GC){GJ.remove(GI.line,GC)}if(GB.length){GJ.insert(GI.line,GB)}}else{if(GF==GG){if(GL.length==1){F8(GF,GF.text.slice(0,GI.ch)+GD+GF.text.slice(GH.ch),F9)}else{var GB=F6(1,GL.length-1);GB.push(new Fv(GD+GF.text.slice(GH.ch),F9,GA));F8(GF,GF.text.slice(0,GI.ch)+GL[0],GK(0));GJ.insert(GI.line+1,GB)}}else{if(GL.length==1){F8(GF,GF.text.slice(0,GI.ch)+GL[0]+GG.text.slice(GH.ch),GK(0));GJ.remove(GI.line+1,GC)}else{F8(GF,GF.text.slice(0,GI.ch)+GL[0],GK(0));F8(GG,GD+GG.text.slice(GH.ch),F9);var GB=F6(1,GL.length-1);if(GC>1){GJ.remove(GI.line+1,GC-1)}GJ.insert(GI.line+1,GB)}}}}AD(GJ,"change",GJ,GE)}function Et(F7){this.lines=F7;this.parent=null;for(var F8=0,F6=0;F8<F7.length;++F8){F7[F8].parent=this;F6+=F7[F8].height}this.height=F6}Et.prototype={chunkSize:function(){return this.lines.length},removeInner:function(F6,GA){for(var F8=F6,F9=F6+GA;F8<F9;++F8){var F7=this.lines[F8];this.height-=F7.height;BZ(F7);AD(F7,"delete")}this.lines.splice(F6,GA)},collapse:function(F6){F6.push.apply(F6,this.lines)},insertInner:function(F7,F8,F6){this.height+=F6;this.lines=this.lines.slice(0,F7).concat(F8).concat(this.lines.slice(F7));for(var F9=0;F9<F8.length;++F9){F8[F9].parent=this}},iterN:function(F6,F9,F8){for(var F7=F6+F9;F6<F7;++F6){if(F8(this.lines[F6])){return true}}}};function FS(F9){this.children=F9;var F8=0,F6=0;for(var F7=0;F7<F9.length;++F7){var GA=F9[F7];F8+=GA.chunkSize();F6+=GA.height;GA.parent=this}this.size=F8;this.height=F6;this.parent=null}FS.prototype={chunkSize:function(){return this.size},removeInner:function(F6,GD){this.size-=GD;for(var F8=0;F8<this.children.length;++F8){var GC=this.children[F8],GA=GC.chunkSize();if(F6<GA){var F9=Math.min(GD,GA-F6),GB=GC.height;GC.removeInner(F6,F9);this.height-=GB-GC.height;if(GA==F9){this.children.splice(F8--,1);GC.parent=null}if((GD-=F9)==0){break}F6=0}else{F6-=GA}}if(this.size-GD<25&&(this.children.length>1||!(this.children[0] instanceof Et))){var F7=[];this.collapse(F7);this.children=[new Et(F7)];this.children[0].parent=this}},collapse:function(F6){for(var F7=0;F7<this.children.length;++F7){this.children[F7].collapse(F6)}},insertInner:function(F7,F8,F6){this.size+=F8.length;this.height+=F6;for(var GB=0;GB<this.children.length;++GB){var GD=this.children[GB],GC=GD.chunkSize();if(F7<=GC){GD.insertInner(F7,F8,F6);if(GD.lines&&GD.lines.length>50){while(GD.lines.length>50){var GA=GD.lines.splice(GD.lines.length-25,25);var F9=new Et(GA);GD.height-=F9.height;this.children.splice(GB+1,0,F9);F9.parent=this}this.maybeSpill()}break}F7-=GC}},maybeSpill:function(){if(this.children.length<=10){return }var F9=this;do{var F7=F9.children.splice(F9.children.length-5,5);var F8=new FS(F7);if(!F9.parent){var GA=new FS(F9.children);GA.parent=F9;F9.children=[GA,F8];F9=GA}else{F9.size-=F8.size;F9.height-=F8.height;var F6=DE(F9.parent.children,F9);F9.parent.children.splice(F6+1,0,F8)}F8.parent=F9.parent}while(F9.children.length>10);F9.parent.maybeSpill()},iterN:function(F6,GC,GB){for(var F7=0;F7<this.children.length;++F7){var GA=this.children[F7],F9=GA.chunkSize();if(F6<F9){var F8=Math.min(GC,F9-F6);if(GA.iterN(F6,F8,GB)){return true}if((GC-=F8)==0){break}F6=0}else{F6-=F9}}}};var CQ=0;var AR=i.Doc=function(F8,F7,F6){if(!(this instanceof AR)){return new AR(F8,F7,F6)}if(F6==null){F6=0}FS.call(this,[new Et([new Fv("",null)])]);this.first=F6;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.frontier=F6;var F9=x(F6,0);this.sel=Em(F9);this.history=new Fn(null);this.id=++CQ;this.modeOption=F7;if(typeof F8=="string"){F8=Aw(F8)}FT(this,{from:F9,to:F9,text:F8});Bs(this,Em(F9),z)};AR.prototype=CJ(FS.prototype,{constructor:AR,iter:function(F8,F7,F6){if(F6){this.iterN(F8-this.first,F7-F8,F6)}else{this.iterN(this.first,this.first+this.size,F8)}},insert:function(F7,F8){var F6=0;for(var F9=0;F9<F8.length;++F9){F6+=F8[F9].height}this.insertInner(F7-this.first,F8,F6)},remove:function(F6,F7){this.removeInner(F6-this.first,F7)},getValue:function(F7){var F6=Ay(this,this.first,this.first+this.size);if(F7===false){return F6}return F6.join(F7||"\n")},setValue:Cb(function(F7){var F8=x(this.first,0),F6=this.first+this.size-1;BC(this,{from:F8,to:x(F6,E9(this,F6).text.length),text:Aw(F7),origin:"setValue",full:true},true);Bs(this,Em(F8))}),replaceRange:function(F7,F9,F8,F6){F9=Fe(this,F9);F8=F8?Fe(this,F8):F9;Ax(this,F7,F9,F8,F6)},getRange:function(F9,F8,F7){var F6=Ft(this,Fe(this,F9),Fe(this,F8));if(F7===false){return F6}return F6.join(F7||"\n")},getLine:function(F7){var F6=this.getLineHandle(F7);return F6&&F6.text},getLineHandle:function(F6){if(B7(this,F6)){return E9(this,F6)}},getLineNumber:function(F6){return Bl(F6)},getLineHandleVisualStart:function(F6){if(typeof F6=="number"){F6=E9(this,F6)}return Y(F6)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(F6){return Fe(this,F6)},getCursor:function(F8){var F6=this.sel.primary(),F7;if(F8==null||F8=="head"){F7=F6.head}else{if(F8=="anchor"){F7=F6.anchor}else{if(F8=="end"||F8=="to"||F8===false){F7=F6.to()}else{F7=F6.from()}}}return F7},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Cb(function(F6,F8,F7){g(this,Fe(this,typeof F6=="number"?x(F6,F8||0):F6),null,F7)}),setSelection:Cb(function(F7,F8,F6){g(this,Fe(this,F7),Fe(this,F8||F7),F6)}),extendSelection:Cb(function(F8,F6,F7){Fo(this,Fe(this,F8),F6&&Fe(this,F6),F7)}),extendSelections:Cb(function(F7,F6){AU(this,Dt(this,F7,F6))}),extendSelectionsBy:Cb(function(F7,F6){AU(this,Bq(this.sel.ranges,F7),F6)}),setSelections:Cb(function(F6,GA,F8){if(!F6.length){return }for(var F9=0,F7=[];F9<F6.length;F9++){F7[F9]=new Ds(Fe(this,F6[F9].anchor),Fe(this,F6[F9].head))}if(GA==null){GA=Math.min(F6.length-1,this.sel.primIndex)}Bs(this,CV(F7,GA),F8)}),addSelection:Cb(function(F8,F9,F7){var F6=this.sel.ranges.slice(0);F6.push(new Ds(Fe(this,F8),Fe(this,F9||F8)));Bs(this,CV(F6,F6.length-1),F7)}),getSelection:function(GA){var F7=this.sel.ranges,F6;for(var F8=0;F8<F7.length;F8++){var F9=Ft(this,F7[F8].from(),F7[F8].to());F6=F6?F6.concat(F9):F9}if(GA===false){return F6}else{return F6.join(GA||"\n")}},getSelections:function(GA){var F9=[],F6=this.sel.ranges;for(var F7=0;F7<F6.length;F7++){var F8=Ft(this,F6[F7].from(),F6[F7].to());if(GA!==false){F8=F8.join(GA||"\n")}F9[F7]=F8}return F9},replaceSelection:function(F8,GA,F6){var F9=[];for(var F7=0;F7<this.sel.ranges.length;F7++){F9[F7]=F8}this.replaceSelections(F9,GA,F6||"+input")},replaceSelections:Cb(function(GB,GD,F8){var GA=[],GC=this.sel;for(var F9=0;F9<GC.ranges.length;F9++){var F7=GC.ranges[F9];GA[F9]={from:F7.from(),to:F7.to(),text:Aw(GB[F9]),origin:F8}}var F6=GD&&GD!="end"&&AE(this,GA,GD);for(var F9=GA.length-1;F9>=0;F9--){BC(this,GA[F9])}if(F6){E1(this,F6)}else{if(this.cm){Fb(this.cm)}}}),undo:Cb(function(){B6(this,"undo")}),redo:Cb(function(){B6(this,"redo")}),undoSelection:Cb(function(){B6(this,"undo",true)}),redoSelection:Cb(function(){B6(this,"redo",true)}),setExtending:function(F6){this.extend=F6},getExtending:function(){return this.extend},historySize:function(){var F9=this.history,F6=0,F8=0;for(var F7=0;F7<F9.done.length;F7++){if(!F9.done[F7].ranges){++F6}}for(var F7=0;F7<F9.undone.length;F7++){if(!F9.undone[F7].ranges){++F8}}return{undo:F6,redo:F8}},clearHistory:function(){this.history=new Fn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(F6){if(F6){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(F6){return this.history.generation==(F6||this.cleanGeneration)},getHistory:function(){return{done:Bn(this.history.done),undone:Bn(this.history.undone)}},setHistory:function(F7){var F6=this.history=new Fn(this.history.maxGeneration);F6.done=Bn(F7.done.slice(0),null,true);F6.undone=Bn(F7.undone.slice(0),null,true)},addLineClass:Cb(function(F8,F7,F6){return ES(this,F8,F7=="gutter"?"gutter":"class",function(F9){var GA=F7=="text"?"textClass":F7=="background"?"bgClass":F7=="gutter"?"gutterClass":"wrapClass";if(!F9[GA]){F9[GA]=F6}else{if(t(F6).test(F9[GA])){return false}else{F9[GA]+=" "+F6}}return true})}),removeLineClass:Cb(function(F8,F7,F6){return ES(this,F8,F7=="gutter"?"gutter":"class",function(GA){var GD=F7=="text"?"textClass":F7=="background"?"bgClass":F7=="gutter"?"gutterClass":"wrapClass";var GC=GA[GD];if(!GC){return false}else{if(F6==null){GA[GD]=null}else{var GB=GC.match(t(F6));if(!GB){return false}var F9=GB.index+GB[0].length;GA[GD]=GC.slice(0,GB.index)+(!GB.index||F9==GC.length?"":" ")+GC.slice(F9)||null}}return true})}),markText:function(F8,F7,F6){return EZ(this,Fe(this,F8),Fe(this,F7),F6,"range")},setBookmark:function(F8,F6){var F7={replacedWith:F6&&(F6.nodeType==null?F6.widget:F6),insertLeft:F6&&F6.insertLeft,clearWhenEmpty:false,shared:F6&&F6.shared};F8=Fe(this,F8);return EZ(this,F8,F8,F7,"bookmark")},findMarksAt:function(GA){GA=Fe(this,GA);var F9=[],F7=E9(this,GA.line).markedSpans;if(F7){for(var F6=0;F6<F7.length;++F6){var F8=F7[F6];if((F8.from==null||F8.from<=GA.ch)&&(F8.to==null||F8.to>=GA.ch)){F9.push(F8.marker.parent||F8.marker)}}}return F9},findMarks:function(GA,F9,F6){GA=Fe(this,GA);F9=Fe(this,F9);var F7=[],F8=GA.line;this.iter(GA.line,F9.line+1,function(GB){var GD=GB.markedSpans;if(GD){for(var GC=0;GC<GD.length;GC++){var GE=GD[GC];if(!(F8==GA.line&&GA.ch>GE.to||GE.from==null&&F8!=GA.line||F8==F9.line&&GE.from>F9.ch)&&(!F6||F6(GE.marker))){F7.push(GE.marker.parent||GE.marker)}}}++F8});return F7},getAllMarks:function(){var F6=[];this.iter(function(F8){var F7=F8.markedSpans;if(F7){for(var F9=0;F9<F7.length;++F9){if(F7[F9].from!=null){F6.push(F7[F9].marker)}}}});return F6},posFromIndex:function(F7){var F6,F8=this.first;this.iter(function(F9){var GA=F9.text.length+1;if(GA>F7){F6=F7;return true}F7-=GA;++F8});return Fe(this,x(F8,F6))},indexFromPos:function(F7){F7=Fe(this,F7);var F6=F7.ch;if(F7.line<this.first||F7.ch<0){return 0}this.iter(this.first,F7.line,function(F8){F6+=F8.text.length+1});return F6},copy:function(F6){var F7=new AR(Ay(this,this.first,this.first+this.size),this.modeOption,this.first);F7.scrollTop=this.scrollTop;F7.scrollLeft=this.scrollLeft;F7.sel=this.sel;F7.extend=false;if(F6){F7.history.undoDepth=this.history.undoDepth;F7.setHistory(this.getHistory())}return F7},linkedDoc:function(F6){if(!F6){F6={}}var F9=this.first,F8=this.first+this.size;if(F6.from!=null&&F6.from>F9){F9=F6.from}if(F6.to!=null&&F6.to<F8){F8=F6.to}var F7=new AR(Ay(this,F9,F8),F6.mode||this.modeOption,F9);if(F6.sharedHist){F7.history=this.history}(this.linked||(this.linked=[])).push({doc:F7,sharedHist:F6.sharedHist});F7.linked=[{doc:this,isParent:true,sharedHist:F6.sharedHist}];DZ(F7,Ej(this));return F7},unlinkDoc:function(F7){if(F7 instanceof i){F7=F7.doc}if(this.linked){for(var F8=0;F8<this.linked.length;++F8){var F9=this.linked[F8];if(F9.doc!=F7){continue}this.linked.splice(F8,1);F7.unlinkDoc(this);EI(Ej(this));break}}if(F7.history==this.history){var F6=[F7.id];D1(F7,function(GA){F6.push(GA.id)},true);F7.history=new Fn(null);F7.history.done=Bn(this.history.done,F6);F7.history.undone=Bn(this.history.undone,F6)}},iterLinkedDocs:function(F6){D1(this,F6)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});AR.prototype.eachLine=AR.prototype.iter;var D="iter insert remove copy getEditor".split(" ");for(var Bi in AR.prototype){if(AR.prototype.hasOwnProperty(Bi)&&DE(D,Bi)<0){i.prototype[Bi]=(function(F6){return function(){return F6.apply(this.doc,arguments)}})(AR.prototype[Bi])}}BW(AR);function D1(F9,F8,F7){function F6(GF,GD,GB){if(GF.linked){for(var GC=0;GC<GF.linked.length;++GC){var GA=GF.linked[GC];if(GA.doc==GD){continue}var GE=GB&&GA.sharedHist;if(F7&&!GE){continue}F8(GA.doc,GE);F6(GA.doc,GF,GE)}}}F6(F9,null,true)}function D5(F6,F7){if(F7.cm){throw new Error("This document is already in use.")}F6.doc=F7;F7.cm=F6;y(F6);BP(F6);if(!F6.options.lineWrapping){G(F6)}F6.options.mode=F7.modeOption;AG(F6)}function E9(F9,GB){GB-=F9.first;if(GB<0||GB>=F9.size){throw new Error("There is no line "+(GB+F9.first)+" in the document.")}for(var F6=F9;!F6.lines;){for(var F7=0;;++F7){var GA=F6.children[F7],F8=GA.chunkSize();if(GB<F8){F6=GA;break}GB-=F8}}return F6.lines[GB]}function Ft(F8,GA,F6){var F7=[],F9=GA.line;F8.iter(GA.line,F6.line+1,function(GB){var GC=GB.text;if(F9==F6.line){GC=GC.slice(0,F6.ch)}if(F9==GA.line){GC=GC.slice(GA.ch)}F7.push(GC);++F9});return F7}function Ay(F7,F9,F8){var F6=[];F7.iter(F9,F8,function(GA){F6.push(GA.text)});return F6}function Fu(F7,F6){var F8=F6-F7.height;if(F8){for(var F9=F7;F9;F9=F9.parent){F9.height+=F8}}}function Bl(F6){if(F6.parent==null){return null}var GA=F6.parent,F9=DE(GA.lines,F6);for(var F7=GA.parent;F7;GA=F7,F7=F7.parent){for(var F8=0;;++F8){if(F7.children[F8]==GA){break}F9+=F7.children[F8].chunkSize()}}return F9+GA.first}function Be(F8,GB){var GD=F8.first;outer:do{for(var F9=0;F9<F8.children.length;++F9){var GC=F8.children[F9],GA=GC.height;if(GB<GA){F8=GC;continue outer}GB-=GA;GD+=GC.chunkSize()}return GD}while(!F8.lines);for(var F9=0;F9<F8.lines.length;++F9){var F7=F8.lines[F9],F6=F7.height;if(GB<F6){break}GB-=F6}return GD+F9}function Bk(F8){F8=Y(F8);var GA=0,F7=F8.parent;for(var F9=0;F9<F7.lines.length;++F9){var F6=F7.lines[F9];if(F6==F8){break}else{GA+=F6.height}}for(var GB=F7.parent;GB;F7=GB,GB=F7.parent){for(var F9=0;F9<GB.children.length;++F9){var GC=GB.children[F9];if(GC==F7){break}else{GA+=GC.height}}}return GA}function A(F7){var F6=F7.order;if(F6==null){F6=F7.order=BD(F7.text)}return F6}function Fn(F6){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=F6||1}function DP(F6,F8){var F7={from:CH(F8.from),to:Cu(F8),text:Ft(F6,F8.from,F8.to)};Bw(F6,F7,F8.from.line,F8.to.line+1);D1(F6,function(F9){Bw(F9,F7,F8.from.line,F8.to.line+1)},true);return F7}function FW(F7){while(F7.length){var F6=Fc(F7);if(F6.ranges){F7.pop()}else{break}}}function Eg(F7,F6){if(F6){FW(F7.done);return Fc(F7.done)}else{if(F7.done.length&&!Fc(F7.done).ranges){return Fc(F7.done)}else{if(F7.done.length>1&&!F7.done[F7.done.length-2].ranges){F7.done.pop();return Fc(F7.done)}}}}function Fh(GC,GA,F6,F9){var F8=GC.history;F8.undone.length=0;var F7=+new Date,GD;if((F8.lastOp==F9||F8.lastOrigin==GA.origin&&GA.origin&&((GA.origin.charAt(0)=="+"&&GC.cm&&F8.lastModTime>F7-GC.cm.options.historyEventDelay)||GA.origin.charAt(0)=="*"))&&(GD=Eg(F8,F8.lastOp==F9))){var GE=Fc(GD.changes);if(CD(GA.from,GA.to)==0&&CD(GA.from,GE.to)==0){GE.to=Cu(GA)}else{GD.changes.push(DP(GC,GA))}}else{var GB=Fc(F8.done);if(!GB||!GB.ranges){Ck(GC.sel,F8.done)}GD={changes:[DP(GC,GA)],generation:F8.generation};F8.done.push(GD);while(F8.done.length>F8.undoDepth){F8.done.shift();if(!F8.done[0].ranges){F8.done.shift()}}}F8.done.push(F6);F8.generation=++F8.maxGeneration;F8.lastModTime=F8.lastSelTime=F7;F8.lastOp=F8.lastSelOp=F9;F8.lastOrigin=F8.lastSelOrigin=GA.origin;if(!GE){Ab(GC,"historyAdded")}}function BY(GA,F6,F8,F9){var F7=F6.charAt(0);return F7=="*"||F7=="+"&&F8.ranges.length==F9.ranges.length&&F8.somethingSelected()==F9.somethingSelected()&&new Date-GA.history.lastSelTime<=(GA.cm?GA.cm.options.historyEventDelay:500)}function F0(GB,F9,F6,F8){var GA=GB.history,F7=F8&&F8.origin;if(F6==GA.lastSelOp||(F7&&GA.lastSelOrigin==F7&&(GA.lastModTime==GA.lastSelTime&&GA.lastOrigin==F7||BY(GB,F7,Fc(GA.done),F9)))){GA.done[GA.done.length-1]=F9}else{Ck(F9,GA.done)}GA.lastSelTime=+new Date;GA.lastSelOrigin=F7;GA.lastSelOp=F6;if(F8&&F8.clearRedo!==false){FW(GA.undone)}}function Ck(F7,F6){var F8=Fc(F6);if(!(F8&&F8.ranges&&F8.equals(F7))){F6.push(F7)}}function Bw(F7,GB,GA,F9){var F6=GB["spans_"+F7.id],F8=0;F7.iter(Math.max(F7.first,GA),Math.min(F7.first+F7.size,F9),function(GC){if(GC.markedSpans){(F6||(F6=GB["spans_"+F7.id]={}))[F8]=GC.markedSpans}++F8})}function BH(F8){if(!F8){return null}for(var F7=0,F6;F7<F8.length;++F7){if(F8[F7].marker.explicitlyCleared){if(!F6){F6=F8.slice(0,F7)}}else{if(F6){F6.push(F8[F7])}}}return !F6?F8:F6.length?F6:null}function B2(F9,GA){var F8=GA["spans_"+F9.id];if(!F8){return null}for(var F7=0,F6=[];F7<GA.text.length;++F7){F6.push(BH(F8[F7]))}return F6}function Bn(GH,F9,GG){for(var GC=0,F7=[];GC<GH.length;++GC){var F8=GH[GC];if(F8.ranges){F7.push(GG?Fs.prototype.deepCopy.call(F8):F8);continue}var GE=F8.changes,GF=[];F7.push({changes:GF});for(var GB=0;GB<GE.length;++GB){var GD=GE[GB],GA;GF.push({from:GD.from,to:GD.to,text:GD.text});if(F9){for(var F6 in GD){if(GA=F6.match(/^spans_(\d+)$/)){if(DE(F9,Number(GA[1]))>-1){Fc(GF)[F6]=GD[F6];delete GD[F6]}}}}}}return F7}function j(F9,F8,F7,F6){if(F7<F9.line){F9.line+=F6}else{if(F8<F9.line){F9.line=F8;F9.ch=0}}}function FB(F9,GB,GC,GD){for(var F8=0;F8<F9.length;++F8){var F6=F9[F8],GA=true;if(F6.ranges){if(!F6.copied){F6=F9[F8]=F6.deepCopy();F6.copied=true}for(var F7=0;F7<F6.ranges.length;F7++){j(F6.ranges[F7].anchor,GB,GC,GD);j(F6.ranges[F7].head,GB,GC,GD)}continue}for(var F7=0;F7<F6.changes.length;++F7){var GE=F6.changes[F7];if(GC<GE.from.line){GE.from=x(GE.from.line+GD,GE.from.ch);GE.to=x(GE.to.line+GD,GE.to.ch)}else{if(GB<=GE.to.line){GA=false;break}}}if(!GA){F9.splice(0,F8+1);F8=0}}}function DY(F7,GA){var F9=GA.from.line,F8=GA.to.line,F6=GA.text.length-(F8-F9)-1;FB(F7.done,F9,F8,F6);FB(F7.undone,F9,F8,F6)}var Cd=i.e_preventDefault=function(F6){if(F6.preventDefault){F6.preventDefault()}else{F6.returnValue=false}};var DL=i.e_stopPropagation=function(F6){if(F6.stopPropagation){F6.stopPropagation()}else{F6.cancelBubble=true}};function Bj(F6){return F6.defaultPrevented!=null?F6.defaultPrevented:F6.returnValue==false}var EL=i.e_stop=function(F6){Cd(F6);DL(F6)};function m(F6){return F6.target||F6.srcElement}function Fi(F7){var F6=F7.which;if(F6==null){if(F7.button&1){F6=1}else{if(F7.button&2){F6=3}else{if(F7.button&4){F6=2}}}}if(B5&&F7.ctrlKey&&F6==1){F6=3}return F6}var Bv=i.on=function(F9,F7,F8){if(F9.addEventListener){F9.addEventListener(F7,F8,false)}else{if(F9.attachEvent){F9.attachEvent("on"+F7,F8)}else{var GA=F9._handlers||(F9._handlers={});var F6=GA[F7]||(GA[F7]=[]);F6.push(F8)}}};var D7=i.off=function(GA,F8,F9){if(GA.removeEventListener){GA.removeEventListener(F8,F9,false)}else{if(GA.detachEvent){GA.detachEvent("on"+F8,F9)}else{var F6=GA._handlers&&GA._handlers[F8];if(!F6){return }for(var F7=0;F7<F6.length;++F7){if(F6[F7]==F9){F6.splice(F7,1);break}}}}};var Ab=i.signal=function(GA,F9){var F6=GA._handlers&&GA._handlers[F9];if(!F6){return }var F7=Array.prototype.slice.call(arguments,2);for(var F8=0;F8<F6.length;++F8){F6[F8].apply(null,F7)}};var BX=null;function AD(GC,GA){var F6=GC._handlers&&GC._handlers[GA];if(!F6){return }var F8=Array.prototype.slice.call(arguments,2),GB;if(BN){GB=BN.delayedCallbacks}else{if(BX){GB=BX}else{GB=BX=[];setTimeout(Ai,0)}}function F7(GD){return function(){GD.apply(null,F8)}}for(var F9=0;F9<F6.length;++F9){GB.push(F7(F6[F9]))}}function Ai(){var F6=BX;BX=null;for(var F7=0;F7<F6.length;++F7){F6[F7]()}}function An(F6,F8,F7){if(typeof F8=="string"){F8={type:F8,preventDefault:function(){this.defaultPrevented=true}}}Ab(F6,F7||F8.type,F6,F8);return Bj(F8)||F8.codemirrorIgnore}function w(F7){var F6=F7._handlers&&F7._handlers.cursorActivity;if(!F6){return }var F9=F7.curOp.cursorActivityHandlers||(F7.curOp.cursorActivityHandlers=[]);for(var F8=0;F8<F6.length;++F8){if(DE(F9,F6[F8])==-1){F9.push(F6[F8])}}}function FC(F8,F7){var F6=F8._handlers&&F8._handlers[F7];return F6&&F6.length>0}function BW(F6){F6.prototype.on=function(F7,F8){Bv(this,F7,F8)};F6.prototype.off=function(F7,F8){D7(this,F7,F8)}}var Dd=30;var B8=i.Pass={toString:function(){return"CodeMirror.Pass"}};var z={scroll:false},n={origin:"*mouse"},Ct={origin:"+move"};function F5(){this.id=null}F5.prototype.set=function(F6,F7){clearTimeout(this.id);this.id=setTimeout(F7,F6)};var Br=i.countColumn=function(F9,F7,GB,GC,F8){if(F7==null){F7=F9.search(/[^\s\u00a0]/);if(F7==-1){F7=F9.length}}for(var GA=GC||0,GD=F8||0;;){var F6=F9.indexOf("\t",GA);if(F6<0||F6>=F7){return GD+(F7-GA)}GD+=F6-GA;GD+=GB-(GD%GB);GA=F6+1}};function EK(GA,F9,GB){for(var GC=0,F8=0;;){var F7=GA.indexOf("\t",GC);if(F7==-1){F7=GA.length}var F6=F7-GC;if(F7==GA.length||F8+F6>=F9){return GC+Math.min(F6,F9-F8)}F8+=F7-GC;F8+=GB-(F8%GB);GC=F7+1;if(F8>=F9){return GC}}}var Av=[""];function CO(F6){while(Av.length<=F6){Av.push(Fc(Av)+" ")}return Av[F6]}function Fc(F6){return F6[F6.length-1]}var Df=function(F6){F6.select()};if(Ev){Df=function(F6){F6.selectionStart=0;F6.selectionEnd=F6.value.length}}else{if(De){Df=function(F7){try{F7.select()}catch(F6){}}}}function DE(F8,F6){for(var F7=0;F7<F8.length;++F7){if(F8[F7]==F6){return F7}}return -1}function Bq(F9,F8){var F6=[];for(var F7=0;F7<F9.length;F7++){F6[F7]=F8(F9[F7],F7)}return F6}function CJ(F9,F6){var F8;if(Object.create){F8=Object.create(F9)}else{var F7=function(){};F7.prototype=F9;F8=new F7()}if(F6){Aj(F6,F8)}return F8}function Aj(F8,F7,F6){if(!F7){F7={}}for(var F9 in F8){if(F8.hasOwnProperty(F9)&&(F6!==false||!F7.hasOwnProperty(F9))){F7[F9]=F8[F9]}}return F7}function CU(F7){var F6=Array.prototype.slice.call(arguments,1);return function(){return F7.apply(null,F6)}}var A8=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;var FY=i.isWordChar=function(F6){return/\w/.test(F6)||F6>"\x80"&&(F6.toUpperCase()!=F6.toLowerCase()||A8.test(F6))};function CY(F6,F7){if(!F7){return FY(F6)}if(F7.source.indexOf("\\w")>-1&&FY(F6)){return true}return F7.test(F6)}function Eo(F6){for(var F7 in F6){if(F6.hasOwnProperty(F7)&&F6[F7]){return false}}return true}var Ed=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function FK(F6){return F6.charCodeAt(0)>=768&&Ed.test(F6)}function Fr(F6,GA,F9,F8){var GB=document.createElement(F6);if(F9){GB.className=F9}if(F8){GB.style.cssText=F8}if(typeof GA=="string"){GB.appendChild(document.createTextNode(GA))}else{if(GA){for(var F7=0;F7<GA.length;++F7){GB.appendChild(GA[F7])}}}return GB}var CK;if(document.createRange){CK=function(F8,F9,F6){var F7=document.createRange();F7.setEnd(F8,F6);F7.setStart(F8,F9);return F7}}else{CK=function(F8,GA,F6){var F7=document.body.createTextRange();try{F7.moveToElementText(F8.parentNode)}catch(F9){return F7}F7.collapse(true);F7.moveEnd("character",F6);F7.moveStart("character",GA);return F7}}function Dv(F7){for(var F6=F7.childNodes.length;F6>0;--F6){F7.removeChild(F7.firstChild)}return F7}function Bp(F6,F7){return Dv(F6).appendChild(F7)}function Fz(F6,F7){if(F6.contains){return F6.contains(F7)}while(F7=F7.parentNode){if(F7==F6){return true}}}function Di(){return document.activeElement}if(De&&K<11){Di=function(){try{return document.activeElement}catch(F6){return document.body}}}function t(F6){return new RegExp("(^|\\s)"+F6+"(?:$|\\s)\\s*")}var F=i.rmClass=function(F8,F6){var F9=F8.className;var F7=t(F6).exec(F9);if(F7){var GA=F9.slice(F7.index+F7[0].length);F8.className=F9.slice(0,F7.index)+(GA?F7[1]+GA:"")}};var FV=i.addClass=function(F7,F6){var F8=F7.className;if(!t(F6).test(F8)){F7.className+=(F8?" ":"")+F6}};function Fm(F8,F6){var F7=F8.split(" ");for(var F9=0;F9<F7.length;F9++){if(F7[F9]&&!t(F7[F9]).test(F6)){F6+=" "+F7[F9]}}return F6}function AX(F9){if(!document.body.getElementsByClassName){return }var F8=document.body.getElementsByClassName("CodeMirror");for(var F7=0;F7<F8.length;F7++){var F6=F8[F7].CodeMirror;if(F6){F9(F6)}}}var Ca=false;function BF(){if(Ca){return }FZ();Ca=true}function FZ(){var F6;Bv(window,"resize",function(){if(F6==null){F6=setTimeout(function(){F6=null;AX(Ap)},100)}});Bv(window,"blur",function(){AX(Ar)})}var Ef=function(){if(De&&K<9){return false}var F6=Fr("div");return"draggable" in F6||"dragDrop" in F6}();var Fg;function BL(F6){if(Fg==null){var F7=Fr("span","\u200b");Bp(F6,Fr("span",[F7,document.createTextNode("x")]));if(F6.firstChild.offsetHeight!=0){Fg=F7.offsetWidth<=1&&F7.offsetHeight>2&&!(De&&K<8)}}if(Fg){return Fr("span","\u200b")}else{return Fr("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}}var Ff;function Bm(F9){if(Ff!=null){return Ff}var F6=Bp(F9,document.createTextNode("A\u062eA"));var F8=CK(F6,0,1).getBoundingClientRect();if(!F8||F8.left==F8.right){return false}var F7=CK(F6,1,2).getBoundingClientRect();return Ff=(F7.right-F8.right<3)}var Aw=i.splitLines="\n\nb".split(/\n/).length!=3?function(GB){var GC=0,F6=[],GA=GB.length;while(GC<=GA){var F9=GB.indexOf("\n",GC);if(F9==-1){F9=GB.length}var F8=GB.slice(GC,GB.charAt(F9-1)=="\r"?F9-1:F9);var F7=F8.indexOf("\r");if(F7!=-1){F6.push(F8.slice(0,F7));GC+=F7+1}else{F6.push(F8);GC=F9+1}}return F6}:function(F6){return F6.split(/\r\n?|\n/)};var BQ=window.getSelection?function(F7){try{return F7.selectionStart!=F7.selectionEnd}catch(F6){return false}}:function(F8){try{var F6=F8.ownerDocument.selection.createRange()}catch(F7){}if(!F6||F6.parentElement()!=F8){return false}return F6.compareEndPoints("StartToEnd",F6)!=0};var C7=(function(){var F6=Fr("div");if("oncopy" in F6){return true}F6.setAttribute("oncopy","return;");return typeof F6.oncopy=="function"})();var E0=null;function Ah(F7){if(E0!=null){return E0}var F8=Bp(F7,Fr("span","x"));var F9=F8.getBoundingClientRect();var F6=CK(F8,0,1).getBoundingClientRect();return E0=Math.abs(F9.left-F6.left)>1}var FA={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};i.keyNames=FA;(function(){for(var F6=0;F6<10;F6++){FA[F6+48]=FA[F6+96]=String(F6)}for(var F6=65;F6<=90;F6++){FA[F6]=String.fromCharCode(F6)}for(var F6=1;F6<=12;F6++){FA[F6+111]=FA[F6+63235]="F"+F6}})();function Dy(F6,GC,GB,GA){if(!F6){return GA(GC,GB,"ltr")}var F9=false;for(var F8=0;F8<F6.length;++F8){var F7=F6[F8];if(F7.from<GB&&F7.to>GC||GC==GB&&F7.to==GC){GA(Math.max(F7.from,GC),Math.min(F7.to,GB),F7.level==1?"rtl":"ltr");F9=true}}if(!F9){GA(GC,GB,"ltr")}}function DS(F6){return F6.level%2?F6.to:F6.from}function F2(F6){return F6.level%2?F6.from:F6.to}function Cc(F7){var F6=A(F7);return F6?DS(F6[0]):0}function Cp(F7){var F6=A(F7);if(!F6){return F7.text.length}return F2(Fc(F6))}function BR(F7,GA){var F8=E9(F7.doc,GA);var GB=Y(F8);if(GB!=F8){GA=Bl(GB)}var F6=A(GB);var F9=!F6?0:F6[0].level%2?Cp(GB):Cc(GB);return x(GA,F9)}function Dj(F8,GB){var F7,F9=E9(F8.doc,GB);while(F7=EP(F9)){F9=F7.find(1,true).line;GB=null}var F6=A(F9);var GA=!F6?F9.text.length:F6[0].level%2?Cc(F9):Cp(F9);return x(GB==null?Bl(F9):GB,GA)}function Dc(F7,GC){var GB=BR(F7,GC.line);var F8=E9(F7.doc,GB.line);var F6=A(F8);if(!F6||F6[0].level==0){var GA=Math.max(0,F8.text.search(/\S/));var F9=GC.line==GB.line&&GC.ch<=GA&&GC.ch;return x(GB.line,F9?0:GA)}return GB}function AM(F7,F8,F6){var F9=F7[0].level;if(F8==F9){return true}if(F6==F9){return false}return F8<F6}var Ew;function Ad(F6,GA){Ew=null;for(var F7=0,F8;F7<F6.length;++F7){var F9=F6[F7];if(F9.from<GA&&F9.to>GA){return F7}if((F9.from==GA||F9.to==GA)){if(F8==null){F8=F7}else{if(AM(F6,F9.level,F6[F8].level)){if(F9.from!=F9.to){Ew=F8}return F7}else{if(F9.from!=F9.to){Ew=F7}return F8}}}}return F8}function E8(F6,F9,F7,F8){if(!F8){return F9+F7}do{F9+=F7}while(F9>0&&FK(F6.text.charAt(F9)));return F9}function U(F6,GD,F8,F9){var GA=A(F6);if(!GA){return AH(F6,GD,F8,F9)}var GC=Ad(GA,GD),F7=GA[GC];var GB=E8(F6,GD,F7.level%2?-F8:F8,F9);for(;;){if(GB>F7.from&&GB<F7.to){return GB}if(GB==F7.from||GB==F7.to){if(Ad(GA,GB)==GC){return GB}F7=GA[GC+=F8];return(F8>0)==F7.level%2?F7.to:F7.from}else{F7=GA[GC+=F8];if(!F7){return null}if((F8>0)==F7.level%2){GB=E8(F6,F7.to,-1,F9)}else{GB=E8(F6,F7.from,1,F9)}}}}function AH(F6,GA,F7,F8){var F9=GA+F7;if(F8){while(F9>0&&FK(F6.text.charAt(F9))){F9+=F7}}return F9<0||F9>F6.text.length?null:F9}var BD=(function(){var GC="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var GA="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm";function F9(GG){if(GG<=247){return GC.charAt(GG)}else{if(1424<=GG&&GG<=1524){return"R"}else{if(1536<=GG&&GG<=1773){return GA.charAt(GG-1536)}else{if(1774<=GG&&GG<=2220){return"r"}else{if(8192<=GG&&GG<=8203){return"w"}else{if(GG==8204){return"b"}else{return"L"}}}}}}}var F6=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var GF=/[stwN]/,F8=/[LRr]/,F7=/[Lb1n]/,GB=/[1n]/;var GE="L";function GD(GI,GH,GG){this.level=GI;this.from=GH;this.to=GG}return function(GQ){if(!F6.test(GQ)){return false}var GW=GQ.length,GM=[];for(var GV=0,GI;GV<GW;++GV){GM.push(GI=F9(GQ.charCodeAt(GV)))}for(var GV=0,GP=GE;GV<GW;++GV){var GI=GM[GV];if(GI=="m"){GM[GV]=GP}else{GP=GI}}for(var GV=0,GG=GE;GV<GW;++GV){var GI=GM[GV];if(GI=="1"&&GG=="r"){GM[GV]="n"}else{if(F8.test(GI)){GG=GI;if(GI=="r"){GM[GV]="R"}}}}for(var GV=1,GP=GM[0];GV<GW-1;++GV){var GI=GM[GV];if(GI=="+"&&GP=="1"&&GM[GV+1]=="1"){GM[GV]="1"}else{if(GI==","&&GP==GM[GV+1]&&(GP=="1"||GP=="n")){GM[GV]=GP}}GP=GI}for(var GV=0;GV<GW;++GV){var GI=GM[GV];if(GI==","){GM[GV]="N"}else{if(GI=="%"){for(var GJ=GV+1;GJ<GW&&GM[GJ]=="%";++GJ){}var GX=(GV&&GM[GV-1]=="!")||(GJ<GW&&GM[GJ]=="1")?"1":"N";for(var GT=GV;GT<GJ;++GT){GM[GT]=GX}GV=GJ-1}}}for(var GV=0,GG=GE;GV<GW;++GV){var GI=GM[GV];if(GG=="L"&&GI=="1"){GM[GV]="L"}else{if(F8.test(GI)){GG=GI}}}for(var GV=0;GV<GW;++GV){if(GF.test(GM[GV])){for(var GJ=GV+1;GJ<GW&&GF.test(GM[GJ]);++GJ){}var GN=(GV?GM[GV-1]:GE)=="L";var GH=(GJ<GW?GM[GJ]:GE)=="L";var GX=GN||GH?"L":"R";for(var GT=GV;GT<GJ;++GT){GM[GT]=GX}GV=GJ-1}}var GU=[],GR;for(var GV=0;GV<GW;){if(F7.test(GM[GV])){var GK=GV;for(++GV;GV<GW&&F7.test(GM[GV]);++GV){}GU.push(new GD(0,GK,GV))}else{var GL=GV,GO=GU.length;for(++GV;GV<GW&&GM[GV]!="L";++GV){}for(var GT=GL;GT<GV;){if(GB.test(GM[GT])){if(GL<GT){GU.splice(GO,0,new GD(1,GL,GT))}var GS=GT;for(++GT;GT<GV&&GB.test(GM[GT]);++GT){}GU.splice(GO,0,new GD(2,GS,GT));GL=GT}else{++GT}}if(GL<GV){GU.splice(GO,0,new GD(1,GL,GV))}}}if(GU[0].level==1&&(GR=GQ.match(/^\s+/))){GU[0].from=GR[0].length;GU.unshift(new GD(0,0,GR[0].length))}if(Fc(GU).level==1&&(GR=GQ.match(/\s+$/))){Fc(GU).to-=GR[0].length;GU.push(new GD(0,GW-GR[0].length,GW))}if(GU[0].level!=Fc(GU).level){GU.push(new GD(GU[0].level,GW,GW))}return GU}})();i.version="4.12.0";return i});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:codemirror-raw', location = '/static/bower/CodeMirror/addon/selection/mark-selection.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(B){B.defineOption("styleSelectedText",false,function(K,N,L){var M=L&&L!=B.Init;if(N&&!M){K.state.markedSelection=[];K.state.markedSelectionStyle=typeof N=="string"?N:"CodeMirror-selectedtext";F(K);K.on("cursorActivity",G);K.on("change",H)}else{if(!N&&M){K.off("cursorActivity",G);K.off("change",H);D(K);K.state.markedSelection=K.state.markedSelectionStyle=null}}});function G(K){K.operation(function(){C(K)})}function H(K){if(K.state.markedSelection.length){K.operation(function(){D(K)})}}var A=8;var J=B.Pos;var I=B.cmpPos;function E(T,R,S,O){if(I(R,S)==0){return }var P=T.state.markedSelection;var U=T.state.markedSelectionStyle;for(var V=R.line;;){var K=V==R.line?R:J(V,0);var L=V+A,Q=L>=S.line;var N=Q?S:J(L,0);var M=T.markText(K,N,{className:U});if(O==null){P.push(M)}else{P.splice(O++,0,M)}if(Q){break}V=L}}function D(K){var M=K.state.markedSelection;for(var L=0;L<M.length;++L){M[L].clear()}M.length=0}function F(K){D(K);var L=K.listSelections();for(var M=0;M<L.length;M++){E(K,L[M].from(),L[M].to())}}function C(K){if(!K.somethingSelected()){return D(K)}if(K.listSelections().length>1){return F(K)}var P=K.getCursor("start"),O=K.getCursor("end");var N=K.state.markedSelection;if(!N.length){return E(K,P,O)}var M=N[0].find(),L=N[N.length-1].find();if(!M||!L||O.line-P.line<A||I(P,L.to)>=0||I(O,M.from)<=0){return F(K)}while(I(P,M.from)>0){N.shift().clear();M=N[0].find()}if(I(P,M.from)<0){if(M.to.line-P.line<A){N.shift().clear();E(K,P,M.to,0)}else{E(K,P,M.from,0)}}while(I(O,L.to)<0){N.pop().clear();L=N[N.length-1].find()}if(I(O,L.to)>0){if(O.line-L.from.line<A){N.pop().clear();E(K,L.from,O)}else{E(K,L.to,O)}}}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:codemirror-raw', location = '/static/bower/CodeMirror/addon/search/searchcursor.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){var B=A.Pos;function C(K,I,L,G){this.atOccurrence=false;this.doc=K;if(G==null&&typeof I=="string"){G=false}L=L?K.clipPos(L):B(0,0);this.pos={from:L,to:L};if(typeof I!="string"){if(!I.global){I=new RegExp(I.source,I.ignoreCase?"ig":"g")}this.matches=function(P,T){if(P){I.lastIndex=0;var M=K.getLine(T.line).slice(0,T.ch),R=0,O,S;for(;;){I.lastIndex=R;var Q=I.exec(M);if(!Q){break}O=Q;S=O.index;R=O.index+(O[0].length||1);if(R==M.length){break}}var N=(O&&O[0].length)||0;if(!N){if(S==0&&M.length==0){O=undefined}else{if(S!=K.getLine(T.line).length){N++}}}}else{I.lastIndex=T.ch;var M=K.getLine(T.line),O=I.exec(M);var N=(O&&O[0].length)||0;var S=O&&O.index;if(S+N!=M.length&&!N){N=1}}if(O&&N){return{from:B(T.line,S),to:B(T.line,S+N),match:O}}}}else{var E=I;if(G){I=I.toLowerCase()}var F=G?function(M){return M.toLowerCase()}:function(M){return M};var J=I.split("\n");if(J.length==1){if(!I.length){this.matches=function(){}}else{this.matches=function(O,Q){if(O){var P=K.getLine(Q.line).slice(0,Q.ch),M=F(P);var N=M.lastIndexOf(I);if(N>-1){N=D(P,M,N);return{from:B(Q.line,N),to:B(Q.line,N+E.length)}}}else{var P=K.getLine(Q.line).slice(Q.ch),M=F(P);var N=M.indexOf(I);if(N>-1){N=D(P,M,N)+Q.ch;return{from:B(Q.line,N),to:B(Q.line,N+E.length)}}}}}}else{var H=E.split("\n");this.matches=function(N,P){var T=J.length-1;if(N){if(P.line-(J.length-1)<K.firstLine()){return }if(F(K.getLine(P.line).slice(0,H[T].length))!=J[J.length-1]){return }var S=B(P.line,H[T].length);for(var O=P.line-1,M=T-1;M>=1;--M,--O){if(J[M]!=F(K.getLine(O))){return }}var U=K.getLine(O),Q=U.length-H[0].length;if(F(U.slice(Q))!=J[0]){return }return{from:B(O,Q),to:S}}else{if(P.line+(J.length-1)>K.lastLine()){return }var U=K.getLine(P.line),Q=U.length-H[0].length;if(F(U.slice(Q))!=J[0]){return }var R=B(P.line,Q);for(var O=P.line+1,M=1;M<T;++M,++O){if(J[M]!=F(K.getLine(O))){return }}if(F(K.getLine(O).slice(0,H[T].length))!=J[T]){return }return{from:R,to:B(O,H[T].length)}}}}}}C.prototype={findNext:function(){return this.find(false)},findPrevious:function(){return this.find(true)},find:function(F){var E=this,I=this.doc.clipPos(F?this.pos.from:this.pos.to);function G(J){var K=B(J,0);E.pos={from:K,to:K};E.atOccurrence=false;return false}for(;;){if(this.pos=this.matches(F,I)){this.atOccurrence=true;return this.pos.match||true}if(F){if(!I.line){return G(0)}I=B(I.line-1,this.doc.getLine(I.line-1).length)}else{var H=this.doc.lineCount();if(I.line==H-1){return G(H)}I=B(I.line+1,0)}}},from:function(){if(this.atOccurrence){return this.pos.from}},to:function(){if(this.atOccurrence){return this.pos.to}},replace:function(F){if(!this.atOccurrence){return }var E=A.splitLines(F);this.doc.replaceRange(E,this.pos.from,this.pos.to);this.pos.to=B(this.pos.from.line+E.length-1,E[E.length-1].length+(E.length==1?this.pos.from.ch:0))}};function D(I,G,H){if(I.length==G.length){return H}for(var F=Math.min(H,I.length);;){var E=I.slice(0,F).toLowerCase().length;if(E<H){++F}else{if(E>H){--F}else{return F}}}}A.defineExtension("getSearchCursor",function(F,G,E){return new C(this.doc,F,G,E)});A.defineDocExtension("getSearchCursor",function(F,G,E){return new C(this,F,G,E)});A.defineExtension("selectMatches",function(H,G){var E=[],F;var I=this.getSearchCursor(H,this.getCursor("from"),G);while(F=I.findNext()){if(A.cmpPos(I.to(),this.getCursor("to"))>0){break}E.push({anchor:I.from(),head:I.to()})}if(E.length){this.setSelections(E,0)}})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:codemirror-raw', location = '/static/bower/CodeMirror/addon/search/match-highlighter.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){var I=2;var B="matchhighlight";var C=100;var K=false;function H(L){if(typeof L=="object"){this.minChars=L.minChars;this.style=L.style;this.showToken=L.showToken;this.delay=L.delay;this.wordsOnly=L.wordsOnly}if(this.style==null){this.style=B}if(this.minChars==null){this.minChars=I}if(this.delay==null){this.delay=C}if(this.wordsOnly==null){this.wordsOnly=K}this.overlay=this.timeout=null}A.defineOption("highlightSelectionMatches",false,function(L,O,M){if(M&&M!=A.Init){var N=L.state.matchHighlighter.overlay;if(N){L.removeOverlay(N)}clearTimeout(L.state.matchHighlighter.timeout);L.state.matchHighlighter=null;L.off("cursorActivity",G)}if(O){L.state.matchHighlighter=new H(O);E(L);L.on("cursorActivity",G)}});function G(L){var M=L.state.matchHighlighter;clearTimeout(M.timeout);M.timeout=setTimeout(function(){E(L)},M.delay)}function E(L){L.operation(function(){var M=L.state.matchHighlighter;if(M.overlay){L.removeOverlay(M.overlay);M.overlay=null}if(!L.somethingSelected()&&M.showToken){var T=M.showToken===true?/[\w$]/:M.showToken;var S=L.getCursor(),U=L.getLine(S.line),N=S.ch,O=N;while(N&&T.test(U.charAt(N-1))){--N}while(O<U.length&&T.test(U.charAt(O))){++O}if(N<O){L.addOverlay(M.overlay=D(U.slice(N,O),T,M.style))}return }var Q=L.getCursor("from"),R=L.getCursor("to");if(Q.line!=R.line){return }if(M.wordsOnly&&!F(L,Q,R)){return }var P=L.getRange(Q,R).replace(/^\s+|\s+$/g,"");if(P.length>=M.minChars){L.addOverlay(M.overlay=D(P,false,M.style))}})}function F(L,Q,P){var N=L.getRange(Q,P);if(N.match(/^\w+$/)!==null){if(Q.ch>0){var O={line:Q.line,ch:Q.ch-1};var M=L.getRange(O,Q);if(M.match(/\W/)===null){return false}}if(P.ch<L.getLine(Q.line).length){var O={line:P.line,ch:P.ch+1};var M=L.getRange(P,O);if(M.match(/\W/)===null){return false}}return true}else{return false}}function J(M,L){return(!M.start||!L.test(M.string.charAt(M.start-1)))&&(M.pos==M.string.length||!L.test(M.string.charAt(M.pos)))}function D(N,M,L){return{token:function(O){if(O.match(N)&&(!M||J(O,M))){return L}O.next();O.skipTo(N.charAt(0))||O.skipToEnd()}}}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:codemirror-raw', location = '/static/bower/CodeMirror/addon/dialog/dialog.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(B){function C(D,H,E){var G=D.getWrapperElement();var F;F=G.appendChild(document.createElement("div"));if(E){F.className="CodeMirror-dialog CodeMirror-dialog-bottom"}else{F.className="CodeMirror-dialog CodeMirror-dialog-top"}if(typeof H=="string"){F.innerHTML=H}else{F.appendChild(H)}return F}function A(D,E){if(D.state.currentNotificationClose){D.state.currentNotificationClose()}D.state.currentNotificationClose=E}B.defineExtension("openDialog",function(I,J,L){if(!L){L={}}A(this,null);var F=C(this,I,L.bottom);var E=false,G=this;function K(M){if(typeof M=="string"){H.value=M}else{if(E){return }E=true;F.parentNode.removeChild(F);G.focus();if(L.onClose){L.onClose(F)}}}var H=F.getElementsByTagName("input")[0],D;if(H){if(L.value){H.value=L.value;H.select()}if(L.onInput){B.on(H,"input",function(M){L.onInput(M,H.value,K)})}if(L.onKeyUp){B.on(H,"keyup",function(M){L.onKeyUp(M,H.value,K)})}B.on(H,"keydown",function(M){if(L&&L.onKeyDown&&L.onKeyDown(M,H.value,K)){return }if(M.keyCode==27||(L.closeOnEnter!==false&&M.keyCode==13)){H.blur();B.e_stop(M);K()}if(M.keyCode==13){J(H.value,M)}});if(L.closeOnBlur!==false){B.on(H,"blur",K)}H.focus()}else{if(D=F.getElementsByTagName("button")[0]){B.on(D,"click",function(){K();G.focus()});if(L.closeOnBlur!==false){B.on(D,"blur",K)}D.focus()}}return K});B.defineExtension("openConfirm",function(L,G,N){A(this,null);var H=C(this,L,N&&N.bottom);var I=H.getElementsByTagName("button");var F=false,J=this,D=1;function M(){if(F){return }F=true;H.parentNode.removeChild(H);J.focus()}I[0].focus();for(var E=0;E<I.length;++E){var K=I[E];(function(O){B.on(K,"click",function(P){B.e_preventDefault(P);M();if(O){O(J)}})})(G[E]);B.on(K,"blur",function(){--D;setTimeout(function(){if(D<=0){M()}},200)});B.on(K,"focus",function(){++D})}});B.defineExtension("openNotification",function(G,E){A(this,J);var F=C(this,G,E&&E.bottom);var D=false,H;var I=E&&typeof E.duration!=="undefined"?E.duration:5000;function J(){if(D){return }D=true;clearTimeout(H);F.parentNode.removeChild(F)}B.on(F,"click",function(K){B.e_preventDefault(K);J()});if(I){H=setTimeout(J,I)}return J})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:codemirror-mode-meta', location = '/static/bower/CodeMirror/mode/meta.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj"]},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"kotlin",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["py","pyw"]},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"]},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"SmartyMixed",mime:"text/x-smarty",mode:"smartymixed"},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]}];for(var B=0;B<A.modeInfo.length;B++){var C=A.modeInfo[B];if(C.mimes){C.mime=C.mimes[0]}}A.findModeByMIME=function(F){F=F.toLowerCase();for(var E=0;E<A.modeInfo.length;E++){var G=A.modeInfo[E];if(G.mime==F){return G}if(G.mimes){for(var D=0;D<G.mimes.length;D++){if(G.mimes[D]==F){return G}}}}};A.findModeByExtension=function(F){for(var E=0;E<A.modeInfo.length;E++){var G=A.modeInfo[E];if(G.ext){for(var D=0;D<G.ext.length;D++){if(G.ext[D]==F){return G}}}}};A.findModeByFileName=function(E){for(var F=0;F<A.modeInfo.length;F++){var H=A.modeInfo[F];if(H.file&&H.file.test(E)){return H}}var D=E.lastIndexOf(".");var G=D>-1&&E.substring(D+1,E.length);if(G){return A.findModeByExtension(G)}};A.findModeByName=function(E){E=E.toLowerCase();for(var F=0;F<A.modeInfo.length;F++){var G=A.modeInfo[F];if(G.name.toLowerCase()==E){return G}if(G.alias){for(var D=0;D<G.alias.length;D++){if(G.alias[D].toLowerCase()==E){return G}}}}}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:codemirror', location = '/static/lib/CodeMirror/codemirror-AMD.js' */ define("codemirror",function(){return CodeMirror});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:codemirror', location = '/static/bower/CodeMirror/addon/runmode/runmode.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.runMode=function(K,H,O,Q){var J=A.getMode(A.defaults,H);var D=/MSIE \d/.test(navigator.userAgent);var G=D&&(document.documentMode==null||document.documentMode<9);if(O.nodeType==1){var L=(Q&&Q.tabSize)||A.defaults.tabSize;var F=O,E=0;F.innerHTML="";O=function(X,U){if(X=="\n"){F.appendChild(document.createTextNode(G?"\r":X));E=0;return }var V="";for(var Y=0;;){var R=X.indexOf("\t",Y);if(R==-1){V+=X.slice(Y);E+=X.length-Y;break}else{E+=R-Y;V+=X.slice(Y,R);var T=L-E%L;E+=T;for(var S=0;S<T;++S){V+=" "}Y=R+1}}if(U){var W=F.appendChild(document.createElement("span"));W.className="cm-"+U.replace(/ +/g," cm-");W.appendChild(document.createTextNode(V))}else{F.appendChild(document.createTextNode(V))}}}var P=A.splitLines(K),C=(Q&&Q.state)||A.startState(J);for(var I=0,M=P.length;I<M;++I){if(I){O("\n")}var N=new A.StringStream(P[I]);if(!N.string&&J.blankLine){J.blankLine(C)}while(!N.eol()){var B=J.token(N,C);O(N.current(),B,I,N.start,C);N.start=N.pos}}}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:determine-language', location = '/static/util/determine-language.js' */ define("util/determine-language",["codemirror","jquery","lodash","exports"],function(O,G,Q,R){document.documentElement.className+=" cm-s-stash-default";var N={bash:"text/x-sh",clojure:"text/x-clojure",coffeescript:"text/x-coffeescript",cpp:"text/x-c++src",cs:"text/x-csharp",css:"text/css",d:"text/x-d",diff:"text/x-diff",dos:"text/x-sh",erlang:"text/x-erlang",go:"text/x-go",haskell:"text/x-haskell",html:"text/html",ini:"text/x-toml",java:"text/x-java",javascript:"text/javascript",json:"application/json",less:"text/x-less",lisp:"text/x-common-lisp",lua:"text/x-lua",markdown:"text/x-markdown",objectivec:"text/x-csrc",perl:"text/x-perl",php:"application/x-httpd-php",python:"text/x-python",ruby:"text/x-ruby",scala:"text/x-scala",sql:"text/x-sql",tex:"text/x-stex",vbscript:"text/vbscript",xml:"application/xml"};var C=WRM.data.claim("com.atlassian.stash.stash-web-plugin:determine-language.syntax-highlighters")||{};var J={};var I={};Q.forEach(C,function(S,T){if(T.indexOf("/")===-1){console&&console.warn&&console.warn("DEPRECATED - Using HighlightJS mapping ("+T+") has been has been deprecated since 3.5 and will be removed in 4.0. See https://confluence.atlassian.com/display/STASHKB/Syntax+highlight+changes")}Q.forEach(S.e,function(U){J[U]=T});Q.forEach(S.x,function(U){I[U]=T})});var K={};var L={};function B(S){return Q.has(J,S)?J[S]:null}function D(S){return Q.has(I,S)?I[S]:null}function H(S){var T=S;if(S.indexOf("/")===-1){T=N[S]}return O.findModeByMIME(T)}function E(S){var U=/^#!(?:\/(?:usr\/)?(?:local\/)?bin\/([^\s]+))(?:\s+([^\s]+))?/;var T=U.exec(S);if(T){var V=T[1];if(V==="env"){V=T[2]}return V}return null}function A(T,S){return K.hasOwnProperty(T)?K[T]:S&&L.hasOwnProperty(S)?L[S]:null}function M(U){var S=U.path;var T=S.lastIndexOf(".");var Y=T===-1?S:S.substring(T+1);var X=U.firstLine.length>1?E(U.firstLine):null;var W=A(Y,X);var V;if(!W){V=B(Y)||(X!=null?D(X):null);if(V){W=H(V)}else{W=O.findModeByFileName(S)}W=W||O.findModeByMIME("text/plain");W.builtIn=true}if(U.legacy){return V||"text"}return W}function P(U,T,S){if(T){T.forEach(function(V){K[V]=U})}if(S){S.forEach(function(V){L[V]=U})}}function F(T){var S=O.findModeByName(T)||O.findModeByExtension(T);if(!S){return G.Deferred().resolve(O.findModeByMIME("text/plain"))}if(typeof O.mimeModes[S.mime]==="undefined"){return WRM.require("wr!com.atlassian.stash.stash-highlight-plugin:"+S.mode).then(function(){return S})}return G.Deferred().resolve(S)}R.fromFileInfo=M;R.registerCodeMirrorMode=P;R.getCodeMirrorModeForName=F});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:stash-codemirror', location = '/static/feature/file-content/stash-codemirror/search.js' */ define("feature/file-content/stash-codemirror/search",["codemirror","jquery","util/navigator"],function(E,G,M){function A(Q,P){if(typeof Q==="string"){Q=new RegExp("^"+Q.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),P?"i":"")}else{Q=new RegExp("^(?:"+Q.source+")",Q.ignoreCase?"i":"")}return{token:function(R){if(R.match(Q)){return"searching"}while(!R.eol()){R.next();if(R.match(Q,false)){break}}}}}function K(){this.cursor=null;this.dialogEl=null;this.overlay=null;this.query=null}function F(P){return P.state.search||(P.state.search=new K())}function N(P){return typeof P==="string"&&P===P.toLowerCase()}function L(P,Q,R){return P.getSearchCursor(Q,R,N(Q))}function D(Q){var P=Q.match(/^\/(.*)\/([a-z]*)$/);return P?new RegExp(P[1],P[2].indexOf("i")===-1?"":"i"):Q}function B(P,Q){P.operation(function(){P.removeOverlay(Q.overlay);Q.overlay=A(Q.query,N(Q.query));P.addOverlay(Q.overlay)})}function O(P,Q){P.operation(function(){P.removeOverlay(Q.overlay);Q.overlay=null})}function I(P,R,Q){R=R&&R.trim();if(!R||R.length===0){return }P.operation(function(){var S=F(P);if(R!==S.query){S.query=D(R);S.cursor=null;B(P,S)}else{if(!S.overlay){B(P,S)}}H(P,Q)})}function J(P,Q){var S=F(P);if(S.dialogEl){var V=S.dialogEl.getElementsByClassName("search-query")[0];V.focus();I(P,V.value,Q);return }var R=G(stash.feature.fileContent.codemirror.searchQuery());R.find(".search-button").on("click",function(W){H(P,G(W.target).closest(".aui-button").data("rev"))}).tooltip();var T=R.find("input")[0];T.onkeydown=function(Z){S.query=undefined;var W=M.isMac();var X=String.fromCharCode(Z.keyCode);var Y=((W&&Z.metaKey&&!Z.ctrlKey)||(!W&&!Z.metaKey&&Z.ctrlKey));if(X==="F"&&Y&&!Z.shiftKey&&!Z.altKey){Z.preventDefault()}else{if(X==="G"&&Y&&!Z.shiftKey&&!Z.altKey){Z.preventDefault();I(P,T.value)}else{if(X==="G"&&Y&&Z.shiftKey&&!Z.altKey){Z.preventDefault();I(P,T.value,true)}}}};S.dialogEl=R[0];var U={value:P.getSelection()||S.query,closeOnEnter:false,closeOnBlur:false,onClose:function(){O(P,S);S.dialogEl=S.cursor=null}};P.openDialog(S.dialogEl,function(W,X){X.preventDefault();I(P,W)},U);I(P,U.value,Q)}function H(P,Q){P.operation(function(){var U=F(P);if(!U.query||!U.dialogEl){J(P,Q);return }if(!U.cursor){if(Q){P.execCommand("goCharLeft")}U.cursor=L(P,U.query,P.getCursor())}if(!U.cursor.find(Q)){U.cursor=L(P,U.query,Q?E.Pos(P.lastLine()):E.Pos(P.firstLine(),0));if(!U.cursor.find(Q)){return }}P.setSelection(U.cursor.from(),U.cursor.to());var V={from:U.cursor.from(),to:U.cursor.to()};var S=P.getOption("scrollLineIntoViewFunc");if(S){S(V);var R=P.charCoords(V.from,"local");var T=P.getScrollInfo();if(T.left>R.left||T.left+T.clientWidth<R.left){P.scrollTo(Math.max(0,R.left-20),null)}}else{P.scrollIntoView(V,100)}})}function C(P,R){var Q=F(P);if(R.length===0){O(P,Q)}else{Q.query=D(R);B(P,Q)}}E.defineOption("scrollLineIntoViewFunc",null);E.commands.find=J;E.commands.findNext=H;E.commands.findPrev=function(P){return H(P,true)};E.commands.highlight=C});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:stash-codemirror', location = '/static/feature/file-content/stash-codemirror/codemirror-search.soy' */ // This file was automatically generated from codemirror-search.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.fileContent.codemirror. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; } if (typeof stash.feature.fileContent.codemirror == 'undefined') { stash.feature.fileContent.codemirror = {}; } stash.feature.fileContent.codemirror.searchQuery = function(opt_data, opt_ignored) { return '<div class="codemirror-search-query">' + soy.$$escapeHtml("Search:") + '<div class="search-box"><input class="search-query" type="text" style="width: 10em"/></div>' + aui.buttons.buttons({content: '' + aui.buttons.button({text: '', iconType: 'aui', iconClass: 'aui-icon-small aui-iconfont-up', extraClasses: ['search-button'], extraAttributes: {type: 'button', 'data-rev': 'true', title: "Previous match"}}) + aui.buttons.button({text: '', iconType: 'aui', iconClass: 'aui-icon-small aui-iconfont-down', extraClasses: ['search-button'], extraAttributes: {type: 'button', title: "Next match"}})}) + '</div>'; }; if (goog.DEBUG) { stash.feature.fileContent.codemirror.searchQuery.soyTemplateName = 'stash.feature.fileContent.codemirror.searchQuery'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:stash-codemirror', location = '/static/feature/file-content/stash-codemirror/stash-codemirror.js' */ define("feature/file-content/stash-codemirror",["aui","codemirror","jquery","lodash","util/function","feature/file-content/stash-codemirror/stash-scrollbar"],function(L,D,E,M,J){function H(O){O.on("keydown",function(P,Q){if(Q.which>=37&&Q.which<=40&&!Q.shiftKey&&!P.somethingSelected()){P.getInputField().blur()}})}function K(P){var O=false;var Q=J.lazyDelay(function(){var R;if(!O){R=P.lineAtHeight(P.getScrollInfo().top+P.heightAtLine(0));P.setSelection({line:R+1,ch:0})}O=false},10);P.on("contextmenu",function(){O=true});P.on("blur",function(R){if(R.somethingSelected()){Q()}O=false})}function B(O){O.on("keydown",F);O.on("keypress",F)}var I={};I[L.keyCode.TAB]=true;function G(P){var O=P.which||P.keyCode;return !!I[O]}var A=["which","keyCode","shiftKey","ctrlKey","metaKey"];function F(P,Q){var O=M.extend(jQuery.Event(Q.type),M.pick(Q,A));E(document).trigger(O);Q.codemirrorIgnore=G(Q)}function N(R){var Q={};var O=Array.prototype.slice.call(arguments,1);var P=J.spread(function(T,S){Q[T]=S!==undefined?M.compose(J.constant(S),R[T].bind(R)):R[T].bind(R)});O.forEach(J.unary(P));return Q}function C(R,O){var P=new D(R,E.extend({mode:"text/plain",readOnly:true,lineNumbers:false,wholeLineUpdateBefore:false,scrollbarStyle:"stash",cursorBlinkRate:0,styleSelectedText:true,theme:"stash-default"},{viewportMargin:O&&O.autoResizing?Infinity:undefined},O));E(P.getWrapperElement()).find(".CodeMirror-lines, .CodeMirror-code").attr("data-skate-ignore","true");if(O&&O.autoResizing){R.className+=" codemirror-auto-resizing-container"}H(P);B(P);K(P);var Q=N(P,["addLineClass",this],"addLineWidget","charCoords","execCommand","getDoc","getInputField","getLine","getLineHandle","getLineNumber","getOption","getScrollInfo","getWrapperElement","heightAtLine","lastLine","lineAtHeight",["markText",this],["off",this],["on",this],["refresh",this],["removeLineClass",this],"replaceRange",["scrollIntoView",this],["scrollTo",this],["setGutterMarker",this],["setOption",this],["setSelection",this],["setValue",this]);E.extend(this,Q);this.operation=function(S){P.operation(J.unary(M.partial(S,this)));return this};this._highlight=function(S){D.commands.highlight(P,S)};this._insert=function(Z,T,V){var X=0===T;var U=T-1;var S=P.getOption("wholeLineUpdateBefore");P.setOption("wholeLineUpdateBefore",X);var Y=P.getDoc();var W={line:U,ch:X?0:P.getLine(U).length};Y.replaceRange(X?Z+"\n":"\n"+Z,W);if(V){Y.setSelection({line:U,ch:0})}P.setOption("wholeLineUpdateBefore",S)};return this}return C});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:stash-codemirror', location = '/static/feature/file-content/stash-codemirror/stash-scrollbar.js' */ define("feature/file-content/stash-codemirror/stash-scrollbar",["codemirror","jquery"],function(A,B){function C(F,E,D){this.cm=D;var G=B("<div>").css("height","100%").css("min-height","1px");var H=this.horiz=B("<div>").addClass("CodeMirror-hscrollbar").css("min-height","18px").append(G)[0];F(H);A.on(H,"scroll",function(){if(H.clientWidth){E(H.scrollLeft,"horizontal")}})}C.prototype={update:function(D){var E=D.scrollWidth>D.clientWidth+1;var F=D.nativeBarWidth;if(E){this.horiz.style.display="block";this.horiz.style.right="0";this.horiz.style.left=D.barLeft+"px";this.horiz.firstChild.style.width=(D.scrollWidth-D.clientWidth+(D.barWidth||this.horiz.clientWidth))+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}return{right:0,bottom:E?F:0}},setScrollLeft:function(D){if(this.horiz.scrollLeft!==D){this.horiz.scrollLeft=D}},setScrollTop:function(D){},clear:function(){var D=this.horiz.parentNode;D.removeChild(this.horiz);D.removeChild(this.vert)}};A.scrollbarModel.stash=C});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:clike', location = '/static/bower/CodeMirror/mode/clike/clike.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(B){B.defineMode("clike",function(a,M){var U=a.indentUnit,S=M.statementIndentUnit||U,V=M.dontAlignCalls,O=M.keywords||{},b=M.builtin||{},W=M.blockKeywords||{},K=M.atoms||{},J=M.hooks||{},R=M.multiLineStrings,P=M.indentStatements!==false;var Q=/[+\-*&%=<>!?|\/]/;var Y;function c(h,f){var e=h.next();if(J[e]){var d=J[e](h,f);if(d!==false){return d}}if(e=='"'||e=="'"){f.tokenize=N(e);return f.tokenize(h,f)}if(/[\[\]{}\(\),;\:\.]/.test(e)){Y=e;return null}if(/\d/.test(e)){h.eatWhile(/[\w\.]/);return"number"}if(e=="/"){if(h.eat("*")){f.tokenize=T;return T(h,f)}if(h.eat("/")){h.skipToEnd();return"comment"}}if(Q.test(e)){h.eatWhile(Q);return"operator"}h.eatWhile(/[\w\$_\xa1-\uffff]/);var g=h.current();if(O.propertyIsEnumerable(g)){if(W.propertyIsEnumerable(g)){Y="newstatement"}return"keyword"}if(b.propertyIsEnumerable(g)){if(W.propertyIsEnumerable(g)){Y="newstatement"}return"builtin"}if(K.propertyIsEnumerable(g)){return"atom"}return"variable"}function N(d){return function(i,g){var h=false,f,e=false;while((f=i.next())!=null){if(f==d&&!h){e=true;break}h=!h&&f=="\\"}if(e||!(h||R)){g.tokenize=null}return"string"}}function T(g,f){var d=false,e;while(e=g.next()){if(e=="/"&&d){f.tokenize=null;break}d=(e=="*")}return"comment"}function X(h,e,d,g,f){this.indented=h;this.column=e;this.type=d;this.align=g;this.prev=f}function L(g,e,f){var d=g.indented;if(g.context&&g.context.type=="statement"){d=g.context.indented}return g.context=new X(d,e,f,null,g.context)}function Z(e){var d=e.context.type;if(d==")"||d=="]"||d=="}"){e.indented=e.context.indented}return e.context=e.context.prev}return{startState:function(d){return{tokenize:null,context:new X((d||0)-U,0,"top",false),indented:0,startOfLine:true}},token:function(g,f){var d=f.context;if(g.sol()){if(d.align==null){d.align=false}f.indented=g.indentation();f.startOfLine=true}if(g.eatSpace()){return null}Y=null;var e=(f.tokenize||c)(g,f);if(e=="comment"||e=="meta"){return e}if(d.align==null){d.align=true}if((Y==";"||Y==":"||Y==",")&&d.type=="statement"){Z(f)}else{if(Y=="{"){L(f,g.column(),"}")}else{if(Y=="["){L(f,g.column(),"]")}else{if(Y=="("){L(f,g.column(),")")}else{if(Y=="}"){while(d.type=="statement"){d=Z(f)}if(d.type=="}"){d=Z(f)}while(d.type=="statement"){d=Z(f)}}else{if(Y==d.type){Z(f)}else{if(P&&(((d.type=="}"||d.type=="top")&&Y!=";")||(d.type=="statement"&&Y=="newstatement"))){L(f,g.column(),"statement")}}}}}}}f.startOfLine=false;return e},indent:function(h,e){if(h.tokenize!=c&&h.tokenize!=null){return B.Pass}var d=h.context,g=e&&e.charAt(0);if(d.type=="statement"&&g=="}"){d=d.prev}var f=g==d.type;if(d.type=="statement"){return d.indented+(g=="{"?0:S)}else{if(d.align&&(!V||d.type!=")")){return d.column+(f?0:1)}else{if(d.type==")"&&!f){return d.indented+S}else{return d.indented+(f?0:U)}}}},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});function F(M){var K={},L=M.split(" ");for(var J=0;J<L.length;++J){K[L[J]]=true}return K}var I="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";function C(K,J){if(!J.startOfLine){return false}for(;;){if(K.skipTo("\\")){K.next();if(K.eol()){J.tokenize=C;break}}else{K.skipToEnd();J.tokenize=null;break}}return"meta"}function H(L,K){L.backUp(1);if(L.match(/(R|u8R|uR|UR|LR)/)){var J=L.match(/"([^\s\\()]{0,16})\(/);if(!J){return false}K.cpp11RawStringDelim=J[1];K.tokenize=E;return E(L,K)}if(L.match(/(u8|u|U|L)/)){if(L.match(/["']/,false)){return"string"}return false}L.next();return false}function G(L,K){var J;while((J=L.next())!=null){if(J=='"'&&!L.eat('"')){K.tokenize=null;break}}return"string"}function E(M,K){var L=K.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");var J=M.match(new RegExp(".*?\\)"+L+'"'));if(J){K.tokenize=null}else{M.skipToEnd()}return"string"}function A(J,N){if(typeof J=="string"){J=[J]}var M=[];function L(O){if(O){for(var P in O){if(O.hasOwnProperty(P)){M.push(P)}}}}L(N.keywords);L(N.builtin);L(N.atoms);if(M.length){N.helperType=J[0];B.registerHelper("hintWords",J[0],M)}for(var K=0;K<J.length;++K){B.defineMIME(J[K],N)}}A(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:F(I),blockKeywords:F("case do else for if switch while struct"),atoms:F("null"),hooks:{"#":C},modeProps:{fold:["brace","include"]}});A(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:F(I+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),blockKeywords:F("catch class do else finally for if struct switch try while"),atoms:F("true false null"),hooks:{"#":C,u:H,U:H,L:H,R:H},modeProps:{fold:["brace","include"]}});A("text/x-java",{name:"clike",keywords:F("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:F("catch class do else finally for if switch try while"),atoms:F("true false null"),hooks:{"@":function(J){J.eatWhile(/[\w\$_]/);return"meta"}},modeProps:{fold:["brace","import"]}});A("text/x-csharp",{name:"clike",keywords:F("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:F("catch class do else finally for foreach if struct switch try while"),builtin:F("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:F("true false null"),hooks:{"@":function(K,J){if(K.eat('"')){J.tokenize=G;return G(K,J)}K.eatWhile(/[\w\$_]/);return"meta"}}});function D(L,J){var K=false;while(!L.eol()){if(!K&&L.match('"""')){J.tokenize=null;break}K=L.next()!="\\"&&!K}return"string"}A("text/x-scala",{name:"clike",keywords:F("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:true,blockKeywords:F("catch class do else finally for forSome if match switch try while"),atoms:F("true false null"),indentStatements:false,hooks:{"@":function(J){J.eatWhile(/[\w\$_]/);return"meta"},'"':function(K,J){if(!K.match('""')){return false}J.tokenize=D;return J.tokenize(K,J)}}});A(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:F("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:F("for while do if else struct"),builtin:F("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:F("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),hooks:{"#":C},modeProps:{fold:["brace","include"]}});A("text/x-nesc",{name:"clike",keywords:F(I+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),blockKeywords:F("case do else for if switch while struct"),atoms:F("null"),hooks:{"#":C},modeProps:{fold:["brace","include"]}});A("text/x-objectivec",{name:"clike",keywords:F(I+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),atoms:F("YES NO NULL NILL ON OFF"),hooks:{"@":function(J){J.eatWhile(/[\w\$]/);return"keyword"},"#":C},modeProps:{fold:"brace"}})});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:commonlisp', location = '/static/bower/CodeMirror/mode/commonlisp/commonlisp.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("commonlisp",function(C){var H=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/;var K=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/;var G=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/;var D=/[^\s'`,@()\[\]";]/;var I;function F(M){var L;while(L=M.next()){if(L=="\\"){M.next()}else{if(!D.test(L)){M.backUp(1);break}}}return M.current()}function B(O,N){if(O.eatSpace()){I="ws";return null}if(O.match(G)){return"number"}var M=O.next();if(M=="\\"){M=O.next()}if(M=='"'){return(N.tokenize=E)(O,N)}else{if(M=="("){I="open";return"bracket"}else{if(M==")"||M=="]"){I="close";return"bracket"}else{if(M==";"){O.skipToEnd();I="ws";return"comment"}else{if(/['`,@]/.test(M)){return null}else{if(M=="|"){if(O.skipTo("|")){O.next();return"symbol"}else{O.skipToEnd();return"error"}}else{if(M=="#"){var M=O.next();if(M=="["){I="open";return"bracket"}else{if(/[+\-=\.']/.test(M)){return null}else{if(/\d/.test(M)&&O.match(/^\d*#/)){return null}else{if(M=="|"){return(N.tokenize=J)(O,N)}else{if(M==":"){F(O);return"meta"}else{return"error"}}}}}}else{var L=F(O);if(L=="."){return null}I="symbol";if(L=="nil"||L=="t"||L.charAt(0)==":"){return"atom"}if(N.lastType=="open"&&(H.test(L)||K.test(L))){return"keyword"}if(L.charAt(0)=="&"){return"variable-2"}return"variable"}}}}}}}}function E(O,M){var N=false,L;while(L=O.next()){if(L=='"'&&!N){M.tokenize=B;break}N=!N&&L=="\\"}return"string"}function J(O,N){var L,M;while(L=O.next()){if(L=="#"&&M=="|"){N.tokenize=B;break}M=L}I="ws";return"comment"}return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:B}},token:function(N,M){if(N.sol()&&typeof M.ctx.indentTo!="number"){M.ctx.indentTo=M.ctx.start+1}I=null;var L=M.tokenize(N,M);if(I!="ws"){if(M.ctx.indentTo==null){if(I=="symbol"&&K.test(N.current())){M.ctx.indentTo=M.ctx.start+C.indentUnit}else{M.ctx.indentTo="next"}}else{if(M.ctx.indentTo=="next"){M.ctx.indentTo=N.column()}}M.lastType=I}if(I=="open"){M.ctx={prev:M.ctx,start:N.column(),indentTo:null}}else{if(I=="close"){M.ctx=M.ctx.prev||M.ctx}}return L},indent:function(N,L){var M=N.ctx.indentTo;return typeof M=="number"?M:N.ctx.start+1},lineComment:";;",blockCommentStart:"#|",blockCommentEnd:"|#"}});A.defineMIME("text/x-common-lisp","commonlisp")});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:css', location = '/static/bower/CodeMirror/mode/css/css.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(N){N.defineMode("css",function(o,c){if(!c.propertyKeywords){c=N.resolveMode("text/css")}var i=o.indentUnit,U=c.tokenHooks,n=c.mediaTypes||{},e=c.mediaFeatures||{},b=c.propertyKeywords||{},V=c.nonStandardPropertyKeywords||{},h=c.colorKeywords||{},k=c.valueKeywords||{},X=c.fontProperties||{},f=c.allowNested;var W,g;function p(s,t){W=t;return s}function r(v,u){var t=v.next();if(U[t]){var s=U[t](v,u);if(s!==false){return s}}if(t=="@"){v.eatWhile(/[\w\\\-]/);return p("def",v.current())}else{if(t=="="||(t=="~"||t=="|")&&v.eat("=")){return p(null,"compare")}else{if(t=='"'||t=="'"){u.tokenize=d(t);return u.tokenize(v,u)}else{if(t=="#"){v.eatWhile(/[\w\\\-]/);return p("atom","hash")}else{if(t=="!"){v.match(/^\s*\w*/);return p("keyword","important")}else{if(/\d/.test(t)||t=="."&&v.eat(/\d/)){v.eatWhile(/[\w.%]/);return p("number","unit")}else{if(t==="-"){if(/[\d.]/.test(v.peek())){v.eatWhile(/[\w.%]/);return p("number","unit")}else{if(v.match(/^\w+-/)){return p("meta","meta")}}}else{if(/[,+>*\/]/.test(t)){return p(null,"select-op")}else{if(t=="."&&v.match(/^-?[_a-z][_a-z0-9-]*/i)){return p("qualifier","qualifier")}else{if(/[:;{}\[\]\(\)]/.test(t)){return p(null,t)}else{if(t=="u"&&v.match("rl(")){v.backUp(1);u.tokenize=q;return p("property","word")}else{if(/[\w\\\-]/.test(t)){v.eatWhile(/[\w\\\-]/);return p("property","word")}else{return p(null,null)}}}}}}}}}}}}}function d(s){return function(w,u){var v=false,t;while((t=w.next())!=null){if(t==s&&!v){if(s==")"){w.backUp(1)}break}v=!v&&t=="\\"}if(t==s||!v&&s!=")"){u.tokenize=null}return p("string","string")}}function q(t,s){t.next();if(!t.match(/\s*[\"\')]/,false)){s.tokenize=d(")")}else{s.tokenize=null}return p(null,"(")}function j(t,s,u){this.type=t;this.indent=s;this.prev=u}function Z(t,u,s){t.context=new j(s,u.indentation()+i,t.context);return s}function l(s){s.context=s.context.prev;return s.context.type}function T(s,u,t){return Y[t.context.type](s,u,t)}function m(t,v,u,w){for(var s=w||1;s>0;s--){u.context=u.context.prev}return T(t,v,u)}function a(t){var s=t.current().toLowerCase();if(k.hasOwnProperty(s)){g="atom"}else{if(h.hasOwnProperty(s)){g="keyword"}else{g="variable"}}}var Y={};Y.top=function(s,u,t){if(s=="{"){return Z(t,u,"block")}else{if(s=="}"&&t.context.prev){return l(t)}else{if(s=="@media"){return Z(t,u,"media")}else{if(s=="@font-face"){return"font_face_before"}else{if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(s)){return"keyframes"}else{if(s&&s.charAt(0)=="@"){return Z(t,u,"at")}else{if(s=="hash"){g="builtin"}else{if(s=="word"){g="tag"}else{if(s=="variable-definition"){return"maybeprop"}else{if(s=="interpolation"){return Z(t,u,"interpolation")}else{if(s==":"){return"pseudo"}else{if(f&&s=="("){return Z(t,u,"parens")}}}}}}}}}}}}return t.context.type};Y.block=function(s,v,t){if(s=="word"){var u=v.current().toLowerCase();if(b.hasOwnProperty(u)){g="property";return"maybeprop"}else{if(V.hasOwnProperty(u)){g="string-2";return"maybeprop"}else{if(f){g=v.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{g+=" error";return"maybeprop"}}}}else{if(s=="meta"){return"block"}else{if(!f&&(s=="hash"||s=="qualifier")){g="error";return"block"}else{return Y.top(s,v,t)}}}};Y.maybeprop=function(s,u,t){if(s==":"){return Z(t,u,"prop")}return T(s,u,t)};Y.prop=function(s,u,t){if(s==";"){return l(t)}if(s=="{"&&f){return Z(t,u,"propBlock")}if(s=="}"||s=="{"){return m(s,u,t)}if(s=="("){return Z(t,u,"parens")}if(s=="hash"&&!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(u.current())){g+=" error"}else{if(s=="word"){a(u)}else{if(s=="interpolation"){return Z(t,u,"interpolation")}}}return"prop"};Y.propBlock=function(t,s,u){if(t=="}"){return l(u)}if(t=="word"){g="property";return"maybeprop"}return u.context.type};Y.parens=function(s,u,t){if(s=="{"||s=="}"){return m(s,u,t)}if(s==")"){return l(t)}if(s=="("){return Z(t,u,"parens")}if(s=="word"){a(u)}return"parens"};Y.pseudo=function(s,u,t){if(s=="word"){g="variable-3";return t.context.type}return T(s,u,t)};Y.media=function(s,v,t){if(s=="("){return Z(t,v,"media_parens")}if(s=="}"){return m(s,v,t)}if(s=="{"){return l(t)&&Z(t,v,f?"block":"top")}if(s=="word"){var u=v.current().toLowerCase();if(u=="only"||u=="not"||u=="and"){g="keyword"}else{if(n.hasOwnProperty(u)){g="attribute"}else{if(e.hasOwnProperty(u)){g="property"}else{g="error"}}}}return t.context.type};Y.media_parens=function(s,u,t){if(s==")"){return l(t)}if(s=="{"||s=="}"){return m(s,u,t,2)}return Y.media(s,u,t)};Y.font_face_before=function(s,u,t){if(s=="{"){return Z(t,u,"font_face")}return T(s,u,t)};Y.font_face=function(s,u,t){if(s=="}"){return l(t)}if(s=="word"){if(!X.hasOwnProperty(u.current().toLowerCase())){g="error"}else{g="property"}return"maybeprop"}return"font_face"};Y.keyframes=function(s,u,t){if(s=="word"){g="variable";return"keyframes"}if(s=="{"){return Z(t,u,"top")}return T(s,u,t)};Y.at=function(s,u,t){if(s==";"){return l(t)}if(s=="{"||s=="}"){return m(s,u,t)}if(s=="word"){g="tag"}else{if(s=="hash"){g="builtin"}}return"at"};Y.interpolation=function(s,u,t){if(s=="}"){return l(t)}if(s=="{"||s==";"){return m(s,u,t)}if(s!="variable"){g="error"}return"interpolation"};return{startState:function(s){return{tokenize:null,state:"top",context:new j("top",s||0,null)}},token:function(u,t){if(!t.tokenize&&u.eatSpace()){return null}var s=(t.tokenize||r)(u,t);if(s&&typeof s=="object"){W=s[1];s=s[0]}g=s;t.state=Y[t.state](W,u,t);return g},indent:function(w,u){var t=w.context,v=u&&u.charAt(0);var s=t.indent;if(t.type=="prop"&&(v=="}"||v==")")){t=t.prev}if(t.prev&&(v=="}"&&(t.type=="block"||t.type=="top"||t.type=="interpolation"||t.type=="font_face")||v==")"&&(t.type=="parens"||t.type=="media_parens")||v=="{"&&(t.type=="at"||t.type=="media"))){s=t.indent-i;t=t.prev}return s},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});function F(V){var U={};for(var T=0;T<V.length;++T){U[V[T]]=true}return U}var A=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],Q=F(A);var S=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],I=F(S);var C=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],H=F(C);var L=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],D=F(L);var B=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],K=F(B);var J=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],O=F(J);var P=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],E=F(P);var M=A.concat(S).concat(C).concat(L).concat(B).concat(J);N.registerHelper("hintWords","css",M);function R(W,V){var T=false,U;while((U=W.next())!=null){if(T&&U=="/"){V.tokenize=null;break}T=(U=="*")}return["comment","comment"]}function G(U,T){if(U.skipTo("-->")){U.match("-->");T.tokenize=null}else{U.skipToEnd()}return["comment","comment"]}N.defineMIME("text/css",{mediaTypes:Q,mediaFeatures:I,propertyKeywords:H,nonStandardPropertyKeywords:D,colorKeywords:K,valueKeywords:O,fontProperties:E,tokenHooks:{"<":function(U,T){if(!U.match("!--")){return false}T.tokenize=G;return G(U,T)},"/":function(U,T){if(!U.eat("*")){return false}T.tokenize=R;return R(U,T)}},name:"css"});N.defineMIME("text/x-scss",{mediaTypes:Q,mediaFeatures:I,propertyKeywords:H,nonStandardPropertyKeywords:D,colorKeywords:K,valueKeywords:O,fontProperties:E,allowNested:true,tokenHooks:{"/":function(U,T){if(U.eat("/")){U.skipToEnd();return["comment","comment"]}else{if(U.eat("*")){T.tokenize=R;return R(U,T)}else{return["operator","operator"]}}},":":function(T){if(T.match(/\s*\{/)){return[null,"{"]}return false},"$":function(T){T.match(/^[\w-]+/);if(T.match(/^\s*:/,false)){return["variable-2","variable-definition"]}return["variable-2","variable"]},"#":function(T){if(!T.eat("{")){return false}return[null,"interpolation"]}},name:"css",helperType:"scss"});N.defineMIME("text/x-less",{mediaTypes:Q,mediaFeatures:I,propertyKeywords:H,nonStandardPropertyKeywords:D,colorKeywords:K,valueKeywords:O,fontProperties:E,allowNested:true,tokenHooks:{"/":function(U,T){if(U.eat("/")){U.skipToEnd();return["comment","comment"]}else{if(U.eat("*")){T.tokenize=R;return R(U,T)}else{return["operator","operator"]}}},"@":function(T){if(T.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,false)){return false}T.eatWhile(/[\w\\\-]/);if(T.match(/^\s*:/,false)){return["variable-2","variable-definition"]}return["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:javascript', location = '/static/bower/CodeMirror/mode/javascript/javascript.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("javascript",function(y,AI){var K=y.indentUnit;var Z=AI.statementIndent;var AY=AI.jsonld;var Y=AI.json||AY;var G=AI.typescript;var AS=AI.wordCharacters||/[\w$\xa1-\uffff]/;var AQ=function(){function Ao(Aq){return{type:Aq,style:"keyword"}}var Aj=Ao("keyword a"),Ah=Ao("keyword b"),Ag=Ao("keyword c");var Ai=Ao("operator"),Am={type:"atom",style:"atom"};var Ak={"if":Ao("if"),"while":Aj,"with":Aj,"else":Ah,"do":Ah,"try":Ah,"finally":Ah,"return":Ag,"break":Ag,"continue":Ag,"new":Ag,"delete":Ag,"throw":Ag,"debugger":Ag,"var":Ao("var"),"const":Ao("var"),let:Ao("var"),"function":Ao("function"),"catch":Ao("catch"),"for":Ao("for"),"switch":Ao("switch"),"case":Ao("case"),"default":Ao("default"),"in":Ai,"typeof":Ai,"instanceof":Ai,"true":Am,"false":Am,"null":Am,"undefined":Am,"NaN":Am,"Infinity":Am,"this":Ao("this"),module:Ao("module"),"class":Ao("class"),"super":Ao("atom"),yield:Ag,"export":Ao("export"),"import":Ao("import"),"extends":Ag};if(G){var Ap={type:"variable",style:"variable-3"};var Al={"interface":Ao("interface"),"extends":Ao("extends"),constructor:Ao("constructor"),"public":Ao("public"),"private":Ao("private"),"protected":Ao("protected"),"static":Ao("static"),string:Ap,number:Ap,bool:Ap,any:Ap};for(var An in Al){Ak[An]=Al[An]}}return Ak}();var o=/[+\-*&%=<>!?|~^]/;var AP=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function e(Aj){var Ah=false,Ag,Ai=false;while((Ag=Aj.next())!=null){if(!Ah){if(Ag=="/"&&!Ai){return }if(Ag=="["){Ai=true}else{if(Ai&&Ag=="]"){Ai=false}}}Ah=!Ah&&Ag=="\\"}}var r,f;function k(Ai,Ah,Ag){r=Ai;f=Ag;return Ah}function t(Ak,Ai){var Ag=Ak.next();if(Ag=='"'||Ag=="'"){Ai.tokenize=q(Ag);return Ai.tokenize(Ak,Ai)}else{if(Ag=="."&&Ak.match(/^\d+(?:[eE][+\-]?\d+)?/)){return k("number","number")}else{if(Ag=="."&&Ak.match("..")){return k("spread","meta")}else{if(/[\[\]{}\(\),;\:\.]/.test(Ag)){return k(Ag)}else{if(Ag=="="&&Ak.eat(">")){return k("=>","operator")}else{if(Ag=="0"&&Ak.eat(/x/i)){Ak.eatWhile(/[\da-f]/i);return k("number","number")}else{if(/\d/.test(Ag)){Ak.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return k("number","number")}else{if(Ag=="/"){if(Ak.eat("*")){Ai.tokenize=AX;return AX(Ak,Ai)}else{if(Ak.eat("/")){Ak.skipToEnd();return k("comment","comment")}else{if(Ai.lastType=="operator"||Ai.lastType=="keyword c"||Ai.lastType=="sof"||/^[\[{}\(,;:]$/.test(Ai.lastType)){e(Ak);Ak.eatWhile(/[gimy]/);return k("regexp","string-2")}else{Ak.eatWhile(o);return k("operator","operator",Ak.current())}}}}else{if(Ag=="`"){Ai.tokenize=AZ;return AZ(Ak,Ai)}else{if(Ag=="#"){Ak.skipToEnd();return k("error","error")}else{if(o.test(Ag)){Ak.eatWhile(o);return k("operator","operator",Ak.current())}else{if(AS.test(Ag)){Ak.eatWhile(AS);var Aj=Ak.current(),Ah=AQ.propertyIsEnumerable(Aj)&&AQ[Aj];return(Ah&&Ai.lastType!=".")?k(Ah.type,Ah.style,Aj):k("variable","variable",Aj)}}}}}}}}}}}}}function q(Ag){return function(Ak,Ai){var Aj=false,Ah;if(AY&&Ak.peek()=="@"&&Ak.match(AP)){Ai.tokenize=t;return k("jsonld-keyword","meta")}while((Ah=Ak.next())!=null){if(Ah==Ag&&!Aj){break}Aj=!Aj&&Ah=="\\"}if(!Aj){Ai.tokenize=t}return k("string","string")}}function AX(Aj,Ai){var Ag=false,Ah;while(Ah=Aj.next()){if(Ah=="/"&&Ag){Ai.tokenize=t;break}Ag=(Ah=="*")}return k("comment","comment")}function AZ(Aj,Ah){var Ai=false,Ag;while((Ag=Aj.next())!=null){if(!Ai&&(Ag=="`"||Ag=="$"&&Aj.eat("{"))){Ah.tokenize=t;break}Ai=!Ai&&Ag=="\\"}return k("quasi","string-2",Aj.current())}var L="([{}])";function AU(Am,Aj){if(Aj.fatArrowAt){Aj.fatArrowAt=null}var Ai=Am.string.indexOf("=>",Am.start);if(Ai<0){return }var Al=0,Ah=false;for(var An=Ai-1;An>=0;--An){var Ag=Am.string.charAt(An);var Ak=L.indexOf(Ag);if(Ak>=0&&Ak<3){if(!Al){++An;break}if(--Al==0){break}}else{if(Ak>=3&&Ak<6){++Al}else{if(AS.test(Ag)){Ah=true}else{if(/["'\/]/.test(Ag)){return }else{if(Ah&&!Al){++An;break}}}}}}if(Ah&&!Al){Aj.fatArrowAt=An}}var B={atom:true,number:true,variable:true,string:true,regexp:true,"this":true,"jsonld-keyword":true};function i(Al,Ah,Ag,Ak,Ai,Aj){this.indented=Al;this.column=Ah;this.type=Ag;this.prev=Ai;this.info=Aj;if(Ak!=null){this.align=Ak}}function R(Aj,Ai){for(var Ah=Aj.localVars;Ah;Ah=Ah.next){if(Ah.name==Ai){return true}}for(var Ag=Aj.context;Ag;Ag=Ag.prev){for(var Ah=Ag.vars;Ah;Ah=Ah.next){if(Ah.name==Ai){return true}}}}function F(Ak,Ah,Ag,Aj,Al){var Am=Ak.cc;c.state=Ak;c.stream=Al;c.marked=null,c.cc=Am;c.style=Ah;if(!Ak.lexical.hasOwnProperty("align")){Ak.lexical.align=true}while(true){var Ai=Am.length?Am.pop():Y?AM:Ae;if(Ai(Ag,Aj)){while(Am.length&&Am[Am.length-1].lex){Am.pop()()}if(c.marked){return c.marked}if(Ag=="variable"&&R(Ak,Aj)){return"variable-2"}return Ah}}}var c={state:null,column:null,marked:null,cc:null};function z(){for(var Ag=arguments.length-1;Ag>=0;Ag--){c.cc.push(arguments[Ag])}}function AD(){z.apply(null,arguments);return true}function AT(Ah){function Ag(Ak){for(var Aj=Ak;Aj;Aj=Aj.next){if(Aj.name==Ah){return true}}return false}var Ai=c.state;if(Ai.context){c.marked="def";if(Ag(Ai.localVars)){return }Ai.localVars={name:Ah,next:Ai.localVars}}else{if(Ag(Ai.globalVars)){return }if(AI.globalVars){Ai.globalVars={name:Ah,next:Ai.globalVars}}}}var P={name:"this",next:{name:"arguments"}};function V(){c.state.context={prev:c.state.context,vars:c.state.localVars};c.state.localVars=P}function W(){c.state.localVars=c.state.context.vars;c.state.context=c.state.context.prev}function Ac(Ah,Ai){var Ag=function(){var Al=c.state,Aj=Al.indented;if(Al.lexical.type=="stat"){Aj=Al.lexical.indented}else{for(var Ak=Al.lexical;Ak&&Ak.type==")"&&Ak.align;Ak=Ak.prev){Aj=Ak.indented}}Al.lexical=new i(Aj,c.stream.column(),Ah,null,Al.lexical,Ai)};Ag.lex=true;return Ag}function H(){var Ag=c.state;if(Ag.lexical.prev){if(Ag.lexical.type==")"){Ag.indented=Ag.lexical.indented}Ag.lexical=Ag.lexical.prev}}H.lex=true;function Q(Ag){function Ah(Ai){if(Ai==Ag){return AD()}else{if(Ag==";"){return z()}else{return AD(Ah)}}}return Ah}function Ae(Ag,Ah){if(Ag=="var"){return AD(Ac("vardef",Ah.length),D,Q(";"),H)}if(Ag=="keyword a"){return AD(Ac("form"),AM,Ae,H)}if(Ag=="keyword b"){return AD(Ac("form"),Ae,H)}if(Ag=="{"){return AD(Ac("}"),X,H)}if(Ag==";"){return AD()}if(Ag=="if"){if(c.state.lexical.info=="else"&&c.state.cc[c.state.cc.length-1]==H){c.state.cc.pop()()}return AD(Ac("form"),AM,Ae,H,E)}if(Ag=="function"){return AD(l)}if(Ag=="for"){return AD(Ac("form"),T,Ae,H)}if(Ag=="variable"){return AD(Ac("stat"),Af)}if(Ag=="switch"){return AD(Ac("form"),AM,Ac("}","switch"),Q("{"),X,H,H)}if(Ag=="case"){return AD(AM,Q(":"))}if(Ag=="default"){return AD(Q(":"))}if(Ag=="catch"){return AD(Ac("form"),V,Q("("),AE,Q(")"),Ae,H,W)}if(Ag=="module"){return AD(Ac("form"),V,g,W,H)}if(Ag=="class"){return AD(Ac("form"),u,H)}if(Ag=="export"){return AD(Ac("form"),Ad,H)}if(Ag=="import"){return AD(Ac("form"),AF,H)}return z(Ac("stat"),AM,Q(";"),H)}function AM(Ag){return x(Ag,false)}function Ab(Ag){return x(Ag,true)}function x(Ah,Aj){if(c.state.fatArrowAt==c.stream.start){var Ag=Aj?m:v;if(Ah=="("){return AD(V,Ac(")"),AR(I,")"),H,Q("=>"),Ag,W)}else{if(Ah=="variable"){return z(V,I,Q("=>"),Ag,W)}}}var Ai=Aj?J:AA;if(B.hasOwnProperty(Ah)){return AD(Ai)}if(Ah=="function"){return AD(l,Ai)}if(Ah=="keyword c"){return AD(Aj?AJ:AH)}if(Ah=="("){return AD(Ac(")"),AH,AW,Q(")"),H,Ai)}if(Ah=="operator"||Ah=="spread"){return AD(Aj?Ab:AM)}if(Ah=="["){return AD(Ac("]"),M,H,Ai)}if(Ah=="{"){return AV(S,"}",null,Ai)}if(Ah=="quasi"){return z(p,Ai)}return AD()}function AH(Ag){if(Ag.match(/[;\}\)\],]/)){return z()}return z(AM)}function AJ(Ag){if(Ag.match(/[;\}\)\],]/)){return z()}return z(Ab)}function AA(Ag,Ah){if(Ag==","){return AD(AM)}return J(Ag,Ah,false)}function J(Ag,Ai,Ak){var Ah=Ak==false?AA:J;var Aj=Ak==false?AM:Ab;if(Ag=="=>"){return AD(V,Ak?m:v,W)}if(Ag=="operator"){if(/\+\+|--/.test(Ai)){return AD(Ah)}if(Ai=="?"){return AD(AM,Q(":"),Aj)}return AD(Aj)}if(Ag=="quasi"){return z(p,Ah)}if(Ag==";"){return }if(Ag=="("){return AV(Ab,")","call",Ah)}if(Ag=="."){return AD(AK,Ah)}if(Ag=="["){return AD(Ac("]"),AH,Q("]"),H,Ah)}}function p(Ag,Ah){if(Ag!="quasi"){return z()}if(Ah.slice(Ah.length-2)!="${"){return AD(p)}return AD(AM,O)}function O(Ag){if(Ag=="}"){c.marked="string-2";c.state.tokenize=AZ;return AD(p)}}function v(Ag){AU(c.stream,c.state);return z(Ag=="{"?Ae:AM)}function m(Ag){AU(c.stream,c.state);return z(Ag=="{"?Ae:Ab)}function Af(Ag){if(Ag==":"){return AD(H,Ae)}return z(AA,Q(";"),H)}function AK(Ag){if(Ag=="variable"){c.marked="property";return AD()}}function S(Ag,Ah){if(Ag=="variable"||c.style=="keyword"){c.marked="property";if(Ah=="get"||Ah=="set"){return AD(h)}return AD(j)}else{if(Ag=="number"||Ag=="string"){c.marked=AY?"property":(c.style+" property");return AD(j)}else{if(Ag=="jsonld-keyword"){return AD(j)}else{if(Ag=="["){return AD(AM,Q("]"),j)}}}}}function h(Ag){if(Ag!="variable"){return z(j)}c.marked="property";return AD(l)}function j(Ag){if(Ag==":"){return AD(Ab)}if(Ag=="("){return z(l)}}function AR(Ai,Ag){function Ah(Ak){if(Ak==","){var Aj=c.state.lexical;if(Aj.info=="call"){Aj.pos=(Aj.pos||0)+1}return AD(Ai,Ah)}if(Ak==Ag){return AD()}return AD(Q(Ag))}return function(Aj){if(Aj==Ag){return AD()}return z(Ai,Ah)}}function AV(Aj,Ag,Ai){for(var Ah=3;Ah<arguments.length;Ah++){c.cc.push(arguments[Ah])}return AD(Ac(Ag,Ai),AR(Aj,Ag),H)}function X(Ag){if(Ag=="}"){return AD()}return z(Ae,X)}function s(Ag){if(G&&Ag==":"){return AD(AC)}}function AC(Ag){if(Ag=="variable"){c.marked="variable-3";return AD()}}function D(){return z(I,s,AB,w)}function I(Ag,Ah){if(Ag=="variable"){AT(Ah);return AD()}if(Ag=="["){return AV(I,"]")}if(Ag=="{"){return AV(Aa,"}")}}function Aa(Ag,Ah){if(Ag=="variable"&&!c.stream.match(/^\s*:/,false)){AT(Ah);return AD(AB)}if(Ag=="variable"){c.marked="property"}return AD(Q(":"),I,AB)}function AB(Ag,Ah){if(Ah=="="){return AD(Ab)}}function w(Ag){if(Ag==","){return AD(D)}}function E(Ag,Ah){if(Ag=="keyword b"&&Ah=="else"){return AD(Ac("form","else"),Ae,H)}}function T(Ag){if(Ag=="("){return AD(Ac(")"),d,Q(")"),H)}}function d(Ag){if(Ag=="var"){return AD(D,Q(";"),b)}if(Ag==";"){return AD(b)}if(Ag=="variable"){return AD(U)}return z(AM,Q(";"),b)}function U(Ag,Ah){if(Ah=="in"||Ah=="of"){c.marked="keyword";return AD(AM)}return AD(AA,b)}function b(Ag,Ah){if(Ag==";"){return AD(a)}if(Ah=="in"||Ah=="of"){c.marked="keyword";return AD(AM)}return z(AM,Q(";"),a)}function a(Ag){if(Ag!=")"){AD(AM)}}function l(Ag,Ah){if(Ah=="*"){c.marked="keyword";return AD(l)}if(Ag=="variable"){AT(Ah);return AD(l)}if(Ag=="("){return AD(V,Ac(")"),AR(AE,")"),H,Ae,W)}}function AE(Ag){if(Ag=="spread"){return AD(AE)}return z(I,s)}function u(Ag,Ah){if(Ag=="variable"){AT(Ah);return AD(n)}}function n(Ag,Ah){if(Ah=="extends"){return AD(AM,n)}if(Ag=="{"){return AD(Ac("}"),N,H)}}function N(Ag,Ah){if(Ag=="variable"||c.style=="keyword"){c.marked="property";if(Ah=="get"||Ah=="set"){return AD(C,l,N)}return AD(l,N)}if(Ah=="*"){c.marked="keyword";return AD(N)}if(Ag==";"){return AD(N)}if(Ag=="}"){return AD()}}function C(Ag){if(Ag!="variable"){return z()}c.marked="property";return AD()}function g(Ag,Ah){if(Ag=="string"){return AD(Ae)}if(Ag=="variable"){AT(Ah);return AD(AG)}}function Ad(Ag,Ah){if(Ah=="*"){c.marked="keyword";return AD(AG,Q(";"))}if(Ah=="default"){c.marked="keyword";return AD(AM,Q(";"))}return z(Ae)}function AF(Ag){if(Ag=="string"){return AD()}return z(AO,AG)}function AO(Ag,Ah){if(Ag=="{"){return AV(AO,"}")}if(Ag=="variable"){AT(Ah)}return AD()}function AG(Ag,Ah){if(Ah=="from"){c.marked="keyword";return AD(AM)}}function M(Ag){if(Ag=="]"){return AD()}return z(Ab,AL)}function AL(Ag){if(Ag=="for"){return z(AW,Q("]"))}if(Ag==","){return AD(AR(AJ,"]"))}return z(AR(Ab,"]"))}function AW(Ag){if(Ag=="for"){return AD(T,AW)}if(Ag=="if"){return AD(AM,AW)}}function AN(Ah,Ag){return Ah.lastType=="operator"||Ah.lastType==","||o.test(Ag.charAt(0))||/[,.]/.test(Ag.charAt(0))}return{startState:function(Ah){var Ag={tokenize:t,lastType:"sof",cc:[],lexical:new i((Ah||0)-K,0,"block",false),localVars:AI.localVars,context:AI.localVars&&{vars:AI.localVars},indented:0};if(AI.globalVars&&typeof AI.globalVars=="object"){Ag.globalVars=AI.globalVars}return Ag},token:function(Ai,Ah){if(Ai.sol()){if(!Ah.lexical.hasOwnProperty("align")){Ah.lexical.align=false}Ah.indented=Ai.indentation();AU(Ai,Ah)}if(Ah.tokenize!=AX&&Ai.eatSpace()){return null}var Ag=Ah.tokenize(Ai,Ah);if(r=="comment"){return Ag}Ah.lastType=r=="operator"&&(f=="++"||f=="--")?"incdec":r;return F(Ah,Ag,r,f,Ai)},indent:function(Am,Ag){if(Am.tokenize==AX){return A.Pass}if(Am.tokenize!=t){return 0}var Al=Ag&&Ag.charAt(0),Aj=Am.lexical;if(!/^\s*else\b/.test(Ag)){for(var Ai=Am.cc.length-1;Ai>=0;--Ai){var An=Am.cc[Ai];if(An==H){Aj=Aj.prev}else{if(An!=E){break}}}}if(Aj.type=="stat"&&Al=="}"){Aj=Aj.prev}if(Z&&Aj.type==")"&&Aj.prev.type=="stat"){Aj=Aj.prev}var Ak=Aj.type,Ah=Al==Ak;if(Ak=="vardef"){return Aj.indented+(Am.lastType=="operator"||Am.lastType==","?Aj.info+1:0)}else{if(Ak=="form"&&Al=="{"){return Aj.indented}else{if(Ak=="form"){return Aj.indented+K}else{if(Ak=="stat"){return Aj.indented+(AN(Am,Ag)?Z||K:0)}else{if(Aj.info=="switch"&&!Ah&&AI.doubleIndentSwitch!=false){return Aj.indented+(/^(?:case|default)\b/.test(Ag)?K:2*K)}else{if(Aj.align){return Aj.column+(Ah?0:1)}else{return Aj.indented+(Ah?0:K)}}}}}}},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Y?null:"/*",blockCommentEnd:Y?null:"*/",lineComment:Y?null:"//",fold:"brace",helperType:Y?"json":"javascript",jsonldMode:AY,jsonMode:Y}});A.registerHelper("wordChars","javascript",/[\w$]/);A.defineMIME("text/javascript","javascript");A.defineMIME("text/ecmascript","javascript");A.defineMIME("application/javascript","javascript");A.defineMIME("application/x-javascript","javascript");A.defineMIME("application/ecmascript","javascript");A.defineMIME("application/json",{name:"javascript",json:true});A.defineMIME("application/x-json",{name:"javascript",json:true});A.defineMIME("application/ld+json",{name:"javascript",jsonld:true});A.defineMIME("text/typescript",{name:"javascript",typescript:true});A.defineMIME("application/typescript",{name:"javascript",typescript:true})});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:xml', location = '/static/bower/CodeMirror/mode/xml/xml.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("xml",function(Y,K){var P=Y.indentUnit;var X=K.multilineTagIndentFactor||1;var D=K.multilineTagIndentPastTag;if(D==null){D=true}var W=K.htmlMode?{autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,menuitem:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true,caseFold:true}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false,caseFold:false};var C=K.alignCDATA;var F,G;function N(f,e){function c(g){e.tokenize=g;return g(f,e)}var d=f.next();if(d=="<"){if(f.eat("!")){if(f.eat("[")){if(f.match("CDATA[")){return c(V("atom","]]>"))}else{return null}}else{if(f.match("--")){return c(V("comment","-->"))}else{if(f.match("DOCTYPE",true,true)){f.eatWhile(/[\w\._\-]/);return c(Z(1))}else{return null}}}}else{if(f.eat("?")){f.eatWhile(/[\w\._\-]/);e.tokenize=V("meta","?>");return"meta"}else{F=f.eat("/")?"closeTag":"openTag";e.tokenize=M;return"tag bracket"}}}else{if(d=="&"){var b;if(f.eat("#")){if(f.eat("x")){b=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";")}else{b=f.eatWhile(/[\d]/)&&f.eat(";")}}else{b=f.eatWhile(/[\w\.\-:]/)&&f.eat(";")}return b?"atom":"error"}else{f.eatWhile(/[^&<]/);return null}}}function M(e,d){var c=e.next();if(c==">"||(c=="/"&&e.eat(">"))){d.tokenize=N;F=c==">"?"endTag":"selfcloseTag";return"tag bracket"}else{if(c=="="){F="equals";return null}else{if(c=="<"){d.tokenize=N;d.state=L;d.tagName=d.tagStart=null;var b=d.tokenize(e,d);return b?b+" tag error":"tag error"}else{if(/[\'\"]/.test(c)){d.tokenize=J(c);d.stringStartCol=e.column();return d.tokenize(e,d)}else{e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}}}}}function J(b){var c=function(e,d){while(!e.eol()){if(e.next()==b){d.tokenize=M;break}}return"string"};c.isInAttribute=true;return c}function V(c,b){return function(e,d){while(!e.eol()){if(e.match(b)){d.tokenize=N;break}e.next()}return c}}function Z(b){return function(e,d){var c;while((c=e.next())!=null){if(c=="<"){d.tokenize=Z(b+1);return d.tokenize(e,d)}else{if(c==">"){if(b==1){d.tokenize=N;break}else{d.tokenize=Z(b-1);return d.tokenize(e,d)}}}}return"meta"}}function R(c,b,d){this.prev=c.context;this.tagName=b;this.indent=c.indented;this.startOfLine=d;if(W.doNotIndent.hasOwnProperty(b)||(c.context&&c.context.noIndent)){this.noIndent=true}}function U(b){if(b.context){b.context=b.context.prev}}function Q(d,c){var b;while(true){if(!d.context){return }b=d.context.tagName;if(!W.contextGrabbers.hasOwnProperty(b)||!W.contextGrabbers[b].hasOwnProperty(c)){return }U(d)}}function L(b,d,c){if(b=="openTag"){c.tagStart=d.column();return B}else{if(b=="closeTag"){return T}else{return L}}}function B(b,d,c){if(b=="word"){c.tagName=d.current();G="tag";return E}else{G="error";return B}}function T(c,e,d){if(c=="word"){var b=e.current();if(d.context&&d.context.tagName!=b&&W.implicitlyClosed.hasOwnProperty(d.context.tagName)){U(d)}if(d.context&&d.context.tagName==b){G="tag";return S}else{G="tag error";return a}}else{G="error";return a}}function S(c,b,d){if(c!="endTag"){G="error";return S}U(d);return L}function a(b,d,c){G="error";return S(b,d,c)}function E(e,c,f){if(e=="word"){G="attribute";return I}else{if(e=="endTag"||e=="selfcloseTag"){var d=f.tagName,b=f.tagStart;f.tagName=f.tagStart=null;if(e=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(d)){Q(f,d)}else{Q(f,d);f.context=new R(f,d,b==f.indented)}return L}}G="error";return E}function I(b,d,c){if(b=="equals"){return O}if(!W.allowMissing){G="error"}return E(b,d,c)}function O(b,d,c){if(b=="string"){return H}if(b=="word"&&W.allowUnquoted){G="string";return E}G="error";return E(b,d,c)}function H(b,d,c){if(b=="string"){return H}return E(b,d,c)}return{startState:function(){return{tokenize:N,state:L,indented:0,tagName:null,tagStart:null,context:null}},token:function(d,c){if(!c.tagName&&d.sol()){c.indented=d.indentation()}if(d.eatSpace()){return null}F=null;var b=c.tokenize(d,c);if((b||F)&&b!="comment"){G=null;c.state=c.state(F||b,d,c);if(G){b=G=="error"?b+" error":G}}return b},indent:function(g,c,f){var e=g.context;if(g.tokenize.isInAttribute){if(g.tagStart==g.indented){return g.stringStartCol+1}else{return g.indented+P}}if(e&&e.noIndent){return A.Pass}if(g.tokenize!=M&&g.tokenize!=N){return f?f.match(/^(\s*)/)[0].length:0}if(g.tagName){if(D){return g.tagStart+g.tagName.length+2}else{return g.tagStart+P*X}}if(C&&/<!\[CDATA\[/.test(c)){return 0}var b=c&&/^<(\/)?([\w_:\.-]*)/.exec(c);if(b&&b[1]){while(e){if(e.tagName==b[2]){e=e.prev;break}else{if(W.implicitlyClosed.hasOwnProperty(e.tagName)){e=e.prev}else{break}}}}else{if(b){while(e){var d=W.contextGrabbers[e.tagName];if(d&&d.hasOwnProperty(b[2])){e=e.prev}else{break}}}}while(e&&!e.startOfLine){e=e.prev}if(e){return e.indent+P}else{return 0}},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml"}});A.defineMIME("text/xml","xml");A.defineMIME("application/xml","xml");if(!A.mimeModes.hasOwnProperty("text/html")){A.defineMIME("text/html",{name:"xml",htmlMode:true})}});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:htmlmixed', location = '/static/bower/CodeMirror/mode/htmlmixed/htmlmixed.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("htmlmixed",function(C,D){var B=A.getMode(C,{name:"xml",htmlMode:true,multilineTagIndentFactor:D.multilineTagIndentFactor,multilineTagIndentPastTag:D.multilineTagIndentPastTag});var M=A.getMode(C,"css");var K=[],J=D&&D.scriptTypes;K.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:A.getMode(C,"javascript")});if(J){for(var E=0;E<J.length;++E){var I=J[E];K.push({matches:I.matches,mode:I.mode&&A.getMode(C,I.mode)})}}K.push({matches:/./,mode:A.getMode(C,"text/plain")});function F(S,Q){var O=Q.htmlState.tagName;if(O){O=O.toLowerCase()}var P=B.token(S,Q.htmlState);if(O=="script"&&/\btag\b/.test(P)&&S.current()==">"){var T=S.string.slice(Math.max(0,S.pos-100),S.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);T=T?T[1]:"";if(T&&/[\"\']/.test(T.charAt(0))){T=T.slice(1,T.length-1)}for(var N=0;N<K.length;++N){var R=K[N];if(typeof R.matches=="string"?T==R.matches:R.matches.test(T)){if(R.mode){Q.token=L;Q.localMode=R.mode;Q.localState=R.mode.startState&&R.mode.startState(B.indent(Q.htmlState,""))}break}}}else{if(O=="style"&&/\btag\b/.test(P)&&S.current()==">"){Q.token=G;Q.localMode=M;Q.localState=M.startState(B.indent(Q.htmlState,""))}}return P}function H(S,O,P){var R=S.current();var Q=R.search(O),N;if(Q>-1){S.backUp(R.length-Q)}else{if(N=R.match(/<\/?$/)){S.backUp(R.length);if(!S.match(O,false)){S.match(R)}}}return P}function L(O,N){if(O.match(/^<\/\s*script\s*>/i,false)){N.token=F;N.localState=N.localMode=null;return null}return H(O,/<\/\s*script\s*>/,N.localMode.token(O,N.localState))}function G(O,N){if(O.match(/^<\/\s*style\s*>/i,false)){N.token=F;N.localState=N.localMode=null;return null}return H(O,/<\/\s*style\s*>/,M.token(O,N.localState))}return{startState:function(){var N=B.startState();return{token:F,localMode:null,localState:null,htmlState:N}},copyState:function(O){if(O.localState){var N=A.copyState(O.localMode,O.localState)}return{token:O.token,localMode:O.localMode,localState:N,htmlState:A.copyState(B,O.htmlState)}},token:function(O,N){return N.token(O,N)},indent:function(O,N){if(!O.localMode||/^\s*<\//.test(N)){return B.indent(O.htmlState,N)}else{if(O.localMode.indent){return O.localMode.indent(O.localState,N)}else{return A.Pass}}},innerMode:function(N){return{state:N.localState||N.htmlState,mode:N.localMode||B}}}},"xml","javascript","css");A.defineMIME("text/html","htmlmixed")});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:markdown', location = '/static/bower/CodeMirror/mode/markdown/markdown.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"),require("../xml/xml"),require("../meta"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../xml/xml","../meta"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("markdown",function(Y,Z){var P=A.modes.hasOwnProperty("xml");var J=A.getMode(Y,P?{name:"xml",htmlMode:true}:"text/plain");function f(x){if(A.findModeByName){var y=A.findModeByName(x);if(y){x=y.mime||y.mimes[0]}}var z=A.getMode(Y,x);return z.name=="null"?null:z}if(Z.highlightFormatting===undefined){Z.highlightFormatting=false}if(Z.maxBlockquoteDepth===undefined){Z.maxBlockquoteDepth=0}if(Z.underscoresBreakWords===undefined){Z.underscoresBreakWords=true}if(Z.fencedCodeBlocks===undefined){Z.fencedCodeBlocks=false}if(Z.taskLists===undefined){Z.taskLists=false}if(Z.strikethrough===undefined){Z.strikethrough=false}var K=0;var I="header",G="comment",R="quote",q="variable-2",n="variable-3",m="keyword",p="hr",H="tag",U="formatting",Q="link",M="link",g="link",e="string",r="em",a="strong",N="strikethrough";var B=/^([*\-=_])(?:\s*\1){2,}\s*$/,E=/^[*\-+]\s+/,c=/^[0-9]+\.\s+/,T=/^\[(x| )\](?=\s)/,t=/^#+/,w=/^(?:\={1,}|-{1,})$/,b=/^[^#!\[\]*_\\<>` "'(~]+/;function u(z,y,x){y.f=y.inline=x;return x(z,y)}function d(z,y,x){y.f=y.block=x;return x(z,y)}function C(x){x.linkTitle=false;x.em=false;x.strong=false;x.strikethrough=false;x.quote=0;if(!P&&x.f==S){x.f=s;x.block=j}x.trailingSpace=0;x.trailingSpaceNewLine=false;x.thisLineHasContent=false;return null}function j(AC,AB){var AA=AC.sol();var y=(AB.list!==false);if(AB.list!==false&&AB.indentationDiff>=0){if(AB.indentationDiff<4){AB.indentation-=AB.indentationDiff}AB.list=null}else{if(AB.list!==false&&AB.indentation>0){AB.list=null;AB.listDepth=Math.floor(AB.indentation/4)}else{if(AB.list!==false){AB.list=false;AB.listDepth=0}}}var x=null;if(AB.indentationDiff>=4){AB.indentation-=4;AC.skipToEnd();return G}else{if(AC.eatSpace()){return null}else{if(x=AC.match(t)){AB.header=x[0].length<=6?x[0].length:6;if(Z.highlightFormatting){AB.formatting="header"}AB.f=AB.inline;return W(AB)}else{if(AB.prevLineHasContent&&(x=AC.match(w))){AB.header=x[0].charAt(0)=="="?1:2;if(Z.highlightFormatting){AB.formatting="header"}AB.f=AB.inline;return W(AB)}else{if(AC.eat(">")){AB.indentation++;AB.quote=AA?1:AB.quote+1;if(Z.highlightFormatting){AB.formatting="quote"}AC.eatSpace();return W(AB)}else{if(AC.peek()==="["){return u(AC,AB,D)}else{if(AC.match(B,true)){return p}else{if((!AB.prevLineHasContent||y)&&(AC.match(E,false)||AC.match(c,false))){var z=null;if(AC.match(E,true)){z="ul"}else{AC.match(c,true);z="ol"}AB.indentation+=4;AB.list=true;AB.listDepth++;if(Z.taskLists&&AC.match(T,false)){AB.taskList=true}AB.f=AB.inline;if(Z.highlightFormatting){AB.formatting=["list","list-"+z]}return W(AB)}else{if(Z.fencedCodeBlocks&&AC.match(/^```[ \t]*([\w+#]*)/,true)){AB.localMode=f(RegExp.$1);if(AB.localMode){AB.localState=AB.localMode.startState()}AB.f=AB.block=i;if(Z.highlightFormatting){AB.formatting="code-block"}AB.code=true;return W(AB)}}}}}}}}}return u(AC,AB,AB.inline)}function S(z,y){var x=J.token(z,y.htmlState);if((P&&y.htmlState.tagStart===null&&!y.htmlState.context)||(y.md_inside&&z.current().indexOf(">")>-1)){y.f=s;y.block=j;y.htmlState=null}return x}function i(y,x){if(y.sol()&&y.match("```",false)){x.localMode=x.localState=null;x.f=x.block=o;return null}else{if(x.localMode){return x.localMode.token(y,x.localState)}else{y.skipToEnd();return G}}}function o(z,y){z.match("```");y.block=j;y.f=s;if(Z.highlightFormatting){y.formatting="code-block"}y.code=true;var x=W(y);y.code=false;return x}function W(AA){var z=[];if(AA.formatting){z.push(U);if(typeof AA.formatting==="string"){AA.formatting=[AA.formatting]}for(var x=0;x<AA.formatting.length;x++){z.push(U+"-"+AA.formatting[x]);if(AA.formatting[x]==="header"){z.push(U+"-"+AA.formatting[x]+"-"+AA.header)}if(AA.formatting[x]==="quote"){if(!Z.maxBlockquoteDepth||Z.maxBlockquoteDepth>=AA.quote){z.push(U+"-"+AA.formatting[x]+"-"+AA.quote)}else{z.push("error")}}}}if(AA.taskOpen){z.push("meta");return z.length?z.join(" "):null}if(AA.taskClosed){z.push("property");return z.length?z.join(" "):null}if(AA.linkHref){z.push(e);return z.length?z.join(" "):null}if(AA.strong){z.push(a)}if(AA.em){z.push(r)}if(AA.strikethrough){z.push(N)}if(AA.linkText){z.push(g)}if(AA.code){z.push(G)}if(AA.header){z.push(I);z.push(I+"-"+AA.header)}if(AA.quote){z.push(R);if(!Z.maxBlockquoteDepth||Z.maxBlockquoteDepth>=AA.quote){z.push(R+"-"+AA.quote)}else{z.push(R+"-"+Z.maxBlockquoteDepth)}}if(AA.list!==false){var y=(AA.listDepth-1)%3;if(!y){z.push(q)}else{if(y===1){z.push(n)}else{z.push(m)}}}if(AA.trailingSpaceNewLine){z.push("trailing-space-new-line")}else{if(AA.trailingSpace){z.push("trailing-space-"+(AA.trailingSpace%2?"a":"b"))}}return z.length?z.join(" "):null}function O(y,x){if(y.match(b,true)){return W(x)}return undefined}function s(AM,y){var z=y.text(AM,y);if(typeof z!=="undefined"){return z}if(y.list){y.list=null;return W(y)}if(y.taskList){var AC=AM.match(T,true)[1]!=="x";if(AC){y.taskOpen=true}else{y.taskClosed=true}if(Z.highlightFormatting){y.formatting="task"}y.taskList=false;return W(y)}y.taskOpen=false;y.taskClosed=false;if(y.header&&AM.match(/^#+$/,true)){if(Z.highlightFormatting){y.formatting="header"}return W(y)}var AE=AM.sol();var x=AM.next();if(x==="\\"){AM.next();if(Z.highlightFormatting){var AF=W(y);return AF?AF+" formatting-escape":"formatting-escape"}}if(y.linkTitle){y.linkTitle=false;var AI=x;if(x==="("){AI=")"}AI=(AI+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var AH="^\\s*(?:[^"+AI+"\\\\]+|\\\\\\\\|\\\\.)"+AI;if(AM.match(new RegExp(AH),true)){return e}}if(x==="`"){var AK=y.formatting;if(Z.highlightFormatting){y.formatting="code"}var AN=W(y);var AG=AM.pos;AM.eatWhile("`");var AA=1+AM.pos-AG;if(!y.code){K=AA;y.code=true;return W(y)}else{if(AA===K){y.code=false;return AN}y.formatting=AK;return W(y)}}else{if(y.code){return W(y)}}if(x==="!"&&AM.match(/\[[^\]]*\] ?(?:\(|\[)/,false)){AM.match(/\[[^\]]*\]/);y.inline=y.f=X;return H}if(x==="["&&AM.match(/.*\](\(.*\)| ?\[.*\])/,false)){y.linkText=true;if(Z.highlightFormatting){y.formatting="link"}return W(y)}if(x==="]"&&y.linkText&&AM.match(/\(.*\)| ?\[.*\]/,false)){if(Z.highlightFormatting){y.formatting="link"}var AF=W(y);y.linkText=false;y.inline=y.f=X;return AF}if(x==="<"&&AM.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,false)){y.f=y.inline=l;if(Z.highlightFormatting){y.formatting="link"}var AF=W(y);if(AF){AF+=" "}else{AF=""}return AF+Q}if(x==="<"&&AM.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,false)){y.f=y.inline=l;if(Z.highlightFormatting){y.formatting="link"}var AF=W(y);if(AF){AF+=" "}else{AF=""}return AF+M}if(x==="<"&&AM.match(/^\w/,false)){if(AM.string.indexOf(">")!=-1){var AD=AM.string.substring(1,AM.string.indexOf(">"));if(/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(AD)){y.md_inside=true}}AM.backUp(1);y.htmlState=A.startState(J);return d(AM,y,S)}if(x==="<"&&AM.match(/^\/\w*?>/)){y.md_inside=false;return"tag"}var AB=false;if(!Z.underscoresBreakWords){if(x==="_"&&AM.peek()!=="_"&&AM.match(/(\w)/,false)){var AJ=AM.pos-2;if(AJ>=0){var AL=AM.string.charAt(AJ);if(AL!=="_"&&AL.match(/(\w)/,false)){AB=true}}}}if(x==="*"||(x==="_"&&!AB)){if(AE&&AM.peek()===" "){}else{if(y.strong===x&&AM.eat(x)){if(Z.highlightFormatting){y.formatting="strong"}var AN=W(y);y.strong=false;return AN}else{if(!y.strong&&AM.eat(x)){y.strong=x;if(Z.highlightFormatting){y.formatting="strong"}return W(y)}else{if(y.em===x){if(Z.highlightFormatting){y.formatting="em"}var AN=W(y);y.em=false;return AN}else{if(!y.em){y.em=x;if(Z.highlightFormatting){y.formatting="em"}return W(y)}}}}}}else{if(x===" "){if(AM.eat("*")||AM.eat("_")){if(AM.peek()===" "){return W(y)}else{AM.backUp(1)}}}}if(Z.strikethrough){if(x==="~"&&AM.eatWhile(x)){if(y.strikethrough){if(Z.highlightFormatting){y.formatting="strikethrough"}var AN=W(y);y.strikethrough=false;return AN}else{if(AM.match(/^[^\s]/,false)){y.strikethrough=true;if(Z.highlightFormatting){y.formatting="strikethrough"}return W(y)}}}else{if(x===" "){if(AM.match(/^~~/,true)){if(AM.peek()===" "){return W(y)}else{AM.backUp(2)}}}}}if(x===" "){if(AM.match(/ +$/,false)){y.trailingSpace++}else{if(y.trailingSpace){y.trailingSpaceNewLine=true}}}return W(y)}function l(AA,z){var y=AA.next();if(y===">"){z.f=z.inline=s;if(Z.highlightFormatting){z.formatting="link"}var x=W(z);if(x){x+=" "}else{x=""}return x+Q}AA.match(/^[^>]+/,true);return Q}function X(z,y){if(z.eatSpace()){return null}var x=z.next();if(x==="("||x==="["){y.f=y.inline=k(x==="("?")":"]");if(Z.highlightFormatting){y.formatting="link-string"}y.linkHref=true;return W(y)}return"error"}function k(x){return function(AB,AA){var z=AB.next();if(z===x){AA.f=AA.inline=s;if(Z.highlightFormatting){AA.formatting="link-string"}var y=W(AA);AA.linkHref=false;return y}if(AB.match(V(x),true)){AB.backUp(1)}AA.linkHref=true;return W(AA)}}function D(y,x){if(y.match(/^[^\]]*\]:/,false)){x.f=h;y.next();if(Z.highlightFormatting){x.formatting="link"}x.linkText=true;return W(x)}return u(y,x,s)}function h(z,y){if(z.match(/^\]:/,true)){y.f=y.inline=F;if(Z.highlightFormatting){y.formatting="link"}var x=W(y);y.linkText=false;return x}z.match(/^[^\]]+/,true);return g}function F(y,x){if(y.eatSpace()){return null}y.match(/^[^\s]+/,true);if(y.peek()===undefined){x.linkTitle=true}else{y.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,true)}x.f=x.inline=s;return e}var v=[];function V(x){if(!v[x]){x=(x+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");v[x]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+x+")")}return v[x]}var L={startState:function(){return{f:j,prevLineHasContent:false,thisLineHasContent:false,block:j,htmlState:null,indentation:0,inline:s,text:O,formatting:false,linkText:false,linkHref:false,linkTitle:false,em:false,strong:false,header:0,taskList:false,list:false,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:false,strikethrough:false}},copyState:function(x){return{f:x.f,prevLineHasContent:x.prevLineHasContent,thisLineHasContent:x.thisLineHasContent,block:x.block,htmlState:x.htmlState&&A.copyState(J,x.htmlState),indentation:x.indentation,localMode:x.localMode,localState:x.localMode?A.copyState(x.localMode,x.localState):null,inline:x.inline,text:x.text,formatting:false,linkTitle:x.linkTitle,em:x.em,strong:x.strong,strikethrough:x.strikethrough,header:x.header,taskList:x.taskList,list:x.list,listDepth:x.listDepth,quote:x.quote,trailingSpace:x.trailingSpace,trailingSpaceNewLine:x.trailingSpaceNewLine,md_inside:x.md_inside}},token:function(AB,AA){AA.formatting=false;if(AB.sol()){var x=!!AA.header;AA.header=0;if(AB.match(/^\s*$/,true)||x){AA.prevLineHasContent=false;C(AA);return x?this.token(AB,AA):null}else{AA.prevLineHasContent=AA.thisLineHasContent;AA.thisLineHasContent=true}AA.taskList=false;AA.code=false;AA.trailingSpace=0;AA.trailingSpaceNewLine=false;AA.f=AA.block;var y=AB.match(/^\s*/,true)[0].replace(/\t/g," ").length;var AC=Math.floor((y-AA.indentation)/4)*4;if(AC>4){AC=4}var z=AA.indentation+AC;AA.indentationDiff=z-AA.indentation;AA.indentation=z;if(y>0){return null}}return AA.f(AB,AA)},innerMode:function(x){if(x.block==S){return{state:x.htmlState,mode:J}}if(x.localState){return{state:x.localState,mode:x.localMode}}return{state:x,mode:L}},blankLine:C,getType:W,fold:"markdown"};return L},"xml");A.defineMIME("text/x-markdown","markdown")});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:perl', location = '/static/bower/CodeMirror/mode/perl/perl.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("perl",function(){var F={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,"$ARG":5,"$_":5,"@ARG":5,"@_":5,"$LIST_SEPARATOR":5,'$"':5,"$PROCESS_ID":5,"$PID":5,"$$":5,"$REAL_GROUP_ID":5,"$GID":5,"$(":5,"$EFFECTIVE_GROUP_ID":5,"$EGID":5,"$)":5,"$PROGRAM_NAME":5,"$0":5,"$SUBSCRIPT_SEPARATOR":5,"$SUBSEP":5,"$;":5,"$REAL_USER_ID":5,"$UID":5,"$<":5,"$EFFECTIVE_USER_ID":5,"$EUID":5,"$>":5,"$a":5,"$b":5,"$COMPILING":5,"$^C":5,"$DEBUGGING":5,"$^D":5,"${^ENCODING}":5,"$ENV":5,"%ENV":5,"$SYSTEM_FD_MAX":5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,"$INPLACE_EDIT":5,"$^I":5,"$^M":5,"$OSNAME":5,"$^O":5,"${^OPEN}":5,"$PERLDB":5,"$^P":5,"$SIG":5,"%SIG":5,"$BASETIME":5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,"$PERL_VERSION":5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,"$EXECUTABLE_NAME":5,"$^X":5,"$1":5,"$MATCH":5,"$&":5,"${^MATCH}":5,"$PREMATCH":5,"$`":5,"${^PREMATCH}":5,"$POSTMATCH":5,"$'":5,"${^POSTMATCH}":5,"$LAST_PAREN_MATCH":5,"$+":5,"$LAST_SUBMATCH_RESULT":5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,"$LAST_REGEXP_CODE_RESULT":5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,"$ARGV":5,"@ARGV":5,ARGV:5,ARGVOUT:5,"$OUTPUT_FIELD_SEPARATOR":5,"$OFS":5,"$,":5,"$INPUT_LINE_NUMBER":5,"$NR":5,"$.":5,"$INPUT_RECORD_SEPARATOR":5,"$RS":5,"$/":5,"$OUTPUT_RECORD_SEPARATOR":5,"$ORS":5,"$\\":5,"$OUTPUT_AUTOFLUSH":5,"$|":5,"$ACCUMULATOR":5,"$^A":5,"$FORMAT_FORMFEED":5,"$^L":5,"$FORMAT_PAGE_NUMBER":5,"$%":5,"$FORMAT_LINES_LEFT":5,"$-":5,"$FORMAT_LINE_BREAK_CHARACTERS":5,"$:":5,"$FORMAT_LINES_PER_PAGE":5,"$=":5,"$FORMAT_TOP_NAME":5,"$^":5,"$FORMAT_NAME":5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,"$EXTENDED_OS_ERROR":5,"$^E":5,"$EXCEPTIONS_BEING_CAUGHT":5,"$^S":5,"$WARNING":5,"$^W":5,"${^WARNING_BITS}":5,"$OS_ERROR":5,"$ERRNO":5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,"$CHILD_ERROR":5,"$?":5,"$EVAL_ERROR":5,"$@":5,"$OFMT":5,"$#":5,"$*":5,"$ARRAY_BASE":5,"$[":5,"$OLD_PERL_VERSION":5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,"eval":1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null};var J="string-2";var H=/[goseximacplud]/;function G(P,O,M,N,L){O.chain=null;O.style=null;O.tail=null;O.tokenize=function(T,R){var S=false,U,Q=0;while(U=T.next()){if(U===M[Q]&&!S){if(M[++Q]!==undefined){R.chain=M[Q];R.style=N;R.tail=L}else{if(L){T.eatWhile(L)}}R.tokenize=K;return N}S=!S&&U=="\\"}return N};return O.tokenize(P,O)}function I(N,M,L){M.tokenize=function(P,O){if(P.string==L){O.tokenize=K}P.skipToEnd();return"string"};return M.tokenize(N,M)}function K(P,N){if(P.eatSpace()){return null}if(N.chain){return G(P,N,N.chain,N.style,N.tail)}if(P.match(/^\-?[\d\.]/,false)){if(P.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/)){return"number"}}if(P.match(/^<<(?=\w)/)){P.eatWhile(/\w/);return I(P,N,P.current().substr(2))}if(P.sol()&&P.match(/^\=item(?!\w)/)){return I(P,N,"=cut")}var M=P.next();if(M=='"'||M=="'"){if(C(P,3)=="<<"+M){var O=P.pos;P.eatWhile(/\w/);var R=P.current().substr(1);if(R&&P.eat(M)){return I(P,N,R)}P.pos=O}return G(P,N,[M],"string")}if(M=="q"){var Q=B(P,-2);if(!(Q&&/\w/.test(Q))){Q=B(P,0);if(Q=="x"){Q=B(P,1);if(Q=="("){D(P,2);return G(P,N,[")"],J,H)}if(Q=="["){D(P,2);return G(P,N,["]"],J,H)}if(Q=="{"){D(P,2);return G(P,N,["}"],J,H)}if(Q=="<"){D(P,2);return G(P,N,[">"],J,H)}if(/[\^'"!~\/]/.test(Q)){D(P,1);return G(P,N,[P.eat(Q)],J,H)}}else{if(Q=="q"){Q=B(P,1);if(Q=="("){D(P,2);return G(P,N,[")"],"string")}if(Q=="["){D(P,2);return G(P,N,["]"],"string")}if(Q=="{"){D(P,2);return G(P,N,["}"],"string")}if(Q=="<"){D(P,2);return G(P,N,[">"],"string")}if(/[\^'"!~\/]/.test(Q)){D(P,1);return G(P,N,[P.eat(Q)],"string")}}else{if(Q=="w"){Q=B(P,1);if(Q=="("){D(P,2);return G(P,N,[")"],"bracket")}if(Q=="["){D(P,2);return G(P,N,["]"],"bracket")}if(Q=="{"){D(P,2);return G(P,N,["}"],"bracket")}if(Q=="<"){D(P,2);return G(P,N,[">"],"bracket")}if(/[\^'"!~\/]/.test(Q)){D(P,1);return G(P,N,[P.eat(Q)],"bracket")}}else{if(Q=="r"){Q=B(P,1);if(Q=="("){D(P,2);return G(P,N,[")"],J,H)}if(Q=="["){D(P,2);return G(P,N,["]"],J,H)}if(Q=="{"){D(P,2);return G(P,N,["}"],J,H)}if(Q=="<"){D(P,2);return G(P,N,[">"],J,H)}if(/[\^'"!~\/]/.test(Q)){D(P,1);return G(P,N,[P.eat(Q)],J,H)}}else{if(/[\^'"!~\/(\[{<]/.test(Q)){if(Q=="("){D(P,1);return G(P,N,[")"],"string")}if(Q=="["){D(P,1);return G(P,N,["]"],"string")}if(Q=="{"){D(P,1);return G(P,N,["}"],"string")}if(Q=="<"){D(P,1);return G(P,N,[">"],"string")}if(/[\^'"!~\/]/.test(Q)){return G(P,N,[P.eat(Q)],"string")}}}}}}}}if(M=="m"){var Q=B(P,-2);if(!(Q&&/\w/.test(Q))){Q=P.eat(/[(\[{<\^'"!~\/]/);if(Q){if(/[\^'"!~\/]/.test(Q)){return G(P,N,[Q],J,H)}if(Q=="("){return G(P,N,[")"],J,H)}if(Q=="["){return G(P,N,["]"],J,H)}if(Q=="{"){return G(P,N,["}"],J,H)}if(Q=="<"){return G(P,N,[">"],J,H)}}}}if(M=="s"){var Q=/[\/>\]})\w]/.test(B(P,-2));if(!Q){Q=P.eat(/[(\[{<\^'"!~\/]/);if(Q){if(Q=="["){return G(P,N,["]","]"],J,H)}if(Q=="{"){return G(P,N,["}","}"],J,H)}if(Q=="<"){return G(P,N,[">",">"],J,H)}if(Q=="("){return G(P,N,[")",")"],J,H)}return G(P,N,[Q,Q],J,H)}}}if(M=="y"){var Q=/[\/>\]})\w]/.test(B(P,-2));if(!Q){Q=P.eat(/[(\[{<\^'"!~\/]/);if(Q){if(Q=="["){return G(P,N,["]","]"],J,H)}if(Q=="{"){return G(P,N,["}","}"],J,H)}if(Q=="<"){return G(P,N,[">",">"],J,H)}if(Q=="("){return G(P,N,[")",")"],J,H)}return G(P,N,[Q,Q],J,H)}}}if(M=="t"){var Q=/[\/>\]})\w]/.test(B(P,-2));if(!Q){Q=P.eat("r");if(Q){Q=P.eat(/[(\[{<\^'"!~\/]/);if(Q){if(Q=="["){return G(P,N,["]","]"],J,H)}if(Q=="{"){return G(P,N,["}","}"],J,H)}if(Q=="<"){return G(P,N,[">",">"],J,H)}if(Q=="("){return G(P,N,[")",")"],J,H)}return G(P,N,[Q,Q],J,H)}}}}if(M=="`"){return G(P,N,[M],"variable-2")}if(M=="/"){if(!/~\s*$/.test(C(P))){return"operator"}else{return G(P,N,[M],J,H)}}if(M=="$"){var O=P.pos;if(P.eatWhile(/\d/)||P.eat("{")&&P.eatWhile(/\d/)&&P.eat("}")){return"variable-2"}else{P.pos=O}}if(/[$@%]/.test(M)){var O=P.pos;if(P.eat("^")&&P.eat(/[A-Z]/)||!/[@$%&]/.test(B(P,-2))&&P.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var Q=P.current();if(F[Q]){return"variable-2"}}P.pos=O}if(/[$@%&]/.test(M)){if(P.eatWhile(/[\w$\[\]]/)||P.eat("{")&&P.eatWhile(/[\w$\[\]]/)&&P.eat("}")){var Q=P.current();if(F[Q]){return"variable-2"}else{return"variable"}}}if(M=="#"){if(B(P,-2)!="$"){P.skipToEnd();return"comment"}}if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(M)){var O=P.pos;P.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);if(F[P.current()]){return"operator"}else{P.pos=O}}if(M=="_"){if(P.pos==1){if(E(P,6)=="_END__"){return G(P,N,["\0"],"comment")}else{if(E(P,7)=="_DATA__"){return G(P,N,["\0"],"variable-2")}else{if(E(P,7)=="_C__"){return G(P,N,["\0"],"string")}}}}}if(/\w/.test(M)){var O=P.pos;if(B(P,-2)=="{"&&(B(P,0)=="}"||P.eatWhile(/\w/)&&B(P,0)=="}")){return"string"}else{P.pos=O}}if(/[A-Z]/.test(M)){var L=B(P,-2);var O=P.pos;P.eatWhile(/[A-Z_]/);if(/[\da-z]/.test(B(P,0))){P.pos=O}else{var Q=F[P.current()];if(!Q){return"meta"}if(Q[1]){Q=Q[0]}if(L!=":"){if(Q==1){return"keyword"}else{if(Q==2){return"def"}else{if(Q==3){return"atom"}else{if(Q==4){return"operator"}else{if(Q==5){return"variable-2"}else{return"meta"}}}}}}else{return"meta"}}}if(/[a-zA-Z_]/.test(M)){var L=B(P,-2);P.eatWhile(/\w/);var Q=F[P.current()];if(!Q){return"meta"}if(Q[1]){Q=Q[0]}if(L!=":"){if(Q==1){return"keyword"}else{if(Q==2){return"def"}else{if(Q==3){return"atom"}else{if(Q==4){return"operator"}else{if(Q==5){return"variable-2"}else{return"meta"}}}}}}else{return"meta"}}return null}return{startState:function(){return{tokenize:K,chain:null,style:null,tail:null}},token:function(M,L){return(L.tokenize||K)(M,L)},lineComment:"#"}});A.registerHelper("wordChars","perl",/[\w$]/);A.defineMIME("text/x-perl","perl");function B(F,G){return F.string.charAt(F.pos+(G||0))}function C(G,H){if(H){var F=G.pos-H;return G.string.substr((F>=0?F:0),H)}else{return G.string.substr(0,G.pos-1)}}function E(G,I){var H=G.string.length;var F=H-G.pos+1;return G.string.substr(G.pos,(I&&I<H?I:F))}function D(G,I){var F=G.pos+I;var H;if(F<=0){G.pos=0}else{if(F>=(H=G.string.length-1)){G.pos=H}else{G.pos=F}}}});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:php', location = '/static/bower/CodeMirror/mode/php/php.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],A)}else{A(CodeMirror)}}})(function(C){function E(M){var K={},L=M.split(" ");for(var J=0;J<L.length;++J){K[L[J]]=true}return K}function D(K,J){if(K.length==0){return G(J)}return function(O,N){var M=K[0];for(var L=0;L<M.length;L++){if(O.match(M[L][0])){N.tokenize=D(K.slice(1),J);return M[L][1]}}N.tokenize=G(J);return"string"}}function G(J){return function(L,K){return A(L,K,J)}}function A(M,K,J){if(M.match("${",false)||M.match("{$",false)){K.tokenize=null;return"string"}if(M.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)){if(M.match("[",false)){K.tokenize=D([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],J)}if(M.match(/\-\>\w/,false)){K.tokenize=D([[["->",null]],[[/[\w]+/,"variable"]]],J)}return"variable-2"}var L=false;while(!M.eol()&&(L||(!M.match("{$",false)&&!M.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,false)))){if(!L&&M.match(J)){K.tokenize=null;K.tokStack.pop();K.tokStack.pop();break}L=M.next()=="\\"&&!L}return"string"}var H="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally";var I="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__";var B="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";C.registerHelper("hintWords","php",[H,I,B].join(" ").split(" "));C.registerHelper("wordChars","php",/[\w$]/);var F={name:"clike",helperType:"php",keywords:E(H),blockKeywords:E("catch do else elseif for foreach if switch try while finally"),atoms:E(I),builtin:E(B),multiLineStrings:true,hooks:{"$":function(J){J.eatWhile(/[\w\$_]/);return"variable-2"},"<":function(L,J){if(L.match(/<</)){L.eatWhile(/[\w\.]/);var K=L.current().slice(3);if(K){(J.tokStack||(J.tokStack=[])).push(K,0);J.tokenize=G(K);return"string"}}return false},"#":function(J){while(!J.eol()&&!J.match("?>",false)){J.next()}return"comment"},"/":function(J){if(J.eat("/")){while(!J.eol()&&!J.match("?>",false)){J.next()}return"comment"}return false},'"':function(J,K){(K.tokStack||(K.tokStack=[])).push('"',0);K.tokenize=G('"');return"string"},"{":function(J,K){if(K.tokStack&&K.tokStack.length){K.tokStack[K.tokStack.length-1]++}return false},"}":function(J,K){if(K.tokStack&&K.tokStack.length>0&&!--K.tokStack[K.tokStack.length-1]){K.tokenize=G(K.tokStack[K.tokStack.length-2])}return false}}};C.defineMode("php",function(L,M){var N=C.getMode(L,"text/html");var J=C.getMode(L,F);function K(U,S){var R=S.curMode==J;if(U.sol()&&S.pending&&S.pending!='"'&&S.pending!="'"){S.pending=null}if(!R){if(U.match(/^<\?\w*/)){S.curMode=J;S.curState=S.php;return"meta"}if(S.pending=='"'||S.pending=="'"){while(!U.eol()&&U.next()!=S.pending){}var Q="string"}else{if(S.pending&&U.pos<S.pending.end){U.pos=S.pending.end;var Q=S.pending.style}else{var Q=N.token(U,S.curState)}}if(S.pending){S.pending=null}var T=U.current(),P=T.search(/<\?/),O;if(P!=-1){if(Q=="string"&&(O=T.match(/[\'\"]$/))&&!/\?>/.test(T)){S.pending=O[0]}else{S.pending={end:U.pos,style:Q}}U.backUp(T.length-P)}return Q}else{if(R&&S.php.tokenize==null&&U.match("?>")){S.curMode=N;S.curState=S.html;return"meta"}else{return J.token(U,S.curState)}}}return{startState:function(){var O=C.startState(N),P=C.startState(J);return{html:O,php:P,curMode:M.startOpen?J:N,curState:M.startOpen?P:O,pending:null}},copyState:function(R){var P=R.html,Q=C.copyState(N,P),T=R.php,O=C.copyState(J,T),S;if(R.curMode==N){S=Q}else{S=O}return{html:Q,php:O,curMode:R.curMode,curState:S,pending:R.pending}},token:K,indent:function(P,O){if((P.curMode!=J&&/^\s*<\//.test(O))||(P.curMode==J&&/^\?>/.test(O))){return N.indent(P.html,O)}return P.curMode.indent(P.curState,O)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(O){return{state:O.curState,mode:O.curMode}}}},"htmlmixed","clike");C.defineMIME("application/x-httpd-php","php");C.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:true});C.defineMIME("text/x-php",F)});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:python', location = '/static/bower/CodeMirror/mode/python/python.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(C){function E(J){return new RegExp("^(("+J.join(")|(")+"))\\b")}var H=E(["and","or","not","is"]);var I=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"];var D=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];var B={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]};var A={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};C.registerHelper("hintWords","python",I.concat(D));function G(J){return J.scopes[J.scopes.length-1]}C.defineMode("python",function(S,b){var K="error";var W=b.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]");var J=b.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");var Q=b.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");var c=b.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(b.version&&parseInt(b.version,10)==3){var V=b.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]");var P=b.identifiers||new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*")}else{var V=b.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");var P=b.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*")}var L=b.hangingIndent||S.indentUnit;var a=I,X=D;if(b.extra_keywords!=undefined){a=a.concat(b.extra_keywords)}if(b.extra_builtins!=undefined){X=X.concat(b.extra_builtins)}if(b.version&&parseInt(b.version,10)==3){a=a.concat(A.keywords);X=X.concat(A.builtins);var T=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{a=a.concat(B.keywords);X=X.concat(B.builtins);var T=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var R=E(a);var M=E(X);function e(j,i){if(j.sol()&&G(i).type=="py"){var f=G(i).offset;if(j.eatSpace()){var g=j.indentation();if(g>f){U(j,i,"py")}else{if(g<f&&N(j,i)){i.errorToken=true}}return null}else{var h=Y(j,i);if(f>0&&N(j,i)){h+=" "+K}return h}}return Y(j,i)}function Y(j,i){if(j.eatSpace()){return null}var h=j.peek();if(h=="#"){j.skipToEnd();return"comment"}if(j.match(/^[0-9\.]/,false)){var g=false;if(j.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)){g=true}if(j.match(/^\d+\.\d*/)){g=true}if(j.match(/^\.\d+/)){g=true}if(g){j.eat(/J/i);return"number"}var f=false;if(j.match(/^0x[0-9a-f]+/i)){f=true}if(j.match(/^0b[01]+/i)){f=true}if(j.match(/^0o[0-7]+/i)){f=true}if(j.match(/^[1-9]\d*(e[\+\-]?\d+)?/)){j.eat(/J/i);f=true}if(j.match(/^0(?![\dx])/i)){f=true}if(f){j.eat(/L/i);return"number"}}if(j.match(T)){i.tokenize=Z(j.current());return i.tokenize(j,i)}if(j.match(c)||j.match(Q)){return null}if(j.match(J)||j.match(V)||j.match(H)){return"operator"}if(j.match(W)){return null}if(j.match(R)){return"keyword"}if(j.match(M)){return"builtin"}if(j.match(/^(self|cls)\b/)){return"variable-2"}if(j.match(P)){if(i.lastToken=="def"||i.lastToken=="class"){return"def"}return"variable"}j.next();return K}function Z(f){while("rub".indexOf(f.charAt(0).toLowerCase())>=0){f=f.substr(1)}var h=f.length==1;var g="string";function i(k,j){while(!k.eol()){k.eatWhile(/[^'"\\]/);if(k.eat("\\")){k.next();if(h&&k.eol()){return g}}else{if(k.match(f)){j.tokenize=e;return g}else{k.eat(/['"]/)}}}if(h){if(b.singleLineStringErrors){return K}else{j.tokenize=e}}return g}i.isString=true;return i}function U(i,g,f){var h=0,j=null;if(f=="py"){while(G(g).type!="py"){g.scopes.pop()}}h=G(g).offset+(f=="py"?S.indentUnit:L);if(f!="py"&&!i.match(/^(\s|#.*)*$/,false)){j=i.column()+1}g.scopes.push({offset:h,type:f,align:j})}function N(g,f){var h=g.indentation();while(G(f).offset>h){if(G(f).type!="py"){return true}f.scopes.pop()}return G(f).offset!=h}function d(j,h){var g=h.tokenize(j,h);var i=j.current();if(i=="."){g=j.match(P,false)?null:K;if(g==null&&h.lastStyle=="meta"){g="meta"}return g}if(i=="@"){if(b.version&&parseInt(b.version,10)==3){return j.match(P,false)?"meta":"operator"}else{return j.match(P,false)?"meta":K}}if((g=="variable"||g=="builtin")&&h.lastStyle=="meta"){g="meta"}if(i=="pass"||i=="return"){h.dedent+=1}if(i=="lambda"){h.lambda=true}if(i==":"&&!h.lambda&&G(h).type=="py"){U(j,h,"py")}var f=i.length==1?"[({".indexOf(i):-1;if(f!=-1){U(j,h,"])}".slice(f,f+1))}f="])}".indexOf(i);if(f!=-1){if(G(h).type==i){h.scopes.pop()}else{return K}}if(h.dedent>0&&j.eol()&&G(h).type=="py"){if(h.scopes.length>1){h.scopes.pop()}h.dedent-=1}return g}var O={startState:function(f){return{tokenize:e,scopes:[{offset:f||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:false,dedent:0}},token:function(j,g){var i=g.errorToken;if(i){g.errorToken=false}var f=d(j,g);g.lastStyle=f;var h=j.current();if(h&&f){g.lastToken=h}if(j.eol()&&g.lambda){g.lambda=false}return i?f+" "+K:f},indent:function(i,f){if(i.tokenize!=e){return i.tokenize.isString?C.Pass:0}var h=G(i);var g=f&&f.charAt(0)==h.type;if(h.align!=null){return h.align-(g?1:0)}else{if(g&&i.scopes.length>1){return i.scopes[i.scopes.length-2].offset}else{return h.offset}}},lineComment:"#",fold:"indent"};return O});C.defineMIME("text/x-python","python");var F=function(J){return J.split(" ")};C.defineMIME("text/x-cython",{name:"python",extra_keywords:F("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:ruby', location = '/static/bower/CodeMirror/mode/ruby/ruby.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("ruby",function(F){function B(S){var R={};for(var P=0,Q=S.length;P<Q;++P){R[S[P]]=true}return R}var K=B(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]);var J=B(["def","class","case","for","while","module","then","catch","loop","proc","begin"]);var E=B(["end","until"]);var D={"[":"]","{":"}","(":")"};var M;function C(P,R,Q){Q.tokenize.push(P);return P(R,Q)}function G(a,R){M=null;if(a.sol()&&a.match("=begin")&&a.eol()){R.tokenize.push(L);return"comment"}if(a.eatSpace()){return null}var P=a.next(),U;if(P=="`"||P=="'"||P=='"'){return C(N(P,"string",P=='"'||P=="`"),a,R)}else{if(P=="/"){var X=a.current().length;if(a.skipTo("/")){var V=a.current().length;a.backUp(a.current().length-X);var T=0;while(a.current().length<V){var Z=a.next();if(Z=="("){T+=1}else{if(Z==")"){T-=1}}if(T<0){break}}a.backUp(a.current().length-X);if(T==0){return C(N(P,"string-2",true),a,R)}}return"operator"}else{if(P=="%"){var Q="string",W=true;if(a.eat("s")){Q="atom"}else{if(a.eat(/[WQ]/)){Q="string"}else{if(a.eat(/[r]/)){Q="string-2"}else{if(a.eat(/[wxq]/)){Q="string";W=false}}}}var S=a.eat(/[^\w\s=]/);if(!S){return"operator"}if(D.propertyIsEnumerable(S)){S=D[S]}return C(N(S,Q,W,true),a,R)}else{if(P=="#"){a.skipToEnd();return"comment"}else{if(P=="<"&&(U=a.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))){return C(I(U[1]),a,R)}else{if(P=="0"){if(a.eat("x")){a.eatWhile(/[\da-fA-F]/)}else{if(a.eat("b")){a.eatWhile(/[01]/)}else{a.eatWhile(/[0-7]/)}}return"number"}else{if(/\d/.test(P)){a.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);return"number"}else{if(P=="?"){while(a.match(/^\\[CM]-/)){}if(a.eat("\\")){a.eatWhile(/\w/)}else{a.next()}return"string"}else{if(P==":"){if(a.eat("'")){return C(N("'","atom",false),a,R)}if(a.eat('"')){return C(N('"',"atom",true),a,R)}if(a.eat(/[\<\>]/)){a.eat(/[\<\>]/);return"atom"}if(a.eat(/[\+\-\*\/\&\|\:\!]/)){return"atom"}if(a.eat(/[a-zA-Z$@_\xa1-\uffff]/)){a.eatWhile(/[\w$\xa1-\uffff]/);a.eat(/[\?\!\=]/);return"atom"}return"operator"}else{if(P=="@"&&a.match(/^@?[a-zA-Z_\xa1-\uffff]/)){a.eat("@");a.eatWhile(/[\w\xa1-\uffff]/);return"variable-2"}else{if(P=="$"){if(a.eat(/[a-zA-Z_]/)){a.eatWhile(/[\w]/)}else{if(a.eat(/\d/)){a.eat(/\d/)}else{a.next()}}return"variable-3"}else{if(/[a-zA-Z_\xa1-\uffff]/.test(P)){a.eatWhile(/[\w\xa1-\uffff]/);a.eat(/[\?\!]/);if(a.eat(":")){return"atom"}return"ident"}else{if(P=="|"&&(R.varList||R.lastTok=="{"||R.lastTok=="do")){M="|";return null}else{if(/[\(\)\[\]{}\\;]/.test(P)){M=P;return null}else{if(P=="-"&&a.eat(">")){return"arrow"}else{if(/[=+\-\/*:\.^%<>~|]/.test(P)){var Y=a.eatWhile(/[=+\-\/*:\.^%<>~|]/);if(P=="."&&!Y){M="."}return"operator"}else{return null}}}}}}}}}}}}}}}}}function O(P){if(!P){P=1}return function(R,Q){if(R.peek()=="}"){if(P==1){Q.tokenize.pop();return Q.tokenize[Q.tokenize.length-1](R,Q)}else{Q.tokenize[Q.tokenize.length-1]=O(P-1)}}else{if(R.peek()=="{"){Q.tokenize[Q.tokenize.length-1]=O(P+1)}}return G(R,Q)}}function H(){var P=false;return function(R,Q){if(P){Q.tokenize.pop();return Q.tokenize[Q.tokenize.length-1](R,Q)}P=true;return G(R,Q)}}function N(P,Q,S,R){return function(W,U){var V=false,T;if(U.context.type==="read-quoted-paused"){U.context=U.context.prev;W.eat("}")}while((T=W.next())!=null){if(T==P&&(R||!V)){U.tokenize.pop();break}if(S&&T=="#"&&!V){if(W.eat("{")){if(P=="}"){U.context={prev:U.context,type:"read-quoted-paused"}}U.tokenize.push(O());break}else{if(/[@\$]/.test(W.peek())){U.tokenize.push(H());break}}}V=!V&&T=="\\"}return Q}}function I(P){return function(R,Q){if(R.match(P)){Q.tokenize.pop()}else{R.skipToEnd()}return"string"}}function L(Q,P){if(Q.sol()&&Q.match("=end")&&Q.eol()){P.tokenize.pop()}Q.skipToEnd();return"comment"}return{startState:function(){return{tokenize:[G],indented:0,context:{type:"top",indented:-F.indentUnit},continuedLine:false,lastTok:null,varList:false}},token:function(U,R){if(U.sol()){R.indented=U.indentation()}var Q=R.tokenize[R.tokenize.length-1](U,R),T;var P=M;if(Q=="ident"){var S=U.current();Q=R.lastTok=="."?"property":K.propertyIsEnumerable(U.current())?"keyword":/^[A-Z]/.test(S)?"tag":(R.lastTok=="def"||R.lastTok=="class"||R.varList)?"def":"variable";if(Q=="keyword"){P=S;if(J.propertyIsEnumerable(S)){T="indent"}else{if(E.propertyIsEnumerable(S)){T="dedent"}else{if((S=="if"||S=="unless")&&U.column()==U.indentation()){T="indent"}else{if(S=="do"&&R.context.indented<R.indented){T="indent"}}}}}}if(M||(Q&&Q!="comment")){R.lastTok=P}if(M=="|"){R.varList=!R.varList}if(T=="indent"||/[\(\[\{]/.test(M)){R.context={prev:R.context,type:M||Q,indented:R.indented}}else{if((T=="dedent"||/[\)\]\}]/.test(M))&&R.context.prev){R.context=R.context.prev}}if(U.eol()){R.continuedLine=(M=="\\"||Q=="operator")}return Q},indent:function(T,P){if(T.tokenize[T.tokenize.length-1]!=G){return 0}var S=P&&P.charAt(0);var R=T.context;var Q=R.type==D[S]||R.type=="keyword"&&/^(?:end|until|else|elsif|when|rescue)\b/.test(P);return R.indented+(Q?0:F.indentUnit)+(T.continuedLine?F.indentUnit:0)},electricChars:"}de",lineComment:"#"}});A.defineMIME("text/x-ruby","ruby")});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:sass', location = '/static/bower/CodeMirror/mode/sass/sass.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("sass",function(F){function P(Q){return new RegExp("^"+Q.join("|"))}var K=["true","false","null","auto"];var B=new RegExp("^"+K.join("|"));var I=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"];var N=P(I);var O=/^::?[a-zA-Z_][\w\-]*/;function M(S,R){var Q=S.peek();if(Q===")"){S.next();R.tokenizer=G;return"operator"}else{if(Q==="("){S.next();S.eatSpace();return"operator"}else{if(Q==="'"||Q==='"'){R.tokenizer=H(S.next());return"string"}else{R.tokenizer=H(")",false);return"string"}}}}function L(Q,R){return function(T,S){if(T.sol()&&T.indentation()<=Q){S.tokenizer=G;return G(T,S)}if(R&&T.skipTo("*/")){T.next();T.next();S.tokenizer=G}else{T.skipToEnd()}return"comment"}}function H(Q,S){if(S==null){S=true}function R(X,U){var W=X.next();var T=X.peek();var Y=X.string.charAt(X.pos-2);var V=((W!=="\\"&&T===Q)||(W===Q&&Y!=="\\"));if(V){if(W!==Q&&S){X.next()}U.tokenizer=G;return"string"}else{if(W==="#"&&T==="{"){U.tokenizer=D(R);X.next();return"operator"}else{return"string"}}}return R}function D(Q){return function(S,R){if(S.peek()==="}"){S.next();R.tokenizer=Q;return"operator"}else{return G(S,R)}}}function E(R){if(R.indentCount==0){R.indentCount++;var S=R.scopes[0].offset;var Q=S+F.indentUnit;R.scopes.unshift({offset:Q})}}function J(Q){if(Q.scopes.length==1){return }Q.scopes.shift()}function G(S,R){var Q=S.peek();if(S.match("/*")){R.tokenizer=L(S.indentation(),true);return R.tokenizer(S,R)}if(S.match("//")){R.tokenizer=L(S.indentation(),false);return R.tokenizer(S,R)}if(S.match("#{")){R.tokenizer=D(G);return"operator"}if(Q==='"'||Q==="'"){S.next();R.tokenizer=H(Q);return"string"}if(!R.cursorHalf){if(Q==="."){S.next();if(S.match(/^[\w-]+/)){E(R);return"atom"}else{if(S.peek()==="#"){E(R);return"atom"}}}if(Q==="#"){S.next();if(S.match(/^[\w-]+/)){E(R);return"atom"}if(S.peek()==="#"){E(R);return"atom"}}if(Q==="$"){S.next();S.eatWhile(/[\w-]/);return"variable-2"}if(S.match(/^-?[0-9\.]+/)){return"number"}if(S.match(/^(px|em|in)\b/)){return"unit"}if(S.match(B)){return"keyword"}if(S.match(/^url/)&&S.peek()==="("){R.tokenizer=M;return"atom"}if(Q==="="){if(S.match(/^=[\w-]+/)){E(R);return"meta"}}if(Q==="+"){if(S.match(/^\+[\w-]+/)){return"variable-3"}}if(Q==="@"){if(S.match(/@extend/)){if(!S.match(/\s*[\w]/)){J(R)}}}if(S.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)){E(R);return"meta"}if(Q==="@"){S.next();S.eatWhile(/[\w-]/);return"meta"}if(S.eatWhile(/[\w-]/)){if(S.match(/ *: *[\w-\+\$#!\("']/,false)){return"propery"}else{if(S.match(/ *:/,false)){E(R);R.cursorHalf=1;return"atom"}else{if(S.match(/ *,/,false)){return"atom"}else{E(R);return"atom"}}}}if(Q===":"){if(S.match(O)){return"keyword"}S.next();R.cursorHalf=1;return"operator"}}else{if(Q==="#"){S.next();if(S.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){if(!S.peek()){R.cursorHalf=0}return"number"}}if(S.match(/^-?[0-9\.]+/)){if(!S.peek()){R.cursorHalf=0}return"number"}if(S.match(/^(px|em|in)\b/)){if(!S.peek()){R.cursorHalf=0}return"unit"}if(S.match(B)){if(!S.peek()){R.cursorHalf=0}return"keyword"}if(S.match(/^url/)&&S.peek()==="("){R.tokenizer=M;if(!S.peek()){R.cursorHalf=0}return"atom"}if(Q==="$"){S.next();S.eatWhile(/[\w-]/);if(!S.peek()){R.cursorHalf=0}return"variable-3"}if(Q==="!"){S.next();if(!S.peek()){R.cursorHalf=0}return S.match(/^[\w]+/)?"keyword":"operator"}if(S.match(N)){if(!S.peek()){R.cursorHalf=0}return"operator"}if(S.eatWhile(/[\w-]/)){if(!S.peek()){R.cursorHalf=0}return"attribute"}if(!S.peek()){R.cursorHalf=0;return null}}if(S.match(N)){return"operator"}S.next();return null}function C(X,R){if(X.sol()){R.indentCount=0}var S=R.tokenizer(X,R);var W=X.current();if(W==="@return"||W==="}"){J(R)}if(S!==null){var T=X.pos-W.length;var V=T+(F.indentUnit*R.indentCount);var Q=[];for(var U=0;U<R.scopes.length;U++){var Y=R.scopes[U];if(Y.offset<=V){Q.push(Y)}}R.scopes=Q}return S}return{startState:function(){return{tokenizer:G,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(S,R){var Q=C(S,R);R.lastToken={style:Q,content:S.current()};return Q},indent:function(Q){return Q.scopes[0].offset}}});A.defineMIME("text/x-sass","sass")});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:shell', location = '/static/bower/CodeMirror/mode/shell/shell.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("shell",function(){var E={};function G(K,H){var J=H.split(" ");for(var I=0;I<J.length;I++){E[J[I]]=K}}G("atom","true false");G("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function");G("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");function F(L,J){if(L.eatSpace()){return null}var I=L.sol();var H=L.next();if(H==="\\"){L.next();return null}if(H==="'"||H==='"'||H==="`"){J.tokens.unshift(C(H));return D(L,J)}if(H==="#"){if(I&&L.eat("!")){L.skipToEnd();return"meta"}L.skipToEnd();return"comment"}if(H==="$"){J.tokens.unshift(B);return D(L,J)}if(H==="+"||H==="="){return"operator"}if(H==="-"){L.eat("-");L.eatWhile(/\w/);return"attribute"}if(/\d/.test(H)){L.eatWhile(/\d/);if(L.eol()||!/\w/.test(L.peek())){return"number"}}L.eatWhile(/[\w-]/);var K=L.current();if(L.peek()==="="&&/\w+/.test(K)){return"def"}return E.hasOwnProperty(K)?E[K]:null}function C(H){return function(M,K){var J,I=false,L=false;while((J=M.next())!=null){if(J===H&&!L){I=true;break}if(J==="$"&&!L&&H!=="'"){L=true;M.backUp(1);K.tokens.unshift(B);break}L=!L&&J==="\\"}if(I||!L){K.tokens.shift()}return(H==="`"||H===")"?"quote":"string")}}var B=function(K,I){if(I.tokens.length>1){K.eat("$")}var H=K.next(),J=/\w/;if(H==="{"){J=/[^}]/}if(H==="("){I.tokens[0]=C(")");return D(K,I)}if(!/\d/.test(H)){K.eatWhile(J);K.eat("}")}I.tokens.shift();return"def"};function D(I,H){return(H.tokens[0]||F)(I,H)}return{startState:function(){return{tokens:[]}},token:function(I,H){return D(I,H)},lineComment:"#",fold:"brace"}});A.defineMIME("text/x-sh","shell")});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:sql', location = '/static/bower/CodeMirror/mode/sql/sql.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("sql",function(C,F){var D=F.client||{},I=F.atoms||{"false":true,"true":true,"null":true},M=F.builtin||{},G=F.keywords||{},H=F.operatorChars||/^[*+\-%<>!=&|~^]/,N=F.support||{},P=F.hooks||{},B=F.dateSQL||{date:true,time:true,timestamp:true};function E(U,S){var R=U.next();if(P[R]){var Q=P[R](U,S);if(Q!==false){return Q}}if(N.hexNumber==true&&((R=="0"&&U.match(/^[xX][0-9a-fA-F]+/))||(R=="x"||R=="X")&&U.match(/^'[0-9a-fA-F]+'/))){return"number"}else{if(N.binaryNumber==true&&(((R=="b"||R=="B")&&U.match(/^'[01]+'/))||(R=="0"&&U.match(/^b[01]+/)))){return"number"}else{if(R.charCodeAt(0)>47&&R.charCodeAt(0)<58){U.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/);N.decimallessFloat==true&&U.eat(".");return"number"}else{if(R=="?"&&(U.eatSpace()||U.eol()||U.eat(";"))){return"variable-3"}else{if(R=="'"||(R=='"'&&N.doubleQuote)){S.tokenize=O(R);return S.tokenize(U,S)}else{if((((N.nCharCast==true&&(R=="n"||R=="N"))||(N.charsetCast==true&&R=="_"&&U.match(/[a-z][a-z0-9]*/i)))&&(U.peek()=="'"||U.peek()=='"'))){return"keyword"}else{if(/^[\(\),\;\[\]]/.test(R)){return null}else{if(N.commentSlashSlash&&R=="/"&&U.eat("/")){U.skipToEnd();return"comment"}else{if((N.commentHash&&R=="#")||(R=="-"&&U.eat("-")&&(!N.commentSpaceRequired||U.eat(" ")))){U.skipToEnd();return"comment"}else{if(R=="/"&&U.eat("*")){S.tokenize=K;return S.tokenize(U,S)}else{if(R=="."){if(N.zerolessFloat==true&&U.match(/^(?:\d+(?:e[+-]?\d+)?)/i)){return"number"}if(N.ODBCdotTable==true&&U.match(/^[a-zA-Z_]+/)){return"variable-2"}}else{if(H.test(R)){U.eatWhile(H);return null}else{if(R=="{"&&(U.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||U.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))){return"number"}else{U.eatWhile(/^[_\w\d]/);var T=U.current().toLowerCase();if(B.hasOwnProperty(T)&&(U.match(/^( )+'[^']*'/)||U.match(/^( )+"[^"]*"/))){return"number"}if(I.hasOwnProperty(T)){return"atom"}if(M.hasOwnProperty(T)){return"builtin"}if(G.hasOwnProperty(T)){return"keyword"}if(D.hasOwnProperty(T)){return"string-2"}return null}}}}}}}}}}}}}}function O(Q){return function(U,S){var T=false,R;while((R=U.next())!=null){if(R==Q&&!T){S.tokenize=E;break}T=!T&&R=="\\"}return"string"}}function K(R,Q){while(true){if(R.skipTo("*")){R.next();if(R.eat("/")){Q.tokenize=E;break}}else{R.skipToEnd();break}}return"comment"}function J(S,R,Q){R.context={prev:R.context,indent:S.indentation(),col:S.column(),type:Q}}function L(Q){Q.indent=Q.context.indent;Q.context=Q.context.prev}return{startState:function(){return{tokenize:E,context:null}},token:function(T,S){if(T.sol()){if(S.context&&S.context.align==null){S.context.align=false}}if(T.eatSpace()){return null}var R=S.tokenize(T,S);if(R=="comment"){return R}if(S.context&&S.context.align==null){S.context.align=true}var Q=T.current();if(Q=="("){J(T,S,")")}else{if(Q=="["){J(T,S,"]")}else{if(S.context&&S.context.type==Q){L(S)}}}return R},indent:function(T,R){var Q=T.context;if(!Q){return 0}var S=R.charAt(0)==Q.type;if(Q.align){return Q.col+(S?0:1)}else{return Q.indent+(S?0:C.indentUnit)}},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:N.commentSlashSlash?"//":N.commentHash?"#":null}});(function(){function C(H){var G;while((G=H.next())!=null){if(G=="`"&&!H.eat("`")){return"variable-2"}}H.backUp(H.current().length-1);return H.eatWhile(/\w/)?"variable-2":null}function B(G){if(G.eat("@")){G.match(/^session\./);G.match(/^local\./);G.match(/^global\./)}if(G.eat("'")){G.match(/^.*'/);return"variable-2"}else{if(G.eat('"')){G.match(/^.*"/);return"variable-2"}else{if(G.eat("`")){G.match(/^.*`/);return"variable-2"}else{if(G.match(/^[0-9a-zA-Z$\.\_]+/)){return"variable-2"}}}}return null}function D(G){if(G.eat("N")){return"atom"}return G.match(/^[a-zA-Z.#!?]/)?"variable-2":null}var E="alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where ";function F(J){var H={},I=J.split(" ");for(var G=0;G<I.length;++G){H[I[G]]=true}return H}A.defineMIME("text/x-sql",{name:"sql",keywords:F(E+"begin"),builtin:F("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),atoms:F("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:F("date time timestamp"),support:F("ODBCdotTable doubleQuote binaryNumber hexNumber")});A.defineMIME("text/x-mssql",{name:"sql",client:F("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:F(E+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),builtin:F("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:F("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:F("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":B}});A.defineMIME("text/x-mysql",{name:"sql",client:F("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:F(E+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:F("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:F("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:F("date time timestamp"),support:F("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":B,"`":C,"\\":D}});A.defineMIME("text/x-mariadb",{name:"sql",client:F("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:F(E+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:F("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:F("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:F("date time timestamp"),support:F("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":B,"`":C,"\\":D}});A.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:F("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),builtin:F("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),atoms:F("false true"),operatorChars:/^[<>=]/,dateSQL:{},support:F("commentSlashSlash decimallessFloat"),hooks:{}});A.defineMIME("text/x-plsql",{name:"sql",client:F("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:F("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:F("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:F("date time timestamp"),support:F("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")});A.defineMIME("text/x-hive",{name:"sql",keywords:F("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:F("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:F("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:F("date timestamp"),support:F("ODBCdotTable doubleQuote binaryNumber hexNumber")})}())});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:vbscript', location = '/static/bower/CodeMirror/mode/vbscript/vbscript.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("vbscript",function(h,N){var T="error";function F(s){return new RegExp("^(("+s.join(")|(")+"))\\b","i")}var p=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]");var O=new RegExp("^((<>)|(<=)|(>=))");var L=new RegExp("^[\\.,]");var d=new RegExp("^[\\(\\)]");var i=new RegExp("^[A-Za-z][_A-Za-z0-9]*");var g=["class","sub","select","while","if","function","property","with","for"];var V=["else","elseif","case"];var D=["next","loop","wend"];var E=F(["and","or","not","xor","is","mod","eqv","imp"]);var J=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"];var X=["true","false","nothing","empty","null"];var m=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"];var l=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"];var j=["WScript","err","debug","RegExp"];var r=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"];var U=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"];var f=["server","response","request","session","application"];var I=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"];var G=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"];var S=U.concat(r);j=j.concat(l);if(h.isASP){j=j.concat(f);S=S.concat(G,I)}var C=F(J);var P=F(X);var Q=F(m);var n=F(j);var B=F(S);var o='"';var R=F(g);var Z=F(V);var a=F(D);var k=F(["end"]);var b=F(["do"]);var q=F(["on error resume next","exit"]);var W=F(["rem"]);function K(s,t){t.currentIndent++}function H(s,t){t.currentIndent--}function Y(w,v){if(w.eatSpace()){return"space"}var u=w.peek();if(u==="'"){w.skipToEnd();return"comment"}if(w.match(W)){w.skipToEnd();return"comment"}if(w.match(/^((&H)|(&O))?[0-9\.]/i,false)&&!w.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,false)){var t=false;if(w.match(/^\d*\.\d+/i)){t=true}else{if(w.match(/^\d+\.\d*/)){t=true}else{if(w.match(/^\.\d+/)){t=true}}}if(t){w.eat(/J/i);return"number"}var s=false;if(w.match(/^&H[0-9a-f]+/i)){s=true}else{if(w.match(/^&O[0-7]+/i)){s=true}else{if(w.match(/^[1-9]\d*F?/)){w.eat(/J/i);s=true}else{if(w.match(/^0(?![\dx])/i)){s=true}}}}if(s){w.eat(/L/i);return"number"}}if(w.match(o)){v.tokenize=e(w.current());return v.tokenize(w,v)}if(w.match(O)||w.match(p)||w.match(E)){return"operator"}if(w.match(L)){return null}if(w.match(d)){return"bracket"}if(w.match(q)){v.doInCurrentLine=true;return"keyword"}if(w.match(b)){K(w,v);v.doInCurrentLine=true;return"keyword"}if(w.match(R)){if(!v.doInCurrentLine){K(w,v)}else{v.doInCurrentLine=false}return"keyword"}if(w.match(Z)){return"keyword"}if(w.match(k)){H(w,v);H(w,v);return"keyword"}if(w.match(a)){if(!v.doInCurrentLine){H(w,v)}else{v.doInCurrentLine=false}return"keyword"}if(w.match(C)){return"keyword"}if(w.match(P)){return"atom"}if(w.match(B)){return"variable-2"}if(w.match(Q)){return"builtin"}if(w.match(n)){return"variable-2"}if(w.match(i)){return"variable"}w.next();return T}function e(s){var u=s.length==1;var t="string";return function(w,v){while(!w.eol()){w.eatWhile(/[^'"]/);if(w.match(s)){v.tokenize=Y;return t}else{w.eat(/['"]/)}}if(u){if(N.singleLineStringErrors){return T}else{v.tokenize=Y}}return t}}function M(v,t){var s=t.tokenize(v,t);var u=v.current();if(u==="."){s=t.tokenize(v,t);u=v.current();if(s&&(s.substr(0,8)==="variable"||s==="builtin"||s==="keyword")){if(s==="builtin"||s==="keyword"){s="variable"}if(S.indexOf(u.substr(1))>-1){s="variable-2"}return s}else{return T}}return s}var c={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:Y,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:false,ignoreKeyword:false}},token:function(u,t){if(u.sol()){t.currentIndent+=t.nextLineIndent;t.nextLineIndent=0;t.doInCurrentLine=0}var s=M(u,t);t.lastToken={style:s,content:u.current()};if(s==="space"){s=null}return s},indent:function(u,s){var t=s.replace(/^\s+|\s+$/g,"");if(t.match(a)||t.match(k)||t.match(Z)){return h.indentUnit*(u.currentIndent-1)}if(u.currentIndent<0){return 0}return u.currentIndent*h.indentUnit}};return c});A.defineMIME("text/vbscript","vbscript")});; ;/* module-key = 'com.atlassian.stash.stash-highlight-plugin:yaml', location = '/static/bower/CodeMirror/mode/yaml/yaml.js' */ (function(A){if(typeof exports=="object"&&typeof module=="object"){A(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],A)}else{A(CodeMirror)}}})(function(A){A.defineMode("yaml",function(){var B=["true","false","on","off","yes","no"];var C=new RegExp("\\b(("+B.join(")|(")+"))$","i");return{token:function(G,F){var E=G.peek();var D=F.escaped;F.escaped=false;if(E=="#"&&(G.pos==0||/\s/.test(G.string.charAt(G.pos-1)))){G.skipToEnd();return"comment"}if(G.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/)){return"string"}if(F.literal&&G.indentation()>F.keyCol){G.skipToEnd();return"string"}else{if(F.literal){F.literal=false}}if(G.sol()){F.keyCol=0;F.pair=false;F.pairStart=false;if(G.match(/---/)){return"def"}if(G.match(/\.\.\./)){return"def"}if(G.match(/\s*-\s+/)){return"meta"}}if(G.match(/^(\{|\}|\[|\])/)){if(E=="{"){F.inlinePairs++}else{if(E=="}"){F.inlinePairs--}else{if(E=="["){F.inlineList++}else{F.inlineList--}}}return"meta"}if(F.inlineList>0&&!D&&E==","){G.next();return"meta"}if(F.inlinePairs>0&&!D&&E==","){F.keyCol=0;F.pair=false;F.pairStart=false;G.next();return"meta"}if(F.pairStart){if(G.match(/^\s*(\||\>)\s*/)){F.literal=true;return"meta"}if(G.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)){return"variable-2"}if(F.inlinePairs==0&&G.match(/^\s*-?[0-9\.\,]+\s?$/)){return"number"}if(F.inlinePairs>0&&G.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)){return"number"}if(G.match(C)){return"keyword"}}if(!F.pair&&G.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)){F.pair=true;F.keyCol=G.indentation();return"atom"}if(F.pair&&G.match(/^:\s*/)){F.pairStart=true;return"meta"}F.pairStart=false;F.escaped=(E=="\\");G.next();return null},startState:function(){return{pair:false,pairStart:false,keyCol:0,inlinePairs:0,inlineList:0,literal:false,escaped:false}}}});A.defineMIME("text/x-yaml","yaml")});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:syntax-highlight', location = '/static/util/syntax-highlight.js' */ define("util/syntax-highlight",["codemirror","jquery","util/determine-language","exports"],function(C,F,E,B){function D(I){var H=F(I);if(!H.length){return }var K=H.attr("data-language");E.getCodeMirrorModeForName(K).then(G).fail(J);function G(L){C.runMode(H.text(),L.mime||{name:K},H[0])}function J(L){console.warn(L||(K+" could not be loaded for syntax highlighting."))}}function A(G){F(G).find("pre > code[data-language]").each(function(){D(this)})}B.codeblock=D;B.container=A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:markup-preview', location = '/static/widget/markup-preview/markup-preview.js' */ define("widget/markup-preview",["aui","jquery","lodash","stash/api/util/navbuilder","util/ajax","util/dom-event","util/events","util/navigator","util/syntax-highlight"],function(I,E,J,B,H,F,K,G,A){var D="ctrl+shift+p";K.on("stash.keyboard.shortcuts.requestPreviewComment",function(M){D=M;this.unbind()});function L(M){this.init.apply(this,arguments)}K.addLocalEventMixin(L.prototype);L.prototype.init=function(N){J.bindAll(this,"togglePreview","updatePreview","refreshPreview","hidePreview","cancelPreview");var P=G.isMac?D.replace(/ctrl/i,"meta"):D;this.$editor=E(N);this.$textarea=this.$editor.find("textarea");this.$previewButton=this.$editor.find(".markup-preview-button");this.$previewPanel=this.$editor.find(".markup-preview");this._destroyables=[];var M=this.$textarea.add(this.$previewButton);M.on("keydown",[P],this.togglePreview);this._destroyables.push({destroy:function(){M.off("keydown",this.togglePreview)}.bind(this)});this._destroyables.push(K.chainWith(this.$previewButton).on("click",this.togglePreview));this._destroyables.push(K.chainWith(this.$previewPanel).on("click",F.filterByTarget(":not(a, a > img)",this.togglePreview)));this._destroyables.push(K.chainWith(this.$textarea).on("input",J.debounce(this.refreshPreview,100)));this._destroyables.push({destroy:this.cancelPreview});var O=this;this.$previewButton.tooltip({gravity:function(){return E.fn.tipsy.autoNS.apply(this,arguments)+"e"},title:function(){return O.isPreviewing()?"Continue editing":O.$previewButton.attr("data-preview-tooltip")}})};L.prototype.isPreviewing=function(){return this.$editor.hasClass("previewing")};L.prototype.togglePreview=F.preventDefault(function(){if(this.isPreviewing()){this.cancelPreview()}else{this.showPreview()}});L.prototype.showPreview=function(){this.$editor.addClass("previewing");this.$textarea.parent().spin("medium");this.$previewButton.text("Edit");this._request&&this._request.abort();function N(P,O){if(O!=="abort"){this.hidePreview()}}function M(){this.$textarea.parent().spinStop();this._request=null}this._request=H.rest({type:"POST",url:C(),data:this.$textarea.val(),dataType:"json"}).done(this.updatePreview).fail(N.bind(this)).always(M.bind(this))};L.prototype.refreshPreview=function(){this.isPreviewing()&&this.showPreview()};L.prototype.updatePreview=function(M){this.$previewPanel.html(M.html);this.$previewPanel.find("a").attr("target","_blank");this.$editor.addClass("loaded");this.$previewButton.focus();A.container(this.$previewPanel);var N=this.trigger.bind(this,"resize");J.defer(N);this.$previewPanel.imagesLoaded(N)};L.prototype.cancelPreview=function(){this._request&&this._request.abort();this.hidePreview()};L.prototype.hidePreview=function(){this.$editor.removeClass("previewing loaded");this.$previewButton.text("Preview");this.$textarea.focus();this.trigger("resize")};L.prototype.destroy=function(){J.invoke(this._destroyables,"destroy")};var C=J.once(function(){return B.rest().markup().preview().build()});return L});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:markup-preview', location = '/static/widget/markup-preview/markup-preview.soy' */ // This file was automatically generated from markup-preview.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.markupPreview. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.markupPreview == 'undefined') { stash.widget.markupPreview = {}; } stash.widget.markupPreview.preview = function(opt_data, opt_ignored) { return '<div class="markup-preview markup" title="' + soy.$$escapeHtml("Click to edit") + '"></div>'; }; if (goog.DEBUG) { stash.widget.markupPreview.preview.soyTemplateName = 'stash.widget.markupPreview.preview'; } stash.widget.markupPreview.previewHelp = function(opt_data, opt_ignored) { return '' + stash.buttons.button({href: 'http:\/\/docs.atlassian.com\/stash\/docs-037\/Markdown+syntax+guide', extraClasses: 'aui-button-subtle aui-button-compact markup-preview-help', title: "Markup syntax guide", iconType: 'custom', iconClass: 'aui-icon aui-icon-small aui-iconfont-help', iconText: "Markup syntax guide", buttonText: '', extraAttributes: {target: '_blank'}}); }; if (goog.DEBUG) { stash.widget.markupPreview.previewHelp.soyTemplateName = 'stash.widget.markupPreview.previewHelp'; } stash.widget.markupPreview.previewButton = function(opt_data, opt_ignored) { return '' + stash.buttons.button({extraClasses: 'aui-button-subtle aui-button-compact markup-preview-button', buttonText: "Preview", extraAttributes: {type: 'button', 'data-preview-tooltip': opt_data.title}}); }; if (goog.DEBUG) { stash.widget.markupPreview.previewButton.soyTemplateName = 'stash.widget.markupPreview.previewButton'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:client-file-handlers', location = '/static/widget/client-file-handlers/client-file-handler.js' */ define("widget/client-file-handlers/client-file-handler",["jquery","lodash","util/events"],function(D,B,C){function A(E){return this.init(E)}C.addLocalEventMixin(A.prototype);A.typeFilters={all:/.*/,application:/^application\/.*/i,audio:/^audio\/.*/i,image:/^image\/.*/i,imageWeb:/^image\/(jpeg|png|gif)$/i,text:/^text\/.*/i,video:/^video\/.*/i};A.prototype.defaults={fileTypeFilter:A.typeFilters.all,fileCountLimit:Infinity,fileSizeLimit:10*1024*1024,onSuccess:D.noop,onError:D.noop};A.prototype.init=function(E){this.options=D.extend({},this.defaults,E);if(E&&!E.fileSizeLimit){this.options.fileSizeLimit=this.defaults.fileSizeLimit}if(E&&!E.fileCountLimit){this.options.fileCountLimit=this.defaults.fileCountLimit}B.bindAll(this,"handleFiles","filterFiles");return this};A.prototype.handleFiles=function(G,F){this.trigger("filesSelected",G);var E=this.filterFiles(G);if(E.valid.length>0){B.isFunction(this.options.onSuccess)&&this.options.onSuccess(E.valid);this.trigger("validFiles",E.valid)}else{B.isFunction(this.options.onError)&&this.options.onError(E.invalid)}if(B.keys(E.invalid).length){this.trigger("invalidFiles",E.invalid)}};A.prototype.filterFiles=function(G){var H=B.isRegExp(this.options.fileTypeFilter)?this.options.fileTypeFilter:this.defaults.fileTypeFilter;var F=this.options.fileSizeLimit;var E=B.reduce(G,function(I,J){if(!H.test(J.type)){I.invalid.byType=I.invalid.byType?I.invalid.byType.concat(J):[J]}else{if(J.size>F){I.invalid.bySize=I.invalid.bySize?I.invalid.bySize.concat(J):[J]}else{I.valid.push(J)}}return I},{valid:[],invalid:{}});if(E.valid.length>this.options.fileCountLimit){E.invalid.byCount=E.valid.slice(this.options.fileCountLimit);E.valid=E.valid.slice(0,this.options.fileCountLimit)}return E};return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:client-file-handlers', location = '/static/widget/client-file-handlers/client-file-uploader.js' */ define("widget/client-file-handlers/client-file-uploader",["jquery","lodash","util/ajax","util/feature-detect","widget/client-file-handlers/client-file-handler"],function(F,D,E,B,A){function C(G){if(!C.isSupported()){throw new Error("ClientFileUploader requires FormData support")}this.init.apply(this,arguments)}C.isSupported=B.formData;C.typeFilters=A.typeFilters;F.extend(C.prototype,A.prototype);C.prototype.defaults=F.extend({},A.prototype.defaults,{url:undefined,fieldName:"file",fileSizeLimit:undefined});C.prototype.init=function(G){D.bindAll(this,"uploadFiles");A.prototype.init.call(this,G);this.uploads=[];this.on("validFiles",this.uploadFiles)};C.prototype.uploadFiles=function(H){var G=this;D.forEach(H,function(J){var K=new FormData();var I=F.Deferred();K.append(G.options.fieldName,J,J.name);var L=E.ajax({url:G.options.url,type:"POST",data:K,xhr:function(){var N=F.ajaxSettings.xhr();var M=N.upload?N.upload:N;M.addEventListener("progress",function(O){if(O.lengthComputable){I.notify(Math.max(0,Math.min(100,100*O.loaded/O.total)))}});return N},statusCode:{500:false},processData:false,contentType:false}).done(function(){I.notify(100);I.resolveWith(this,arguments)}).fail(function(){I.rejectWith(this,arguments)}).always(function(){G.uploads=D.without(G.uploads,L)});I.promise(L);G.uploads.push(L);G.trigger("uploadStarted",L,J)})};C.prototype.destroy=function(){D.invoke(this.uploads,"abort");this.uploads=[]};return C});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:client-file-handlers', location = '/static/widget/client-file-handlers/client-file-reader.js' */ define("widget/client-file-handlers/client-file-reader",["jquery","lodash","util/feature-detect","widget/client-file-handlers/client-file-handler"],function(F,E,C,B){var D={ArrayBuffer:"readAsArrayBuffer",BinaryString:"readAsBinaryString",DataURL:"readAsDataURL",Text:"readAsText"};function A(G){if(!A.isSupported()){throw new Error("ClientFileReader requires FileReaderAPI support")}return this.init(G)}A.isSupported=C.fileReader;F.extend(A.prototype,B.prototype);A.readMethods={ArrayBuffer:"ArrayBuffer",BinaryString:"BinaryString",DataURL:"DataURL",Text:"Text"};A.typeFilters=B.typeFilters;A.prototype.defaults=F.extend({},B.prototype.defaults,{readMethod:A.readMethods.DataURL,onRead:F.noop});A.prototype.init=function(G){E.bindAll(this,"onSuccess","readFile");B.prototype.init.call(this,G);this.options.onSuccess=this.onSuccess;return this};A.prototype.onSuccess=function(H){var G=E.has(D,this.options.readMethod)?D[this.options.readMethod]:undefined;if(G){E.each(H,E.bind(function(J){var I=new FileReader();I.onload=E.bind(this.readFile,this,J);I[G](J)},this))}};A.prototype.readFile=function(G,H){E.isFunction(this.options.onRead)&&this.options.onRead(H.target.result,G)};return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:client-file-handlers', location = '/static/widget/client-file-handlers/client-file-iframe-uploader.js' */ define("widget/client-file-handlers/client-file-iframe-uploader",["jquery","lodash","util/deprecation","widget/client-file-handlers/client-file-handler"],function(F,C,E,B){var A=E.getMessageLogger("widget/client-file-handlers/client-file-iframe-uploader",null,"3.7","4.0");function D(G){A();return this.init(G)}F.extend(D.prototype,B.prototype);D.prototype.defaults=F.extend({},B.prototype.defaults,{uploadURL:"",uploadFieldName:"file",onUpload:F.noop,responseHandler:function(H,I){var G;try{G=JSON.parse(F(H).html())}catch(J){I.reject()}if(G){I.resolve(G)}else{I.reject()}}});D.prototype.states={IN_PROGRESS:"IN_PROGRESS",IDLE:"IDLE"};D.prototype.init=function(G){C.bindAll(this,"createHiddenIframe","onIframeLoad","handleFiles","setStateInProgress","setStateIdle","cancelUpload");this.options=F.extend({},this.defaults,G);this.$uploadIframe=this.createHiddenIframe();if(this.options.cancelTrigger){this.$cancelTrigger=F(this.options.cancelTrigger);this.$cancelTrigger.click(C.bind(function(){this.cancelUpload()},this))}this.state=this.states.IDLE;return this};D.prototype.createHiddenIframe=function(){return F("<iframe>").attr("name","hidden-upload-iframe").hide().appendTo(document.body).on("load",this.onIframeLoad)};D.prototype.onIframeLoad=function(G){if(this.state===this.states.IN_PROGRESS){this.requestPromise.done(this.options.onUpload).fail(this.options.onError);this.options.responseHandler(G.target.contentDocument.body,this.requestPromise)}};D.prototype.handleFiles=function(I,G){if(this.state===this.states.IN_PROGRESS){this.cancelUpload()}if(!this.$fileSourceElem){this.$fileSourceElem=F(G);this.$fileSourceElem.attr("name",this.options.uploadFieldName);if(!this.$fileSourceElem.prop("form")){this.$fileSourceElem.wrap("<form>")}var J=F(this.$fileSourceElem.prop("form"));J.addClass("hidden-upload-form").attr("action",this.options.uploadURL).attr("method","post").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data").attr("target",this.$uploadIframe.attr("name"));this.$spinner=F('<div class="spinner"></div>').insertBefore(this.$fileSourceElem);if(F.isPlainObject(this.options.extraData)){C.each(this.options.extraData,function(L,K){F('<input type="hidden">').attr("name",K).val(L).appendTo(J)})}}var H=F(this.$fileSourceElem.prop("form"));if(this.options.xsrfToken&&this.options.xsrfToken.name&&this.options.xsrfToken.value){H.append("<input type='hidden' name='"+this.options.xsrfToken.name+"' value='"+this.options.xsrfToken.value+"'/>")}H.submit();this.requestPromise=F.Deferred();this.requestPromise.always(this.setStateIdle);this.setStateInProgress()};D.prototype.setStateInProgress=function(){this.state=this.states.IN_PROGRESS;if(this.$spinner){this.$spinner.spin()}if(this.$fileSourceElem){this.$fileSourceElem.attr("disabled","disabled")}};D.prototype.setStateIdle=function(){this.state=this.states.IDLE;if(this.$spinner){this.$spinner.spinStop()}if(this.$fileSourceElem){this.$fileSourceElem.removeAttr("disabled")}this.requestPromise=null};D.prototype.cancelUpload=function(){this.$uploadIframe.remove();this.setStateIdle();this.$uploadIframe=this.createHiddenIframe()};return D});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:drag-drop-file-target', location = '/static/widget/drag-drop-file-target/drag-drop-file-target.js' */ define("widget/drag-drop-file-target",["jquery","lodash","util/events"],function(D,A,B){function C(E,F){return this.init.apply(this,arguments)}C.prototype.getDefaults=function(){return{activeDropTargetClass:"active-drop-target",uploadPrompt:"Drag a file here to upload",clientFileHandler:null}};C.prototype.init=function(E,F){A.bindAll(this,"onDragOver","onDragEnd","onDrop");this.$target=D(E);this.options=D.extend({},this.getDefaults(),F);this.$target.attr("data-upload-prompt",this.options.uploadPrompt);this._destroyables=[];this._destroyables.push(B.chainWith(this.$target).on("dragover",this.onDragOver).on("dragleave",this.onDragEnd).on("dragend",this.onDragEnd).on("drop",this.onDrop))};C.prototype.onDragOver=function(E){E.preventDefault();this.$target.addClass(this.options.activeDropTargetClass)};C.prototype.onDragEnd=function(E){E.preventDefault();this.$target.removeClass(this.options.activeDropTargetClass)};C.prototype.onDrop=function(E){E.preventDefault();E.originalEvent.preventDefault();this.$target.removeClass(this.options.activeDropTargetClass);if(this.options.clientFileHandler){this.options.clientFileHandler.handleFiles(E.originalEvent.dataTransfer.files,E.originalEvent.target)}};C.prototype.destroy=function(){this.$target.removeAttr("data-upload-prompt");this.$target.removeClass(this.options.activeDropTargetClass);A.invoke(this._destroyables,"destroy")};return C});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:paste-image-target', location = '/static/widget/paste-image-target/paste-image-target.js' */ define("widget/paste-image-target",["jquery","lodash","util/events","util/function","widget/client-file-handlers/client-file-handler"],function(F,B,C,D,A){function E(G,H){this.init.apply(this,arguments)}E.prototype.init=function(G,H){B.bindAll(this,"handlePaste","processClipboardItem");this.$el=F(G);this.clientFileHandler=H;this._destroyables=[];this._destroyables.push(C.chainWith(this.$el).on("paste",this.handlePaste))};E.prototype.handlePaste=function(J){var I=A.typeFilters.image;var G=J.originalEvent;var H=G.clipboardData&&G.clipboardData.items;if(this.clientFileHandler&&H&&H.length===1){B.toArray(H).filter(B.compose(I.test.bind(I),D.dot("type"))).forEach(this.processClipboardItem)}};E.prototype.processClipboardItem=function(H){var G=H.getAsFile();G.name="upload."+B.last(G.type.split("/"));this.clientFileHandler.handleFiles([G],this.$el)};E.prototype.destroy=function(){B.invoke(this._destroyables,"destroy")};return E});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:upload-interceptor', location = '/static/widget/upload-interceptor/upload-interceptor.js' */ define("widget/upload-interceptor",["jquery","lodash","util/events"],function(D,A,B){function C(E,F){this.init.apply(this,arguments)}C.prototype.init=function(E,F){A.bindAll(this,"onSelectFile");this.$el=D(E);this.clientFileHandler=F;this._destroyables=[];this._destroyables.push(B.chainWith(this.$el).on("change",this.onSelectFile))};C.prototype.onSelectFile=function(F){var E=F.target;if((E.value!==""||(E.files&&E.files.length))&&this.clientFileHandler){this.clientFileHandler.handleFiles(E.files,E);D(E).wrap("<form>").parent("form").trigger("reset").end().unwrap()}};C.prototype.destroy=function(){A.invoke(this._destroyables,"destroy")};return C});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:faux-upload-field', location = '/static/widget/faux-upload-field/faux-upload-field.js' */ define("widget/faux-upload-field",["jquery","lodash","util/dom-event","util/events","util/navigator","widget/client-file-handlers/client-file-handler","widget/upload-interceptor"],function(H,D,G,E,C,A,F){function B(I,J){this.init.apply(this,arguments)}B.prototype.defaults={clientFileHandler:null,accept:null,allowMultiple:false};B.prototype.init=function(J,K){this.$el=H(J);this._destroyables=[];switch(K.accept){case A.typeFilters.audio:K.accept="audio/*";break;case A.typeFilters.image:K.accept="image/*";break;case A.typeFilters.imageWeb:K.accept="image/jpeg, image/gif, image/png";break;case A.typeFilters.video:K.accept="video/*";break}this.options=H.extend({},this.defaults,K);var I=D.uniqueId("faux-upload-field-");var L=H(stash.widget.fauxUploadField.uploadField({id:I,accept:this.options.accept,allowMultiple:this.options.allowMultiple})).hide().insertAfter(this.$el);this.$el.tooltip({gravity:H.fn.tipsy.autoNS});if(this.$el.is("label")){this.$el.attr("for",I)}else{if(C.isIE()){this.$el.hide();L.show()}else{this._destroyables.push(E.chainWith(this.$el).on("click",G.preventDefault(L.click.bind(L))))}}if(this.options.clientFileHandler){this._destroyables.push(new F(L,this.options.clientFileHandler))}};B.prototype.destroy=function(){D.invoke(this._destroyables,"destroy")};return B});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:faux-upload-field', location = '/static/widget/faux-upload-field/faux-upload-field.soy' */ // This file was automatically generated from faux-upload-field.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.fauxUploadField. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.fauxUploadField == 'undefined') { stash.widget.fauxUploadField = {}; } stash.widget.fauxUploadField.uploadField = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '<input type="file" ' + ((opt_data.id) ? ' id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + 'class="faux-upload-field ' + ((opt_data.extraClasses) ? soy.$$escapeHtml(opt_data.extraClasses) : '') + '"' + ((opt_data.accept) ? ' accept="' + soy.$$escapeHtml(opt_data.accept) + '"' : '') + ((opt_data.allowMultiple) ? ' multiple' : '') + '/>'; }; if (goog.DEBUG) { stash.widget.fauxUploadField.uploadField.soyTemplateName = 'stash.widget.fauxUploadField.uploadField'; } stash.widget.fauxUploadField.labelButton = function(opt_data, opt_ignored) { return '' + aui.buttons.button({tagName: 'label', extraClasses: 'faux-upload-label-button ' + opt_data.extraClasses, text: opt_data.text}); }; if (goog.DEBUG) { stash.widget.fauxUploadField.labelButton.soyTemplateName = 'stash.widget.fauxUploadField.labelButton'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:drag-drop-file-uploader', location = '/static/widget/drag-drop-file-uploader/drag-drop-file-uploader.js' */ define("widget/drag-drop-file-uploader",["jquery","lodash","util/events","widget/client-file-handlers/client-file-uploader","widget/drag-drop-file-target","widget/faux-upload-field","widget/paste-image-target"],function(H,D,E,C,G,B,F){function A(J,I){if(!A.isSupported()){throw new Error("DragDropUploader requires ClientFileUploader support")}this.init.apply(this,arguments)}A.typeFilters=C.typeFilters;A.isSupported=C.isSupported;E.addLocalEventMixin(A.prototype);A.prototype.defaults={url:null,fieldName:"file",uploadButton:undefined,fileTypeFilter:undefined,fileCountLimit:undefined,fileSizeLimit:undefined,pasteUpload:true};A.prototype.init=function(L,J){this.$target=H(L);var K=D.pick(C.prototype.defaults,"fileTypeFilter","fileCountLimit","fileSizeLimit");this.options=H.extend({},this.defaults,K,J);this._destroyables=[];var I=new C({url:this.options.url,fieldName:this.options.fieldName});this._destroyables.push(this.retriggerFrom(I,"filesSelected","validFiles","invalidFiles","uploadStarted"));this._destroyables.push(I);this._destroyables.push(new G(this.$target,{clientFileHandler:I}));if(this.options.uploadButton){this._destroyables.push(new B(H(this.options.uploadButton),{clientFileHandler:I,allowMultiple:this.options.fileCountLimit>1}))}if(this.options.pasteUpload){this._destroyables.push(new F(this.$target,I))}};A.prototype.destroy=function(){D.invoke(this._destroyables,"destroy")};return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:promise-util', location = '/static/util/promise.js' */ define("util/promise",["jquery","lodash","exports"],function(H,O,F){var B={PENDING:"pending",REJECTED:"rejected",RESOLVED:"resolved"};function E(R){R&&R.abort&&R.abort()}function K(){var R=Array.prototype.slice.call(arguments);var S=H.when.apply(H,R);S.abort=function(){O.forEach(R,E)};return S}function M(){console.log("Promise does not have an abort function")}function C(){var R=H.when.apply(H,arguments);R.abort=O.invoke.bind(O,arguments,"abort");return P(R)}function P(a,T,S){var R;var Z=a;var V=H.Callbacks();var W={};function X(){if(W.state()==="pending"){if(!R){E(Z)}R=true}V.fire()}function Y(b,c){return function(){if(R){return new H.Deferred()[b+"With"](this,arguments)}Z=c.apply(this,arguments);return Z}}var U=a.then(T?Y("resolve",T):null,S?Y("reject",S):null);W.abort=X;W.thenAbortable=function(b,d){var c=P(W,b,d);V.add(c.abort);return c};return U.promise(W)}function G(S,R){return function(){var X=H.Deferred();var T=this;var U=Array.prototype.slice.call(arguments);var Y;var W=function(){return setTimeout(function(){var Z=S.apply(T,U);Z.done(X.resolve).fail(X.reject);Y=Z.abort?O.bind(Z.abort,Z):M},R)};var V=W();Y=function(){clearTimeout(V);X.reject(X,"abort","abort")};return X.promise({abort:function(){Y()},reset:function(){if(X.state()==="pending"){clearTimeout(V);U=Array.prototype.slice.call(arguments);V=W()}}})}}function I(){return H.when.apply(H,O.map(arguments,A)).then(L,L)}function A(R){return R.then(Q(false),Q(true))}function Q(R){return function(){return H.Deferred().resolve({rejectedSelf:R&&this,self:this,args:Array.prototype.slice.call(arguments)})}}function L(){var U=O.chain(arguments).pluck("rejectedSelf").find(O.identity).value();var T=(U?"reject":"resolve")+"With";var R=U||arguments[0].self;var S=O.pluck(arguments,"args");return H.Deferred()[T](R,S)}function N(R,V,S,U){var T=H(R).spin(S||"small",U||{});return V.always(function(){T.remove()})}function D(R,W,S){S=S||"small";var V;var T=H(R);function U(){var X=Array.prototype.slice.call(arguments);if(!X.length){return }T.spin(S).addClass("spinning");V=I.apply(null,O.compact(X.concat(V)));V.always(function(){if(V.state()!==B.PENDING){T.spinStop().removeClass("spinning")}})}W&&U(W);return{add:U}}function J(V){var T=H.Deferred(),R={timeout:10000,interval:100,name:"",predicate:H.noop};V=H.extend(R,V);var S=new Date().getTime()+(V.timeout);var U=setInterval(function(){var W=V.predicate();if(W){clearInterval(U);T.resolve(W)}else{if(new Date().getTime()>S){clearInterval(U);T.reject("Predicate '"+V.name+"' was false after "+V.timeout+"ms")}}},V.interval);return T.promise()}F.state=B;F.delay=G;F.reduce=K;F.settle=I;F.spinner=N;F.rollingSpinner=D;F.thenAbortable=P;F.whenAbortable=C;F.waitFor=J});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:inline-error-dialog', location = '/static/widget/inline-error-dialog/inline-error-dialog.js' */ define("widget/inline-error-dialog",["aui","jquery","lodash","util/events"],function(B,E,C,D){function A(F,G){this.init.apply(this,arguments)}A.prototype.init=function(F,H){this.errors=[];this.options=E.extend({persistent:true},H);this._destroyables=[];C.bindAll(this,"_renderDialogContents","hide","show","refresh","add","reset","destroy");var G={noBind:true,persistent:this.options.persistent,addActiveClass:false,fadeTime:0};this._$inlineDialog=B.InlineDialog(E(F),C.uniqueId("inline-error-dialog-"),this._renderDialogContents,G);if(this.options.persistent){this._destroyables.push(D.chainWith(this._$inlineDialog).on("click",".dismiss-button",this.hide))}};A.prototype._renderDialogContents=function(G,F,H){G.html(stash.widget.inlineErrorDialog.contents({title:C.isFunction(this.options.title)?this.options.title(this.errors):this.options.title,subtitle:C.isFunction(this.options.subtitle)?this.options.subtitle(this.errors):this.options.subtitle,errors:this.errors,persistent:this.options.persistent})).addClass("inline-error-contents");H()};A.prototype.hide=function(){this._$inlineDialog.hide();this.reset()};A.prototype.show=function(){this._$inlineDialog.show();this.refresh()};A.prototype.refresh=function(){this._$inlineDialog.refresh()};A.prototype.add=function(F){this.errors.push(F)};A.prototype.reset=function(){this.errors.length=0};A.prototype.destroy=function(){this.errors.length=0;C.invoke(this._destroyables,"destroy");this._$inlineDialog.remove()};return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:inline-error-dialog', location = '/static/widget/inline-error-dialog/inline-error-dialog.soy' */ // This file was automatically generated from inline-error-dialog.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.inlineErrorDialog. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.inlineErrorDialog == 'undefined') { stash.widget.inlineErrorDialog = {}; } stash.widget.inlineErrorDialog.contents = function(opt_data, opt_ignored) { var output = '<h4>' + aui.icons.icon({icon: 'error', useIconFont: true}) + ((opt_data.title) ? soy.$$escapeHtml(opt_data.title) : '') + '</h4>' + ((opt_data.subtitle) ? '<h6>' + soy.$$escapeHtml(opt_data.subtitle) + '</h6>' : ''); var errorList16 = opt_data.errors; var errorListLen16 = errorList16.length; for (var errorIndex16 = 0; errorIndex16 < errorListLen16; errorIndex16++) { var errorData16 = errorList16[errorIndex16]; output += ((errorIndex16 == 0) ? '<ul>' : '') + '<li>' + soy.$$escapeHtml(errorData16) + '</li>' + ((errorIndex16 == errorListLen16 - 1) ? '</ul>' : ''); } output += (opt_data.persistent) ? stash.buttons.button({extraClasses: 'dismiss-button', type: 'button', buttonText: "Dismiss"}) : ''; return output; }; if (goog.DEBUG) { stash.widget.inlineErrorDialog.contents.soyTemplateName = 'stash.widget.inlineErrorDialog.contents'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:property-util', location = '/static/util/property.js' */ define("util/property",["jquery","exports"],function(D,B){function C(F,E){if(F==null){return F}switch(E){case"STRING":return F;case"NUMBER":return Number(F);case"BOOLEAN":return F.toLowerCase()==="true"}}var A={};B.getFromProvider=function(E){var F=A[E]||(A[E]=WRM.data.claim("com.atlassian.stash.config-wrm-data:"+E+".data"));return D.Deferred().resolve(C(F.value,F.type))};B._coerce=C});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:feature-enabled', location = '/static/util/feature-enabled.js' */ define("util/feature-enabled",["jquery","exports"],function(D,B){var A={};var C=Object.prototype.hasOwnProperty;B.getFromProvider=function(E){var F=C.call(A,E)?A[E]:(A[E]=WRM.data.claim("com.atlassian.stash.feature-wrm-data:"+E+".data"));return D.Deferred().resolve(F)}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:markup-attachments', location = '/static/widget/markup-attachments/markup-attachments.soy' */ // This file was automatically generated from markup-attachments.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.markupAttachments. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.markupAttachments == 'undefined') { stash.widget.markupAttachments = {}; } stash.widget.markupAttachments.uploadTrigger = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '' + stash.buttons.button({tagName: 'label', extraClasses: 'aui-button-subtle aui-button-compact markup-attachments-button', title: opt_data.title, iconType: 'aui', iconClass: 'aui-icon-small aui-iconfont-attachment', iconText: opt_data.accessibilityText, buttonText: opt_data.buttonText ? opt_data.buttonText : ''}); }; if (goog.DEBUG) { stash.widget.markupAttachments.uploadTrigger.soyTemplateName = 'stash.widget.markupAttachments.uploadTrigger'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:markup-attachments', location = '/static/widget/markup-attachments/markup-attachments.js' */ define("widget/markup-attachments",["aui","jquery","lodash","stash/api/util/navbuilder","util/events","util/feature-enabled","util/function","util/promise","util/property","util/text","model/page-state","widget/drag-drop-file-uploader","widget/inline-error-dialog"],function(K,H,U,J,D,E,L,T,P,B,N,G,Q){var M;E.getFromProvider("attachments").done(function(V){M=V});var C;P.getFromProvider("attachment.upload.max.size").done(function(V){C=V});function I(V){if(!I.isSupported()){throw new Error("MarkupAttachments requires DragDropFileUploader support")}this.init.apply(this,arguments)}I.isEnabled=function(){return M};I.isSupported=G.isSupported;I._editorClass="markup-attachments";I.prototype.init=function(W){this.$editor=H(W);this.$textarea=this.$editor.find("textarea");this.$uploadButton=this.$editor.find(".markup-attachments-button");this._destroyables=[];U.bindAll(this,"handleUpload","handleAttachment","handleFailures","hideErrors");this.$editor.addClass(I._editorClass);this.dragDropFileUploader=new G(this.$editor,{url:O(),fieldName:"files",uploadButton:this.$uploadButton,fileSizeLimit:C});this._destroyables.push(this.dragDropFileUploader);this._destroyables.push(D.chainWith(this.dragDropFileUploader).on({filesSelected:this.hideErrors,invalidFiles:L.partialRight(U.forEach,L.binary(this.handleFailures)),uploadStarted:this.handleUpload}));var X=B.formatSizeInBytes(this.dragDropFileUploader.options.fileSizeLimit);this.errorDialog=new Q(this.$uploadButton,{title:function(Y){return K.format("{0,choice,1#There was a problem with your upload and the following file was not added|1\u003cThere was a problem with your upload and the following files were not added}",Y.length)},subtitle:K.format("Note: There is a {0} size limit per file",X)});this._destroyables.push(this.errorDialog);this._destroyables.push(D.chainWith(this.$editor).on("resize",this.errorDialog.refresh));var V=H(aui.icons.icon({icon:"success",useIconFont:true})).appendTo(this.$uploadButton);this._destroyables.push({destroy:V.remove.bind(V)});this.rollingSpinner=T.rollingSpinner(this.$uploadButton)};I.prototype.handleUpload=function(Y,V){this.rollingSpinner.add(Y);var X=U.compose(L.partialRight(U.forEach,U.partial(this.handleAttachment,V)),L.dot("attachments"));var W=function(a,Z){this.handleFailures([V],Z,{statusCode:a.status})};Y.done(X).fail(W.bind(this))};I.prototype.handleAttachment=function(W,X){if(X.errors){var V=U.first(X.errors);this.handleFailures([W],V.exceptionName,{message:V.message});return }this.$textarea.val(F(this.$textarea.val())+A(X.url,W.name,W.type)).trigger("input").focus()};I.prototype.handleFailures=function(V,W,X){if(W==="abort"||W==="error"&&X.statusCode!==500){this.hideErrors();return }U.pluck(V,"name").forEach(this.errorDialog.add);this.errorDialog.show()};I.prototype.hideErrors=function(){this.errorDialog.hide()};I.prototype.destroy=function(){this.$editor.removeClass(I._editorClass);U.invoke(this._destroyables,"destroy")};var O=U.once(function(){return N.getRepository()&&J.currentRepo().attachments().build()});function R(V){V=(V||"").replace(/[^\w\.\-]/g,"");return(V.length===0||U.first(V)===".")?"upload"+V:V}function S(V){return V.replace(/([\(\)])/g,"\\$1")}function A(X,a,V){var Y=R(a);var Z=S(X);var W=G.typeFilters.image.test(V)?"":Y;return"["+W+"]("+Z+")"}function F(V){return V+((V.length&&U.last(V)!=="\n")?"\n":"")}return I});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:markup-editor', location = '/static/widget/markup-editor/markup-editor.soy' */ // This file was automatically generated from markup-editor.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.markupEditor. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.markupEditor == 'undefined') { stash.widget.markupEditor = {}; } stash.widget.markupEditor.editor = function(opt_data, opt_ignored) { return '<div class="markup-editor">' + stash.widget.markupPreview.preview(null) + widget.aui.form.expandingTextarea({id: opt_data.textareaId, name: opt_data.textareaName ? opt_data.textareaName : 'text', extraClasses: 'text', initialValue: opt_data.text, placeholderText: opt_data.placeholderText}) + '<div class="markup-toolbar"><div class="secondary">' + stash.widget.markupPreview.previewHelp(null) + stash.widget.markupPreview.previewButton({title: opt_data.previewButtonTitle}) + '</div><div class="primary">' + stash.widget.markupAttachments.uploadTrigger({title: opt_data.attachmentButtonTitle, accessibilityText: opt_data.attachmentButtonAccessibilityText}) + '</div><div class="tertiary"></div></div></div>'; }; if (goog.DEBUG) { stash.widget.markupEditor.editor.soyTemplateName = 'stash.widget.markupEditor.editor'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:markup-editor', location = '/static/widget/markup-editor/markup-editor.js' */ define("widget/markup-editor",["aui","jquery","lodash","util/events","widget/markup-attachments","widget/markup-preview","widget/mentionable-textarea"],function(B,G,C,E,H,D,F){function A(I){this.init.apply(this,arguments)}A._dataKey="markup-editor";A.bindTo=function(J){var K=A.unbindFrom(J);var I=new A(K);K.data(A._dataKey,I);return I};A.unbindFrom=function(J){var K=G(J);K=K.is(".markup-editor")?K:K.find(".markup-editor");var I=K.data(A._dataKey);I&&I.destroy();return K};E.addLocalEventMixin(A.prototype);A.prototype.init=function(K){var L=G(K);this.$editor=L.is(".markup-editor")?L:L.find(".markup-editor");this._destroyables=[];var N=this.$editor.find("textarea");if(N.is(document.activeElement)){C.defer(N.focus.bind(N))}var J=this.$editor.find("textarea.expanding").expandingTextarea();this._destroyables.push(E.chainWith(J).on("resize.expanding",this.onComponentResize.bind(this,false)));this._destroyables.push({destroy:J.expandingTextarea.bind(J,"destroy")});var M=new D(this.$editor);this._destroyables.push(E.chainWith(M).on("resize",this.onComponentResize.bind(this,true)));this._destroyables.push(M);this._destroyables.push(new F({$container:this.$editor}));var I=function(O){this.$editor.find(".markup-attachments-button").addClass("disabled").prop("disabled","disabled").attr("aria-disabled",true).attr("title",O)}.bind(this);if(H.isEnabled()){if(H.isSupported()){this._destroyables.push(new H(this.$editor))}else{I("Uploading attachments is not supported in this browser")}}else{I("Your system administrator has disabled uploading attachments")}this.$editor.find(".markup-preview-help").tooltip({gravity:G.fn.tipsy.autoNS})};A.prototype.onComponentResize=function(I){this.$editor.triggerHandler("resize");this.trigger("resize",I)};A.prototype.destroy=function(){C.invoke(this._destroyables,"destroy");this.$editor.data(A._dataKey,null);this.$editor=null;this.off()};return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:baconjs', location = '/static/bower/bacon/dist/Bacon.js' */ (function(){var U,AJ,P,AN,i,X,Z,c,AC,a,M,f,AE,AB,K,Q,AH,W,d,AL,AG,V,J,p,v,AK,x,S,s,y,l,z,AF,e,H,b,O,B,AM,j,R,E,A,AR,AI,AA,AS,AP,u,g,G,o,t,m,AO,w,AT,I,N,T,D,n,AQ,q,k,Y,L,h,AU,r={}.hasOwnProperty,F=[].slice,C=function(AY,AW){for(var AV in AW){if(r.call(AW,AV)){AY[AV]=AW[AV]}}function AX(){this.constructor=AY}AX.prototype=AW.prototype;AY.prototype=new AX();AY.__super__=AW.prototype;return AY},AD=function(AV,AW){return function(){return AV.apply(AW,arguments)}};U={toString:function(){return"Bacon"}};U.version="0.7.42";f=(typeof global!=="undefined"&&global!==null?global:this).Error;h={indexOf:Array.prototype.indexOf?function(AW,AV){return AW.indexOf(AV)}:function(AX,AV){var AY,Aa,AZ,AW;for(AY=AZ=0,AW=AX.length;AZ<AW;AY=++AZ){Aa=AX[AY];if(AV===Aa){return AY}}return -1},indexWhere:function(AW,AZ){var AX,Aa,AY,AV;for(AX=AY=0,AV=AW.length;AY<AV;AX=++AY){Aa=AW[AX];if(AZ(Aa)){return AX}}return -1},head:function(AV){return AV[0]},always:function(AV){return function(){return AV}},negate:function(AV){return function(AW){return !AV(AW)}},empty:function(AV){return AV.length===0},tail:function(AV){return AV.slice(1,AV.length)},filter:function(Aa,AY){var AX,AV,AZ,AW;AX=[];for(AZ=0,AW=AY.length;AZ<AW;AZ++){AV=AY[AZ];if(Aa(AV)){AX.push(AV)}}return AX},map:function(Aa,AY){var AV,AZ,AX,AW;AW=[];for(AZ=0,AX=AY.length;AZ<AX;AZ++){AV=AY[AZ];AW.push(Aa(AV))}return AW},each:function(AV,AY){var AW,AX;for(AW in AV){AX=AV[AW];AY(AW,AX)}return void 0},toArray:function(AV){if(A(AV)){return AV}else{return[AV]}},contains:function(AW,AV){return h.indexOf(AW,AV)!==-1},id:function(AV){return AV},last:function(AV){return AV[AV.length-1]},all:function(AX,AZ){var AV,AY,AW;if(AZ==null){AZ=h.id}for(AY=0,AW=AX.length;AY<AW;AY++){AV=AX[AY];if(!AZ(AV)){return false}}return true},any:function(AX,AZ){var AV,AY,AW;if(AZ==null){AZ=h.id}for(AY=0,AW=AX.length;AY<AW;AY++){AV=AX[AY];if(AZ(AV)){return true}}return false},without:function(AV,AW){return h.filter((function(AX){return AX!==AV}),AW)},remove:function(AV,AW){var AX;AX=h.indexOf(AW,AV);if(AX>=0){return AW.splice(AX,1)}},fold:function(AY,AX,Aa){var AV,AZ,AW;for(AZ=0,AW=AY.length;AZ<AW;AZ++){AV=AY[AZ];AX=Aa(AX,AV)}return AX},flatMap:function(AW,AV){return h.fold(AV,[],(function(AY,AX){return AY.concat(AW(AX))}))},cached:function(AW){var AV;AV=K;return function(){if(AV===K){AV=AW();AW=void 0}return AV}},toString:function(AZ){var AW,AX,AV,AY;try{AT++;if(AZ==null){return"undefined"}else{if(AI(AZ)){return"function"}else{if(A(AZ)){if(AT>5){return"[..]"}return"["+h.map(h.toString,AZ).toString()+"]"}else{if(((AZ!=null?AZ.toString:void 0)!=null)&&AZ.toString!==Object.prototype.toString){return AZ.toString()}else{if(typeof AZ==="object"){if(AT>5){return"{..}"}AX=(function(){var Aa;Aa=[];for(AV in AZ){if(!r.call(AZ,AV)){continue}AY=(function(){try{return AZ[AV]}catch(Ab){AW=Ab;return AW}})();Aa.push(h.toString(AV)+":"+h.toString(AY))}return Aa})();return"{"+AX+"}"}else{return AZ}}}}}}finally{AT--}}};AT=0;U._=h;U.scheduler={setTimeout:function(AV,AW){return setTimeout(AV,AW)},setInterval:function(AW,AV){return setInterval(AW,AV)},clearInterval:function(AV){return clearInterval(AV)},now:function(){return new Date().getTime()}};U.fromBinder=function(AV,AW){if(AW==null){AW=h.id}return new M(H(U,"fromBinder",AV,AW),function(Aa){var Ab,AY,AX,AZ;AZ=false;Ab=false;AY=function(){if(!AZ){if(typeof AX!=="undefined"&&AX!==null){AX();return AZ=true}else{return Ab=true}}};AX=AV(function(){var Ad,Af,Ae,Ah,Ag,Ac;Ad=1<=arguments.length?F.call(arguments,0):[];Ah=AW.apply(this,Ad);if(!(A(Ah)&&h.last(Ah) instanceof a)){Ah=[Ah]}Ae=U.more;for(Ag=0,Ac=Ah.length;Ag<Ac;Ag++){Af=Ah[Ag];Ae=Aa(Af=D(Af));if(Ae===U.noMore||Af.isEnd()){AY();return Ae}}return Ae});if(Ab){AY()}return AY})};U.$={};U.$.asEventStream=function(AW,AV,AX){var AY;if(AI(AV)){AY=[AV,void 0],AX=AY[0],AV=AY[1]}return Y(this.selector||this,"asEventStream",AW,U.fromBinder((function(AZ){return function(Aa){AZ.on(AW,AV,Aa);return function(){return AZ.off(AW,AV,Aa)}}})(this),AX))};if((AU=typeof jQuery!=="undefined"&&jQuery!==null?jQuery:typeof Zepto!=="undefined"&&Zepto!==null?Zepto:void 0)!=null){AU.fn.asEventStream=U.$.asEventStream}U.fromEventTarget=function(Af,Ae,AX){var AV,AZ,Ad,Ac,Ab,Aa,AY,AW;AV=(Ad=(Ac=(Ab=Af.addEventListener)!=null?Ab:Af.addListener)!=null?Ac:Af.bind)!=null?Ad:Af.on;AZ=(Aa=(AY=(AW=Af.removeEventListener)!=null?AW:Af.removeListener)!=null?AY:Af.unbind)!=null?Aa:Af.off;return Y(U,"fromEventTarget",Af,Ae,U.fromBinder(function(Ag){AV.call(Af,Ae,Ag);return function(){return AZ.call(Af,Ae,Ag)}},AX))};U.fromPromise=function(AV,AW){return Y(U,"fromPromise",AV,U.fromBinder(function(AX){AV.then(AX,function(AY){return AX(new AC(AY))});return function(){if(AW){return typeof AV.abort==="function"?AV.abort():void 0}}},(function(AX){return[AX,b()]})))};U.noMore=["<no-more>"];U.more=["<more>"];U.later=function(AV,AW){return Y(U,"later",AV,AW,U.fromPoll(AV,function(){return[AW,b()]}))};U.sequentially=function(AX,AV){var AW;AW=0;return Y(U,"sequentially",AX,AV,U.fromPoll(AX,function(){var AY;AY=AV[AW++];if(AW<AV.length){return AY}else{if(AW===AV.length){return[AY,b()]}else{return b()}}}))};U.repeatedly=function(AX,AV){var AW;AW=0;return Y(U,"repeatedly",AX,AV,U.fromPoll(AX,function(){return AV[AW++%AV.length]}))};U.spy=function(AV){return N.push(AV)};N=[];I=function(AY){var AW,AX,AV;if(N.length){if(!I.running){try{I.running=true;for(AX=0,AV=N.length;AX<AV;AX++){AW=N[AX];AW(AY)}}finally{delete I.running}}}return void 0};L=function(AV){return function(){var AX,AY,AZ,AW;AZ=arguments[0],AX=2<=arguments.length?F.call(arguments,1):[];if(typeof AZ==="object"&&AX.length){AY=AZ;AW=AX[0];AZ=function(){return AY[AW].apply(AY,arguments)};AX=AX.slice(1)}return AV.apply(null,[AZ].concat(F.call(AX)))}};AP=function(AW,AV){return L(function(){var AX,AY,AZ;AY=arguments[0],AX=2<=arguments.length?F.call(arguments,1):[];AZ=w(AV,[function(Aa,Ab){return AY.apply(null,F.call(Aa).concat([Ab]))}]);return Y.apply(null,[U,AW,AY].concat(F.call(AX),[U.combineAsArray(AX).flatMap(AZ)]))})};U.fromCallback=AP("fromCallback",function(){var AV,AW;AW=arguments[0],AV=2<=arguments.length?F.call(arguments,1):[];return U.fromBinder(function(AX){u(AW,AV)(AX);return AO},(function(AX){return[AX,b()]}))});U.fromNodeCallback=AP("fromNodeCallback",function(){var AV,AW;AW=arguments[0],AV=2<=arguments.length?F.call(arguments,1):[];return U.fromBinder(function(AX){u(AW,AV)(AX);return AO},function(AX,AY){if(AX){return[new AC(AX),b()]}return[AY,b()]})});U.fromPoll=function(AV,AW){return Y(U,"fromPoll",AV,AW,U.fromBinder((function(AX){var AY;AY=U.scheduler.setInterval(AX,AV);return function(){return U.scheduler.clearInterval(AY)}}),AW))};U.interval=function(AV,AW){if(AW==null){AW={}}return Y(U,"interval",AV,AW,U.fromPoll(AV,function(){return m(AW)}))};U.constant=function(AV){return new AH(H(U,"constant",AV),function(AW){AW(E(AV));AW(b());return AO})};U.never=function(){return new M(H(U,"never"),function(AV){AV(b());return AO})};U.once=function(AV){return new M(H(U,"once",AV),function(AW){AW(D(AV));AW(b());return AO})};U.fromArray=function(AV){var AW;p(AV);if(!AV.length){return Y(U,"fromArray",AV,U.never())}else{AW=0;return new M(H(U,"fromArray",AV),function(Aa){var AY,AZ,AX;AX=false;AZ=U.more;AY=function(){var Ab;if((AZ!==U.noMore)&&!AX){Ab=AV[AW++];AZ=Aa(D(Ab));if(AZ!==U.noMore){if(AW===AV.length){return Aa(b())}else{return AG.afterTransaction(AY)}}}};AY();return function(){return AX=true}})}};U.mergeAll=function(){var AV;AV=1<=arguments.length?F.call(arguments,0):[];if(A(AV[0])){AV=AV[0]}if(AV.length){return new M(H.apply(null,[U,"mergeAll"].concat(F.call(AV))),function(AZ){var AX,AW,AY;AX=0;AY=function(Aa){return function(Ab){return Aa.dispatcher.subscribe(function(Ad){var Ac;if(Ad.isEnd()){AX++;if(AX===AV.length){return AZ(b())}else{return U.more}}else{Ac=AZ(Ad);if(Ac===U.noMore){Ab()}return Ac}})}};AW=h.map(AY,AV);return l.apply(null,AW)})}else{return U.never()}};U.zipAsArray=function(){var AV;AV=1<=arguments.length?F.call(arguments,0):[];if(A(AV[0])){AV=AV[0]}return Y.apply(null,[U,"zipAsArray"].concat(F.call(AV),[U.zipWith(AV,function(){var AW;AW=1<=arguments.length?F.call(arguments,0):[];return AW})]))};U.zipWith=function(){var AW,AX,AV;AW=arguments[0],AX=2<=arguments.length?F.call(arguments,1):[];if(!AI(AW)){AV=[AW,AX[0]],AX=AV[0],AW=AV[1]}AX=h.map((function(AY){return AY.toEventStream()}),AX);return Y.apply(null,[U,"zipWith",AW].concat(F.call(AX),[U.when(AX,AW)]))};U.groupSimultaneous=function(){var AW,AV,AX;AX=1<=arguments.length?F.call(arguments,0):[];if(AX.length===1&&A(AX[0])){AX=AX[0]}AV=(function(){var Aa,AZ,AY;AY=[];for(Aa=0,AZ=AX.length;Aa<AZ;Aa++){AW=AX[Aa];AY.push(new AJ(AW))}return AY})();return Y.apply(null,[U,"groupSimultaneous"].concat(F.call(AX),[U.when(AV,(function(){var AY;AY=1<=arguments.length?F.call(arguments,0):[];return AY}))]))};U.combineAsArray=function(){var AX,AY,AW,Aa,Ab,AZ,AV;Ab=1<=arguments.length?F.call(arguments,0):[];if(Ab.length===1&&A(Ab[0])){Ab=Ab[0]}for(AX=AZ=0,AV=Ab.length;AZ<AV;AX=++AZ){Aa=Ab[AX];if(!(AA(Aa))){Ab[AX]=U.constant(Aa)}}if(Ab.length){AW=(function(){var Ae,Ad,Ac;Ac=[];for(Ae=0,Ad=Ab.length;Ae<Ad;Ae++){AY=Ab[Ae];Ac.push(new AL(AY,true))}return Ac})();return Y.apply(null,[U,"combineAsArray"].concat(F.call(Ab),[U.when(AW,(function(){var Ac;Ac=1<=arguments.length?F.call(arguments,0):[];return Ac})).toProperty()]))}else{return U.constant([])}};U.onValues=function(){var AW,AX,AV;AX=2<=arguments.length?F.call(arguments,0,AV=arguments.length-1):(AV=0,[]),AW=arguments[AV++];return U.combineAsArray(AX).onValues(AW)};U.combineWith=function(){var AV,AW;AV=arguments[0],AW=2<=arguments.length?F.call(arguments,1):[];return Y.apply(null,[U,"combineWith",AV].concat(F.call(AW),[U.combineAsArray(AW).map(function(AX){return AV.apply(null,AX)})]))};U.combineTemplate=function(Ac){var AX,AY,Ae,Ad,AW,Aa,AV,Ab,AZ,Af;AV=[];Af=[];Aa=function(Ag){return Ag[Ag.length-1]};AZ=function(Ag,Ah,Ai){return Aa(Ag)[Ah]=Ai};AX=function(Ah,Ag){return function(Aj,Ai){return AZ(Aj,Ah,Ai[Ag])}};AW=function(Ag,Ah){return function(Ai){return AZ(Ai,Ag,Ah)}};Ab=function(Ag){if(A(Ag)){return[]}else{return{}}};Ae=function(Ah,Ai){var Aj,Ag;if(AA(Ai)){Af.push(Ai);return AV.push(AX(Ah,Af.length-1))}else{if(Ai===Object(Ai)&&typeof Ai!=="function"&&!(Ai instanceof RegExp)&&!(Ai instanceof Date)){Ag=function(Ak){return function(Al){var Am;Am=Ab(Ai);AZ(Al,Ak,Am);return Al.push(Am)}};Aj=function(Ak){return Ak.pop()};AV.push(Ag(Ah));Ad(Ai);return AV.push(Aj)}else{return AV.push(AW(Ah,Ai))}}};Ad=function(Ag){return h.each(Ag,Ae)};Ad(Ac);AY=function(Aj){var Ai,Al,Ag,Ak,Ah;Ag=Ab(Ac);Ai=[Ag];for(Ak=0,Ah=AV.length;Ak<Ah;Ak++){Al=AV[Ak];Al(Ai,Aj)}return Ag};return Y(U,"combineTemplate",Ac,U.combineAsArray(Af).map(AY))};U.retry=function(AY){var AX,Aa,Ab,AW,AV,AZ;if(!AI(AY.source)){throw new f("'source' option has to be a function")}AZ=AY.source;AW=AY.retries||0;Ab=AY.maxRetries||AW;AX=AY.delay||function(){return 0};Aa=AY.isRetryable||function(){return true};AV=function(Ad){var Ae,Ac;Ac={source:AZ,retries:AW-1,maxRetries:Ab,delay:AX,isRetryable:Aa};Ae=function(){return U.retry(Ac)};return U.later(AX(Ad)).filter(false).concat(U.once().flatMap(Ae))};return Y(U,"retry",AY,AZ().flatMapError(function(Ac){if(Aa(Ac)&&AW>0){return AV({error:Ac,retriesDone:Ab-AW})}else{return U.once(new AC(Ac))}}))};O=0;a=(function(){function AV(){this.id=++O}AV.prototype.isEvent=function(){return true};AV.prototype.isEnd=function(){return false};AV.prototype.isInitial=function(){return false};AV.prototype.isNext=function(){return false};AV.prototype.isError=function(){return false};AV.prototype.hasValue=function(){return false};AV.prototype.filter=function(){return true};AV.prototype.inspect=function(){return this.toString()};AV.prototype.log=function(){return this.toString()};return AV})();AB=(function(AW){C(AV,AW);function AV(AY,AX){AV.__super__.constructor.call(this);if(!AX&&AI(AY)||AY instanceof AV){this.valueF=AY;this.valueInternal=void 0}else{this.valueF=void 0;this.valueInternal=AY}}AV.prototype.isNext=function(){return true};AV.prototype.hasValue=function(){return true};AV.prototype.value=function(){if(this.valueF instanceof AV){this.valueInternal=this.valueF.value();this.valueF=void 0}else{if(this.valueF){this.valueInternal=this.valueF();this.valueF=void 0}}return this.valueInternal};AV.prototype.fmap=function(AZ){var AX,AY;if(this.valueInternal){AY=this.valueInternal;return this.apply(function(){return AZ(AY)})}else{AX=this;return this.apply(function(){return AZ(AX.value())})}};AV.prototype.apply=function(AX){return new AV(AX)};AV.prototype.filter=function(AX){return AX(this.value())};AV.prototype.toString=function(){return h.toString(this.value())};AV.prototype.log=function(){return this.value()};return AV})(a);AE=(function(AW){C(AV,AW);function AV(){return AV.__super__.constructor.apply(this,arguments)}AV.prototype.isInitial=function(){return true};AV.prototype.isNext=function(){return false};AV.prototype.apply=function(AX){return new AV(AX)};AV.prototype.toNext=function(){return new AB(this)};return AV})(AB);c=(function(AV){C(AW,AV);function AW(){return AW.__super__.constructor.apply(this,arguments)}AW.prototype.isEnd=function(){return true};AW.prototype.fmap=function(){return this};AW.prototype.apply=function(){return this};AW.prototype.toString=function(){return"<end>"};return AW})(a);AC=(function(AV){C(AW,AV);function AW(AX){this.error=AX}AW.prototype.isError=function(){return true};AW.prototype.fmap=function(){return this};AW.prototype.apply=function(){return this};AW.prototype.toString=function(){return"<error> "+h.toString(this.error)};return AW})(a);R=0;Q=(function(){function AV(AW){this.id=++R;Y(AW,this);this.initialDesc=this.desc}AV.prototype.subscribe=function(AW){return AG.wrappedSubscribe(this,AW)};AV.prototype.subscribeInternal=function(AW){return this.dispatcher.subscribe(AW)};AV.prototype.onValue=function(){var AW;AW=g(arguments);return this.subscribe(function(AX){if(AX.hasValue()){return AW(AX.value())}})};AV.prototype.onValues=function(AW){return this.onValue(function(AX){return AW.apply(null,AX)})};AV.prototype.onError=function(){var AW;AW=g(arguments);return this.subscribe(function(AX){if(AX.isError()){return AW(AX.error)}})};AV.prototype.onEnd=function(){var AW;AW=g(arguments);return this.subscribe(function(AX){if(AX.isEnd()){return AW()}})};AV.prototype.errors=function(){return Y(this,"errors",this.filter(function(){return false}))};AV.prototype.filter=function(){var AW,AX;AX=arguments[0],AW=2<=arguments.length?F.call(arguments,1):[];return e(this,AX,AW,function(AY){return Y(this,"filter",AY,this.withHandler(function(AZ){if(AZ.filter(AY)){return this.push(AZ)}else{return U.more}}))})};AV.prototype.takeWhile=function(){var AW,AX;AX=arguments[0],AW=2<=arguments.length?F.call(arguments,1):[];return e(this,AX,AW,function(AY){return Y(this,"takeWhile",AY,this.withHandler(function(AZ){if(AZ.filter(AY)){return this.push(AZ)}else{this.push(b());return U.noMore}}))})};AV.prototype.endOnError=function(){var AW,AX;AX=arguments[0],AW=2<=arguments.length?F.call(arguments,1):[];if(AX==null){AX=true}return e(this,AX,AW,function(AY){return Y(this,"endOnError",this.withHandler(function(AZ){if(AZ.isError()&&AY(AZ.error)){this.push(AZ);return this.push(b())}else{return this.push(AZ)}}))})};AV.prototype.take=function(AW){if(AW<=0){return U.never()}return Y(this,"take",AW,this.withHandler(function(AX){if(!AX.hasValue()){return this.push(AX)}else{AW--;if(AW>0){return this.push(AX)}else{if(AW===0){this.push(AX)}this.push(b());return U.noMore}}}))};AV.prototype.map=function(){var AW,AX;AX=arguments[0],AW=2<=arguments.length?F.call(arguments,1):[];if(AX instanceof AH){return AX.sampledBy(this,j)}else{return e(this,AX,AW,function(AY){return Y(this,"map",AY,this.withHandler(function(AZ){return this.push(AZ.fmap(AY))}))})}};AV.prototype.mapError=function(){var AW;AW=g(arguments);return Y(this,"mapError",AW,this.withHandler(function(AX){if(AX.isError()){return this.push(m(AW(AX.error)))}else{return this.push(AX)}}))};AV.prototype.mapEnd=function(){var AW;AW=g(arguments);return Y(this,"mapEnd",AW,this.withHandler(function(AX){if(AX.isEnd()){this.push(m(AW(AX)));this.push(b());return U.noMore}else{return this.push(AX)}}))};AV.prototype.doAction=function(){var AW;AW=g(arguments);return Y(this,"doAction",AW,this.withHandler(function(AX){if(AX.hasValue()){AW(AX.value())}return this.push(AX)}))};AV.prototype.skip=function(AW){return Y(this,"skip",AW,this.withHandler(function(AX){if(!AX.hasValue()){return this.push(AX)}else{if(AW>0){AW--;return U.more}else{return this.push(AX)}}}))};AV.prototype.skipDuplicates=function(AW){if(AW==null){AW=function(AY,AX){return AY===AX}}return Y(this,"skipDuplicates",this.withStateMachine(K,function(AY,AX){if(!AX.hasValue()){return[AY,[AX]]}else{if(AX.isInitial()||AY===K||!AW(AY.get(),AX.value())){return[new d(AX.value()),[AX]]}else{return[AY,[]]}}}))};AV.prototype.skipErrors=function(){return Y(this,"skipErrors",this.withHandler(function(AW){if(AW.isError()){return U.more}else{return this.push(AW)}}))};AV.prototype.withStateMachine=function(AW,AY){var AX;AX=AW;return Y(this,"withStateMachine",AW,AY,this.withHandler(function(Ad){var Ac,Af,Aa,Ag,Ab,Ae,AZ;Ac=AY(AX,Ad);Af=Ac[0],Ag=Ac[1];AX=Af;Ab=U.more;for(Ae=0,AZ=Ag.length;Ae<AZ;Ae++){Aa=Ag[Ae];Ab=this.push(Aa);if(Ab===U.noMore){return Ab}}return Ab}))};AV.prototype.scan=function(AX,AZ){var AY,Aa,AW;AZ=T(AZ);AY=q(AX);AW=(function(Ab){return function(Ag){var Af,Ae,Ad,Ac;Af=false;Ac=AO;Ae=U.more;Ad=function(){if(!Af){return AY.forEach(function(Ah){Af=true;Ae=Ag(new AE(function(){return Ah}));if(Ae===U.noMore){Ac();return Ac=AO}})}};Ac=Ab.dispatcher.subscribe(function(Aj){var Ah,Ai;if(Aj.hasValue()){if(Af&&Aj.isInitial()){return U.more}else{if(!Aj.isInitial()){Ad()}Af=true;Ai=AY.getOrElse(void 0);Ah=AZ(Ai,Aj.value());AY=new d(Ah);return Ag(Aj.apply(function(){return Ah}))}}else{if(Aj.isEnd()){Ae=Ad()}if(Ae!==U.noMore){return Ag(Aj)}}});AG.whenDoneWith(Aa,Ad);return Ac}})(this);return Aa=new AH(H(this,"scan",AX,AZ),AW)};AV.prototype.fold=function(AW,AX){return Y(this,"fold",AW,AX,this.scan(AW,AX).sampledBy(this.filter(false).mapEnd().toProperty()))};AV.prototype.zip=function(AW,AX){if(AX==null){AX=Array}return Y(this,"zip",AW,U.zipWith([this,AW],AX))};AV.prototype.diff=function(AX,AW){AW=T(AW);return Y(this,"diff",AX,AW,this.scan([AX],function(AY,AZ){return[AZ,AW(AY[0],AZ)]}).filter(function(AY){return AY.length===2}).map(function(AY){return AY[1]}))};AV.prototype.flatMap=function(){return AM(this,t(arguments))};AV.prototype.flatMapFirst=function(){return AM(this,t(arguments),true)};AV.prototype.flatMapWithConcurrencyLimit=function(){var AX,AW;AW=arguments[0],AX=2<=arguments.length?F.call(arguments,1):[];return Y.apply(null,[this,"flatMapWithConcurrencyLimit",AW].concat(F.call(AX),[AM(this,t(AX),false,AW)]))};AV.prototype.flatMapLatest=function(){var AW,AX;AW=t(arguments);AX=this.toEventStream();return Y(this,"flatMapLatest",AW,AX.flatMap(function(AY){return o(AW(AY)).takeUntil(AX)}))};AV.prototype.flatMapError=function(AW){return Y(this,"flatMapError",AW,this.mapError(function(AX){return new AC(AX)}).flatMap(function(AX){if(AX instanceof AC){return AW(AX.error)}else{return U.once(AX)}}))};AV.prototype.flatMapConcat=function(){return Y.apply(null,[this,"flatMapConcat"].concat(F.call(arguments),[this.flatMapWithConcurrencyLimit.apply(this,[1].concat(F.call(arguments)))]))};AV.prototype.bufferingThrottle=function(AW){return Y(this,"bufferingThrottle",AW,this.flatMapConcat(function(AX){return U.once(AX).concat(U.later(AW).filter(false))}))};AV.prototype.not=function(){return Y(this,"not",this.map(function(AW){return !AW}))};AV.prototype.log=function(){var AW;AW=1<=arguments.length?F.call(arguments,0):[];this.subscribe(function(AX){return typeof console!=="undefined"&&console!==null?typeof console.log==="function"?console.log.apply(console,F.call(AW).concat([AX.log()])):void 0:void 0});return this};AV.prototype.slidingWindow=function(AX,AW){if(AW==null){AW=0}return Y(this,"slidingWindow",AX,AW,this.scan([],(function(AY,AZ){return AY.concat([AZ]).slice(-AX)})).filter((function(AY){return AY.length>=AW})))};AV.prototype.combine=function(AW,AY){var AX;AX=T(AY);return Y(this,"combine",AW,AY,U.combineAsArray(this,AW).map(function(AZ){return AX(AZ[0],AZ[1])}))};AV.prototype.decode=function(AW){return Y(this,"decode",AW,this.combine(U.combineTemplate(AW),function(AY,AX){return AX[AY]}))};AV.prototype.awaiting=function(AW){return Y(this,"awaiting",AW,U.groupSimultaneous(this,AW).map(function(AX){var AY,AZ;AY=AX[0],AZ=AX[1];return AZ.length===0}).toProperty(false).skipDuplicates())};AV.prototype.name=function(AW){this._name=AW;return this};AV.prototype.withDescription=function(){return H.apply(null,arguments).apply(this)};AV.prototype.toString=function(){if(this._name){return this._name}else{return this.desc.toString()}};AV.prototype.internalDeps=function(){return this.initialDesc.deps()};return AV})();Q.prototype.reduce=Q.prototype.fold;Q.prototype.assign=Q.prototype.onValue;Q.prototype.inspect=Q.prototype.toString;AM=function(AX,Ab,AY,AW){var Aa,AV,AZ;AZ=[AX];Aa=[];AV=new M(H(AX,"flatMap"+(AY?"First":""),Ab),function(Ae){var Ag,Af,Ah,Ac,Ad;Ah=new AN();Ac=[];Ad=function(Ai){var Aj;Aj=o(Ab(Ai.value()));Aa.push(Aj);return Ah.add(function(Al,Ak){return Aj.dispatcher.subscribe(function(An){var Am;if(An.isEnd()){h.remove(Aj,Aa);Af();Ag(Ak);return U.noMore}else{if(An instanceof AE){An=An.toNext()}Am=Ae(An);if(Am===U.noMore){Al()}return Am}})})};Af=function(){var Ai;Ai=Ac.shift();if(Ai){return Ad(Ai)}};Ag=function(Ai){Ai();if(Ah.empty()){return Ae(b())}};Ah.add(function(Aj,Ai){return AX.dispatcher.subscribe(function(Ak){if(Ak.isEnd()){return Ag(Ai)}else{if(Ak.isError()){return Ae(Ak)}else{if(AY&&Ah.count()>1){return U.more}else{if(Ah.unsubscribed){return U.noMore}if(AW&&Ah.count()>AW){return Ac.push(Ak)}else{return Ad(Ak)}}}}})});return Ah.unsubscribe});AV.internalDeps=function(){if(Aa.length){return AZ.concat(Aa)}else{return AZ}};return AV};M=(function(AW){C(AV,AW);function AV(AZ,AX,AY){if(AI(AZ)){AY=AX;AX=AZ;AZ=[]}AV.__super__.constructor.call(this,AZ);AK(AX);this.dispatcher=new Z(AX,AY);I(this)}AV.prototype.delay=function(AX){return Y(this,"delay",AX,this.flatMap(function(AY){return U.later(AX,AY)}))};AV.prototype.debounce=function(AX){return Y(this,"debounce",AX,this.flatMapLatest(function(AY){return U.later(AX,AY)}))};AV.prototype.debounceImmediate=function(AX){return Y(this,"debounceImmediate",AX,this.flatMapFirst(function(AY){return U.once(AY).concat(U.later(AX).filter(false))}))};AV.prototype.throttle=function(AX){return Y(this,"throttle",AX,this.bufferWithTime(AX).map(function(AY){return AY[AY.length-1]}))};AV.prototype.bufferWithTime=function(AX){return Y(this,"bufferWithTime",AX,this.bufferWithTimeOrCount(AX,Number.MAX_VALUE))};AV.prototype.bufferWithCount=function(AX){return Y(this,"bufferWithCount",AX,this.bufferWithTimeOrCount(void 0,AX))};AV.prototype.bufferWithTimeOrCount=function(AX,AY){var AZ;AZ=function(Aa){if(Aa.values.length===AY){return Aa.flush()}else{if(AX!==void 0){return Aa.schedule()}}};return Y(this,"bufferWithTimeOrCount",AX,AY,this.buffer(AX,AZ,AZ))};AV.prototype.buffer=function(AZ,Ab,AY){var AX,Ac,Aa;if(Ab==null){Ab=AO}if(AY==null){AY=AO}AX={scheduled:false,end:void 0,values:[],flush:function(){var Ad;this.scheduled=false;if(this.values.length>0){Ad=this.push(m(this.values));this.values=[];if(this.end!=null){return this.push(this.end)}else{if(Ad!==U.noMore){return AY(this)}}}else{if(this.end!=null){return this.push(this.end)}}},schedule:function(){if(!this.scheduled){this.scheduled=true;return AZ((function(Ad){return function(){return Ad.flush()}})(this))}}};Aa=U.more;if(!AI(AZ)){Ac=AZ;AZ=function(Ad){return U.scheduler.setTimeout(Ad,Ac)}}return Y(this,"buffer",this.withHandler(function(Ad){AX.push=(function(Ae){return function(Af){return Ae.push(Af)}})(this);if(Ad.isError()){Aa=this.push(Ad)}else{if(Ad.isEnd()){AX.end=Ad;if(!AX.scheduled){AX.flush()}}else{AX.values.push(Ad.value());Ab(AX)}}return Aa}))};AV.prototype.merge=function(AX){var AY;v(AX);AY=this;return Y(AY,"merge",AX,U.mergeAll(this,AX))};AV.prototype.toProperty=function(AX){var AY,AZ;AZ=arguments.length===0?K:q(function(){return AX});AY=this.dispatcher;return new AH(H(this,"toProperty",AX),function(Ae){var Ad,Ac,Ab,Aa;Ad=false;Aa=AO;Ac=U.more;Ab=function(){if(!Ad){return AZ.forEach(function(Af){Ad=true;Ac=Ae(new AE(Af));if(Ac===U.noMore){Aa();return Aa=AO}})}};Aa=AY.subscribe(function(Af){if(Af.hasValue()){if(Ad&&Af.isInitial()){return U.more}else{if(!Af.isInitial()){Ab()}Ad=true;AZ=new d(Af);return Ae(Af)}}else{if(Af.isEnd()){Ac=Ab()}if(Ac!==U.noMore){return Ae(Af)}}});Ab();return Aa})};AV.prototype.toEventStream=function(){return this};AV.prototype.sampledBy=function(AX,AY){return Y(this,"sampledBy",AX,AY,this.toProperty().sampledBy(AX,AY))};AV.prototype.concat=function(AX){var AY;AY=this;return new AV(H(AY,"concat",AX),function(Aa){var Ab,AZ;AZ=AO;Ab=AY.dispatcher.subscribe(function(Ac){if(Ac.isEnd()){return AZ=AX.dispatcher.subscribe(Aa)}else{return Aa(Ac)}});return function(){Ab();return AZ()}})};AV.prototype.takeUntil=function(AX){var AY;AY={};return Y(this,"takeUntil",AX,U.groupSimultaneous(this.mapEnd(AY),AX.skipErrors()).withHandler(function(Ac){var Af,Ab,Ae,Ad,Aa,AZ;if(!Ac.hasValue()){return this.push(Ac)}else{AZ=Ac.value(),Af=AZ[0],AX=AZ[1];if(AX.length){return this.push(b())}else{Ab=U.more;for(Ad=0,Aa=Af.length;Ad<Aa;Ad++){Ae=Af[Ad];if(Ae===AY){Ab=this.push(b())}else{Ab=this.push(m(Ae))}}return Ab}}}))};AV.prototype.skipUntil=function(AY){var AX;AX=AY.take(1).map(true).toProperty(false);return Y(this,"skipUntil",AY,this.filter(AX))};AV.prototype.skipWhile=function(){var AX,AZ,AY;AZ=arguments[0],AX=2<=arguments.length?F.call(arguments,1):[];AY=false;return e(this,AZ,AX,function(Aa){return Y(this,"skipWhile",Aa,this.withHandler(function(Ab){if(AY||!Ab.hasValue()||!Aa(Ab.value())){if(Ab.hasValue()){AY=true}return this.push(Ab)}else{return U.more}}))})};AV.prototype.holdWhen=function(Aa){var AY,AX,AZ;AZ=Aa.startWith(false);AX=AZ.filter(function(Ab){return !Ab});AY=AZ.filter(h.id);return Y(this,"holdWhen",Aa,this.filter(false).merge(AZ.flatMapConcat((function(Ab){return function(Ac){if(!Ac){return Ab.takeUntil(AY)}else{return Ab.scan([],(function(Ae,Ad){return Ae.concat(Ad)})).sampledBy(AX).take(1).flatMap(U.fromArray)}}})(this))))};AV.prototype.startWith=function(AX){return Y(this,"startWith",AX,U.once(AX).concat(this))};AV.prototype.withHandler=function(AX){return new AV(H(this,"withHandler",AX),this.dispatcher.subscribe,AX)};return AV})(Q);AH=(function(AV){C(AW,AV);function AW(AZ,AX,AY){if(AI(AZ)){AY=AX;AX=AZ;AZ=[]}AW.__super__.constructor.call(this,AZ);AK(AX);this.dispatcher=new W(this,AX,AY);I(this)}AW.prototype.sampledBy=function(AZ,Ac){var AY,AX,Aa,Ad,Ab;if(Ac!=null){Ac=T(Ac)}else{AY=true;Ac=function(Ae){return Ae.value()}}Ab=new AL(this,false,AY);Aa=new AL(AZ,true,AY);Ad=U.when([Ab,Aa],Ac);AX=AZ instanceof AW?Ad.toProperty():Ad;return Y(this,"sampledBy",AZ,Ac,AX)};AW.prototype.sample=function(AX){return Y(this,"sample",AX,this.sampledBy(U.interval(AX,{})))};AW.prototype.changes=function(){return new M(H(this,"changes"),(function(AX){return function(AY){return AX.dispatcher.subscribe(function(AZ){if(!AZ.isInitial()){return AY(AZ)}})}})(this))};AW.prototype.withHandler=function(AX){return new AW(H(this,"withHandler",AX),this.dispatcher.subscribe,AX)};AW.prototype.toProperty=function(){x(arguments);return this};AW.prototype.toEventStream=function(){return new M(H(this,"toEventStream"),(function(AX){return function(AY){return AX.dispatcher.subscribe(function(AZ){if(AZ.isInitial()){AZ=AZ.toNext()}return AY(AZ)})}})(this))};AW.prototype.and=function(AX){return Y(this,"and",AX,this.combine(AX,function(AY,AZ){return AY&&AZ}))};AW.prototype.or=function(AX){return Y(this,"or",AX,this.combine(AX,function(AY,AZ){return AY||AZ}))};AW.prototype.delay=function(AX){return this.delayChanges("delay",AX,function(AY){return AY.delay(AX)})};AW.prototype.debounce=function(AX){return this.delayChanges("debounce",AX,function(AY){return AY.debounce(AX)})};AW.prototype.throttle=function(AX){return this.delayChanges("throttle",AX,function(AY){return AY.throttle(AX)})};AW.prototype.delayChanges=function(){var AZ,AY,AX;AZ=2<=arguments.length?F.call(arguments,0,AX=arguments.length-1):(AX=0,[]),AY=arguments[AX++];return Y.apply(null,[this].concat(F.call(AZ),[V(this,AY(this.changes()))]))};AW.prototype.takeUntil=function(AY){var AX;AX=this.changes().takeUntil(AY);return Y(this,"takeUntil",AY,V(this,AX))};AW.prototype.startWith=function(AX){return Y(this,"startWith",AX,this.scan(AX,function(AZ,AY){return AY}))};AW.prototype.bufferingThrottle=function(){var AX;return(AX=AW.__super__.bufferingThrottle.apply(this,arguments)).bufferingThrottle.apply(AX,arguments).toProperty()};return AW})(Q);e=function(AZ,AX,AV,AY){var AW;if(AX instanceof AH){AW=AX.sampledBy(AZ,function(Ab,Aa){return[Ab,Aa]});return AY.call(AW,function(Aa){var Ac,Ab;Ac=Aa[0],Ab=Aa[1];return Ac}).map(function(Aa){var Ac,Ab;Ac=Aa[0],Ab=Aa[1];return Ab})}else{AX=u(AX,AV);return AY.call(AZ,AX)}};V=function(AW,AX){var AV;AV=new M(H(AW,"justInitValue"),function(Aa){var AY,AZ;AZ=void 0;AY=AW.dispatcher.subscribe(function(Ab){if(!Ab.isEnd()){AZ=Ab}return U.noMore});AG.whenDoneWith(AV,function(){if(AZ!=null){Aa(AZ)}return Aa(b())});return AY});return AV.concat(AX).toProperty()};Z=(function(){function AV(AW,AX){this._subscribe=AW;this._handleEvent=AX;this.subscribe=AD(this.subscribe,this);this.handleEvent=AD(this.handleEvent,this);this.subscriptions=[];this.queue=[];this.pushing=false;this.ended=false;this.prevError=void 0;this.unsubSrc=void 0}AV.prototype.hasSubscribers=function(){return this.subscriptions.length>0};AV.prototype.removeSub=function(AW){return this.subscriptions=h.without(AW,this.subscriptions)};AV.prototype.push=function(AW){if(AW.isEnd()){this.ended=true}return AG.inTransaction(AW,this,this.pushIt,[AW])};AV.prototype.pushToSubscriptions=function(Aa){var Ac,AZ,AY,AX,Ab,AW;try{AX=this.subscriptions;for(Ab=0,AW=AX.length;Ab<AW;Ab++){AY=AX[Ab];AZ=AY.sink(Aa);if(AZ===U.noMore||Aa.isEnd()){this.removeSub(AY)}}return true}catch(Ad){Ac=Ad;this.pushing=false;this.queue=[];throw Ac}};AV.prototype.pushIt=function(AW){if(!this.pushing){if(AW===this.prevError){return }if(AW.isError()){this.prevError=AW}this.pushing=true;this.pushToSubscriptions(AW);this.pushing=false;while(this.queue.length){AW=this.queue.shift();this.push(AW)}if(this.hasSubscribers()){return U.more}else{this.unsubscribeFromSource();return U.noMore}}else{this.queue.push(AW);return U.more}};AV.prototype.handleEvent=function(AW){if(this._handleEvent){return this._handleEvent(AW)}else{return this.push(AW)}};AV.prototype.unsubscribeFromSource=function(){if(this.unsubSrc){this.unsubSrc()}return this.unsubSrc=void 0};AV.prototype.subscribe=function(AX){var AW;if(this.ended){AX(b());return AO}else{AK(AX);AW={sink:AX};this.subscriptions.push(AW);if(this.subscriptions.length===1){this.unsubSrc=this._subscribe(this.handleEvent);AK(this.unsubSrc)}return(function(AY){return function(){AY.removeSub(AW);if(!AY.hasSubscribers()){return AY.unsubscribeFromSource()}}})(this)}};return AV})();W=(function(AV){C(AW,AV);function AW(AZ,AX,AY){this.property=AZ;this.subscribe=AD(this.subscribe,this);AW.__super__.constructor.call(this,AX,AY);this.current=K;this.currentValueRootId=void 0;this.propertyEnded=false}AW.prototype.push=function(AX){if(AX.isEnd()){this.propertyEnded=true}if(AX.hasValue()){this.current=new d(AX);this.currentValueRootId=AG.currentEventId()}return AW.__super__.push.call(this,AX)};AW.prototype.maybeSubSource=function(AY,AX){if(AX===U.noMore){return AO}else{if(this.propertyEnded){AY(b());return AO}else{return Z.prototype.subscribe.call(this,AY)}}};AW.prototype.subscribe=function(AZ){var Ab,AY,AX,Aa;AY=false;AX=U.more;if(this.current.isDefined&&(this.hasSubscribers()||this.propertyEnded)){Ab=AG.currentEventId();Aa=this.currentValueRootId;if(!this.propertyEnded&&Aa&&Ab&&Ab!==Aa){AG.whenDoneWith(this.property,(function(Ac){return function(){if(Ac.currentValueRootId===Aa){return AZ(E(Ac.current.get().value()))}}})(this));return this.maybeSubSource(AZ,AX)}else{AG.inTransaction(void 0,this,(function(){return AX=AZ(E(this.current.get().value()))}),[]);return this.maybeSubSource(AZ,AX)}}else{return this.maybeSubSource(AZ,AX)}};return AW})(Z);P=(function(AV){C(AW,AV);function AW(){this.guardedSink=AD(this.guardedSink,this);this.subscribeAll=AD(this.subscribeAll,this);this.unsubAll=AD(this.unsubAll,this);this.sink=void 0;this.subscriptions=[];this.ended=false;AW.__super__.constructor.call(this,H(U,"Bus"),this.subscribeAll)}AW.prototype.unsubAll=function(){var AZ,Aa,AY,AX;AX=this.subscriptions;for(Aa=0,AY=AX.length;Aa<AY;Aa++){AZ=AX[Aa];if(typeof AZ.unsub==="function"){AZ.unsub()}}return void 0};AW.prototype.subscribeAll=function(AZ){var Aa,Ab,AY,AX;this.sink=AZ;AX=y(this.subscriptions);for(Ab=0,AY=AX.length;Ab<AY;Ab++){Aa=AX[Ab];this.subscribeInput(Aa)}return this.unsubAll};AW.prototype.guardedSink=function(AX){return(function(AY){return function(AZ){if(AZ.isEnd()){AY.unsubscribeInput(AX);return U.noMore}else{return AY.sink(AZ)}}})(this)};AW.prototype.subscribeInput=function(AX){return AX.unsub=AX.input.dispatcher.subscribe(this.guardedSink(AX.input))};AW.prototype.unsubscribeInput=function(AZ){var Aa,Ab,Ac,AY,AX;AX=this.subscriptions;for(Aa=Ac=0,AY=AX.length;Ac<AY;Aa=++Ac){Ab=AX[Aa];if(Ab.input===AZ){if(typeof Ab.unsub==="function"){Ab.unsub()}this.subscriptions.splice(Aa,1);return }}};AW.prototype.plug=function(AX){var AY;S(AX);if(this.ended){return }AY={input:AX};this.subscriptions.push(AY);if((this.sink!=null)){this.subscribeInput(AY)}return(function(AZ){return function(){return AZ.unsubscribeInput(AX)}})(this)};AW.prototype.end=function(){this.ended=true;this.unsubAll();return typeof this.sink==="function"?this.sink(b()):void 0};AW.prototype.push=function(AX){return typeof this.sink==="function"?this.sink(m(AX)):void 0};AW.prototype.error=function(AX){return typeof this.sink==="function"?this.sink(new AC(AX)):void 0};return AW})(M);AL=(function(){function AV(AY,AX,AW){this.obs=AY;this.sync=AX;this.lazy=AW!=null?AW:false;this.queue=[]}AV.prototype.subscribe=function(AW){return this.obs.dispatcher.subscribe(AW)};AV.prototype.toString=function(){return this.obs.toString()};AV.prototype.markEnded=function(){return this.ended=true};AV.prototype.consume=function(){if(this.lazy){return{value:h.always(this.queue[0])}}else{return this.queue[0]}};AV.prototype.push=function(AW){return this.queue=[AW]};AV.prototype.mayHave=function(){return true};AV.prototype.hasAtLeast=function(){return this.queue.length};AV.prototype.flatten=true;return AV})();i=(function(AV){C(AW,AV);function AW(){return AW.__super__.constructor.apply(this,arguments)}AW.prototype.consume=function(){return this.queue.shift()};AW.prototype.push=function(AX){return this.queue.push(AX)};AW.prototype.mayHave=function(AX){return !this.ended||this.queue.length>=AX};AW.prototype.hasAtLeast=function(AX){return this.queue.length>=AX};AW.prototype.flatten=false;return AW})(AL);AJ=(function(AV){C(AW,AV);function AW(AX){AW.__super__.constructor.call(this,AX,true)}AW.prototype.consume=function(){var AX;AX=this.queue;this.queue=[];return{value:function(){return AX}}};AW.prototype.push=function(AX){return this.queue.push(AX.value())};AW.prototype.hasAtLeast=function(){return true};return AW})(AL);AL.isTrigger=function(AV){if(AV instanceof AL){return AV.sync}else{return AV instanceof M}};AL.fromObservable=function(AV){if(AV instanceof AL){return AV}else{if(AV instanceof AH){return new AL(AV,false)}else{return new i(AV,true)}}};H=function(){var AV,AW,AX;AW=arguments[0],AX=arguments[1],AV=3<=arguments.length?F.call(arguments,2):[];if((AW||AX) instanceof X){return AW||AX}else{return new X(AW,AX,AV)}};B=function(AV){if(A(AV)){return h.flatMap(B,AV)}else{if(AA(AV)){return[AV]}else{if(AV instanceof AL){return[AV.obs]}else{return[]}}}};X=(function(){function AV(AX,AY,AW){this.context=AX;this.method=AY;this.args=AW;this.cached=void 0}AV.prototype.deps=function(){return this.cached||(this.cached=B([this.context].concat(this.args)))};AV.prototype.apply=function(AW){AW.desc=this;return AW};AV.prototype.toString=function(){return h.toString(this.context)+"."+h.toString(this.method)+"("+h.map(h.toString,this.args)+")"};return AV})();Y=function(){var AW,AX,AV;AW=2<=arguments.length?F.call(arguments,0,AV=arguments.length-1):(AV=0,[]),AX=arguments[AV++];return H.apply(null,AW).apply(AX)};U.when=function(){var Aj,Ah,Ac,Ab,Ai,AZ,Af,Ae,Ad,AY,An,Ag,AV,Ak,Al,AX,AW,Am,Ao,Aa;if(arguments.length===0){return U.never()}Ai=arguments.length;Al="when: expecting arguments in the form (Observable+,function)+";J(Al,Ai%2===0);AV=[];Ad=[];Ah=0;AY=[];while(Ah<Ai){AY[Ah]=arguments[Ah];AY[Ah+1]=arguments[Ah+1];Ae=h.toArray(arguments[Ah]);Aj=z(arguments[Ah+1]);Af={f:Aj,ixs:[]};Ak=false;for(AX=0,Am=Ae.length;AX<Am;AX++){Ag=Ae[AX];Ac=h.indexOf(AV,Ag);if(!Ak){Ak=AL.isTrigger(Ag)}if(Ac<0){AV.push(Ag);Ac=AV.length-1}Aa=Af.ixs;for(AW=0,Ao=Aa.length;AW<Ao;AW++){Ab=Aa[AW];if(Ab.index===Ac){Ab.count++}}Af.ixs.push({index:Ac,count:1})}J("At least one EventStream required",Ak||(!Ae.length));if(Ae.length>0){Ad.push(Af)}Ah=Ah+2}if(!AV.length){return U.never()}AV=h.map(AL.fromObservable,AV);AZ=(h.any(AV,function(Ap){return Ap.flatten}))&&(AF(h.map((function(Ap){return Ap.obs}),AV)));return An=new M(H.apply(null,[U,"when"].concat(F.call(AY))),function(Aw){var Av,Au,Ap,Ar,At,Aq,As;As=[];Ap=false;Ar=function(Az){var Ay,Ax,A0;A0=Az.ixs;for(Ay=0,Ax=A0.length;Ay<Ax;Ay++){Ah=A0[Ay];if(!AV[Ah.index].hasAtLeast(Ah.count)){return false}}return true};Au=function(Ax){return !Ax.sync||Ax.ended};Av=function(Az){var Ay,Ax,A0;A0=Az.ixs;for(Ay=0,Ax=A0.length;Ay<Ax;Ay++){Ah=A0[Ay];if(!AV[Ah.index].mayHave(Ah.count)){return true}}};At=function(Ax){return !Ax.source.flatten};Aq=function(Ax){return function(Az){var Ay,A1,A0;A1=function(){return AG.whenDoneWith(An,Ay)};A0=function(){var A4,A7,A6,A3,A5,A2;if(As.length>0){A6=U.more;A3=As.pop();for(A5=0,A2=Ad.length;A5<A2;A5++){A7=Ad[A5];if(Ar(A7)){A4=(function(){var A9,BB,BA,A8;BA=A7.ixs;A8=[];for(A9=0,BB=BA.length;A9<BB;A9++){Ah=BA[A9];A8.push(AV[Ah.index].consume())}return A8})();A6=Aw(A3.e.apply(function(){var A9,A8;A8=(function(){var BB,BC,BA;BA=[];for(BB=0,BC=A4.length;BB<BC;BB++){A9=A4[BB];BA.push(A9.value())}return BA})();return A7.f.apply(A7,A8)}));if(As.length){As=h.filter(At,As)}if(A6===U.noMore){return A6}else{return A0()}}}}else{return U.more}};Ay=function(){var A2;A2=A0();if(Ap){Ap=false;if(h.all(AV,Au)||h.all(Ad,Av)){A2=U.noMore;Aw(b())}}if(A2===U.noMore){Az()}return A2};return Ax.subscribe(function(A3){var A2;if(A3.isEnd()){Ap=true;Ax.markEnded();A1()}else{if(A3.isError()){A2=Aw(A3)}else{Ax.push(A3);if(Ax.sync){As.push({source:Ax,e:A3});if(AZ||AG.hasWaiters()){A1()}else{Ay()}}}}if(A2===U.noMore){Az()}return A2||U.more})}};return l.apply(null,(function(){var Az,Ax,Ay;Ay=[];for(Az=0,Ax=AV.length;Az<Ax;Az++){Ag=AV[Az];Ay.push(Aq(Ag))}return Ay})())})};AF=function(AX,AW){var AV;if(AW==null){AW=[]}AV=function(AZ){var AY;if(h.contains(AW,AZ)){return true}else{AY=AZ.internalDeps();if(AY.length){AW.push(AZ);return h.any(AY,AV)}else{AW.push(AZ);return false}}};return h.any(AX,AV)};U.update=function(){var AX,AW,AV,AY;AW=arguments[0],AY=2<=arguments.length?F.call(arguments,1):[];AV=function(AZ){return function(){var Aa;Aa=1<=arguments.length?F.call(arguments,0):[];return function(Ab){return AZ.apply(null,[Ab].concat(Aa))}}};AX=AY.length-1;while(AX>0){if(!(AY[AX] instanceof Function)){AY[AX]=(function(AZ){return function(){return AZ}})(AY[AX])}AY[AX]=AV(AY[AX]);AX=AX-2}return Y.apply(null,[U,"update",AW].concat(F.call(AY),[U.when.apply(U,AY).scan(AW,(function(AZ,Aa){return Aa(AZ)}))]))};l=function(){var AV;AV=1<=arguments.length?F.call(arguments,0):[];return new AN(AV).unsubscribe};AN=(function(){function AV(AX){var AY,AZ,AW;if(AX==null){AX=[]}this.unsubscribe=AD(this.unsubscribe,this);this.unsubscribed=false;this.subscriptions=[];this.starting=[];for(AZ=0,AW=AX.length;AZ<AW;AZ++){AY=AX[AZ];this.add(AY)}}AV.prototype.add=function(AY){var AZ,AX,AW;if(this.unsubscribed){return }AZ=false;AX=AO;this.starting.push(AY);AW=(function(Aa){return function(){if(Aa.unsubscribed){return }AZ=true;Aa.remove(AX);return h.remove(AY,Aa.starting)}})(this);AX=AY(this.unsubscribe,AW);if(!(this.unsubscribed||AZ)){this.subscriptions.push(AX)}h.remove(AY,this.starting);return AX};AV.prototype.remove=function(AW){if(this.unsubscribed){return }if((h.remove(AW,this.subscriptions))!==void 0){return AW()}};AV.prototype.unsubscribe=function(){var AY,AZ,AX,AW;if(this.unsubscribed){return }this.unsubscribed=true;AW=this.subscriptions;for(AZ=0,AX=AW.length;AZ<AX;AZ++){AY=AW[AZ];AY()}this.subscriptions=[];return this.starting=[]};AV.prototype.count=function(){if(this.unsubscribed){return 0}return this.subscriptions.length+this.starting.length};AV.prototype.empty=function(){return this.count()===0};return AV})();U.CompositeUnsubscribe=AN;d=(function(){function AV(AW){this.value=AW}AV.prototype.getOrElse=function(){return this.value};AV.prototype.get=function(){return this.value};AV.prototype.filter=function(AW){if(AW(this.value)){return new AV(this.value)}else{return K}};AV.prototype.map=function(AW){return new AV(AW(this.value))};AV.prototype.forEach=function(AW){return AW(this.value)};AV.prototype.isDefined=true;AV.prototype.toArray=function(){return[this.value]};AV.prototype.inspect=function(){return"Some("+this.value+")"};AV.prototype.toString=function(){return this.inspect()};return AV})();K={getOrElse:function(AV){return AV},filter:function(){return K},map:function(){return K},forEach:function(){},isDefined:false,toArray:function(){return[]},inspect:function(){return"None"},toString:function(){return this.inspect()}};AG=(function(){var Aa,Ah,AW,AX,Ae,Ai,Af,Ag,Ad,AV,AY,AZ,Ab,Ac;AV=void 0;AY=[];AZ={};Ah=[];AW=0;Aa=function(Aj){if(AV){return Ah.push(Aj)}else{return Aj()}};Ab=function(Al,Aj){var Ak;if(AV){Ak=AZ[Al.id];if(Ak==null){Ak=AZ[Al.id]=[Aj];return AY.push(Al)}else{return Ak.push(Aj)}}else{return Aj()}};Ae=function(){while(AY.length>0){Af(0)}return void 0};Af=function(Al){var An,Ap,Ak,Ao,Am,Aj;Ap=AY[Al];Ak=Ap.id;Ao=AZ[Ak];AY.splice(Al,1);delete AZ[Ak];Ai(Ap);for(Am=0,Aj=Ao.length;Am<Aj;Am++){An=Ao[Am];An()}return void 0};Ai=function(Ao){var Am,An,Ak,Al,Aj;An=Ao.internalDeps();for(Al=0,Aj=An.length;Al<Aj;Al++){Am=An[Al];Ai(Am);if(AZ[Am.id]){Ak=h.indexOf(AY,Am);Af(Ak)}}return void 0};Ad=function(Am,Al,An,Ak){var Ao,Aj;if(AV){return An.apply(Al,Ak)}else{AV=Am;try{Aj=An.apply(Al,Ak);Ae()}finally{AV=void 0;while(AW<Ah.length){Ao=Ah[AW];AW++;Ao()}AW=0;Ah=[]}return Aj}};AX=function(){if(AV){return AV.id}else{return void 0}};Ac=function(Ao,An){var Am,Aj,Al,Ak;Ak=false;Aj=false;Am=function(){return Aj=true};Al=function(){Ak=true;return Am()};Am=Ao.dispatcher.subscribe(function(Ap){return Aa(function(){var Aq;if(!Ak){Aq=An(Ap);if(Aq===U.noMore){return Al()}}})});if(Aj){Am()}return Al};Ag=function(){return AY.length>0};return{whenDoneWith:Ab,hasWaiters:Ag,inTransaction:Ad,currentEventId:AX,wrappedSubscribe:Ac,afterTransaction:Aa}})();U.EventStream=M;U.Property=AH;U.Observable=Q;U.Bus=P;U.Initial=AE;U.Next=AB;U.End=c;U.Error=AC;AO=function(){};AS=function(AW,AV){return AV};j=function(AV,AW){return AV};E=function(AV){return new AE(AV,true)};m=function(AV){return new AB(AV,true)};b=function(){return new c()};D=function(AV){if(AV instanceof a){return AV}else{return m(AV)}};y=function(AV){return AV.slice(0)};J=function(AV,AW){if(!AW){throw new f(AV)}};v=function(AV){if(!(AV instanceof M)){throw new f("not an EventStream : "+AV)}};S=function(AV){if(!(AV instanceof Q)){throw new f("not an Observable : "+AV)}};AK=function(AV){return J("not a function : "+AV,AI(AV))};AI=function(AV){return typeof AV==="function"};A=function(AV){return AV instanceof Array};AA=function(AV){return AV instanceof Q};p=function(AV){if(!A(AV)){throw new f("not an array : "+AV)}};x=function(AV){return J("no arguments supported",AV.length===0)};s=function(AV){if(typeof AV!=="string"){throw new f("not a string : "+AV)}};w=function(AW,AV){return function(){var AX;AX=1<=arguments.length?F.call(arguments,0):[];return AW.apply(null,AV.concat(AX))}};t=function(AV){if(AV.length===1&&AA(AV[0])){return h.always(AV[0])}else{return g(AV)}};g=function(AV){AV=Array.prototype.slice.call(AV);return G.apply(null,AV)};G=L(function(){var AV,AW;AW=arguments[0],AV=2<=arguments.length?F.call(arguments,1):[];if(AI(AW)){if(AV.length){return w(AW,AV)}else{return AW}}else{if(AR(AW)){return n(AW,AV)}else{return h.always(AW)}}});u=function(AW,AV){return G.apply(null,[AW].concat(F.call(AV)))};z=function(AV){if(AI(AV)){return AV}else{return h.always(AV)}};o=function(AV){if(AA(AV)){return AV}else{return U.once(AV)}};AR=function(AV){return(typeof AV==="string")&&AV.length>1&&AV.charAt(0)==="."};U.isFieldKey=AR;n=function(AX,AV){var AW,AY;AY=AX.slice(1).split(".");AW=h.map(k(AV),AY);return function(Ab){var Aa,AZ;for(Aa=0,AZ=AW.length;Aa<AZ;Aa++){AX=AW[Aa];Ab=AX(Ab)}return Ab}};k=function(AV){return function(AW){return function(AY){var AX;if(AY==null){return void 0}else{AX=AY[AW];if(AI(AX)){return AX.apply(AY,AV)}else{return AX}}}}};AQ=function(AV){return AV.slice(1)};T=function(AW){var AV;if(AI(AW)){return AW}else{if(AR(AW)){AV=AQ(AW);return function(AY,AX){return AY[AV](AX)}}else{return J("not a function or a field key: "+AW,false)}}};q=function(AV){if(AV instanceof d||AV===K){return AV}else{return new d(AV)}};if((typeof define!=="undefined"&&define!==null)&&(define.amd!=null)){define([],function(){return U});this.Bacon=U}else{if((typeof module!=="undefined"&&module!==null)&&(module.exports!=null)){module.exports=U;U.Bacon=U}else{this.Bacon=U}}}).call(this);; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:baconjs', location = '/static/lib/Bacon-AMD.js' */ define("bacon",["jquery"],function(B){var A=window.Bacon||window.module.exports;B.fn.asEventStream=A.$.asEventStream;return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:bacon-util', location = '/static/util/bacon.js' */ define("util/bacon",["aui","bacon","jquery","lodash","util/events","util/function","util/performance","exports"],function(J,A,E,L,M,I,H,D){D.events=function F(N){return A.fromBinder(function(O){return M.chain().on(N,O).destroy})};D.keyboardEvents=function K(N,O){var P=A.fromBinder(function(R){var Q=[];Q.push(M.chain().on("stash.keyboard.shortcuts."+N,function(T){var S=this.execute?this:J.whenIType(T);S.execute(R);if(O){Q.push(S.unbind)}}).destroy);return L.partial(I.applyAll,Q)});if(!O){P.onValue(jQuery.noop)}return P};D.split=function G(O,N){return A.fromBinder(function(S){var P=[];var Q;var R=[];R.push(O.onValue(function(T){var U=N(T);if(Q&&U!==Q){S(P);P=[]}Q=U;P.push(T)}));R.push(O.onEnd(function(){if(P.length>0){S(P)}S(new A.End())}));return L.partial(I.applyAll,R)})};D.toArray=function C(O){var N=[];O.onValue(function(P){N.push(P)});return N};D.getWindowScrollProperty=L.once(function(){var N=E(window);function P(){return{left:N.scrollLeft(),top:N.scrollTop()}}var O=A.fromBinder(function(S){var R=H.enqueueCapped(requestAnimationFrame,S);var Q=L.debounce(R,20);N.on("scroll",R).on("scroll",Q);return function(){N.off("scroll",R).off("scroll",Q)}}).map(P).skipDuplicates(function(R,Q){return R.left===Q.left&&R.top===Q.top}).toProperty(P());O.onValue(E.noop);return O});D.getWindowSizeProperty=L.once(function(){var O=E(window);var N=A.fromBinder(function(Q){var P=M.chain().on("window.resize",function(R,S){Q(new A.Next({width:R,height:S}))});return function(){P.destroy()}}).toProperty({width:O.width(),height:O.height()});N.onValue(E.noop);return N});D.takeBetween=function B(T,V){var N=V.start;var Q=V.end;var U=V.startInclusive;var S=V.endInclusive;var O=V.equals||function(X,W){return X===W};if(O(N,Q)){if(U||S){return T.skipWhile(function(W){return !O(W,N)}).take(1)}return A.never()}var P,R;return T.skipWhile(function(W){if(R||P){return false}if(O(W,N)){P=true;return !U}if(O(W,Q)){R=true;return !S}return true}).takeWhile(function(W){if(O(W,N)){P=true;return U}if(O(W,Q)){R=true;return S}return !(R&&P)})}});; ;/* module-key = 'com.atlassian.stash.stash-page-data-plugin:page-data-loader', location = '/static/util/page-data-loader.js' */ var _PageDataPlugin=(function(){var B=Object.prototype.hasOwnProperty;var F=jQuery;var E={};var A={};function D(J,I){for(var K in I){if(B.call(I,K)){var L=A[K]||(A[K]={});var M=L[J]||(L[J]=F.Deferred());var H=E[K]||(E[K]={});H[J]=I[K];if(M.state()!=="pending"){throw new Error("Attempt to set context "+J+" for plugin key "+K+" multiple times.")}M.resolve(H[J])}}}function C(J,I){var H=Array.prototype.slice.call(arguments,2);var K=A[J]||(A[J]={});var L=K[I]||(K[I]=F.Deferred());H.forEach(function(M){L.done(M)});return L}function G(){F.each(A,function(I,H){F.each(H,function(J,K){K.reject(E[I]?new Error("Provider "+I+" not included with context "+J):new Error("Provider "+I+" not included on page."))})})}F(document).ready(G);return{load:D,data:E,ready:C,_domReady:G}}());; ;/* module-key = 'com.atlassian.stash.stash-client-web-fragments-plugin:web-fragment-manager', location = '/static/util/web-fragment-manager.js' */ var WebFragments=(function(){var M=Object.prototype.hasOwnProperty;var N={item:{},section:{},panel:{}};var O=function(S){var R=[];for(var Q in S){if(M.call(S,Q)){R.push(Q)}}return R};function J(V){var T=Array.prototype.slice.call(arguments,1);for(var R=0,X=T.length;R<X;R++){var U=T[R];if(U){for(var Y=O(U),Q=0,S=Y.length;Q<S;Q++){var W=Y[Q];V[W]=U[W]}}}return V}var K;if(!window._PageDataPlugin||!_PageDataPlugin.ready){K=function(Q){return Q}}else{K=function(Q){_PageDataPlugin.ready(Q.completeModuleKey,Q.location,function(R){if(M.call(R,"serverCondition")){Q.serverCondition=R.serverCondition}if(M.call(R,"serverContext")){Q.serverContext=R.serverContext}})}}var E={item:function(Q,R){return{url:"#example-web-item-url",pluginKey:"org.example.plugins",moduleKey:"example-web-item",completeModuleKey:"org.example.plugins:example-web-item",linkText:"Client Web Item: "+Q,hasTooltip:true,tooltip:"Client Context Items: "+O(R).join(", "),hasIcon:false,iconUrl:null,iconWidth:0,iconHeight:0,styleClass:"plugin-point",linkId:null,description:null,params:{},type:"ITEM",weight:1000}},section:function(Q,R){return{name:"example-web-section",key:"example-web-section",location:Q,labelText:"Client Web Section: "+Q,type:"SECTION",params:{},weight:1000}},panel:function(Q,R){return{view:'<div class="plugin-point web-panel"><strong>Client Web Panel</strong>: '+Q+"<br /><strong>Client Context Items</strong>: "+O(R).join(", ")+"</div>",weight:1000}}};function F(Q){return new RegExp("[\\?&]web\\."+Q+"s(=|&|$)").test(window.location.search)}function H(R,Q){return typeof R==="function"?R(J({},Q)):R}function B(Q,R,V){var Y,W,T,X;var U={type:V.toUpperCase()};if(M.call(Q,"serverCondition")&&!Q.serverCondition){return null}R=J({},R,Q.serverContext,Q.params);if(M.call(Q,"condition")&&!H(Q.condition,R)){return null}if(Q["context-provider"]&&typeof Q["context-provider"]==="function"){R=H(Q["context-provider"],R)}for(Y=O(Q),T=0,X=Y.length;T<X;T++){W=Y[T];if(!/con(dition|text-provider)|params/.test(W)){U[W]=H(Q[W],R)}}if(Q.params){var S=U.params={};for(Y=O(Q.params),T=0,X=Y.length;T<X;T++){W=Y[T];S[W]=H(Q.params[W],R)}}return U}function I(R){var Q=N[R];return function(T,W){var Y=Q[T];var S=[];if(Y&&Y.length){for(var V=0,X=Y.length;V<X;V++){var U=B(Y[V],W,R);if(U){S.push(U)}}}if(F(R)){S.push(E[R](T,W))}return S}}var L=I("panel");function A(Q,T){var R=L(Q,T);for(var S=0,U=R.length;S<U;S++){R[S]=R[S].view}return R}var D=I("item");function G(Q,T){var R=D(Q,T);for(var S=0,U=R.length;S<U;S++){R[S].hasIcon=!!R[S].iconUrl;R[S].hasTooltip=!!R[S].tooltip}return R}function P(R){var Q=N[R];return function(S){if(!S){throw new Error("No descriptor provided")}if(typeof S.location!=="string"){throw new Error("No location provided, or location was not a string.")}if(typeof S.completeModuleKey!=="string"){throw new Error("No completeModuleKey provided, or completeModuleKey was not a string.")}K(S);if(!Q[S.location]){Q[S.location]=[]}Q[S.location].push(S);Q[S.location].sort(C)}}function C(R,Q){return(R.weight>=0?R.weight:1000)-(Q.weight>=0?Q.weight:1000)}return{getWebItems:I("item"),getWebSections:I("section"),getWebPanels:A,getWebFragmentDescriptors:function(Q,S){var R=N[S];var T=R&&R[Q];return T&&T.slice()},addWebItemDescriptor:P("item"),addWebSectionDescriptor:P("section"),addWebPanelDescriptor:P("panel"),getWebFragments:function(U,T,R){if(typeof T!=="string"){R=T;T=U}var Q=this.getWebItems(U,R);var V=this.getWebSections(T,R);var S=Q.concat(V);S.sort(C);return S},_getValue:H,_formatI18n:function(Q,R,T){var S=(Q===R?T:Q)||R||T||"";return function(W){var U=[];var Y=O(W);Y.sort();for(var V=0,X=Y.length;V<X;V++){U.push(W[Y[V]])}return AJS.format(S,U)}}}}());; ;/* module-key = 'com.atlassian.stash.stash-client-web-fragments-plugin:comment-create-task', location = '/web-fragment-placeholder.config' */ WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-client-web-fragments-plugin','key':'comment-create-task','moduleKey':'comment-create-task','completeModuleKey':'com.atlassian.stash.stash-client-web-fragments-plugin:comment-create-task','weight':40.0,'condition':function(ctx) { return WebFragments._getValue((require('feature/tasks/taskable-comment').isPullRequest), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'task-create'),'location':'stash.comments.actions','url':WebFragments._formatI18n(null, null, '#'),'linkText':WebFragments._formatI18n("Create task", 'stash.web.tasks.createTask', '')});; ;/* module-key = 'com.atlassian.stash.stash-comment-likes:comment-likes-resources', location = '/static/feature/comments/likes/comment-likes.soy' */ // This file was automatically generated from comment-likes.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.plugin.comment.likes. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.plugin == 'undefined') { stash.plugin = {}; } if (typeof stash.plugin.comment == 'undefined') { stash.plugin.comment = {}; } if (typeof stash.plugin.comment.likes == 'undefined') { stash.plugin.comment.likes = {}; } stash.plugin.comment.likes.likeButton = function(opt_data, opt_ignored) { return '' + stash.buttons.linkButton({content: '' + ((opt_data.userHasLiked) ? soy.$$escapeHtml("Unlike") : soy.$$escapeHtml("Like")), extraClasses: 'comment-likes-button'}); }; if (goog.DEBUG) { stash.plugin.comment.likes.likeButton.soyTemplateName = 'stash.plugin.comment.likes.likeButton'; } stash.plugin.comment.likes.likeInfo = function(opt_data, opt_ignored) { return '<span class="comment-likes-info">' + aui.icons.icon({icon: 'like-small', useIconFont: true}) + ((opt_data.userHasLiked) ? (opt_data.likerCount == 1) ? soy.$$escapeHtml("You like this") : (opt_data.likerCount == 2) ? soy.$$escapeHtml(soydata.VERY_UNSAFE.ordainSanitizedHtml(AJS.format("You and \x3cspan class\x3d\x22comment-liker\x22 title\x3d\x22{0}\x22\x3e{0}\x3c/span\x3e like this",typeof (opt_data.otherLiker.displayName || opt_data.otherLiker.name) === 'number' ? opt_data.otherLiker.displayName || opt_data.otherLiker.name : soy.$$escapeHtml(opt_data.otherLiker.displayName || opt_data.otherLiker.name)))) : soy.$$filterNoAutoescape(AJS.format("You and {1}{0} others{2} like this",opt_data.likerCount - 1,'<button class="stash-link-button">','</button>')) : (opt_data.likerCount == 1) ? soy.$$escapeHtml(soydata.VERY_UNSAFE.ordainSanitizedHtml(AJS.format("\x3cspan class\x3d\x22comment-liker\x22 title\x3d\x22{0}\x22\x3e{0}\x3c/span\x3e likes this",typeof (opt_data.otherLiker.displayName || opt_data.otherLiker.name) === 'number' ? opt_data.otherLiker.displayName || opt_data.otherLiker.name : soy.$$escapeHtml(opt_data.otherLiker.displayName || opt_data.otherLiker.name)))) : soy.$$filterNoAutoescape(AJS.format("{1}{0} people{2} like this",opt_data.likerCount,'<button class="stash-link-button">','</button>'))) + '</span>'; }; if (goog.DEBUG) { stash.plugin.comment.likes.likeInfo.soyTemplateName = 'stash.plugin.comment.likes.likeInfo'; } stash.plugin.comment.likes.dialog = function(opt_data, opt_ignored) { var output = '<div class="comment-likes-dialog"><h5 class="title">' + soy.$$escapeHtml("People who like this") + '</h5><ul class="user-list">'; var likerList38 = opt_data.otherLikers; var likerListLen38 = likerList38.length; for (var likerIndex38 = 0; likerIndex38 < likerListLen38; likerIndex38++) { var likerData38 = likerList38[likerIndex38]; output += '<li>' + stash.widget.avatar({size: 'small', person: likerData38}) + stash.widget.userLink({user: likerData38}) + '</li>'; } output += '</ul></div>'; return output; }; if (goog.DEBUG) { stash.plugin.comment.likes.dialog.soyTemplateName = 'stash.plugin.comment.likes.dialog'; } ; ;/* module-key = 'com.atlassian.stash.stash-comment-likes:comment-likes-resources', location = '/static/feature/comments/likes/analytics.js' */ define("feature/comments/likes/analytics",["stash/api/util/events","stash/api/util/state","util/analytics","util/function","exports"],function(i,g,e,f,c){function h(){i.on("stash.feature.comments.likes.like",b.bind(null,"like"));i.on("stash.feature.comments.likes.unlike",b.bind(null,"unlike"));i.on("stash.feature.comments.likes.actions.like",b.bind(null,"actions.like"))}var d="comment.";function b(k,j){e.add(d+k,a(j))}function a(l){var n=g.getPullRequest();var m=g.getRepository();var o={"comment.id":l.commentId,"repository.id":m.id,totalLikes:l.likerCount};if(n){var k=g.getCurrentUser().slug;var j=n.reviewers.map(f.dot("user.slug"));o.isAuthor=n.author.user.slug===k;o.isReviewer=j.indexOf(k)!==-1;o["pullRequest.id"]=n.id}return o}c.init=h});; ;/* module-key = 'com.atlassian.stash.stash-comment-likes:comment-likes-resources', location = '/static/feature/comments/likes/analytics-init.js' */ jQuery(document).ready(function(){require("feature/comments/likes/analytics").init()});; ;/* module-key = 'com.atlassian.stash.stash-comment-likes:comment-likes-resources', location = '/static/feature/comments/likes/controller.js' */ define("feature/comments/likes/controller",["aui","jquery","lib/jsuri","lodash","stash/api/util/events","stash/api/util/navbuilder","stash/api/util/server","stash/api/util/state"],function(k,f,c,l,m,h,d,j){function g(o){l.bindAll(this);this.options=o;this.$buttonEl=null;this.$infoPanel=null;this.likes=o.likes;this.dialog=null;this.$infoPanel=o.$infoPlaceholder.parent();this.$infoPanel.on("click","button",this.onInfoClicked);this.updateLikeInfo();if(this.likes.canLike){this.$buttonEl=this.$infoPanel.parentsUntil(".content").find(".comment-likes-button");this.$buttonEl.on("click",this.onLikeClick);this.likeIfDeepLinked()}else{if(this.likes.likerCount===0){this.$infoPanel.remove()}}}g.prototype.updateLikeButton=function(){var o=this.likes.userHasLiked?"Unlike":"Like";this.$buttonEl.text(o)};g.prototype.updateLikeInfo=function(){if(this.likes.likerCount===0){this.$infoPanel.addClass("hidden")}else{this.$infoPanel.html(stash.plugin.comment.likes.likeInfo(this.likes));this.$infoPanel.removeClass("hidden");this.dialog=null}};g.prototype.getLikesURL=function(){var o=j.getPullRequest();var q=j.getCommit();var p=h.rest("comment-likes");if(o){p=p.currentPullRequest()}else{if(q){p=p.project(j.getProject().key).repo(j.getRepository().slug).commit(q.id)}}return p.addPathComponents("comments",this.options.commentId,"likes").build()};g.prototype.onInfoClicked=function(p){p.preventDefault();var o=this;if(!this.dialog){this.dialog=k.InlineDialog(p.target,"likes-info-panel",function(r,q,s){r.html(stash.plugin.comment.likes.dialog(o.likes));s()},{closeOnTriggerClick:true,initCallback:e,hideCallback:a});this.dialog.show()}};g.prototype.likeIfDeepLinked=function(){var o=new c(window.location);if(o.getQueryParamValue("action")==="like"&&parseInt(o.getQueryParamValue("commentId"),10)===this.options.commentId&&!this.likes.userHasLiked){this.setLike(true);this._triggerEvent("actions.like")}};function n(o){if(this.popup&&!this.popup.has(o.target).length){this.hide()}}var b;function e(){b=n.bind(this);f(document).on("mouseup",b)}function a(){f(document).off("mouseup",b);b=null}g.prototype.onLikeClick=function(o){o.preventDefault();this.setLike(!this.likes.userHasLiked)};g.prototype.setLike=function(o){this._setInteralLikeStatus(o);this._syncLike(o)};g.prototype._setInteralLikeStatus=function(o){this.likes.userHasLiked=o;this.likes.likerCount=o?this.likes.likerCount+1:this.likes.likerCount-1;this.updateLikeButton();this.updateLikeInfo()};var i={"404":function(t,o,s,r){var p=r&&r.errors&&r.errors.length&&r.errors[0];var q=p&&p.message;return{title:"Comment not found",message:q,shouldReload:true,fallbackUrl:undefined}}};g.prototype._syncLike=function(o){d.rest({type:o?"POST":"DELETE",url:this.getLikesURL(),statusCode:i}).done(this._triggerEvent.bind(this,o?"like":"unlike")).fail(this._setInteralLikeStatus.bind(this,!o))};g.prototype._triggerEvent=function(o){m.trigger("stash.feature.comments.likes."+o,null,l.extend({commentId:this.options.commentId},this.likes))};return g});; ;/* module-key = 'com.atlassian.stash.stash-comment-likes:comment-likes-resources', location = '/static/feature/comments/likes/web-panel.js' */ define("feature/comments/likes/web-panel",["stash/api/util/state","feature/comments/comment-async-web-panel","feature/comments/likes/controller","exports"],function(e,g,c,b){function d(i){var l=i.comment;var k=l.properties&&l.properties.likedBy;var h=e.getCurrentUser().slug;var j={userHasLiked:false,otherLiker:null,likerCount:0,otherLikers:[],canLike:l.author.slug!==h};if(k){j.userHasLiked=k.total>0&&k.likers[0].slug===h;if(j.userHasLiked){j.otherLiker=k.total>1?k.likers[1]:null}else{j.otherLiker=k.total>0?k.likers[0]:null}j.likerCount=k.total;j.otherLikers=j.userHasLiked?k.likers.slice(1):k.likers}return j}function a(h){return d(h).canLike}function f(h){return g.getWebPanelEl(function(i){new c({commentId:h.comment.id,likes:d(h),$infoPlaceholder:i})})}b.contextProvider=d;b.buttonPanelCondition=a;b.infoPanel=f});; ;/* module-key = 'com.atlassian.stash.stash-comment-likes:comment-likes-button', location = '/web-fragment-placeholder.config' */ WebFragments.addWebPanelDescriptor({'pluginKey':'com.atlassian.stash.stash-comment-likes','key':'comment-likes-button','moduleKey':'comment-likes-button','completeModuleKey':'com.atlassian.stash.stash-comment-likes:comment-likes-button','weight':110.0,'condition':function(ctx) { return WebFragments._getValue((require('feature/comments/likes/web-panel').buttonPanelCondition), ctx); },'context-provider':function(ctx) { return WebFragments._getValue((require('feature/comments/likes/web-panel').contextProvider), ctx); },'params':{},'location':'stash.comments.info','view':function(ctx) { return WebFragments._getValue((stash.plugin.comment.likes.likeButton), ctx); }});; ;/* module-key = 'com.atlassian.stash.stash-comment-likes:comment-likes-info', location = '/web-fragment-placeholder.config' */ WebFragments.addWebPanelDescriptor({'pluginKey':'com.atlassian.stash.stash-comment-likes','key':'comment-likes-info','moduleKey':'comment-likes-info','completeModuleKey':'com.atlassian.stash.stash-comment-likes:comment-likes-info','weight':111.0,'params':{},'location':'stash.comments.info','view':function(ctx) { return WebFragments._getValue((require('feature/comments/likes/web-panel').infoPanel), ctx); }});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-model-resources', location = '/static/feature/tasks/model/task-collection.js' */ define("feature/tasks/model/task-collection",["backbone-brace","stash/api/util/events","stash/api/util/navbuilder","stash/api/util/state","feature/tasks/model/task","feature/tasks/model/task-state"],function(A,H,F,E,G,D){var C=A.Collection.extend({model:G,initialize:function(){this.on("remove",function(J){if(!J.isNew()){var I=J.toJSON();I.lastState=I.state;I.state=D.DEFAULT;H.trigger("stash.feature.pull-request-tasks.deleted",null,{task:I})}})},url:F.rest("tasks").addPathComponents("pull-requests").withParams({repositoryId:E.getRepository().id,pullRequestId:E.getPullRequest().id,start:0,limit:1000}).build()});var B=new C();C.getCollection=function(){return B};return C});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-model-resources', location = '/static/feature/tasks/model/task-state.js' */ define("feature/tasks/model/task-state",function(){var A={DEFAULT:"NONE",OPEN:"OPEN",RESOLVED:"RESOLVED",DELETED:"DELETED"};A.Transitions={};A.Transitions[A.DEFAULT]=A.OPEN;A.Transitions[A.OPEN]=A.RESOLVED;A.Transitions[A.RESOLVED]=A.OPEN;return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-model-resources', location = '/static/feature/tasks/model/task.js' */ define("feature/tasks/model/task",["aui","backbone","backbone-brace","lodash","stash/api/util/events","stash/api/util/navbuilder","model/stash-user","feature/tasks/model/task-state"],function(J,K,I,L,H,A,G,C){var E={COMMENT:"COMMENT"};var D=A.rest().addPathComponents("tasks");function B(M){return M&&"stash.feature.pull-request-tasks."+M}var F=I.Model.extend({namedAttributes:{id:"number",anchor:null,state:"string",author:G,createdDate:"number",text:"string",html:"string",properties:null,permittedOperations:null,lastState:"string",pendingSync:"boolean",pullRequestId:"number",repositoryId:"number"},defaults:{state:C.OPEN,text:"",pendingSync:false,permittedOperations:{}},url:function(){var M=D;if(!this.isNew()){M=M.addPathComponents(this.getId())}return M.build()},initialize:function(){if(this.getState()===C.OPEN&&this.isNew()){this._triggerTaskEvent(this.eventNameForState(this.getState()))}this.on("destroy",this._onDestroy);this.on("sync",this._triggerTaskEvent.bind(this,B("saved")))},_onDestroy:function(){if(this.isNew()){this.changeState(C.DELETED)}},nextState:function(){return C.Transitions[this.getState()]},eventNameForState:function(M){switch(M){case C.OPEN:if(this.isNew()){return B("created")}else{return B("reopened")}break;case C.RESOLVED:return B("resolved");case C.DELETED:return B("deleted");case C.DEFAULT:default:return B("default")}},transitionToNextState:function(){return this._updateState(this.nextState())},changeState:function(M){this.set({state:M,lastState:this.getState()},{local:true});this._triggerTaskEvent(this.eventNameForState(M))},_updateState:function(O){var P=this.getState();var N=this.eventNameForState(O);var M=this;this.changeState(O);return this.save().done(function(){if(M.getState()!==O){N=M.eventNameForState(M.getState());M._triggerTaskEvent(N)}}).fail(function(){M.set({state:P,lastState:O});M._triggerTaskEvent(B("failed-transition"))})},updateText:function(P){var N=this;var M=this.getText();var O=F.sanitiseText(P);this.setText(O);return(this.save()||K.$.Deferred().reject(this.validationError)).fail(function(){if(O!==""){N.setText(M)}})},validate:function(N,M){var O=F.sanitiseText(N.text);if(O!==N.text){return "Invalid task text"}if(N.text===""){return "Please enter some text"}},sync:function(P,O,N){this.setPendingSync(true);var M=K.sync(P,O,L.extend(N,{statusCode:{"404":function(V,Q,U,T){var R=T&&T.errors&&T.errors.length&&T.errors[0];var S=R&&R.message;if(P!=="create"){S="Stash could not update this task, it has been deleted."}return{title:"Task not found",message:S,shouldReload:true,fallbackUrl:undefined}}}}));M.always(this.setPendingSync.bind(this,false));return M},_triggerTaskEvent:function(M,N){if(N===this){N={}}H.trigger(M,null,L.extend({task:this.toJSON()},N))}},{Anchor:E});F.sanitiseText=function(M){return M.trim().replace(/\s+/gm," ")};return F});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-view-resources', location = '/static/feature/tasks/task-view/task-view.js' */ define("feature/tasks/task-view",["aui","backbone","jquery","lodash","util/events","util/function","feature/tasks/model/task-state"],function(F,G,B,H,I,E,A){var C={VIEW:"view",EDIT:"edit"};var D=G.View.extend({events:{"click .task-checkbox":"transitionTaskHandler","click .task-edit":"onTaskEditClick","click .task-save":"onTaskSaveClick","click .task-cancel":"onTaskCancelClick","keydown .task-text":"onTaskKeyDown","click .task-delete":"onTaskDeleteClick","keypress textarea":"onTaskTextareaKeypress"},defaults:{showLink:false,mode:C.VIEW},initialize:function(J){H.bindAll(this,"focusEditor","_onResize");this.listenTo(this.model,"change invalid",this.render);this.options=H.extend({},this.defaults,J);this.mode=this.options.mode;if(this.mode===C.EDIT){this.originalText=this.model.getText()}this._enableExpandingTextareas()},template:E.dot("stash.feature.tasks.taskView.task")(window),render:function(){var J=B(this.template({task:this.model.toJSON(),mode:this.mode,showLink:this.options.showLink,error:this.model.validationError}));this.$el.replaceWith(J);this.setElement(J);this._enableExpandingTextareas();if(this.mode===C.EDIT){H.defer(this.focusEditor)}H.defer(this._onResize);return this},transitionTaskHandler:function(){this.model.transitionToNextState()},saveTask:function(){var J=this;var K=this.$(".task-text").val();J.switchMode(C.VIEW);this.model.updateText(K).fail(function(){J.switchMode(C.EDIT)})},switchMode:function(J){this.mode=J;if(J===C.EDIT){this.originalText=this.model.getText()||this.originalText}this.render()},cancelTaskEdit:function(){if(this.model.isNew()){this.model.destroy()}else{this.model.setText(this.originalText);this.model.isValid();this.originalText=null;this.switchMode(C.VIEW)}},onTaskDeleteClick:function(K){var J=this;K.preventDefault();if(this.model.isNew()){return }J.model.changeState(A.DELETED);J.model.destroy({wait:true,error:function(){J.model.changeState(J.model.getLastState())}})},focusEditor:function(){this.$(".task-text").focus()},getEditorText:function(){return this.$(".task-text").val()},onTaskKeyDown:function(J){if(J.keyCode===F.keyCode.ESCAPE){J.preventDefault();J.stopPropagation();this.cancelTaskEdit()}else{if(J.keyCode===F.keyCode.ENTER){J.preventDefault();this.saveTask()}}},onTaskEditClick:function(J){J.preventDefault();if(this.model.isNew()){return }this.switchMode(C.EDIT)},onTaskSaveClick:function(J){J.preventDefault();this.saveTask()},onTaskCancelClick:function(J){J.preventDefault();this.cancelTaskEdit()},onTaskTextareaKeypress:H.debounce(function(J){B(J.target).removeClass("task-error")},300),_enableExpandingTextareas:function(){if(this.mode===C.EDIT){this.$("textarea.expanding").expandingTextarea().on("input.expanding",this._onResize)}},_onResize:function(){I.trigger("stash.webpanel.resize",null,{location:"internal.stash.comments.extra",el:this.$el.get(0)})}},{Mode:C});return D});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-view-resources', location = '/static/feature/tasks/task-view/task-view.soy' */ // This file was automatically generated from task-view.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.tasks.taskView. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.tasks == 'undefined') { stash.feature.tasks = {}; } if (typeof stash.feature.tasks.taskView == 'undefined') { stash.feature.tasks.taskView = {}; } stash.feature.tasks.taskView.task = function(opt_data, opt_ignored) { var output = '<div class="task task-status-' + soy.$$escapeHtml(opt_data.task.state.toLowerCase()) + ((opt_data.error) ? ' task-error' : '') + ((opt_data.task.pendingSync) ? ' task-pending-sync' : '') + ((opt_data.task.text == '' && ! opt_data.task.id) ? ' task-blank' : '') + '" data-task-state="' + soy.$$escapeHtml(opt_data.task.state) + '" data-task-id="' + soy.$$escapeHtml([opt_data ? opt_data.task.id : null,''].filter(function(x){return x != null;})[0]) + '" data-comment-id="' + soy.$$escapeHtml(opt_data.task.anchor.id) + '"><div class="task-action task-checkbox-container"><input type="checkbox" class="task-checkbox checkbox"' + ((opt_data.task.state == 'RESOLVED') ? ' checked="checked"' : '') + ((opt_data.mode == 'edit' || ! opt_data.task.permittedOperations.transitionable) ? ' disabled=\'disabled\'' : '') + ' /></div>' + ((opt_data.mode == 'edit') ? stash.feature.tasks.taskView.editTaskForm(opt_data) : stash.feature.tasks.taskView.viewTask(opt_data)) + ((opt_data.showLink) ? aui.buttons.button({text: '', type: 'link', extraClasses: 'task-action task-link-button', iconType: 'aui', iconClass: 'aui-icon-small aui-iconfont-link'}) : '') + '<div class="task-footer">'; var diffAnchorPath__soy45 = opt_data.task.properties && opt_data.task.properties.diffAnchorPath; output += ((opt_data.showLink && diffAnchorPath__soy45) ? '<aside class="comment-diff-anchor">' + aui.icons.icon({useIconFont: true, icon: 'file', iconFontSet: 'devtools'}) + aui.buttons.button({text: new (require('model/path'))(diffAnchorPath__soy45).getName(), type: 'link', extraAttributes: {'data-path': diffAnchorPath__soy45}}) + '</aside>' : '') + ((opt_data.mode == 'edit' || (opt_data.task.permittedOperations.editable || opt_data.task.permittedOperations.deletable) || opt_data.task.id == null) ? '<ul class="actions">' + ((opt_data.mode == 'edit') ? stash.feature.tasks.taskView.editTaskActions(null) : stash.feature.tasks.taskView.viewTaskActions(opt_data)) + '</ul>' : '') + ((opt_data.mode == 'edit') ? '<div class="task-tip">' + soy.$$escapeHtml("Tip: Try selecting some of the comment before clicking \x22Create task\x22") + '</div>' : '') + '</div></div>'; return output; }; if (goog.DEBUG) { stash.feature.tasks.taskView.task.soyTemplateName = 'stash.feature.tasks.taskView.task'; } stash.feature.tasks.taskView.viewTask = function(opt_data, opt_ignored) { return '<div class="task-content message ' + soy.$$escapeHtml(opt_data.task.html ? 'markup' : 'plaintext') + '">' + ((opt_data.task.html) ? soy.$$filterNoAutoescape(opt_data.task.html) : soy.$$escapeHtml(opt_data.task.text)) + '</div>'; }; if (goog.DEBUG) { stash.feature.tasks.taskView.viewTask.soyTemplateName = 'stash.feature.tasks.taskView.viewTask'; } stash.feature.tasks.taskView.viewTaskActions = function(opt_data, opt_ignored) { return '' + ((opt_data.task.permittedOperations.editable || opt_data.task.id == null) ? '<li><a href="#" class="task-edit">' + soy.$$escapeHtml("Edit") + '</a></li>' : '') + ((opt_data.task.permittedOperations.deletable || opt_data.task.id == null) ? '<li><a href="#" class="task-delete">' + soy.$$escapeHtml("Delete") + '</a></li>' : ''); }; if (goog.DEBUG) { stash.feature.tasks.taskView.viewTaskActions.soyTemplateName = 'stash.feature.tasks.taskView.viewTaskActions'; } stash.feature.tasks.taskView.editTaskForm = function(opt_data, opt_ignored) { return '' + widget.aui.form.expandingTextarea({name: 'task-text', initialValue: opt_data.task.text, placeholderText: '' + ((opt_data.error) ? soy.$$escapeHtml(opt_data.error) : (opt_data.task.text) ? soy.$$escapeHtml("Please enter some text") : soy.$$escapeHtml("Add new task")), extraClasses: 'task-text' + ((opt_data.error) ? ' task-error' : '')}); }; if (goog.DEBUG) { stash.feature.tasks.taskView.editTaskForm.soyTemplateName = 'stash.feature.tasks.taskView.editTaskForm'; } stash.feature.tasks.taskView.editTaskActions = function(opt_data, opt_ignored) { return '<li><a href="#" class="task-save">' + soy.$$escapeHtml("Save") + '</a></li><li><a href="#" class="task-cancel">' + soy.$$escapeHtml("Cancel") + '</a></li>'; }; if (goog.DEBUG) { stash.feature.tasks.taskView.editTaskActions.soyTemplateName = 'stash.feature.tasks.taskView.editTaskActions'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-list-resources', location = '/static/feature/tasks/task-list/task-list.js' */ define("feature/tasks/task-list",["jquery","stash/api/util/events","stash/api/util/state","feature/tasks/model/task-collection","feature/tasks/task-list/task-list-dialog","exports"],function(D,G,F,E,B,C){var A;var I={};function H(J,L,M,N){var K={projectKey:J,repository:L,pullRequestId:M};I.sourceEl=N;if(!A){A=new B(E.getCollection());A._dialog.on("beforeShow",function(){G.trigger("stash.feature.tasks.list.opened",null,I)});A._dialog.on("close",function(){G.trigger("stash.feature.tasks.list.closed")})}A.openDialog(K)}C.openTaskListDialogForCurrentPullRequest=function(){H(F.getProject(),F.getRepository(),F.getPullRequest().id)};C.onReady=function(){D(document).on("click",".task-list-dialog-link",function(M){M.preventDefault();var J=D(M.currentTarget);var K=J.data("project-key")||F.getProject().key;var N=J.data("pull-request-id")||F.getPullRequest().id;var L={id:J.data("repository-id")||F.getRepository().id,slug:J.data("repository-slug")||F.getRepository().slug};H(K,L,N,M.currentTarget)})}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-list-resources', location = '/static/feature/tasks/task-list/task-list-dialog.js' */ define("feature/tasks/task-list/task-list-dialog",["aui","jquery","lodash","stash/api/util/events","stash/api/util/server","util/navbuilder","feature/tasks/model/task-state","feature/tasks/task-list/task-list-table"],function(L,F,M,J,E,B,D,I){var K="#task-list-dialog";var H="#task-list-dialog-list";var G=B.rest().currentPullRequest().addPathComponents("tasks","count").build();function C(N){this.init.apply(this,arguments)}C.prototype.init=function(N){M.bindAll(this,"openDialog","updateDialog","closeDialog","_updateTaskCounts");var P=stash.feature.tasks.taskList.dialog();var O=F(K);if(O.length>0){O.remove()}F(document.body).append(P);this._dialog=L.dialog2(K);this._table=null;this._taskCollection=N;jQuery("#dialog-close-button").click(this.closeDialog);J.on("stash.feature.tasks.visit-task",this.closeDialog);this._dialog.on("show",function(){F(document).on("keydown",A)});this._dialog.on("hide",function(){F(document).off("keydown",A)})};function A(R){var Q={69:"E",74:"J",75:"K",79:"O",32:"SPACE",46:"DELETE"};var P={E:"stash.feature.tasks.dialog.action.edit",J:"stash.feature.tasks.dialog.action.moveNext",K:"stash.feature.tasks.dialog.action.movePrevious",O:"stash.feature.tasks.dialog.action.open",SPACE:"stash.feature.tasks.dialog.action.transitionToNextState",DELETE:"stash.feature.tasks.dialog.action.delete"};var O=Q[R.keyCode];var N=R.target.nodeName==="TEXTAREA";if(!N){if(O){J.trigger(P[O]);R.preventDefault()}}}C.prototype.updateDialog=function(){if(this._table){this._table.update()}};C.prototype.openDialog=function(P){this._dialog.show();if(!this._table){var O=this._dialog.$el.find(".aui-dialog2-content");var N=this._dialog.$el.find(H);this._table=new I(N,O,this._taskCollection,P);this._table.on("dataLoaded",this._updateTaskCounts.bind(this,P))}this._table.update()};C.prototype._updateTaskCounts=function(O,P){var Q;var S=new F.Deferred();if(!P.isLastPage){S=E.rest({url:G})}else{Q=this._taskCollection.groupBy("state");var R=Q[D.OPEN];var N=Q[D.RESOLVED];S.resolve({open:R?R.length:0,resolved:N?N.length:0})}S.done(function(T){J.trigger("stash.feature.pull-request-tasks.set-counts",null,{openTaskCount:T.open,resolvedTaskCount:T.resolved,pullRequestId:O.pullRequestId,repositoryId:O.repository.id,isReset:true})})};C.prototype.closeDialog=function(){this._dialog.hide()};return C});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-list-resources', location = '/static/feature/tasks/task-list/task-list-row-view.js' */ define("feature/tasks/task-list/task-list-row-view",["backbone","jquery","lodash","stash/api/util/events","util/feature-detect","util/function","feature/tasks/model/task-state","feature/tasks/task-view"],function(H,D,A,G,B,C,E,F){return H.View.extend({events:{"click .task-content":"taskListContentClicked","click .task-link-button":"taskListLinkClicked","click .comment-diff-anchor .aui-button":"taskListDiffAnchorClicked"},defaults:{isCollapsible:true,showLink:true,initialTaskViewMode:F.Mode.VIEW},initialize:function(I){this.options=A.extend({},this.defaults,I);this.isCollapsed=this.options.isCollapsible;this.taskView=new F({model:this.model,mode:this.options.initialTaskViewMode,prNavBuilder:this.prNavBuilder,showLink:this.options.showLink});this.focusEditor=this.taskView.focusEditor;this.getEditorText=this.taskView.getEditorText;this.listenTo(this.model,"change:state",this._handleTaskChangeState);this.listenTo(this.model,"change:text",this._handleTaskChangeText);if(this.options.isCollapsible){A.bindAll(this,"handleTaskExpand");G.on("stash.feature.tasks.list.expand",this.handleTaskExpand)}},template:C.dot("stash.feature.tasks.taskList.taskListRow")(window),activityUrl:function(){var I=this.model.getAnchor();return this.options.prNavBuilder.overview().comment(I.id).build()},diffUrl:function(I){return this.options.prNavBuilder.diff().change(I).build()},render:function(){var I=D(this.template({isCollapsed:this.isCollapsed}));I.append(this.taskView.render().$el);this.$el.replaceWith(I);this.setElement(I);return this},transitionTaskHandler:function(){this.model.transitionToNextState()},taskListContentClicked:function(J){if(!this.options.isCollapsible){return }var I=D(J.target);if(I.is("a")){return }this.setCollapsed(!this.isCollapsed)},setCollapsed:function(L){var I=this;this.isCollapsed=L;function K(N,Q,P,M){function O(){I.$el.removeClass([Q,M].join(" ")).addClass(P).css({height:""})}I.$el.css({height:N}).addClass(Q);if(B.cssTransition()){I.$el.one(B.transitionEndEventName(),O)}else{O()}}function J(){return I.$el.find(".task").get(0).scrollHeight}if(this.isCollapsed){this.$el.css({height:J()}).removeClass("expanded");A.defer(K.bind(this,"","collapsing","collapsed","expanded expanding"))}else{if(this.model.getState()!==E.OPEN){return }G.trigger("stash.feature.tasks.list.expand",null,this);this.$el.removeClass("collapsed");K(J(),"expanding","expanded","collapsed collapsing")}},taskListDiffAnchorClicked:function(I){var J=this.model.getProperties().diffAnchorPath;this._handleTaskClick(I,"stash.layout.pull-request.urlRequested",this.diffUrl(J));this.triggerTaskVisitedEvent({location:"diff"})},taskListLinkClicked:function(I){this._handleTaskClick(I,"stash.layout.pull-request.urlRequested",this.activityUrl());this.triggerTaskVisitedEvent({location:"activity-stream"})},triggerTaskVisitedEvent:function(I){I=A.extend({},{task:this.model.toJSON()},I);G.trigger("stash.feature.tasks.visit-task",null,I)},handleTaskExpand:function(I){if(I===this||this.isCollapsed){return }if(this.taskView.mode===F.Mode.EDIT){this.taskView.cancelTaskEdit()}this.setCollapsed(true)},highlight:function(){var I=this.$el.removeClass.bind(this.$el,"task-highlight");this.$el.addClass("task-highlight");if(B.cssAnimation()){this.$el.one(B.animationEndEventName(),I)}else{setTimeout(I,5000)}},_handleTaskClick:function(J,I){J.preventDefault();G.trigger.apply(this,[I,null].concat(A.toArray(arguments).slice(2)))},_handleTaskChangeState:function(I){this.$el.toggleClass("pending-delete",I.getState()===E.DELETED)},_handleTaskChangeText:function(I){if(I.isNew()&&I.getText()!==""){this.highlight()}}})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-list-resources', location = '/static/feature/tasks/task-list/task-list.soy' */ // This file was automatically generated from task-list.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.tasks.taskList. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.tasks == 'undefined') { stash.feature.tasks = {}; } if (typeof stash.feature.tasks.taskList == 'undefined') { stash.feature.tasks.taskList = {}; } stash.feature.tasks.taskList.dialog = function(opt_data, opt_ignored) { return '' + aui.dialog.dialog2({id: 'task-list-dialog', size: 'medium', titleText: "Tasks", extraClasses: 'task-list-dialog', content: '' + stash.feature.tasks.taskList.dialogContent(null), footerHintText: "Tip: Use Shift + T to open the task list.", footerActionContent: '' + aui.buttons.button({id: 'dialog-close-button', text: "Close", extraClasses: 'aui-button-link'})}); }; if (goog.DEBUG) { stash.feature.tasks.taskList.dialog.soyTemplateName = 'stash.feature.tasks.taskList.dialog'; } stash.feature.tasks.taskList.dialogContent = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '<ul id="' + soy.$$escapeHtml([opt_data ? opt_data.id : null,'task-list-dialog-list'].filter(function(x){return x != null;})[0]) + '" class="paged-table task-list"></ul>'; }; if (goog.DEBUG) { stash.feature.tasks.taskList.dialogContent.soyTemplateName = 'stash.feature.tasks.taskList.dialogContent'; } stash.feature.tasks.taskList.dialogContentSection = function(opt_data, opt_ignored) { return '<li class="task-list-row section-heading"><h6>' + soy.$$escapeHtml(opt_data.title) + '</h6></li>'; }; if (goog.DEBUG) { stash.feature.tasks.taskList.dialogContentSection.soyTemplateName = 'stash.feature.tasks.taskList.dialogContentSection'; } stash.feature.tasks.taskList.taskListRow = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '<li class="task-list-row' + soy.$$escapeHtml(opt_data.isCollapsed ? ' collapsed' : ' expanded') + ' task-container"></li>'; }; if (goog.DEBUG) { stash.feature.tasks.taskList.taskListRow.soyTemplateName = 'stash.feature.tasks.taskList.taskListRow'; } stash.feature.tasks.taskList.dialogEmptyMessage = function(opt_data, opt_ignored) { return '<p>' + soy.$$escapeHtml("There are no tasks for this pull request.") + '</p>'; }; if (goog.DEBUG) { stash.feature.tasks.taskList.dialogEmptyMessage.soyTemplateName = 'stash.feature.tasks.taskList.dialogEmptyMessage'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-list-resources', location = '/static/feature/tasks/task-list/task-list-table.js' */ define("feature/tasks/task-list/task-list-table",["aui","jquery","lodash","stash/api/util/navbuilder","util/events","util/function","widget/paged-table","feature/tasks/model/task","feature/tasks/model/task-state","feature/tasks/task-list/task-list-row-view"],function(I,D,K,B,L,H,E,F,C,A){function G(Q,P,R,O){var M=this;this._scrollable=D(P);this.$target=D(Q);this.collection=R;this.context=O;this._destroyables=[];this._resolvedHeaderOutput=false;K.bindAll(this,"_onTaskDestroy","_handleEdit","_handleMoveNext","_handleMovePrevious","_handleOpen","_handleTransitionToNextState","_handleDelete");this.collection.on("destroy",this._onTaskDestroy);this._taskRowViews=[];var N={target:this.$target,noneFoundMessageHtml:stash.feature.tasks.taskList.dialogEmptyMessage,scrollPane:P,rowSelector:"> li",taskContainerSelector:".task-container",focusOptions:{rowSelector:"> li",focusedClass:"focused"},statusCode:{"*":function(U,X,W,V,S){if(W==="timeout"||(U.status>=500&&U.status<=599)){var T=stash.widget.paragraph({text:S.message});M._addNoRowsMessage(S.message);return false}return true}}};E.call(this,N);this.prNavBuilder=B.project(O.projectKey).repo(O.repository).pullRequest(O.pullRequestId);this.bindNavigationHandlers()}K.extend(G.prototype,E.prototype);L.addLocalEventMixin(G.prototype);G.prototype._addNoRowsMessage=function(M){this.$table.addClass("no-rows").after(this._new$Message(M||this.options.noneFoundMessageHtml()))};G.prototype.update=function(M){this._resolvedHeaderOutput=false;K.invoke(this._taskRowViews,"remove");this._taskRowViews=[];E.prototype.update.call(this,M).done(this.trigger.bind(this,"dataLoaded"))};G.prototype.buildUrl=function(O,M){var N=B.rest().project(this.context.projectKey).repo(this.context.repository).pullRequest(this.context.pullRequestId).addPathComponents("tasks").withParams({start:O,limit:M,withComments:true}).build();return N};G.prototype.handleNewRows=function(P,O){var M=this;var N=[];K.each(P.values,function(R){var S=M.collection.get(R.id);if(S){S.set(R)}else{S=new F(R);S.setPullRequestId(M.context.pullRequestId);M.collection.add(S)}var Q=new A({prNavBuilder:M.prNavBuilder,model:S});M._taskRowViews.push(Q);if(S.getState()===C.RESOLVED&&!M._resolvedHeaderOutput){var T=stash.feature.tasks.taskList.dialogContentSection({title:"Resolved tasks"});N.push(T);M._resolvedHeaderOutput=true}N.push(Q.render().$el)});M.$table.show()[O!=="html"?O:"append"](N)};G.prototype.bindNavigationHandlers=function(){this._destroyables.push(L.chain().on("stash.feature.tasks.dialog.action.edit",this._handleEdit).on("stash.feature.tasks.dialog.action.moveNext",this._handleMoveNext).on("stash.feature.tasks.dialog.action.movePrevious",this._handleMovePrevious).on("stash.feature.tasks.dialog.action.open",this._handleOpen).on("stash.feature.tasks.dialog.action.transitionToNextState",this._handleTransitionToNextState).on("stash.feature.tasks.dialog.action.delete",this._handleDelete));this._destroyables.push(E.prototype.initShortcuts.call(this))};G.prototype.destroy=function(){E.prototype.destroy.call(this);K.invoke(this._destroyables,"destroy")};G.prototype.getTaskListRowViewForTask=function(N){var M=this._taskRowViews.filter(function(O){return O.model.getId()===N.getId()});return M&&M[0]};G.prototype.focusInitialRow=function(){this._$focusedRow=this.$target.find(this.options.focusOptions.rowSelector+this.options.taskContainerSelector).first().addClass(this.options.focusOptions.focusedClass)};G.prototype.scrollToRow=function(M){var P=this._scrollable.offset().top;var O=this._scrollable.scrollTop();var N=M.offset().top;this._scrollable.scrollTop((N-P)+O)};var J={UP:"prevAll",DOWN:"nextAll"};G.prototype._handleMoveNext=function(){this._focusRow(J.DOWN)};G.prototype._handleMovePrevious=function(){this._focusRow(J.UP)};G.prototype._focusRow=function(N,M){var O=this._$focusedRow[N](this.options.taskContainerSelector);if(!O.length){return }this._$focusedRow.removeClass(this.options.focusOptions.focusedClass);this._$focusedRow=O.first().addClass(this.options.focusOptions.focusedClass);if(!M){this.scrollToRow(this._$focusedRow)}};G.prototype._handleOpen=function(){this._$focusedRow.find(".task-link-button").trigger("click")};G.prototype._handleEdit=function(){var M=this.getTaskListRowViewForTask(this.getTaskFromFocusedRow());M.setCollapsed(false);this._$focusedRow.find(".task-edit").trigger("click")};G.prototype._handleTransitionToNextState=function(){var M=this.getTaskFromFocusedRow();if(M){M.transitionToNextState()}};G.prototype._handleDelete=function(){this._$focusedRow.find(".task-delete").trigger("click")};G.prototype.getTaskFromFocusedRow=function(){var M=this._$focusedRow.find(".task").data("task-id");return M&&this.collection.get(M)};G.prototype._onTaskDestroy=function(N){var M=K.find(this._taskRowViews,H.dotEq("model",N));if(!M){return }var O=this._$focusedRow.is(this.options.taskContainerSelector+":last")?J.UP:J.DOWN;this._focusRow(O,true);M.remove();this._taskRowViews=K.without(this._taskRowViews,M);if(N.getLastState()===C.RESOLVED){var P=K.compose(H.eq(C.RESOLVED),H.invoke("model.getState"));if(!this._taskRowViews.some(P)){this._resolvedHeaderOutput=false;this.$table.find(".section-heading").remove()}}if(this._taskRowViews.length===0){this._addNoRowsMessage()}};return G});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-list-resources', location = '/static/feature/tasks/task-list/comment-task-list-view.js' */ define("feature/tasks/task-list/comment-task-list-view",["backbone","lodash","util/events","util/feature-detect","util/function","feature/tasks/model/task","feature/tasks/task-list/task-list-row-view","feature/tasks/task-view"],function(F,G,H,I,E,C,A,D){var B=F.View.extend({defaults:{pullRequestId:null},initialize:function(K){var J=this;this.comment=K.comment;["add","remove"].forEach(function(L){J.listenTo(J.collection,L,J.render.bind(J,L))});this.options=G.extend({},this.defaults,K);this.taskRowViews=[]},getCurrentTask:function(){return this.collection.find(E.invoke("isNew"))},getCurrentTaskText:function(){return this.getCurrentTaskRowView().getEditorText()||""},getCurrentTaskRowView:function(){return this._findRowViewForTask(this.getCurrentTask())},createTask:function(L){var J=this.getCurrentTaskRowView();if(J){J.focusEditor();return null}var K=new C({anchor:{id:this.comment.id,type:C.Anchor.COMMENT},pullRequestId:this.options.pullRequestId,repositoryId:this.options.repositoryId,text:L});this.collection.unshift(K);if(L){K.prefilled=true;K.save().fail(this.collection.remove.bind(this.collection,K))}return K},render:function(N,J){var U=this;var S;this.$(".pending-delete").removeClass("pending-delete");var K=this.$el.outerHeight(true);this.$el.css({height:K});function T(V){return new A({model:V,initialTaskViewMode:(V.isNew()&&V.getText()==="")?D.Mode.EDIT:D.Mode.VIEW,isCollapsible:false,showLink:false})}var R=false;switch(N){case"remove":S=this._findRowViewForTask(J);if(S){S.$el.addClass("pending-delete").trigger("comment-child-removed");S.remove();this.taskRowViews=G.without(this.taskRowViews,S)}R=true;break;case"add":var O=arguments[3].at;S=T(J);this.taskRowViews.splice(O,0,S);var Q=S.render().$el;var P=this.$(this.$("li").get(O));if(P.length){P.before(Q)}else{this.$el.append(Q)}if(J.isNew()&&J.getText()!==""){S.highlight()}Q.trigger("comment-child-added");R=true;break;default:G.invoke(this.taskRowViews,"remove");this.taskRowViews=this.collection.map(T);this.$el.append(this.taskRowViews.map(function(V){return V.render().$el}));break}var L=this.taskRowViews.reduce(function(V,W){return V+W.$el.outerHeight(true)},0);function M(V){U.$el.removeClass("transition-height").css({height:"auto"});if(V){H.trigger("stash.webpanel.resize",null,{location:"internal.stash.comments.extra",el:U.$el.get(0)})}}if(I.cssTransition()&&R){this.$el.addClass("transition-height").css({height:L}).one(I.transitionEndEventName(),M.bind(U,true))}else{M(false)}return this},_findRowViewForTask:function(J){return G.find(this.taskRowViews,{model:J})}});return B});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-analytics-resources', location = '/static/feature/tasks/task-analytics/task-analytics.js' */ define("feature/tasks/task-analytics",["jquery","stash/api/util/events","stash/api/util/state","util/analytics","util/text","feature/tasks/model/task","feature/tasks/model/task-collection","feature/tasks/model/task-state","exports"],function(R,Q,L,W,P,V,h,S,Z){var e={ACTIVITY_STREAM:"activity-stream",COMMITS:"commits-tab",DIFF:"diff-tab",TASK_LIST:"task-list"};var U=h.getCollection();var J="#task-list-dialog";var B=true;var b=false;var I="pullRequest.task.";var C;function d(k,l){W.add(I+k,l)}function D(k){return Date.now()-k}function H(k,m){var l;if(k){l={"task.text.length":k.text.length,"task.id":k.id,"task.time.since.created":D(k.createdDate)}}var n={source:j(),"pullRequest.id":L.getPullRequest().id,"repository.id":L.getRepository().id};return R.extend({},n,m,l)}function c(){Q.chain().on("stash.feature.pull-request-tasks.resolved",M).on("stash.feature.pull-request-tasks.reopened",F).on("stash.feature.tasks.list.opened",O).on("stash.feature.tasks.list.closed",g).on("stash.feature.tasks.list.expand",E).on("stash.feature.tasks.visit-task",K);U.on("change:id",i).on("change:text",X).on("destroy",A)}function M(k){d("resolved."+G.taskTransitionAction(k.task),H(k.task))}function F(k){d("reopened."+G.taskTransitionAction(k.task),H(k.task))}function O(l){C=Date.now();var k="keyboard-shortcut";if(l&&l.sourceEl){k="link"}d("list.opened."+G.genericAction(),H(null,{"source.secondary":k}))}function g(){d("list.closed."+G.genericAction(),H(null,{age:D(C)}))}function E(k){d("list.expandTask."+G.genericAction(),H(k.model.toJSON()))}function K(l){var k="gotoTask";if(l.location==="diff"){k="gotoFile"}d("list."+k+"."+G.genericAction(),H(l.task))}function i(k){var n=k.toJSON();var m;if(n.anchor.type===V.Anchor.COMMENT){var l=a(n);m={"is.comment.owner":l.author===L.getCurrentUser().name,"duplicates.comment":n.text.trim()===l.text.trim()}}d("created."+(k.prefilled?"prefilled.":"")+G.genericAction(),H(n,m))}function X(m){if(m.isNew()){return }var k=m.getState()===S.RESOLVED;var l=f()||Y()||N(m.toJSON());if(!l||k){return }if(m.attributes.text!==m._previousAttributes.text){d("edited."+G.taskAction(m.toJSON(),B),H(m.toJSON()))}}function A(k){if(k.isNew()){return }d("deleted."+G.taskAction(k.toJSON(),B),H(k.toJSON()))}var G={Type:{other:"byOther",PRAuthor:"byPRAuthor",taskAuthor:"byTaskAuthor",admin:"byAdmin",reviewer:"byReviewer"},genericAction:function(){var k=this.Type.other;if(f()){k=this.Type.PRAuthor}else{if(T()){k=this.Type.reviewer}}return k},taskAction:function(l,k){var m=this.Type.other;k=!!k;if(Y()&&k){m=this.Type.admin}if(f()){m=this.Type.PRAuthor}else{if(N(l)){m=this.Type.taskAuthor}}return m},taskTransitionAction:function(k){return this.taskAction(k,b)}};function j(){var k=R(J);if(k.length&&k.attr("aria-hidden")==="false"){return e.TASK_LIST}var l=R(".active-tab[data-module-key]").attr("data-module-key");if(P.endsWith(l,"diff")){return e.DIFF}if(P.endsWith(l,"commits")){return e.COMMITS}return e.ACTIVITY_STREAM}function f(){return L.getCurrentUser().id===L.getPullRequest().author.user.id}function Y(){return L.getCurrentUser().isAdmin}function T(){var k=L.getPullRequest().reviewers;return k.length&&k.some(function(l){return l.user.id===L.getCurrentUser().id})}function N(k){return L.getCurrentUser().name===k.author.name}function a(k){if(k.anchor.type!==V.Anchor.COMMENT){return null}var l=R('.comment[data-id="'+k.anchor.id+'"]');return{text:l.find("> .content > .message").text(),author:l.find("span[data-username]").attr("data-username")}}Z.init=c});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:task-analytics-resources', location = '/static/feature/tasks/task-analytics/task-analytics-init.js' */ jQuery(document).ready(function(){require("feature/tasks/task-analytics").init()});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:updating-section', location = '/static/widget/updating-section/updating-section.js' */ define("widget/updating-section",["jquery","lodash"],function(C,B){function A(G,F,E,D){this.init.apply(this,arguments)}A.defaults={context:{},isVisibleProperty:null};A.prototype.init=function(G,F,E,D){this._$el=C(G);this._template=E;this._options=B.extend({},A.defaults,D);this._$placeholder=this._$el.find(".replacement-placeholder");this._currentValue={};B.bindAll(this,"updateValue","updateVisibility");this._destroyCallbacks=[F.onValue(this.updateValue)];if(this._options.isVisibleProperty){this._destroyCallbacks.push(this._options.isVisibleProperty.onValue(this.updateVisibility))}};A.prototype.updateVisibility=function(D){this._$el.toggleClass("hidden",!D)};A.prototype.updateValue=function(E){var D=B.extend({},E,this._options.context);if(B.isEqual(D,this._currentValue)){return }this._currentValue=D;var F=this._template(D);this._$placeholder.stop().fadeOut(0).html(F).fadeIn()};A.prototype.destroy=function(){this._destroyCallbacks.forEach(Function.prototype.call,Function.prototype.call)};return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:taskable-comment-resources', location = '/static/feature/tasks/taskable-comment/taskable-comment.js' */ define("feature/tasks/taskable-comment",["jquery","lodash","stash/api/util/events","stash/api/util/state","feature/comments/comment-async-web-panel","feature/tasks/model/task","feature/tasks/model/task-collection","feature/tasks/task-list/comment-task-list-view","exports"],function(E,N,L,K,A,G,I,P,D){var H=I.getCollection();var O={};L.on("stash.feature.tasks.createTask",F);function F(Q){var X=E(Q);var R=X.data("id");var W="";var U=window.getSelection();if(U){var Y=X.find(".message").get(0);if(E.contains(Y,U.anchorNode)&&(E.contains(Y,U.focusNode)||X.find(".actions").is(U.focusNode))){W=G.sanitiseText(U.toString());U.removeAllRanges()}}var V=O[R];var T=V.createTask(W);if(T){H.add(T)}else{if(W){T=V.getCurrentTask();var S=V.getCurrentTaskText();S=S?S.trim()+" ":"";T.setText(S+W)}}}L.on("stash.feature.comments.commentDeleted",C);function C(R){var Q=H.find(function(S){return S.getAnchor().id===R.id});if(Q){H.remove(Q)}}function M(S){var T=S.comment;var Q=new I();N.each(T.tasks,function(V){var U=H.get(V.id);if(!U){U=new G(V);U.setPullRequestId(K.getPullRequest().id);U.setRepositoryId(K.getRepository().id);H.add(U)}Q.add(U)});var R={comment:T,collection:Q};return A.getWebPanelEl(function(V){var U=E(stash.feature.tasks.taskableComment.taskListPlaceholder());V.replaceWith(U);B(U,R)})}function B(S,R){var Q=E(S);var T=new P({collection:R.collection,el:Q,comment:R.comment,pullRequestId:K.getPullRequest().id,repositoryId:K.getRepository().id});T.render();O[R.comment.id]=T}function J(Q){return !!Q.pullRequest}D.newTaskableCommentView=M;D.isPullRequest=J;D._commentTaskListViews=O});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:taskable-comment-resources', location = '/static/feature/tasks/taskable-comment/taskable-comment.soy' */ // This file was automatically generated from taskable-comment.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.tasks.taskableComment. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.tasks == 'undefined') { stash.feature.tasks = {}; } if (typeof stash.feature.tasks.taskableComment == 'undefined') { stash.feature.tasks.taskableComment = {}; } stash.feature.tasks.taskableComment.taskListPlaceholder = function(opt_data, opt_ignored) { return '<ul class="task-list"></ul>'; }; if (goog.DEBUG) { stash.feature.tasks.taskableComment.taskListPlaceholder.soyTemplateName = 'stash.feature.tasks.taskableComment.taskListPlaceholder'; } ; ;/* module-key = 'com.atlassian.stash.stash-client-web-fragments-plugin:comment-task-list', location = '/web-fragment-placeholder.config' */ WebFragments.addWebPanelDescriptor({'pluginKey':'com.atlassian.stash.stash-client-web-fragments-plugin','key':'comment-task-list','moduleKey':'comment-task-list','completeModuleKey':'com.atlassian.stash.stash-client-web-fragments-plugin:comment-task-list','weight':100.0,'condition':function(ctx) { return WebFragments._getValue((require('feature/tasks/taskable-comment').isPullRequest), ctx); },'params':{},'location':'internal.stash.comments.extra','view':function(ctx) { return WebFragments._getValue((require('feature/tasks/taskable-comment').newTaskableCommentView), ctx); }});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/activity-comment-context.js' */ define("feature/comments/activity-comment-context",["lodash","util/events","feature/comments/activity-comment-container","feature/comments/comment-context"],function(B,C,A,D){return D.extend({findContainerElements:function(){return[this.el]},_registerContainer:function(F,G,E){this._containers[F]=new A({name:F,context:this,el:G,anchor:E});return this._containers[F]},getActivityCommentContainer:function(){return this._containers[this.getAnchor().getId()]},restoreDrafts:function(){if(this.unrestoredDrafts.length){var E=this.getActivityCommentContainer();this.unrestoredDrafts=B.reject(this.unrestoredDrafts,E.restoreDraftComment.bind(E));if(this.unrestoredDrafts.length){C.once("stash.feature.pullRequestActivity.dataLoaded",this.restoreDrafts.bind(this))}}}})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/comment-tips.js' */ define("feature/comments/comment-tips",["aui","util/navigator"],function(B,A){return{tips:[A.isMac()?"\u2318 + Enter to post your comment":"Ctrl + Enter to post your comment","Type \u0027@\u0027 to mention other users",B.format("You can use {0}Markdown{1} in comments","<a href='http:\/\/docs.atlassian.com\/stash\/docs-037\/Markdown+syntax+guide' target=\"_blank\">","</a>")]}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/anchors.js' */ define("feature/comments/anchors",["jquery","stash/api/util/navbuilder","model/page-state"],function(E,F,D){function A(G){G=G||{};this._projectKey=G.projectKey||D.getProject().getKey();this._repoSlug=G.repoSlug||D.getRepository().getSlug();this._pullRequestId=G.pullRequestId||D.getPullRequest().getId()}A.prototype.getId=function(){return"pullrequest-"+this._projectKey+"-"+this._repoSlug+"-"+this._pullRequestId};A.prototype.toJSON=function(){return undefined};A.prototype.urlBuilder=function(){return F.rest().project(this._projectKey).repo(this._repoSlug).pullRequest(this._pullRequestId).comments()};function C(G){this._path=G.getPath();this._srcPath=G.getSrcPath();this._commitRange=G.getCommitRange();this._projectKey=(G.getRepository()||D).getProject().getKey();this._repoSlug=(G||D).getRepository().getSlug()}C.prototype.getId=function(){return"diff-"+this._projectKey+"-"+this._repoSlug+"-"+this._commitRange.getId()+"-"+this._path};C.prototype.toJSON=function(){var G={path:this._path.toString(),commitRange:this._commitRange.toJSON()};var H=this._srcPath&&this._srcPath.toString();if(H){G.srcPath=H}return G};C.prototype.urlBuilder=function(){var G=F.rest().project(this._projectKey).repo(this._repoSlug);var H=this._commitRange.getPullRequest();if(H){return G.pullRequest(H.getId()).comments()}return G.changeset(this._commitRange.getUntilRevision().getId()).comments()};function B(J,I,G,H){this._diffAnchor=J;this._lineType=I;this._line=G;this._fileType=H}B.prototype.getId=function(){var G=this._fileType?this._fileType+"-":"";return"line-"+this._diffAnchor.getId()+"-"+G+this._lineType+"-"+this._line};B.prototype.toJSON=function(){var G=E.extend(this._diffAnchor.toJSON(),{line:this._line,lineType:this._lineType});if(this._fileType){G.fileType=this._fileType}return G};B.prototype.urlBuilder=function(){return this._diffAnchor.urlBuilder()};return{PullRequestAnchor:A,DiffAnchor:C,LineAnchor:B}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/comment-container.js' */ define("feature/comments/comment-container",["aui","backbone","jquery","lib/jsuri","lodash","memoir","util/analytics","util/dom-event","util/events","util/function","util/syntax-highlight","model/page-state","widget/aui/form","widget/confirm-dialog","widget/markup-editor","feature/comments/comment-collection","feature/comments/comment-model","feature/comments/comment-tips"],function(H,B,E,N,R,P,F,S,A,I,L,J,C,G,M,K,O,D){var Q=450;return B.View.extend({initialize:function(){R.bindAll(this,"onCommentEditorResize","onCommentFocused");this.anchor=this.anchor||this.options.anchor;this.rootCommentListSelector=this.rootCommentListSelector||this.options.rootCommentListSelector;this.context=this.options.context;this.pullRequest=this.options.pullRequest||J.getPullRequest();if(!this.collection){this.collection=new K([],{anchor:this.anchor})}this.initDeleteButtons();this.$el.imagesLoaded(this.onImagesLoaded.bind(this));A.trigger("stash.feature.comments.commentContainerAdded",null,this.$el);var T=300;this.updateDraftComment=R.debounce(this.updateDraftComment,T);this.deleteDraftComment=R.debounce(this.deleteDraftComment,T);this.on("comment.saved",L.container.bind(null,this.$el));L.container(this.$el);A.once("stash.feature.pullRequestActivity.focused",this.onCommentFocused)},events:{"submit form":"onFormSubmit","click a.times":"onDateClicked","click .cancel":"onCancelClicked","click .reply":"onReplyClicked","click .edit":"onEditClicked","click .task-create":"onCreateTaskClicked","keydown form":"onFormKeydown","input textarea":"onTextareaInput","comment-child-added .comment ":"onChildrenChanged","comment-child-removed .comment ":"onChildrenChanged"},initDeleteButtons:function(T){this.createDeleteDialog().attachTo(".delete",null,this.el)},createDeleteDialog:function(){var T=this;var U=new G({id:"delete-repository-dialog",titleText:"Delete comment",titleClass:"warning-header",panelContent:"<p>"+"Are you sure that you want to delete this comment?"+"</p>",submitText:"Delete",submitToHref:false});U.addConfirmListener(function(X,V,W){W();T.deleteComment(V.closest(".comment"))});return U},onFormSubmit:function(T){T.preventDefault();T.stopPropagation();this.submitCommentForm(E(T.target))},onDateClicked:function(U){U.preventDefault();U.stopPropagation();E(".comment.focused").removeClass("focused");var T=E(U.target).closest("a");T.closest(".comment").addClass("focused");P.pushState(null,null,T.prop("href"))},onCancelClicked:function(T){T.preventDefault();T.stopPropagation();this.cancelCommentForm(E(T.target).closest("form"))},onReplyClicked:function(T){T.preventDefault();T.stopPropagation();this.openReplyForm(E(T.target).closest(".comment"))},onEditClicked:function(T){T.preventDefault();T.stopPropagation();this.openEditForm(E(T.target).closest(".comment"))},onCreateTaskClicked:function(U){U.preventDefault();U.stopPropagation();var T=E(U.target).closest(".comment");A.trigger("stash.feature.tasks.createTask",null,T)},onImagesLoaded:function(T){this.trigger("change")},onFormKeydown:function(T){if(S.isCtrlish(T)&&T.which===H.keyCode.ENTER){T.preventDefault();T.stopPropagation();E(T.target).closest("form").submit()}},onTextareaInput:function(T){if(E(T.target).closest(".comment-container").is(this.el)){this.updateDraftComment(T.target)}},onChildrenChanged:function(V){if(V.target===V.currentTarget){return }V.stopPropagation();var T=E(V.currentTarget);var U=T.find("> .content .task-list-row, > .replies > .comment").not(".pending-delete").length;T.find("> .content > .actions > li > .delete").parent().toggleClass("hidden",!!U)},onCommentFocused:function(U){var V=new N(window.location);var W=V.getQueryParamValue("action");var T={"comment.id":this.getCommentJSON(U.closest(".comment")).id,"pullRequest.id":J.getPullRequest().id,"repository.id":J.getRepository().id};if(W==="reply"){U.find(".reply").first().click();F.add("stash.client.comment.actions.reply",T)}else{if(W==="view"){F.add("stash.client.comment.actions.view",T)}}},updateDraftComment:function(U){var T=this.getDraftCommentFromForm(E(U).closest("form"));this.context&&this.context.saveDraftComment(T)},getDraftCommentFromForm:function(U){var T=this.getCommentFormJSON(U);if(T.anchor){delete T.anchor.commitRange}return E.extend({},T)},deleteDraftComment:function(T){this.context&&this.context.deleteDraftComment(T)},getRootCommentList:function(){var T=this.$(this.rootCommentListSelector);if(!T.length){T=this.$el}return T},render:function(){var T=stash.feature.comments(E.extend({comments:this.collection.toJSON()},this.anchor.toJSON()));this.$el.replaceWith(T);this.setElement(T[0])},_toJSON:function(U,V){var X=parseInt(U.parent().closest(".comment").attr("data-id"),10);var W=parseInt(U.attr("data-id"),10);var T=parseInt(U.attr("data-version"),10);return{id:!isNaN(W)?W:undefined,version:!isNaN(T)?T:undefined,text:V,anchor:this.anchor.toJSON(),parent:!isNaN(X)?{id:X}:undefined}},getCommentJSON:function(T){return this._toJSON(T,T.find("> .content > .message").attr("data-text"))},getCommentFormJSON:function(T){var U=T.parent().is(".comment")?T.parent():T;return this._toJSON(U,T.find("textarea").val())},renderContentUpdate:function(T,U){T.children(".content").replaceWith(stash.feature.commentContent({pullRequest:this.pullRequest&&this.pullRequest.toJSON(),comment:U,hideDelete:!!T.find("> .replies > .comment").length}));T.attr("data-version",U.version).data("version",U.version);this.$el.imagesLoaded(this.onImagesLoaded.bind(this));this.scrollToComment(T);this.trigger("change");A.trigger("stash.feature.comments.commentEdited",null,U,T)},insertCommentIntoList:function(V,T,W){var U=T.children(".comment:first");while(U.length){if(parseInt(U.data("id"),10)>W.id){break}U=U.next(".comment")}U=U.length?U:T.children(".comment-form-container:last");if(U.length){V.insertBefore(U)}else{T.append(V)}},renderComment:function(Y,Z,V){var U;if(V&&(U=E('.comment[data-id="'+Y.id+'"]')).length){return this.renderContentUpdate(U,Y)}Y=E.extend({isNew:true},Y);var X=Z&&this.$("[data-id="+Z+"]");var W=(X?X.children(".replies"):this.getRootCommentList());U=E(stash.feature.comment({pullRequest:this.pullRequest&&this.pullRequest.toJSON(),numOfAncestors:W.parents(".comment").length,extraClasses:this.getExtraCommentClasses(),comment:Y}));this.insertCommentIntoList(U,W,Y);var T=5000;setTimeout(R.bind(U.removeClass,U,"new"),T);this.scrollToComment(U);U.hide().fadeIn("slow");this.$el.imagesLoaded(this.onImagesLoaded.bind(this));this.trigger("change");A.trigger("stash.feature.comments.commentAdded",null,Y,U);U.trigger("comment-child-added")},getExtraCommentClasses:function(){return""},showErrorMessage:function(W,V){var U=this;var T=U.find(".error");if(!T.length){T=E('<div class="error"></div>');U.find(".comment-form-footer").before(T)}T.text(V)},cancelCommentForm:function(T){this.closeCommentForm(T)},submitCommentForm:function(U){if(C.isSubmissionPrevented(U)){return }var T=this;var V=U.find(".comment-submit-spinner");var Y=this.getCommentFormJSON(U);var W=Y.id!=null;var X=W&&this.collection.get(Y.id);var a=Y.parent&&Y.parent.id;var Z=X?this.collection.get(Y.id):new O();Z.on("invalid",this.showErrorMessage,U);if(Z.set(E.extend(Y,{avatarSize:stash.widget.avatarSizeInPx({size:"medium"})}),{validate:true})){if(!X){this.collection.push(Z)}U.addClass("submitting");V.spin("medium");C.preventSubmission(U);Z.save().done(function(b){b.createdDate=Math.min(b.createdDate,new Date().getTime());b.updatedDate=Math.min(b.updatedDate,new Date().getTime());T.closeCommentForm(U,{doNotDestroy:true});T.renderComment(b,a,W);T.trigger("comment.saved")}).fail(function(){if(!X&&!W){T.collection.remove(Y.id)}}).always(function(){V.spinStop();U.removeClass("submitting");C.allowSubmission(U)})}Z.off("invalid",this.showErrorMessage)},deleteComment:function(W){var X=this.getCommentJSON(W);var Y;if(this.collection.get(X)){Y=this.collection.get(X.id)}else{Y=new O(X);this.collection.push(Y)}var T=W.find("> .content .delete"),V={h:T.height(),w:T.width()};T.height(V.h).width(V.w).css("vertical-align","middle").empty().spin("small");var U=this;Y.destroy({wait:true}).always(function(){T.spinStop()}).done(function(){W.addClass("pending-delete").fadeOut(function(){W.trigger("comment-child-removed").remove();U.onCommentDeleted();U.trigger("change");A.trigger("stash.feature.comments.commentDeleted",null,X)})}).fail(function(){T.css("height","").css("width","").css("vertical-align","").text("Delete")})},onCommentDeleted:function(){},onCommentEditorResize:E.noop,openEditForm:function(V){var W=this.getCommentJSON(V);var T=E(stash.feature.commentForm(E.extend({tips:this.$el.width()>Q?D.tips:[],currentUser:J.getCurrentUser()&&J.getCurrentUser().toJSON()},W)));var U=V.find("> .user-avatar, > .content");U.detach();V.prepend(T).addClass("comment-form-container");T.data("originalContent",U);this._bindMarkupEditor(T);this.focusCommentForm(T);this.trigger("change");A.trigger("stash.feature.comments.commentFormShown",null,T);return T},openReplyForm:function(U){var T=U.children(".replies");return this.openCommentForm(T,{location:"top"})},openNewCommentForm:function(){return this.openCommentForm(this.getRootCommentList(),{location:"bottom"})},openCommentForm:function(T,W){var X=W&&W.location==="top"?"prependTo":"appendTo";var U=T.children(".comment-form-container").not(".comment");if(!U.length){U=E(stash.feature.commentFormListItem({tips:this.$el.width()>Q?D.tips:[],currentUser:J.getCurrentUser()&&J.getCurrentUser().toJSON()}))[X](T);this._bindMarkupEditor(U.find("form"))}var V=U.find("form");this.focusCommentForm(V);this.trigger("change");A.trigger("stash.feature.comments.commentFormShown",null,V);return V},closeCommentForm:function(T){T.find(".error").remove();this.deleteDraftComment(this.getDraftCommentFromForm(T));this._unbindMarkupEditor(T);var U=T.data("originalContent");var V=T.parent();if(U){V.removeClass("comment-form-container");T.replaceWith(U)}else{V.remove()}this.trigger("change");A.trigger("stash.feature.comments.commentFormHidden",null,T)},focusCommentForm:I.lazyDefer(function(T){this.scrollToComment(T);T.find("textarea").focus()}),scrollToComment:E.noop,populateCommentFormFromDraft:function(U,T){E(U).find("textarea").val(T.text).addClass("restored").attr("title","This comment has been restored from an automatically saved draft.").trigger("input").one("click input",function(){E(this).removeClass("restored").removeAttr("title")})},getCommentElById:function(T){return this.$(".comment[data-id="+T+"]")},restoreDraftComment:function(T){var U;if(T.id){var V=this.getCommentElById(T.id);if(V.length){if(parseInt(T.version,10)<parseInt(V.attr("data-version"),10)){this.context.deleteDraftComment(T);return true}U=this.openEditForm(V)}}else{if(T.parent){var W=this.getCommentElById(T.parent.id);if(W.length){U=this.openReplyForm(W)}}else{U=this.openNewCommentForm()}}U&&this.populateCommentFormFromDraft(U,T);return !!U},_bindMarkupEditor:function(T){M.bindTo(T).on("resize",this.onCommentEditorResize)},_unbindMarkupEditor:function(T){M.unbindFrom(T)},destroy:function(){this.$("form").each(I.thisToParam(this._unbindMarkupEditor.bind(this)))}})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/comment-collection.js' */ define("feature/comments/comment-collection",["backbone","feature/comments/comment-model"],function(B,A){return B.Collection.extend({initialize:function(D,C){C=C||{};this.anchor=C.anchor},model:A,url:function(){return this.anchor.urlBuilder().build()}})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/comments.soy' */ // This file was automatically generated from comments.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } stash.feature.comments = function(opt_data, opt_ignored) { var output = '<div class="comment-container' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '"' + ((opt_data.line) ? ' data-line-number="' + soy.$$escapeHtml(opt_data.line) + '"' : '') + ((opt_data.lineType) ? ' data-line-type="' + soy.$$escapeHtml(opt_data.lineType) + '"' : '') + '><div class="panel"><ol class="comment-list">'; if (opt_data.comments) { var commentList22 = opt_data.comments; var commentListLen22 = commentList22.length; for (var commentIndex22 = 0; commentIndex22 < commentListLen22; commentIndex22++) { var commentData22 = commentList22[commentIndex22]; output += stash.feature.comment({comment: commentData22, numOfAncestors: 0, pullRequest: opt_data.commitRange.pullRequest}); } } output += '</ol></div></div>'; return output; }; if (goog.DEBUG) { stash.feature.comments.soyTemplateName = 'stash.feature.comments'; } stash.feature.comment = function(opt_data, opt_ignored) { var output = '<li class="comment' + ((opt_data.comment.isNew) ? ' new' : '') + ((opt_data.comment.isUnread) ? ' unread' : '') + ((opt_data.comment.isFocused) ? ' focused' : '') + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '" data-id="' + soy.$$escapeHtml(opt_data.comment.id) + '" data-version="' + soy.$$escapeHtml(opt_data.comment.version) + '">' + stash.widget.avatar({size: 'medium', person: opt_data.comment.author}) + stash.feature.commentContent(opt_data) + '<ol class="replies' + ((opt_data.numOfAncestors >= 7) ? ' no-indent' : '') + '">'; if (opt_data.comment.comments) { var replyList62 = opt_data.comment.comments; var replyListLen62 = replyList62.length; for (var replyIndex62 = 0; replyIndex62 < replyListLen62; replyIndex62++) { var replyData62 = replyList62[replyIndex62]; output += stash.feature.comment({comment: replyData62, pullRequest: opt_data.pullRequest, numOfAncestors: opt_data.numOfAncestors + 1}); } } output += '</ol></li>'; return output; }; if (goog.DEBUG) { stash.feature.comment.soyTemplateName = 'stash.feature.comment'; } stash.feature.commentContent = function(opt_data, opt_ignored) { var output = '<div class="content">'; if (opt_data.comment.deleted) { output += soy.$$escapeHtml("This comment has been removed by the author."); } else { output += stash.widget.userLink({user: opt_data.comment.author, extraClasses: 'user-name'}) + '<div class="message ' + soy.$$escapeHtml(opt_data.comment.html ? 'markup' : 'plaintext') + '" data-text="' + soy.$$escapeHtml(opt_data.comment.text) + '">' + ((opt_data.comment.html) ? soy.$$filterNoAutoescape(opt_data.comment.html) : '<p>' + soy.$$escapeHtml(opt_data.comment.text) + '</p>') + '</div><ul class="actions"><li>' + stash.buttons.linkButton({content: '' + soy.$$escapeHtml("Reply"), extraClasses: 'reply'}) + '</li>' + ((opt_data.comment.permittedOperations.editable) ? '<li>' + stash.buttons.linkButton({content: '' + soy.$$escapeHtml("Edit"), extraClasses: 'edit'}) + '</li>' : '') + ((opt_data.comment.permittedOperations.deletable) ? '<li' + ((opt_data.hideDelete || (opt_data.comment.comments && opt_data.comment.comments.length || opt_data.comment.tasks && opt_data.comment.tasks.length)) ? ' class="hidden"' : '') + '>' + stash.buttons.linkButton({content: '' + soy.$$escapeHtml("Delete"), extraClasses: 'delete'}) + '</li>' : ''); var itemList117 = WebFragments.getWebItems('stash.comments.actions',{comment: opt_data.comment, pullRequest: opt_data.pullRequest}); var itemListLen117 = itemList117.length; for (var itemIndex117 = 0; itemIndex117 < itemListLen117; itemIndex117++) { var itemData117 = itemList117[itemIndex117]; output += '<li>' + stash.widget.webItem(itemData117) + '</li>'; } output += '</ul><ul class="info">'; var panelHtmlList123 = WebFragments.getWebPanels('stash.comments.info',{comment: opt_data.comment, pullRequest: opt_data.pullRequest}).map(function(webPanel) { return soydata.VERY_UNSAFE.ordainSanitizedHtml(webPanel); }); var panelHtmlListLen123 = panelHtmlList123.length; for (var panelHtmlIndex123 = 0; panelHtmlIndex123 < panelHtmlListLen123; panelHtmlIndex123++) { var panelHtmlData123 = panelHtmlList123[panelHtmlIndex123]; output += '<li>' + soy.$$escapeHtml(panelHtmlData123) + '</li>'; } output += '<li>'; if (opt_data.pullRequest) { var pullRequestCommentLink__soy131 = require('stash/api/util/navbuilder').project(opt_data.pullRequest.toRef.repository.project.key).repo(opt_data.pullRequest.toRef.repository.slug).pullRequest(opt_data.pullRequest.id).overview().comment(opt_data.comment.id).withParams(opt_data.comment.id).build(); output += '<a class="times" href="' + soy.$$escapeHtml(pullRequestCommentLink__soy131) + '">' + stash.feature.commentDate(opt_data) + '</a>'; } else { output += '<span class="times">' + stash.feature.commentDate(opt_data) + '</span>'; } output += '</li></ul><div class="extras">'; var panelHtmlList144 = WebFragments.getWebPanels('internal.stash.comments.extra',{comment: opt_data.comment, pullRequest: opt_data.pullRequest}).map(function(webPanel) { return soydata.VERY_UNSAFE.ordainSanitizedHtml(webPanel); }); var panelHtmlListLen144 = panelHtmlList144.length; for (var panelHtmlIndex144 = 0; panelHtmlIndex144 < panelHtmlListLen144; panelHtmlIndex144++) { var panelHtmlData144 = panelHtmlList144[panelHtmlIndex144]; output += (panelHtmlIndex144 == 0) ? soy.$$escapeHtml(panelHtmlData144) : ''; } output += '</div>'; } output += '</div>'; return output; }; if (goog.DEBUG) { stash.feature.commentContent.soyTemplateName = 'stash.feature.commentContent'; } stash.feature.commentDate = function(opt_data, opt_ignored) { return '' + ((opt_data.comment.updatedDate - opt_data.comment.createdDate > 0) ? (require('util/time').format(opt_data.comment.createdDate, 'shortAge') != require('util/time').format(opt_data.comment.updatedDate, 'shortAge')) ? stash.feature.commentEditTimes({createdDateContent: '' + stash.widget.date.shortAge({date: opt_data.comment.createdDate}), updatedDateContent: '' + stash.widget.date.shortAge({date: opt_data.comment.updatedDate})}) : stash.widget.date.shortAge({date: opt_data.comment.createdDate, title: AJS.format("{0} (edited {1})",require('util/time').format(opt_data.comment.createdDate, 'full'),require('util/time').format(opt_data.comment.updatedDate, 'full'))}) : stash.widget.date.shortAge({date: opt_data.comment.createdDate})); }; if (goog.DEBUG) { stash.feature.commentDate.soyTemplateName = 'stash.feature.commentDate'; } stash.feature.commentEditTimes = function(opt_data, opt_ignored) { return '' + soy.$$filterNoAutoescape(AJS.format("{0} (edited {1})",opt_data.createdDateContent,opt_data.updatedDateContent)); }; if (goog.DEBUG) { stash.feature.commentEditTimes.soyTemplateName = 'stash.feature.commentEditTimes'; } stash.feature.commentFormListItem = function(opt_data, opt_ignored) { return '<li class="comment-form-container' + ((opt_data.isHidden) ? ' hidden' : '') + '">' + stash.feature.commentForm({id: opt_data.id, version: opt_data.version, text: opt_data.text, tips: opt_data.tips, currentUser: opt_data.currentUser, extraClasses: opt_data.extraFormClasses}) + '</li>'; }; if (goog.DEBUG) { stash.feature.commentFormListItem.soyTemplateName = 'stash.feature.commentFormListItem'; } stash.feature.commentForm = function(opt_data, opt_ignored) { return '<form' + ((opt_data.id) ? ' data-id="' + soy.$$escapeHtml(opt_data.id) + '" data-version="' + soy.$$escapeHtml(opt_data.version) + '"' : '') + ' class="new-comment-form' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '">' + stash.widget.avatar({size: 'medium', person: opt_data.currentUser}) + '<div class="content">' + ((opt_data.text) ? '<input name="old_text" type="hidden" value="' + soy.$$escapeHtml(opt_data.text) + '" />' : '') + stash.widget.markupEditor.editor({text: opt_data.text, placeholderText: "What do you want to say?", previewButtonTitle: "View a preview of this comment", attachmentButtonTitle: "Attach a file to this comment. You can also drag and drop a file to attach it.", attachmentButtonAccessibilityText: "Attach file"}) + '<div class="comment-form-footer"><div class="buttons">' + stash.buttons.button({buttonText: opt_data.id ? "Save" : "Comment"}) + widget.aui.form.cancelButton({href: '#'}) + '</div>' + ((opt_data.tips.length) ? stash.feature.commentFormTip(opt_data) : '') + '</div></div></form>'; }; if (goog.DEBUG) { stash.feature.commentForm.soyTemplateName = 'stash.feature.commentForm'; } stash.feature.commentFormTip = function(opt_data, opt_ignored) { return '<div class="tip"><span class="tip-label">' + soy.$$escapeHtml("Tip:") + ' </span>' + soy.$$filterNoAutoescape(opt_data.tips[Math.floor(Math.random() * opt_data.tips.length)]) + '</div>'; }; if (goog.DEBUG) { stash.feature.commentFormTip.soyTemplateName = 'stash.feature.commentFormTip'; } stash.feature.addCommentTrigger = function(opt_data, opt_ignored) { return '<button class="add-comment-trigger" title="' + soy.$$escapeHtml("Add a comment on this line.") + '">' + aui.icons.icon({useIconFont: true, icon: 'comment', accessibilityText: "This line has a comment."}) + aui.icons.icon({useIconFont: true, icon: 'add-comment', accessibilityText: "Add a comment on this line."}) + '</button>'; }; if (goog.DEBUG) { stash.feature.addCommentTrigger.soyTemplateName = 'stash.feature.addCommentTrigger'; } stash.feature.dummyCommentTrigger = function(opt_data, opt_ignored) { opt_data = opt_data || {}; var output = ''; var changeLocation__soy249 = opt_data.relevantContextLines ? AJS.format("Comments can only be added within {0} lines of a change",opt_data.relevantContextLines) : "Comments can only be added near a change"; output += '<div class="dummy-comment-trigger" title="' + soy.$$escapeHtml(changeLocation__soy249) + '" ></div>'; return output; }; if (goog.DEBUG) { stash.feature.dummyCommentTrigger.soyTemplateName = 'stash.feature.dummyCommentTrigger'; } stash.feature.fileComments = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '<div class="file-comments">' + ((opt_data.comments && opt_data.comments.length > 0) ? stash.feature.comments(opt_data) : '') + '</div>'; }; if (goog.DEBUG) { stash.feature.fileComments.soyTemplateName = 'stash.feature.fileComments'; } stash.feature.commentCount = function(opt_data, opt_ignored) { return '<span class="comment-count" title="' + soy.$$escapeHtml(AJS.format("{0} {0,choice,1#comment|1\x3ccomments}",parseInt(opt_data.count))) + '">' + aui.icons.icon({icon: 'comment', size: 'small', useIconFont: true, accessibilityText: AJS.format("{0} {0,choice,1#comment|1\x3ccomments}",parseInt(opt_data.count))}) + soy.$$escapeHtml(require('util/text').capInt(opt_data.count, 99)) + '</span>'; }; if (goog.DEBUG) { stash.feature.commentCount.soyTemplateName = 'stash.feature.commentCount'; } stash.feature.commentAsyncWebPanelPlaceholder = function(opt_data, opt_ignored) { return '<div id="async-web-panel-' + soy.$$escapeHtml(opt_data.webPanelId) + '"></div>'; }; if (goog.DEBUG) { stash.feature.commentAsyncWebPanelPlaceholder.soyTemplateName = 'stash.feature.commentAsyncWebPanelPlaceholder'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/diff-comment-context.js' */ (function(){var A=require("util/bacon").keyboardEvents("requestTertiaryNext");var B=require("util/bacon").keyboardEvents("requestTertiaryPrevious");define("feature/comments/diff-comment-context",["jquery","lodash","util/events","util/function","model/direction","feature/comments/anchors","feature/comments/comment-collection","feature/comments/comment-context","feature/comments/diff-comment-container","feature/file-content/diff-view-file-types","feature/file-content/diff-view-options","feature/file-content/diff-view-segment-types"],function(I,M,O,L,D,C,F,G,N,J,H,K){var E=C.LineAnchor;return G.extend({events:{"click .add-comment-trigger":"addCommentClicked","mouseenter .dummy-comment-trigger, .add-comment-trigger":"initTooltip"},initialize:function(){this._destroyables=[];M.bindAll(this,"onDiffChange","onFileCommentsResized","onCommentContainerDestroyed","onDiffViewOptionsChange");this._initFileCommentButton=this._initFileCommentButton.bind(this,this.options.$toolbar);this._destroyables.push(O.chain().once("stash.feature.fileContent.requestHandled",this._initFileCommentButton));this.setDiffView(this.options.diffView);this._dvOptions=this.options.diffViewOptions||H;this._commentsById=this.options.lineComments&&M.indexBy(this.options.lineComments,L.dot("id"));this.$el.toggleClass("commentable",this.options.allowCommenting);this.toggleComments(!this._dvOptions.get("hideComments"));this._dvOptions.on("change",this.onDiffViewOptionsChange);O.on("stash.comment.commentContainerDestroyed",this.onCommentContainerDestroyed);this.renderFileComments();G.prototype.initialize.apply(this,arguments);var P=this._getFileCommentContainer();if(P){this._initializeFileCommentContainer(P)}},_initFileCommentButton:function(P){P.find(".add-file-comment-trigger").on("click",this.addFileCommentClicked.bind(this)).tooltip({gravity:"ne"})},_initializeFileCommentContainer:function(P){P.on("resize",this.onFileCommentsResized)},_getFileCommentContainer:function(){var Q=this.options.anchor;var P=Q.getId();if(this.includesContainer(P)){return this._containers[P]}},_registerContainer:function(Q,R,P){this._containers[Q]=new N({anchor:P,context:this,el:R,name:Q});return this._containers[Q]},addFileCommentClicked:function(){this.forceShowingComments();var P=this.addCommentContainerForFile();P.openNewCommentForm()},initTooltip:function(Q){var P=I(Q.currentTarget);if(P.data("tooltip-inited")){return }P.data("tooltip-inited",true);P.tooltip({gravity:"w",delayOut:200}).trigger("mouseenter")},addCommentClicked:function(R){R.preventDefault();this.forceShowingComments();var Q=I(R.target).closest(".line");var P=this.addCommentContainerForLine(Q);P.openNewCommentForm()},forceShowingComments:function(){if(this._dvOptions.get("hideComments")){this._dvOptions.set("hideComments",false)}},addCommentContainerForFile:function(){var Q=this._getFileCommentContainer();if(Q){return Q}var P=I(stash.feature.comments(this.options.anchor.toJSON()));P.appendTo(this.$(".file-comments"));this.registerContainer(P[0],this.options.anchor);Q=this._getFileCommentContainer();this._initializeFileCommentContainer(Q);return Q},addCommentContainerForLine:function(T,P){var S=this.getLineAnchor(T);var R=T.lineType?T:this.diffView.getLineHandle(T);var Q=S.getId();if(!this.includesContainer(Q)){this._containers[Q]=new N({anchor:S,collection:P?new F(P,{anchor:S}):undefined,context:this,lineHandle:R,name:Q,showComments:!this._dvOptions.get("hideComments")})}return this._containers[Q]},destroy:function(P){if(!P){if(this.diffView){this.diffView.off("change",this.onDiffChange)}this.$el.removeClass("commentable");this._dvOptions.off("change",this.onDiffViewOptionsChange);this._dvOptions=null;O.off("stash.comment.commentContainerDestroyed",this.onCommentContainerDestroyed);M.invoke(this._destroyables,"destroy");this._destroyables=null}G.prototype.destroy.apply(this,arguments)},findContainerElements:function(){return this.$(".line .comment-box, .file-comments > .comment-container")},getAnchor:function(P){if(I(P).closest(".file-comments").length){return this.options.anchor}return this.getLineAnchor(I(P).closest(".line"))},getGutterId:function(){return this.options.allowCommenting?"add-comment-trigger":null},getLineAnchor:function(Q){var P=Q.lineType?Q:this.diffView.getLineHandle(Q);return new E(this.options.anchor,P.lineType,P.lineNumber,P.fileType)},renderFileComments:function(){var P=this.options.anchor.toJSON().commitRange;this.$el.prepend(stash.feature.fileComments({comments:this.options.fileComments,commitRange:P}))},addAnchoredComments:function(){var P=this;var S=this.diffView;var R=this.options.lineComments;if(R&&R[0]&&!R[0].anchor){return }function Q(T){return M.chain(T).filter(function(U){return !!(U.anchor&&U.anchor.line)}).groupBy(function(U){return(U.anchor.fileType||"")+U.anchor.line}).value()}M.forEach(Q(R),function(T){var U=T[0].anchor;var V=S.getLineHandle({fileType:U.fileType,lineType:U.lineType,lineNumber:U.line});if(V){P.addCommentContainerForLine(V,T)}})},onFileCommentsResized:function(){this.trigger("fileCommentsResized")},onDiffChange:function(R){if(R.type!=="INITIAL"&&R.type!=="INSERT"){return }if(R.type==="INITIAL"){this.addAnchoredComments()}var Q=this.diffView;var P=this;R.eachLine(function(W){var U=W.line;var V;var S=!W.attributes.expanded&&W.line.conflictMarker!=="MARKER";if(S&&(P.options.allowCommenting&&R.type==="INITIAL")){V=stash.feature.addCommentTrigger()}else{V=stash.feature.dummyCommentTrigger({relevantContextLines:P.options.relevantContextLines})}if(W.handles.FROM){Q.setGutterMarker(W.handles.FROM,P.getGutterId(),I(V)[0])}if(W.handles.TO&&W.handles.FROM!==W.handles.TO){Q.setGutterMarker(W.handles.TO,P.getGutterId(),I(V)[0])}if(U.commentIds){var T=M.chain(U.commentIds).map(L.lookup(P._commentsById)).filter(M.identity).value();if(T.length){P.addCommentContainerForLine(W.handles.FROM||W.handles.TO,T)}}if(P.unrestoredDrafts.length&&R.type==="INITIAL"){M.chain(W.handles).values().compact().uniq().forEach(P.restoreDraftsForLine.bind(P)).value()}})},onCommentContainerDestroyed:function(P){var Q=this._getFileCommentContainer();if(Q&&P===Q.$el){M.defer(this.onFileCommentsResized.bind(this))}},onDiffViewOptionsChange:function(P){if(P.key==="hideComments"){this.toggleComments(!P.value)}},restoreDraftsForLine:function(Q){var S=I.extend({line:Q.lineNumber,lineType:Q.lineType},{fileType:Q.fileType});var R=this.getUnrestoredDraftsForLine(S);if(R.length){var P=this.addCommentContainerForLine(Q);this._restoreDraftsToContainer(P,R);P.destroyIfEmpty()}},_restoreDraftsToContainer:function(P,Q){M.forEach(Q,P.restoreDraftComment.bind(P));this.unrestoredDrafts=M.difference(this.unrestoredDrafts,Q)},restoreDrafts:function(){var P=this;if(!this.options.allowCommenting){this.unrestoredDrafts=M.filter(this.unrestoredDrafts,function(Q){return(Q.id||Q.parent)&&(P.$el.is(".file-comment-activity")||Q.anchor.line)})}this.restoreDraftFileComments()},restoreDraftFileComments:function(){var P=M.reject(this.unrestoredDrafts,L.dot("anchor.line"));if(P.length){this._restoreDraftsToContainer(this.addCommentContainerForFile(),P)}},getUnrestoredDraftsForLine:function(R){var Q=M.compose(L.partialRight(M.omit,"path","srcPath"),this.unifyAnchorFileTypes);var S=M.isEqual.bind(M,Q(R));var P=M.compose(S,Q,L.dot("anchor"));return M.filter(this.unrestoredDrafts,P)},unifyAnchorFileTypes:function(Q){var R=((Q.lineType===K.CONTEXT||Q.lineType===K.REMOVED)&&Q.fileType===J.FROM);var P=(Q.lineType===K.ADDED&&Q.fileType===J.TO);if(R||P){return M.omit(Q,"fileType")}return Q},clarifyAmbiguousDraftProps:function(Q){var P=G.prototype.clarifyAmbiguousDraftProps.call(this,Q);P.anchor=this.unifyAnchorFileTypes(P.anchor);return P},setDiffView:function(P){if(this.diffView){this.diffView.off("internal-change",this.onDiffChange)}this.diffView=P;if(P){this.diffView.on("internal-change",this.onDiffChange);this._destroyables.push({destroy:A.onValue(P._scrollToComment.bind(P,D.DOWN))});this._destroyables.push({destroy:B.onValue(P._scrollToComment.bind(P,D.UP))})}},toggleComments:function(P){this.$el.toggleClass("hide-comments",!P);M.invoke(this._containers,"toggleComment",P)}})})}());; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/comment-model.js' */ define("feature/comments/comment-model",["aui","backbone","backbone-brace","lodash","stash/api/util/navbuilder"],function(A,F,C,B,E){var D=C.Model.extend({namedAttributes:{anchor:null,attributes:null,author:null,avatarSize:null,comments:null,tasks:null,createdDate:"number",html:"string",id:"number",isFocused:"boolean",isUnread:"boolean",parent:null,permittedOperations:null,properties:null,text:"string",updatedDate:"number",version:"number"},validate:function(G){if(!G.text||!/\S/.test(G.text)){return "Please enter some text"}},url:function(){var I=E.parse(C.Model.prototype.url.apply(this,arguments));var G=this.get("anchor");if(G&&G.commitRange){var H=G.commitRange.sinceRevision;if(H){I.addQueryParam("since",H.id)}}I.addQueryParam("version",this.get("version")).addQueryParam("avatarSize",this.get("avatarSize")).addQueryParam("markup",true);return I.toString()},forEachCommentInThread:function(G){G(this);B.each(this.get("comments"),function(H){H.forEachCommentInThread(G)})},sync:function(I,H,G){return F.sync(I,H,B.extend(G,{statusCode:{"404":function(O,J,N,L,M){var K=L&&L.errors&&L.errors.length&&L.errors[0];if(K&&K.message&&/comment/i.test(K.message)){if(I==="create"&&H.get("parent")!=null){return{title:"Comment not found",message:"The comment you are replying to no longer exists.",shouldReload:true,fallbackUrl:undefined}}else{if(I==="update"){return{title:"Comment not found",message:"The comment you are updating no longer exists.",shouldReload:true,fallbackUrl:undefined}}}}}}}))}});C.Mixins.applyMixin(D,{namedAttributes:{comments:[D]}});return D});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/comment-async-web-panel.js' */ define("feature/comments/comment-async-web-panel",["jquery","stash/api/util/events","util/promise","exports"],function(F,G,C,B){var A=[document.documentElement];G.on("stash.page.pull-request.view.contextRequested",function(){A=[document.documentElement]});G.on("stash.feature.comments.commentContainerAdded",function(H){A.push(H[0])});var E=0;function D(I){E++;var H="#async-web-panel-"+E;C.waitFor({predicate:function(){var J=F(H,A);return J.length?J:false},name:"Async web panel "+E,interval:50}).then(I);return stash.feature.commentAsyncWebPanelPlaceholder({webPanelId:E})}B.getWebPanelEl=D});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/diff-comment-container.js' */ define("feature/comments/diff-comment-container",["jquery","lodash","util/events","util/function","feature/comments/comment-container"],function(E,A,B,C,D){var F;B.on("memoir.changestate",function(){F=null});return D.extend({rootCommentListSelector:".comment-list",initialize:function(){A.bindAll(this,"onResize","onWebPanelResize");if(!this.$el.is(".comment-container")){this.setElement(E(stash.feature.comments(E.extend({extraClasses:"comment-box",comments:this.options.collection&&this.options.collection.toJSON()},this.options.anchor.toJSON())))[0])}if(!this.isFileCommentContainer()&&this.options.context.diffView){this.toggleComment(this.options.showComments);this.options.context.diffView.addLineClass(this.options.lineHandle,"wrap","commented")}this.on("change",this.onResize);this.on("comment.saved",this.scrollIntoView);B.on("stash.webpanel.resize",this.onWebPanelResize);D.prototype.initialize.apply(this,arguments)},closeCommentForm:function(H,I){if(!I||!I.doNotDestroy){var G=H.parent().parent();if(G.is(this.rootCommentListSelector)&&G.children(".comment").length===0){this.deleteDraftComment(this.getDraftCommentFromForm(H));this._unbindMarkupEditor(H);return this.destroy()}}return D.prototype.closeCommentForm.apply(this,arguments)},destroyIfEmpty:function(){var G=this.$(this.rootCommentListSelector);if(G.children(".comment").length===0&&!G.find("textarea").val()){this.destroy()}},destroy:function(G){D.prototype.destroy.apply(this,arguments);F=null;if(this._widget){this._widget.clear();this._widget=null}this.off("change",this.onResize);if(this.options.lineHandle){this.options.context.diffView.removeLineClass(this.options.lineHandle,"wrap","commented")}B.trigger("stash.comment.commentContainerDestroyed",null,this.$el);this.context.destroy(this,G)},focusCommentForm:C.lazyDefer(function(G){this.scrollToComment(G);var H=G.find("textarea");if(this.isFileCommentContainer()){setTimeout(H.focus.bind(H),100)}else{H.focus()}}),onCommentDeleted:function(){this.destroyIfEmpty()},onCommentEditorResize:function(){this.onResize()},onWebPanelResize:function(G){if(G.location==="internal.stash.comments.extra"&&E.contains(this.$el.get(0),G.el)){this.onResize()}},onResize:function(){if(this._widget){this._widget.changed()}this.trigger("resize")},isFileCommentContainer:function(){return !!this.$el.closest(".file-comments").length},isActivityCommentContainer:function(){return !!this.$el.closest(".activity-item").length},scrollToComment:function(G){if(!this.isActivityCommentContainer()){var H=G.offset().top-this.$el.offset().top;if(this.isFileCommentContainer()){if(this.options.context.diffView){this.options.context.diffView.scrollToFileComments(H,G.height())}}else{this.options.context.diffView.scrollToWidgetOffset(this.options.lineHandle,H,G.height())}}},toggleComment:function(G){if(this.isFileCommentContainer()){this.options.context.trigger("fileCommentsResized")}else{if(G&&!this._widget){this._widget=this.options.context.diffView.addLineWidget(this.options.lineHandle,this.el,{noHScroll:true,coverGutter:true,insertAt:0})}else{if(!G&&this._widget){this._widget.clear();this._widget=null;this.el.parentElement.removeChild(this.el)}}}}})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/activity-comment-container.js' */ define("feature/comments/activity-comment-container",["jquery","lodash","util/events","feature/comments/comment-container"],function(D,A,B,C){return C.extend({initialize:function(){C.prototype.initialize.apply(this,arguments)},rootCommentListSelector:".pull-request-activity",events:A.extend({},C.prototype.events,{"focus .general-comment-form textarea":"onGeneralFormTextareaFocused"}),initDeleteButtons:function(){this.createDeleteDialog().attachTo(".general-comment-activity .delete",null,this.el)},insertCommentIntoList:function(G,E,H){if(E.is(this.rootCommentListSelector)){var F=E.children(":first");G.insertAfter(F)}else{C.prototype.insertCommentIntoList.apply(this,arguments)}},closeCommentForm:function(E){E.find(".error").remove();if(E.is(".general-comment-form")){this._unbindMarkupEditor(E);E.addClass("collapsed");E.find("textarea").val("").removeClass("restored").removeAttr("title").blur();this.deleteDraftComment(this.getDraftCommentFromForm(E))}else{C.prototype.closeCommentForm.apply(this,arguments)}},getExtraCommentClasses:function(){return"general-comment-activity"},onGeneralFormTextareaFocused:function(F){var E=D(F.target).closest(".general-comment-form");if(E.hasClass("collapsed")){this._bindMarkupEditor(E);E.removeClass("collapsed")}}})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/comment-context.js' */ define("feature/comments/comment-context",["backbone","jquery","lodash","util/client-storage","util/events","feature/comments/comment-container"],function(F,E,B,A,C,D){return F.View.extend({initialize:function(){this._containers={};this.checkForNewContainers();var G=this;C.on("stash.feature.comments.commentAdded",this._commentAddedHandler=function(I,J){if(G.$el.find(J).length&&G.$el.find(".comment").length===1){C.trigger("stash.feature.comments.firstCommentAdded",null,G.$el)}});var H=this.getDrafts()||[];this.unrestoredDrafts=this.drafts=B.isArray(H)?H:[H];this.restoreDrafts()},includesContainer:function(G){return B.has(this._containers,G)},registerContainer:function(I,H){var G=H.getId();if(!this.includesContainer(G)){this._registerContainer(G,I,H)}},_registerContainer:function(H,I,G){this._containers[H]=new D({name:H,context:this,el:I,anchor:G});return this._containers[H]},checkForNewContainers:function(){var G=this;B.forEach(this.findContainerElements(),function(H){G.registerContainer(H,G.getAnchor(H))})},findContainerElements:function(){return this.$(".comment-container")},getAnchor:function(){return this.options.anchor},clarifyAmbiguousDraftProps:function(G){return B.omit(G,"text")},deleteDraftComment:function(G,I){I=B.isBoolean(I)?I:true;var H=B.isEqual.bind(B,this.clarifyAmbiguousDraftProps(G));this.drafts=B.reject(this.drafts,B.compose(H,this.clarifyAmbiguousDraftProps.bind(this)));if(I){this.saveDraftComments()}},getDrafts:function(){return A.getSessionItem(this.getDraftsKey())},getDraftsKey:function(){return A.buildKey(["draft-comment",this.options.anchor.getId()],"user")},restoreDrafts:E.noop,saveDraftComment:function(G){this.deleteDraftComment(G,false);G.text&&this.drafts.push(G);this.saveDraftComments()},saveDraftComments:function(){A.setSessionItem(this.getDraftsKey(),this.drafts)},destroy:function(G,H){if(G){G.remove();delete this._containers[G.options.name];if(!this.$el.has(".comment").length&&!H){C.trigger("stash.feature.comments.lastCommentDeleted",null,this.$el)}}else{H=true;B.invoke(this._containers,"destroy",H);this._containers=null;if(this._commentAddedHandler){C.off("stash.feature.comments.commentAdded",this._commentAddedHandler);delete this._commentAddedHandler}}}})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:comments', location = '/static/feature/comments/comments.js' */ define("feature/comments",["jquery","feature/comments/activity-comment-context","feature/comments/anchors","feature/comments/comment-tips","feature/comments/diff-comment-context"],function(E,A,D,F,C){var B={CREATE_NEW:"create-new",REPLY_ONLY:"reply-only",READ:"read",NONE:"none"};return E.extend({bindContext:function(L,H,G){if(L.data("comment-context")){throw new Error("Duplicate comment context registered.")}var K=G&&(G.commentMode===B.READ||G.commentMode===B.CREATE_NEW||G.commentMode===B.REPLY_ONLY);var J=G&&G.commentMode===B.CREATE_NEW;G=E.extend({el:L[0],anchor:H,allowCommenting:J,showComments:K},G);var I=H instanceof D.DiffAnchor?new C(G):new A(G);L.data("comment-context",I);return I},updateContext:function(H){var G=H.data("comment-context");if(G){G.checkForNewContainers()}},unbindContext:function(H){var G=H.data("comment-context");if(G){G.destroy()}},commentMode:B},D,F)});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:commits-table', location = '/static/feature/commits/commits-table-clientside.soy' */ // This file was automatically generated from commits-table-clientside.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.commits. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.commits == 'undefined') { stash.feature.commits = {}; } stash.feature.commits.commitsTableImpl = function(opt_data, opt_ignored) { var param13 = ''; if (opt_data.changesetPage) { var changesetList16 = opt_data.changesetPage.values; var changesetListLen16 = changesetList16.length; for (var changesetIndex16 = 0; changesetIndex16 < changesetListLen16; changesetIndex16++) { var changesetData16 = changesetList16[changesetIndex16]; param13 += stash.feature.commits.commitsTableRow({changeset: changesetData16, cellsContent: '' + stash.feature.commits.commitsTableCells({repository: opt_data.repository, changeset: changesetData16, webSections: opt_data.webSections})}); } } var output = '' + stash.widget.pagedTable({id: opt_data.tableId, page: opt_data.changesetPage, extraClasses: 'commits-table' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), theadContent: '' + ((opt_data.changesetPage && (opt_data.changesetPage.size > 0 || opt_data.changesetPage.start > 0) || ! opt_data.changesetPage) ? '<tr>' + stash.feature.commits.commitsTableHeaderCells(opt_data) + '</tr>' : ''), content: param13}); return output; }; if (goog.DEBUG) { stash.feature.commits.commitsTableImpl.soyTemplateName = 'stash.feature.commits.commitsTableImpl'; } stash.feature.commits.commitsTableHeaderCells = function(opt_data, opt_ignored) { var output = '<th class="author" title="' + soy.$$escapeHtml("Author") + '" scope="col">' + soy.$$escapeHtml("Author") + '</th><th class="changeset" title="' + soy.$$escapeHtml("Commit") + '" scope="col">' + soy.$$escapeHtml("Commit") + '</th><th class="message" title="' + soy.$$escapeHtml("Message") + '" scope="col">' + soy.$$escapeHtml("Message") + '</th><th class="comment-count" scope="col"></th><th class="timestamp" title="' + soy.$$escapeHtml("Commit Date") + '" scope="col">' + soy.$$escapeHtml("Commit Date") + '</th>'; if (opt_data.webSections) { var webSectionList46 = opt_data.webSections; var webSectionListLen46 = webSectionList46.length; for (var webSectionIndex46 = 0; webSectionIndex46 < webSectionListLen46; webSectionIndex46++) { var webSectionData46 = webSectionList46[webSectionIndex46]; output += '<th class="' + soy.$$escapeHtml(webSectionData46.key) + '" title="' + soy.$$escapeHtml(webSectionData46.labelText) + '" scope="col">' + soy.$$escapeHtml(webSectionData46.labelText) + '</th>'; } } return output; }; if (goog.DEBUG) { stash.feature.commits.commitsTableHeaderCells.soyTemplateName = 'stash.feature.commits.commitsTableHeaderCells'; } stash.feature.commits.commitsTableRow = function(opt_data, opt_ignored) { return '<tr data-changesetid="' + soy.$$escapeHtml(opt_data.changeset.id) + '" class="commit-row ' + ((opt_data.changeset.parents.length >= 2) ? 'merge' : '') + '">' + soy.$$filterNoAutoescape(opt_data.cellsContent) + '</tr>'; }; if (goog.DEBUG) { stash.feature.commits.commitsTableRow.soyTemplateName = 'stash.feature.commits.commitsTableRow'; } stash.feature.commits.commitsTableCells = function(opt_data, opt_ignored) { var output = '<td class="author">' + stash.widget.avatarWithName({size: 'small', person: opt_data.changeset.author, link: true, linkExtraClasses: 'secondary-link'}) + '</td><td class="changeset">' + stash.feature.changeset.link(opt_data) + '<!-- show merge lozenge/icon if is a merge commit, eg has 2+ parents -->' + ((opt_data.changeset.parents.length >= 2) ? stash.widget.lozenge.merge({abbreviated: true}) : '') + '</td><td class="message">'; var parsedCommitMessage__soy83 = require('util/parse-commit-message').splitIntoSubjectAndBody(opt_data.changeset.message); output += '<span class="message-subject" title="' + soy.$$escapeHtml(soy.$$truncate(opt_data.changeset.message, 800, true)) + '">' + soy.$$escapeHtml(soy.$$truncate(parsedCommitMessage__soy83.subject, 400, true)) + '</span><span class="message-body" title="' + soy.$$escapeHtml(soy.$$truncate(opt_data.changeset.message, 800, true)) + '">' + soy.$$escapeHtml(soy.$$truncate(parsedCommitMessage__soy83.body, 400, true)) + '</span></td><td class="comment-count">'; if (opt_data.changeset.attributes && opt_data.changeset.attributes.commentCount) { var countList103 = opt_data.changeset.attributes.commentCount; var countListLen103 = countList103.length; for (var countIndex103 = 0; countIndex103 < countListLen103; countIndex103++) { var countData103 = countList103[countIndex103]; output += stash.feature.commentCount({count: countData103}); } } output += '</td><td class="timestamp">' + stash.widget.date.shortAge({date: opt_data.changeset.authorTimestamp}) + '</td>' + ((opt_data.webSections) ? stash.feature.commits.commitsRowExtras(opt_data) : ''); return output; }; if (goog.DEBUG) { stash.feature.commits.commitsTableCells.soyTemplateName = 'stash.feature.commits.commitsTableCells'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:commits-table', location = '/static/feature/commits/commits-table.js' */ define("feature/commits/commits-table",["aui","jquery","lodash","util/events","widget/paged-table"],function(A,E,B,C,D){function F(H,G){this.getCommitsUrlBuilder=H;var I={target:"#commits-table",ajaxDataType:"html",tableMessageClass:"commits-table-message",allFetchedMessageHtml:'<p class="no-more-results">'+A.escapeHtml("No more history")+"</p>",noneFoundMessageHtml:'<h3 class="no-results entity-empty">'+A.escapeHtml("No history found")+"</h3>"};G=E.extend({},I,G);D.call(this,G);this.$spinner.addClass("commits-table-spinner");this._destroyables=[]}E.extend(F.prototype,D.prototype);F.prototype.buildUrl=function(H,G){return this.getCommitsUrlBuilder().withParams({start:H,limit:G,contents:""}).build()};F.prototype.onDataLoaded=function(I,G,H){if(typeof H==="string"){H=this.createDataFromJQuery(I,G,E(H))}return D.prototype.onDataLoaded.call(this,I,G,H)};F.prototype.attachNewContent=function(H,G){D.prototype.attachNewContent.call(this,H,G);C.trigger("stash.widget.commitsTable.contentAdded",this,H)};F.prototype.handleNewRows=function(H,G){this.$table.show().children("tbody")[G!=="html"?G:"append"](H.values)};F.prototype.focusInitialRow=function(){this.$table.find("tbody tr.commit-row:first").addClass("focused-commit")};F.prototype.bindKeyboardShortcuts=function(){var H=this,K=this.$table.selector,G=false,I={focusedClass:"focused-commit",wrapAround:false,escToCancel:false},L=K+" .commit-row."+I.focusedClass,J=L+", "+K+".show-merges .commit-row, "+K+":not(.show-merges) .commit-row:not(.merge)";this._onDisableOpenItemHandler=function(){G=true};this._onEnableOpenItemHandler=function(){G=false};this.bindMoveToNextHandler=function(M){(this.moveToNextItem?this:A.whenIType(M)).moveToNextItem(J,I).execute(function(){if(E(J).last().hasClass(I.focusedClass)){window.scrollTo(0,document.documentElement.scrollHeight)}})};this.bindMoveToPreviousHandler=function(M){(this.moveToPrevItem?this:A.whenIType(M)).moveToPrevItem(J,I)};this.bindOpenItemHandler=function(M){(this.execute?this:A.whenIType(M)).execute(function(){if(!G){var N=jQuery(L);if(N.length){window.location.href=N.find("td.changeset a").attr("href")}}})};this.bindToggleMergesHandler=function(M){(this.execute?this:A.whenIType(M)).execute(function(){H.$table.toggleClass("show-merges")})};this._destroyables.push(C.chain().on("stash.keyboard.shortcuts.requestMoveToNextHandler",this.bindMoveToNextHandler).on("stash.keyboard.shortcuts.requestMoveToPreviousHandler",this.bindMoveToPreviousHandler).on("stash.keyboard.shortcuts.requestOpenItemHandler",this.bindOpenItemHandler).on("stash.keyboard.shortcuts.requestToggleMergesHandler",this.bindToggleMergesHandler).on("stash.keyboard.shortcuts.disableOpenItemHandler",this._onDisableOpenItemHandler).on("stash.keyboard.shortcuts.enableOpenItemHandler",this._onEnableOpenItemHandler));this._destroyables.push(D.prototype.initShortcuts.call(this))};F.prototype.destroy=function(){D.prototype.destroy.call(this);B.invoke(this._destroyables,"destroy")};return F});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:commits-page', location = '/static/page/commits/commits.js' */ define("page/commits",["memoir","stash/api/util/navbuilder","util/events","model/revision-reference","feature/commits/commits-table","exports"],function(I,A,J,B,F,E){var D,H;function G(L){L=L||D;var K=A.currentRepo().commits();if(!L.isDefault()){K=K.withParams({until:L.getId()})}return K}function C(){H.bindKeyboardShortcuts();J.on("stash.widget.keyboard-shortcuts.register-contexts",function(M){M.enableContext("commits")});var K=function(){J.trigger("stash.keyboard.shortcuts.disableOpenItemHandler")};var L=function(){J.trigger("stash.keyboard.shortcuts.enableOpenItemHandler")};J.on("stash.widget.branchselector.dialogShown",K);J.on("stash.widget.branchselector.dialogHidden",L);J.on("stash.layout.branch.actions.dropdownShown",K);J.on("stash.layout.branch.actions.dropdownHidden",L)}E.onReady=function(K){D=new B(K);H=new F(G);H.init();J.on("stash.layout.branch.revisionRefChanged",function(L){if(D!==L){I.pushState(L.toJSON(),null,G(L).build())}});J.on("memoir.changestate",function(M){var L=M.state;if(L){D=new B(L);H.update();J.trigger("stash.page.commits.revisionRefChanged",null,D)}});C();I.initialState(D.toJSON())}});; ;/* module-key = 'com.atlassian.auiplugin:aui-experimental-progress-indicator', location = 'js/aui-experimental-progress-indicator.js' */ (function(){function A(B,D,C){AJS._internal.animation.recomputeStyle(B);B.css("width",C*100+"%");D.attr("data-value",C)}AJS.progressBars={update:function(G,M){var C=AJS.$(G).first();var F=C.children(".aui-progress-indicator-value");var L=F.attr("data-value")||0;var K="aui-progress-indicator-after-update";var I="aui-progress-indicator-before-update";var D="transitionend webkitTransitionEnd";var E=!C.attr("data-value");if(E){F.css("width",0)}if(typeof M==="number"&&M<=1&&M>=0){C.trigger(I,[L,M]);var H=document.body||document.documentElement;var B=H.style;var J="transition";if(typeof B.transition==="string"||typeof B.WebkitTransition==="string"){F.one(D,function(){C.trigger(K,[L,M])});A(F,C,M)}else{A(F,C,M);C.trigger(K,[L,M])}}return C},setIndeterminate:function(D){var C=AJS.$(D).first();var B=C.children(".aui-progress-indicator-value");C.removeAttr("data-value");AJS._internal.animation.recomputeStyle(C);B.css("width","100%")}}}());; ;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/lib/d3.min.js' */ !function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function r(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function o(){}function a(n){return ia+n in this}function c(n){return n=ia+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===oa&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===oa)return!1;return!0}function h(){}function g(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function p(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=aa.length;r>e;++e){var u=aa[e]+t;if(u in n)return u}}function v(){}function d(){}function m(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new o;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function y(){Zo.event.preventDefault()}function x(){for(var n,t=Zo.event;n=t.sourceEvent;)t=n;return t}function M(n){for(var t=new d,e=0,r=arguments.length;++e<r;)t[arguments[e]]=m(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=Zo.event;u.target=n,Zo.event=u,t[u.type].apply(e,r)}finally{Zo.event=i}}},t}function _(n){return sa(n,pa),n}function b(n){return"function"==typeof n?n:function(){return la(n,this)}}function w(n){return"function"==typeof n?n:function(){return fa(n,this)}}function S(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=Zo.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function k(n){return n.trim().replace(/\s+/g," ")}function E(n){return new RegExp("(?:^|\\s+)"+Zo.requote(n)+"(?:\\s+|$)","g")}function A(n){return(n+"").trim().split(/^|\s+/)}function C(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=A(n).map(N);var u=n.length;return"function"==typeof t?r:e}function N(n){var t=E(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",k(u+" "+n))):e.setAttribute("class",k(u.replace(t," ")))}}function z(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function L(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function T(n){return"function"==typeof n?n:(n=Zo.ns.qualify(n)).local?function(){return this.ownerDocument.createElementNS(n.space,n.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,n)}}function q(n){return{__data__:n}}function R(n){return function(){return ga(this,n)}}function D(t){return arguments.length||(t=n),function(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}}function P(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function U(n){return sa(n,da),n}function j(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function H(){var n=this.__transition__;n&&++n.active}function F(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,Xo(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+Zo.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),c=O;a>0&&(n=n.substring(0,a));var s=ya.get(n);return s&&(n=s,c=Y),a?t?u:r:t?v:i}function O(n,t){return function(e){var r=Zo.event;Zo.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{Zo.event=r}}}function Y(n,t){var e=O(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function I(){var n=".dragsuppress-"+ ++Ma,t="click"+n,e=Zo.select(Wo).on("touchmove"+n,y).on("dragstart"+n,y).on("selectstart"+n,y);if(xa){var r=Bo.style,u=r[xa];r[xa]="none"}return function(i){function o(){e.on(t,null)}e.on(n,null),xa&&(r[xa]=u),i&&(e.on(t,function(){y(),o()},!0),setTimeout(o,0))}}function Z(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>_a&&(Wo.scrollX||Wo.scrollY)){e=Zo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e[0][0].getScreenCTM();_a=!(u.f||u.e),e.remove()}return _a?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function V(){return Zo.event.changedTouches[0].identifier}function X(){return Zo.event.target}function $(){return Wo}function B(n){return n>0?1:0>n?-1:0}function W(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function J(n){return n>1?0:-1>n?ba:Math.acos(n)}function G(n){return n>1?Sa:-1>n?-Sa:Math.asin(n)}function K(n){return((n=Math.exp(n))-1/n)/2}function Q(n){return((n=Math.exp(n))+1/n)/2}function nt(n){return((n=Math.exp(2*n))-1)/(n+1)}function tt(n){return(n=Math.sin(n/2))*n}function et(){}function rt(n,t,e){return this instanceof rt?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof rt?new rt(n.h,n.s,n.l):mt(""+n,yt,rt):new rt(n,t,e)}function ut(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new gt(u(n+120),u(n),u(n-120))}function it(n,t,e){return this instanceof it?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof it?new it(n.h,n.c,n.l):n instanceof at?st(n.l,n.a,n.b):st((n=xt((n=Zo.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new it(n,t,e)}function ot(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new at(e,Math.cos(n*=Aa)*t,Math.sin(n)*t)}function at(n,t,e){return this instanceof at?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof at?new at(n.l,n.a,n.b):n instanceof it?ot(n.l,n.c,n.h):xt((n=gt(n)).r,n.g,n.b):new at(n,t,e)}function ct(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=lt(u)*ja,r=lt(r)*Ha,i=lt(i)*Fa,new gt(ht(3.2404542*u-1.5371385*r-.4985314*i),ht(-.969266*u+1.8760108*r+.041556*i),ht(.0556434*u-.2040259*r+1.0572252*i))}function st(n,t,e){return n>0?new it(Math.atan2(e,t)*Ca,Math.sqrt(t*t+e*e),n):new it(0/0,0/0,n)}function lt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function ft(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function ht(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function gt(n,t,e){return this instanceof gt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof gt?new gt(n.r,n.g,n.b):mt(""+n,gt,ut):new gt(n,t,e)}function pt(n){return new gt(n>>16,255&n>>8,255&n)}function vt(n){return pt(n)+""}function dt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function mt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(_t(u[0]),_t(u[1]),_t(u[2]))}return(i=Ia.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.substring(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function yt(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new rt(r,u,c)}function xt(n,t,e){n=Mt(n),t=Mt(t),e=Mt(e);var r=ft((.4124564*n+.3575761*t+.1804375*e)/ja),u=ft((.2126729*n+.7151522*t+.072175*e)/Ha),i=ft((.0193339*n+.119192*t+.9503041*e)/Fa);return at(116*u-16,500*(r-u),200*(u-i))}function Mt(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function _t(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function bt(n){return"function"==typeof n?n:function(){return n}}function wt(n){return n}function St(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),kt(t,e,n,r)}}function kt(n,t,e,r){function u(){var n,t=c.status;if(!t&&c.responseText||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return o.error.call(i,r),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=Zo.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,s=null;return!Wo.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=Zo.event;Zo.event=n;try{o.progress.call(i,c)}finally{Zo.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(s=n,i):s},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(Xo(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var l in a)c.setRequestHeader(l,a[l]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=s&&(c.responseType=s),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},Zo.rebind(i,o,"on"),null==r?i:i.get(Et(r))}function Et(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function At(){var n=Ct(),t=Nt()-n;t>24?(isFinite(t)&&(clearTimeout($a),$a=setTimeout(At,t)),Xa=0):(Xa=1,Wa(At))}function Ct(){var n=Date.now();for(Ba=Za;Ba;)n>=Ba.t&&(Ba.f=Ba.c(n-Ba.t)),Ba=Ba.n;return n}function Nt(){for(var n,t=Za,e=1/0;t;)t.f?t=n?n.n=t.n:Za=t.n:(t.t<e&&(e=t.t),t=(n=t).n);return Va=n,e}function zt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Lt(n,t){var e=Math.pow(10,3*ua(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Tt(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r?function(n){for(var t=n.length,u=[],i=0,o=r[0];t>0&&o>0;)u.push(n.substring(t-=o,t+o)),o=r[i=(i+1)%r.length];return u.reverse().join(e)}:wt;return function(n){var e=Ga.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"",c=e[4]||"",s=e[5],l=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1;switch(h&&(h=+h.substring(1)),(s||"0"===r&&"="===o)&&(s=r="0",o="=",f&&(l-=Math.floor((l-1)/4))),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=Ka.get(g)||qt;var y=s&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):a;if(0>p){var c=Zo.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x=n.lastIndexOf("."),M=0>x?n:n.substring(0,x),_=0>x?"":t+n.substring(x+1);!s&&f&&(M=i(M));var b=v.length+M.length+_.length+(y?0:u.length),w=l>b?new Array(b=l-b+1).join(r):"";return y&&(M=i(w+M)),u+=v,n=M+_,("<"===o?u+n+w:">"===o?w+u+n:"^"===o?w.substring(0,b>>=1)+u+n+w.substring(b):u+(y?n:w+n))+e}}}function qt(n){return n+""}function Rt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Dt(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new nc(e-1)),1),e}function i(n,e){return t(n=new nc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{nc=Rt;var r=new Rt;return r._=n,o(r,t,e)}finally{nc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Pt(n);return c.floor=c,c.round=Pt(r),c.ceil=Pt(u),c.offset=Pt(i),c.range=a,n}function Pt(n){return function(t,e){try{nc=Rt;var r=new Rt;return r._=t,n(r,e)._}finally{nc=Date}}}function Ut(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.substring(c,a)),null!=(u=ec[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=C[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.substring(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&nc!==Rt,o=new(i?Rt:nc);return"j"in r?o.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+Math.floor(r.Z/100),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,o,a=0,c=t.length,s=e.length;c>a;){if(r>=s)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=N[o in ec?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){b.lastIndex=0;var r=b.exec(t.substring(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){M.lastIndex=0;var r=M.exec(t.substring(e));return r?(n.w=_.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.substring(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.substring(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,C.c.toString(),t,r)}function c(n,t,r){return e(n,C.x.toString(),t,r)}function s(n,t,r){return e(n,C.X.toString(),t,r)}function l(n,t,e){var r=x.get(t.substring(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{nc=Rt;var t=new nc;return t._=n,r(t)}finally{nc=Date}}var r=t(n);return e.parse=function(n){try{nc=Rt;var t=r.parse(n);return t&&t._}finally{nc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=re;var x=Zo.map(),M=Ht(v),_=Ft(v),b=Ht(d),w=Ft(d),S=Ht(m),k=Ft(m),E=Ht(y),A=Ft(y);p.forEach(function(n,t){x.set(n.toLowerCase(),t)});var C={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return jt(n.getDate(),t,2)},e:function(n,t){return jt(n.getDate(),t,2)},H:function(n,t){return jt(n.getHours(),t,2)},I:function(n,t){return jt(n.getHours()%12||12,t,2)},j:function(n,t){return jt(1+Qa.dayOfYear(n),t,3)},L:function(n,t){return jt(n.getMilliseconds(),t,3)},m:function(n,t){return jt(n.getMonth()+1,t,2)},M:function(n,t){return jt(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return jt(n.getSeconds(),t,2)},U:function(n,t){return jt(Qa.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return jt(Qa.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return jt(n.getFullYear()%100,t,2)},Y:function(n,t){return jt(n.getFullYear()%1e4,t,4)},Z:te,"%":function(){return"%"}},N={a:r,A:u,b:i,B:o,c:a,d:Wt,e:Wt,H:Gt,I:Gt,j:Jt,L:ne,m:Bt,M:Kt,p:l,S:Qt,U:Yt,w:Ot,W:It,x:c,X:s,y:Vt,Y:Zt,Z:Xt,"%":ee};return t}function jt(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Ht(n){return new RegExp("^(?:"+n.map(Zo.requote).join("|")+")","i")}function Ft(n){for(var t=new o,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Ot(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Yt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e));return r?(n.U=+r[0],e+r[0].length):-1}function It(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e));return r?(n.W=+r[0],e+r[0].length):-1}function Zt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Vt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.y=$t(+r[0]),e+r[0].length):-1}function Xt(n,t,e){return/^[+-]\d{4}$/.test(t=t.substring(e,e+5))?(n.Z=-t,e+5):-1}function $t(n){return n+(n>68?1900:2e3)}function Bt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Wt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Jt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function Gt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function Kt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function Qt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ne(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function te(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=~~(ua(t)/60),u=ua(t)%60;return e+jt(r,"0",2)+jt(u,"0",2)}function ee(n,t,e){uc.lastIndex=0;var r=uc.exec(t.substring(e,e+1));return r?e+r[0].length:-1}function re(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ue(){}function ie(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function oe(n,t){n&&cc.hasOwnProperty(n.type)&&cc[n.type](n,t)}function ae(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function ce(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)ae(n[e],t,1);t.polygonEnd()}function se(){function n(n,t){n*=Aa,t=t*Aa/2+ba/4;var e=n-r,o=e>=0?1:-1,a=o*e,c=Math.cos(t),s=Math.sin(t),l=i*s,f=u*c+l*Math.cos(a),h=l*o*Math.sin(a);lc.add(Math.atan2(h,f)),r=n,u=c,i=s}var t,e,r,u,i;fc.point=function(o,a){fc.point=n,r=(t=o)*Aa,u=Math.cos(a=(e=a)*Aa/2+ba/4),i=Math.sin(a)},fc.lineEnd=function(){n(t,e)}}function le(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function fe(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function he(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function ge(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function pe(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function ve(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function de(n){return[Math.atan2(n[1],n[0]),G(n[2])]}function me(n,t){return ua(n[0]-t[0])<ka&&ua(n[1]-t[1])<ka}function ye(n,t){n*=Aa;var e=Math.cos(t*=Aa);xe(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function xe(n,t,e){++hc,pc+=(n-pc)/hc,vc+=(t-vc)/hc,dc+=(e-dc)/hc}function Me(){function n(n,u){n*=Aa;var i=Math.cos(u*=Aa),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),s=Math.atan2(Math.sqrt((s=e*c-r*a)*s+(s=r*o-t*c)*s+(s=t*a-e*o)*s),t*o+e*a+r*c);gc+=s,mc+=s*(t+(t=o)),yc+=s*(e+(e=a)),xc+=s*(r+(r=c)),xe(t,e,r)}var t,e,r;wc.point=function(u,i){u*=Aa;var o=Math.cos(i*=Aa);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),wc.point=n,xe(t,e,r)}}function _e(){wc.point=ye}function be(){function n(n,t){n*=Aa;var e=Math.cos(t*=Aa),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),s=u*c-i*a,l=i*o-r*c,f=r*a-u*o,h=Math.sqrt(s*s+l*l+f*f),g=r*o+u*a+i*c,p=h&&-J(g)/h,v=Math.atan2(h,g);Mc+=p*s,_c+=p*l,bc+=p*f,gc+=v,mc+=v*(r+(r=o)),yc+=v*(u+(u=a)),xc+=v*(i+(i=c)),xe(r,u,i)}var t,e,r,u,i;wc.point=function(o,a){t=o,e=a,wc.point=n,o*=Aa;var c=Math.cos(a*=Aa);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),xe(r,u,i)},wc.lineEnd=function(){n(t,e),wc.lineEnd=_e,wc.point=ye}}function we(){return!0}function Se(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(me(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return u.lineEnd(),void 0}var c=new Ee(e,n,null,!0),s=new Ee(e,null,c,!1);c.o=s,i.push(c),o.push(s),c=new Ee(r,n,null,!1),s=new Ee(r,null,c,!0),c.o=s,i.push(c),o.push(s)}}),o.sort(t),ke(i),ke(o),i.length){for(var a=0,c=e,s=o.length;s>a;++a)o[a].e=c=!c;for(var l,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;l=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,s=l.length;s>a;++a)u.point((f=l[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){l=g.p.z;for(var a=l.length-1;a>=0;--a)u.point((f=l[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,l=g.z,p=!p}while(!g.v);u.lineEnd()}}}function ke(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function Ee(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Ae(n,t,e,r){return function(u,i){function o(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function a(n,t){var e=u(n,t);d.point(e[0],e[1])}function c(){y.point=a,d.lineStart()}function s(){y.point=o,d.lineEnd()}function l(n,t){v.push([n,t]);var e=u(n,t);M.point(e[0],e[1])}function f(){M.lineStart(),v=[]}function h(){l(v[0][0],v[0][1]),M.lineEnd();var n,t=M.clean(),e=x.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,o=-1;if(r>0){for(_||(i.polygonStart(),_=!0),i.lineStart();++o<r;)i.point((u=n[o])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Ce))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:s,polygonStart:function(){y.point=l,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=s,g=Zo.merge(g);var n=Le(m,p);g.length?(_||(i.polygonStart(),_=!0),Se(g,ze,n,e,i)):n&&(_||(i.polygonStart(),_=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),_&&(i.polygonEnd(),_=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},x=Ne(),M=t(x),_=!1;return y}}function Ce(n){return n.length>1}function Ne(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:v,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function ze(n,t){return((n=n.x)[0]<0?n[1]-Sa-ka:Sa-n[1])-((t=t.x)[0]<0?t[1]-Sa-ka:Sa-t[1])}function Le(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;lc.reset();for(var a=0,c=t.length;c>a;++a){var s=t[a],l=s.length;if(l)for(var f=s[0],h=f[0],g=f[1]/2+ba/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===l&&(d=0),n=s[d];var m=n[0],y=n[1]/2+ba/4,x=Math.sin(y),M=Math.cos(y),_=m-h,b=_>=0?1:-1,w=b*_,S=w>ba,k=p*x;if(lc.add(Math.atan2(k*b*Math.sin(w),v*M+k*Math.cos(w))),i+=S?_+b*wa:_,S^h>=e^m>=e){var E=he(le(f),le(n));ve(E);var A=he(u,E);ve(A);var C=(S^_>=0?-1:1)*G(A[2]);(r>C||r===C&&(E[0]||E[1]))&&(o+=S^_>=0?1:-1)}if(!d++)break;h=m,p=x,v=M,f=n}}return(-ka>i||ka>i&&0>lc)^1&o}function Te(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?ba:-ba,c=ua(i-e);ua(c-ba)<ka?(n.point(e,r=(r+o)/2>0?Sa:-Sa),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=ba&&(ua(e-u)<ka&&(e-=u*ka),ua(i-a)<ka&&(i-=a*ka),r=qe(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function qe(n,t,e,r){var u,i,o=Math.sin(n-e);return ua(o)>ka?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function Re(n,t,e,r){var u;if(null==n)u=e*Sa,r.point(-ba,u),r.point(0,u),r.point(ba,u),r.point(ba,0),r.point(ba,-u),r.point(0,-u),r.point(-ba,-u),r.point(-ba,0),r.point(-ba,u);else if(ua(n[0]-t[0])>ka){var i=n[0]<t[0]?ba:-ba;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function De(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,s,l;return{lineStart:function(){s=c=!1,l=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?ba:-ba),h):0;if(!e&&(s=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(me(e,g)||me(p,g))&&(p[0]+=ka,p[1]+=ka,v=t(p[0],p[1]))),v!==c)l=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(l=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&me(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return l|(s&&c)<<1}}}function r(n,t,e){var r=le(n),u=le(t),o=[1,0,0],a=he(r,u),c=fe(a,a),s=a[0],l=c-s*s;if(!l)return!e&&n;var f=i*c/l,h=-i*s/l,g=he(o,a),p=pe(o,f),v=pe(a,h);ge(p,v);var d=g,m=fe(p,d),y=fe(d,d),x=m*m-y*(fe(p,p)-1);if(!(0>x)){var M=Math.sqrt(x),_=pe(d,(-m-M)/y);if(ge(_,p),_=de(_),!e)return _;var b,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(b=w,w=S,S=b);var A=S-w,C=ua(A-ba)<ka,N=C||ka>A;if(!C&&k>E&&(b=k,k=E,E=b),N?C?k+E>0^_[1]<(ua(_[0]-w)<ka?k:E):k<=_[1]&&_[1]<=E:A>ba^(w<=_[0]&&_[0]<=S)){var z=pe(d,(-m+M)/y);return ge(z,p),[_,de(z)]}}}function u(t,e){var r=o?n:ba-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=ua(i)>ka,c=sr(n,6*Aa);return Ae(t,e,c,o?[0,-n]:[-ba,n-ba])}function Pe(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,s=o.y,l=a.x,f=a.y,h=0,g=1,p=l-c,v=f-s;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-s,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-s,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:s+h*v}),1>g&&(u.b={x:c+g*p,y:s+g*v}),u}}}}}}function Ue(n,t,e,r){function u(r,u){return ua(r[0]-n)<ka?u>0?0:3:ua(r[0]-e)<ka?u>0?2:1:ua(r[1]-t)<ka?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,s=a[0];c>o;++o)i=a[o],s[1]<=r?i[1]>r&&W(s,i,n)>0&&++t:i[1]<=r&&W(s,i,n)<0&&--t,s=i;return 0!==t}function s(i,a,c,s){var l=0,f=0;if(null==i||(l=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do s.point(0===l||3===l?n:e,l>1?r:t);while((l=(l+c+4)%4)!==f)}else s.point(a[0],a[1])}function l(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){l(n,t)&&a.point(n,t)}function h(){N.point=p,d&&d.push(m=[]),S=!0,w=!1,_=b=0/0}function g(){v&&(p(y,x),M&&w&&A.rejoin(),v.push(A.buffer())),N.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-kc,Math.min(kc,n)),t=Math.max(-kc,Math.min(kc,t));var e=l(n,t);if(d&&m.push([n,t]),S)y=n,x=t,M=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:_,y:b},b:{x:n,y:t}};C(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}_=n,b=t,w=e}var v,d,m,y,x,M,_,b,w,S,k,E=a,A=Ne(),C=Pe(n,t,e,r),N={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=Zo.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),u&&Se(v,i,t,s,a),a.polygonEnd()),v=d=m=null}};return N}}function je(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function He(n){var t=0,e=ba/3,r=tr(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*ba/180,e=n[1]*ba/180):[180*(t/ba),180*(e/ba)]},u}function Fe(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,G((i-(n*n+e*e)*u*u)/(2*u))]},e}function Oe(){function n(n,t){Ac+=u*n-r*t,r=n,u=t}var t,e,r,u;Tc.point=function(i,o){Tc.point=n,t=r=i,e=u=o},Tc.lineEnd=function(){n(t,e)}}function Ye(n,t){Cc>n&&(Cc=n),n>zc&&(zc=n),Nc>t&&(Nc=t),t>Lc&&(Lc=t)}function Ie(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=Ze(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=Ze(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Ze(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Ve(n,t){pc+=n,vc+=t,++dc}function Xe(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);mc+=o*(t+n)/2,yc+=o*(e+r)/2,xc+=o,Ve(t=n,e=r)}var t,e;Rc.point=function(r,u){Rc.point=n,Ve(t=r,e=u)}}function $e(){Rc.point=Ve}function Be(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);mc+=o*(r+n)/2,yc+=o*(u+t)/2,xc+=o,o=u*n-r*t,Mc+=o*(r+n),_c+=o*(u+t),bc+=3*o,Ve(r=n,u=t)}var t,e,r,u;Rc.point=function(i,o){Rc.point=n,Ve(t=r=i,e=u=o)},Rc.lineEnd=function(){n(t,e)}}function We(n){function t(t,e){n.moveTo(t,e),n.arc(t,e,o,0,wa)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:v};return a}function Je(n){function t(n){return(a?r:e)(n)}function e(t){return Qe(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){x=0/0,S.point=i,t.lineStart()}function i(e,r){var i=le([e,r]),o=n(e,r);u(x,M,y,_,b,w,x=o[0],M=o[1],y=e,_=i[0],b=i[1],w=i[2],a,t),t.point(x,M)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=s,S.lineEnd=l}function s(n,t){i(f=n,h=t),g=x,p=M,v=_,d=b,m=w,S.point=i}function l(){u(x,M,y,_,b,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,x,M,_,b,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,s,l,f,h,g,p,v,d,m){var y=l-t,x=f-e,M=y*y+x*x;if(M>4*i&&d--){var _=a+g,b=c+p,w=s+v,S=Math.sqrt(_*_+b*b+w*w),k=Math.asin(w/=S),E=ua(ua(w)-1)<ka||ua(r-h)<ka?(r+h)/2:Math.atan2(b,_),A=n(E,k),C=A[0],N=A[1],z=C-t,L=N-e,T=x*z-y*L;(T*T/M>i||ua((y*z+x*L)/M-.5)>.3||o>a*g+c*p+s*v)&&(u(t,e,r,a,c,s,C,N,E,_/=S,b/=S,w,d,m),m.point(C,N),u(C,N,E,_,b,w,l,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Aa),a=16; return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function Ge(n){var t=Je(function(t,e){return n([t*Ca,e*Ca])});return function(n){return er(t(n))}}function Ke(n){this.stream=n}function Qe(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function nr(n){return tr(function(){return n})()}function tr(n){function t(n){return n=a(n[0]*Aa,n[1]*Aa),[n[0]*h+c,s-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(s-n[1])/h),n&&[n[0]*Ca,n[1]*Ca]}function r(){a=je(o=ir(m,y,x),i);var n=i(v,d);return c=g-n[0]*h,s=p+n[1]*h,u()}function u(){return l&&(l.valid=!1,l=null),t}var i,o,a,c,s,l,f=Je(function(n,t){return n=i(n,t),[n[0]*h+c,s-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,y=0,x=0,M=Sc,_=wt,b=null,w=null;return t.stream=function(n){return l&&(l.valid=!1),l=er(M(o,f(_(n)))),l.valid=!0,l},t.clipAngle=function(n){return arguments.length?(M=null==n?(b=n,Sc):De((b=+n)*Aa),u()):b},t.clipExtent=function(n){return arguments.length?(w=n,_=n?Ue(n[0][0],n[0][1],n[1][0],n[1][1]):wt,u()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Aa,d=n[1]%360*Aa,r()):[v*Ca,d*Ca]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Aa,y=n[1]%360*Aa,x=n.length>2?n[2]%360*Aa:0,r()):[m*Ca,y*Ca,x*Ca]},Zo.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function er(n){return Qe(n,function(t,e){n.point(t*Aa,e*Aa)})}function rr(n,t){return[n,t]}function ur(n,t){return[n>ba?n-wa:-ba>n?n+wa:n,t]}function ir(n,t,e){return n?t||e?je(ar(n),cr(t,e)):ar(n):t||e?cr(t,e):ur}function or(n){return function(t,e){return t+=n,[t>ba?t-wa:-ba>t?t+wa:t,e]}}function ar(n){var t=or(n);return t.invert=or(-n),t}function cr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,s=Math.sin(t),l=s*r+a*u;return[Math.atan2(c*i-l*o,a*r-s*u),G(l*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,s=Math.sin(t),l=s*i-c*o;return[Math.atan2(c*i+s*o,a*r+l*u),G(l*r-a*u)]},e}function sr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=lr(e,u),i=lr(e,i),(o>0?i>u:u>i)&&(u+=o*wa)):(u=n+o*wa,i=n-.5*c);for(var s,l=u;o>0?l>i:i>l;l-=c)a.point((s=de([e,-r*Math.cos(l),-r*Math.sin(l)]))[0],s[1])}}function lr(n,t){var e=le(t);e[0]-=n,ve(e);var r=J(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-ka)%(2*Math.PI)}function fr(n,t,e){var r=Zo.range(n,t-ka,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function hr(n,t,e){var r=Zo.range(n,t-ka,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function gr(n){return n.source}function pr(n){return n.target}function vr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),s=u*Math.sin(n),l=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(tt(r-t)+u*o*tt(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*l,u=e*s+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Ca,Math.atan2(o,Math.sqrt(r*r+u*u))*Ca]}:function(){return[n*Ca,t*Ca]};return p.distance=h,p}function dr(){function n(n,u){var i=Math.sin(u*=Aa),o=Math.cos(u),a=ua((n*=Aa)-t),c=Math.cos(a);Dc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Pc.point=function(u,i){t=u*Aa,e=Math.sin(i*=Aa),r=Math.cos(i),Pc.point=n},Pc.lineEnd=function(){Pc.point=Pc.lineEnd=v}}function mr(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function yr(n,t){function e(n,t){o>0?-Sa+ka>t&&(t=-Sa+ka):t>Sa-ka&&(t=Sa-ka);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(ba/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=B(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Sa]},e):Mr}function xr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return ua(u)<ka?rr:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-B(u)*Math.sqrt(n*n+e*e)]},e)}function Mr(n,t){return[n,Math.log(Math.tan(ba/4+t/2))]}function _r(n){var t,e=nr(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=ba*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function br(n,t){return[Math.log(Math.tan(ba/4+t/2)),-n]}function wr(n){return n[0]}function Sr(n){return n[1]}function kr(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&W(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function Er(n,t){return n[0]-t[0]||n[1]-t[1]}function Ar(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Cr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],s=e[1],l=t[1]-c,f=r[1]-s,h=(a*(c-s)-f*(u-i))/(f*o-a*l);return[u+h*o,c+h*l]}function Nr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function zr(){Gr(this),this.edge=this.site=this.circle=null}function Lr(n){var t=Bc.pop()||new zr;return t.site=n,t}function Tr(n){Yr(n),Vc.remove(n),Bc.push(n),Gr(n)}function qr(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Tr(n);for(var c=i;c.circle&&ua(e-c.circle.x)<ka&&ua(r-c.circle.cy)<ka;)i=c.P,a.unshift(c),Tr(c),c=i;a.unshift(c),Yr(c);for(var s=o;s.circle&&ua(e-s.circle.x)<ka&&ua(r-s.circle.cy)<ka;)o=s.N,a.push(s),Tr(s),s=o;a.push(s),Yr(s);var l,f=a.length;for(l=1;f>l;++l)s=a[l],c=a[l-1],Br(s.edge,c.site,s.site,u);c=a[0],s=a[f-1],s.edge=Xr(c.site,s.site,null,u),Or(c),Or(s)}function Rr(n){for(var t,e,r,u,i=n.x,o=n.y,a=Vc._;a;)if(r=Dr(a,o)-i,r>ka)a=a.L;else{if(u=i-Pr(a,o),!(u>ka)){r>-ka?(t=a.P,e=a):u>-ka?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Lr(n);if(Vc.insert(t,c),t||e){if(t===e)return Yr(t),e=Lr(t.site),Vc.insert(c,e),c.edge=e.edge=Xr(t.site,c.site),Or(t),Or(e),void 0;if(!e)return c.edge=Xr(t.site,c.site),void 0;Yr(t),Yr(e);var s=t.site,l=s.x,f=s.y,h=n.x-l,g=n.y-f,p=e.site,v=p.x-l,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,x=v*v+d*d,M={x:(d*y-g*x)/m+l,y:(h*x-v*y)/m+f};Br(e.edge,s,p,M),c.edge=Xr(s,n,null,M),e.edge=Xr(n,p,null,M),Or(t),Or(e)}}function Dr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,s=c-t;if(!s)return a;var l=a-r,f=1/i-1/s,h=l/s;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*s)-c+s/2+u-i/2)))/f+r:(r+a)/2}function Pr(n,t){var e=n.N;if(e)return Dr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ur(n){this.site=n,this.edges=[]}function jr(n){for(var t,e,r,u,i,o,a,c,s,l,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=Zc,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)l=a[o].end(),r=l.x,u=l.y,s=a[++o%c].start(),t=s.x,e=s.y,(ua(r-t)>ka||ua(u-e)>ka)&&(a.splice(o,0,new Wr($r(i.site,l,ua(r-f)<ka&&p-u>ka?{x:f,y:ua(t-f)<ka?e:p}:ua(u-p)<ka&&h-r>ka?{x:ua(e-p)<ka?t:h,y:p}:ua(r-h)<ka&&u-g>ka?{x:h,y:ua(t-h)<ka?e:g}:ua(u-g)<ka&&r-f>ka?{x:ua(e-g)<ka?t:f,y:g}:null),i.site,null)),++c)}function Hr(n,t){return t.angle-n.angle}function Fr(){Gr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Or(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var o=u.x,a=u.y,c=r.x-o,s=r.y-a,l=i.x-o,f=i.y-a,h=2*(c*f-s*l);if(!(h>=-Ea)){var g=c*c+s*s,p=l*l+f*f,v=(f*g-s*p)/h,d=(c*p-l*g)/h,f=d+a,m=Wc.pop()||new Fr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,x=$c._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}$c.insert(y,m),y||(Xc=m)}}}}function Yr(n){var t=n.circle;t&&(t.P||(Xc=t.N),$c.remove(t),Wc.push(t),Gr(t),n.circle=null)}function Ir(n){for(var t,e=Ic,r=Pe(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Zr(t,n)||!r(t)||ua(t.a.x-t.b.x)<ka&&ua(t.a.y-t.b.y)<ka)&&(t.a=t.b=null,e.splice(u,1))}function Zr(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],s=t[1][1],l=n.l,f=n.r,h=l.x,g=l.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(o>d||d>=a)return;if(h>p){if(i){if(i.y>=s)return}else i={x:d,y:c};e={x:d,y:s}}else{if(i){if(i.y<c)return}else i={x:d,y:s};e={x:d,y:c}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=s)return}else i={x:(c-u)/r,y:c};e={x:(s-u)/r,y:s}}else{if(i){if(i.y<c)return}else i={x:(s-u)/r,y:s};e={x:(c-u)/r,y:c}}else if(v>g){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.x<o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}return n.a=i,n.b=e,!0}function Vr(n,t){this.l=n,this.r=t,this.a=this.b=null}function Xr(n,t,e,r){var u=new Vr(n,t);return Ic.push(u),e&&Br(u,n,t,e),r&&Br(u,t,n,r),Zc[n.i].edges.push(new Wr(u,n,t)),Zc[t.i].edges.push(new Wr(u,t,n)),u}function $r(n,t,e){var r=new Vr(n,null);return r.a=t,r.b=e,Ic.push(r),r}function Br(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function Wr(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function Jr(){this._=null}function Gr(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function Kr(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Qr(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function nu(n){for(;n.L;)n=n.L;return n}function tu(n,t){var e,r,u,i=n.sort(eu).pop();for(Ic=[],Zc=new Array(n.length),Vc=new Jr,$c=new Jr;;)if(u=Xc,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(Zc[i.i]=new Ur(i),Rr(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;qr(u.arc)}t&&(Ir(t),jr(t));var o={cells:Zc,edges:Ic};return Vc=$c=Ic=Zc=null,o}function eu(n,t){return t.y-n.y||t.x-n.x}function ru(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function uu(n){return n.x}function iu(n){return n.y}function ou(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function au(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&au(n,c[0],e,r,o,a),c[1]&&au(n,c[1],o,r,u,a),c[2]&&au(n,c[2],e,a,o,i),c[3]&&au(n,c[3],o,a,u,i)}}function cu(n,t){n=Zo.rgb(n),t=Zo.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+dt(Math.round(e+i*n))+dt(Math.round(r+o*n))+dt(Math.round(u+a*n))}}function su(n,t){var e,r={},u={};for(e in n)e in t?r[e]=hu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function lu(n,t){return t-=n=+n,function(e){return n+t*e}}function fu(n,t){var e,r,u,i=Gc.lastIndex=Kc.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=Gc.exec(n))&&(r=Kc.exec(t));)(u=r.index)>i&&(u=t.substring(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:lu(e,r)})),i=Kc.lastIndex;return i<t.length&&(u=t.substring(i),a[o]?a[o]+=u:a[++o]=u),a.length<2?c[0]?(t=c[0].x,function(n){return t(n)+""}):function(){return t}:(t=c.length,function(n){for(var e,r=0;t>r;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function hu(n,t){for(var e,r=Zo.interpolators.length;--r>=0&&!(e=Zo.interpolators[r](n,t)););return e}function gu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(hu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function pu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function vu(n){return function(t){return 1-n(1-t)}}function du(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function mu(n){return n*n}function yu(n){return n*n*n}function xu(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Mu(n){return function(t){return Math.pow(t,n)}}function _u(n){return 1-Math.cos(n*Sa)}function bu(n){return Math.pow(2,10*(n-1))}function wu(n){return 1-Math.sqrt(1-n*n)}function Su(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/wa*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*wa/t)}}function ku(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Eu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Au(n,t){n=Zo.hcl(n),t=Zo.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ot(e+i*n,r+o*n,u+a*n)+""}}function Cu(n,t){n=Zo.hsl(n),t=Zo.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ut(e+i*n,r+o*n,u+a*n)+""}}function Nu(n,t){n=Zo.lab(n),t=Zo.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function zu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Lu(n){var t=[n.a,n.b],e=[n.c,n.d],r=qu(t),u=Tu(t,e),i=qu(Ru(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Ca,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Ca:0}function Tu(n,t){return n[0]*t[0]+n[1]*t[1]}function qu(n){var t=Math.sqrt(Tu(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Ru(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Du(n,t){var e,r=[],u=[],i=Zo.transform(n),o=Zo.transform(t),a=i.translate,c=o.translate,s=i.rotate,l=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:lu(a[0],c[0])},{i:3,x:lu(a[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),s!=l?(s-l>180?l+=360:l-s>180&&(s+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:lu(s,l)})):l&&r.push(r.pop()+"rotate("+l+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:lu(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:lu(g[0],p[0])},{i:e-2,x:lu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Pu(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return(e-n)*t}}function Uu(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return Math.max(0,Math.min(1,(e-n)*t))}}function ju(n){for(var t=n.source,e=n.target,r=Fu(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Hu(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Fu(n,t){if(n===t)return n;for(var e=Hu(n),r=Hu(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function Ou(n){n.fixed|=2}function Yu(n){n.fixed&=-7}function Iu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Zu(n){n.fixed&=-5}function Vu(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(Vu(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var s=t*e[n.point.index];n.charge+=n.pointCharge=s,r+=s*n.point.x,u+=s*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function Xu(n,t){return Zo.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=Ku,n}function $u(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function Bu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++o<u;)e.push(i[o]);for(;null!=(n=r.pop());)t(n)}function Wu(n){return n.children}function Ju(n){return n.value}function Gu(n,t){return t.value-n.value}function Ku(n){return Zo.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function Qu(n){return n.x}function ni(n){return n.y}function ti(n,t,e){n.y0=t,n.y=e}function ei(n){return Zo.range(n.length)}function ri(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function ui(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function ii(n){return n.reduce(oi,0)}function oi(n,t){return n+t[1]}function ai(n,t){return ci(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function ci(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function si(n){return[Zo.min(n),Zo.max(n)]}function li(n,t){return n.value-t.value}function fi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function hi(n,t){n._pack_next=t,t._pack_prev=n}function gi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function pi(n){function t(n){l=Math.min(n.x-n.r,l),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(s=e.length)){var e,r,u,i,o,a,c,s,l=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(vi),r=e[0],r.x=-r.r,r.y=0,t(r),s>1&&(u=e[1],u.x=u.r,u.y=0,t(u),s>2))for(i=e[2],yi(r,u,i),t(i),fi(r,i),r._pack_prev=i,fi(i,u),u=r._pack_next,o=3;s>o;o++){yi(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(gi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!gi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?hi(r,u=a):hi(r=c,u),o--):(fi(r,i),u=i,t(i))}var m=(l+f)/2,y=(h+g)/2,x=0;for(o=0;s>o;o++)i=e[o],i.x-=m,i.y-=y,x=Math.max(x,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=x,e.forEach(di)}}function vi(n){n._pack_next=n._pack_prev=n}function di(n){delete n._pack_next,delete n._pack_prev}function mi(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)mi(u[i],t,e,r)}function yi(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),s=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+s*i,e.y=n.y+c*i-s*u}else e.x=n.x+r,e.y=n.y}function xi(n,t){return n.parent==t.parent?1:2}function Mi(n){var t=n.children;return t.length?t[0]:n.t}function _i(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function bi(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function wi(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Si(n,t,e){return n.a.parent===t.parent?n.a:e}function ki(n){return 1+Zo.max(n,function(n){return n.y})}function Ei(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Ai(n){var t=n.children;return t&&t.length?Ai(t[0]):n}function Ci(n){var t,e=n.children;return e&&(t=e.length)?Ci(e[t-1]):n}function Ni(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function zi(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Li(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Ti(n){return n.rangeExtent?n.rangeExtent():Li(n.range())}function qi(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Ri(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Di(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:ss}function Pi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=Zo.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Ui(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Pi:qi,c=r?Uu:Pu;return o=u(n,t,c,e),a=u(t,n,c,hu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(zu)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Oi(n,t)},i.tickFormat=function(t,e){return Yi(n,t,e)},i.nice=function(t){return Hi(n,t),u()},i.copy=function(){return Ui(n,t,e,r)},u()}function ji(n,t){return Zo.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Hi(n,t){return Ri(n,Di(Fi(n,t)[2]))}function Fi(n,t){null==t&&(t=10);var e=Li(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Oi(n,t){return Zo.range.apply(Zo,Fi(n,t))}function Yi(n,t,e){var r=Fi(n,t);if(e){var u=Ga.exec(e);if(u.shift(),"s"===u[8]){var i=Zo.formatPrefix(Math.max(ua(r[0]),ua(r[1])));return u[7]||(u[7]="."+Ii(i.scale(r[2]))),u[8]="f",e=Zo.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Zi(u[8],r)),e=u.join("")}else e=",."+Ii(r[2])+"f";return Zo.format(e)}function Ii(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Zi(n,t){var e=Ii(t[2]);return n in ls?Math.abs(e-Ii(Math.max(ua(t[0]),ua(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Vi(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Ri(r.map(u),e?Math:hs);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Li(r),o=[],a=n[0],c=n[1],s=Math.floor(u(a)),l=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(l-s)){if(e){for(;l>s;s++)for(var h=1;f>h;h++)o.push(i(s)*h);o.push(i(s))}else for(o.push(i(s));s++<l;)for(var h=f-1;h>0;h--)o.push(i(s)*h);for(s=0;o[s]<a;s++);for(l=o.length;o[l-1]>c;l--);o=o.slice(s,l)}return o},o.tickFormat=function(n,t){if(!arguments.length)return fs;arguments.length<2?t=fs:"function"!=typeof t&&(t=Zo.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Vi(n.copy(),t,e,r)},ji(o,n)}function Xi(n,t,e){function r(t){return n(u(t))}var u=$i(t),i=$i(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Oi(e,n)},r.tickFormat=function(n,t){return Yi(e,n,t)},r.nice=function(n){return r.domain(Hi(e,n))},r.exponent=function(o){return arguments.length?(u=$i(t=o),i=$i(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Xi(n.copy(),t,e)},ji(r,n)}function $i(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Bi(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return Zo.range(n.length).map(function(n){return t+e*n})}var u,i,a;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new o;for(var i,a=-1,c=r.length;++a<c;)u.has(i=r[a])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,a=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,o){arguments.length<2&&(o=0);var c=u[0],s=u[1],l=(s-c)/(Math.max(1,n.length-1)+o);return i=r(n.length<2?(c+s)/2:c+l*o/2,l),a=0,t={t:"rangePoints",a:arguments},e},e.rangeBands=function(u,o,c){arguments.length<2&&(o=0),arguments.length<3&&(c=o);var s=u[1]<u[0],l=u[s-0],f=u[1-s],h=(f-l)/(n.length-o+2*c);return i=r(l+h*c,h),s&&i.reverse(),a=h*(1-o),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,o,c){arguments.length<2&&(o=0),arguments.length<3&&(c=o);var s=u[1]<u[0],l=u[s-0],f=u[1-s],h=Math.floor((f-l)/(n.length-o+2*c)),g=f-l-(n.length-o)*h;return i=r(l+Math.round(g/2),h),s&&i.reverse(),a=Math.round(h*(1-o)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return a},e.rangeExtent=function(){return Li(t.a[0])},e.copy=function(){return Bi(n,t)},e.domain(n)}function Wi(e,r){function u(){var n=0,t=r.length;for(o=[];++n<t;)o[n-1]=Zo.quantile(e,n/t);return i}function i(n){return isNaN(n=+n)?void 0:r[Zo.bisect(o,n)]}var o;return i.domain=function(r){return arguments.length?(e=r.filter(t).sort(n),u()):e},i.range=function(n){return arguments.length?(r=n,u()):r},i.quantiles=function(){return o},i.invertExtent=function(n){return n=r.indexOf(n),0>n?[0/0,0/0]:[n>0?o[n-1]:e[0],n<o.length?o[n]:e[e.length-1]]},i.copy=function(){return Wi(e,r)},u()}function Ji(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return Ji(n,t,e)},u()}function Gi(n,t){function e(e){return e>=e?t[Zo.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return Gi(n,t)},e}function Ki(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Oi(n,t)},t.tickFormat=function(t,e){return Yi(n,t,e)},t.copy=function(){return Ki(n)},t}function Qi(n){return n.innerRadius}function no(n){return n.outerRadius}function to(n){return n.startAngle}function eo(n){return n.endAngle}function ro(n){function t(t){function o(){s.push("M",i(n(l),a))}for(var c,s=[],l=[],f=-1,h=t.length,g=bt(e),p=bt(r);++f<h;)u.call(this,c=t[f],f)?l.push([+g.call(this,c,f),+p.call(this,c,f)]):l.length&&(o(),l=[]);return l.length&&o(),s.length?s.join(""):null}var e=wr,r=Sr,u=we,i=uo,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=xs.get(n)||uo).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function uo(n){return n.join("L")}function io(n){return uo(n)+"Z"}function oo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function ao(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function co(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function so(n,t){return n.length<4?uo(n):n[1]+ho(n.slice(1,n.length-1),go(n,t))}function lo(n,t){return n.length<3?uo(n):n[0]+ho((n.push(n[0]),n),go([n[n.length-2]].concat(n,[n[1]]),t))}function fo(n,t){return n.length<3?uo(n):n[0]+ho(n,go(n,t))}function ho(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return uo(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var s=2;s<t.length;s++,c++)i=n[c],a=t[s],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var l=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+l[0]+","+l[1]}return r}function go(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function po(n){if(n.length<3)return uo(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",xo(bs,o),",",xo(bs,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Mo(c,o,a);return n.pop(),c.push("L",r),c.join("")}function vo(n){if(n.length<4)return uo(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(xo(bs,i)+","+xo(bs,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Mo(e,i,o);return e.join("")}function mo(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[xo(bs,o),",",xo(bs,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Mo(t,o,a);return t.join("")}function yo(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,s=-1;++s<=e;)r=n[s],u=s/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return po(n)}function xo(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Mo(n,t,e){n.push("C",xo(Ms,t),",",xo(Ms,e),",",xo(_s,t),",",xo(_s,e),",",xo(bs,t),",",xo(bs,e))}function _o(n,t){return(t[1]-n[1])/(t[0]-n[0])}function bo(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=_o(u,i);++t<e;)r[t]=(o+(o=_o(u=i,i=n[t+1])))/2;return r[t]=o,r}function wo(n){for(var t,e,r,u,i=[],o=bo(n),a=-1,c=n.length-1;++a<c;)t=_o(n[a],n[a+1]),ua(t)<ka?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function So(n){return n.length<3?uo(n):n[0]+ho(n,wo(n))}function ko(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]+ms,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Eo(n){function t(t){function c(){v.push("M",a(n(m),f),l,s(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,x=t.length,M=bt(e),_=bt(u),b=e===r?function(){return g}:bt(r),w=u===i?function(){return p}:bt(i);++y<x;)o.call(this,h=t[y],y)?(d.push([g=+M.call(this,h,y),p=+_.call(this,h,y)]),m.push([+b.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var e=wr,r=wr,u=0,i=Sr,o=we,a=uo,c=a.key,s=a,l="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=xs.get(n)||uo).key,s=a.reverse||a,l=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Ao(n){return n.radius}function Co(n){return[n.x,n.y]}function No(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]+ms;return[e*Math.cos(r),e*Math.sin(r)]}}function zo(){return 64}function Lo(){return"circle"}function To(n){var t=Math.sqrt(n/ba);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function qo(n,t){return sa(n,Cs),n.id=t,n}function Ro(n,t,e,r){var u=n.id;return P(n,"function"==typeof e?function(n,i,o){n.__transition__[u].tween.set(t,r(e.call(n,n.__data__,i,o)))}:(e=r(e),function(n){n.__transition__[u].tween.set(t,e)}))}function Do(n){return null==n&&(n=""),function(){this.textContent=n}}function Po(n,t,e,r){var u=n.__transition__||(n.__transition__={active:0,count:0}),i=u[e];if(!i){var a=r.time;i=u[e]={tween:new o,time:a,ease:r.ease,delay:r.delay,duration:r.duration},++u.count,Zo.timer(function(r){function o(r){return u.active>e?s():(u.active=e,i.event&&i.event.start.call(n,l,t),i.tween.forEach(function(e,r){(r=r.call(n,l,t))&&v.push(r)}),Zo.timer(function(){return p.c=c(r||1)?we:c,1},0,a),void 0)}function c(r){if(u.active!==e)return s();for(var o=r/g,a=f(o),c=v.length;c>0;)v[--c].call(n,a); return o>=1?(i.event&&i.event.end.call(n,l,t),s()):void 0}function s(){return--u.count?delete u[e]:delete n.__transition__,1}var l=n.__data__,f=i.ease,h=i.delay,g=i.duration,p=Ba,v=[];return p.t=h+a,r>=h?o(r-h):(p.c=o,void 0)},0,a)}}function Uo(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function jo(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function Ho(n){return n.toISOString()}function Fo(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=Zo.bisect(Us,u);return i==Us.length?[t.year,Fi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Us[i-1]<Us[i]/u?i-1:i]:[Fs,Fi(n,e)[2]]}return r.invert=function(t){return Oo(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Oo)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Oo(+e+1),t).length}var i=r.domain(),o=Li(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Ri(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Oo(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Oo(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Li(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Oo(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Fo(n.copy(),t,e)},ji(r,n)}function Oo(n){return new Date(n)}function Yo(n){return JSON.parse(n.responseText)}function Io(n){var t=$o.createRange();return t.selectNode($o.body),t.createContextualFragment(n.responseText)}var Zo={version:"3.4.11"};Date.now||(Date.now=function(){return+new Date});var Vo=[].slice,Xo=function(n){return Vo.call(n)},$o=document,Bo=$o.documentElement,Wo=window;try{Xo(Bo.childNodes)[0].nodeType}catch(Jo){Xo=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}try{$o.createElement("div").style.setProperty("opacity",0,"")}catch(Go){var Ko=Wo.Element.prototype,Qo=Ko.setAttribute,na=Ko.setAttributeNS,ta=Wo.CSSStyleDeclaration.prototype,ea=ta.setProperty;Ko.setAttribute=function(n,t){Qo.call(this,n,t+"")},Ko.setAttributeNS=function(n,t,e){na.call(this,n,t,e+"")},ta.setProperty=function(n,t,e){ea.call(this,n,t+"",e)}}Zo.ascending=n,Zo.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},Zo.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(e=n[u])&&e>=e);)e=void 0;for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i&&!(null!=(e=t.call(n,n[u],u))&&e>=e);)e=void 0;for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},Zo.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(e=n[u])&&e>=e);)e=void 0;for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i&&!(null!=(e=t.call(n,n[u],u))&&e>=e);)e=void 0;for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},Zo.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o&&!(null!=(e=u=n[i])&&e>=e);)e=u=void 0;for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o&&!(null!=(e=u=t.call(n,n[i],i))&&e>=e);)e=void 0;for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},Zo.sum=function(n,t){var e,r=0,u=n.length,i=-1;if(1===arguments.length)for(;++i<u;)isNaN(e=+n[i])||(r+=e);else for(;++i<u;)isNaN(e=+t.call(n,n[i],i))||(r+=e);return r},Zo.mean=function(n,e){var r,u=0,i=n.length,o=-1,a=i;if(1===arguments.length)for(;++o<i;)t(r=n[o])?u+=r:--a;else for(;++o<i;)t(r=e.call(n,n[o],o))?u+=r:--a;return a?u/a:void 0},Zo.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},Zo.median=function(e,r){return arguments.length>1&&(e=e.map(r)),e=e.filter(t),e.length?Zo.quantile(e.sort(n),.5):void 0};var ra=e(n);Zo.bisectLeft=ra.left,Zo.bisect=Zo.bisectRight=ra.right,Zo.bisector=function(t){return e(1===t.length?function(e,r){return n(t(e),r)}:t)},Zo.shuffle=function(n){for(var t,e,r=n.length;r;)e=0|Math.random()*r--,t=n[r],n[r]=n[e],n[e]=t;return n},Zo.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},Zo.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},Zo.zip=function(){if(!(u=arguments.length))return[];for(var n=-1,t=Zo.min(arguments,r),e=new Array(t);++n<t;)for(var u,i=-1,o=e[n]=new Array(u);++i<u;)o[i]=arguments[i][n];return e},Zo.transpose=function(n){return Zo.zip.apply(Zo,n)},Zo.keys=function(n){var t=[];for(var e in n)t.push(e);return t},Zo.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},Zo.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},Zo.merge=function(n){for(var t,e,r,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(e=new Array(o);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var ua=Math.abs;Zo.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),1/0===(t-n)/e)throw new Error("infinite range");var r,i=[],o=u(ua(e)),a=-1;if(n*=o,t*=o,e*=o,0>e)for(;(r=n+e*++a)>t;)i.push(r/o);else for(;(r=n+e*++a)<t;)i.push(r/o);return i},Zo.map=function(n){var t=new o;if(n instanceof o)n.forEach(function(n,e){t.set(n,e)});else for(var e in n)t.set(e,n[e]);return t},i(o,{has:a,get:function(n){return this[ia+n]},set:function(n,t){return this[ia+n]=t},remove:c,keys:s,values:function(){var n=[];return this.forEach(function(t,e){n.push(e)}),n},entries:function(){var n=[];return this.forEach(function(t,e){n.push({key:t,value:e})}),n},size:l,empty:f,forEach:function(n){for(var t in this)t.charCodeAt(0)===oa&&n.call(this,t.substring(1),this[t])}});var ia="\x00",oa=ia.charCodeAt(0);Zo.nest=function(){function n(t,a,c){if(c>=i.length)return r?r.call(u,a):e?a.sort(e):a;for(var s,l,f,h,g=-1,p=a.length,v=i[c++],d=new o;++g<p;)(h=d.get(s=v(l=a[g])))?h.push(l):d.set(s,[l]);return t?(l=t(),f=function(e,r){l.set(e,n(t,r,c))}):(l={},f=function(e,r){l[e]=n(t,r,c)}),d.forEach(f),l}function t(n,e){if(e>=i.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],a=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(Zo.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return a[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},Zo.set=function(n){var t=new h;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},i(h,{has:a,add:function(n){return this[ia+n]=!0,n},remove:function(n){return n=ia+n,n in this&&delete this[n]},values:s,size:l,empty:f,forEach:function(n){for(var t in this)t.charCodeAt(0)===oa&&n.call(this,t.substring(1))}}),Zo.behavior={},Zo.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=g(n,t,t[e]);return n};var aa=["webkit","ms","moz","Moz","o","O"];Zo.dispatch=function(){for(var n=new d,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=m(n);return n},d.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.substring(e+1),n=n.substring(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},Zo.event=null,Zo.requote=function(n){return n.replace(ca,"\\$&")};var ca=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,sa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},la=function(n,t){return t.querySelector(n)},fa=function(n,t){return t.querySelectorAll(n)},ha=Bo.matches||Bo[p(Bo,"matchesSelector")],ga=function(n,t){return ha.call(n,t)};"function"==typeof Sizzle&&(la=function(n,t){return Sizzle(n,t)[0]||null},fa=Sizzle,ga=Sizzle.matchesSelector),Zo.selection=function(){return ma};var pa=Zo.selection.prototype=[];pa.select=function(n){var t,e,r,u,i=[];n=b(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,s=r.length;++c<s;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return _(i)},pa.selectAll=function(n){var t,e,r=[];n=w(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=Xo(n.call(e,e.__data__,a,u))),t.parentNode=e);return _(r)};var va={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};Zo.ns={prefix:va,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.substring(0,t),n=n.substring(t+1)),va.hasOwnProperty(e)?{space:va[e],local:n}:n}},pa.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=Zo.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(S(t,n[t]));return this}return this.each(S(n,t))},pa.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=A(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!E(n[u]).test(t))return!1;return!0}for(t in n)this.each(C(t,n[t]));return this}return this.each(C(n,t))},pa.style=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t="");for(e in n)this.each(z(e,n[e],t));return this}if(2>r)return Wo.getComputedStyle(this.node(),null).getPropertyValue(n);e=""}return this.each(z(n,t,e))},pa.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(L(t,n[t]));return this}return this.each(L(n,t))},pa.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},pa.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},pa.append=function(n){return n=T(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},pa.insert=function(n,t){return n=T(n),t=b(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},pa.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})},pa.data=function(n,t){function e(n,e){var r,u,i,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),v=new Array(a);if(t){var d,m=new o,y=new o,x=[];for(r=-1;++r<a;)d=t.call(u=n[r],u.__data__,r),m.has(d)?v[r]=u:m.set(d,u),x.push(d);for(r=-1;++r<f;)d=t.call(e,i=e[r],r),(u=m.get(d))?(g[r]=u,u.__data__=i):y.has(d)||(p[r]=q(i)),y.set(d,i),m.remove(d);for(r=-1;++r<a;)m.has(x[r])&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=q(i);for(;f>r;++r)p[r]=q(e[r]);for(;a>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,c.push(p),s.push(g),l.push(v)}var r,u,i=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++i<a;)(u=r[i])&&(n[i]=u.__data__);return n}var c=U([]),s=_([]),l=_([]);if("function"==typeof n)for(;++i<a;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<a;)e(r=this[i],n);return s.enter=function(){return c},s.exit=function(){return l},s},pa.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},pa.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=R(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return _(u)},pa.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},pa.sort=function(n){n=D.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},pa.each=function(n){return P(this,function(t,e,r){n.call(t,t.__data__,e,r)})},pa.call=function(n){var t=Xo(arguments);return n.apply(t[0]=this,t),this},pa.empty=function(){return!this.node()},pa.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},pa.size=function(){var n=0;return this.each(function(){++n}),n};var da=[];Zo.selection.enter=U,Zo.selection.enter.prototype=da,da.append=pa.append,da.empty=pa.empty,da.node=pa.node,da.call=pa.call,da.size=pa.size,da.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var s=-1,l=u.length;++s<l;)(i=u[s])?(t.push(r[s]=e=n.call(u.parentNode,i.__data__,s,a)),e.__data__=i.__data__):t.push(null)}return _(o)},da.insert=function(n,t){return arguments.length<2&&(t=j(this)),pa.insert.call(this,n,t)},pa.transition=function(){for(var n,t,e=Ss||++Ns,r=[],u=ks||{time:Date.now(),ease:xu,delay:0,duration:250},i=-1,o=this.length;++i<o;){r.push(n=[]);for(var a=this[i],c=-1,s=a.length;++c<s;)(t=a[c])&&Po(t,c,e,u),n.push(t)}return qo(r,e)},pa.interrupt=function(){return this.each(H)},Zo.select=function(n){var t=["string"==typeof n?la(n,$o):n];return t.parentNode=Bo,_([t])},Zo.selectAll=function(n){var t=Xo("string"==typeof n?fa(n,$o):n);return t.parentNode=Bo,_([t])};var ma=Zo.select(Bo);pa.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(F(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(F(n,t,e))};var ya=Zo.map({mouseenter:"mouseover",mouseleave:"mouseout"});ya.forEach(function(n){"on"+n in $o&&ya.remove(n)});var xa="onselectstart"in $o?null:p(Bo.style,"userSelect"),Ma=0;Zo.mouse=function(n){return Z(n,x())};var _a=/WebKit/.test(Wo.navigator.userAgent)?-1:0;Zo.touches=function(n,t){return arguments.length<2&&(t=x().touches),t?Xo(t).map(function(t){var e=Z(n,t);return e.identifier=t.identifier,e}):[]},Zo.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",i)}function t(n,t,u,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-x[0],e=r[1]-x[1],p|=n|e,x=r,g({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&Zo.event.target===f),g({type:"dragend"}))}var s,l=this,f=Zo.event.target,h=l.parentNode,g=e.of(l,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=Zo.select(u()).on(i+d,a).on(o+d,c),y=I(),x=t(h,v);r?(s=r.apply(l,arguments),s=[s.x-x[0],s.y-x[1]]):s=[0,0],g({type:"dragstart"})}}var e=M(n,"drag","dragstart","dragend"),r=null,u=t(v,Zo.mouse,$,"mousemove","mouseup"),i=t(V,Zo.touch,X,"touchmove","touchend");return n.origin=function(t){return arguments.length?(r=t,n):r},Zo.rebind(n,e,"on")};var ba=Math.PI,wa=2*ba,Sa=ba/2,ka=1e-6,Ea=ka*ka,Aa=ba/180,Ca=180/ba,Na=Math.SQRT2,za=2,La=4;Zo.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=Q(v),o=i/(za*h)*(e*nt(Na*t+v)-K(v));return[r+o*s,u+o*l,i*e/Q(Na*t+v)]}return[r+n*s,u+n*l,i*Math.exp(Na*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],s=o-r,l=a-u,f=s*s+l*l,h=Math.sqrt(f),g=(c*c-i*i+La*f)/(2*i*za*h),p=(c*c-i*i-La*f)/(2*c*za*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Na;return e.duration=1e3*y,e},Zo.behavior.zoom=function(){function n(n){n.on(A,s).on(Ra+".zoom",f).on("dblclick.zoom",h).on(z,l)}function t(n){return[(n[0]-S.x)/S.k,(n[1]-S.y)/S.k]}function e(n){return[n[0]*S.k+S.x,n[1]*S.k+S.y]}function r(n){S.k=Math.max(E[0],Math.min(E[1],n))}function u(n,t){t=e(t),S.x+=n[0]-t[0],S.y+=n[1]-t[1]}function i(){_&&_.domain(x.range().map(function(n){return(n-S.x)/S.k}).map(x.invert)),w&&w.domain(b.range().map(function(n){return(n-S.y)/S.k}).map(b.invert))}function o(n){n({type:"zoomstart"})}function a(n){i(),n({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function c(n){n({type:"zoomend"})}function s(){function n(){l=1,u(Zo.mouse(r),h),a(s)}function e(){f.on(C,null).on(N,null),g(l&&Zo.event.target===i),c(s)}var r=this,i=Zo.event.target,s=L.of(r,arguments),l=0,f=Zo.select(Wo).on(C,n).on(N,e),h=t(Zo.mouse(r)),g=I();H.call(r),o(s)}function l(){function n(){var n=Zo.touches(g);return h=S.k,n.forEach(function(n){n.identifier in v&&(v[n.identifier]=t(n))}),n}function e(){var t=Zo.event.target;Zo.select(t).on(M,i).on(_,f),b.push(t);for(var e=Zo.event.changedTouches,o=0,c=e.length;c>o;++o)v[e[o].identifier]=null;var s=n(),l=Date.now();if(1===s.length){if(500>l-m){var h=s[0],g=v[h.identifier];r(2*S.k),u(h,g),y(),a(p)}m=l}else if(s.length>1){var h=s[0],x=s[1],w=h[0]-x[0],k=h[1]-x[1];d=w*w+k*k}}function i(){for(var n,t,e,i,o=Zo.touches(g),c=0,s=o.length;s>c;++c,i=null)if(e=o[c],i=v[e.identifier]){if(t)break;n=e,t=i}if(i){var l=(l=e[0]-n[0])*l+(l=e[1]-n[1])*l,f=d&&Math.sqrt(l/d);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],r(f*h)}m=null,u(n,t),a(p)}function f(){if(Zo.event.touches.length){for(var t=Zo.event.changedTouches,e=0,r=t.length;r>e;++e)delete v[t[e].identifier];for(var u in v)return void n()}Zo.selectAll(b).on(x,null),w.on(A,s).on(z,l),k(),c(p)}var h,g=this,p=L.of(g,arguments),v={},d=0,x=".zoom-"+Zo.event.changedTouches[0].identifier,M="touchmove"+x,_="touchend"+x,b=[],w=Zo.select(g).on(A,null).on(z,e),k=I();H.call(g),e(),o(p)}function f(){var n=L.of(this,arguments);d?clearTimeout(d):(g=t(p=v||Zo.mouse(this)),H.call(this),o(n)),d=setTimeout(function(){d=null,c(n)},50),y(),r(Math.pow(2,.002*Ta())*S.k),u(p,g),a(n)}function h(){var n=L.of(this,arguments),e=Zo.mouse(this),i=t(e),s=Math.log(S.k)/Math.LN2;o(n),r(Math.pow(2,Zo.event.shiftKey?Math.ceil(s)-1:Math.floor(s)+1)),u(e,i),a(n),c(n)}var g,p,v,d,m,x,_,b,w,S={x:0,y:0,k:1},k=[960,500],E=qa,A="mousedown.zoom",C="mousemove.zoom",N="mouseup.zoom",z="touchstart.zoom",L=M(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=L.of(this,arguments),t=S;Ss?Zo.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},o(n)}).tween("zoom:zoom",function(){var e=k[0],r=k[1],u=e/2,i=r/2,o=Zo.interpolateZoom([(u-S.x)/S.k,(i-S.y)/S.k,e/S.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),c=e/r[2];this.__chart__=S={x:u-r[0]*c,y:i-r[1]*c,k:c},a(n)}}).each("end.zoom",function(){c(n)}):(this.__chart__=S,o(n),a(n),c(n))})},n.translate=function(t){return arguments.length?(S={x:+t[0],y:+t[1],k:S.k},i(),n):[S.x,S.y]},n.scale=function(t){return arguments.length?(S={x:S.x,y:S.y,k:+t},i(),n):S.k},n.scaleExtent=function(t){return arguments.length?(E=null==t?qa:[+t[0],+t[1]],n):E},n.center=function(t){return arguments.length?(v=t&&[+t[0],+t[1]],n):v},n.size=function(t){return arguments.length?(k=t&&[+t[0],+t[1]],n):k},n.x=function(t){return arguments.length?(_=t,x=t.copy(),S={x:0,y:0,k:1},n):_},n.y=function(t){return arguments.length?(w=t,b=t.copy(),S={x:0,y:0,k:1},n):w},Zo.rebind(n,L,"on")};var Ta,qa=[0,1/0],Ra="onwheel"in $o?(Ta=function(){return-Zo.event.deltaY*(Zo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in $o?(Ta=function(){return Zo.event.wheelDelta},"mousewheel"):(Ta=function(){return-Zo.event.detail},"MozMousePixelScroll");Zo.color=et,et.prototype.toString=function(){return this.rgb()+""},Zo.hsl=rt;var Da=rt.prototype=new et;Da.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new rt(this.h,this.s,this.l/n)},Da.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new rt(this.h,this.s,n*this.l)},Da.rgb=function(){return ut(this.h,this.s,this.l)},Zo.hcl=it;var Pa=it.prototype=new et;Pa.brighter=function(n){return new it(this.h,this.c,Math.min(100,this.l+Ua*(arguments.length?n:1)))},Pa.darker=function(n){return new it(this.h,this.c,Math.max(0,this.l-Ua*(arguments.length?n:1)))},Pa.rgb=function(){return ot(this.h,this.c,this.l).rgb()},Zo.lab=at;var Ua=18,ja=.95047,Ha=1,Fa=1.08883,Oa=at.prototype=new et;Oa.brighter=function(n){return new at(Math.min(100,this.l+Ua*(arguments.length?n:1)),this.a,this.b)},Oa.darker=function(n){return new at(Math.max(0,this.l-Ua*(arguments.length?n:1)),this.a,this.b)},Oa.rgb=function(){return ct(this.l,this.a,this.b)},Zo.rgb=gt;var Ya=gt.prototype=new et;Ya.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new gt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new gt(u,u,u)},Ya.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new gt(n*this.r,n*this.g,n*this.b)},Ya.hsl=function(){return yt(this.r,this.g,this.b)},Ya.toString=function(){return"#"+dt(this.r)+dt(this.g)+dt(this.b)};var Ia=Zo.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ia.forEach(function(n,t){Ia.set(n,pt(t))}),Zo.functor=bt,Zo.xhr=St(wt),Zo.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=kt(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(l>=s)return o;if(u)return u=!1,i;var t=l;if(34===n.charCodeAt(t)){for(var e=t;e++<s;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}l=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++l):10===r&&(u=!0),n.substring(t+1,e).replace(/""/g,'"')}for(;s>l;){var r=n.charCodeAt(l++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(l)&&(++l,++a);else if(r!==c)continue;return n.substring(t,l-a)}return n.substring(t)}for(var r,u,i={},o={},a=[],s=n.length,l=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();(!t||(h=t(h,f++)))&&a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new h,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},Zo.csv=Zo.dsv(",","text/csv"),Zo.tsv=Zo.dsv(" ","text/tab-separated-values"),Zo.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=x().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return Z(n,r)};var Za,Va,Xa,$a,Ba,Wa=Wo[p(Wo,"requestAnimationFrame")]||function(n){setTimeout(n,17)};Zo.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};Va?Va.n=i:Za=i,Va=i,Xa||($a=clearTimeout($a),Xa=1,Wa(At))},Zo.timer.flush=function(){Ct(),Nt()},Zo.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var Ja=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Lt);Zo.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=Zo.round(n,zt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),Ja[8+e/3]};var Ga=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ka=Zo.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=Zo.round(n,zt(n,t))).toFixed(Math.max(0,Math.min(20,zt(n*(1+1e-15),t))))}}),Qa=Zo.time={},nc=Date;Rt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){tc.setUTCDate.apply(this._,arguments)},setDay:function(){tc.setUTCDay.apply(this._,arguments)},setFullYear:function(){tc.setUTCFullYear.apply(this._,arguments)},setHours:function(){tc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){tc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){tc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){tc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){tc.setUTCSeconds.apply(this._,arguments)},setTime:function(){tc.setTime.apply(this._,arguments)}};var tc=Date.prototype;Qa.year=Dt(function(n){return n=Qa.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),Qa.years=Qa.year.range,Qa.years.utc=Qa.year.utc.range,Qa.day=Dt(function(n){var t=new nc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),Qa.days=Qa.day.range,Qa.days.utc=Qa.day.utc.range,Qa.dayOfYear=function(n){var t=Qa.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=Qa[n]=Dt(function(n){return(n=Qa.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=Qa.year(n).getDay();return Math.floor((Qa.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});Qa[n+"s"]=e.range,Qa[n+"s"].utc=e.utc.range,Qa[n+"OfYear"]=function(n){var e=Qa.year(n).getDay();return Math.floor((Qa.dayOfYear(n)+(e+t)%7)/7)}}),Qa.week=Qa.sunday,Qa.weeks=Qa.sunday.range,Qa.weeks.utc=Qa.sunday.utc.range,Qa.weekOfYear=Qa.sundayOfYear;var ec={"-":"",_:" ",0:"0"},rc=/^\s*\d+/,uc=/^%/;Zo.locale=function(n){return{numberFormat:Tt(n),timeFormat:Ut(n)}};var ic=Zo.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Zo.format=ic.numberFormat,Zo.geo={},ue.prototype={s:0,t:0,add:function(n){ie(n,this.t,oc),ie(oc.s,this.s,this),this.s?this.t+=oc.t:this.s=oc.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var oc=new ue;Zo.geo.stream=function(n,t){n&&ac.hasOwnProperty(n.type)?ac[n.type](n,t):oe(n,t)};var ac={Feature:function(n,t){oe(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)oe(e[r].geometry,t)}},cc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){ae(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)ae(e[r],t,0)},Polygon:function(n,t){ce(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)ce(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)oe(e[r],t)}};Zo.geo.area=function(n){return sc=0,Zo.geo.stream(n,fc),sc};var sc,lc=new ue,fc={sphere:function(){sc+=4*ba},point:v,lineStart:v,lineEnd:v,polygonStart:function(){lc.reset(),fc.lineStart=se},polygonEnd:function(){var n=2*lc;sc+=0>n?4*ba+n:n,fc.lineStart=fc.lineEnd=fc.point=v}};Zo.geo.bounds=function(){function n(n,t){x.push(M=[l=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=le([t*Aa,e*Aa]);if(m){var u=he(m,r),i=[u[1],-u[0],0],o=he(i,u);ve(o),o=de(o);var c=t-p,s=c>0?1:-1,v=o[0]*Ca*s,d=ua(c)>180;if(d^(v>s*p&&s*t>v)){var y=o[1]*Ca;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>s*p&&s*t>v)){var y=-o[1]*Ca;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t):h>=l?(l>t&&(l=t),t>h&&(h=t)):t>p?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t)}else n(t,e);m=r,p=t}function e(){_.point=t}function r(){M[0]=l,M[1]=h,_.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ua(r)>180?r+(r>0?360:-360):r}else v=n,d=e;fc.point(n,e),t(n,e)}function i(){fc.lineStart()}function o(){u(v,d),fc.lineEnd(),ua(y)>ka&&(l=-(h=180)),M[0]=l,M[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function s(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var l,f,h,g,p,v,d,m,y,x,M,_={point:n,lineStart:e,lineEnd:r,polygonStart:function(){_.point=u,_.lineStart=i,_.lineEnd=o,y=0,fc.polygonStart()},polygonEnd:function(){fc.polygonEnd(),_.point=n,_.lineStart=e,_.lineEnd=r,0>lc?(l=-(h=180),f=-(g=90)):y>ka?g=90:-ka>y&&(f=-90),M[0]=l,M[1]=h}};return function(n){g=h=-(l=f=1/0),x=[],Zo.geo.stream(n,_);var t=x.length;if(t){x.sort(c);for(var e,r=1,u=x[0],i=[u];t>r;++r)e=x[r],s(e[0],u)||s(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e); for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,l=e[0],h=u[1])}return x=M=null,1/0===l||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[l,f],[h,g]]}}(),Zo.geo.centroid=function(n){hc=gc=pc=vc=dc=mc=yc=xc=Mc=_c=bc=0,Zo.geo.stream(n,wc);var t=Mc,e=_c,r=bc,u=t*t+e*e+r*r;return Ea>u&&(t=mc,e=yc,r=xc,ka>gc&&(t=pc,e=vc,r=dc),u=t*t+e*e+r*r,Ea>u)?[0/0,0/0]:[Math.atan2(e,t)*Ca,G(r/Math.sqrt(u))*Ca]};var hc,gc,pc,vc,dc,mc,yc,xc,Mc,_c,bc,wc={sphere:v,point:ye,lineStart:Me,lineEnd:_e,polygonStart:function(){wc.lineStart=be},polygonEnd:function(){wc.lineStart=Me}},Sc=Ae(we,Te,Re,[-ba,-ba/2]),kc=1e9;Zo.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ue(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(Zo.geo.conicEqualArea=function(){return He(Fe)}).raw=Fe,Zo.geo.albers=function(){return Zo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Zo.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=Zo.geo.albers(),o=Zo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=Zo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var s=i.scale(),l=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[l-.455*s,f-.238*s],[l+.455*s,f+.238*s]]).stream(c).point,r=o.translate([l-.307*s,f+.201*s]).clipExtent([[l-.425*s+ka,f+.12*s+ka],[l-.214*s-ka,f+.234*s-ka]]).stream(c).point,u=a.translate([l-.205*s,f+.212*s]).clipExtent([[l-.214*s+ka,f+.166*s+ka],[l-.115*s-ka,f+.234*s-ka]]).stream(c).point,n},n.scale(1070)};var Ec,Ac,Cc,Nc,zc,Lc,Tc={point:v,lineStart:v,lineEnd:v,polygonStart:function(){Ac=0,Tc.lineStart=Oe},polygonEnd:function(){Tc.lineStart=Tc.lineEnd=Tc.point=v,Ec+=ua(Ac/2)}},qc={point:Ye,lineStart:v,lineEnd:v,polygonStart:v,polygonEnd:v},Rc={point:Ve,lineStart:Xe,lineEnd:$e,polygonStart:function(){Rc.lineStart=Be},polygonEnd:function(){Rc.point=Ve,Rc.lineStart=Xe,Rc.lineEnd=$e}};Zo.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),Zo.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Ec=0,Zo.geo.stream(n,u(Tc)),Ec},n.centroid=function(n){return pc=vc=dc=mc=yc=xc=Mc=_c=bc=0,Zo.geo.stream(n,u(Rc)),bc?[Mc/bc,_c/bc]:xc?[mc/xc,yc/xc]:dc?[pc/dc,vc/dc]:[0/0,0/0]},n.bounds=function(n){return zc=Lc=-(Cc=Nc=1/0),Zo.geo.stream(n,u(qc)),[[Cc,Nc],[zc,Lc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||Ge(n):wt,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Ie:new We(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(Zo.geo.albersUsa()).context(null)},Zo.geo.transform=function(n){return{stream:function(t){var e=new Ke(t);for(var r in n)e[r]=n[r];return e}}},Ke.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Zo.geo.projection=nr,Zo.geo.projectionMutator=tr,(Zo.geo.equirectangular=function(){return nr(rr)}).raw=rr.invert=rr,Zo.geo.rotation=function(n){function t(t){return t=n(t[0]*Aa,t[1]*Aa),t[0]*=Ca,t[1]*=Ca,t}return n=ir(n[0]%360*Aa,n[1]*Aa,n.length>2?n[2]*Aa:0),t.invert=function(t){return t=n.invert(t[0]*Aa,t[1]*Aa),t[0]*=Ca,t[1]*=Ca,t},t},ur.invert=rr,Zo.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=ir(-n[0]*Aa,-n[1]*Aa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ca,n[1]*=Ca}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=sr((t=+r)*Aa,u*Aa),n):t},n.precision=function(r){return arguments.length?(e=sr(t*Aa,(u=+r)*Aa),n):u},n.angle(90)},Zo.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Aa,u=n[1]*Aa,i=t[1]*Aa,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),s=Math.cos(u),l=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=s*l-c*f*a)*e),c*l+s*f*a)},Zo.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return Zo.range(Math.ceil(i/d)*d,u,d).map(h).concat(Zo.range(Math.ceil(s/m)*m,c,m).map(g)).concat(Zo.range(Math.ceil(r/p)*p,e,p).filter(function(n){return ua(n%d)>ka}).map(l)).concat(Zo.range(Math.ceil(a/v)*v,o,v).filter(function(n){return ua(n%m)>ka}).map(f))}var e,r,u,i,o,a,c,s,l,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(s).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],s=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),s>c&&(t=s,s=c,c=t),n.precision(y)):[[i,s],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,l=fr(a,o,90),f=hr(r,e,y),h=fr(s,c,90),g=hr(i,u,y),n):y},n.majorExtent([[-180,-90+ka],[180,90-ka]]).minorExtent([[-180,-80-ka],[180,80+ka]])},Zo.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=gr,u=pr;return n.distance=function(){return Zo.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},Zo.geo.interpolate=function(n,t){return vr(n[0]*Aa,n[1]*Aa,t[0]*Aa,t[1]*Aa)},Zo.geo.length=function(n){return Dc=0,Zo.geo.stream(n,Pc),Dc};var Dc,Pc={sphere:v,point:v,lineStart:dr,lineEnd:v,polygonStart:v,polygonEnd:v},Uc=mr(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(Zo.geo.azimuthalEqualArea=function(){return nr(Uc)}).raw=Uc;var jc=mr(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},wt);(Zo.geo.azimuthalEquidistant=function(){return nr(jc)}).raw=jc,(Zo.geo.conicConformal=function(){return He(yr)}).raw=yr,(Zo.geo.conicEquidistant=function(){return He(xr)}).raw=xr;var Hc=mr(function(n){return 1/n},Math.atan);(Zo.geo.gnomonic=function(){return nr(Hc)}).raw=Hc,Mr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Sa]},(Zo.geo.mercator=function(){return _r(Mr)}).raw=Mr;var Fc=mr(function(){return 1},Math.asin);(Zo.geo.orthographic=function(){return nr(Fc)}).raw=Fc;var Oc=mr(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(Zo.geo.stereographic=function(){return nr(Oc)}).raw=Oc,br.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Sa]},(Zo.geo.transverseMercator=function(){var n=_r(br),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=br,Zo.geom={},Zo.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=bt(e),i=bt(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(Er),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var s=kr(a),l=kr(c),f=l[0]===s[0],h=l[l.length-1]===s[s.length-1],g=[];for(t=s.length-1;t>=0;--t)g.push(n[a[s[t]][2]]);for(t=+f;t<l.length-h;++t)g.push(n[a[l[t]][2]]);return g}var e=wr,r=Sr;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},Zo.geom.polygon=function(n){return sa(n,Yc),n};var Yc=Zo.geom.polygon.prototype=[];Yc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},Yc.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},Yc.clip=function(n){for(var t,e,r,u,i,o,a=Nr(n),c=-1,s=this.length-Nr(this),l=this[s-1];++c<s;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],Ar(o,l,u)?(Ar(i,l,u)||n.push(Cr(i,o,l,u)),n.push(o)):Ar(i,l,u)&&n.push(Cr(i,o,l,u)),i=o;a&&n.push(n[0]),l=u}return n};var Ic,Zc,Vc,Xc,$c,Bc=[],Wc=[];Ur.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Hr),t.length},Wr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Jr.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=nu(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(Kr(this,e),n=e,e=n.U),e.C=!1,r.C=!0,Qr(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(Qr(this,e),n=e,e=n.U),e.C=!1,r.C=!0,Kr(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,o=n.R;if(e=i?o?nu(o):i:o,u?u.L===n?u.L=e:u.R=e:this._=e,i&&o?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==o?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=o,o.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return n.C=!1,void 0;do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,Kr(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Qr(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,Kr(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,Qr(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Kr(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,Qr(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},Zo.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return tu(e(n),a).cells.forEach(function(e,a){var c=e.edges,s=e.site,l=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):s.x>=r&&s.x<=i&&s.y>=u&&s.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];l.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/ka)*ka,y:Math.round(o(n,t)/ka)*ka,i:t}})}var r=wr,u=Sr,i=r,o=u,a=Jc;return n?t(n):(t.links=function(n){return tu(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return tu(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Hr),c=-1,s=a.length,l=a[s-1].edge,f=l.l===o?l.r:l.l;++c<s;)u=l,i=f,l=a[c].edge,f=l.l===o?l.r:l.l,r<i.i&&r<f.i&&ru(o,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=bt(r=n),t):r},t.y=function(n){return arguments.length?(o=bt(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?Jc:n,t):a===Jc?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===Jc?null:a&&a[1]},t)};var Jc=[[-1e6,-1e6],[1e6,1e6]];Zo.geom.delaunay=function(n){return Zo.geom.voronoi().triangles(n)},Zo.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,l=n.y;if(null!=c)if(ua(c-e)+ua(l-r)<.01)s(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,s(n,f,c,l,u,i,o,a),s(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else s(n,t,e,r,u,i,o,a)}function s(n,t,e,r,u,o,a,c){var s=.5*(u+a),l=.5*(o+c),f=e>=s,h=r>=l,g=(h<<1)+f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=ou()),f?u=s:a=s,h?o=l:c=l,i(n,t,e,r,u,o,a,c)}var l,f,h,g,p,v,d,m,y,x=bt(a),M=bt(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)l=n[g],l.x<v&&(v=l.x),l.y<d&&(d=l.y),l.x>m&&(m=l.x),l.y>y&&(y=l.y),f.push(l.x),h.push(l.y);else for(g=0;p>g;++g){var _=+x(l=n[g],g),b=+M(l,g);v>_&&(v=_),d>b&&(d=b),_>m&&(m=_),b>y&&(y=b),f.push(_),h.push(b)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=ou();if(k.add=function(n){i(k,n,+x(n,++g),+M(n,g),v,d,m,y)},k.visit=function(n){au(n,k,v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=l=null,k}var o,a=wr,c=Sr;return(o=arguments.length)?(a=uu,c=iu,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},Zo.interpolateRgb=cu,Zo.interpolateObject=su,Zo.interpolateNumber=lu,Zo.interpolateString=fu;var Gc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kc=new RegExp(Gc.source,"g");Zo.interpolate=hu,Zo.interpolators=[function(n,t){var e=typeof t;return("string"===e?Ia.has(t)||/^(#|rgb\(|hsl\()/.test(t)?cu:fu:t instanceof et?cu:Array.isArray(t)?gu:"object"===e&&isNaN(t)?su:lu)(n,t)}],Zo.interpolateArray=gu;var Qc=function(){return wt},ns=Zo.map({linear:Qc,poly:Mu,quad:function(){return mu},cubic:function(){return yu},sin:function(){return _u},exp:function(){return bu},circle:function(){return wu},elastic:Su,back:ku,bounce:function(){return Eu}}),ts=Zo.map({"in":wt,out:vu,"in-out":du,"out-in":function(n){return du(vu(n))}});Zo.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return e=ns.get(e)||Qc,r=ts.get(r)||wt,pu(r(e.apply(null,Vo.call(arguments,1))))},Zo.interpolateHcl=Au,Zo.interpolateHsl=Cu,Zo.interpolateLab=Nu,Zo.interpolateRound=zu,Zo.transform=function(n){var t=$o.createElementNS(Zo.ns.prefix.svg,"g");return(Zo.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Lu(e?e.matrix:es)})(n)},Lu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var es={a:1,b:0,c:0,d:1,e:0,f:0};Zo.interpolateTransform=Du,Zo.layout={},Zo.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(ju(n[e]));return t}},Zo.layout.chord=function(){function n(){var n,s,f,h,g,p={},v=[],d=Zo.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(s=0,g=-1;++g<i;)s+=u[h][g];v.push(s),m.push(Zo.range(i)),n+=s}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(wa-l*i)/n,s=0,h=-1;++h<i;){for(f=s,g=-1;++g<i;){var y=d[h],x=m[y][g],M=u[y][x],_=s,b=s+=M*n;p[y+"-"+x]={index:y,subindex:x,startAngle:_,endAngle:b,value:M}}r[y]={index:y,startAngle:f,endAngle:s,value:(s-f)/n},s+=l}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,s={},l=0;return s.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,s):u},s.padding=function(n){return arguments.length?(l=n,e=r=null,s):l},s.sortGroups=function(n){return arguments.length?(o=n,e=r=null,s):o},s.sortSubgroups=function(n){return arguments.length?(a=n,e=null,s):a},s.sortChords=function(n){return arguments.length?(c=n,e&&t(),s):c},s.chords=function(){return e||n(),e},s.groups=function(){return r||n(),r},s},Zo.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-e,c=i*i+o*o;if(c>a*a/d){if(p>c){var s=t.charge/c;n.px-=i*s,n.py-=o*s}return!0}if(t.point&&c&&p>c){var s=t.pointCharge/c;n.px-=i*s,n.py-=o*s}}return!t.charge}}function t(n){n.px=Zo.event.x,n.py=Zo.event.y,a.resume()}var e,r,u,i,o,a={},c=Zo.dispatch("start","tick","end"),s=[1,1],l=.9,f=rs,h=us,g=-30,p=is,v=.1,d=.64,m=[],y=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,x,M,_=m.length,b=y.length;for(e=0;b>e;++e)a=y[e],f=a.source,h=a.target,x=h.x-f.x,M=h.y-f.y,(p=x*x+M*M)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,x*=p,M*=p,h.x-=x*(d=f.weight/(h.weight+f.weight)),h.y-=M*d,f.x+=x*(d=1-d),f.y+=M*d);if((d=r*v)&&(x=s[0]/2,M=s[1]/2,e=-1,d))for(;++e<_;)a=m[e],a.x+=(x-a.x)*d,a.y+=(M-a.y)*d;if(g)for(Vu(t=Zo.geom.quadtree(m),r,o),e=-1;++e<_;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<_;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*l,a.y-=(a.py-(a.py=a.y))*l);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(y=n,a):y},a.size=function(n){return arguments.length?(s=n,a):s},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(l=+n,a):l},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),Zo.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;s>a;++a){var u=y[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,s=o.length;++a<s;)if(!isNaN(i=o[a][n]))return i;return Math.random()*r}var t,e,r,c=m.length,l=y.length,p=s[0],v=s[1];for(t=0;c>t;++t)(r=m[t]).index=t,r.weight=0;for(t=0;l>t;++t)r=y[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;l>t;++t)u[t]=+f.call(this,y[t],t);else for(t=0;l>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;l>t;++t)i[t]=+h.call(this,y[t],t);else for(t=0;l>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=Zo.behavior.drag().origin(wt).on("dragstart.force",Ou).on("drag.force",t).on("dragend.force",Yu)),arguments.length?(this.on("mouseover.force",Iu).on("mouseout.force",Zu).call(e),void 0):e},Zo.rebind(a,c,"on")};var rs=20,us=1,is=1/0;Zo.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(s=e.call(n,i,i.depth))&&(c=s.length)){for(var c,s,l;--c>=0;)o.push(l=s[c]),l.parent=i,l.depth=i.depth+1;r&&(i.value=0),i.children=s}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Bu(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=Gu,e=Wu,r=Ju;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&($u(t,function(n){n.children&&(n.value=0)}),Bu(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},Zo.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,s=-1;for(r=t.value?r/t.value:0;++s<o;)n(a=i[s],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=Zo.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},Xu(e,r)},Zo.layout.pie=function(){function n(i){var o=i.map(function(e,r){return+t.call(n,e,r)}),a=+("function"==typeof r?r.apply(this,arguments):r),c=(("function"==typeof u?u.apply(this,arguments):u)-a)/Zo.sum(o),s=Zo.range(i.length);null!=e&&s.sort(e===os?function(n,t){return o[t]-o[n]}:function(n,t){return e(i[n],i[t])});var l=[];return s.forEach(function(n){var t;l[n]={data:i[n],value:t=o[n],startAngle:a,endAngle:a+=t*c}}),l}var t=Number,e=os,r=0,u=wa;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n};var os={};Zo.layout.stack=function(){function n(a,c){var s=a.map(function(e,r){return t.call(n,e,r)}),l=s.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,l,c);s=Zo.permute(s,f),l=Zo.permute(l,f);var h,g,p,v=r.call(n,l,c),d=s.length,m=s[0].length;for(g=0;m>g;++g)for(u.call(n,s[0][g],p=v[g],l[0][g][1]),h=1;d>h;++h)u.call(n,s[h][g],p+=l[h-1][g][1],l[h][g][1]);return a}var t=wt,e=ei,r=ri,u=ti,i=Qu,o=ni;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:as.get(t)||ei,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:cs.get(t)||ri,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var as=Zo.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(ui),i=n.map(ii),o=Zo.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,s=[],l=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],s.push(e)):(c+=i[e],l.push(e));return l.reverse().concat(s)},reverse:function(n){return Zo.range(n.length).reverse()},"default":ei}),cs=Zo.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,s,l=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=s=0,e=1;h>e;++e){for(t=0,u=0;l>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];l>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,s>c&&(s=c)}for(e=0;h>e;++e)g[e]-=s;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:ri});Zo.layout.histogram=function(){function n(n,i){for(var o,a,c=[],s=n.map(e,this),l=r.call(this,s,i),f=u.call(this,l,s,i),i=-1,h=s.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=s[i],a>=l[0]&&a<=l[1]&&(o=c[Zo.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=si,u=ai;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=bt(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return ci(n,t)}:bt(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},Zo.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],s=u[1],l=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Bu(a,function(n){n.r=+l(n.value)}),Bu(a,pi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/s))/2;Bu(a,function(n){n.r+=f}),Bu(a,pi),Bu(a,function(n){n.r-=f})}return mi(a,c/2,s/2,t?1:1/Math.max(2*a.r/c,2*a.r/s)),o}var t,e=Zo.layout.hierarchy().sort(li),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Xu(n,e)},Zo.layout.tree=function(){function n(n,u){var l=o.call(this,n,u),f=l[0],h=t(f);if(Bu(h,e),h.parent.m=-h.z,$u(h,r),s)$u(f,i);else{var g=f,p=f,v=f;$u(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);$u(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return l}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){wi(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],s=u.m,l=i.m,f=o.m,h=c.m;o=_i(o),u=Mi(u),o&&u;)c=Mi(c),i=_i(i),i.a=n,r=o.z+f-u.z-s+a(o._,u._),r>0&&(bi(Si(o,n,e),n,r),s+=r,l+=r),f+=o.m,s+=u.m,h+=c.m,l+=i.m;o&&!_i(i)&&(i.t=o,i.m+=f-l),u&&!Mi(c)&&(c.t=u,c.m+=s-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=Zo.layout.hierarchy().sort(null).value(null),a=xi,c=[1,1],s=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(s=null==(c=t)?i:null,n):s?null:c},n.nodeSize=function(t){return arguments.length?(s=null==(c=t)?null:i,n):s?c:null},Xu(n,o)},Zo.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],s=0;Bu(c,function(n){var t=n.children;t&&t.length?(n.x=Ei(t),n.y=ki(t)):(n.x=o?s+=e(n,o):0,n.y=0,o=n)});var l=Ai(c),f=Ci(c),h=l.x-e(l,f)/2,g=f.x+e(f,l)/2;return Bu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=Zo.layout.hierarchy().sort(null).value(null),e=xi,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Xu(n,t)},Zo.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,s=f(e),l=[],h=i.slice(),p=1/0,v="slice"===g?s.dx:"dice"===g?s.dy:"slice-dice"===g?1&e.depth?s.dy:s.dx:Math.min(s.dx,s.dy);for(n(h,s.dx*s.dy/e.value),l.area=0;(c=h.length)>0;)l.push(o=h[c-1]),l.area+=o.area,"squarify"!==g||(a=r(l,v))<=p?(h.pop(),p=a):(l.area-=l.pop().area,u(l,v,s,!1),v=Math.min(s.dx,s.dy),l.length=l.area=0,p=1/0);l.length&&(u(l,v,s,!0),l.length=l.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,s=e.y,l=t?c(n.area/t):0;if(t==e.dx){for((r||l>e.dy)&&(l=e.dy);++i<o;)u=n[i],u.x=a,u.y=s,u.dy=l,a+=u.dx=Math.min(e.x+e.dx-a,l?c(u.area/l):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=l,e.dy-=l}else{for((r||l>e.dx)&&(l=e.dx);++i<o;)u=n[i],u.x=a,u.y=s,u.dx=l,s+=u.dy=Math.min(e.y+e.dy-s,l?c(u.area/l):0);u.z=!1,u.dy+=e.y+e.dy-s,e.x+=l,e.dx-=l}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=s[0],i.dy=s[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=Zo.layout.hierarchy(),c=Math.round,s=[1,1],l=null,f=Ni,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(s=n,i):s},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Ni(t):zi(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return zi(t,n)}if(!arguments.length)return l;var r;return f=null==(l=n)?Ni:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Xu(i,a)},Zo.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=Zo.random.normal.apply(Zo,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=Zo.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},Zo.scale={};var ss={floor:wt,ceil:wt};Zo.scale.linear=function(){return Ui([0,1],[0,1],hu,!1)};var ls={s:1,g:1,p:1,r:1,e:1};Zo.scale.log=function(){return Vi(Zo.scale.linear().domain([0,1]),10,!0,[1,10])};var fs=Zo.format(".0e"),hs={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};Zo.scale.pow=function(){return Xi(Zo.scale.linear(),1,[0,1])},Zo.scale.sqrt=function(){return Zo.scale.pow().exponent(.5)},Zo.scale.ordinal=function(){return Bi([],{t:"range",a:[[]]})},Zo.scale.category10=function(){return Zo.scale.ordinal().range(gs)},Zo.scale.category20=function(){return Zo.scale.ordinal().range(ps)},Zo.scale.category20b=function(){return Zo.scale.ordinal().range(vs)},Zo.scale.category20c=function(){return Zo.scale.ordinal().range(ds)};var gs=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(vt),ps=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(vt),vs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(vt),ds=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(vt);Zo.scale.quantile=function(){return Wi([],[])},Zo.scale.quantize=function(){return Ji(0,1,[0,1])},Zo.scale.threshold=function(){return Gi([.5],[0,1])},Zo.scale.identity=function(){return Ki([0,1])},Zo.svg={},Zo.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=e.apply(this,arguments),o=r.apply(this,arguments)+ms,a=u.apply(this,arguments)+ms,c=(o>a&&(c=o,o=a,a=c),a-o),s=ba>c?"0":"1",l=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a); return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+s+",0 "+n*l+","+n*f+"Z":"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=Qi,e=no,r=to,u=eo;return n.innerRadius=function(e){return arguments.length?(t=bt(e),n):t},n.outerRadius=function(t){return arguments.length?(e=bt(t),n):e},n.startAngle=function(t){return arguments.length?(r=bt(t),n):r},n.endAngle=function(t){return arguments.length?(u=bt(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+e.apply(this,arguments))/2,i=(r.apply(this,arguments)+u.apply(this,arguments))/2+ms;return[Math.cos(i)*n,Math.sin(i)*n]},n};var ms=-Sa,ys=wa-ka;Zo.svg.line=function(){return ro(wt)};var xs=Zo.map({linear:uo,"linear-closed":io,step:oo,"step-before":ao,"step-after":co,basis:po,"basis-open":vo,"basis-closed":mo,bundle:yo,cardinal:fo,"cardinal-open":so,"cardinal-closed":lo,monotone:So});xs.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Ms=[0,2/3,1/3,0],_s=[0,1/3,2/3,0],bs=[0,1/6,2/3,1/6];Zo.svg.line.radial=function(){var n=ro(ko);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},ao.reverse=co,co.reverse=ao,Zo.svg.area=function(){return Eo(wt)},Zo.svg.area.radial=function(){var n=Eo(ko);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},Zo.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),s=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,s)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,s.r,s.p0)+r(s.r,s.p1,s.a1-s.a0)+u(s.r,s.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)+ms,l=s.call(n,u,r)+ms;return{r:i,a0:o,a1:l,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(l),i*Math.sin(l)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>ba)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=gr,o=pr,a=Ao,c=to,s=eo;return n.radius=function(t){return arguments.length?(a=bt(t),n):a},n.source=function(t){return arguments.length?(i=bt(t),n):i},n.target=function(t){return arguments.length?(o=bt(t),n):o},n.startAngle=function(t){return arguments.length?(c=bt(t),n):c},n.endAngle=function(t){return arguments.length?(s=bt(t),n):s},n},Zo.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=gr,e=pr,r=Co;return n.source=function(e){return arguments.length?(t=bt(e),n):t},n.target=function(t){return arguments.length?(e=bt(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},Zo.svg.diagonal.radial=function(){var n=Zo.svg.diagonal(),t=Co,e=n.projection;return n.projection=function(n){return arguments.length?e(No(t=n)):t},n},Zo.svg.symbol=function(){function n(n,r){return(ws.get(t.call(this,n,r))||To)(e.call(this,n,r))}var t=Lo,e=zo;return n.type=function(e){return arguments.length?(t=bt(e),n):t},n.size=function(t){return arguments.length?(e=bt(t),n):e},n};var ws=Zo.map({circle:To,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*As)),e=t*As;return"M0,"+-t+"L"+e+",0"+" 0,"+t+" "+-e+",0"+"Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Es),e=t*Es/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Es),e=t*Es/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});Zo.svg.symbolTypes=ws.keys();var Ss,ks,Es=Math.sqrt(3),As=Math.tan(30*Aa),Cs=[],Ns=0;Cs.call=pa.call,Cs.empty=pa.empty,Cs.node=pa.node,Cs.size=pa.size,Zo.transition=function(n){return arguments.length?Ss?n.transition():n:ma.transition()},Zo.transition.prototype=Cs,Cs.select=function(n){var t,e,r,u=this.id,i=[];n=b(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]);for(var c=this[o],s=-1,l=c.length;++s<l;)(r=c[s])&&(e=n.call(r,r.__data__,s,o))?("__data__"in r&&(e.__data__=r.__data__),Po(e,s,u,r.__transition__[u]),t.push(e)):t.push(null)}return qo(i,u)},Cs.selectAll=function(n){var t,e,r,u,i,o=this.id,a=[];n=w(n);for(var c=-1,s=this.length;++c<s;)for(var l=this[c],f=-1,h=l.length;++f<h;)if(r=l[f]){i=r.__transition__[o],e=n.call(r,r.__data__,f,c),a.push(t=[]);for(var g=-1,p=e.length;++g<p;)(u=e[g])&&Po(u,g,o,i),t.push(u)}return qo(a,o)},Cs.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=R(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return qo(u,this.id)},Cs.tween=function(n,t){var e=this.id;return arguments.length<2?this.node().__transition__[e].tween.get(n):P(this,null==t?function(t){t.__transition__[e].tween.remove(n)}:function(r){r.__transition__[e].tween.set(n,t)})},Cs.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Du:hu,a=Zo.ns.qualify(n);return Ro(this,"attr."+n,t,a.local?i:u)},Cs.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=Zo.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Cs.style=function(n,t,e){function r(){this.style.removeProperty(n)}function u(t){return null==t?r:(t+="",function(){var r,u=Wo.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(r=hu(u,t),function(t){this.style.setProperty(n,r(t),e)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return Ro(this,"style."+n,t,u)},Cs.styleTween=function(n,t,e){function r(r,u){var i=t.call(this,r,u,Wo.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Cs.text=function(n){return Ro(this,"text",n,Do)},Cs.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})},Cs.ease=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof n&&(n=Zo.ease.apply(Zo,arguments)),P(this,function(e){e.__transition__[t].ease=n}))},Cs.delay=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].delay:P(this,"function"==typeof n?function(e,r,u){e.__transition__[t].delay=+n.call(e,e.__data__,r,u)}:(n=+n,function(e){e.__transition__[t].delay=n}))},Cs.duration=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].duration:P(this,"function"==typeof n?function(e,r,u){e.__transition__[t].duration=Math.max(1,n.call(e,e.__data__,r,u))}:(n=Math.max(1,n),function(e){e.__transition__[t].duration=n}))},Cs.each=function(n,t){var e=this.id;if(arguments.length<2){var r=ks,u=Ss;Ss=e,P(this,function(t,r,u){ks=t.__transition__[e],n.call(t,t.__data__,r,u)}),ks=r,Ss=u}else P(this,function(r){var u=r.__transition__[e];(u.event||(u.event=Zo.dispatch("start","end"))).on(n,t)});return this},Cs.transition=function(){for(var n,t,e,r,u=this.id,i=++Ns,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],s=0,l=t.length;l>s;s++)(e=t[s])&&(r=Object.create(e.__transition__[u]),r.delay+=r.duration,Po(e,s,i,r)),n.push(e)}return qo(o,i)},Zo.svg.axis=function(){function n(n){n.each(function(){var n,s=Zo.select(this),l=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):wt:t,p=s.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",ka),d=Zo.transition(p.exit()).style("opacity",ka).remove(),m=Zo.transition(p.order()).style("opacity",1),y=Ti(f),x=s.selectAll(".domain").data([0]),M=(x.enter().append("path").attr("class","domain"),Zo.transition(x));v.append("line"),v.append("text");var _=v.select("line"),b=m.select("line"),w=p.select("text").text(g),S=v.select("text"),k=m.select("text");switch(r){case"bottom":n=Uo,_.attr("y2",u),S.attr("y",Math.max(u,0)+o),b.attr("x2",0).attr("y2",u),k.attr("x",0).attr("y",Math.max(u,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+i+"V0H"+y[1]+"V"+i);break;case"top":n=Uo,_.attr("y2",-u),S.attr("y",-(Math.max(u,0)+o)),b.attr("x2",0).attr("y2",-u),k.attr("x",0).attr("y",-(Math.max(u,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+-i+"V0H"+y[1]+"V"+-i);break;case"left":n=jo,_.attr("x2",-u),S.attr("x",-(Math.max(u,0)+o)),b.attr("x2",-u).attr("y2",0),k.attr("x",-(Math.max(u,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),M.attr("d","M"+-i+","+y[0]+"H0V"+y[1]+"H"+-i);break;case"right":n=jo,_.attr("x2",u),S.attr("x",Math.max(u,0)+o),b.attr("x2",u).attr("y2",0),k.attr("x",Math.max(u,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),M.attr("d","M"+i+","+y[0]+"H0V"+y[1]+"H"+i)}if(f.rangeBand){var E=f,A=E.rangeBand()/2;l=f=function(n){return E(n)+A}}else l.rangeBand?l=f:d.call(n,f);v.call(n,l),m.call(n,f)})}var t,e=Zo.scale.linear(),r=zs,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Ls?t+"":zs,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var zs="bottom",Ls={top:1,right:1,bottom:1,left:1};Zo.svg.brush=function(){function n(i){i.each(function(){var i=Zo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(p,wt);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Ts[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,f=Zo.transition(i),h=Zo.transition(o);c&&(l=Ti(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),e(f)),s&&(l=Ti(s),h.attr("y",l[0]).attr("height",l[1]-l[0]),r(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+l[+/e$/.test(n)]+","+f[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",l[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function r(n){n.select(".extent").attr("y",f[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function u(){function u(){32==Zo.event.keyCode&&(C||(x=null,z[0]-=l[1],z[1]-=f[1],C=2),y())}function p(){32==Zo.event.keyCode&&2==C&&(z[0]+=l[1],z[1]+=f[1],C=0,y())}function v(){var n=Zo.mouse(_),u=!1;M&&(n[0]+=M[0],n[1]+=M[1]),C||(Zo.event.altKey?(x||(x=[(l[0]+l[1])/2,(f[0]+f[1])/2]),z[0]=l[+(n[0]<x[0])],z[1]=f[+(n[1]<x[1])]):x=null),E&&d(n,c,0)&&(e(S),u=!0),A&&d(n,s,1)&&(r(S),u=!0),u&&(t(S),w({type:"brush",mode:C?"move":"resize"}))}function d(n,t,e){var r,u,a=Ti(t),c=a[0],s=a[1],p=z[e],v=e?f:l,d=v[1]-v[0];return C&&(c-=p,s-=d+p),r=(e?g:h)?Math.max(c,Math.min(s,n[e])):n[e],C?u=(r+=p)+d:(x&&(p=Math.max(c,Math.min(s,2*x[e]-r))),r>p?(u=r,r=p):u=p),v[0]!=r||v[1]!=u?(e?o=null:i=null,v[0]=r,v[1]=u,!0):void 0}function m(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),Zo.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),N(),w({type:"brushend"})}var x,M,_=this,b=Zo.select(Zo.event.target),w=a.of(_,arguments),S=Zo.select(_),k=b.datum(),E=!/^(n|s)$/.test(k)&&c,A=!/^(e|w)$/.test(k)&&s,C=b.classed("extent"),N=I(),z=Zo.mouse(_),L=Zo.select(Wo).on("keydown.brush",u).on("keyup.brush",p);if(Zo.event.changedTouches?L.on("touchmove.brush",v).on("touchend.brush",m):L.on("mousemove.brush",v).on("mouseup.brush",m),S.interrupt().selectAll("*").interrupt(),C)z[0]=l[0]-z[0],z[1]=f[0]-z[1];else if(k){var T=+/w$/.test(k),q=+/^n/.test(k);M=[l[1-T]-z[0],f[1-q]-z[1]],z[0]=l[T],z[1]=f[q]}else Zo.event.altKey&&(x=z.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),Zo.select("body").style("cursor",b.style("cursor")),w({type:"brushstart"}),v()}var i,o,a=M(n,"brushstart","brush","brushend"),c=null,s=null,l=[0,0],f=[0,0],h=!0,g=!0,p=qs[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:l,y:f,i:i,j:o},e=this.__chart__||t;this.__chart__=t,Ss?Zo.select(this).transition().each("start.brush",function(){i=e.i,o=e.j,l=e.x,f=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=gu(l,t.x),r=gu(f,t.y);return i=o=null,function(u){l=t.x=e(u),f=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,p=qs[!c<<1|!s],n):c},n.y=function(t){return arguments.length?(s=t,p=qs[!c<<1|!s],n):s},n.clamp=function(t){return arguments.length?(c&&s?(h=!!t[0],g=!!t[1]):c?h=!!t:s&&(g=!!t),n):c&&s?[h,g]:c?h:s?g:null},n.extent=function(t){var e,r,u,a,h;return arguments.length?(c&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),i=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(h=e,e=r,r=h),(e!=l[0]||r!=l[1])&&(l=[e,r])),s&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],s.invert&&(u=s(u),a=s(a)),u>a&&(h=u,u=a,a=h),(u!=f[0]||a!=f[1])&&(f=[u,a])),n):(c&&(i?(e=i[0],r=i[1]):(e=l[0],r=l[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(h=e,e=r,r=h))),s&&(o?(u=o[0],a=o[1]):(u=f[0],a=f[1],s.invert&&(u=s.invert(u),a=s.invert(a)),u>a&&(h=u,u=a,a=h))),c&&s?[[e,u],[r,a]]:c?[e,r]:s&&[u,a])},n.clear=function(){return n.empty()||(l=[0,0],f=[0,0],i=o=null),n},n.empty=function(){return!!c&&l[0]==l[1]||!!s&&f[0]==f[1]},Zo.rebind(n,a,"on")};var Ts={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},qs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Rs=Qa.format=ic.timeFormat,Ds=Rs.utc,Ps=Ds("%Y-%m-%dT%H:%M:%S.%LZ");Rs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ho:Ps,Ho.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Ho.toString=Ps.toString,Qa.second=Dt(function(n){return new nc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Qa.seconds=Qa.second.range,Qa.seconds.utc=Qa.second.utc.range,Qa.minute=Dt(function(n){return new nc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Qa.minutes=Qa.minute.range,Qa.minutes.utc=Qa.minute.utc.range,Qa.hour=Dt(function(n){var t=n.getTimezoneOffset()/60;return new nc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Qa.hours=Qa.hour.range,Qa.hours.utc=Qa.hour.utc.range,Qa.month=Dt(function(n){return n=Qa.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Qa.months=Qa.month.range,Qa.months.utc=Qa.month.utc.range;var Us=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],js=[[Qa.second,1],[Qa.second,5],[Qa.second,15],[Qa.second,30],[Qa.minute,1],[Qa.minute,5],[Qa.minute,15],[Qa.minute,30],[Qa.hour,1],[Qa.hour,3],[Qa.hour,6],[Qa.hour,12],[Qa.day,1],[Qa.day,2],[Qa.week,1],[Qa.month,1],[Qa.month,3],[Qa.year,1]],Hs=Rs.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",we]]),Fs={range:function(n,t,e){return Zo.range(Math.ceil(n/e)*e,+t,e).map(Oo)},floor:wt,ceil:wt};js.year=Qa.year,Qa.scale=function(){return Fo(Zo.scale.linear(),js,Hs)};var Os=js.map(function(n){return[n[0].utc,n[1]]}),Ys=Ds.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",we]]);Os.year=Qa.year.utc,Qa.scale.utc=function(){return Fo(Zo.scale.linear(),Os,Ys)},Zo.text=St(function(n){return n.responseText}),Zo.json=function(n,t){return kt(n,"application/json",Yo,t)},Zo.html=function(n,t){return kt(n,"text/html",Io,t)},Zo.xml=St(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(Zo):"object"==typeof module&&module.exports&&(module.exports=Zo),this.d3=Zo}();; ;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/lib/d3.tip.js' */ // d3.tip // Copyright (c) 2013 Justin Palmer // // Tooltips for d3.js SVG visualizations (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module with d3 as a dependency. define(['d3'], factory) } else { // Browser global. root.d3.tip = factory(root.d3) } }(this, function (d3) { // Public - contructs a new tooltip // // Returns a tip return function() { var direction = d3_tip_direction, offset = d3_tip_offset, html = d3_tip_html, node = initNode(), svg = null, point = null, target = null function tip(vis) { svg = getSVGNode(vis) point = svg.createSVGPoint() document.body.appendChild(node) } // Public - show the tooltip on the screen // // Returns a tip tip.show = function() { var args = Array.prototype.slice.call(arguments) if(args[args.length - 1] instanceof SVGElement) target = args.pop() var content = html.apply(this, args), poffset = offset.apply(this, args), dir = direction.apply(this, args), nodel = d3.select(node), i = directions.length, coords, scrollTop = document.documentElement.scrollTop || document.body.scrollTop, scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft nodel.html(content) .style({ opacity: 1, 'pointer-events': 'all' }) while(i--) nodel.classed(directions[i], false) coords = direction_callbacks.get(dir).apply(this) nodel.classed(dir, true).style({ top: (coords.top + poffset[0]) + scrollTop + 'px', left: (coords.left + poffset[1]) + scrollLeft + 'px' }) return tip } // Public - hide the tooltip // // Returns a tip tip.hide = function() { nodel = d3.select(node) nodel.style({ opacity: 0, 'pointer-events': 'none' }) return tip } // Public: Proxy attr calls to the d3 tip container. Sets or gets attribute value. // // n - name of the attribute // v - value of the attribute // // Returns tip or attribute value tip.attr = function(n, v) { if (arguments.length < 2 && typeof n === 'string') { return d3.select(node).attr(n) } else { var args = Array.prototype.slice.call(arguments) d3.selection.prototype.attr.apply(d3.select(node), args) } return tip } // Public: Proxy style calls to the d3 tip container. Sets or gets a style value. // // n - name of the property // v - value of the property // // Returns tip or style property value tip.style = function(n, v) { if (arguments.length < 2 && typeof n === 'string') { return d3.select(node).style(n) } else { var args = Array.prototype.slice.call(arguments) d3.selection.prototype.style.apply(d3.select(node), args) } return tip } // Public: Set or get the direction of the tooltip // // v - One of n(north), s(south), e(east), or w(west), nw(northwest), // sw(southwest), ne(northeast) or se(southeast) // // Returns tip or direction tip.direction = function(v) { if (!arguments.length) return direction direction = v == null ? v : d3.functor(v) return tip } // Public: Sets or gets the offset of the tip // // v - Array of [x, y] offset // // Returns offset or tip.offset = function(v) { if (!arguments.length) return offset offset = v == null ? v : d3.functor(v) return tip } // Public: sets or gets the html value of the tooltip // // v - String value of the tip // // Returns html value or tip tip.html = function(v) { if (!arguments.length) return html html = v == null ? v : d3.functor(v) return tip } function d3_tip_direction() { return 'n' } function d3_tip_offset() { return [0, 0] } function d3_tip_html() { return ' ' } var direction_callbacks = d3.map({ n: direction_n, s: direction_s, e: direction_e, w: direction_w, nw: direction_nw, ne: direction_ne, sw: direction_sw, se: direction_se }), directions = direction_callbacks.keys() function direction_n() { var bbox = getScreenBBox() return { top: bbox.n.y - node.offsetHeight, left: bbox.n.x - node.offsetWidth / 2 } } function direction_s() { var bbox = getScreenBBox() return { top: bbox.s.y, left: bbox.s.x - node.offsetWidth / 2 } } function direction_e() { var bbox = getScreenBBox() return { top: bbox.e.y - node.offsetHeight / 2, left: bbox.e.x } } function direction_w() { var bbox = getScreenBBox() return { top: bbox.w.y - node.offsetHeight / 2, left: bbox.w.x - node.offsetWidth } } function direction_nw() { var bbox = getScreenBBox() return { top: bbox.nw.y - node.offsetHeight, left: bbox.nw.x - node.offsetWidth } } function direction_ne() { var bbox = getScreenBBox() return { top: bbox.ne.y - node.offsetHeight, left: bbox.ne.x } } function direction_sw() { var bbox = getScreenBBox() return { top: bbox.sw.y, left: bbox.sw.x - node.offsetWidth } } function direction_se() { var bbox = getScreenBBox() return { top: bbox.se.y, left: bbox.e.x } } function initNode() { var node = d3.select(document.createElement('div')) node.style({ position: 'absolute', top: 0, opacity: 0, 'pointer-events': 'none', 'box-sizing': 'border-box' }) return node.node() } function getSVGNode(el) { el = el.node() if(el.tagName.toLowerCase() == 'svg') return el return el.ownerSVGElement } // Private - gets the screen coordinates of a shape // // Given a shape on the screen, will return an SVGPoint for the directions // n(north), s(south), e(east), w(west), ne(northeast), se(southeast), nw(northwest), // sw(southwest). // // +-+-+ // | | // + + // | | // +-+-+ // // Returns an Object {n, s, e, w, nw, sw, ne, se} function getScreenBBox() { var targetel = target || d3.event.target, bbox = {}, matrix = targetel.getScreenCTM(), tbbox = targetel.getBBox(), width = tbbox.width, height = tbbox.height, x = tbbox.x, y = tbbox.y point.x = x point.y = y bbox.nw = point.matrixTransform(matrix) point.x += width bbox.ne = point.matrixTransform(matrix) point.y += height bbox.se = point.matrixTransform(matrix) point.x -= width bbox.sw = point.matrixTransform(matrix) point.y -= height / 2 bbox.w = point.matrixTransform(matrix) point.x += width bbox.e = point.matrixTransform(matrix) point.x -= width / 2 point.y -= height / 2 bbox.n = point.matrixTransform(matrix) point.y += height bbox.s = point.matrixTransform(matrix) return bbox } return tip }; }));; ;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-nav.js' */ define('graph/navbuilder', ['underscore', 'stash/api/util/navbuilder', 'model/page-state', 'exports'], function (_, nav, pageState, exports) { function getContributionsLink(userName, from, to) { var params = { name: userName }; if (from) { params.from = from; } if (to) { params.to = to; } return nav.pluginServlets().path('user-contributions').withParams(params).buildAbsolute(); } function getChangesetLink(key, slug, id) { return nav.project(key).repo(slug).changeset(id).buildAbsolute(); } function getPullRequestLink(key, slug, id) { return nav.project(key).repo(slug).pullRequest(id).buildAbsolute(); } function getFileDiffLink(key, slug, id, file) { return nav.project(key).repo(slug).changeset(id).withFragment(file).buildAbsolute() } function getRepoGraphsURL(params) { var defaultParams = { projectKey: pageState.getProject().getKey(), repoSlug: pageState.getRepository().getSlug() }; if (params.allBranches || !pageState.getRevisionRef().isDefault()) { defaultParams.refId = params.ref.id; } var cleanParams = _.omit(params, ['ref', 'allBranches']); return nav.pluginServlets().path('graphs').withParams(_.extend(defaultParams, cleanParams)).buildAbsolute(); } function parse(url) { return nav.parse(url); } function getCommitsGraphURL() { return nav.rest('stash-graph') .project(pageState.getProject()) .repo(pageState.getRepository()) .addPathComponents('parents') .build() } exports.getContributionsLink = getContributionsLink; exports.getChangesetLink = getChangesetLink; exports.getPullRequestLink = getPullRequestLink; exports.getFileDiffLink = getFileDiffLink; exports.getRepoGraphsURL = getRepoGraphsURL; exports.getCommitsGraphURL = getCommitsGraphURL; exports.parse = parse; }); ; ;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-license.js' */ define('graph/license', ['jquery', 'aui', 'model/page-state', 'util/client-storage', 'graphs/timeHelper', 'exports'], function ($, AJS, pageState, storage, timeHelper, exports) { var licenseAttributes; function getNoShowExpiresDialogKey() { return 'graphNoShowExpiresDialog_' + licenseAttributes.expiry; } function setLicenseAttributes(licenseAttr) { licenseAttributes = licenseAttr; AJS.log(licenseAttributes); if (licenseAttributes.expiry) { licenseAttributes.expiryDate = timeHelper.licenseFormat(licenseAttributes.expiry); } } function isFeatured() { return licenseAttributes.featured; } function isEnds() { return licenseAttributes.ends; } function isCluster() { return licenseAttributes.cluster; } function getExpiryDate() { return licenseAttributes.expiryDate; } function createCommitsGraphTooltip($target) { AJS.InlineDialog($target, 'buy', function (content, trigger, showPopup) { content.html("\u003cp\u003eIn order to use this functionality in full you need to purchase a \u003ca href=\u0022https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs?from=commits-graph\u0022 target=\u0022_blank\u0022\u003ecommercial\u003c/a\u003e license for Awesome Graphs add-on.\u003c/p\u003e\u003cp\u003e\u003ca href=\u0022https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs?from=commits-graph\u0022 target=\u0022_blank\u0022\u003eBuy it now\u003c/a\u003e\u003c/p\u003e"); showPopup(); return false; }, {width: 250} ); } function createBranchSelectorTooltip() { AJS.InlineDialog($('#stilt-branch-button'), 'branch', function (content, trigger, showPopup) { var user = pageState.getCurrentUser(); content.html(Graph.Repository.licenseTooltipBranch({ emailAddress: user.get('emailAddress') })); showPopup(); return false; }, {width: 250} ); } function createGroupWidgetTooltip() { AJS.InlineDialog($('#group-variants'), 'group-widget', function (content, trigger, showPopup) { var user = pageState.getCurrentUser(); content.html(Graph.Repository.licenseTooltipGroupWidget({ emailAddress: user.get('emailAddress') })); showPopup(); return false; }, {width: 250} ); } function showTemplateDialog(params) { var dialog = AJS.InlineDialog($('#' + params.targetId), params.dialogId, function (content, trigger, showPopup) { content.html(params.content); showPopup(); return false; }, { width: 250, noBind: true, initCallback: function () { $('#' + params.closeId).on('click', function () { dialog.hide(); storage.setItem(params.storageKey, true, {noCleanup: true}, 'local'); }); } } ); !storage.getItem(params.storageKey, 'local') && dialog.show() } function showExpiresDialog(targetId) { return showTemplateDialog({ targetId: targetId, dialogId: 'ends', content: Graph.Repository.licenseEndsDialog({ expiryDate: getExpiryDate() }), closeId: 'featured-dialog-close', storageKey: getNoShowExpiresDialogKey() }); } function showFremiumDialog(targetId) { return showTemplateDialog({ targetId: targetId, dialogId: 'freemium', content: Graph.Repository.freemiumDialog(), closeId: 'freemium-dialog-close', storageKey: 'graphNoShowFreemiumDialog' }); } function showLicenseInCluster(container) { container.html(aui.message.info({ content: "Your Stash is running in cluster mode. Awesome Graphs is available in Stash Data Center when you have a commercial license for the add-on. You can \u003ca href=https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\u003ebuy a license\u003c/a\u003e on the Atlassian Marketplace." })); } function showExpiresMessage(content) { $('.license-ends-message').remove(); content.before(aui.message.info({ content: Graph.User.licenseEndsDialog({expiryDate: getExpiryDate()}) })); } function showFreemiumMessageUserContributions(container) { container.addClass('no-license-graph').before(Graph.User.freemiumMessage()); } function showFreemiumMessageCodeFrequency(container) { var user = pageState.getCurrentUser(); container.addClass('no-license-graph').before(Graph.Repository.freemiumMessage( user ? {userEmail: user.get('emailAddress')} : {} )); } exports.setLicenseAttributes = setLicenseAttributes; exports.isFeatured = isFeatured; exports.isCluster = isCluster; exports.isEnds = isEnds; exports.getExpiryDate = getExpiryDate; exports.createCommitsGraphTooltip = createCommitsGraphTooltip; exports.createBranchSelectorTooltip = createBranchSelectorTooltip; exports.showLicenseInCluster = showLicenseInCluster; exports.showExpiresDialog = showExpiresDialog; exports.showFremiumDialog = showFremiumDialog; exports.showExpiresMessage = showExpiresMessage; exports.showFreemiumMessageUserContributions = showFreemiumMessageUserContributions; exports.showFreemiumMessageCodeFrequency = showFreemiumMessageCodeFrequency; exports.createGroupWidgetTooltip = createGroupWidgetTooltip; }); ; ;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-utility.js' */ define('graphs/utility', ['jquery', 'exports'], function ($, exports) { function getScrollWidth() { var div = document.createElement('div'); div.style.overflowY = 'scroll'; div.style.width = '50px'; div.style.height = '50px'; div.style.visibility = 'hidden'; $('body').append(div); var scrollWidth = div.offsetWidth - div.clientWidth; $(div).remove(); return scrollWidth; } function isUglyTick(a, b) { return b === 0 || (a ^ 0) !== a; } function shouldDisplayTick(a, b) { return isUglyTick(a, b) ? "none" : "block"; } exports.getScrollWidth = getScrollWidth; exports.shouldDisplayTick = shouldDisplayTick; });; ;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-date-helper.js' */ define('graphs/timeHelper', ['exports'], function (exports) { var parseYmd = function (date) { return d3.time.format("%Y-%m-%d").parse(date); }; var formatYmdDate = function (date) { return d3.time.format("%Y-%m-%d")(date); }; var format = function (template, date) { return d3.time.format(template)(parseYmd(date)); }; var fullFormat = function (date) { return format("%B %d %Y", date); }; var activityFormat = function (date) { return format("%B %d, %Y", date); }; var activityFormatDate = function (date) { return d3.time.format("%B %d, %Y")(date); }; var formatCodeFrequencyTipDate = function (date) { return d3.time.format("%A, %d %B %Y")(date); }; var formatDomainTitleDate = function (date) { return d3.time.format('%B %e, %Y')(date); }; var monthFormat = function (date) { return format("%b", date); }; var licenseFormat = function (date) { return format("%b %e, %Y", date) }; var getIntervals = function (start, end, type) { return d3.time[type].range(d3.time[type].floor(start), d3.time[type].ceil(end)); }; var getDays = function (start, end) { return getIntervals(start, end, 'day'); }; var getWeeks = function (start, end) { return getIntervals(start, end, 'week'); }; var getMonths = function (start, end) { return getIntervals(start, end, 'month'); }; var getRoundedExtent = function (extent, interval) { var rExtent = extent.map(d3.time[interval].round); // if empty when rounded, use floor & ceil instead if (rExtent[0] >= rExtent[1]) { rExtent[0] = d3.time[interval].floor(extent[0]); rExtent[1] = d3.time[interval].ceil(extent[1]); } return rExtent; }; var getLastYearDate = function (date) { return d3.time.year.offset(date, -1); }; exports.parseYmd = parseYmd; exports.formatYmdDate = formatYmdDate; exports.fullFormat = fullFormat; exports.monthFormat = monthFormat; exports.licenseFormat = licenseFormat; exports.activityFormat = activityFormat; exports.activityFormatDate = activityFormatDate; exports.formatCodeFrequencyTipDate = formatCodeFrequencyTipDate; exports.formatDomainTitleDate = formatDomainTitleDate; exports.getDays = getDays; exports.getWeeks = getWeeks; exports.getMonths = getMonths; exports.getRoundedExtent = getRoundedExtent; exports.getLastYearDate = getLastYearDate; });; ;/* module-key = 'com.stiltsoft.stash.graphs:graph-client-resources', location = 'js/common/graph-loader.js' */ define('graphs/loader', ['underscore', 'aui', 'util/ajax', 'exports'], function (_, AJS, ajax, exports) { 'use strict'; var request; function load(params) { var resource = AJS.contextPath() + '/rest/stash-graph/1.0/' + params.resource, method = params.method || 'rest', wait = _.isUndefined(params.wait) || params.wait, opts = _.defaults(params.opts, {type: 'GET', cache: true}); if (request && wait && request.state() === 'pending') { return request; } if (request && method === 'poll' && request.state() === 'pending' && !wait) { request.pause(); } request = ajax[method](_.extend({url: resource}, opts)); return request; } function isFree() { return !request || request.state() !== 'pending'; } exports.load = load; exports.isFree = isFree; });; ;/* module-key = 'com.stiltsoft.stash.graphs:graph-commit-graph', location = 'js/repository/commits-graph-impl.js' */ define('page/awesome-commit-graph-impl', ['jquery', 'util/events'], function($, events) { var paper; var objects; var shadow; var options; var $el; var count; events.on("awesome.graphs.commit.graph.init", function(d) { paper = null; }); events.on("awesome.graphs.commit.graph.add", function(d) { $el = d.$el; options = d.options; if (!paper) { count = 0; paper = Raphael($el[0], options.width, options.height); objects = paper.set(); } paper.setSize(options.width, options.height); $.each(d.values, function(i, point) { var routes = drawRoutes(point, count + i); $.each(routes, function(i, route) { objects.push(route); }); objects.push(drawDot(point, count + i)); }); count += d.values.length; drawShadow(count - 1, options.width); }); var drawShadow = function(y, width) { if (shadow) { shadow.remove(); } shadow = paper.rect(0, getYPos(y) + options.yStep / 2, width, 20).attr({ "fill": "#fff", "stroke-width": "0" }); }; var drawDot = function(point, yStep) { return paper .circle(getXPos(point[1][0]), getYPos(yStep), options.dotRadius) .attr({ 'fill': color(point[1][1]), 'stroke-width': 0 }); }; var drawRoutes = function(point, yStep) { var xQuarter = options.xStep / 4; var yTwoThird = options.yStep / 3 * 2; var fromY = getYPos(yStep); var toY = getYPos(yStep + 1); var routes = []; for (var i = point[2].length - 1; i >= 0; i--) { var route = point[2][i]; var fromX = getXPos(route[0]); var toX = getXPos(route[1]); var opt = { 'stroke': color(route[2]), 'stroke-width': 2 }; var path = null; var moves = ['M', fromX, fromY]; if (fromX === toX) { path = paper .path(moves.concat([ 'L', toX, toY])) .attr(opt); } else { path = paper .path(moves.concat([ 'C', fromX - xQuarter, fromY + yTwoThird, toX + xQuarter, toY - yTwoThird, toX, toY])) .attr(opt); } routes.push(path); } return routes; }; var getYPos = function(level) { return (options.yStep * level) + options.padding + options.dotRadius; }; var getXPos = function(branch) { return (options.xStep * branch) + options.xPadding - options.dotRadius; }; var color = function(branch) { return colors[branch % colors.length]; }; var colors = [ "#8eb021", "#84bbc6", "#67ab49", "#654982", "#f15c75", "#ac707a", "#f691b2", "#59afe1", "#4a6785", "#d39c3f", "#f79232", "#815b3a", "#f1a257", "#cccccc", "#999999", "#e9e9e9" ]; }); require('page/awesome-commit-graph-impl');; ;/* module-key = 'com.stiltsoft.stash.graphs:graph-commit-graph', location = 'js/repository/commits-graph.js' */ define('page/awesome-commit-graph', ['jquery', 'util/events', 'model/page-state', 'util/ajax', 'graph/license', 'graph/navbuilder'], function($, events, pageState, ajax, license, nav) { var CommitGraph = { offsetY: null, svg: null, canvas: null, ids: [], map: [], branches: [], totalBranches: 0, reserve: [], nodes: [], maxBranches: -1, add: function(changesets) { var t = this; if (!t.canvas) { t.canvas = t.getCanvas(); t.offsetY = $('.commit-row:first', t.commitsContent()).outerHeight(); } t.ids = []; t.nodes = []; changesets.forEach(function(changeset) { t.ids.push(changeset.id); t.map[changeset.id] = changeset.parents; }); t.draw(); }, draw: function() { var t = this; t.paint(); var dotRadius = 4; var xStep = 15; var width = t.maxBranches * xStep; t.commitsContent().animate({'padding-left': width}, {duration: 1200, easing: 'linear'}); events.trigger("awesome.graphs.commit.graph.add", this, { $el: t.canvas, options: { height: t.commitsContent().height(), width: width, padding: (t.offsetY / 2) - dotRadius, xPadding: 9, xStep: xStep, yStep: t.offsetY, dotRadius: dotRadius, lineWidth: 2 }, values: t.nodes }); }, branch: function(id) { var t = this; if (t.branches[id] === undefined) { t.branches[id] = t.totalBranches; t.reserve.push(t.totalBranches++); } return t.branches[id]; }, paint: function() { var t = this; t.ids.forEach(function(id) { var parentsIds = t.map[id]; var branch = t.branch(id); var offset = t.reserve.indexOf(branch); var routes = []; if (t.branches[parentsIds[0]] !== undefined) { for (var j = offset + 1; j < t.reserve.length; j++) { routes.push([j, j - 1, t.reserve[j]]); } for (j = 0; j < offset; j++) { routes.push([j, j, t.reserve[j]]); } t.reserve.splice(t.reserve.indexOf(branch), 1); routes.push([offset, t.reserve.indexOf(t.branches[parentsIds[0]]), branch]); } else { for (j = 0; j < t.reserve.length; j++) { routes.push([j, j, t.reserve[j]]); } t.branches[parentsIds[0]] = branch; } if (parentsIds.length === 2) { var other = t.branch(parentsIds[1]); routes.push([offset, t.reserve.indexOf(other), other]); } if (routes.length > t.maxBranches) { t.maxBranches = routes.length; } t.nodes.push([id, [offset, branch, ""], routes, []]); }); }, getCanvas: function() { var t = this; if (t.canvas) { return t.canvas; } return $('<div class="awesome-commits-graph" />') .offset(t.commitsContent().offset()) .appendTo('body'); }, reset: function() { var t = this; t.canvas.remove(); t.canvas = null; t.ids = []; t.map = []; t.branches = []; t.totalBranches = 0; t.reserve = []; t.nodes = []; t.maxBranches = -1; }, commitsContent: function() { return $('.commits-content'); }, relocate: function() { var t = CommitGraph; if (t.canvas) { t.canvas.offset(t.commitsContent().offset()); } } }; events.on('stash.feature.sidebar.collapseEnd', CommitGraph.relocate); events.on('stash.feature.sidebar.expandEnd', CommitGraph.relocate); var licenseActive; var $unlock; events.on('stash.layout.branch.revisionRefChanged', function(revisionRef) { AJS.log("RevisionRef -> " + revisionRef); CommitGraph.reset(); $unlock = null; events.trigger("awesome.graphs.commit.graph.init", this, {}); }); events.on('stash.widget.commitsTable.contentAdded', function(page) { AJS.log(page); if (page.start > 0 && !licenseActive) { if ($unlock == null) { $unlock = $('<a href="#" class="buy"/>'); CommitGraph.getCanvas().append($unlock); license.createCommitsGraphTooltip($unlock); } return; } var ids = page.values.map(function () { return $(this).data('changesetid'); }).toArray(); ajax.rest({ url: nav.getCommitsGraphURL(), type: 'POST', data: { changesetIds: ids }, statusCode: { '*': function() { return false; } } }).done(function(data) { licenseActive = data.licenseActive; var m = []; data.payload.values.forEach(function(changeset) { m[changeset.id] = changeset; }); var d = []; ids.forEach(function(id) { d.push(m[id]); }); CommitGraph.add(d); }); }); }); require('page/awesome-commit-graph');; ;/* module-key = 'com.stiltsoft.stash.graphs:graphs-sticky-branches', location = 'js/common/graph-sticky-branches.js' */ define('page/graphs-sticky-branches', ['jquery', 'util/events', 'stash/api/util/navbuilder', 'exports'], function($, events, nav, exports) { exports.onReady = function() { events.on('stash.layout.branch.revisionRefChanged', function(revisionRef) { if (revisionRef) { var $graphsLink = $('#repository-nav-graphs'); if (!revisionRef.getIsDefault()) { $graphsLink.attr('href', nav.parse($graphsLink.attr('href')).replaceQueryParam('refId', revisionRef.getId())); } else { $graphsLink.attr('href', nav.parse($graphsLink.attr('href')).deleteQueryParam('refId')); } } }); }; }); AJS.$(document).ready(function() { require('page/graphs-sticky-branches').onReady(); });; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:code-block', location = '/static/widget/code-block/code-block.soy' */ // This file was automatically generated from code-block.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.codeBlock = function(opt_data, opt_ignored) { return '<div class="code-block' + ((opt_data.instructionBlock) ? ' instruction-block' : '') + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '"><pre><code>' + soy.$$filterNoAutoescape(opt_data.content) + '</code></pre></div>'; }; if (goog.DEBUG) { stash.widget.codeBlock.soyTemplateName = 'stash.widget.codeBlock'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:dialog-selection', location = '/static/widget/dialog-selection/dialog-selection.soy' */ // This file was automatically generated from dialog-selection.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.dialogSelection = function(opt_data, opt_ignored) { var output = '<ol class="dialog-selection">'; var optionList4 = opt_data.options; var optionListLen4 = optionList4.length; for (var optionIndex4 = 0; optionIndex4 < optionListLen4; optionIndex4++) { var optionData4 = optionList4[optionIndex4]; output += '<li class="option' + ((optionData4.styleClass) ? ' ' + soy.$$escapeHtml(optionData4.styleClass) : '') + ((optionIndex4 == 0) ? ' selected' : '') + '" data-option="' + soy.$$escapeHtml(optionData4.key) + '"><span class="option-icon"></span><div class="option-meta"><div class="option-name">' + soy.$$escapeHtml(optionData4.linkText) + '</div><div class="option-description">' + soy.$$escapeHtml(optionData4.description) + '</div></div></li>'; } output += '</ol>'; return output; }; if (goog.DEBUG) { stash.widget.dialogSelection.soyTemplateName = 'stash.widget.dialogSelection'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:project-avatar', location = '/static/feature/project/project-avatar/project-avatar.soy' */ // This file was automatically generated from project-avatar.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.project. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.project == 'undefined') { stash.feature.project = {}; } stash.feature.project.avatar = function(opt_data, opt_ignored) { return '' + aui.avatar.avatar({tagName: opt_data.tagName, size: opt_data.size, avatarImageUrl: opt_data.imageUrl ? opt_data.imageUrl : opt_data.project ? require('stash/api/util/navbuilder')._avatarUrl(opt_data.project, ({XSMALL:32,SMALL:48,MEDIUM:64,LARGE:96,XLARGE:128,XXLARGE:192,XXXLARGE:256})[opt_data.size.toUpperCase()]).build() : '', accessibilityText: opt_data.project ? opt_data.project.name : '', title: opt_data.tooltip, badgeContent: opt_data.badgeContent, isProject: ! opt_data.project.owner, imageClasses: opt_data.imageClasses, extraClasses: (opt_data.hideBadge ? ' badge-hidden' : '') + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: opt_data.extraAttributes}); }; if (goog.DEBUG) { stash.feature.project.avatar.soyTemplateName = 'stash.feature.project.avatar'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:ref-lozenge', location = '/static/feature/repository/ref-lozenge/ref-lozenge.soy' */ // This file was automatically generated from ref-lozenge.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.repository. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; } stash.feature.repository.refLozenge = function(opt_data, opt_ignored) { return '' + stash.widget.lozenge.htmlLozenge({extraClasses: (opt_data.extraClasses ? opt_data.extraClasses + ' ' : '') + 'ref-lozenge', monospace: true, htmlElement: 'span', content: ((opt_data.repository) ? '<span class="repository">' + stash.feature.project.avatar({size: 'xsmall', project: opt_data.repository.project, tagName: 'span'}) + '<span class="name">' + soy.$$escapeHtml(opt_data.repository.name) + '</span></span>' : '') + '<span class="ref ' + soy.$$escapeHtml(opt_data.ref.type && opt_data.ref.type.id ? opt_data.ref.type.id.toLowerCase() : 'branch') + '">' + aui.icons.icon({size: 'small', useIconFont: true, iconFontSet: 'devtools', icon: opt_data.ref.type && opt_data.ref.type.id.toLowerCase() == 'tag' ? 'tag' : 'branch-small'}) + '<span class="name" aria-label="' + ((opt_data.refAccessibilityText) ? soy.$$escapeHtml(opt_data.refAccessibilityText) : soy.$$escapeHtml(AJS.format("branch {0}",opt_data.ref.displayId))) + '">' + soy.$$escapeHtml(opt_data.ref.displayId) + '</span></span>', extraAttributes: {'data-ref-tooltip': opt_data.tooltip ? opt_data.tooltip : (opt_data.repository ? opt_data.repository.project.name + ' / ' + opt_data.repository.name + ' : ' : '') + opt_data.ref.displayId}}); }; if (goog.DEBUG) { stash.feature.repository.refLozenge.soyTemplateName = 'stash.feature.repository.refLozenge'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:ref-lozenge', location = '/static/feature/repository/ref-lozenge/ref-lozenge.js' */ define("feature/repository/ref-lozenge",["jquery"],function(A){A(".ref-lozenge").tooltip({live:true,title:"data-ref-tooltip",hoverable:true,gravity:function(){return A.fn.tipsy.autoNS.call(this)+A.fn.tipsy.autoWE.call(this)},delayIn:500,className:function(){var K=A(".tipsy");var C=K[0];var L=K.prop("className");var D=/tipsy-[ns]?e/.test(L);var J=/tipsy-s/.test(L);var E=D?C.offsetWidth:undefined;var N=J?C.offsetHeight:undefined;K.addClass("ref-lozenge-tooltip");if(D){var G=C.offsetWidth;var I=G-E;var H=parseFloat(K.css("left"),10);K.css("left",(H-I)+"px")}if(J){var B=C.offsetHeight;var F=B-N;var M=parseFloat(K.css("top"),10);K.css("top",(M-F)+"px")}return"ref-lozenge-tooltip"}})});require("feature/repository/ref-lozenge");; ;/* module-key = 'com.atlassian.stash.stash-repository-ref-sync:ref-sync-common', location = '/static/feature/sync/common/ref-sync-common.js' */ define("feature/sync/common/ref-sync-common",["stash/api/util/navbuilder","stash/api/util/server","exports"],function(e,c,a){function b(f){return c.rest({url:e.rest("sync").currentRepo().build(),type:"POST",data:{enabled:f}})}function d(){return e.rest("sync").currentRepo().addPathComponents("synchronize").build()}a.enableRefSyncing=b;a.getSyncUrl=d});; ;/* module-key = 'com.atlassian.stash.stash-repository-ref-sync:merge', location = '/web-fragment-placeholder.config' */ WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-repository-ref-sync','key':'merge','moduleKey':'merge','completeModuleKey':'com.atlassian.stash.stash-repository-ref-sync:merge','weight':10.0,'params':{},'styleClass':WebFragments._formatI18n(null, null, 'merge-action'),'description':WebFragments._formatI18n(null, null, 'Merge the upstream branch into the fork branch.'),'location':'stash.refsync.diverged.actions','linkText':WebFragments._formatI18n("Merge", 'stash.refsync.dialog.action.merge', '')});; ;/* module-key = 'com.atlassian.stash.stash-repository-ref-sync:discard', location = '/web-fragment-placeholder.config' */ WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-repository-ref-sync','key':'discard','moduleKey':'discard','completeModuleKey':'com.atlassian.stash.stash-repository-ref-sync:discard','weight':20.0,'params':{},'styleClass':WebFragments._formatI18n(null, null, 'discard-action'),'description':WebFragments._formatI18n(null, null, 'Overwrite the branch with upstream, discarding your changes.'),'location':'stash.refsync.diverged.actions','linkText':WebFragments._formatI18n("Discard", 'stash.refsync.dialog.action.discard', '')});; ;/* module-key = 'com.atlassian.stash.stash-repository-ref-sync:ref-sync-dialog', location = '/static/feature/sync/dialog/ref-sync-dialog.js' */ define("feature/sync/dialog/ref-sync-dialog",["aui","jquery","lodash","stash/api/util/navbuilder","util/ajax","model/page-state","widget/submit-spinner","feature/sync/common/ref-sync-common"],function(i,d,j,a,g,h,e,b){function f(k){return a.project(k.getProject()).repo(k).clone(k.getScmId()).buildAbsolute()}function c(){this.initDialog()}c.prototype.initDialog=function(){var k=this;var l;this.ref=h.getRevisionRef();this.dialog=new i.Dialog({width:840,height:420,closeOnOutsideClick:true});j.bindAll(this.dialog,"hide");this.dialog.popup.element.addClass("ref-sync-dialog");this.dialog.addHeader().addPanel().addSubmit("",function(){l.show();k.doSynchronization().fail(function(){l.hide()}).done(function(){window.location.reload(true)})}).addCancel("Cancel",this.dialog.hide);this.$syncPanel=this.dialog.getCurrentPanel().body;this.$syncPanel.on("click",".option",function(){k.$syncPanel.find(".selected").removeClass("selected");var n=d(this);n.addClass("selected");k._setAction(n)});var m=this.dialog.getCurrentPanel().page.buttonpanel.find(".button-panel-submit-button");m.addClass("aui-button aui-button-primary").removeClass("button-panel-button");l=new e(m,"before")};c.prototype.doSynchronization=function(){var k=this;return g.rest({url:b.getSyncUrl(),type:"POST",data:{action:this.action,refId:this.ref.getId()},statusCode:{409:function(o,p,m,l){k.dialog.addPage("merge-conflict").addHeader("Merge conflicts").addPanel().addButtonPanel().addCancel("Close",k.dialog.hide);d(document).one("hideLayer",function(){k.dialog.prevPage().page.pop().body.remove()});var n=k.dialog.getCurrentPanel().body;n.append(stash.feature.sync.mergeConflictHelp({conflicts:l.conflicts,branchName:k.ref.getDisplayId(),upstreamRemote:f(h.getRepository().getOrigin()),forkRemote:f(h.getRepository())}));k.dialog.updateHeight();return false}}})};c.prototype._setAction=function(l){this.action=l.attr("data-option");var k=this.dialog.getCurrentPanel().page.buttonpanel;var m=k.find(".button-panel-submit-button");m.text(l.find(".option-name").text());d(".discard-warning").remove();if(this.action==="discard"){k.prepend(stash.feature.sync.discardWarning())}};c.prototype.showFor=function(k){this.ref=k;this.dialog.addHeader(i.format("Synchronize {0}",k.getDisplayId()));this.$syncPanel.html(stash.feature.sync.dialog({ref:k.toJSON()}));this._setAction(this.$syncPanel.find(".selected"));this.dialog.show();this.dialog.updateHeight()};return c});; ;/* module-key = 'com.atlassian.stash.stash-repository-ref-sync:ref-sync-dialog', location = '/static/feature/sync/dialog/ref-sync-dialog.soy' */ // This file was automatically generated from ref-sync-dialog.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.sync. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.sync == 'undefined') { stash.feature.sync = {}; } stash.feature.sync.dialog = function(opt_data, opt_ignored) { return '<div class="diverge-message">' + stash.feature.sync.divergeMessage({refLozengeContent: '' + stash.feature.repository.refLozenge(opt_data)}) + '</div>' + stash.widget.dialogSelection({options: WebFragments.getWebItems('stash.refsync.diverged.actions')}); }; if (goog.DEBUG) { stash.feature.sync.dialog.soyTemplateName = 'stash.feature.sync.dialog'; } stash.feature.sync.divergeMessage = function(opt_data, opt_ignored) { return '<p>' + soy.$$filterNoAutoescape(AJS.format("{0} could not be synchronized automatically because it has diverged from upstream. Each branch includes changesets the other does not.",opt_data.refLozengeContent)) + '</p><p>' + soy.$$escapeHtml("To synchronize, select one of these strategies:") + '</p>'; }; if (goog.DEBUG) { stash.feature.sync.divergeMessage.soyTemplateName = 'stash.feature.sync.divergeMessage'; } stash.feature.sync.discardWarning = function(opt_data, opt_ignored) { return '<span class=\'discard-warning\'>' + aui.icons.icon({icon: 'error', size: 'small', useIconFont: true}) + '<span>' + soy.$$escapeHtml("Discarding means your changes will be lost") + '</span></span>'; }; if (goog.DEBUG) { stash.feature.sync.discardWarning.soyTemplateName = 'stash.feature.sync.discardWarning'; } stash.feature.sync.mergeConflictHelp = function(opt_data, opt_ignored) { var output = '<div class="merge-conflict-message">' + soy.$$escapeHtml(AJS.format("Upstream changes could not be merged in automatically due to conflicts in the following {0,choice,1#file|1\x3cfiles}:",opt_data.conflicts.length)) + '</div><ul class="conflicted-files">'; var conflictList31 = opt_data.conflicts; var conflictListLen31 = conflictList31.length; for (var conflictIndex31 = 0; conflictIndex31 < conflictListLen31; conflictIndex31++) { var conflictData31 = conflictList31[conflictIndex31]; output += (conflictIndex31 < 2 || conflictIndex31 == 2 && conflictIndex31 == conflictListLen31 - 1) ? '<li class="conflicted-file">' + soy.$$escapeHtml(conflictData31.path) + '</li>' : ''; } output += ((opt_data.conflicts.length > 3) ? '<li class="more-conflicted">' + soy.$$escapeHtml(AJS.format("and {0} more conflicted files",opt_data.conflicts.length - 2)) + '</li>' : '') + '</ul>' + stash.feature.sync.manualMergeInstructions(opt_data); return output; }; if (goog.DEBUG) { stash.feature.sync.mergeConflictHelp.soyTemplateName = 'stash.feature.sync.mergeConflictHelp'; } stash.feature.sync.manualMergeInstructions = function(opt_data, opt_ignored) { return '<h4>' + soy.$$escapeHtml("How to perform a manual merge:") + '</h4><p><strong>' + soy.$$escapeHtml("Step 1:") + '</strong> ' + soy.$$escapeHtml("Fetch changes from the upstream repository (saving the upstream branch as FETCH_HEAD).") + '</p>' + stash.widget.codeBlock({content: 'git fetch ' + soy.$$escapeHtml(opt_data.upstreamRemote) + ' ' + soy.$$escapeHtml(opt_data.branchName) + '\n', instructionBlock: true}) + '<p><strong>' + soy.$$escapeHtml("Step 2:") + '</strong> ' + soy.$$escapeHtml("Checkout the fork branch and merge in the changes from the upstream branch. Resolve conflicts.") + '</p>' + stash.widget.codeBlock({content: 'git checkout ' + soy.$$escapeHtml(opt_data.branchName) + ' \ngit merge FETCH_HEAD', instructionBlock: true}) + '<p><strong>' + soy.$$escapeHtml("Step 3:") + '</strong> ' + soy.$$escapeHtml("After the merge conflicts are resolved, stage the changes accordingly, commit the changes and push.") + '</p>' + stash.widget.codeBlock({content: 'git commit\ngit push ' + soy.$$escapeHtml(opt_data.forkRemote) + ' HEAD', instructionBlock: true}); }; if (goog.DEBUG) { stash.feature.sync.manualMergeInstructions.soyTemplateName = 'stash.feature.sync.manualMergeInstructions'; } ; ;/* module-key = 'com.atlassian.stash.stash-repository-ref-sync:ref-sync-button', location = '/static/feature/sync/button/ref-sync-button.js' */ define("feature/sync/button/ref-sync-button",["jquery","stash/api/util/navbuilder","util/ajax","util/events","model/page-state","feature/sync/dialog/ref-sync-dialog","exports"],function(f,b,h,j,i,d,e){var g=".synchronize-ref";function a(){return b.newBuilder(["rest","sync","latest","projects",i.getProject().getKey(),"repos",i.getRepository().getSlug()]).build()}function c(k){h.rest({url:a(),data:{at:k.getId()}}).done(function(l){var m=l&&l.state==="DIVERGED";f(g).toggleClass("hidden",!m)})}e.onReady=function(){var k=new d();f(g).on("click",function(l){l.preventDefault();k.showFor(i.getRevisionRef())});c(i.getRevisionRef());j.on("stash.layout.branch.revisionRefChanged",c)}});jQuery(document).ready(function(){require("feature/sync/button/ref-sync-button").onReady()});; ;/* module-key = 'com.atlassian.plugins.issue-status-plugin:issue-status-resources', location = 'templates/status.soy' */ // This file was automatically generated from status.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace JIRA.Template.Util.Issue.Status. */ if (typeof JIRA == 'undefined') { var JIRA = {}; } if (typeof JIRA.Template == 'undefined') { JIRA.Template = {}; } if (typeof JIRA.Template.Util == 'undefined') { JIRA.Template.Util = {}; } if (typeof JIRA.Template.Util.Issue == 'undefined') { JIRA.Template.Util.Issue = {}; } if (typeof JIRA.Template.Util.Issue.Status == 'undefined') { JIRA.Template.Util.Issue.Status = {}; } JIRA.Template.Util.Issue.Status.issueStatusResolver = function(opt_data, opt_ignored) { return '' + ((! opt_data.issueStatus) ? '<span class="aui-icon aui-icon-small aui-iconfont-help jira-issue-status-render-error" title="' + soy.$$escapeHtml("no.issue.status.info") + '"></span>' : (opt_data.issueStatus.statusCategory) ? JIRA.Template.Util.Issue.Status.issueStatus(opt_data) : JIRA.Template.Util.Issue.Status.iconStatus({name: opt_data.issueStatus.name, iconUrl: opt_data.issueStatus.iconUrl, description: opt_data.issueStatus.description, isCompact: opt_data.isCompact})); }; if (goog.DEBUG) { JIRA.Template.Util.Issue.Status.issueStatusResolver.soyTemplateName = 'JIRA.Template.Util.Issue.Status.issueStatusResolver'; } JIRA.Template.Util.Issue.Status.iconStatus = function(opt_data, opt_ignored) { return '<img src="' + soy.$$escapeHtml(opt_data.iconUrl) + '" width="16" height="16" alt="' + soy.$$escapeHtml(opt_data.name) + '" title="' + soy.$$escapeHtml(opt_data.name) + ((opt_data.description) ? ' - ' + soy.$$escapeHtml(opt_data.description) : '') + '" class="jira-issue-status-icon">' + ((! opt_data.isCompact) ? ' ' + soy.$$escapeHtml(opt_data.name) : ''); }; if (goog.DEBUG) { JIRA.Template.Util.Issue.Status.iconStatus.soyTemplateName = 'JIRA.Template.Util.Issue.Status.iconStatus'; } JIRA.Template.Util.Issue.Status.issueStatus = function(opt_data, opt_ignored) { return '' + JIRA.Template.Util.Issue.Status.statusLozenge({name: opt_data.issueStatus.name, categoryKey: opt_data.issueStatus.statusCategory.key, colorName: opt_data.issueStatus.statusCategory.colorName, description: opt_data.issueStatus.description, isSubtle: opt_data.isSubtle, isCompact: opt_data.isCompact, maxWidth: opt_data.maxWidth}); }; if (goog.DEBUG) { JIRA.Template.Util.Issue.Status.issueStatus.soyTemplateName = 'JIRA.Template.Util.Issue.Status.issueStatus'; } JIRA.Template.Util.Issue.Status.statusLozenge = function(opt_data, opt_ignored) { var output = ''; var maxWidth__soy46 = opt_data.maxWidth ? opt_data.maxWidth : 'medium'; var tooltipContent__soy47 = '<span class="jira-issue-status-tooltip-title">' + soy.$$escapeHtml(opt_data.name) + '</span>' + ((opt_data.description) ? '<br><span class="jira-issue-status-tooltip-desc">' + soy.$$escapeHtml(opt_data.description) + '</span>' : ''); output += '<span class=" jira-issue-status-lozenge aui-lozenge ' + JIRA.Template.Util.Issue.Status.statusLozengeClasses(opt_data) + ((opt_data.isSubtle && ! opt_data.isCompact) ? ' aui-lozenge-subtle' : '') + ((opt_data.isCompact) ? ' jira-issue-status-lozenge-compact' : '') + ' jira-issue-status-lozenge-max-width-' + soy.$$escapeHtml(maxWidth__soy46) + '" data-tooltip="' + soy.$$escapeHtml(tooltipContent__soy47) + '">' + soy.$$escapeHtml(opt_data.name) + '</span>'; return output; }; if (goog.DEBUG) { JIRA.Template.Util.Issue.Status.statusLozenge.soyTemplateName = 'JIRA.Template.Util.Issue.Status.statusLozenge'; } JIRA.Template.Util.Issue.Status.statusLozengeClasses = function(opt_data, opt_ignored) { return 'jira-issue-status-lozenge-' + soy.$$escapeHtml(opt_data.colorName ? opt_data.colorName : 'medium-gray') + ' ' + ((opt_data.categoryKey) ? 'jira-issue-status-lozenge-' + soy.$$escapeHtml(opt_data.categoryKey) : ''); }; if (goog.DEBUG) { JIRA.Template.Util.Issue.Status.statusLozengeClasses.soyTemplateName = 'JIRA.Template.Util.Issue.Status.statusLozengeClasses'; } ; ;/* module-key = 'com.atlassian.plugins.issue-status-plugin:issue-status-resources', location = '/js/issue-status-plugin.js' */ AJS.$(function(){if(AJS.$.fn.tooltip){AJS.$(".jira-issue-status-lozenge[data-tooltip]").tooltip({aria:true,gravity:AJS.$.fn.tipsy.autoWE,delayIn:100,html:true,live:true,title:"data-tooltip",className:"jira-issue-status-tooltip"})}});; ;/* module-key = 'com.atlassian.auiplugin:aui-select2', location = 'js-vendor/jquery/plugins/jquery.select2.js' */ (function(A){if(typeof A.fn.each2=="undefined"){A.extend(A.fn,{each2:function(E){var C=A([0]),D=-1,B=this.length;while(++D<B&&(C.context=C[0]=this[D])&&E.call(C[0],D,C)!==false){}return this}})}})(jQuery);(function(d,M){if(window.Select2!==M){return }var k,n,X,C,A,P,O={x:0,y:0},V,W,k={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(o){o=o.which?o.which:o;switch(o){case k.LEFT:case k.RIGHT:case k.UP:case k.DOWN:return true}return false},isControl:function(p){var o=p.which;switch(o){case k.SHIFT:case k.CTRL:case k.ALT:return true}if(p.metaKey){return true}return false},isFunctionKey:function(o){o=o.which?o.which:o;return o>=112&&o<=123}},b="<div class='select2-measure-scrollbar'></div>",D={"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z"};V=d(document);A=(function(){var o=1;return function(){return o++}}());function E(r){var p,q,o,s;if(!r||r.length<1){return r}p="";for(q=0,o=r.length;q<o;q++){s=r.charAt(q);p+=D[s]||s}return p}function Q(q,r){var p=0,o=r.length;for(;p<o;p=p+1){if(T(q,r[p])){return p}}return -1}function m(){var o=d(b);o.appendTo("body");var p={width:o.width()-o[0].clientWidth,height:o.height()-o[0].clientHeight};o.remove();return p}function T(p,o){if(p===o){return true}if(p===M||o===M){return false}if(p===null||o===null){return false}if(p.constructor===String){return p+""===o+""}if(o.constructor===String){return o+""===p+""}return false}function I(p,r){var s,q,o;if(p===null||p.length<1){return[]}s=p.split(r);for(q=0,o=s.length;q<o;q=q+1){s[q]=d.trim(s[q])}return s}function H(o){return o.outerWidth(false)-o.width()}function f(p){var o="keyup-change-value";p.on("keydown",function(){if(d.data(p,o)===M){d.data(p,o,p.val())}});p.on("keyup",function(){var q=d.data(p,o);if(q!==M&&p.val()!==q){d.removeData(p,o);p.trigger("keyup-change")}})}V.on("mousemove",function(o){O.x=o.pageX;O.y=o.pageY});function j(o){o.on("mousemove",function(q){var p=O;if(p===M||p.x!==q.pageX||p.y!==q.pageY){d(q.target).trigger("mousemove-filtered",q)}})}function K(r,p,o){o=o||M;var q;return function(){var s=arguments;window.clearTimeout(q);q=window.setTimeout(function(){p.apply(o,s)},r)}}function S(q){var o=false,p;return function(){if(o===false){p=q();o=true}return p}}function L(o,q){var p=K(o,function(r){q.trigger("scroll-debounced",r)});q.on("scroll",function(r){if(Q(r.target,q.get())>=0){p(r)}})}function i(o){if(o[0]===document.activeElement){return }window.setTimeout(function(){var q=o[0],r=o.val().length,p;o.focus();if(o.is(":visible")&&q===document.activeElement){if(q.setSelectionRange){q.setSelectionRange(r,r)}else{if(q.createTextRange){p=q.createTextRange();p.collapse(false);p.select()}}}},0)}function F(o){o=d(o)[0];var r=0;var p=0;if("selectionStart" in o){r=o.selectionStart;p=o.selectionEnd-r}else{if("selection" in document){o.focus();var q=document.selection.createRange();p=document.selection.createRange().text.length;q.moveStart("character",-o.value.length);r=q.text.length-p}}return{offset:r,length:p}}function a(o){o.preventDefault();o.stopPropagation()}function B(o){o.preventDefault();o.stopImmediatePropagation()}function N(p){if(!P){var o=p[0].currentStyle||window.getComputedStyle(p[0],null);P=d(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:o.fontSize,fontFamily:o.fontFamily,fontStyle:o.fontStyle,fontWeight:o.fontWeight,letterSpacing:o.letterSpacing,textTransform:o.textTransform,whiteSpace:"nowrap"});P.attr("class","select2-sizer");d("body").append(P)}P.text(p.val());return P.width()}function J(p,t,o){var r,s=[],q;r=p.attr("class");if(r){r=""+r;d(r.split(" ")).each2(function(){if(this.indexOf("select2-")===0){s.push(this)}})}r=t.attr("class");if(r){r=""+r;d(r.split(" ")).each2(function(){if(this.indexOf("select2-")!==0){q=o(this);if(q){s.push(q)}}})}p.attr("class",s.join(" "))}function U(t,s,q,o){var r=E(t.toUpperCase()).indexOf(E(s.toUpperCase())),p=s.length;if(r<0){q.push(o(t));return }q.push(o(t.substring(0,r)));q.push("<span class='select2-match'>");q.push(o(t.substring(r,r+p)));q.push("</span>");q.push(o(t.substring(r+p,t.length)))}function g(o){var p={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(o).replace(/[&<>"'\/\\]/g,function(q){return p[q]})}function e(p){var s,q=null,t=p.quietMillis||100,r=p.url,o=this;return function(u){window.clearTimeout(s);s=window.setTimeout(function(){var x=p.data,w=r,z=p.transport||d.fn.select2.ajaxDefaults.transport,v={type:p.type||"GET",cache:p.cache||false,jsonpCallback:p.jsonpCallback||M,dataType:p.dataType||"json"},y=d.extend({},d.fn.select2.ajaxDefaults.params,v);x=x?x.call(o,u.term,u.page,u.context):null;w=(typeof w==="function")?w.call(o,u.term,u.page,u.context):w;if(q){q.abort()}if(p.params){if(d.isFunction(p.params)){d.extend(y,p.params.call(o))}else{d.extend(y,p.params)}}d.extend(y,{url:w,dataType:p.dataType,data:x,success:function(AB){var AA=p.results(AB,u.page);u.callback(AA)}});q=z.call(o,y)},t)}}function h(p){var s=p,r,q,t=function(u){return""+u.text};if(d.isArray(s)){q=s;s={results:q}}if(d.isFunction(s)===false){q=s;s=function(){return q}}var o=s();if(o.text){t=o.text;if(!d.isFunction(t)){r=o.text;t=function(u){return u[r]}}}return function(w){var v=w.term,u={results:[]},x;if(v===""){w.callback(s());return }x=function(z,AB){var AA,y;z=z[0];if(z.children){AA={};for(y in z){if(z.hasOwnProperty(y)){AA[y]=z[y]}}AA.children=[];d(z.children).each2(function(AC,AD){x(AD,AA.children)});if(AA.children.length||w.matcher(v,t(AA),z)){AB.push(AA)}}else{if(w.matcher(v,t(z),z)){AB.push(z)}}};d(s().results).each2(function(z,y){x(y,u.results)});w.callback(u)}}function Z(p){var o=d.isFunction(p);return function(s){var r=s.term,q={results:[]};d(o?p():p).each(function(){var t=this.text!==M,u=t?this.text:this;if(r===""||s.matcher(r,u)){q.results.push(t?this:{id:this,text:this})}});s.callback(q)}}function Y(o,p){if(d.isFunction(o)){return true}if(!o){return false}throw new Error(p+" must be a function or a falsy value")}function c(o){return d.isFunction(o)?o():o}function R(o){var p=0;d.each(o,function(q,r){if(r.children){p+=R(r.children)}else{p++}});return p}function G(w,x,u,o){var p=w,y=false,r,v,s,q,t;if(!o.createSearchChoice||!o.tokenSeparators||o.tokenSeparators.length<1){return M}while(true){v=-1;for(s=0,q=o.tokenSeparators.length;s<q;s++){t=o.tokenSeparators[s];v=w.indexOf(t);if(v>=0){break}}if(v<0){break}r=w.substring(0,v);w=w.substring(v+t.length);if(r.length>0){r=o.createSearchChoice.call(this,r,x);if(r!==M&&r!==null&&o.id(r)!==M&&o.id(r)!==null){y=false;for(s=0,q=x.length;s<q;s++){if(T(o.id(r),o.id(x[s]))){y=true;break}}if(!y){u(r)}}}}if(p!==w){return w}}function l(o,p){var q=function(){};q.prototype=new o;q.prototype.constructor=q;q.prototype.parent=o.prototype;q.prototype=d.extend(q.prototype,p);return q}n=l(Object,{bind:function(p){var o=this;return function(){p.apply(o,arguments)}},init:function(s){var q,p,t=".select2-results";this.opts=s=this.prepareOpts(s);this.id=s.id;if(s.element.data("select2")!==M&&s.element.data("select2")!==null){s.element.data("select2").destroy()}this.container=this.createContainer();this.containerId="s2id_"+(s.element.attr("id")||"autogen"+A());this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1");this.container.attr("id",this.containerId);this.body=S(function(){return s.element.closest("body")});J(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.attr("style",s.element.attr("style"));this.container.css(c(s.containerCss));this.container.addClass(c(s.containerCssClass));this.elementTabIndex=this.opts.element.attr("tabindex");this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",a);this.container.data("select2",this);this.dropdown=this.container.find(".select2-drop");J(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass(c(s.dropdownCssClass));this.dropdown.data("select2",this);this.dropdown.on("click",a);this.results=q=this.container.find(t);this.search=p=this.container.find("input.select2-input");this.queryCount=0;this.resultsPage=0;this.context=null;this.initContainer();this.container.on("click",a);j(this.results);this.dropdown.on("mousemove-filtered touchstart touchmove touchend",t,this.bind(this.highlightUnderEvent));L(80,this.results);this.dropdown.on("scroll-debounced",t,this.bind(this.loadMoreIfNeeded));d(this.container).on("change",".select2-input",function(u){u.stopPropagation()});d(this.dropdown).on("change",".select2-input",function(u){u.stopPropagation()});if(d.fn.mousewheel){q.mousewheel(function(x,y,v,u){var w=q.scrollTop();if(u>0&&w-u<=0){q.scrollTop(0);a(x)}else{if(u<0&&q.get(0).scrollHeight-q.scrollTop()+u<=q.height()){q.scrollTop(q.get(0).scrollHeight-q.height());a(x)}}})}f(p);p.on("keyup-change input paste",this.bind(this.updateResults));p.on("focus",function(){p.addClass("select2-focused")});p.on("blur",function(){p.removeClass("select2-focused")});this.dropdown.on("mouseup",t,this.bind(function(u){if(d(u.target).closest(".select2-result-selectable").length>0){this.highlightUnderEvent(u);this.selectHighlighted(u)}}));this.dropdown.on("click mouseup mousedown",function(u){u.stopPropagation()});if(d.isFunction(this.opts.initSelection)){this.initSelection();this.monitorSource()}if(s.maximumInputLength!==null){this.search.attr("maxlength",s.maximumInputLength)}var r=s.element.prop("disabled");if(r===M){r=false}this.enable(!r);var o=s.element.prop("readonly");if(o===M){o=false}this.readonly(o);W=W||m();this.autofocus=s.element.prop("autofocus");s.element.prop("autofocus",false);if(this.autofocus){this.focus()}this.nextSearchTerm=M},destroy:function(){var p=this.opts.element,o=p.data("select2");this.close();if(this.propertyObserver){delete this.propertyObserver;this.propertyObserver=null}if(o!==M){o.container.remove();o.dropdown.remove();p.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||false);if(this.elementTabIndex){p.attr({tabindex:this.elementTabIndex})}else{p.removeAttr("tabindex")}p.show()}},optionToData:function(o){if(o.is("option")){return{id:o.prop("value"),text:o.text(),element:o.get(),css:o.attr("class"),disabled:o.prop("disabled"),locked:T(o.attr("locked"),"locked")||T(o.data("locked"),true)}}else{if(o.is("optgroup")){return{text:o.attr("label"),children:[],element:o.get(),css:o.attr("class")}}}},prepareOpts:function(t){var r,p,o,s,q=this;r=t.element;if(r.get(0).tagName.toLowerCase()==="select"){this.select=p=t.element}if(p){d.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in t){throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}})}t=d.extend({},{populateResults:function(u,v,x){var w,y=this.opts.id;w=function(AF,z,AE){var AG,AB,AL,AI,AC,AK,AA,AJ,AH,AD;AF=t.sortResults(AF,z,x);for(AG=0,AB=AF.length;AG<AB;AG=AG+1){AL=AF[AG];AC=(AL.disabled===true);AI=(!AC)&&(y(AL)!==M);AK=AL.children&&AL.children.length>0;AA=d("<li></li>");AA.addClass("select2-results-dept-"+AE);AA.addClass("select2-result");AA.addClass(AI?"select2-result-selectable":"select2-result-unselectable");if(AC){AA.addClass("select2-disabled")}if(AK){AA.addClass("select2-result-with-children")}AA.addClass(q.opts.formatResultCssClass(AL));AJ=d(document.createElement("div"));AJ.addClass("select2-result-label");AD=t.formatResult(AL,AJ,x,q.opts.escapeMarkup);if(AD!==M){AJ.html(AD)}AA.append(AJ);if(AK){AH=d("<ul></ul>");AH.addClass("select2-result-sub");w(AL.children,AH,AE+1);AA.append(AH)}AA.data("select2-data",AL);z.append(AA)}};w(v,u,0)}},d.fn.select2.defaults,t);if(typeof (t.id)!=="function"){o=t.id;t.id=function(u){return u[o]}}if(d.isArray(t.element.data("select2Tags"))){if("tags" in t){throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+t.element.attr("id")}t.tags=t.element.data("select2Tags")}if(p){t.query=this.bind(function(y){var x={results:[],more:false},w=y.term,v,u,z;z=function(AA,AC){var AB;if(AA.is("option")){if(y.matcher(w,AA.text(),AA)){AC.push(q.optionToData(AA))}}else{if(AA.is("optgroup")){AB=q.optionToData(AA);AA.children().each2(function(AD,AE){z(AE,AB.children)});if(AB.children.length>0){AC.push(AB)}}}};v=r.children();if(this.getPlaceholder()!==M&&v.length>0){u=this.getPlaceholderOption();if(u){v=v.not(u)}}v.each2(function(AA,AB){z(AB,x.results)});y.callback(x)});t.id=function(u){return u.id};t.formatResultCssClass=function(u){return u.css}}else{if(!("query" in t)){if("ajax" in t){s=t.element.data("ajax-url");if(s&&s.length>0){t.ajax.url=s}t.query=e.call(t.element,t.ajax)}else{if("data" in t){t.query=h(t.data)}else{if("tags" in t){t.query=Z(t.tags);if(t.createSearchChoice===M){t.createSearchChoice=function(u){return{id:d.trim(u),text:d.trim(u)}}}if(t.initSelection===M){t.initSelection=function(u,w){var v=[];d(I(u.val(),t.separator)).each(function(){var y={id:this,text:this},x=t.tags;if(d.isFunction(x)){x=x()}d(x).each(function(){if(T(this.id,y.id)){y=this;return false}});v.push(y)});w(v)}}}}}}}if(typeof (t.query)!=="function"){throw"query function not defined for Select2 "+t.element.attr("id")}return t},monitorSource:function(){var p=this.opts.element,q,o;p.on("change.select2",this.bind(function(r){if(this.opts.element.data("select2-change-triggered")!==true){this.initSelection()}}));q=this.bind(function(){var s=p.prop("disabled");if(s===M){s=false}this.enable(!s);var r=p.prop("readonly");if(r===M){r=false}this.readonly(r);J(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.addClass(c(this.opts.containerCssClass));J(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass(c(this.opts.dropdownCssClass))});p.on("propertychange.select2",q);if(this.mutationCallback===M){this.mutationCallback=function(r){r.forEach(q)}}o=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(o!==M){if(this.propertyObserver){delete this.propertyObserver;this.propertyObserver=null}this.propertyObserver=new o(this.mutationCallback);this.propertyObserver.observe(p.get(0),{attributes:true,subtree:false})}},triggerSelect:function(p){var o=d.Event("select2-selecting",{val:this.id(p),object:p});this.opts.element.trigger(o);return !o.isDefaultPrevented()},triggerChange:function(o){o=o||{};o=d.extend({},o,{type:"change",val:this.val()});this.opts.element.data("select2-change-triggered",true);this.opts.element.trigger(o);this.opts.element.data("select2-change-triggered",false);this.opts.element.click();if(this.opts.blurOnChange){this.opts.element.blur()}},isInterfaceEnabled:function(){return this.enabledInterface===true},enableInterface:function(){var o=this._enabled&&!this._readonly,p=!o;if(o===this.enabledInterface){return false}this.container.toggleClass("select2-container-disabled",p);this.close();this.enabledInterface=o;return true},enable:function(o){if(o===M){o=true}if(this._enabled===o){return }this._enabled=o;this.opts.element.prop("disabled",!o);this.enableInterface()},disable:function(){this.enable(false)},readonly:function(o){if(o===M){o=false}if(this._readonly===o){return false}this._readonly=o;this.opts.element.prop("readonly",o);this.enableInterface();return true},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var q=this.dropdown,t=this.container.offset(),AC=this.container.outerHeight(false),AD=this.container.outerWidth(false),y=q.outerHeight(false),AA=d(window),AH=AA.width(),w=AA.height(),p=AA.scrollLeft()+AH,AG=AA.scrollTop()+w,r=t.top+AC,AE=t.left,o=r+y<=AG,v=(t.top-y)>=this.body().scrollTop(),z=q.outerWidth(false),AJ=AE+z<=p,AI=q.hasClass("select2-drop-above"),u,AF,s,x,AB;if(AI){AF=true;if(!v&&o){s=true;AF=false}}else{AF=false;if(!o&&v){s=true;AF=true}}if(s){q.hide();t=this.container.offset();AC=this.container.outerHeight(false);AD=this.container.outerWidth(false);y=q.outerHeight(false);p=AA.scrollLeft()+AH;AG=AA.scrollTop()+w;r=t.top+AC;AE=t.left;z=q.outerWidth(false);AJ=AE+z<=p;q.show()}if(this.opts.dropdownAutoWidth){AB=d(".select2-results",q)[0];q.addClass("select2-drop-auto-width");q.css("width","");z=q.outerWidth(false)+(AB.scrollHeight===AB.clientHeight?0:W.width);z>AD?AD=z:z=AD;AJ=AE+z<=p}else{this.container.removeClass("select2-drop-auto-width")}if(this.body().css("position")!=="static"){u=this.body().offset();r-=u.top;AE-=u.left}if(!AJ){AE=t.left+AD-z}x={left:AE,width:AD};if(AF){x.bottom=w-t.top;x.top="auto";this.container.addClass("select2-drop-above");q.addClass("select2-drop-above")}else{x.top=r;x.bottom="auto";this.container.removeClass("select2-drop-above");q.removeClass("select2-drop-above")}x=d.extend(x,c(this.opts.dropdownCss));q.css(x)},shouldOpen:function(){var o;if(this.opened()){return false}if(this._enabled===false||this._readonly===true){return false}o=d.Event("select2-opening");this.opts.element.trigger(o);return !o.isDefaultPrevented()},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){if(!this.shouldOpen()){return false}this.opening();return true},opening:function(){var t=this.containerId,o="scroll."+t,r="resize."+t,q="orientationchange."+t,p;this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.clearDropdownAlignmentPreference();if(this.dropdown[0]!==this.body().children().last()[0]){this.dropdown.detach().appendTo(this.body())}p=d("#select2-drop-mask");if(p.length==0){p=d(document.createElement("div"));p.attr("id","select2-drop-mask").attr("class","select2-drop-mask");p.hide();p.appendTo(this.body());p.on("mousedown touchstart click",function(v){var w=d("#select2-drop"),u;if(w.length>0){u=w.data("select2");if(u.opts.selectOnBlur){u.selectHighlighted({noFocus:true})}u.close({focus:true});v.preventDefault();v.stopPropagation()}})}if(this.dropdown.prev()[0]!==p[0]){this.dropdown.before(p)}d("#select2-drop").removeAttr("id");this.dropdown.attr("id","select2-drop");p.show();this.positionDropdown();this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");var s=this;this.container.parents().add(window).each(function(){d(this).on(r+" "+o+" "+q,function(u){s.positionDropdown()})})},close:function(){if(!this.opened()){return }var r=this.containerId,o="scroll."+r,q="resize."+r,p="orientationchange."+r;this.container.parents().add(window).each(function(){d(this).off(o).off(q).off(p)});this.clearDropdownAlignmentPreference();d("#select2-drop-mask").hide();this.dropdown.removeAttr("id");this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();this.clearSearch();this.search.removeClass("select2-active");this.opts.element.trigger(d.Event("select2-close"))},externalSearch:function(o){this.open();this.search.val(o);this.updateResults(false)},clearSearch:function(){},getMaximumSelectionSize:function(){return c(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var r=this.results,q,o,v,u,s,t,p;o=this.highlight();if(o<0){return }if(o==0){r.scrollTop(0);return }q=this.findHighlightableChoices().find(".select2-result-label");v=d(q[o]);u=v.offset().top+v.outerHeight(true);if(o===q.length-1){p=r.find("li.select2-more-results");if(p.length>0){u=p.offset().top+p.outerHeight(true)}}s=r.offset().top+r.outerHeight(true);if(u>s){r.scrollTop(r.scrollTop()+(u-s))}t=v.offset().top-r.offset().top;if(t<0&&v.css("display")!="none"){r.scrollTop(r.scrollTop()+t)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled, .select2-selected)")},moveHighlight:function(r){var q=this.findHighlightableChoices(),p=this.highlight();while(p>-1&&p<q.length){p+=r;var o=d(q[p]);if(o.hasClass("select2-result-selectable")&&!o.hasClass("select2-disabled")&&!o.hasClass("select2-selected")){this.highlight(p);break}}},highlight:function(p){var r=this.findHighlightableChoices(),o,q;if(arguments.length===0){return Q(r.filter(".select2-highlighted")[0],r.get())}if(p>=r.length){p=r.length-1}if(p<0){p=0}this.removeHighlight();o=d(r[p]);o.addClass("select2-highlighted");this.ensureHighlightVisible();q=o.data("select2-data");if(q){this.opts.element.trigger({type:"select2-highlight",val:this.id(q),choice:q})}},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(p){var o=d(p.target).closest(".select2-result-selectable");if(o.length>0&&!o.is(".select2-highlighted")){var q=this.findHighlightableChoices();this.highlight(q.index(o))}else{if(o.length==0){this.removeHighlight()}}},loadMoreIfNeeded:function(){var s=this.results,r=s.find("li.select2-more-results"),u,t=this.resultsPage+1,o=this,q=this.search.val(),p=this.context;if(r.length===0){return }u=r.offset().top-s.offset().top-s.height();if(u<=this.opts.loadMorePadding){r.addClass("select2-active");this.opts.query({element:this.opts.element,term:q,page:t,context:p,matcher:this.opts.matcher,callback:this.bind(function(v){if(!o.opened()){return }o.opts.populateResults.call(this,s,v.results,{term:q,page:t,context:p});o.postprocessResults(v,false,false);if(v.more===true){r.detach().appendTo(s).text(o.opts.formatLoadMore(t+1));window.setTimeout(function(){o.loadMoreIfNeeded()},10)}else{r.remove()}o.positionDropdown();o.resultsPage=t;o.context=v.context;this.opts.element.trigger({type:"select2-loaded",items:v})})})}},tokenize:function(){},updateResults:function(w){var AA=this.search,u=this.results,o=this.opts,t,z=this,x,s=AA.val(),q=d.data(this.container,"select2-last-term"),y;if(w!==true&&q&&T(s,q)){return }d.data(this.container,"select2-last-term",s);if(w!==true&&(this.showSearchInput===false||!this.opened())){return }function v(){AA.removeClass("select2-active");z.positionDropdown()}function p(AB){u.html(AB);v()}y=++this.queryCount;var r=this.getMaximumSelectionSize();if(r>=1){t=this.data();if(d.isArray(t)&&t.length>=r&&Y(o.formatSelectionTooBig,"formatSelectionTooBig")){p("<li class='select2-selection-limit'>"+o.formatSelectionTooBig(r)+"</li>");return }}if(AA.val().length<o.minimumInputLength){if(Y(o.formatInputTooShort,"formatInputTooShort")){p("<li class='select2-no-results'>"+o.formatInputTooShort(AA.val(),o.minimumInputLength)+"</li>")}else{p("")}if(w&&this.showSearch){this.showSearch(true)}return }if(o.maximumInputLength&&AA.val().length>o.maximumInputLength){if(Y(o.formatInputTooLong,"formatInputTooLong")){p("<li class='select2-no-results'>"+o.formatInputTooLong(AA.val(),o.maximumInputLength)+"</li>")}else{p("")}return }if(o.formatSearching&&this.findHighlightableChoices().length===0){p("<li class='select2-searching'>"+o.formatSearching()+"</li>")}AA.addClass("select2-active");this.removeHighlight();x=this.tokenize();if(x!=M&&x!=null){AA.val(x)}this.resultsPage=1;o.query({element:o.element,term:AA.val(),page:this.resultsPage,context:null,matcher:o.matcher,callback:this.bind(function(AC){var AB;if(y!=this.queryCount){return }if(!this.opened()){this.search.removeClass("select2-active");return }this.context=(AC.context===M)?null:AC.context;if(this.opts.createSearchChoice&&AA.val()!==""){AB=this.opts.createSearchChoice.call(z,AA.val(),AC.results);if(AB!==M&&AB!==null&&z.id(AB)!==M&&z.id(AB)!==null){if(d(AC.results).filter(function(){return T(z.id(this),z.id(AB))}).length===0){AC.results.unshift(AB)}}}if(AC.results.length===0&&Y(o.formatNoMatches,"formatNoMatches")){p("<li class='select2-no-results'>"+o.formatNoMatches(AA.val())+"</li>");return }u.empty();z.opts.populateResults.call(this,u,AC.results,{term:AA.val(),page:this.resultsPage,context:null});if(AC.more===true&&Y(o.formatLoadMore,"formatLoadMore")){u.append("<li class='select2-more-results'>"+z.opts.escapeMarkup(o.formatLoadMore(this.resultsPage))+"</li>");window.setTimeout(function(){z.loadMoreIfNeeded()},10)}this.postprocessResults(AC,w);v();this.opts.element.trigger({type:"select2-loaded",items:AC})})})},cancel:function(){this.close()},blur:function(){if(this.opts.selectOnBlur){this.selectHighlighted({noFocus:true})}this.close();this.container.removeClass("select2-container-active");if(this.search[0]===document.activeElement){this.search.blur()}this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){i(this.search)},selectHighlighted:function(p){var o=this.highlight(),q=this.results.find(".select2-highlighted"),r=q.closest(".select2-result").data("select2-data");if(r){this.highlight(o);this.onSelect(r,p)}else{if(p&&p.noFocus){this.close()}}},getPlaceholder:function(){var o;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((o=this.getPlaceholderOption())!==M?o.text():M)},getPlaceholderOption:function(){if(this.select){var o=this.select.children("option").first();if(this.opts.placeholderOption!==M){return(this.opts.placeholderOption==="first"&&o)||(typeof this.opts.placeholderOption==="function"&&this.opts.placeholderOption(this.select))}else{if(o.text()===""&&o.val()===""){return o}}}},initContainerWidth:function(){function p(){var u,s,v,t,r,q;if(this.opts.width==="off"){return null}else{if(this.opts.width==="element"){return this.opts.element.outerWidth(false)===0?"auto":this.opts.element.outerWidth(false)+"px"}else{if(this.opts.width==="copy"||this.opts.width==="resolve"){u=this.opts.element.attr("style");if(u!==M){s=u.split(";");for(t=0,r=s.length;t<r;t=t+1){q=s[t].replace(/\s/g,"");v=q.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);if(v!==null&&v.length>=1){return v[1]}}}if(this.opts.width==="resolve"){u=this.opts.element.css("width");if(u.indexOf("%")>0){return u}return(this.opts.element.outerWidth(false)===0?"auto":this.opts.element.outerWidth(false)+"px")}return null}else{if(d.isFunction(this.opts.width)){return this.opts.width()}else{return this.opts.width}}}}}var o=p.call(this);if(o!==null){this.container.css("width",o)}}});X=l(n,{createContainer:function(){var o=d(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow'><b></b></span>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return o},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.focusser.prop("disabled",!this.isInterfaceEnabled())}},opening:function(){var q,p,o;if(this.opts.minimumResultsForSearch>=0){this.showSearch(true)}this.parent.opening.apply(this,arguments);if(this.showSearchInput!==false){this.search.val(this.focusser.val())}this.search.focus();q=this.search.get(0);if(q.createTextRange){p=q.createTextRange();p.collapse(false);p.select()}else{if(q.setSelectionRange){o=this.search.val().length;q.setSelectionRange(o,o)}}if(this.search.val()===""){if(this.nextSearchTerm!=M){this.search.val(this.nextSearchTerm);this.search.select()}}this.focusser.prop("disabled",true).val("");this.updateResults(true);this.opts.element.trigger(d.Event("select2-open"))},close:function(o){if(!this.opened()){return }this.parent.close.apply(this,arguments);o=o||{focus:true};this.focusser.removeAttr("disabled");if(o.focus){this.focusser.focus()}},focus:function(){if(this.opened()){this.close()}else{this.focusser.removeAttr("disabled");this.focusser.focus()}},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments);this.focusser.removeAttr("disabled");this.focusser.focus()},destroy:function(){d("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments)},initContainer:function(){var p,o=this.container,q=this.dropdown;if(this.opts.minimumResultsForSearch<0){this.showSearch(false)}else{this.showSearch(true)}this.selection=p=o.find(".select2-choice");this.focusser=o.find(".select2-focusser");this.focusser.attr("id","s2id_autogen"+A());d("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id"));this.focusser.attr("tabindex",this.elementTabIndex);this.search.on("keydown",this.bind(function(r){if(!this.isInterfaceEnabled()){return }if(r.which===k.PAGE_UP||r.which===k.PAGE_DOWN){a(r);return }switch(r.which){case k.UP:case k.DOWN:this.moveHighlight((r.which===k.UP)?-1:1);a(r);return ;case k.ENTER:this.selectHighlighted();a(r);return ;case k.TAB:this.selectHighlighted({noFocus:true});return ;case k.ESC:this.cancel(r);a(r);return }}));this.search.on("blur",this.bind(function(r){if(document.activeElement===this.body().get(0)){window.setTimeout(this.bind(function(){this.search.focus()}),0)}}));this.focusser.on("keydown",this.bind(function(r){if(!this.isInterfaceEnabled()){return }if(r.which===k.TAB||k.isControl(r)||k.isFunctionKey(r)||r.which===k.ESC){return }if(this.opts.openOnEnter===false&&r.which===k.ENTER){a(r);return }if(r.which==k.DOWN||r.which==k.UP||(r.which==k.ENTER&&this.opts.openOnEnter)){if(r.altKey||r.ctrlKey||r.shiftKey||r.metaKey){return }this.open();a(r);return }if(r.which==k.DELETE||r.which==k.BACKSPACE){if(this.opts.allowClear){this.clear()}a(r);return }}));f(this.focusser);this.focusser.on("keyup-change input",this.bind(function(r){if(this.opts.minimumResultsForSearch>=0){r.stopPropagation();if(this.opened()){return }this.open()}}));p.on("mousedown","abbr",this.bind(function(r){if(!this.isInterfaceEnabled()){return }this.clear();B(r);this.close();this.selection.focus()}));p.on("mousedown",this.bind(function(r){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(d.Event("select2-focus"))}if(this.opened()){this.close()}else{if(this.isInterfaceEnabled()){this.open()}}a(r)}));q.on("mousedown",this.bind(function(){this.search.focus()}));p.on("focus",this.bind(function(r){a(r)}));this.focusser.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(d.Event("select2-focus"))}this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){if(!this.opened()){this.container.removeClass("select2-container-active");this.opts.element.trigger(d.Event("select2-blur"))}}));this.search.on("focus",this.bind(function(){if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(d.Event("select2-focus"))}this.container.addClass("select2-container-active")}));this.initContainerWidth();this.opts.element.addClass("select2-offscreen");this.setPlaceholder()},clear:function(q){var r=this.selection.data("select2-data");if(r){var p=d.Event("select2-clearing");this.opts.element.trigger(p);if(p.isDefaultPrevented()){return }var o=this.getPlaceholderOption();this.opts.element.val(o?o.val():"");this.selection.find(".select2-chosen").empty();this.selection.removeData("select2-data");this.setPlaceholder();if(q!==false){this.opts.element.trigger({type:"select2-removed",val:this.id(r),choice:r});this.triggerChange({removed:r})}}},initSelection:function(){var p;if(this.isPlaceholderOptionSelected()){this.updateSelection(null);this.close();this.setPlaceholder()}else{var o=this;this.opts.initSelection.call(null,this.opts.element,function(q){if(q!==M&&q!==null){o.updateSelection(q);o.close();o.setPlaceholder()}})}},isPlaceholderOptionSelected:function(){var o;if(!this.getPlaceholder()){return false}return((o=this.getPlaceholderOption())!==M&&o.prop("selected"))||(this.opts.element.val()==="")||(this.opts.element.val()===M)||(this.opts.element.val()===null)},prepareOpts:function(){var p=this.parent.prepareOpts.apply(this,arguments),o=this;if(p.element.get(0).tagName.toLowerCase()==="select"){p.initSelection=function(q,s){var r=q.find("option").filter(function(){return this.selected});s(o.optionToData(r))}}else{if("data" in p){p.initSelection=p.initSelection||function(r,t){var s=r.val();var q=null;p.query({matcher:function(u,x,v){var w=T(s,p.id(v));if(w){q=v}return w},callback:!d.isFunction(t)?d.noop:function(){t(q)}})}}}return p},getPlaceholder:function(){if(this.select){if(this.getPlaceholderOption()===M){return M}}return this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var o=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&o!==M){if(this.select&&this.getPlaceholderOption()===M){return }this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(o));this.selection.addClass("select2-default");this.container.removeClass("select2-allowclear")}},postprocessResults:function(t,p,s){var r=0,o=this,u=true;this.findHighlightableChoices().each2(function(v,w){if(T(o.id(w.data("select2-data")),o.opts.element.val())){r=v;return false}});if(s!==false){if(p===true&&r>=0){this.highlight(r)}else{this.highlight(0)}}if(p===true){var q=this.opts.minimumResultsForSearch;if(q>=0){this.showSearch(R(t.results)>=q)}}},showSearch:function(o){if(this.showSearchInput===o){return }this.showSearchInput=o;this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!o);this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!o);d(this.dropdown,this.container).toggleClass("select2-with-searchbox",o)},onSelect:function(q,p){if(!this.triggerSelect(q)){return }var o=this.opts.element.val(),r=this.data();this.opts.element.val(this.id(q));this.updateSelection(q);this.opts.element.trigger({type:"select2-selected",val:this.id(q),choice:q});this.nextSearchTerm=this.opts.nextSearchTerm(q,this.search.val());this.close();if(!p||!p.noFocus){this.focusser.focus()}if(!T(o,this.id(q))){this.triggerChange({added:q,removed:r})}},updateSelection:function(r){var p=this.selection.find(".select2-chosen"),q,o;this.selection.data("select2-data",r);p.empty();if(r!==null){q=this.opts.formatSelection(r,p,this.opts.escapeMarkup)}if(q!==M){p.append(q)}o=this.opts.formatSelectionCssClass(r,p);if(o!==M){p.addClass(o)}this.selection.removeClass("select2-default");if(this.opts.allowClear&&this.getPlaceholder()!==M){this.container.addClass("select2-allowclear")}},val:function(){var s,p=false,q=null,o=this,r=this.data();if(arguments.length===0){return this.opts.element.val()}s=arguments[0];if(arguments.length>1){p=arguments[1]}if(this.select){this.select.val(s).find("option").filter(function(){return this.selected}).each2(function(t,u){q=o.optionToData(u);return false});this.updateSelection(q);this.setPlaceholder();if(p){this.triggerChange({added:q,removed:r})}}else{if(!s&&s!==0){this.clear(p);return }if(this.opts.initSelection===M){throw new Error("cannot call val() if initSelection() is not defined")}this.opts.element.val(s);this.opts.initSelection(this.opts.element,function(t){o.opts.element.val(!t?"":o.id(t));o.updateSelection(t);o.setPlaceholder();if(p){o.triggerChange({added:t,removed:r})}})}},clearSearch:function(){this.search.val("");this.focusser.val("")},data:function(q){var p,o=false;if(arguments.length===0){p=this.selection.data("select2-data");if(p==M){p=null}return p}else{if(arguments.length>1){o=arguments[1]}if(!q){this.clear(o)}else{p=this.data();this.opts.element.val(!q?"":this.id(q));this.updateSelection(q);if(o){this.triggerChange({added:q,removed:p})}}}}});C=l(n,{createContainer:function(){var o=d(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return o},prepareOpts:function(){var p=this.parent.prepareOpts.apply(this,arguments),o=this;if(p.element.get(0).tagName.toLowerCase()==="select"){p.initSelection=function(q,s){var r=[];q.find("option").filter(function(){return this.selected}).each2(function(t,u){r.push(o.optionToData(u))});s(r)}}else{if("data" in p){p.initSelection=p.initSelection||function(q,t){var r=I(q.val(),p.separator);var s=[];p.query({matcher:function(u,x,v){var w=d.grep(r,function(y){return T(y,p.id(v))}).length;if(w){s.push(v)}return w},callback:!d.isFunction(t)?d.noop:function(){var u=[];for(var x=0;x<r.length;x++){var y=r[x];for(var w=0;w<s.length;w++){var v=s[w];if(T(y,p.id(v))){u.push(v);s.splice(w,1);break}}}t(u)}})}}}return p},selectChoice:function(o){var p=this.container.find(".select2-search-choice-focus");if(p.length&&o&&o[0]==p[0]){}else{if(p.length){this.opts.element.trigger("choice-deselected",p)}p.removeClass("select2-search-choice-focus");if(o&&o.length){this.close();o.addClass("select2-search-choice-focus");this.opts.element.trigger("choice-selected",o)}}},destroy:function(){d("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments)},initContainer:function(){var o=".select2-choices",p;this.searchContainer=this.container.find(".select2-search-field");this.selection=p=this.container.find(o);var q=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(r){q.search[0].focus();q.selectChoice(d(this))});this.search.attr("id","s2id_autogen"+A());d("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.search.attr("id"));this.search.on("input paste",this.bind(function(){if(!this.isInterfaceEnabled()){return }if(!this.opened()){this.open()}}));this.search.attr("tabindex",this.elementTabIndex);this.keydowns=0;this.search.on("keydown",this.bind(function(v){if(!this.isInterfaceEnabled()){return }++this.keydowns;var t=p.find(".select2-search-choice-focus");var u=t.prev(".select2-search-choice:not(.select2-locked)");var s=t.next(".select2-search-choice:not(.select2-locked)");var w=F(this.search);if(t.length&&(v.which==k.LEFT||v.which==k.RIGHT||v.which==k.BACKSPACE||v.which==k.DELETE||v.which==k.ENTER)){var r=t;if(v.which==k.LEFT&&u.length){r=u}else{if(v.which==k.RIGHT){r=s.length?s:null}else{if(v.which===k.BACKSPACE){this.unselect(t.first());this.search.width(10);r=u.length?u:s}else{if(v.which==k.DELETE){this.unselect(t.first());this.search.width(10);r=s.length?s:null}else{if(v.which==k.ENTER){r=null}}}}}this.selectChoice(r);a(v);if(!r||!r.length){this.open()}return }else{if(((v.which===k.BACKSPACE&&this.keydowns==1)||v.which==k.LEFT)&&(w.offset==0&&!w.length)){this.selectChoice(p.find(".select2-search-choice:not(.select2-locked)").last());a(v);return }else{this.selectChoice(null)}}if(this.opened()){switch(v.which){case k.UP:case k.DOWN:this.moveHighlight((v.which===k.UP)?-1:1);a(v);return ;case k.ENTER:this.selectHighlighted();a(v);return ;case k.TAB:this.selectHighlighted({noFocus:true});this.close();return ;case k.ESC:this.cancel(v);a(v);return }}if(v.which===k.TAB||k.isControl(v)||k.isFunctionKey(v)||v.which===k.BACKSPACE||v.which===k.ESC){return }if(v.which===k.ENTER){if(this.opts.openOnEnter===false){return }else{if(v.altKey||v.ctrlKey||v.shiftKey||v.metaKey){return }}}this.open();if(v.which===k.PAGE_UP||v.which===k.PAGE_DOWN){a(v)}if(v.which===k.ENTER){a(v)}}));this.search.on("keyup",this.bind(function(r){this.keydowns=0;this.resizeSearch()}));this.search.on("blur",this.bind(function(r){this.container.removeClass("select2-container-active");this.search.removeClass("select2-focused");this.selectChoice(null);if(!this.opened()){this.clearSearch()}r.stopImmediatePropagation();this.opts.element.trigger(d.Event("select2-blur"))}));this.container.on("click",o,this.bind(function(r){if(!this.isInterfaceEnabled()){return }if(d(r.target).closest(".select2-search-choice").length>0){return }this.selectChoice(null);this.clearPlaceholder();if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(d.Event("select2-focus"))}this.open();this.focusSearch();r.preventDefault()}));this.container.on("focus",o,this.bind(function(){if(!this.isInterfaceEnabled()){return }if(!this.container.hasClass("select2-container-active")){this.opts.element.trigger(d.Event("select2-focus"))}this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active");this.clearPlaceholder()}));this.initContainerWidth();this.opts.element.addClass("select2-offscreen");this.clearSearch()},enableInterface:function(){if(this.parent.enableInterface.apply(this,arguments)){this.search.prop("disabled",!this.isInterfaceEnabled())}},initSelection:function(){var p;if(this.opts.element.val()===""&&this.opts.element.text()===""){this.updateSelection([]);this.close();this.clearSearch()}if(this.select||this.opts.element.val()!==""){var o=this;this.opts.initSelection.call(null,this.opts.element,function(q){if(q!==M&&q!==null){o.updateSelection(q);o.close();o.clearSearch()}})}},clearSearch:function(){var p=this.getPlaceholder(),o=this.getMaxSearchWidth();if(p!==M&&this.getVal().length===0&&this.search.hasClass("select2-focused")===false){this.search.val(p).addClass("select2-default");this.search.width(o>0?o:this.container.css("width"))}else{this.search.val("").width(10)}},clearPlaceholder:function(){if(this.search.hasClass("select2-default")){this.search.val("").removeClass("select2-default")}},opening:function(){this.clearPlaceholder();this.resizeSearch();this.parent.opening.apply(this,arguments);this.focusSearch();this.updateResults(true);this.search.focus();this.opts.element.trigger(d.Event("select2-open"))},close:function(){if(!this.opened()){return }this.parent.close.apply(this,arguments)},focus:function(){this.close();this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(r){var q=[],p=[],o=this;d(r).each(function(){if(Q(o.id(this),q)<0){q.push(o.id(this));p.push(this)}});r=p;this.selection.find(".select2-search-choice").remove();d(r).each(function(){o.addSelectedChoice(this)});o.postprocessResults()},tokenize:function(){var o=this.search.val();o=this.opts.tokenizer.call(this,o,this.data(),this.bind(this.onSelect),this.opts);if(o!=null&&o!=M){this.search.val(o);if(o.length>0){this.open()}}},onSelect:function(p,o){if(!this.triggerSelect(p)){return }this.addSelectedChoice(p);this.opts.element.trigger({type:"selected",val:this.id(p),choice:p});if(this.select||!this.opts.closeOnSelect){this.postprocessResults(p,false,this.opts.closeOnSelect===true)}if(this.opts.closeOnSelect){this.close();this.search.width(10)}else{if(this.countSelectableResults()>0){this.search.width(10);this.resizeSearch();if(this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()){this.updateResults(true)}this.positionDropdown()}else{this.close();this.search.width(10)}}this.triggerChange({added:p});if(!o||!o.noFocus){this.focusSearch()}},cancel:function(){this.close();this.focusSearch()},addSelectedChoice:function(s){var u=!s.locked,q=d("<li class='select2-search-choice'> <div></div> <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),v=d("<li class='select2-search-choice select2-locked'><div></div></li>");var r=u?q:v,o=this.id(s),p=this.getVal(),t,w;t=this.opts.formatSelection(s,r.find("div"),this.opts.escapeMarkup);if(t!=M){r.find("div").replaceWith("<div>"+t+"</div>")}w=this.opts.formatSelectionCssClass(s,r.find("div"));if(w!=M){r.addClass(w)}if(u){r.find(".select2-search-choice-close").on("mousedown",a).on("click dblclick",this.bind(function(x){if(!this.isInterfaceEnabled()){return }d(x.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(d(x.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");this.close();this.focusSearch()})).dequeue();a(x)})).on("focus",this.bind(function(){if(!this.isInterfaceEnabled()){return }this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active")}))}r.data("select2-data",s);r.insertBefore(this.searchContainer);p.push(o);this.setVal(p)},unselect:function(q){var s=this.getVal(),r,p;q=q.closest(".select2-search-choice");if(q.length===0){throw"Invalid argument: "+q+". Must be .select2-search-choice"}r=q.data("select2-data");if(!r){return }while((p=Q(this.id(r),s))>=0){s.splice(p,1);this.setVal(s);if(this.select){this.postprocessResults()}}var o=d.Event("select2-removing");o.val=this.id(r);o.choice=r;this.opts.element.trigger(o);if(o.isDefaultPrevented()){return }q.remove();this.opts.element.trigger({type:"select2-removed",val:this.id(r),choice:r});this.triggerChange({removed:r})},postprocessResults:function(s,p,r){var t=this.getVal(),u=this.results.find(".select2-result"),q=this.results.find(".select2-result-with-children"),o=this;u.each2(function(w,v){var x=o.id(v.data("select2-data"));if(Q(x,t)>=0){v.addClass("select2-selected");v.find(".select2-result-selectable").addClass("select2-selected")}});q.each2(function(w,v){if(!v.is(".select2-result-selectable")&&v.find(".select2-result-selectable:not(.select2-selected)").length===0){v.addClass("select2-selected")}});if(this.highlight()==-1&&r!==false){o.highlight(0)}if(!this.opts.createSearchChoice&&!u.filter(".select2-result:not(.select2-selected)").length>0){if(!s||s&&!s.more&&this.results.find(".select2-no-results").length===0){if(Y(o.opts.formatNoMatches,"formatNoMatches")){this.results.append("<li class='select2-no-results'>"+o.opts.formatNoMatches(o.search.val())+"</li>")}}}},getMaxSearchWidth:function(){return this.selection.width()-H(this.search)},resizeSearch:function(){var t,r,q,o,p,s=H(this.search);t=N(this.search)+10;r=this.search.offset().left;q=this.selection.width();o=this.selection.offset().left;p=q-(r-o)-s;if(p<t){p=q-s}if(p<40){p=q-s}if(p<=0){p=t}this.search.width(Math.floor(p))},getVal:function(){var o;if(this.select){o=this.select.val();return o===null?[]:o}else{o=this.opts.element.val();return I(o,this.opts.separator)}},setVal:function(p){var o;if(this.select){this.select.val(p)}else{o=[];d(p).each(function(){if(Q(this,o)<0){o.push(this)}});this.opts.element.val(o.length===0?"":o.join(this.opts.separator))}},buildChangeDetails:function(o,r){var r=r.slice(0),o=o.slice(0);for(var q=0;q<r.length;q++){for(var p=0;p<o.length;p++){if(T(this.opts.id(r[q]),this.opts.id(o[p]))){r.splice(q,1);if(q>0){q--}o.splice(p,1);p--}}}return{added:r,removed:o}},val:function(r,p){var q,o=this;if(arguments.length===0){return this.getVal()}q=this.data();if(!q.length){q=[]}if(!r&&r!==0){this.opts.element.val("");this.updateSelection([]);this.clearSearch();if(p){this.triggerChange({added:this.data(),removed:q})}return }this.setVal(r);if(this.select){this.opts.initSelection(this.select,this.bind(this.updateSelection));if(p){this.triggerChange(this.buildChangeDetails(q,this.data()))}}else{if(this.opts.initSelection===M){throw new Error("val() cannot be called if initSelection() is not defined")}this.opts.initSelection(this.opts.element,function(t){var s=d.map(t,o.id);o.setVal(s);o.updateSelection(t);o.clearSearch();if(p){o.triggerChange(o.buildChangeDetails(q,o.data()))}})}this.clearSearch()},onSortStart:function(){if(this.select){throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.")}this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var p=[],o=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();this.selection.find(".select2-search-choice").each(function(){p.push(o.opts.id(d(this).data("select2-data")))});this.setVal(p);this.triggerChange()},data:function(q,r){var p=this,s,o;if(arguments.length===0){return this.selection.find(".select2-search-choice").map(function(){return d(this).data("select2-data")}).get()}else{o=this.data();if(!q){q=[]}s=d.map(q,function(t){return p.opts.id(t)});this.setVal(s);this.updateSelection(q);this.clearSearch();if(r){this.triggerChange(this.buildChangeDetails(o,this.data()))}}}});d.fn.select2=function(){var t=Array.prototype.slice.call(arguments,0),p,s,o,v,x,w=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],u=["opened","isFocused","container","dropdown"],q=["val","data"],r={search:"externalSearch"};this.each(function(){if(t.length===0||typeof (t[0])==="object"){p=t.length===0?{}:d.extend({},t[0]);p.element=d(this);if(p.element.get(0).tagName.toLowerCase()==="select"){x=p.element.prop("multiple")}else{x=p.multiple||false;if("tags" in p){p.multiple=x=true}}s=x?new C():new X();s.init(p)}else{if(typeof (t[0])==="string"){if(Q(t[0],w)<0){throw"Unknown method: "+t[0]}v=M;s=d(this).data("select2");if(s===M){return }o=t[0];if(o==="container"){v=s.container}else{if(o==="dropdown"){v=s.dropdown}else{if(r[o]){o=r[o]}v=s[o].apply(s,t.slice(1))}}if(Q(t[0],u)>=0||(Q(t[0],q)&&t.length==1)){return false}}else{throw"Invalid arguments to select2 plugin: "+t}}});return(v===M)?this:v};d.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:true,openOnEnter:true,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(p,q,s,o){var r=[];U(p.text,s.term,r,o);return r.join("")},formatSelection:function(q,p,o){return q?o(q.text):M},sortResults:function(p,o,q){return p},formatResultCssClass:function(o){return M},formatSelectionCssClass:function(p,o){return M},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(o,p){var q=p-o.length;return"Please enter "+q+" more character"+(q==1?"":"s")},formatInputTooLong:function(p,o){var q=p.length-o;return"Please delete "+q+" character"+(q==1?"":"s")},formatSelectionTooBig:function(o){return"You can only select "+o+" item"+(o==1?"":"s")},formatLoadMore:function(o){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(o){return o.id},matcher:function(o,p){return E(""+p).toUpperCase().indexOf(E(""+o).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:G,escapeMarkup:g,blurOnChange:false,selectOnBlur:false,adaptContainerCssClass:function(o){return o},adaptDropdownCssClass:function(o){return null},nextSearchTerm:function(o,p){return M}};d.fn.select2.ajaxDefaults={transport:d.ajax,params:{type:"GET",cache:false,dataType:"json"}};window.Select2={query:{ajax:e,local:h,tags:Z},util:{debounce:K,markMatch:U,escapeMarkup:g,stripDiacritics:E},"class":{"abstract":n,single:X,multi:C}}}(jQuery));; ;/* module-key = 'com.atlassian.auiplugin:aui-select2', location = 'js/aui-select2.js' */ (function(C){var E=C.fn.select2;var D="aui-select2-container";var B="aui-select2-drop aui-dropdown2 aui-style-default";var A="aui-has-avatar";C.fn.auiSelect2=function(I){var H;if(C.isPlainObject(I)){var F=C.extend({},I);var G=F.hasAvatar?" "+A:"";F.containerCssClass=D+G+(F.containerCssClass?" "+F.containerCssClass:"");F.dropdownCssClass=B+G+(F.dropdownCssClass?" "+F.dropdownCssClass:"");H=Array.prototype.slice.call(arguments,1);H.unshift(F)}else{if(!arguments.length){H=[{containerCssClass:D,dropdownCssClass:B}]}else{H=arguments}}return E.apply(this,H)}})(AJS.$);; ;/* module-key = 'com.atlassian.auiplugin:aui-date-picker', location = 'js-vendor/jquery/jquery-ui/jquery.ui.datepicker.js' */ /* * jQuery UI Datepicker 1.8.24 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker * * Depends: * jquery.ui.core.js */ (function($,undefined){$.extend($.ui,{datepicker:{version:"1.8.24"}});var PROP_NAME="datepicker";var dpuuid=new Date().getTime();var instActive;function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){if(this.debug){console.log.apply("",arguments)}},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){this.uuid+=1;target.id="dp"+this.uuid}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return }this._attachments(input,inst);input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});this._autoSize(inst);$.data(target,PROP_NAME,inst);if(inst.settings.disabled){this._disableDatepicker(target)}},_attachments:function(input,inst){var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(inst.append){inst.append.remove()}if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}input.unbind("focus",this._showDatepicker);if(inst.trigger){inst.trigger.remove()}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==input[0]){$.datepicker._hideDatepicker()}else{if($.datepicker._datepickerShowing&&$.datepicker._lastInput!=input[0]){$.datepicker._hideDatepicker();$.datepicker._showDatepicker(input[0])}else{$.datepicker._showDatepicker(input[0])}}return false})}},_autoSize:function(inst){if(this._get(inst,"autoSize")&&!inst.inline){var date=new Date(2009,12-1,20);var dateFormat=this._get(inst,"dateFormat");if(dateFormat.match(/[DM]/)){var findMax=function(names){var max=0;var maxI=0;for(var i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i}}return maxI};date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?"monthNames":"monthNamesShort"))));date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?"dayNames":"dayNamesShort")))+20-date.getDay())}inst.input.attr("size",this._formatDate(inst,date).length)}},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return }divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst),true);this._updateDatepicker(inst);this._updateAlternate(inst);if(inst.settings.disabled){this._disableDatepicker(target)}inst.dpDiv.css("display","block")},_dialogDatepicker:function(input,date,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){this.uuid+=1;var id="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+id+'" style="position: absolute; top: -100px; width: 0px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});date=(date&&date.constructor==Date?this._formatDate(inst,date):date);this._dialogInput.val(date);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=document.documentElement.clientWidth;var browserHeight=document.documentElement.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return }var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return }var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return }var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker()}var date=this._getDateDatepicker(target,true);var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");extendRemove(inst.settings,settings);if(minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){inst.settings.minDate=this._formatDate(inst,minDate)}if(maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){inst.settings.maxDate=this._formatDate(inst,maxDate)}this._attachments($(target),inst);this._autoSize(inst);this._setDate(inst,date);this._updateAlternate(inst);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date){var inst=this._getInst(target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst,noDefault)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:var sel=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}var onSelect=$.datepicker._get(inst,"onSelect");if(onSelect){var dateStr=$.datepicker._formatDate(inst);onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{$.datepicker._hideDatepicker()}return false;break;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||event.metaKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_doKeyUp:function(event){var inst=$.datepicker._getInst(event.target);if(inst.input.val()!=inst.lastVal){try{var date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),(inst.input?inst.input.val():null),$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst)}}catch(err){$.datepicker.log(err)}}return true},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return }var inst=$.datepicker._getInst(input);if($.datepicker._curInst&&$.datepicker._curInst!=inst){$.datepicker._curInst.dpDiv.stop(true,true);if(inst&&$.datepicker._datepickerShowing){$.datepicker._hideDatepicker($.datepicker._curInst.input[0])}}var beforeShow=$.datepicker._get(inst,"beforeShow");var beforeShowSettings=beforeShow?beforeShow.apply(input,[input,inst]):{};if(beforeShowSettings===false){return }extendRemove(inst.settings,beforeShowSettings);inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.dpDiv.empty();inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim");var duration=$.datepicker._get(inst,"duration");var postProcess=function(){var cover=inst.dpDiv.find("iframe.ui-datepicker-cover");if(!!cover.length){var borders=$.datepicker._getBorders(inst.dpDiv);cover.css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()})}};inst.dpDiv.zIndex($(input).zIndex()+1);$.datepicker._datepickerShowing=true;if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim||"show"]((showAnim?duration:null),postProcess)}if(!showAnim||!duration){postProcess()}if(inst.input.is(":visible")&&!inst.input.is(":disabled")){inst.input.focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var self=this;self.maxRows=4;var borders=$.datepicker._getBorders(inst.dpDiv);instActive=inst;inst.dpDiv.empty().append(this._generateHTML(inst));this._attachHandlers(inst);var cover=inst.dpDiv.find("iframe.ui-datepicker-cover");if(!!cover.length){cover.css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()})}inst.dpDiv.find("."+this._dayOverClass+" a").mouseover();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst==$.datepicker._curInst&&$.datepicker._datepickerShowing&&inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&inst.input[0]!=document.activeElement){inst.input.focus()}if(inst.yearshtml){var origyearshtml=inst.yearshtml;setTimeout(function(){if(origyearshtml===inst.yearshtml&&inst.yearshtml){inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml)}origyearshtml=inst.yearshtml=null},0)}},_getBorders:function(elem){var convert=function(value){return{thin:1,medium:2,thick:3}[value]||value};return[parseFloat(convert(elem.css("border-left-width"))),parseFloat(convert(elem.css("border-top-width")))]},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=document.documentElement.clientWidth+(isFixed?0:$(document).scrollLeft());var viewHeight=document.documentElement.clientHeight+(isFixed?0:$(document).scrollTop());offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight):0);return offset},_findPos:function(obj){var inst=this._getInst(obj);var isRTL=this._get(inst,"isRTL");while(obj&&(obj.type=="hidden"||obj.nodeType!=1||$.expr.filters.hidden(obj))){obj=obj[isRTL?"previousSibling":"nextSibling"]}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return }if(this._datepickerShowing){var showAnim=this._get(inst,"showAnim");var duration=this._get(inst,"duration");var postProcess=function(){$.datepicker._tidyDialog(inst)};if($.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide"))]((showAnim?duration:null),postProcess)}if(!showAnim){postProcess()}this._datepickerShowing=false;var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return }var $target=$(event.target),inst=$.datepicker._getInst($target[0]);if((($target[0].id!=$.datepicker._mainDivId&&$target.parents("#"+$.datepicker._mainDivId).length==0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)))||($target.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=inst)){$.datepicker._hideDatepicker()}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return }this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return }var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{this._hideDatepicker();this._lastInput=inst.input[0];if(typeof (inst.input[0])!="object"){inst.input.focus()}this._lastInput=null}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);var dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));var time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){var isDoubled=lookAhead(match);var size=(match=="@"?14:(match=="!"?20:(match=="y"&&isDoubled?4:(match=="o"?3:2))));var digits=new RegExp("^\\d{1,"+size+"}");var num=value.substring(iValue).match(digits);if(!num){throw"Missing number at position "+iValue}iValue+=num[0].length;return parseInt(num[0],10)};var getName=function(match,shortNames,longNames){var names=$.map(lookAhead(match)?longNames:shortNames,function(v,k){return[[k,v]]}).sort(function(a,b){return -(a[1].length-b[1].length)});var index=-1;$.each(names,function(i,pair){var name=pair[1];if(value.substr(iValue,name.length).toLowerCase()==name.toLowerCase()){index=pair[0];iValue+=name.length;return false}});if(index!=-1){return index+1}else{throw"Unknown name at position "+iValue}};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"!":var date=new Date((getNumber("!")-this._ticksTo1970)/10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(iValue<value.length){throw"Extra/unparsed characters found in date: "+value.substring(iValue)}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"!":output+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst,noDefault){if(inst.input.val()==inst.lastVal){return }var dateFormat=this._get(inst,"dateFormat");var dates=inst.lastVal=inst.input?inst.input.val():null;var date,defaultDate;date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);dates=(noDefault?"":dates)}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),new Date()))},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst))}catch(e){}var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};var newDate=(date==null||date===""?defaultDate:(typeof date=="string"?offsetString(date):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):new Date(date.getTime()))));newDate=(newDate&&newDate.toString()=="Invalid Date"?defaultDate:newDate);if(newDate){newDate.setHours(0);newDate.setMinutes(0);newDate.setSeconds(0);newDate.setMilliseconds(0)}return this._daylightSavingAdjust(newDate)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,noChange){var clear=!date;var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;var newDate=this._restrictMinMax(inst,this._determineDate(inst,date,new Date()));inst.selectedDay=inst.currentDay=newDate.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear();if((origMonth!=inst.selectedMonth||origYear!=inst.selectedYear)&&!noChange){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_attachHandlers:function(inst){var stepMonths=this._get(inst,"stepMonths");var id="#"+inst.id.replace(/\\\\/g,"\\");inst.dpDiv.find("[data-handler]").map(function(){var handler={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(id,-stepMonths,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(id,+stepMonths,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(id)},selectDay:function(){window["DP_jQuery_"+dpuuid].datepicker._selectDay(id,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false},selectMonth:function(){window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(id,this,"M");return false},selectYear:function(){window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(id,this,"Y");return false}};$(this).bind(this.getAttribute("data-event"),handler[this.getAttribute("data-handler")])})},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var showWeek=this._get(inst,"showWeek");var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var selectOtherMonths=this._get(inst,"selectOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";this.maxRows=4;for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group';if(numMonths[1]>1){switch(col){case 0:calender+=" ui-datepicker-group-first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+=" ui-datepicker-group-last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle";cornerClass="";break}}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead=(showWeek?'<th class="ui-datepicker-week-col">'+this._get(inst,"weekHeader")+"</th>":"");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var curRows=Math.ceil((leadDays+daysInMonth)/7);var numRows=(isMultiMonth?this.maxRows>curRows?this.maxRows:curRows:curRows);this.maxRows=numRows;var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody=(!showWeek?"":'<td class="ui-datepicker-week-col">'+this._get(inst,"calculateWeek")(printDate)+"</td>");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()==currentDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":' data-handler="selectDay" data-event="click" data-month="'+printDate.getMonth()+'" data-year="'+printDate.getFullYear()+'"')+">"+(otherMonth&&!showOtherMonths?" ":(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()==currentDate.getTime()?" ui-state-active":"")+(otherMonth?" ui-priority-secondary":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span>"}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+(secondary||!(changeMonth&&changeYear)?" ":"")}if(!inst.yearshtml){inst.yearshtml="";if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var thisYear=new Date().getFullYear();var determineYear=function(value){var year=(value.match(/c[+-].*/)?drawYear+parseInt(value.substring(1),10):(value.match(/[+-].*/)?thisYear+parseInt(value,10):parseInt(value,10)));return(isNaN(year)?thisYear:year)};var year=determineYear(years[0]);var endYear=Math.max(year,determineYear(years[1]||""));year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);inst.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;year<=endYear;year++){inst.yearshtml+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}inst.yearshtml+="</select>";html+=inst.yearshtml;inst.yearshtml=null}}html+=this._get(inst,"yearSuffix");if(showMonthAfterYear){html+=(secondary||!(changeMonth&&changeYear)?" ":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");var newDate=(minDate&&date<minDate?minDate:date);newDate=(maxDate&&newDate>maxDate?maxDate:newDate);return newDate},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null)},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime()))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.bind("mouseout",function(event){var elem=$(event.target).closest(selector);if(!elem.length){return }elem.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(event){var elem=$(event.target).closest(selector);if($.datepicker._isDisabledDatepicker(instActive.inline?dpDiv.parent()[0]:instActive.input[0])||!elem.length){return }elem.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");elem.addClass("ui-state-hover");if(elem.hasClass("ui-datepicker-prev")){elem.addClass("ui-datepicker-prev-hover")}if(elem.hasClass("ui-datepicker-next")){elem.addClass("ui-datepicker-next-hover")}})}function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!this.length){return this}if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate"||options=="widget")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.8.24";window["DP_jQuery_"+dpuuid]=$})(jQuery);; ;/* module-key = 'com.atlassian.auiplugin:aui-date-picker', location = 'js/aui-date-picker.js' */ (function(A){var B=0;AJS.DatePicker=function(I,E){var H,D,F,G;var C;H={};G=B++;F=A(I);F.attr("data-aui-dp-uuid",G);E=A.extend(undefined,AJS.DatePicker.prototype.defaultOptions,E);H.getField=function(){return F};H.getOptions=function(){return E};D=function(){var P,M,U,Q,T,S,V,R,J,L;H.hide=function(){J.hide()};H.show=function(){J.show()};H.setDate=function(X){if(typeof P!=="undefined"){P.datepicker("setDate",X)}};H.getDate=function(X){if(typeof P!=="undefined"){return P.datepicker("getDate")}};S=function(Y){L.off();if(E.hint){var Z=A("<div/>").addClass("aui-datepicker-hint");Z.append("<span/>").text(E.hint);L.append(Z)}P=A("<div/>");P.attr("data-aui-dp-popup-uuid",G);L.append(P);var X={dateFormat:E.dateFormat,defaultDate:F.val(),maxDate:F.attr("max"),minDate:F.attr("min"),nextText:">",onSelect:function(b,a){F.val(b);F.change();H.hide();V=true;F.focus();E.onSelect&&E.onSelect.call(this,b)},onChangeMonthYear:function(){setTimeout(J.refresh,0)},prevText:"<"};A.extend(X,Y);if(E.firstDay>-1){X.firstDay=E.firstDay}if(typeof F.attr("step")!=="undefined"){AJS.log("WARNING: The AJS date picker polyfill currently does not support the step attribute!")}P.datepicker(X);A("body").on("keydown",M);F.on("focusout keydown",U);F.on("propertychange keyup input paste",T)};M=function(Z){var X=A(Z.target);var a=X.closest(L).length||X.is(F);var Y=X.closest(".ui-datepicker-header").length;if((!a&&!Y)||Z.keyCode===AJS.keyCode.ESCAPE){H.hide();return }if(X[0]!==F[0]){Z.preventDefault()}};U=function(X){if(!(R)){A("body").on("focus blur click mousedown","*",M);R=true}};Q=function(X){if(!(V)){H.show()}else{V=false}};T=function(X){var Y=A(this).val();if(Y){P.datepicker("setDate",F.val());P.datepicker("option",{maxDate:F.attr("max"),minDate:F.attr("min")})}};H.destroyPolyfill=function(){H.hide();F.attr("placeholder",null);F.off("propertychange keyup input paste",T);F.off("focus click",Q);F.off("focusout keydown",U);A("body").off("keydown",U);if(AJS.DatePicker.prototype.browserSupportsDateField){F[0].type="date"}if(typeof P!=="undefined"){P.datepicker("destroy")}delete H.destroyPolyfill;delete H.show;delete H.hide};V=false;R=false;if(!(E.languageCode in AJS.DatePicker.prototype.localisations)){E.languageCode=""}var O=AJS.DatePicker.prototype.localisations[E.languageCode];var W="";var K=240;if(O.size==="large"){K=325;W="aui-datepicker-dialog-large"}var N={hideCallback:function(){A("body").off("focus blur click mousedown","*",M);R=false;if(C&&C._datePickerPopup){delete C._datePickerPopup}},hideDelay:null,noBind:true,persistent:true,closeOthers:false,width:K};if(E.position){N.calculatePositions=function(X,Z){var Y=A(X[0]);return E.position.call(this,Y,Z)}}J=AJS.InlineDialog(F,undefined,function(Y,X,Z){if(typeof P==="undefined"){L=Y;S(O)}C=A(X).closest(".aui-inline-dialog").get(0);if(C){C._datePickerPopup=J}Z()},N);J.addClass("aui-datepicker-dialog");J.addClass(W);F.on("focus click",Q);F.attr("placeholder",E.dateFormat);if(E.overrideBrowserDefault&&AJS.DatePicker.prototype.browserSupportsDateField){F[0].type="text"}};H.reset=function(){if(typeof H.destroyPolyfill==="function"){H.destroyPolyfill()}if((!(AJS.DatePicker.prototype.browserSupportsDateField))||E.overrideBrowserDefault){D()}};H.reset();return H};AJS.DatePicker.prototype.browserSupportsDateField=(A('<input type="date" />')[0].type==="date");AJS.DatePicker.prototype.defaultOptions={overrideBrowserDefault:false,firstDay:-1,languageCode:AJS.$("html").attr("lang")||"en-AU",dateFormat:A.datepicker.W3C};AJS.DatePicker.prototype.localisations={"":{dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesMin:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDay:0,isRTL:false,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],showMonthAfterYear:false,yearSuffix:""},af:{dayNames:["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"],dayNamesMin:["Son","Maa","Din","Woe","Don","Vry","Sat"],firstDay:1,isRTL:false,monthNames:["Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober","November","Desember"],showMonthAfterYear:false,yearSuffix:""},"ar-DZ":{dayNames:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],dayNamesMin:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],firstDay:6,isRTL:true,monthNames:["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],showMonthAfterYear:false,yearSuffix:""},ar:{dayNames:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],dayNamesMin:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],firstDay:6,isRTL:true,monthNames:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],showMonthAfterYear:false,yearSuffix:""},az:{dayNames:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"],dayNamesMin:["B","Be","Ça","Ç","Ca","C","Ş"],firstDay:1,isRTL:false,monthNames:["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],showMonthAfterYear:false,yearSuffix:""},bg:{dayNames:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота"],dayNamesMin:["Нед","Пон","Вто","Сря","Чет","Пет","Съб"],firstDay:1,isRTL:false,monthNames:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],showMonthAfterYear:false,yearSuffix:""},bs:{dayNames:["Nedelja","Ponedeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],dayNamesMin:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],firstDay:1,isRTL:false,monthNames:["Januar","Februar","Mart","April","Maj","Juni","Juli","August","Septembar","Oktobar","Novembar","Decembar"],showMonthAfterYear:false,yearSuffix:""},ca:{dayNames:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"],dayNamesMin:["Dug","Dln","Dmt","Dmc","Djs","Dvn","Dsb"],firstDay:1,isRTL:false,monthNames:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],showMonthAfterYear:false,yearSuffix:""},cs:{dayNames:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],dayNamesMin:["ne","po","út","st","čt","pá","so"],firstDay:1,isRTL:false,monthNames:["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],showMonthAfterYear:false,yearSuffix:""},da:{dayNames:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],dayNamesMin:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],firstDay:1,isRTL:false,monthNames:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],showMonthAfterYear:false,yearSuffix:""},de:{dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesMin:["So","Mo","Di","Mi","Do","Fr","Sa"],firstDay:1,isRTL:false,monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],showMonthAfterYear:false,yearSuffix:""},el:{dayNames:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],dayNamesMin:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],firstDay:1,isRTL:false,monthNames:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],showMonthAfterYear:false,yearSuffix:""},"en-AU":{dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesMin:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDay:1,isRTL:false,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],showMonthAfterYear:false,yearSuffix:""},"en-GB":{dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesMin:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDay:1,isRTL:false,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],showMonthAfterYear:false,yearSuffix:""},"en-NZ":{dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesMin:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDay:1,isRTL:false,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],showMonthAfterYear:false,yearSuffix:""},eo:{dayNames:["Dimanĉo","Lundo","Mardo","Merkredo","Ĵaŭdo","Vendredo","Sabato"],dayNamesMin:["Dim","Lun","Mar","Mer","Ĵaŭ","Ven","Sab"],firstDay:0,isRTL:false,monthNames:["Januaro","Februaro","Marto","Aprilo","Majo","Junio","Julio","Aŭgusto","Septembro","Oktobro","Novembro","Decembro"],showMonthAfterYear:false,yearSuffix:""},es:{dayNames:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],dayNamesMin:["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],firstDay:1,isRTL:false,monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],showMonthAfterYear:false,yearSuffix:""},et:{dayNames:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev"],dayNamesMin:["Pühap","Esmasp","Teisip","Kolmap","Neljap","Reede","Laup"],firstDay:1,isRTL:false,monthNames:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],showMonthAfterYear:false,yearSuffix:"",size:"large"},eu:{dayNames:["Igandea","Astelehena","Asteartea","Asteazkena","Osteguna","Ostirala","Larunbata"],dayNamesMin:["Iga","Ast","Ast","Ast","Ost","Ost","Lar"],firstDay:1,isRTL:false,monthNames:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],showMonthAfterYear:false,yearSuffix:""},fa:{dayNames:["يکشنبه","دوشنبه","سهشنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],dayNamesMin:["ي","د","س","چ","پ","ج","ش"],firstDay:6,isRTL:true,monthNames:["فروردين","ارديبهشت","خرداد","تير","مرداد","شهريور","مهر","آبان","آذر","دي","بهمن","اسفند"],showMonthAfterYear:false,yearSuffix:""},fi:{dayNames:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],dayNamesMin:["Su","Ma","Ti","Ke","To","Pe","Su"],firstDay:1,isRTL:false,monthNames:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],showMonthAfterYear:false,yearSuffix:""},fo:{dayNames:["Sunnudagur","Mánadagur","Týsdagur","Mikudagur","Hósdagur","Fríggjadagur","Leyardagur"],dayNamesMin:["Sun","Mán","Týs","Mik","Hós","Frí","Ley"],firstDay:0,isRTL:false,monthNames:["Januar","Februar","Mars","Apríl","Mei","Juni","Juli","August","September","Oktober","November","Desember"],showMonthAfterYear:false,yearSuffix:""},"fr-CH":{dayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayNamesMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],firstDay:1,isRTL:false,monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],showMonthAfterYear:false,yearSuffix:""},fr:{dayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayNamesMin:["Dim.","Lun.","Mar.","Mer.","Jeu.","Ven.","Sam."],firstDay:1,isRTL:false,monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],showMonthAfterYear:false,yearSuffix:""},gl:{dayNames:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado"],dayNamesMin:["Dom","Lun","Mar","Mér","Xov","Ven","Sáb"],firstDay:1,isRTL:false,monthNames:["Xaneiro","Febreiro","Marzo","Abril","Maio","Xuño","Xullo","Agosto","Setembro","Outubro","Novembro","Decembro"],showMonthAfterYear:false,yearSuffix:""},he:{dayNames:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת"],dayNamesMin:["א'","ב'","ג'","ד'","ה'","ו'","שבת"],firstDay:0,isRTL:true,monthNames:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],showMonthAfterYear:false,yearSuffix:""},hr:{dayNames:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],dayNamesMin:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],firstDay:1,isRTL:false,monthNames:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],showMonthAfterYear:false,yearSuffix:""},hu:{dayNames:["Vasárnap","Hétfö","Kedd","Szerda","Csütörtök","Péntek","Szombat"],dayNamesMin:["Vas","Hét","Ked","Sze","Csü","Pén","Szo"],firstDay:1,isRTL:false,monthNames:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],showMonthAfterYear:true,yearSuffix:""},hy:{dayNames:["կիրակի","եկուշաբթի","երեքշաբթի","չորեքշաբթի","հինգշաբթի","ուրբաթ","շաբաթ"],dayNamesMin:["կիր","երկ","երք","չրք","հնգ","ուրբ","շբթ"],firstDay:1,isRTL:false,monthNames:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս","Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],showMonthAfterYear:false,yearSuffix:""},id:{dayNames:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],dayNamesMin:["Min","Sen","Sel","Rab","kam","Jum","Sab"],firstDay:0,isRTL:false,monthNames:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","Nopember","Desember"],showMonthAfterYear:false,yearSuffix:""},is:{dayNames:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"],dayNamesMin:["Sun","Mán","Þri","Mið","Fim","Fös","Lau"],firstDay:0,isRTL:false,monthNames:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],showMonthAfterYear:false,yearSuffix:""},it:{dayNames:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],dayNamesMin:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],firstDay:1,isRTL:false,monthNames:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],showMonthAfterYear:false,yearSuffix:""},ja:{dayNames:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],dayNamesMin:["日","月","火","水","木","金","土"],firstDay:0,isRTL:false,monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],showMonthAfterYear:true,yearSuffix:"年"},ko:{dayNames:["일","월","화","수","목","금","토"],dayNamesMin:["일","월","화","수","목","금","토"],firstDay:0,isRTL:false,monthNames:["1월(JAN)","2월(FEB)","3월(MAR)","4월(APR)","5월(MAY)","6월(JUN)","7월(JUL)","8월(AUG)","9월(SEP)","10월(OCT)","11월(NOV)","12월(DEC)"],showMonthAfterYear:false,yearSuffix:"년"},kz:{dayNames:["Жексенбі","Дүйсенбі","Сейсенбі","Сәрсенбі","Бейсенбі","Жұма","Сенбі"],dayNamesMin:["жкс","дсн","ссн","срс","бсн","жма","снб"],firstDay:1,isRTL:false,monthNames:["Қаңтар","Ақпан","Наурыз","Сәуір","Мамыр","Маусым","Шілде","Тамыз","Қыркүйек","Қазан","Қараша","Желтоқсан"],showMonthAfterYear:false,yearSuffix:""},lt:{dayNames:["sekmadienis","pirmadienis","antradienis","trečiadienis","ketvirtadienis","penktadienis","šeštadienis"],dayNamesMin:["sek","pir","ant","tre","ket","pen","šeš"],firstDay:1,isRTL:false,monthNames:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],showMonthAfterYear:false,yearSuffix:""},lv:{dayNames:["svētdiena","pirmdiena","otrdiena","trešdiena","ceturtdiena","piektdiena","sestdiena"],dayNamesMin:["svt","prm","otr","tre","ctr","pkt","sst"],firstDay:1,isRTL:false,monthNames:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],showMonthAfterYear:false,yearSuffix:""},ml:{dayNames:["ഞായര്","തിങ്കള്","ചൊവ്വ","ബുധന്","വ്യാഴം","വെള്ളി","ശനി"],dayNamesMin:["ഞായ","തിങ്ക","ചൊവ്വ","ബുധ","വ്യാഴം","വെള്ളി","ശനി"],firstDay:1,isRTL:false,monthNames:["ജനുവരി","ഫെബ്രുവരി","മാര്ച്ച്","ഏപ്രില്","മേയ്","ജൂണ്","ജൂലൈ","ആഗസ്റ്റ്","സെപ്റ്റംബര്","ഒക്ടോബര്","നവംബര്","ഡിസംബര്"],showMonthAfterYear:false,yearSuffix:""},ms:{dayNames:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],dayNamesMin:["Aha","Isn","Sel","Rab","kha","Jum","Sab"],firstDay:0,isRTL:false,monthNames:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],showMonthAfterYear:false,yearSuffix:""},nl:{dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],dayNamesMin:["zon","maa","din","woe","don","vri","zat"],firstDay:1,isRTL:false,monthNames:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],showMonthAfterYear:false,yearSuffix:""},no:{dayNames:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],dayNamesMin:["søn","man","tir","ons","tor","fre","lør"],firstDay:1,isRTL:false,monthNames:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],showMonthAfterYear:false,yearSuffix:""},pl:{dayNames:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],dayNamesMin:["Nie","Pn","Wt","Śr","Czw","Pt","So"],firstDay:1,isRTL:false,monthNames:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],showMonthAfterYear:false,yearSuffix:""},"pt-BR":{dayNames:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],dayNamesMin:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],firstDay:0,isRTL:false,monthNames:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],showMonthAfterYear:false,yearSuffix:""},pt:{dayNames:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],dayNamesMin:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],firstDay:0,isRTL:false,monthNames:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],showMonthAfterYear:false,yearSuffix:""},rm:{dayNames:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"],dayNamesMin:["Dum","Gli","Mar","Mes","Gie","Ven","Som"],firstDay:1,isRTL:false,monthNames:["Schaner","Favrer","Mars","Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],showMonthAfterYear:false,yearSuffix:""},ro:{dayNames:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"],dayNamesMin:["Dum","Lun","Mar","Mie","Joi","Vin","Sâm"],firstDay:1,isRTL:false,monthNames:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],showMonthAfterYear:false,yearSuffix:""},ru:{dayNames:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesMin:["вск","пнд","втр","срд","чтв","птн","сбт"],firstDay:1,isRTL:false,monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],showMonthAfterYear:false,yearSuffix:""},sk:{dayNames:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"],dayNamesMin:["Ned","Pon","Uto","Str","Štv","Pia","Sob"],firstDay:1,isRTL:false,monthNames:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],showMonthAfterYear:false,yearSuffix:""},sl:{dayNames:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"],dayNamesMin:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"],firstDay:1,isRTL:false,monthNames:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],showMonthAfterYear:false,yearSuffix:""},sq:{dayNames:["E Diel","E Hënë","E Martë","E Mërkurë","E Enjte","E Premte","E Shtune"],dayNamesMin:["Di","Hë","Ma","Më","En","Pr","Sh"],firstDay:1,isRTL:false,monthNames:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],showMonthAfterYear:false,yearSuffix:""},"sr-SR":{dayNames:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota"],dayNamesMin:["Ned","Pon","Uto","Sre","Čet","Pet","Sub"],firstDay:1,isRTL:false,monthNames:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],showMonthAfterYear:false,yearSuffix:""},sr:{dayNames:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"],dayNamesMin:["Нед","Пон","Уто","Сре","Чет","Пет","Суб"],firstDay:1,isRTL:false,monthNames:["Јануар","Фебруар","Март","Април","Мај","Јун","Јул","Август","Септембар","Октобар","Новембар","Децембар"],showMonthAfterYear:false,yearSuffix:""},sv:{dayNames:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"],dayNamesMin:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"],firstDay:1,isRTL:false,monthNames:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],showMonthAfterYear:false,yearSuffix:""},ta:{dayNames:["ஞாயிற்றுக்கிழமை","திங்கட்கிழமை","செவ்வாய்க்கிழமை","புதன்கிழமை","வியாழக்கிழமை","வெள்ளிக்கிழமை","சனிக்கிழமை"],dayNamesMin:["ஞாயிறு","திங்கள்","செவ்வாய்","புதன்","வியாழன்","வெள்ளி","சனி"],firstDay:1,isRTL:false,monthNames:["தை","மாசி","பங்குனி","சித்திரை","வைகாசி","ஆனி","ஆடி","ஆவணி","புரட்டாசி","ஐப்பசி","கார்த்திகை","மார்கழி"],showMonthAfterYear:false,yearSuffix:""},th:{dayNames:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์"],dayNamesMin:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],firstDay:0,isRTL:false,monthNames:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],showMonthAfterYear:false,yearSuffix:""},tj:{dayNames:["якшанбе","душанбе","сешанбе","чоршанбе","панҷшанбе","ҷумъа","шанбе"],dayNamesMin:["якш","душ","сеш","чор","пан","ҷум","шан"],firstDay:1,isRTL:false,monthNames:["Январ","Феврал","Март","Апрел","Май","Июн","Июл","Август","Сентябр","Октябр","Ноябр","Декабр"],showMonthAfterYear:false,yearSuffix:""},tr:{dayNames:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],dayNamesMin:["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],firstDay:1,isRTL:false,monthNames:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],showMonthAfterYear:false,yearSuffix:""},uk:{dayNames:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"],dayNamesMin:["нед","пнд","вів","срд","чтв","птн","сбт"],firstDay:1,isRTL:false,monthNames:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],showMonthAfterYear:false,yearSuffix:""},vi:{dayNames:["Chủ Nhật","Thứ Hai","Thứ Ba","Thứ Tư","Thứ Năm","Thứ Sáu","Thứ Bảy"],dayNamesMin:["CN","T2","T3","T4","T5","T6","T7"],firstDay:0,isRTL:false,monthNames:["Tháng Một","Tháng Hai","Tháng Ba","Tháng Tư","Tháng Năm","Tháng Sáu","Tháng Bảy","Tháng Tám","Tháng Chín","Tháng Mười","Tháng Mười Một","Tháng Mười Hai"],showMonthAfterYear:false,yearSuffix:""},"zh-CN":{dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesMin:["周日","周一","周二","周三","周四","周五","周六"],firstDay:1,isRTL:false,monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],showMonthAfterYear:true,yearSuffix:"年"},"zh-HK":{dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesMin:["周日","周一","周二","周三","周四","周五","周六"],firstDay:0,isRTL:false,monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],showMonthAfterYear:true,yearSuffix:"年"},"zh-TW":{dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesMin:["周日","周一","周二","周三","周四","周五","周六"],firstDay:1,isRTL:false,monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],showMonthAfterYear:true,yearSuffix:"年"}};A.fn.datePicker=function(C){return(new AJS.DatePicker(this,C))}}(jQuery));; ;/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:fields', location = '/fields/fields.soy' */ // This file was automatically generated from fields.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace jiraIntegration.templates.fields. */ if (typeof jiraIntegration == 'undefined') { var jiraIntegration = {}; } if (typeof jiraIntegration.templates == 'undefined') { jiraIntegration.templates = {}; } if (typeof jiraIntegration.templates.fields == 'undefined') { jiraIntegration.templates.fields = {}; } jiraIntegration.templates.fields.stringField = function(opt_data, opt_ignored) { return '' + aui.form.textField({labelContent: '' + soy.$$escapeHtml(opt_data.labelText), id: opt_data.name, name: opt_data.name, value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts}); }; if (goog.DEBUG) { jiraIntegration.templates.fields.stringField.soyTemplateName = 'jiraIntegration.templates.fields.stringField'; } jiraIntegration.templates.fields.textareaField = function(opt_data, opt_ignored) { var output = '<div class="field-group jira-field' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '" data-jira-type="' + soy.$$escapeHtml(opt_data.jiraType) + '"><label for="' + soy.$$escapeHtml(opt_data.name) + '">' + soy.$$escapeHtml(opt_data.labelText) + ((opt_data.isRequired) ? '<span class="aui-icon icon-required"></span>' : '') + '</label><textarea rows="10" id="' + soy.$$escapeHtml(opt_data.name) + '" name="' + soy.$$escapeHtml(opt_data.name) + '" class="textarea long-field">' + soy.$$escapeHtml(opt_data.value) + '</textarea>'; if (opt_data.errorTexts) { var errorList37 = opt_data.errorTexts; var errorListLen37 = errorList37.length; for (var errorIndex37 = 0; errorIndex37 < errorListLen37; errorIndex37++) { var errorData37 = errorList37[errorIndex37]; output += '<div class="error">' + soy.$$escapeHtml(errorData37) + '</div>'; } } output += '</div>'; return output; }; if (goog.DEBUG) { jiraIntegration.templates.fields.textareaField.soyTemplateName = 'jiraIntegration.templates.fields.textareaField'; } jiraIntegration.templates.fields.arrayField = function(opt_data, opt_ignored) { return '' + aui.form.textField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts}); }; if (goog.DEBUG) { jiraIntegration.templates.fields.arrayField.soyTemplateName = 'jiraIntegration.templates.fields.arrayField'; } jiraIntegration.templates.fields.numberField = function(opt_data, opt_ignored) { return '' + aui.form.textField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts}); }; if (goog.DEBUG) { jiraIntegration.templates.fields.numberField.soyTemplateName = 'jiraIntegration.templates.fields.numberField'; } jiraIntegration.templates.fields.allowedValuesField = function(opt_data, opt_ignored) { return '' + ((opt_data.options.length) ? aui.form.selectField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), options: opt_data.options, isRequired: opt_data.isRequired, isMultiple: opt_data.isMultiple, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts}) : aui.form.valueField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), value: "None", isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts})); }; if (goog.DEBUG) { jiraIntegration.templates.fields.allowedValuesField.soyTemplateName = 'jiraIntegration.templates.fields.allowedValuesField'; } jiraIntegration.templates.fields.timeTrackingField = function(opt_data, opt_ignored) { return '' + aui.form.textField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts}); }; if (goog.DEBUG) { jiraIntegration.templates.fields.timeTrackingField.soyTemplateName = 'jiraIntegration.templates.fields.timeTrackingField'; } jiraIntegration.templates.fields.unrenderableTypeField = function(opt_data, opt_ignored) { var output = '<div class="field-group jira-field jira-field-unrenderable' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '"><label>' + soy.$$escapeHtml(opt_data.labelText) + ((opt_data.isRequired) ? '<span class="aui-icon icon-required"></span>' : '') + '</label>' + aui.form.value({content: opt_data.reasonContent}); if (opt_data.errorTexts) { var errorList117 = opt_data.errorTexts; var errorListLen117 = errorList117.length; for (var errorIndex117 = 0; errorIndex117 < errorListLen117; errorIndex117++) { var errorData117 = errorList117[errorIndex117]; output += '<div class="error">' + soy.$$escapeHtml(errorData117) + '</div>'; } } output += '</div>'; return output; }; if (goog.DEBUG) { jiraIntegration.templates.fields.unrenderableTypeField.soyTemplateName = 'jiraIntegration.templates.fields.unrenderableTypeField'; } jiraIntegration.templates.fields.dateField = function(opt_data, opt_ignored) { return '' + aui.form.textField({labelContent: '' + soy.$$escapeHtml(opt_data.labelText), id: opt_data.name, name: opt_data.name, value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts}); }; if (goog.DEBUG) { jiraIntegration.templates.fields.dateField.soyTemplateName = 'jiraIntegration.templates.fields.dateField'; } jiraIntegration.templates.fields.select2WithIconField = function(opt_data, opt_ignored) { var output = '<div class="field-group jira-field' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '" data-jira-type="' + soy.$$escapeHtml(opt_data.jiraType) + '"><label for="' + soy.$$escapeHtml(opt_data.name) + '">' + soy.$$escapeHtml(opt_data.labelText) + ((opt_data.isRequired) ? '<span class="aui-icon icon-required"></span>' : '') + '</label><select id="' + soy.$$escapeHtml(opt_data.name) + '" name="' + soy.$$escapeHtml(opt_data.name) + '">'; var optionList154 = opt_data.options; var optionListLen154 = optionList154.length; for (var optionIndex154 = 0; optionIndex154 < optionListLen154; optionIndex154++) { var optionData154 = optionList154[optionIndex154]; output += '<option value="' + soy.$$escapeHtml(optionData154.value) + '" ' + ((optionData154.selected) ? 'selected' : '') + ' data-icon-url="' + soy.$$escapeHtml(optionData154.iconUrl) + '">' + soy.$$escapeHtml(optionData154.text) + '</option>'; } output += '</select>'; if (opt_data.errorTexts) { var errorList170 = opt_data.errorTexts; var errorListLen170 = errorList170.length; for (var errorIndex170 = 0; errorIndex170 < errorListLen170; errorIndex170++) { var errorData170 = errorList170[errorIndex170]; output += '<div class="error">' + soy.$$escapeHtml(errorData170) + '</div>'; } } output += '</div>'; return output; }; if (goog.DEBUG) { jiraIntegration.templates.fields.select2WithIconField.soyTemplateName = 'jiraIntegration.templates.fields.select2WithIconField'; } jiraIntegration.templates.fields.select2WithIconOption = function(opt_data, opt_ignored) { return ((opt_data.iconUrl) ? aui.avatar.avatar({avatarImageUrl: opt_data.iconUrl, size: 'xsmall', isProject: opt_data.isProject, extraClasses: 'select-option-image', tagName: 'span'}) : '') + '<span class="select-option" title="' + soy.$$escapeHtml(opt_data.optionValue) + '">' + soy.$$escapeHtml(opt_data.optionValue) + '</span>'; }; if (goog.DEBUG) { jiraIntegration.templates.fields.select2WithIconOption.soyTemplateName = 'jiraIntegration.templates.fields.select2WithIconOption'; } jiraIntegration.templates.fields.labelFieldResult = function(opt_data, opt_ignored) { return '' + ((opt_data.label.isNew) ? soy.$$escapeHtml(AJS.format("\x22{0}\x22 - (New label)",opt_data.label.labelName)) : soy.$$escapeHtml(opt_data.label.labelName)); }; if (goog.DEBUG) { jiraIntegration.templates.fields.labelFieldResult.soyTemplateName = 'jiraIntegration.templates.fields.labelFieldResult'; } jiraIntegration.templates.fields.userOptionSelect = function(opt_data, opt_ignored) { var output = ''; var userOption__soy197 = soy.$$escapeHtml(opt_data.displayName) + ' - (' + soy.$$escapeHtml(opt_data.name) + ')'; output += '<span title="' + soy.$$filterNoAutoescape(userOption__soy197) + '">' + soy.$$filterNoAutoescape(userOption__soy197) + '</span>'; return output; }; if (goog.DEBUG) { jiraIntegration.templates.fields.userOptionSelect.soyTemplateName = 'jiraIntegration.templates.fields.userOptionSelect'; } ; ;/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:fields', location = '/fields/fields.js' */ var jiraIntegration=window.jiraIntegration||{};jiraIntegration.fields=(function(I,P){var k="YYYY-MM-DD";var g={template:jiraIntegration.templates.fields.stringField,getContext:u,getValue:A};var y={template:jiraIntegration.templates.fields.stringField,getContext:q,getValue:D,behavior:o};var t={template:jiraIntegration.templates.fields.arrayField,getContext:h,getValue:B,behavior:j};var r={template:jiraIntegration.templates.fields.textareaField,getContext:u,getValue:A};var F={template:jiraIntegration.templates.fields.numberField,getContext:u,getValue:C};var c={template:jiraIntegration.templates.fields.arrayField,getContext:h,getValue:B};var O={template:jiraIntegration.templates.fields.allowedValuesField,getContext:f,getValue:P.bind(b,null,"name"),behavior:R};var L={template:jiraIntegration.templates.fields.allowedValuesField,getContext:f,getValue:P.bind(b,null,"id")};var K={template:jiraIntegration.templates.fields.timeTrackingField,getContext:Q,getValue:e};var J={template:jiraIntegration.templates.fields.dateField,getContext:u,getValue:A,behavior:x};var i={template:jiraIntegration.templates.fields.select2WithIconField,getContext:H,getValue:P.bind(b,null,"name"),behavior:a};var l={"com.pyxis.greenhopper.jira:gh-epic-label":g,string:g,summary:g,"com.atlassian.jira.plugin.system.customfieldtypes:textfield":g,"com.atlassian.jira.plugin.system.customfieldtypes:url":g,environment:r,"com.atlassian.jira.plugin.system.customfieldtypes:textarea":r,description:r,"com.atlassian.jira.plugin.system.customfieldtypes:float":F,array:c,labels:t,"com.atlassian.jira.plugin.system.customfieldtypes:labels":c,resolution:O,fixVersions:O,priority:i,versions:O,components:O,security:O,"com.atlassian.jira.plugin.system.customfieldtypes:version":O,"com.atlassian.jira.plugin.system.customfieldtypes:multiversion":O,"com.atlassian.jira.plugin.system.customfieldtypes:project":O,assignee:y,reporter:y,timetracking:K,duedate:J,"com.atlassian.jira.plugin.system.customfieldtypes:datepicker":J,"com.atlassian.jira.plugin.system.customfieldtypes:multiselect":L,"com.atlassian.jira.plugin.system.customfieldtypes:select":L};var v={ignoreFieldsWithDefaultValue:false};function m(U,S,V){var T=S.schema.system||"customfield_"+S.schema.customId;return{labelText:S.name,name:T,isRequired:S.required,errorTexts:V[T],jiraType:U}}function u(W,S,T,U){var V=W.name;W.value=(I.isPlainObject(U[V])?U[V].name:U[V])||(T&&T.fields[V])||"";return W}function A(S){return S.val()}function C(S){var T=S.val();if(s(T)){return Number(T)}return T||null}function x(S){var U=S.find("input");if(!!navigator.userAgent.match(/Trident/)&&AJS.version<"5.3.5"){var T="placeholder" in document.createElement("input");U.attr("placeholder",k);if(!T){U.on("focus",function(){if(U.val()===U.attr("placeholder")){U.val("")}}).on("blur",function(){if(U.val()===""){U.val(U.attr("placeholder"))}}).blur()}}else{U.datePicker({overrideBrowserDefault:true})}}function h(W,S,T,U){var V=W.name;W.value=(U[V]&&U[V].join(","))||(T&&T.fields[V]&&T.fields[V].join(","));return W}function B(S){return P.map(S.val().split(","),I.trim)}function f(Y,S,T,V){var W=Y.name;var U=V[W];var Z=T&&T.fields[W];var X;if(U){X=I.isArray(U)?P.pluck(U,"name"):[U.name]}else{if(Z){X=I.isArray(Z)?P.pluck(Z,"name"):[Z.name]}else{X=[]}}Y.options=P.map(S.allowedValues,function(aa){return{value:aa.name||aa.id,text:aa.name||aa.value,selected:P.contains(X,aa.name||aa.id)}});Y.isMultiple=P.contains(S.operations,"add");return Y}function b(V,T){var W=T.val();var S=T.attr("multiple");var U=function(Y){var X={};X[V]=Y;return X};if(S){return I.isArray(W)?P.map(W,U):[U(W)]}return U(W)}function R(S){S.find("select[multiple]").auiSelect2()}function q(W,S,T,U){var V=W.name;W.value=(U[V]&&U[V].name)||(T&&T.fields[V]&&T.fields[V].name)||"";return W}function D(S){return{name:S.val()}}function N(T,W,V,U,X){var Z=T.find("input");var Y=T.attr("name");Z.removeClass("text");var S={minimumInputLength:1,id:Y,name:Y,query:function(ab){function aa(ac){ab.callback({results:ac})}n(W,V,ab.term,U).done(aa)}};Z.auiSelect2(I.extend(S,X));T.find("div.aui-select2-container").addClass("jira-select2-drop-box")}function o(S,V,U,T){var W={formatInputTooShort:function(){return "Find users..."},formatResult:function(X){return jiraIntegration.templates.fields.userOptionSelect({name:X.id,displayName:X.text})}};N(S,V,U,T,W)}function j(S,V,U,T){var W=S.find("input");jiraIntegration.fields._labelPicker.build(W,function(X){return n(V,U,X,T)})}function n(W,U,V,T){var S=I.extend({restType:U,issueKey:(T&&T.key)||"",term:V},W);return I.ajax({type:"POST",contentType:"application/json",dataType:"json",url:AJS.contextPath()+"/rest/jira-integration/latest/fields/autocomplete",data:JSON.stringify(S)})}function Q(W,S,T,U){var V=W.name;W.value=(U[V]&&U[V].remainingEstimate)||(T&&T.fields[V]&&T.fields[V].remainingEstimate)||"";return W}function e(S){return{remainingEstimate:S.val()}}function H(X,S,T,U){var V=X.name;var W=(U[V]&&U[V].name)||(T&&T.fields&&T.fields[V]&&T.fields[V].name)||"";X.options=P.map(S.allowedValues,function(Y){return{value:Y.name,text:Y.name,selected:W===Y.name,iconUrl:Y.iconUrl}});return X}function z(T){var S;if(T.id){S=I(T.element).attr("data-icon-url")}return jiraIntegration.templates.fields.select2WithIconOption({optionValue:T.text,iconUrl:S})}function a(W,V,T,S){if(!I.fn.auiSelect2){AJS.log("AUI version 5.2 or greater is required as this plugin needs the .auiSelect2() jQuery plugin.");return}var U=W.find("select");U.addClass("jira-select2-drop-box");U.auiSelect2({hasAvatar:true,minimumResultsForSearch:-1,formatSelection:z,formatResult:z})}function p(T,S){if(P.has(l,T)&&console&&console.warn){console.warn("Redefining handler for type "+T+".")}l[T]=S}function E(S){return S.schema?(S.schema.system||S.schema.custom||S.schema.customId):S}function M(S){return l[E(S)]}function w(S){var T=d(S);return T&&M(T)}function d(S){return S.closest(".jira-field").attr("data-jira-type")}function G(T,S){return I.ajax({type:"GET",url:AJS.contextPath()+"/rest/jira-integration/1.0/servers/"+T.serverId+"/projects/"+T.projectKey+"/issue-types/"+T.issueType+"/fields-meta"}).pipe(function(V){var U=[];P.each(V.fields,function(X){var W=E(X);if(X.required&&!P.contains(S.excludedFields,W)){U.push(X)}});return U})}function s(S){return/\d/.test(S)&&/^-?\d*\.?\d*$/.test(S)}return{addFieldHandler:p,getFieldHandler:M,canRender:function(S){var U=E(S);var T=l[U];if(!T){return false}return S.operations&&S.operations.length&&(!T.canRender||T.canRender(S))},renderField:function(W,Y,Z,X){var S=Y.schema.system||Y.schema.custom||Y.schema.customId;var U=l[S];var V=m(S,Y,X||{});var aa=!U||(U.canRender&&!U.canRender(Y));var T=!Y.operations||!Y.operations.length;if(aa||T){V.reasonContent=aa?AJS.format("{0}Edit{1} this field in JIRA",'<a href="'+(W?W.url:"#")+'">',"</a>"):T?AJS.format("{0}Edit{1} this field in JIRA",'<a href="'+(W?W.url:"#")+'">',"</a>"):null;if(!V.reasonContent){throw new Error("Invalid unrenderable reason.")}return jiraIntegration.templates.fields.unrenderableTypeField(V)}return U.template(U.getContext(V,Y,W,Z||{}))},getJSON:function(S){var T=w(S);return T&&T.getValue&&T.getValue(S)},attachFieldBehaviors:function(U,T,S){U.find(".jira-field").each(function(X,W){var V=I(W);var Z=d(V);var Y=Z&&M(Z);var aa=Y&&Y.behavior;if(aa){aa(V,T,Z,S)}})},renderCreateRequiredFields:function(W,V,U,T,S){T=P.extend({},v,T);function X(Y){if(T.ignoreFieldsWithDefaultValue){Y=P.filter(Y,function(aa){return !aa.hasDefaultValue})}var Z=P.filter(Y,function(aa){return !jiraIntegration.fields.canRender(aa)});if(Z.length){if(S){S(Z)}return}W.html(P.map(Y,function(aa){return jiraIntegration.fields.renderField(null,aa,null,null)}).join(""));jiraIntegration.fields.attachFieldBehaviors(W,{serverId:U.serverId,projectKey:U.projectKey},null)}if(T.requiredFields){X(T.requiredFields)}else{G(U,T).done(X)}}}}(AJS.$,window._));; ;/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:fields', location = '/fields/label-picker.js' */ var jiraIntegration=window.jiraIntegration||{};jiraIntegration.fields=jiraIntegration.fields||{};jiraIntegration.fields._labelPicker=function(a){var b=function(d,c){d.auiSelect2({tags:true,multiple:true,tokenSeparators:[","," "],createSearchChoice:function(e){if(!e){return null}return{id:e,text:e,isNew:true}},query:function(f){var e=function(g){f.callback({results:g})};c(f.term).done(e)},formatResult:function(e){return jiraIntegration.templates.fields.labelFieldResult({label:{labelName:e.text,isNew:e.isNew}})}})};return{build:b}}(AJS.$);; ;/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:transition-form', location = '/transition-form/transition-form.soy' */ // This file was automatically generated from transition-form.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace jiraIntegration.templates._transitionForm. */ if (typeof jiraIntegration == 'undefined') { var jiraIntegration = {}; } if (typeof jiraIntegration.templates == 'undefined') { jiraIntegration.templates = {}; } if (typeof jiraIntegration.templates._transitionForm == 'undefined') { jiraIntegration.templates._transitionForm = {}; } jiraIntegration.templates._transitionForm.globalError = function(opt_data, opt_ignored) { var param3 = ''; var errorTextList4 = opt_data.errorTexts; var errorTextListLen4 = errorTextList4.length; for (var errorTextIndex4 = 0; errorTextIndex4 < errorTextListLen4; errorTextIndex4++) { var errorTextData4 = errorTextList4[errorTextIndex4]; param3 += '<p>' + soy.$$escapeHtml(errorTextData4) + '</p>'; } var output = '' + aui.message.error({content: param3}); output += aui.buttons.button({tagName: 'a', type: 'primary', extraClasses: 'jira-error-action', extraAttributes: {href: opt_data.actionUrl}, text: opt_data.actionText}); return output; }; if (goog.DEBUG) { jiraIntegration.templates._transitionForm.globalError.soyTemplateName = 'jiraIntegration.templates._transitionForm.globalError'; } jiraIntegration.templates._transitionForm.form = function(opt_data, opt_ignored) { var param19 = '<div class="jira-section-heading"><h3>' + soy.$$escapeHtml(opt_data.transition.name) + '</h3></div>'; if (opt_data.errorText) { var param25 = ''; var errorTextList26 = opt_data.errorText; var errorTextListLen26 = errorTextList26.length; for (var errorTextIndex26 = 0; errorTextIndex26 < errorTextListLen26; errorTextIndex26++) { var errorTextData26 = errorTextList26[errorTextIndex26]; param25 += soy.$$escapeHtml(errorTextData26); } param19 += aui.message.error({content: param25}); } param19 += soy.$$filterNoAutoescape(opt_data.fieldContent) + aui.form.buttons({content: '' + aui.buttons.button({type: 'primary', extraClasses: 'jira-transition', extraAttributes: {'data-transition-id': opt_data.transition.id}, text: opt_data.transition.name}) + aui.buttons.button({extraClasses: 'jira-transition-cancel', type: 'link', text: "Cancel"})}); var output = '' + aui.form.form({action: '', extraClasses: 'jira-transition-form', content: param19}); return output; }; if (goog.DEBUG) { jiraIntegration.templates._transitionForm.form.soyTemplateName = 'jiraIntegration.templates._transitionForm.form'; } ; ;/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:transition-form', location = '/transition-form/transition-form.js' */ var jiraIntegration=window.jiraIntegration||{};jiraIntegration.transitionForm=(function(b,a){return{isRequired:function(c,d){return d.fields&&a.some(d.fields,jiraIntegration.fields.canRender)},$render:function(g,f,c,h){if(!b.fn.auiSelect2){throw new Error("AUI version 5.2 or greater is required as this plugin needs the .auiSelect2() jQuery plugin.")}var d={};var k=false;a.each(h&&h.errors||[],function(l){k=k||l.context;var m=l.context||"__global__";d[m]=d[m]||[];d[m].push(l.message)});var i=!!d.__global__;if(!i||k){var e=f.fields?a.values(f.fields):[];a.each(e,function(m,l){m.fieldIndex=l});e.sort(function(o,n){var m=jiraIntegration.fields.canRender(o)?0:1;var l=jiraIntegration.fields.canRender(n)?0:1;return(m-l)||(o.fieldIndex-n.fieldIndex)});var j=b(jiraIntegration.templates._transitionForm.form({errorTexts:d.__global__,transition:f,fieldContent:a.map(e,function(l){return jiraIntegration.fields.renderField(g,l,c,d)}).join("")}));jiraIntegration.fields.attachFieldBehaviors(j,{serverId:g.applicationLinkId,projectKey:g.fields.project.key},g);return j}else{return b(jiraIntegration.templates._transitionForm.globalError({errorTexts:d.__global__,actionText:AJS.format("{0} in JIRA",f.name),actionUrl:g.url}))}},getJSON:function(c){return a.reduce(c.find("input,select,textarea").not(".select2-input,.select2-focusser"),function(d,f){var e=b(f);d[e.attr("name")]=jiraIntegration.fields.getJSON(e);return d},{})}}}(AJS.$,window._));; ;/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:jira-issues-dialog', location = '/jira-issue-dialog/jira-issues-dialog.js' */ var jiraIntegration=window.jiraIntegration||{};jiraIntegration.JiraIssuesDialog=(function(f,n){f(document).on("jira-img-error","img",function(){var r=f('<div class="jira-default-project-avatar"></div>').text(this.getAttribute("alt"));f(this).replaceWith(r)});function c(r){this.options=f.extend({},c.prototype.defaults,r);this.issueKeys=this.options.issueKeys||[];this.entityKey=this.options.entityKey||null;n.bindAll(this,"show","hide","onAuthorizationSucceeded","setIssueKeys","setEntityKey","setTitle","reset","destroy","_renderJiraData");this._initDialog();this._truncated=false;this._jiraIssuesData=null;this._jiraIssuesDataPromise=null;this._events={};this._currentXhr=null}c.prototype.defaults={id:"jira-issues-dialog",issueKeys:null,entityKey:null,maxIssues:10,headerTitle:"JIRA Issues",get$AuthMessage:function(s,t,u,r){return f(jiraIntegration.templates.dialog.authenticate({extraClasses:"jira-oauth-dialog",applicationName:t,text:u,title:AJS.format("Authenticate with {0}",t),content:aui.buttons.button({text:"Authenticate",tagName:"a",type:"primary",extraClasses:"jira-dialog-auth-trigger "+r,extraAttributes:{href:s,target:"_blank"}})}))},get$ConnectionLostMessage:function(t){if(t.length===1){var s=t[0];return f(jiraIntegration.templates.dialog.error({titleContent:jiraIntegration.templates.dialog.linkTitle({text:"Connection lost with",link:s.applicationUrl,linkText:s.applicationName}),text:"Unfortunately, we\u0027ve encountered problems connecting to JIRA"+":\n"+s.message,extraClasses:"communication-error"}))}else{var r=n.map(t,function(u){return jiraIntegration.templates.dialog.linkText({link:u.applicationUrl,linkText:u.applicationName,text:u.message,extraClasses:"multi"})});return f(jiraIntegration.templates.dialog.error({title:"There were errors communicating with JIRA",content:r.join(""),extraClasses:"communication-error"}))}},get$UnknownErrorMessage:function(){return f(jiraIntegration.templates.dialog.error({title:"Unknown error",text:"An unexpected error occurred.\nPlease contact your system administrator if the problem persists."}))},get$NoIssuesExistMessage:function(){return f(jiraIntegration.templates.dialog.message({title:"Can\u0027t display issues",text:"Either you don\u0027t have access to view them or they don\u0027t exist.\nPlease contact your system administrator if you believe this is incorrect.",iconClass:"icon-jira",extraClasses:"no-issues-exist"}))},ajax:function(r){alert("JiraIssuesDialog requires the option 'ajax(options)' to be specified.\nThis method should handle response status codes other than 200 and 500.")}};function o(r){return Math.max(0,Math.min(r-250,640))}c.prototype.on=function(r,s){this._events[r]=this._events[r]||[];this._events[r].push(s)};c.prototype.off=function(r,s){if(this._events[r]){this._events[r]=n.without(this._events[r],s)}};c.prototype._trigger=function(s){var r=this;var t=Array.prototype.slice.call(arguments,1);if(this._events[s]){n.map(this._events[s],function(u){u.apply(r,t)})}};c.prototype._initDialog=function(){var r=this;var t=f(window).height();this.dialog=new AJS.Dialog({width:980,height:o(t),id:this.options.id,closeOnOutsideClick:true,focusSelector:".button-panel-cancel-link"});f("#"+this.options.id).addClass("jira-issues-dialog");this.setTitle();this.dialog.addCancel("Close",this.hide).addPanel("jira-issues-list");this._transitionClickHandler=function(u){u.preventDefault();r._onTransitionClicked(this)};this.dialog.getCurrentPanel().body.on("click",".jira-transition-cancel",function(u){u.preventDefault();r._onTransitionCancelled(this)});f(document).on("hideLayer",function(){if(r.multiIssueView){r.multiIssueView.destroy()}});var s=f(window);this.onWindowResize=n.debounce(function(){r._setMinHeight(s.height())},200);s.on("resize",this.onWindowResize)};c.prototype._setMinHeight=function(s){var r=this.dialog.getCurrentPanel().body;r.css("min-height",o(s));if(r.is(":visible")){this.dialog.updateHeight()}};function b(r){return(!r.which||r.which===1)&&!(r.metaKey||r.ctrlKey||r.shiftKey||(r.altKey&&!f.browser.msie))}c.prototype.reset=function(){this._cancelPendingRender();this._truncated=false;this._jiraIssuesData=null};c.prototype.setIssueKeys=function(s,r){s=n.uniq(s);this.initialIssueKey=r;if(!this.issueKeys||s.length!==this.issueKeys.length||n.difference(s,this.issueKeys).length){this.issueKeys=s;this.reset()}};c.prototype.setEntityKey=function(r){if(this.entityKey!==r){this.entityKey=r;this.reset()}};c.prototype.destroy=function(){this.reset();this.dialog.remove();this._events=null;this.dialog=null;this.issueKeys=null;this.entityKey=null;this.options=null;if(this.onWindowResize){f(window).off("resize",this.onWindowResize);this.onWindowResize=null}};c.prototype.setTitle=function(r){this.dialog.addHeader(r||this.options.headerTitle||c.prototype.defaults.headerTitle)};c.prototype.show=function(){f(document).on("click",".jira-transition",this._transitionClickHandler);this.dialog.getCurrentPanel().body.removeClass("multi-issues");this.dialog.show();this._setMinHeight(f(window).height());this._loadJiraData().done(this._renderJiraData);this._trigger("show")};c.prototype.hide=function(){this.dialog.hide();f(document).off("click",".jira-transition",this._transitionClickHandler);this._trigger("hide")};c.prototype._getRestIssuesUrl=function(){return AJS.contextPath()+"/rest/jira-integration/latest/issues?issueKey="+n.map(this.issueKeys,encodeURIComponent).join("&issueKey=")+(this.entityKey?"&entityKey="+encodeURIComponent(this.entityKey):"")+"&fields=*all,-comment&minimum="+this.options.maxIssues};c.prototype._getRestTransitionUrl=function(r,s){return AJS.contextPath()+"/rest/jira-integration/latest/issues/"+encodeURIComponent(r)+"/transitions?applicationId="+encodeURIComponent(s)+"&fields=*all,-comment"};c.prototype._loadJiraData=function(){if(!this._jiraIssuesData&&!this._jiraIssuesDataPromise){var r=this;var s=this.dialog.getCurrentPanel().body;if(!f.fn.spin){alert("This plugin requires spin.js and the jquery plugin to be available.")}s.empty().spin("large");this._jiraIssuesDataPromise=this.options.ajax({type:"GET",url:this._getRestIssuesUrl(),dataType:"json",contentType:"application/json",jsonp:false}).pipe(function(v,y,w){if(v.errors&&v.errors.length){r._handleAuthenticationRequired(v.errors[0]);return f.Deferred().reject()}if(v&&v.length){var x=n.filter(v,function(z){return z.canTransition&&z.transitions.length===0});if(x.length){n.forEach(x,function(z){z.transitions=r._getTransitions(z.key,z.applicationLinkId,v);z.transitions.done(function(){q(z)})});n.forEach(n.difference(v,x),q);var t=x[0].transitions;var u=f.Deferred();t.done(function(){u.resolve(v)});t.fail(u.reject);return u}n.forEach(v,q)}return v},function(u,v,t){r._handle500Error(u)}).always(function(){s.spinStop()}).done(function(t){if(t.length){r._truncated=t.length>r.options.maxIssues;t=n.first(t,r.options.maxIssues)}r._jiraIssuesData=t;r._setAuthUrl(null)});return r._jiraIssuesDataPromise.always(function(){r._jiraIssuesDataPromise=null})}else{if(this._jiraIssuesDataPromise){return this._jiraIssuesDataPromise}else{return f.Deferred().resolve(this._jiraIssuesData).promise()}}};c.prototype._getTransitions=function(r,v,u){var t=this;var s;u=u||this._jiraIssuesData;if(u){s=n.find(u,function(w){return w.key===r});if(s&&s.transitions&&s.transitions[0]&&s.transitions[0].fields){return f.when(s.transitions)}}return this.options.ajax({type:"GET",url:this._getRestTransitionUrl(r,v),dataType:"json",contentType:"application/json",jsonp:false}).pipe(function(w){if(w.errors&&w.errors.length){t._handleAuthenticationRequired(w.errors[0]);return f.Deferred().reject()}else{if(s){s.transitions=w}return w}},function(x,y,w){t._handle500Error(x)})};c.prototype._transitionIssue=function(s,u,v,r){var t=this;return this.options.ajax({type:"POST",url:this._getRestTransitionUrl(s.key,v),dataType:"json",contentType:"application/json",jsonp:false,data:JSON.stringify({fields:r,transition:{id:u.id}})}).pipe(function(x){if(x.errors&&x.errors.length){t._handleAuthenticationRequired(x.errors[0]);return f.Deferred().reject()}if(s.fields.status.id===x.fields.status.id&&u.to&&u.to.id!==x.fields.status.id){return f.Deferred().reject(d("The transition could not be completed due to an unexpected error. Use JIRA to execute this transition."))}t._trigger("transitioned",s.key);if(x.canTransition&&!x.transitions.length){var w=f.Deferred();t._getTransitions(x.key,x.applicationLinkId,[x]).done(function(){q(x);t._updateCachedData(x);w.resolve(x)}).fail(w.reject);return w}q(x);t._updateCachedData(x);return x})};c.prototype._setAuthUrl=function(r){this._authUrl=r};c.prototype.isVisible=function(){return this.dialog.getCurrentPanel().body.is(":visible")};c.prototype.onAuthorizationSucceeded=function(r){if(this._authUrl===r&&this.isVisible()){this._authUrl=null;this._loadJiraData().done(this._renderJiraData)}};c.prototype._onTransitionClicked=function(y){var E=this;var t=f(y);var F=t.closest(".jira-transition-form");var C=this.dialog.getCurrentPanel().body.find(".jira-issue-detailed");var z=C.find(".jira-transition");var r=C.attr("data-application-id");var u=C.attr("data-issue-key");var w=t.attr("data-transition-id");var D=n.find(this._jiraIssuesData,function(G){return G.key===u});z.attr("aria-disabled","true").prop("disabled",true);var B;var A;var s=this._getTransitions(u,r).pipe(function(G){B=n.find(G,function(H){return H.id===w});if(B){if(F.length){A=jiraIntegration.transitionForm.getJSON(F)}else{if(jiraIntegration.transitionForm.isRequired(D,B)){return f.Deferred().reject("formRequired")}}}else{B={id:w,name:t.text()}}return E._transitionIssue(D,B,r,A)});var x;if(F.length){x=f('<div class="jira-transition-spinner"></div>').prependTo(F.find(".buttons"))}else{x=f('<div class="jira-transition-spinner"></div>').appendTo(C.find(".jira-transitions"))}x.spin();var v=C.closest(".list-and-detail-view").find('> .list-view .issue-item[data-issuekey="'+D.key+'"]');s.done(function(H){var G=H.fields.status;v.find(".issue-item-status").html(jiraIntegration.templates.dialog.itemIssueStatus({issueStatus:G}))});this._registerPendingRender(s).always(function(){z.attr("aria-disabled","false").prop("disabled",false);x.spinStop().remove()}).done(function(G){C.replaceWith(E._renderDetailedIssue(G))}).fail(function(H){if(!H){return}if(H==="formRequired"){C.children(".jira-header").nextAll().remove();C.append(jiraIntegration.transitionForm.$render(D,B));C.addClass("jira-transitioning");return}var I;if(H.responseText){try{I=JSON.parse(H.responseText)}catch(J){I=d("An unexpected error occurred.\nPlease contact your system administrator if the problem persists.")}}else{I=H}if(I&&I.errors){C.children(".jira-header").nextAll().remove();if(B){C.append(jiraIntegration.transitionForm.$render(D,B,A,I));C.addClass("jira-transitioning")}else{if(I.errors&&I.errors.length){var G=n.map(I.errors,function(K){return"<li>"+AJS.escapeHtml(K.message)+"</li>"});C.append(aui.message.error({content:'<ul class="jira-errors">'+G.join("")+"</ul>"}))}else{C.replaceWith(E.options.get$UnknownErrorMessage());E._setMinHeight(0)}}}})};c.prototype._renderDetailedIssue=function(r){var s=f(jiraIntegration.templates.dialog.detailedIssue({issue:r}));return s.attr("data-last-updated",new Date().getTime())};c.prototype._onTransitionCancelled=function(t){var v=f(t);var u=v.closest(".jira-issue-detailed");var r=u.attr("data-issue-key");var s=n.find(this._jiraIssuesData,function(w){return w.key===r});u.replaceWith(this._renderDetailedIssue(s))};c.prototype._updateCachedData=function(r){this._jiraIssuesData=n.map(this._jiraIssuesData,function(s){return(s.key===r.key)?r:s})};c.prototype._handleAuthenticationRequired=function(r){this._setAuthUrl(r.authenticationUri);this._removeViewWarning();this.dialog.getCurrentPanel().body.empty().append(this.options.get$AuthMessage(r.authenticationUri,r.applicationName,r.message,this.options.oauthTriggerClass));this._trigger("authorizationRequired",r.authenticationUri,r.applicationName);this._setMinHeight(0)};c.prototype._removeViewWarning=function(){this.dialog.popup.element.find(".view-warning").remove()};c.prototype._handle500Error=function(v){if(v.status===500){var s;try{s=JSON.parse(v.responseText)}catch(u){}var r;var t=s&&s.errors;if(!t||!t.length){r=this.options.get$UnknownErrorMessage()}else{r=this.options.get$ConnectionLostMessage(t)}this._removeViewWarning();this.dialog.getCurrentPanel().body.empty().append(r);this._setMinHeight(0)}};c.prototype._registerPendingRender=function(r){this._cancelPendingRender();var s=this._pendingRender=f.Deferred();r.done(function(){s.resolveWith(this,arguments)}).fail(function(){s.rejectWith(this,arguments)});return this._pendingRender};c.prototype._cancelPendingRender=function(){if(this._pendingRender){this._pendingRender.reject();this._pendingRender=null}};c.prototype._renderJiraData=function(){var s=this;var u;var t="You don\u0027t have access to view all issues or they may not exist";var x=this.dialog.getCurrentPanel().body;this._cancelPendingRender();var r;var w;switch(this._jiraIssuesData.length){case 0:u=this.options.get$NoIssuesExistMessage();break;case 1:r=this.issueKeys.length>1?t:null;u=this._renderDetailedIssue(this._jiraIssuesData[0]);w=f(window).height();break;default:if(this._truncated){r=AJS.format("Showing the first {0} issues",this.options.maxIssues)}else{if(this.issueKeys.length!==this._jiraIssuesData.length){r=t}}var v=n.findWhere(this._jiraIssuesData,{key:this.initialIssueKey});u=f(jiraIntegration.templates.dialog.multiIssueView({issues:this._jiraIssuesData,selectedIssue:v}));this.multiIssueView=new e(u,function(B,A,C,D){if(!b(D)){return}D.preventDefault();s._cancelPendingRender();var y=B.attr("data-issuekey");var z=n.find(s._jiraIssuesData,function(E){return E.key===y});if(z.transitions&&z.transitions.promise){C.empty().spin("large");s._registerPendingRender(z.transitions).always(function(){C.spinStop()}).done(function(){C.html(s._renderDetailedIssue(z))})}else{C.html(s._renderDetailedIssue(z))}});x.addClass("multi-issues");w=f(window).height();break}this._removeViewWarning();if(r){this.dialog.popup.element.find(".dialog-button-panel").prepend(jiraIntegration.templates.dialog.warningMessage({warningText:r}))}x.html(u);u.find(".issue-status").attr("data-last-updated",new Date().getTime());this._setMinHeight(w||0)};function d(r){return{errors:[{message:r}]}}var l={j:74,k:75};function e(r,t,s){this.options=f.extend({},e.prototype.defaults,s);this.$listView=r.find(".list-view");this.$detailView=r.find(".detail-view");this.selectHandler=t;n.bindAll(this,"itemClickHandler","shortcutHandler");this.init()}e.prototype.defaults={selectedClass:"selectedItem"};e.prototype.init=function(){var r=this;this.bindShortcuts();this.$listView.on("click","li",this.itemClickHandler)};e.prototype.itemClickHandler=function(t){var s=this.options.selectedClass;this.$listView.find("li."+s).removeClass(s);var r=f(t.currentTarget).addClass(s);this.selectHandler(r,this.$listView,this.$detailView,t)};e.prototype.destroy=function(){this.unbindShortcuts()};e.prototype.shortcutHandler=function(u){if(f(u.target).is("input,textarea,select")){return}var s;if(u.which===l.j){s="next"}else{if(u.which===l.k){s="prev"}else{return}}var t=this.$listView.find("li."+this.options.selectedClass);var r=t[s]("li");r.click();this._scrollItemIntoView(r)};e.prototype.bindShortcuts=function(){f(document).on("keydown",this.shortcutHandler)};e.prototype.unbindShortcuts=function(){f(document).off("keydown",this.shortcutHandler)};e.prototype._scrollItemIntoView=function(r){r.find("a").focus().blur()};var j=/.*(?=\/browse\/[^\/]*-\d+)/;var a=/.*(?=\/rest\/api\/\d+\/)/;function q(u){var t=j.exec(u.url)[0];var v=a.exec(u.self)[0];function s(y,w,x){if(typeof y==="string"){x[w]=k(y,t,v);return}n.each(y,s)}function r(x,w){if(x[w]){x[w]=i(x[w],t,v)}}p(u.fields,m,s);p(u.renderedFields,m,s);p(u.transitions,m,s);if(u.renderedFields){r(u.renderedFields,"description");n.each(u.renderedFields.comment&&u.renderedFields.comment.comments||[],function(w){r(w,"body")})}}function m(t,r,s){return/[uU]rls?$/.test(r)}function i(s,r,u){try{var t=f("<div />").html(s);n.each(["href","src"],function(w){n.each(t.find("["+w+"]"),function(x){x.setAttribute(w,k(x.getAttribute(w),r,u))})});s=t.html()}catch(v){}return s}var h=/^(https?:)?\/\//;function k(s,r,t){if(s.substring(0,t.length)===t){return g(r,s.substring(t.length))}if(!h.test(s)){return g(r,s)}return s}function p(t,s,r){if(t&&typeof t==="object"){n.each(t,function(v,u){if(s(v,u,t)){r(v,u,t)}p(v,s,r)})}}function g(s,r){var u=s.charAt(s.length-1)==="/";var t=r.charAt(0)==="/";return u&&t?s+r.substring(1):u||t?s+r:s+"/"+r}return c}(AJS.$,_));; ;/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:jira-issues-dialog', location = '/jira-issue-dialog/jira-issues-dialog.soy' */ // This file was automatically generated from jira-issues-dialog.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace jiraIntegration.templates.dialog. */ if (typeof jiraIntegration == 'undefined') { var jiraIntegration = {}; } if (typeof jiraIntegration.templates == 'undefined') { jiraIntegration.templates = {}; } if (typeof jiraIntegration.templates.dialog == 'undefined') { jiraIntegration.templates.dialog = {}; } jiraIntegration.templates.dialog.detailedIssue = function(opt_data, opt_ignored) { return '<div class="jira-issue-detailed" data-issue-key="' + soy.$$escapeHtml(opt_data.issue.key) + '" data-application-id="' + soy.$$escapeHtml(opt_data.issue.applicationLinkId) + '"><div class="jira-header">' + aui.group.group({content: '' + aui.group.item({extraClasses: 'jira-project-avatar', content: '<span class="aui-avatar aui-avatar-project jira-project-avatar aui-avatar-large"><span class="aui-avatar-inner"><img src="' + soy.$$escapeHtml(opt_data.issue.fields.project.avatarUrls['48x48']) + '" alt="' + soy.$$escapeHtml(opt_data.issue.fields.project.name ? opt_data.issue.fields.project.name : '') + '" onerror="AJS.$(this).trigger(\'jira-img-error\')" /></span></span>'}) + aui.group.item({content: '<span class="project-name">' + soy.$$escapeHtml(opt_data.issue.fields.project.name) + '</span><a class="issue-key" href="' + soy.$$escapeHtml(opt_data.issue.url) + '">' + soy.$$escapeHtml(opt_data.issue.key) + '</a><h2 class="issue-summary" title="' + soy.$$escapeHtml(opt_data.issue.fields.summary) + '">' + soy.$$escapeHtml(opt_data.issue.fields.summary) + '</h2>'})}) + '</div>' + ((opt_data.issue.canTransition && opt_data.issue.transitions && opt_data.issue.transitions.length) ? jiraIntegration.templates.dialog.jiraActionsToolbar({transitions: opt_data.issue.transitions, maxTransitionsToDisplay: opt_data.maxTransitionsToDisplay}) : '') + '<div class="jira-section-heading"><h3>' + soy.$$escapeHtml("Details") + '</h3></div>' + aui.group.group({extraClasses: 'issue-details jira-section', content: '' + aui.group.item({content: '<ul class="fields"><li class="field issue-type"><span class="field-label">' + soy.$$escapeHtml("Type:") + '</span><img class="aui-icon" src="' + soy.$$escapeHtml(opt_data.issue.fields.issuetype.iconUrl) + '"/><span class="field-text">' + soy.$$escapeHtml(opt_data.issue.fields.issuetype.name) + '</span></li><li class="field issue-priority"><span class="field-label">' + soy.$$escapeHtml("Priority:") + '</span>' + ((opt_data.issue.fields.priority) ? '<img class="aui-icon" src="' + soy.$$escapeHtml(opt_data.issue.fields.priority.iconUrl) + '"/><span class="field-text">' + soy.$$escapeHtml(opt_data.issue.fields.priority.name) + '</span>' : '<span class="field-text empty">' + soy.$$escapeHtml("No priority") + '</span>') + '</li></ul>'}) + aui.group.item({content: '<ul class="fields"><li class="field issue-status"><span class="field-label">' + soy.$$escapeHtml("Status:") + '</span>' + JIRA.Template.Util.Issue.Status.issueStatusResolver({issueStatus: opt_data.issue.fields.status}) + '</li><li class="field issue-assignee"><span class="field-label">' + soy.$$escapeHtml("Assignee:") + '</span>' + ((opt_data.issue.fields.assignee) ? '<img class="aui-icon" title="' + soy.$$escapeHtml(opt_data.issue.fields.assignee.displayName) + '" src="' + soy.$$escapeHtml(opt_data.issue.fields.assignee.avatarUrls['16x16']) + '"><span class="field-text">' + soy.$$escapeHtml(opt_data.issue.fields.assignee.displayName) + '</span>' : '<span class="field-text empty">' + soy.$$escapeHtml("Unassigned") + '</span>') + '</li></ul>'})}) + '<div class="jira-section-heading"><h3>' + soy.$$escapeHtml("Description") + '</h3></div><div class="jira-section">' + ((opt_data.issue.renderedFields && opt_data.issue.renderedFields.description) ? '<div class="issue-description rendered">' + soy.$$filterNoAutoescape(opt_data.issue.renderedFields.description) + '</div>' : (opt_data.issue.fields.description) ? '<p class="issue-description">' + soy.$$escapeHtml(opt_data.issue.fields.description) + '</p>' : '<p class="issue-description empty">' + soy.$$escapeHtml("No description") + '</p>') + '</div></div>'; }; if (goog.DEBUG) { jiraIntegration.templates.dialog.detailedIssue.soyTemplateName = 'jiraIntegration.templates.dialog.detailedIssue'; } jiraIntegration.templates.dialog.jiraActionsToolbar = function(opt_data, opt_ignored) { return '' + aui.toolbar2.toolbar2({extraClasses: 'jira-actions', content: '' + aui.toolbar2.group({content: '' + aui.toolbar2.item({item: 'primary', extraClasses: 'jira-transitions', content: '' + jiraIntegration.templates.dialog.transitionsButtons(opt_data)})})}); }; if (goog.DEBUG) { jiraIntegration.templates.dialog.jiraActionsToolbar.soyTemplateName = 'jiraIntegration.templates.dialog.jiraActionsToolbar'; } jiraIntegration.templates.dialog.transitionsButtons = function(opt_data, opt_ignored) { var output = ''; var maxTransitionsToDisplay__soy122 = opt_data.maxTransitionsToDisplay ? opt_data.maxTransitionsToDisplay : 3; var param123 = ''; var transitionList124 = opt_data.transitions; var transitionListLen124 = transitionList124.length; for (var transitionIndex124 = 0; transitionIndex124 < transitionListLen124; transitionIndex124++) { var transitionData124 = transitionList124[transitionIndex124]; param123 += (transitionIndex124 < maxTransitionsToDisplay__soy122 - 1 || opt_data.transitions.length <= maxTransitionsToDisplay__soy122) ? aui.buttons.button({text: transitionData124.name, extraClasses: 'jira-transition', extraAttributes: {'data-transition-id': transitionData124.id, autocomplete: 'off'}}) : ''; } param123 += (opt_data.transitions.length > maxTransitionsToDisplay__soy122) ? aui.buttons.button({text: "More", dropdown2Target: 'jira-more-transitions', extraAttributes: {autocomplete: 'off'}}) : ''; output += aui.buttons.buttons({content: param123}); if (opt_data.transitions.length > maxTransitionsToDisplay__soy122) { var param143 = '<ul>'; var transitionList145 = opt_data.transitions; var transitionListLen145 = transitionList145.length; for (var transitionIndex145 = 0; transitionIndex145 < transitionListLen145; transitionIndex145++) { var transitionData145 = transitionList145[transitionIndex145]; param143 += (transitionIndex145 > maxTransitionsToDisplay__soy122 - 2) ? '<li><a class="jira-transition" data-transition-id="' + soy.$$escapeHtml(transitionData145.id) + '">' + soy.$$escapeHtml(transitionData145.name) + '</a></li>' : ''; } param143 += '</ul>'; output += aui.dropdown2.contents({id: 'jira-more-transitions', extraClasses: 'aui-style-default', content: param143}); } return output; }; if (goog.DEBUG) { jiraIntegration.templates.dialog.transitionsButtons.soyTemplateName = 'jiraIntegration.templates.dialog.transitionsButtons'; } jiraIntegration.templates.dialog.warningMessage = function(opt_data, opt_ignored) { return '<div class="view-warning"><span class="aui-icon aui-icon-small aui-iconfont-info" /><span class="warning-message">' + soy.$$escapeHtml(opt_data.warningText) + '</span></div>'; }; if (goog.DEBUG) { jiraIntegration.templates.dialog.warningMessage.soyTemplateName = 'jiraIntegration.templates.dialog.warningMessage'; } jiraIntegration.templates.dialog.multiIssueView = function(opt_data, opt_ignored) { var output = '<div class="list-and-detail-view"><div class="list-view"><ul>'; var issueList162 = opt_data.issues; var issueListLen162 = issueList162.length; for (var issueIndex162 = 0; issueIndex162 < issueListLen162; issueIndex162++) { var issueData162 = issueList162[issueIndex162]; output += jiraIntegration.templates.dialog.issueItem({issue: issueData162, isSelected: opt_data.selectedIssue ? issueData162.key == opt_data.selectedIssue.key : issueIndex162 == 0}); } output += '</ul></div><div class="detail-view">' + jiraIntegration.templates.dialog.detailedIssue({issue: opt_data.selectedIssue ? opt_data.selectedIssue : opt_data.issues[0]}) + '</div></div>'; return output; }; if (goog.DEBUG) { jiraIntegration.templates.dialog.multiIssueView.soyTemplateName = 'jiraIntegration.templates.dialog.multiIssueView'; } jiraIntegration.templates.dialog.issueItem = function(opt_data, opt_ignored) { return '<li class="issue-item' + soy.$$escapeHtml(opt_data.isSelected ? ' selectedItem' : '') + '" data-issuekey="' + soy.$$escapeHtml(opt_data.issue.key) + '"><img class="aui-icon issue-item-type" title="' + soy.$$escapeHtml(opt_data.issue.fields.issuetype.name) + '" src="' + soy.$$escapeHtml(opt_data.issue.fields.issuetype.iconUrl) + '"/><a class="issue-item-key" href="' + soy.$$escapeHtml(opt_data.issue.url) + '">' + soy.$$escapeHtml(opt_data.issue.key) + '</a><div class="issue-item-status">' + jiraIntegration.templates.dialog.itemIssueStatus({issueStatus: opt_data.issue.fields.status}) + '</div><a href="' + soy.$$escapeHtml(opt_data.issue.url) + '" class="issue-item-summary" title="' + soy.$$escapeHtml(opt_data.issue.fields.summary) + '">' + soy.$$escapeHtml(opt_data.issue.fields.summary) + '</a></li>'; }; if (goog.DEBUG) { jiraIntegration.templates.dialog.issueItem.soyTemplateName = 'jiraIntegration.templates.dialog.issueItem'; } jiraIntegration.templates.dialog.itemIssueStatus = function(opt_data, opt_ignored) { return '' + JIRA.Template.Util.Issue.Status.issueStatusResolver({issueStatus: opt_data.issueStatus, isSubtle: true, isCompact: ! opt_data.issueStatus.statusCategory}); }; if (goog.DEBUG) { jiraIntegration.templates.dialog.itemIssueStatus.soyTemplateName = 'jiraIntegration.templates.dialog.itemIssueStatus'; } jiraIntegration.templates.dialog.message = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '<div class="jira-dialog-message' + aui.renderExtraClasses(opt_data) + '"' + aui.renderExtraAttributes(opt_data) + '>' + ((opt_data.iconClass) ? '<div class="jira-dialog-message-icon aui-icon' + ((opt_data.iconClass) ? ' ' + soy.$$escapeHtml(opt_data.iconClass) : '') + '">' + soy.$$escapeHtml(opt_data.accessibilityText ? opt_data.accessibilityText : '') + '</div>' : '') + ((opt_data.title) ? '<h2>' + soy.$$escapeHtml(opt_data.title) + '</h2>' : '') + ((opt_data.titleContent) ? soy.$$filterNoAutoescape(opt_data.titleContent) : '') + ((opt_data.text) ? '<p>' + soy.$$escapeHtml(opt_data.text) + '</p>' : '') + ((opt_data.content) ? soy.$$filterNoAutoescape(opt_data.content) : '') + '</div>'; }; if (goog.DEBUG) { jiraIntegration.templates.dialog.message.soyTemplateName = 'jiraIntegration.templates.dialog.message'; } jiraIntegration.templates.dialog.linkText = function(opt_data, opt_ignored) { return '<p class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"><a href="' + soy.$$escapeHtml(opt_data.link) + '">' + soy.$$escapeHtml(opt_data.linkText) + '</a>: ' + soy.$$escapeHtml(opt_data.text) + '</p>'; }; if (goog.DEBUG) { jiraIntegration.templates.dialog.linkText.soyTemplateName = 'jiraIntegration.templates.dialog.linkText'; } jiraIntegration.templates.dialog.linkTitle = function(opt_data, opt_ignored) { return '<h2>' + soy.$$escapeHtml(opt_data.text) + ' <a href="' + soy.$$escapeHtml(opt_data.link) + '">' + soy.$$escapeHtml(opt_data.linkText) + '</a></h2>'; }; if (goog.DEBUG) { jiraIntegration.templates.dialog.linkTitle.soyTemplateName = 'jiraIntegration.templates.dialog.linkTitle'; } jiraIntegration.templates.dialog.authenticate = function(opt_data, opt_ignored) { return '' + jiraIntegration.templates.dialog.message({title: AJS.format("Authenticate with {0}",opt_data.applicationName), text: opt_data.text, content: opt_data.content, extraClasses: opt_data.extraClasses, iconClass: 'icon-lock'}); }; if (goog.DEBUG) { jiraIntegration.templates.dialog.authenticate.soyTemplateName = 'jiraIntegration.templates.dialog.authenticate'; } jiraIntegration.templates.dialog.error = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '' + jiraIntegration.templates.dialog.message({title: opt_data.title, titleContent: opt_data.titleContent, text: opt_data.text, content: opt_data.content, extraClasses: opt_data.extraClasses, iconClass: 'icon-skull'}); }; if (goog.DEBUG) { jiraIntegration.templates.dialog.error.soyTemplateName = 'jiraIntegration.templates.dialog.error'; } ; ;/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:jira-issues-dialog-trigger', location = '/jira-issues-dialog-trigger/jira-issues-dialog-trigger.js' */ jiraIntegration.triggers=(function(d,b){function c(g){return g.which===3}function f(g){return(!g.which||g.which===1)&&!(g.metaKey||g.ctrlKey||g.shiftKey||(g.altKey&&!d.browser.msie))}var a={defaults:{selector:".jira-issues-trigger",headerTitleFn:null}};function e(j,h){j=d.extend({},a.defaults,j);var l;function i(){if(!l){if(h instanceof jiraIntegration.JiraIssuesDialog){l=h}else{l=new jiraIntegration.JiraIssuesDialog(h)}}return l}function n(v,r){var t=i();if(c(v)||(!f(v)&&!!r.data("single-issue"))){return}v.preventDefault();var u=r.attr("data-issue-keys");var s=u&&u.split(",");var q=r.attr("data-initial-issue-key");if(s){t.setIssueKeys(s,q)}if(typeof j.headerTitleFn==="function"){t.setTitle(j.headerTitleFn(r))}t.show()}var o={gravity:"n",className:function(){var s=d(".tipsy");var w=s[0];var q=w.offsetWidth;var v="multi-issues-tooltip";s.addClass(v);var t=w.offsetWidth;var r=q-t;var u=parseFloat(s.css("left"),10);s.css("left",(u+r/2)+"px");return v}};var g;var p;if(typeof j.selector==="string"){g=function(r){var q=d(r.target).closest(j.selector);if(q.length){n(r,q)}};d(document).on("click",g);o.live=true;d(j.selector+".multi-issues").tipsy(o);p=function(){d(document).off("click",g)}}else{g=function(q){n(q,d(this))};var k=d(j.selector);k.on("click",g);var m=k.filter(".multi-issues");m.tipsy(o);p=function(){k.off("click",g)}}return{getDialog:i,unbind:p}}a.init=e;return a}(AJS.$,_));; ;/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:jira-issues-dialog-trigger', location = '/jira-issues-dialog-trigger/jira-issues-dialog-trigger.soy' */ // This file was automatically generated from jira-issues-dialog-trigger.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace jiraIntegration.templates.trigger. */ if (typeof jiraIntegration == 'undefined') { var jiraIntegration = {}; } if (typeof jiraIntegration.templates == 'undefined') { jiraIntegration.templates = {}; } if (typeof jiraIntegration.templates.trigger == 'undefined') { jiraIntegration.templates.trigger = {}; } jiraIntegration.templates.trigger.issuesTrigger = function(opt_data, opt_ignored) { var output = ''; if (opt_data.displayedIssue || opt_data.issues.length == 1) { output += '<a class="' + soy.$$escapeHtml(opt_data.className ? opt_data.className : 'jira-issues-trigger') + '" data-issue-keys="'; var issueList8 = opt_data.issues; var issueListLen8 = issueList8.length; for (var issueIndex8 = 0; issueIndex8 < issueListLen8; issueIndex8++) { var issueData8 = issueList8[issueIndex8]; output += ((! (issueIndex8 == 0)) ? ',' : '') + soy.$$escapeHtml(issueData8.key); } output += '"' + ((opt_data.displayedIssue) ? ' data-initial-issue-key="' + soy.$$escapeHtml(opt_data.displayedIssue.key) + '"' : '') + ' data-single-issue="true" href="' + soy.$$escapeHtml(opt_data.displayedIssue ? opt_data.displayedIssue.url : opt_data.issues[0].url) + '">' + soy.$$escapeHtml(opt_data.displayedIssue ? opt_data.displayedIssue.key : opt_data.issues[0].key) + '</a>'; } else if (opt_data.issues.length > 1) { output += '<a class="' + soy.$$escapeHtml(opt_data.className ? opt_data.className : 'jira-issues-trigger') + ' multi-issues" data-issue-keys="'; var issueList29 = opt_data.issues; var issueListLen29 = issueList29.length; for (var issueIndex29 = 0; issueIndex29 < issueListLen29; issueIndex29++) { var issueData29 = issueList29[issueIndex29]; output += ((! (issueIndex29 == 0)) ? ',' : '') + soy.$$escapeHtml(issueData29.key); } output += '" href="#" title="' + jiraIntegration.templates.trigger.tooltip(opt_data) + '"><strong>' + soy.$$escapeHtml(opt_data.issues.length <= (opt_data.maxIssues ? opt_data.maxIssues : 10) ? opt_data.issues.length : AJS.format("{0}+",opt_data.maxIssues ? opt_data.maxIssues : 10)) + '</strong> ' + soy.$$escapeHtml("JIRA Issues") + '</a>'; } return output; }; if (goog.DEBUG) { jiraIntegration.templates.trigger.issuesTrigger.soyTemplateName = 'jiraIntegration.templates.trigger.issuesTrigger'; } jiraIntegration.templates.trigger.tooltip = function(opt_data, opt_ignored) { var output = ''; var issueList44 = opt_data.issues; var issueListLen44 = issueList44.length; for (var issueIndex44 = 0; issueIndex44 < issueListLen44; issueIndex44++) { var issueData44 = issueList44[issueIndex44]; output += (issueIndex44 < 5) ? ((! (issueIndex44 == 0)) ? '\n' : '') + soy.$$escapeHtml(issueData44.key) : ''; } output += (opt_data.issues.length > 5) ? '\n' + soy.$$escapeHtml(AJS.format("and {0} more...",opt_data.issues.length - 5)) : ''; return output; }; if (goog.DEBUG) { jiraIntegration.templates.trigger.tooltip.soyTemplateName = 'jiraIntegration.templates.trigger.tooltip'; } ; ;/* module-key = 'com.atlassian.stash.stash-jira-integration:jira-integration-lib', location = '/lib/jira-integration/jira-issues-dialog_AMD.js' */ define("jira-integration/jira-issues-dialog",[],function(){return jiraIntegration.JiraIssuesDialog});; ;/* module-key = 'com.atlassian.stash.stash-jira-integration:jira-integration-lib', location = '/lib/jira-integration/jira-triggers_AMD.js' */ define("jira-integration/jira-triggers",[],function(){return jiraIntegration.triggers});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:oauth-util', location = '/static/util/oauth.js' */ define("util/oauth",["jquery","util/events"],function(E,B){var A=(function(){function I(){if(window.aouthWindow&&window.aouthWindow.close){window.aouthWindow.close()}window.oauthCallback=null;window.aouthWindow=null}function H(L,M,K){window.oauthCallback={uri:L,success:function(){I();if(M){M()}},failure:function(){I();if(K){K()}}};window.aouthWindow=window.open(L)}function J(K){if(window.oauthCallback&&window.oauthCallback.uri===K){window.oauthCallback.failure()}}return{fireRequest:H,cancelRequest:J}}());function D(J){var H=new E.Deferred();var K={url:J,deferred:H,api:H.promise({abort:function(){A.cancelRequest(J)}})};B.trigger("stash.util.oauth.authorizationRequested",null,J);H.then(function L(){B.trigger("stash.util.oauth.authorizationSucceeded",null,J)},function I(){B.trigger("stash.util.oauth.authorizationFailed",null,J)});A.fireRequest(J,H.resolve,H.reject);return K}var C;function G(H){if(C){if(C.url===H){return C.api}C.api.abort()}C=D(H);var I=C;C.deferred.always(function(){C=null});return I.api}function F(H){E(document).on("click",H,function(J){var I=this.getAttribute("href");if(I){G(I);J.preventDefault()}})}return{authorizeUrl:G,interceptLinks:F}});; ;/* module-key = 'com.atlassian.stash.stash-jira-integration:jira-issues-dialog', location = '/jira-issues-dialog/stash-jira-issues-dialog.js' */ define("feature/jira/jira-issues-dialog",["jira-integration/jira-issues-dialog","jira-integration/jira-triggers","jquery","lodash","util/ajax","util/events","util/oauth"],function(a,d,c,f,e,i,h){var g="jira-ual-authenticate";h.interceptLinks("."+g);function b(j){f.bindAll(this,"show","hide","showDialog","closeDialog","destroy");j=c.extend({},this.defaults,j);if(j.triggerSelector){this._triggerInfo=d.init({selector:j.triggerSelector,headerTitleFn:typeof j.headerTitle==="function"?j.headerTitle:undefined},j);this._dialog=this._triggerInfo.getDialog()}else{this._dialog=new a(j)}i.on("stash.util.oauth.authorizationSucceeded",this._dialog.onAuthorizationSucceeded)}b.prototype.defaults=c.extend({},a.prototype.defaults,{oauthTriggerClass:g,ajax:function(j){return e.rest(c.extend({statusCode:{200:false,500:false}},j))}});b.prototype.destroy=function(){i.off("stash.util.oauth.authorizationSucceeded",this._dialog.onAuthorizationSucceeded);this._dialog.destroy();this._dialog=null;if(this._triggerInfo){this._triggerInfo.unbind();this._triggerInfo=null}};b.prototype.showDialog=b.prototype.show=function(){this._dialog.show()};b.prototype.closeDialog=b.prototype.hide=function(){this._dialog.hide()};b.prototype.setIssueKeys=function(j){this._dialog.setIssueKeys(j)};return b});; ;/* module-key = 'com.atlassian.stash.stash-jira-integration:commit-list-jira-issues', location = '/commits/commits-jira-issues.js' */ define("feature/commits/commits-jira-issues",["feature/jira/jira-issues-dialog","exports"],function(c,b){function a(e){var d=new c({id:"commits-jira-issues-dialog",triggerSelector:e})}b.onReady=function(){a(".commits-issues-trigger")}});jQuery(document).ready(function(){require("feature/commits/commits-jira-issues").onReady()});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:keyboard-shortcuts', location = '/static/widget/keyboard-shortcuts/keyboard-shortcuts.js' */ define("widget/keyboard-shortcuts",["aui","jquery","lodash","util/events","util/navigator","exports"],function(H,D,J,K,F,B){var L=/^[cC]trl$/i,I="\u2318";var A={};function G(){if(!(this instanceof G)){return new G()}this._dialog=new H.Dialog({width:830,height:580,id:"keyboard-shortcut-dialog",closeOnOutsideClick:true});this._enabledContexts=[]}G.prototype._setRegistry=function(M){this._registry=M};G.prototype._initContent=function(){this._dialog.addHeader("Keyboard shortcuts");this._dialog.addPanel("",stash.widget.keyboardShortcutsContent({contextNames:J.keys(A),contexts:J.values(A)}));this._dialog.addCancel("Close",function(M){M.hide()})};G.prototype._bind=function(M){this._$trigger=M;var N=this;this._$trigger.on("click",function(O){N._show();O.preventDefault()})};G.prototype.enableContext=function(M){if(D.inArray(M,this._enabledContexts)!==-1){return }this._registry.enableContext(M);this._enabledContexts.push(M)};G.prototype.resetContexts=function(){H.trigger("remove-bindings.keyboardshortcuts");this._enabledContexts=[];H.trigger("add-bindings.keyboardshortcuts")};G.prototype._show=function(){if(!this._hasShown){this._initContent();this._hasShown=true}this._dialog.show();this._dialog.updateHeight();this._dialog.getCurrentPanel().body.find(".keyboard-shortcut-help").focus()};G.prototype.addCustomShortcut=function(N,P,O,Q){var M=C({keys:P,context:N,displayContext:Q,description:O},{convertOSModifier:false})};G.convertOSModifier=function(M){return F.isMac()?M.replace(L,I):M};function C(M,N){M=D.extend({},M);M.keys=J.map(M.keys,function(O){return J.map(O,function(P){if(J.all(["key","modifiers"],J.partial(J.has,P))){return P}var Q=(P.length>1)?P.split("+"):P;if(!J.isArray(Q)||Q.length===1){return P}return{key:Q.pop(),modifiers:N&&N.convertOSModifier===false?Q:J.map(Q,G.convertOSModifier)}})});if(!M.displayContext){M.displayContext=G._contextDisplayInfo[M.context]?G._contextDisplayInfo[M.context].displayName:M.context.replace(/\b[a-z]/g,function(O){return O.toUpperCase()})}if(!A[M.displayContext]){A[M.displayContext]=[]}A[M.displayContext].push(M)}G.internalizeShortcuts=function(M){J.each(M,C)};G._contextDisplayInfo={repository:{displayName:"Within A Repository"},"branch-compare":{displayName:"Branch compare"},"branch-list":{displayName:"Branch list"},changeset:{displayName:"Changeset"},commits:{displayName:"Commit List"},"diff-tree":{displayName:"Changeset"},"diff-view":{displayName:"Diff View"},filebrowser:{displayName:"Directory Browsing"},global:{displayName:"Global"},"pull-request":{displayName:"Within A Pull Request"},"pull-request-list":{displayName:"Pull Request List"},"pull-request-overview":{displayName:"Within A Pull Request"},sourceview:{displayName:"Source View"}};var E=new G();B.onReady=function(){E._bind(D(".keyboard-shortcut-link"));var M=D.Deferred();D(document).ready(function(){setTimeout(function(){M.resolve()},0)});H.bind("register-contexts.keyboardshortcuts",function(O,N){E._setRegistry(N.shortcutRegistry);E.enableContext("global");M.done(function(){K.trigger("stash.widget.keyboard-shortcuts.register-contexts",E,E)})});H.bind("shortcuts-loaded.keyboardshortcuts",function(O,N){G.internalizeShortcuts(N.shortcuts)});H.params["keyboardshortcut-hash"]="bundled";H.trigger("initialize.keyboardshortcuts")};B.addTooltip=function(N,P){var M=J(P.split("+")).chain().map(G.convertOSModifier).map(function(Q){if(Q==="shift"){return "Shift"}else{if(Q==="ctrl"){return G.convertOSModifier("Ctrl")}else{return Q}}}).value().join(" + ");var O=N.attr("title");N.attr("title",O+H.format(" (Type \u0027\u0027{0}\u0027\u0027)",M));return{remove:function(){N.attr("title",O)}}};B.showDialog=function(){if(E){E._show()}};B.resetContexts=function(){E.resetContexts()}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:keyboard-shortcuts', location = '/static/widget/keyboard-shortcuts/keyboard-shortcuts.soy' */ // This file was automatically generated from keyboard-shortcuts.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.keyboardShortcutsContent = function(opt_data, opt_ignored) { var param6 = ''; var contextNameList7 = opt_data.contextNames; var contextNameListLen7 = contextNameList7.length; for (var contextNameIndex7 = 0; contextNameIndex7 < contextNameListLen7; contextNameIndex7++) { var contextNameData7 = contextNameList7[contextNameIndex7]; param6 += (contextNameIndex7 % 2 == 0) ? stash.widget.keyboardShortContext({contextName: contextNameData7, contextShortcuts: opt_data.contexts[contextNameIndex7]}) : ''; } var param5 = '' + aui.group.item({content: param6}); var param15 = ''; var contextNameList16 = opt_data.contextNames; var contextNameListLen16 = contextNameList16.length; for (var contextNameIndex16 = 0; contextNameIndex16 < contextNameListLen16; contextNameIndex16++) { var contextNameData16 = contextNameList16[contextNameIndex16]; param15 += (contextNameIndex16 % 2 == 1) ? stash.widget.keyboardShortContext({contextName: contextNameData16, contextShortcuts: opt_data.contexts[contextNameIndex16]}) : ''; } param5 += aui.group.item({content: param15}); var output = '' + aui.group.group({extraClasses: 'keyboard-shortcut-help', extraAttributes: {tabindex: '-1'}, content: param5}); return output; }; if (goog.DEBUG) { stash.widget.keyboardShortcutsContent.soyTemplateName = 'stash.widget.keyboardShortcutsContent'; } stash.widget.keyboardShortContext = function(opt_data, opt_ignored) { var output = '<div class="keyboard-shortcut-context"><h3>' + soy.$$escapeHtml(opt_data.contextName) + '</h3><dl>'; var shortcutList29 = opt_data.contextShortcuts; var shortcutListLen29 = shortcutList29.length; for (var shortcutIndex29 = 0; shortcutIndex29 < shortcutListLen29; shortcutIndex29++) { var shortcutData29 = shortcutList29[shortcutIndex29]; output += (! shortcutData29.hidden) ? stash.widget.keyboardShortcutItem({shortcut: shortcutData29}) : ''; } output += '</dl></div>'; return output; }; if (goog.DEBUG) { stash.widget.keyboardShortContext.soyTemplateName = 'stash.widget.keyboardShortContext'; } stash.widget.keyboardShortcutItem = function(opt_data, opt_ignored) { var output = '<dt>' + soy.$$escapeHtml(opt_data.shortcut.description) + '</dt>'; var optionList40 = opt_data.shortcut.keys; var optionListLen40 = optionList40.length; for (var optionIndex40 = 0; optionIndex40 < optionListLen40; optionIndex40++) { var optionData40 = optionList40[optionIndex40]; output += ((! (optionIndex40 == 0) && ! (optionIndex40 == optionListLen40 - 1)) ? '<dd class=\'separator\'>' + soy.$$escapeHtml(",") + '</dd>' : '') + ((! (optionIndex40 == 0) && optionIndex40 == optionListLen40 - 1) ? '<dd class=\'separator\'>' + soy.$$escapeHtml(" or") + '</dd>' : '') + '<dd>' + stash.widget.keyboardShortcutOption({sequence: optionData40}) + '</dd>'; } return output; }; if (goog.DEBUG) { stash.widget.keyboardShortcutItem.soyTemplateName = 'stash.widget.keyboardShortcutItem'; } stash.widget.keyboardShortcutOption = function(opt_data, opt_ignored) { var output = ''; var keypressList57 = opt_data.sequence; var keypressListLen57 = keypressList57.length; for (var keypressIndex57 = 0; keypressIndex57 < keypressListLen57; keypressIndex57++) { var keypressData57 = keypressList57[keypressIndex57]; output += ((! (keypressIndex57 == 0)) ? ' ' + soy.$$escapeHtml("then") + ' ' : '') + ((keypressData57.modifiers) ? stash.widget.keyboardShortcutModifier({keypress: keypressData57}) : stash.widget.keyboardShortcutKey({key: keypressData57})); } return output; }; if (goog.DEBUG) { stash.widget.keyboardShortcutOption.soyTemplateName = 'stash.widget.keyboardShortcutOption'; } stash.widget.keyboardShortcutModifier = function(opt_data, opt_ignored) { var output = ''; var modifierList72 = opt_data.keypress.modifiers; var modifierListLen72 = modifierList72.length; for (var modifierIndex72 = 0; modifierIndex72 < modifierListLen72; modifierIndex72++) { var modifierData72 = modifierList72[modifierIndex72]; output += stash.widget.keyboardShortcutKey({key: modifierData72}); } output += stash.widget.keyboardShortcutKey({key: opt_data.keypress.key}); return output; }; if (goog.DEBUG) { stash.widget.keyboardShortcutModifier.soyTemplateName = 'stash.widget.keyboardShortcutModifier'; } stash.widget.keyboardShortcutKey = function(opt_data, opt_ignored) { return '<kbd>' + soy.$$escapeHtml(opt_data.key) + '</kbd>'; }; if (goog.DEBUG) { stash.widget.keyboardShortcutKey.soyTemplateName = 'stash.widget.keyboardShortcutKey'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:keyboard-controller', location = '/static/widget/keyboard-controller.js' */ define("widget/keyboard-controller",["aui","jquery"],function(B,D){function A(I,G){if(!(this instanceof A)){return new A(I,G)}var F=D(I);var H;F.on("keydown",H=function(J){if(J.keyCode in G){if(!G[J.keyCode](J)){J.preventDefault()}}});this.destroy=function(){F.off("keydown",H)};return this}function C(I,G){G=D.extend({},C.defaults,G);function H(J){J.focus().addClass(G.focusedClass)}var F={};F[B.keyCode.TAB]=function(N){var K,J,L,M=N.target;K=D("a:visible, :input:visible:enabled, :checkbox:visible:enabled, :radio:visible:enabled, [tabindex]",I).not("[tabindex=-1]").filter(function(){return D(this).css("visibility")!=="hidden"});L=K.last();J=K.first();K.removeClass(G.focusedClass);if(N.shiftKey&&M===J[0]){if(!G.wrapAround){return true}H(L)}else{if(!N.shiftKey&&M===L[0]){if(!G.wrapAround){return true}H(J)}else{if(N.shiftKey){H(K.eq(K.index(M)-1))}else{H(K.eq(K.index(M)+1))}}}};return new A(I,F)}C.defaults={focusedClass:"item-focused",wrapAround:true};function E(S,T,U){U=D.extend({},E.defaults,U);var G=D(T);var R=D.Callbacks();var P=D.Callbacks();if(U.onSelect){R.add(U.onSelect)}if(U.onFocus){P.add(U.onFocus)}var J=false,F=false,L=false;function I(W){do{var X=W.find(">:first-child");var V=W.next();if(X.length){W=X}else{if(V.length){W=V}else{W=W.parentsUntil(G[0]).next().first()}}}while(W.length&&!W.is(U.itemSelector));return W}function O(X){do{var W=X.prev();if(W.length){var V;while((V=W.find(">:last-child")).length){W=V}X=W}else{X=X.parent();if(X[0]===G[0]){X=D()}}}while(X.length&&!X.is(U.itemSelector));return X}function Q(V){return function W(d){var c=D(U.itemSelector,G);var f=c.filter(function(){return D(this).hasClass(U.focusedClass)});var X=false;var g=V==="next";var a;if(f.length){if(U.adjacentItems){a=f[V](U.itemSelector)}else{if(V==="next"){a=I(f)}else{a=O(f)}}}else{if(V==="next"){a=c.first()}else{if(U.wrapAround){a=c.last()}else{return }}}L=true;if(!a.length){if(V==="next"&&U.requestMore&&!J){if(!F){L=false;var i=U.requestMore();if(i){F=true;i.done(function(e){J=e;if(!L){W(d)}}).always(function(){F=false;L=false});return }else{J=true;W(d);return }}else{L=false;return }}else{if(U.wrapAround){X=true;g=!g;a=c[V==="next"?"first":"last"]()}else{return }}}f.removeClass(U.focusedClass);a.addClass(U.focusedClass);var Y=a[V](),b=!X&&Y.length?Y:a;var Z=document.activeElement;if(U.focusIntoView&&Z){var h=b.attr("tabindex");b.attr("tabindex","0");b.focus();Z.focus();if(h==null){b.removeAttr("tabindex")}else{b.attr("tabindex",h)}}else{a[0].scrollIntoView(false)}P.fire(a,d)}}var K={};var N=K[B.keyCode.UP]=Q("prev");var H=K[B.keyCode.DOWN]=Q("next");K[B.keyCode.ENTER]=function(V){var X=D(U.itemSelector,G);var W=X.filter(function(){return D(this).hasClass(U.focusedClass)});if(W.length){R.fire(W,V)}};var M=new A(S,K);M.setListElement=function(V){G=D(V)};M.blur=function(){D(U.itemSelector,G).removeClass(U.focusedClass)};M.focus=function(){P.add.apply(P,arguments);return this};M.select=function(){R.add.apply(R,arguments);return this};M.moveToNext=H;M.moveToPrev=N;return M}E.defaults={itemSelector:"li",focusedClass:"item-focused",wrapAround:false,adjacentItems:true,requestMore:undefined,onFocus:undefined,onSelect:undefined};return{KeyboardController:A,TabKeyboardController:C,ListKeyboardController:E}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:jquery-mousewheel', location = '/static/bower/jquery-mousewheel/jquery.mousewheel.js' */ /* Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.1.1 * * Requires: 1.2.2+ */ (function(A){if(typeof define==="function"&&define.amd){define(["jquery"],A)}else{A(jQuery)}}(function(E){var D=["wheel","mousewheel","DOMMouseScroll"];var G="onwheel" in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"];var F,A;if(E.event.fixHooks){for(var B=D.length;B;){E.event.fixHooks[D[--B]]=E.event.mouseHooks}}E.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var H=G.length;H;){this.addEventListener(G[--H],C,false)}}else{this.onmousewheel=C}},teardown:function(){if(this.removeEventListener){for(var H=G.length;H;){this.removeEventListener(G[--H],C,false)}}else{this.onmousewheel=null}}};E.fn.extend({mousewheel:function(H){return H?this.bind("mousewheel",H):this.trigger("mousewheel")},unmousewheel:function(H){return this.unbind("mousewheel",H)}});function C(H){var I=H||window.event,N=[].slice.call(arguments,1),P=0,K=0,J=0,M=0,L=0,O;H=E.event.fix(I);H.type="mousewheel";if(I.wheelDelta){P=I.wheelDelta}if(I.detail){P=I.detail*-1}if(I.deltaY){J=I.deltaY*-1;P=J}if(I.deltaX){K=I.deltaX;P=K*-1}if(I.wheelDeltaY!==undefined){J=I.wheelDeltaY}if(I.wheelDeltaX!==undefined){K=I.wheelDeltaX*-1}M=Math.abs(P);if(!F||M<F){F=M}L=Math.max(Math.abs(J),Math.abs(K));if(!A||L<A){A=L}O=P>0?"floor":"ceil";P=Math[O](P/F);K=Math[O](K/A);J=Math[O](J/A);N.unshift(H,P,K,J);return(E.event.dispatch||E.event.handle).apply(this,N)}}));; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:searchable-selector', location = '/static/widget/searchable-selector/searchable-selector.soy' */ // This file was automatically generated from searchable-selector.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.searchableSelector = function(opt_data, opt_ignored) { var output = '<div class="searchable-selector ' + ((opt_data.extraClasses) ? soy.$$escapeHtml(opt_data.extraClasses) : '') + '" id="' + soy.$$escapeHtml(opt_data.id) + '">' + ((opt_data.searchable) ? '<header><label class="assistive" for="' + soy.$$escapeHtml(opt_data.id) + '-search-input">' + soy.$$escapeHtml(opt_data.searchPlaceholder ? opt_data.searchPlaceholder : "Search") + '</label><input id="' + soy.$$escapeHtml(opt_data.id) + '-search-input" type="text" name="filter" class="filter" placeholder="' + soy.$$escapeHtml(opt_data.searchPlaceholder ? opt_data.searchPlaceholder : "Search") + '"/></header>' : ''); if (opt_data.tabs && opt_data.tabs.length > 1) { output += '<div class="aui-tabs horizontal-tabs"><ul class="tabs-menu">'; var tabList24 = opt_data.tabs; var tabListLen24 = tabList24.length; for (var tabIndex24 = 0; tabIndex24 < tabListLen24; tabIndex24++) { var tabData24 = tabList24[tabIndex24]; output += aui.tabMenuItem({url: '#' + soy.$$escapeHtml(opt_data.id) + '-tab-pane-' + soy.$$escapeHtml(tabIndex24), text: tabData24.label, isActive: tabIndex24 == 0, extraAttributes: {'data-tab-id': tabIndex24}}); } output += '</ul>'; var tabList36 = opt_data.tabs; var tabListLen36 = tabList36.length; for (var tabIndex36 = 0; tabIndex36 < tabListLen36; tabIndex36++) { var tabData36 = tabList36[tabIndex36]; output += aui.tabPane({content: '<ul class="results-list"></ul><div class="spinner"></div>', id: opt_data.id + '-tab-pane-' + tabIndex36, isActive: tabIndex36 == 0, extraClasses: 'results', extraAttributes: {'data-tab-id': tabIndex36}}); } output += '</div>'; } else { output += '<div class="results"><ul class="results-list"></ul><div class="spinner"></div></div>'; } output += '</div>'; return output; }; if (goog.DEBUG) { stash.widget.searchableSelector.soyTemplateName = 'stash.widget.searchableSelector'; } stash.widget.searchableSelectorResults = function(opt_data, opt_ignored) { var output = ''; var resultList50 = opt_data.values; var resultListLen50 = resultList50.length; for (var resultIndex50 = 0; resultIndex50 < resultListLen50; resultIndex50++) { var resultData50 = resultList50[resultIndex50]; output += '<li class="result ' + ((opt_data.isPreload) ? 'preload' : '') + '"><a href="' + soy.$$escapeHtml(resultData50.url ? resultData50.url : '#') + '" tabindex="-1" data-id="' + soy.$$escapeHtml(resultData50.id) + '" data-item="' + soy.$$escapeHtml(JSON.stringify(resultData50).replace(/\//g, '\\/')) + '">' + soy.$$escapeHtml(resultData50.name) + '</a></li>'; } output += (opt_data.isLastPage) ? (opt_data.size > 0) ? '<li class="no-results">' + soy.$$escapeHtml(opt_data.noMoreResultsText ? opt_data.noMoreResultsText : "No more results") + '</li>' : '<li class="no-results">' + soy.$$escapeHtml(opt_data.noResultsText ? opt_data.noResultsText : "No results") + '</li>' : ''; return output; }; if (goog.DEBUG) { stash.widget.searchableSelectorResults.soyTemplateName = 'stash.widget.searchableSelectorResults'; } stash.widget.searchableSelectorTrigger = function(opt_data, opt_ignored) { return '' + stash.widget.searchableSelectorTriggerGeneric({id: opt_data.id, content: '' + stash.widget.searchableSelectorTriggerContent(opt_data), autofocus: opt_data.autofocus, extraClasses: opt_data.extraClasses, extraAttributes: opt_data.extraAttributes}); }; if (goog.DEBUG) { stash.widget.searchableSelectorTrigger.soyTemplateName = 'stash.widget.searchableSelectorTrigger'; } stash.widget.searchableSelectorTriggerGeneric = function(opt_data, opt_ignored) { return '<button ' + ((opt_data.id) ? 'id="' + soy.$$escapeHtml(opt_data.id) + '" ' : '') + 'type="button" class="aui-button searchable-selector-trigger' + aui.renderExtraClasses(opt_data) + '"' + ((opt_data.autofocus) ? ' autofocus' : '') + aui.renderExtraAttributes(opt_data) + '>' + soy.$$filterNoAutoescape(opt_data.content) + '</button>'; }; if (goog.DEBUG) { stash.widget.searchableSelectorTriggerGeneric.soyTemplateName = 'stash.widget.searchableSelectorTriggerGeneric'; } stash.widget.searchableSelectorTriggerWithField = function(opt_data, opt_ignored) { return '' + stash.widget.searchableSelectorTrigger(opt_data) + widget.aui.form.input({id: opt_data.fieldId ? opt_data.fieldId : opt_data.id + '-field', name: opt_data.fieldName ? opt_data.fieldName : opt_data.id + '-field', initialValue: opt_data.item ? opt_data.item.id : null, type: 'hidden'}); }; if (goog.DEBUG) { stash.widget.searchableSelectorTriggerWithField.soyTemplateName = 'stash.widget.searchableSelectorTriggerWithField'; } stash.widget.searchableSelectorTriggerContent = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '' + ((opt_data.item) ? '<span class="name" data-id="' + soy.$$escapeHtml(opt_data.item.id) + '" data-item="' + soy.$$escapeHtml(JSON.stringify(opt_data.item).replace(/\//g, '\\/')) + '">' + soy.$$escapeHtml(opt_data.item.name) + '</span>' : '<span class="placeholder">' + soy.$$escapeHtml(opt_data.text ? opt_data.text : "Select item") + '</span>'); }; if (goog.DEBUG) { stash.widget.searchableSelectorTriggerContent.soyTemplateName = 'stash.widget.searchableSelectorTriggerContent'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:searchable-selector', location = '/static/widget/searchable-selector/searchable-selector.js' */ define("widget/searchable-selector",["aui","jquery","lodash","util/ajax","util/dom-event","util/events","util/navigator","util/promise","widget/keyboard-controller","widget/paged-scrollable"],function(M,D,N,L,H,O,J,B,G,K){var C=G.TabKeyboardController;var E=G.ListKeyboardController;var I=0;function F(Q,P){return this.init.apply(this,arguments)}F.prototype.defaults={id:null,extraClasses:null,namespace:"searchable-selector",url:null,tabs:null,searchable:true,searchPlaceholder:null,queryParamKey:"filter",queryParamsBuilder:null,pageSize:20,statusCodeHandlers:{},followLinks:false,hideDialogOnSelect:true,itemSelectedEvent:"stash.widget.searchableSelector.itemSelected",context:null,field:null,itemDataKey:"item",template:stash.widget.searchableSelector,resultsTemplate:stash.widget.searchableSelectorResults,noResultsText:null,noMoreResultsText:null,triggerContentTemplate:stash.widget.searchableSelectorTriggerContent,triggerPlaceholder:null,preloadData:null,alwaysShowPreload:false,dataTransform:null,postOptionsInit:null,clearResultsOnSearch:true,popUpOffsetX:0,popUpOffsetY:-1,width:350};F.constructDataPageFromPreloadArray=function(P){if(!N.isArray(P)){return null}return{values:P,isLastPage:false,size:P.length,start:0,limit:P.length}};F.prototype.tabOptionKeys=["label","url","resultsTemplate","noResultsText","noMoreResultsText","dataTransform","queryParamKey","preloadData","searchPlaceholder"];F.prototype.init=function(R,Q){var P=this;this.instanceId=I++;this.$trigger=D(R);this.setOptions(Q);this.scrollables=[];this.scrollableDataStores=[];if(!this._getOptionVal("id")){this.options.id=this._getOptionVal("namespace")+"-"+this.instanceId}if(this.options.tabs&&this.options.tabs.length){this.tabs=N.map(this.options.tabs,function(V){return D.extend(true,{},N.pick(P.options,P.tabOptionKeys),V)})}var U=this._getOption("postOptionsInit");if(N.isFunction(U)){U.call(this)}var T;this.blockShortcutPropagation=T=function(V){var W=(this===document);if(V.keyCode===M.keyCode.ESCAPE){V[W?"stopImmediatePropagation":"stopPropagation"]();P.dialog.hide()}else{if(!W){V.stopPropagation()}}};var S=P._getOptionVal("externalSearchField");this.dialog=M.InlineDialog(this.$trigger,this._getOptionVal("id"),function(W,V,X){if(!W.data("initialised")){P._initialiseDialogContent(W)}X();if(!S){N.defer(N.bind(P.setFocus,P))}},{offsetX:this._getOptionVal("popUpOffsetX"),offsetY:this._getOptionVal("popUpOffsetY"),noBind:!!S,width:this._getOptionVal("width"),hideCallback:function(){if(P.$content.is(document.activeElement)||D.contains(P.$content[0],document.activeElement)){P.$trigger.focus()}D(document).add(P.dialog).off("keydown keypress",T)},initCallback:function(){D(document).add(P.dialog).on("keydown keypress",T)}});if(this._getOptionVal("searchable")&&S){this.$searchField=D(S);this._initialiseSearchOnInput()}if(this.$trigger.find(".name").length){this._selectedItem=this._getItemFromTrigger()}M.bind("hide.dialog",function(W,V){if(P.$trigger.closest(V.dialog.popup.element).length){P.dialog.hide()}});return this};F.prototype.getSelectedItem=function(){return this._selectedItem};F.prototype.setSelectedItem=function(P){if(D.isPlainObject(P)&&P.id!=null){if(!this._selectedItem||this._selectedItem.id!==P.id){this._itemSelected(P)}}};F.prototype.clearSelection=function(){this._selectedItem=null;if(this._getOptionVal("field")){D(this._getOptionVal("field")).val("")}this.resetTrigger()};F.prototype._getItemFromTrigger=function(){var P=this.$trigger.find(".name");return D.extend({},this._buildObjectFromElementDataAttributes(P),{name:P.text()})};F.prototype._buildObjectFromElementDataAttributes=function(P){return D(P).data(this._getOptionVal("itemDataKey"))};F.prototype._initialiseDialogContent=function(Q){var P=this;var R=this._getOptionVal("searchable");var S=this._getOptionVal("externalSearchField");Q.append(this._getOption("template")({id:this._getOptionVal("id"),tabs:this.tabs,searchable:!S&&R,searchPlaceholder:this._getOptionVal("searchPlaceholder"),extraClasses:this._getOptionVal("extraClasses")}));Q.closest(".aui-inline-dialog").addClass("searchable-selector-dialog");if(R&&!S){this.$searchField=Q.find("input.filter");this._initialiseSearchOnInput()}if(this.tabs){var T=Q.find("ul.tabs-menu a");T.on("tabSelect",function(V,U){P.currentTabId=U.tab.parent().data("tab-id");if(P._getOptionVal("searchable")||P._getDataStoreForScrollable().length===0){P._populateScrollable()}P._resultsKeyboardController.setListElement(P._getCurrentScrollable().$scrollElement.find("ul.results-list"));if(R){P.$searchField.focus()}P._updateSearchPlaceholder()});T.on("click",function(U){if(D(this).parent().hasClass("active-tab")){U.stopPropagation();U.preventDefault()}});T.on("keydown",function(V){if(V.keyCode===M.keyCode.ENTER){var U=D(this);if(U.parent("li").hasClass("active-tab")){V.preventDefault()}else{U.click()}}});M.tabs.setup()}Q.find(".results").each(function(){P.scrollables.push(P._createScrollable(D(this)));P.scrollableDataStores.push([])});Q.on("click",".result a",function(U){P.selectItem(U,D(this))});this._initialiseKeyboardNavigation(Q);this._populateScrollable();this.$content=Q;Q.data("initialised",true)};F.prototype._initialiseSearchOnInput=function(){var Q=this;var R=this._getSearchTerm();var S=this._getOptionVal("externalSearchField");var T=B.delay(N.bind(this._handleSearchInput,this),350);var P=N.bind(function(){if(R!==(R=this._getSearchTerm())){if(!this._pendingSearch){this._pendingSearch=T(R);this._pendingSearch.always(function(){Q._pendingSearch=null})}else{this._pendingSearch.reset(R)}}},this);this.$searchField.on("keydown.searchable-selector input.searchable-selector",N.bind(function(U){if(S){if(U.which===M.keyCode.ESCAPE){this._pendingSearch&&this._pendingSearch.abort()}else{if(U.which===M.keyCode.DOWN&&this._shouldSearch(R)){this.dialog.show()}else{if(U.which===M.keyCode.ENTER&&!this.dialog.is(":visible")){this._pendingSearch&&this._pendingSearch.done(function(){var V=Q._getCurrentScrollable().$scrollElement.find("ul.results-list li.result:first");Q._clickItem(V)})}}}}N.defer(P)},this))};F.prototype._handleSearchInput=function(P){var Q=this._getOptionVal("externalSearchField");if(Q){if(this._shouldSearch(P)){if(!this.dialog.is(":visible")){this.dialog.show()}return this._populateScrollable()}else{this.dialog.hide();return D.Deferred().reject().promise()}}else{return this._populateScrollable()}};F.prototype._initialiseKeyboardNavigation=function(R){var S=this;var Q;var T=false;var P=function(V){var W=S.dialog.is(":visible");if(S._getOptionVal("externalSearchField")&&!W){return }if(T&&!W){S.$trigger.click()}else{S._clickItem(V)}};if(this._resultsKeyboardController){this._resultsKeyboardController.destroy()}if(this.$searchField){Q=this.$searchField}else{if(this.tabs){Q=R.find("ul.tabs-menu")}else{Q=this.$trigger;T=true}}var U=S._getCurrentScrollable().$scrollElement.find("ul.results-list");this._resultsKeyboardController=new E(Q,U,{wrapAround:false,focusedClass:"focused",itemSelector:"li.result",requestMore:function(){var V=S._getCurrentScrollable().loadAfter();return V&&V.then(function(W){return W.isLastPage})},onSelect:function(V){if(S._pendingSearch){S._pendingSearch.done(function(){var W=U.find("li.result:first");if(W.length){P(W)}})}else{P(V)}},focusIntoView:true,adjacentItems:S._getOptionVal("adjacentItems")});if(this._tabKeyboardController){this._tabKeyboardController.destroy()}if(J.isMozilla()||J.isWebkit()){R.addClass("override-focus-style")}this._tabKeyboardController=new C(R)};F.prototype._clickItem=function(P){P.children("a").each(function(){this.click()})};F.prototype.setFocus=function(){if(this.$searchField){this.$searchField.focus()}else{if(this.tabs){this.$content.find("ul.tabs-menu a").first().focus()}else{this.$trigger.focus()}}};F.prototype._createScrollable=function(P){var Q=new K(P,{pageSize:this._getOptionVal("pageSize"),bufferPixels:0,preventOverscroll:true});Q.requestData=N.bind(this.getResults,this,Q);Q.attachNewContent=N.bind(this.addResultsToList,this,Q,false);return Q};F.prototype._populateScrollable=function(Q){Q=Q||this._getCurrentScrollable();this._emptyScrollable(Q);var P=this._getPreloadData();var S=0;if(P){S=this.addResultsToList(Q,true,P)}var R=Q.init();if(S>0){return D.Deferred().resolve().promise()}else{return R}};F.prototype._getPreloadData=function(){var Q=this._getOptionVal("preloadData");var R=this._getSearchTerm();if(Q&&(this._getOptionVal("alwaysShowPreload")||R==="")){var P=this._getOption("dataTransform");if(N.isFunction(P)){Q=P.call(this,Q,R)}}else{Q=null}return Q};F.prototype._emptyScrollable=function(P){P=P||this._getCurrentScrollable();P.reset();this._getDataStoreForScrollable(P).length=0;if(this._getOptionVal("clearResultsOnSearch")){P.$scrollElement.children("ul.results-list").empty()}};F.prototype._getCurrentScrollable=function(){return this.scrollables[this.tabs&&this.currentTabId?this.currentTabId:0]};F.prototype._getDataStoreForScrollable=function(Q){if(!Q){return this.scrollableDataStores[this.tabs&&this.currentTabId?this.currentTabId:0]}var P=N.indexOf(this.scrollables,Q);if(P!==-1){return this.scrollableDataStores[P]}else{return null}};F.prototype._getSearchTerm=function(){return(this.$searchField)?this.$searchField.val():""};F.prototype._updateSearchPlaceholder=function(){if(this.$searchField){this.$searchField.attr("placeholder",this._getOptionVal("searchPlaceholder"))}};F.prototype._getOptionVal=function(P){return this._getOption(P,true)};F.prototype._getOption=function(P,R){var Q;if(this.tabs&&N.contains(this.tabOptionKeys,P)){Q=this.tabs[this.currentTabId||0][P]}else{Q=this.options[P]}return(R)?A(Q,this):Q};F.prototype.setOptions=function(P){this.options=D.extend(true,{},this.defaults,P)};F.prototype.getResults=function(U,W,P){var Q=this;if(this.currentXHR&&this.currentXHR.abort){this.currentXHR.abort()}var T=this._getOption("queryParamsBuilder")||this._defaultQueryParamsBuilder;var S=T.call(this,this._getSearchTerm(),W,P);if(S===null){return D.Deferred().reject().promise()}var V=U.$scrollElement.children("ul.results-list");this._showSpinner(U);V.scrollTop(V[0].scrollHeight);var R=this.currentXHR=L.rest({url:this._getOptionVal("url"),data:S,statusCode:this._getOptionVal("statusCodeHandlers")});R.always(function(){Q._hideSpinner(U);Q.currentXHR=null});return R};F.prototype._showSpinner=function(P){P.$scrollElement.children(".spinner").show().spin()};F.prototype._hideSpinner=function(P){P.$scrollElement.children(".spinner").spinStop().hide()};F.prototype._shouldSearch=function(P){var Q=this._getOption("queryParamsBuilder")||this._defaultQueryParamsBuilder;return Q.call(this,P,0,this._getOptionVal("pageSize"))!=null};F.prototype._defaultQueryParamsBuilder=function(Q,S,P){var R={start:S,limit:P};if(this._getOptionVal("searchable")){R[this._getOptionVal("queryParamKey")]=Q}return R};F.prototype.addResultsToList=function(V,Q,T){var X=this._getOption("dataTransform");var W;if(N.isFunction(X)){T=X.call(this,T,this._getSearchTerm())}if(!Q&&(W=this._getPreloadData())){T=this.dedupeData(T,W)}T=D.extend({},T,{isPreload:Q,noResultsText:this._getOptionVal("noResultsText"),noMoreResultsText:this._getOptionVal("noMoreResultsText")});var U=D(this._getOption("resultsTemplate")(T));var S=this._getDataStoreForScrollable(V);S.push.apply(S,T.values);var R=V.$scrollElement.children("ul.results-list");var P=T.start===0&&!(W&&W.size>0)&&(!Q||T.size>0);if(P){R.empty()}R.append(U).attr("data-last-updated",new Date().getTime());if(P&&T.size>0){this._resultsKeyboardController.moveToNext()}return T.size};F.prototype.dedupeData=function(Q,P){if(Q&&Q.values&&P&&P.values){Q=D.extend(true,{},Q);Q.values=N.reject(Q.values,function(R){return N.find(P.values,function(S){return R.id===S.id})})}return Q};F.prototype.selectItem=function(R,Q){var S=Q.data("id");var P=N.find(this._getDataStoreForScrollable(),function(T){return T.id===S});if(Q.attr("href")!=="#"&&(this._getOptionVal("followLinks")||!H.openInSameTab)){}else{R.preventDefault()}if(!this._selectedItem||this._selectedItem.id!==P.id){this._itemSelected(P)}if(this._getOptionVal("hideDialogOnSelect")){this.dialog.hide()}};F.prototype._itemSelected=function(P){this._selectedItem=P;if(this._getOptionVal("field")){D(this._getOptionVal("field")).val(P.id)}this.updateTrigger({item:P});O.trigger(this._getOptionVal("itemSelectedEvent"),this,P,this._getOptionVal("context"))};F.prototype.updateTrigger=function(P){if(!this._getOptionVal("externalSearchField")){this.$trigger.html(this._getOption("triggerContentTemplate")(P||{}))}};F.prototype.resetTrigger=function(){this.updateTrigger({text:this._getOptionVal("triggerPlaceholder")})};F.prototype.destroy=function(){if(this.blockShortcutPropagation){D(document).add(this.dialog).off("keydown keypress",this.blockShortcutPropagation)}if(this._getOptionVal("externalSearchField")){this.$searchField.off(".searchable-selector")}if(this.dialog){this.dialog.hide();this.dialog.remove();this.dialog=null}if(this._resultsKeyboardController){this._resultsKeyboardController.destroy();this._resultsKeyboardController=null}if(this._tabKeyboardController){this._tabKeyboardController.destroy();this._tabKeyboardController=null}this.$trigger=null;this.scrollables=null;this.scrollableDataStores=null;this.tabs=null;this._initialiseDialogContent=D.noop};function A(Q,P){return N.isFunction(Q)?Q.call(P):Q}return F});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-item', location = '/static/feature/repository/repository-item/repository-item.soy' */ // This file was automatically generated from repository-item.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.repository. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; } stash.feature.repository.repositoryItem = function(opt_data, opt_ignored) { return '<span class="repository-item" title="' + soy.$$escapeHtml(opt_data.repository.project.name) + ' / ' + soy.$$escapeHtml(opt_data.repository.name) + '" data-id="' + soy.$$escapeHtml(opt_data.repository.id) + '" data-repository="' + soy.$$escapeHtml(JSON.stringify(opt_data.repository).replace(/\//g, '\\/')) + '">' + stash.feature.repository.repositoryItemContent({avatarTagName: 'span', repository: opt_data.repository}) + '</span>'; }; if (goog.DEBUG) { stash.feature.repository.repositoryItem.soyTemplateName = 'stash.feature.repository.repositoryItem'; } stash.feature.repository.repositoryItemContent = function(opt_data, opt_ignored) { return stash.feature.project.avatar({size: 'xsmall', project: opt_data.repository.project, tagName: opt_data.avatarTagName}) + '<span class="project-and-repository"><span class="project-name">' + ((opt_data.projectNameContent) ? soy.$$filterNoAutoescape(opt_data.projectNameContent) : soy.$$escapeHtml(opt_data.repository.project.name)) + '</span><span class="separator">/</span><span class="name">' + ((opt_data.repositoryNameContent) ? soy.$$filterNoAutoescape(opt_data.repositoryNameContent) : soy.$$escapeHtml(opt_data.repository.name)) + '</span></span>'; }; if (goog.DEBUG) { stash.feature.repository.repositoryItemContent.soyTemplateName = 'stash.feature.repository.repositoryItemContent'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:internal-regexp-util', location = '/static/bower/atlassian-regexp/lib/internal/util/regexp.js' */ define("internal/util/regexp",["exports"],function(A){function B(C){return C.replace(/[\-\[\]{}()+?.,\\\^$|#\s]/g,"\\$&")}A.escape=B});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:internal-highlight-text-util', location = '/static/bower/atlassian-highlight-text/lib/internal/util/highlight-text.js' */ define("internal/util/highlight-text",["internal/util/regexp"],function(D){var C=/[&"'<>`]/g;var E=function(G){var F={"<":"<",">":">","&":"&","'":"'","`":"`"};if(F.hasOwnProperty(G)){return F[G]}return"""};var A=function(F){return F.replace(C,E)};var B=function(F){return D.escape(A(F))};return{highlight:function(K,H,G){if(!H||H.length===0){return A(K)}var J=(typeof H==="string")?B(H):H.map(B).join("|");var F=(G==null)?"gi":G;var I=new RegExp(J,F);return A(K).replace(I,"<mark>$&</mark>")}}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:highlight-text-util', location = '/static/util/highlight-text.js' */ define("util/highlight-text",["internal/util/highlight-text"],function(A){return A});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-menu-items', location = '/static/feature/repository/menu-items/repository-menu-items.soy' */ // This file was automatically generated from repository-menu-items.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.repository. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; } stash.feature.repository.menuItems = function(opt_data, opt_ignored) { var output = ''; var repoList3 = opt_data.repos; var repoListLen3 = repoList3.length; for (var repoIndex3 = 0; repoIndex3 < repoListLen3; repoIndex3++) { var repoData3 = repoList3[repoIndex3]; output += '<li class="repository-item repository-menu-item' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '"><a data-proj-key="' + soy.$$escapeHtml(repoData3.project.key) + '" data-repo-slug="' + soy.$$escapeHtml(repoData3.slug) + '" data-repo-id="' + soy.$$escapeHtml(repoData3.id) + '" href="' + soy.$$escapeHtml(require('stash/api/util/navbuilder').project(repoData3.project.key).repo(repoData3.slug).browse().build()) + '" title="' + soy.$$escapeHtml(AJS.format("Go to repository \x22{0}\x22 in project \x22{1}\x22",repoData3.name,repoData3.project.name)) + '">' + stash.feature.repository.repositoryItemContent({repository: repoData3, projectNameContent: require('util/highlight-text').highlight(repoData3.project.name, opt_data.projectHighlightText, 'i'), repositoryNameContent: require('util/highlight-text').highlight(repoData3.name, opt_data.repositoryHighlightText, 'i')}) + '</a></li>'; } return output; }; if (goog.DEBUG) { stash.feature.repository.menuItems.soyTemplateName = 'stash.feature.repository.menuItems'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-search', location = '/static/feature/repository/repository-search/repository-search.soy' */ // This file was automatically generated from repository-search.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.repository. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; } stash.feature.repository.repositorySearch = function(opt_data, opt_ignored) { return '<form class="aui-quicksearch"><div class="repository-search-trigger"><label class="assistive" for="repository-search">' + soy.$$escapeHtml("Find a repository...") + '</label><input id="repository-search" type="text" autocomplete="off" placeholder="' + soy.$$escapeHtml("Find a repository...") + '"/><div class="spinner"></div></div></form>'; }; if (goog.DEBUG) { stash.feature.repository.repositorySearch.soyTemplateName = 'stash.feature.repository.repositorySearch'; } stash.feature.repository.repositorySearchResults = function(opt_data, opt_ignored) { return '' + ((! (opt_data.isPreload && opt_data.size == 0)) ? '<div class="results-section' + ((opt_data.isPreload) ? ' recently-viewed' : '') + '">' + stash.feature.repository.menuItems({repos: opt_data.values, extraClasses: 'result', projectHighlightText: opt_data.projectSearchTerm, repositoryHighlightText: opt_data.repositorySearchTerm}) + ((opt_data.isLastPage) ? (opt_data.size > 0) ? '<li class="no-results">' + soy.$$escapeHtml(opt_data.noMoreResultsText) + '</li>' : '<li class="no-results">' + soy.$$escapeHtml(opt_data.noResultsText) + '</li>' : '') + '</div>' : ''); }; if (goog.DEBUG) { stash.feature.repository.repositorySearchResults.soyTemplateName = 'stash.feature.repository.repositorySearchResults'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-search', location = '/static/feature/repository/repository-search/repository-search.js' */ define("feature/repository/repository-search",["aui","jquery","lodash","xregexp","stash/api/util/navbuilder","util/events","widget/searchable-selector"],function(F,B,G,E,A,I,D){var C=null;I.on("stash.feature.repositories.recent.loaded",function(J){C=J});var H=function(M,K,J){J=J||{};J.externalSearchField=M;var L=this.init(K,J);L._bindSearchFieldEvents();L.dialog.on("click","a",function(){I.trigger("internal.stash.ui.nav.search.result.clicked",null,{repositoryId:B(this).attr("data-repo-id")})});return L};B.extend(H.prototype,D.prototype);H.prototype._generatePreloadData=function(){if(C==null){return null}var J;var L=this._parseSearchTerm(this._getSearchTerm());if(L){var M=L.projectName&&new RegExp("^"+E.escape(L.projectName),"i");var K=L.repositoryName&&new RegExp("^"+E.escape(L.repositoryName),"i");J=G.filter(C.values,function(N){return(L.projectName==null||N.project.name.match(M)!=null)&&(L.repositoryName==null||N.name.match(K)!=null)})}else{J=C.values}J.sort(function(O,N){return(L&&L.projectName?O.project.name.localeCompare(N.project.name):0)||O.name.localeCompare(N.name)||O.id-N.id});return G.extend({},C,{values:J,size:J.length,isLastPage:false})};H.prototype.defaults=B.extend({},D.prototype.defaults,{extraClasses:"repository-search-dialog",url:A.rest().allRepos().withParams({avatarSize:stash.widget.avatarSizeInPx({size:"xsmall"})}).build(),queryParamsBuilder:function(K,M,J){var L=this._parseSearchTerm(K);if(L==null){return null}return{start:M,limit:J,name:L.repositoryName,projectname:L.projectName}},dataTransform:function(L,J){var K=this._parseSearchTerm(J);if(K==null){return L}return B.extend({repositorySearchTerm:K.repositoryName,projectSearchTerm:K.projectName},L)},preloadData:H.prototype._generatePreloadData,alwaysShowPreload:true,followLinks:true,resultsTemplate:stash.feature.repository.repositorySearchResults,noResultsText:"No repositories matching your search",noMoreResultsText:"No more repositories",adjacentItems:false,clearResultsOnSearch:false,popUpOffsetY:1});H.prototype._bindSearchFieldEvents=function(){var J=this;this.$searchField.on("keydown.repository-search",function(K){if(K.which===F.keyCode.ENTER){K.preventDefault()}});this.$searchField.on("keyup.repository-search",function(K){var L=J.dialog.is(":visible");if(!L&&K.which===F.keyCode.ESCAPE){B(this).blur()}});this.$searchField.on("focus",function(){I.trigger("internal.stash.ui.nav.search.focused")})};H.prototype._parseSearchTerm=function(J){J=B.trim(J);if(J===""||J==="/"){return null}var L={};var K=J.lastIndexOf("/");if(K===-1){L.projectName=null;L.repositoryName=J}else{L.projectName=B.trim(J.substr(0,K));L.repositoryName=B.trim(J.substr(K+1))}return L};H.prototype._showSpinner=function(J){J.$scrollElement.find(".spinner").hide();this.$searchField.closest(".aui-quicksearch").addClass("loading");this.$searchField.next(".spinner").spin()};H.prototype._hideSpinner=function(){this.$searchField.closest(".aui-quicksearch").removeClass("loading");this.$searchField.next(".spinner").spinStop()};return H});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:base-layout', location = '/static/layout/base/base.js' */ define("layout/base",["aui","jquery","lodash","memoir","stash/api/util/navbuilder","util/analytics","util/client-storage","util/events","model/page-state","model/stash-user","widget/aui/dropdown","widget/aui/form","feature/repository/repository-search","exports"],function(J,F,Q,M,I,H,K,C,L,N,P,D,A,R){if(location.search){var G=I.parse(location.href),B=G.getQueryParamValue("eve");B&&C.on(B,function(){console.log([C.name()],this,arguments)})}function O(S){if(S){S.isAdmin=!!F("#header").find("a.admin-link").length;L.setCurrentUser(new N(S))}}function E(S){if(!K.getSessionItem(S)){K.setSessionItem(S,true);H.add("demographics",{d_lang:document.documentElement.lang},true)}}R.onReady=function(V,T){O(V);P.onReady();D.onReady();J.params["build-number"]=encodeURIComponent(F("#product-version").attr("data-system-build-number"));var W=F(window);var U=Q.debounce(function(){C.trigger("window.resize.debounced",W,W.width(),W.height())},200);W.on("resize",U);var X=Q.throttle(function(){C.trigger("window.scroll.throttled",W,W.scrollTop())},25);W.on("scroll",X);var S=F("#repository-search");new A(S,S.closest(".repository-search-trigger"));M.setTitleSuffix(" - "+T);E(K.buildKey("demographic-analytics","user"))};C.on("memoir.changestate",function(T){var S=F("#login-link");if(S.length&&T.state){S.attr("href",I.login().next().build())}F("body").children(".tipsy").remove()})});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:quick-copy-text', location = '/static/widget/quick-copy-text.js' */ define("widget/quick-copy-text",["jquery","exports"],function(B,A){var C=true;A.onReady=function(){if(C){C=false;B(document).on("click",".quick-copy-text",function(D){this.focus();this.select()})}}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:browser-location', location = '/static/util/browser-location.js' */ define("util/browser-location",["exports"],function(A){A.location=window.location});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:sticky-branches', location = '/static/feature/repository/sticky-branches.js' */ define("feature/repository/sticky-branches",["jquery","stash/api/util/navbuilder","util/browser-location","util/client-storage","util/events","util/text","exports"],function(E,A,B,C,L,F,D){var I;var J;var K;D.onReady=function(){var P=A.parse(B.location.href),S=A.currentRepo().browse().build(),T=A.currentRepo().commits().build(),O=P.path().indexOf(S)===0,U=P.path()===T,X=O?P.getQueryParamValue("at"):U?P.getQueryParamValue("until"):undefined,M=O||U,W=C.buildKey("current-branch","repo"),V=C.getSessionItem(W);I=E("#repository-nav-files");J=E("#repository-nav-commits");K=E("#repository-nav-branches");var Q;if(X&&O){var R=E("[data-revision-ref]","#repository-layout-revision-selector").data("revision-ref");Q=R&&((R.id===X&&R.type.id==="commit")||(R.id!==X&&(R.type.id==="branch"||R.type.id==="tag")&&/^[0-9a-f]{7,40}$/.test(X)))}var N=!(O&&Q);if(X&&N){X=decodeURIComponent(X);if(X!==V){C.setSessionItem(W,X)}H(X)}else{if(M&&N){C.removeSessionItem(W)}else{if(V){H(V)}}}L.on("stash.layout.branch.revisionRefChanged",function(Y){if(Y){if(!Y.getIsDefault()){var Z=Y.getId();H(Z);C.setSessionItem(W,Z)}else{G();C.removeSessionItem(W)}}});L.on("stash.*.*.revisionRefRemoved",function(Z){var Y=C.getSessionItem(W);if(Y&&F.endsWith(Z.id,Y)){G();C.removeSessionItem(W)}})};function H(M){if(M){M=encodeURIComponent(M);I.attr("href",A.parse(I.attr("href")).replaceQueryParam("at",M));J.attr("href",A.parse(J.attr("href")).replaceQueryParam("until",M));K.attr("href",A.parse(K.attr("href")).replaceQueryParam("base",M))}else{G()}}function G(){I.attr("href",A.parse(I.attr("href")).deleteQueryParam("at"));J.attr("href",A.parse(J.attr("href")).deleteQueryParam("until"));K.attr("href",A.parse(K.attr("href")).deleteQueryParam("base"))}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-public-lozenge', location = '/static/feature/repository/public-lozenge/public-lozenge.soy' */ // This file was automatically generated from public-lozenge.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.repository. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; } stash.feature.repository.publicLozenge = function(opt_data, opt_ignored) { return '' + ((true && (opt_data.repository['public'] || opt_data.repository.project['public'])) ? '<div class="public-lozenge aui-lozenge aui-lozenge-subtle">' + soy.$$escapeHtml("Public") + '</div>' : ''); }; if (goog.DEBUG) { stash.feature.repository.publicLozenge.soyTemplateName = 'stash.feature.repository.publicLozenge'; } ; ;/* module-key = 'com.atlassian.plugins.atlassian-chaperone:internals', location = '/internals/syncing.js' */ var Chaperone={_internal:{}};Chaperone._internal.syncing=(function(){function a(c,d){return(d||AJS.$).ajax({url:AJS.contextPath()+"/rest/chaperone/1/chaperone/"+c})}function b(c,e,d){return(d||AJS.$).ajax({url:AJS.contextPath()+"/rest/chaperone/1/chaperone/"+c,type:"POST",data:{json:e}})}return{syncToServer:b,syncFromServer:a}})();; ;/* module-key = 'com.atlassian.plugins.atlassian-chaperone:feature-discovery', location = '/feature-discovery/feature-discovery.js' */ (function(i,g,k,e,f){var j=e.syncFromServer;var h=e.syncToServer;var c=g.Callbacks();g(document).on("ajaxStop",function(){c.fire()});var b=g.Callbacks();g(window).on("resize",function(){b.fire()});function a(l){var m=g.Deferred();function n(){var o=g(l);if(o.length){m.resolve(o);c.remove(n)}}c.add(n);n();return m}function d(p,r,m,o){var l=g.Callbacks();var n=g.Callbacks();var s=g.Callbacks();function q(u){var w;function t(y){return function(){g(document).off("hideLayer",v);u.off(".chaperone");w.remove();b.remove(w.refresh);c.remove(x);if(y){y.fire()}}}function x(){if(!u.is(":visible")){t()()}}var v=t(l);w=new i.InlineDialog(u,"feature-discovery-"+p,function(A,y,D){A.html(chaperone.featureDiscovery.content({step:r,paging:m}));var C=A.find(".feature-discovery-action");var z=A.find(".feature-discovery-next");var B=A.find(".feature-discovery-close");if(r.action&&r.action.click){C.click(r.action.click)}u.on("click.chaperone",t(s));z.click(t(n));B.click(v);C.click(t(s));D();if(!o.modal){k.delay(function(){g(document).on("showLayer",v)},100)}},{closeOthers:false,hideDelay:null,noBind:true,gravity:r.gravity||(r.dir||"s").replace(/[nswe]/g,function(y){return{n:"s",s:"n",e:"w",w:"e"}[y]}),offsetX:r.offsetX,offsetY:r.offsetY,persistent:true,width:r.width||300,addActiveClass:false});b.add(w.refresh);c.add(x);w.show()}return{showWhenTargetVisible:function(){return a(r.selector).then(q)},on:function(t,u){switch(t){case"close":l.add(u);break;case"next":n.add(u);break;case"action":s.add(u);break}}}}f.registerFeature=function(n,l,m){m=m||{};var p=j(n).pipe(function(q){q=q||{};if(q.isAllDismissed){return g.Deferred().reject()}return q});function o(t,r,q){var s=r.stepInfoById[t.id||t.selector];switch(m.dismissalMode){case"progressive":s.isDismissed=true;h(n,JSON.stringify(r));break;default:if(q&&!r.isAllDismissed){r.isAllDismissed=true;h(n,JSON.stringify(r))}break}}k.reduce(l,function(r,q){return r.then(function(x){var D=x.stepInfoById=x.stepInfoById||{};var w=q.id||q.selector;var s=D[w]=D[w]||{};if(s.isDismissed){return r}var B=l.length;var v=k.indexOf(l,q);var t=v<B-1;var y=new d(n,q,{numSteps:B,stepIndex:v,hasNext:t},m);var C=g.Deferred();y.on("close",C.reject);y.on("next",k.bind(C.resolve,C,x));y.on("action",k.bind(C.resolve,C,x));var z=y.showWhenTargetVisible();var A=k.bind(o,null,q,x,!t);var u=k.bind(o,null,q,x,"all");if(q.once){z.then(A)}else{y.on("close",u);y.on("next",A);y.on("action",A)}return C})},p)};f.checkFeatureVisibility=function(){c.fire()};f.checkFeatureAlignment=function(){b.fire()}})(AJS,AJS.$,_,Chaperone._internal.syncing,Chaperone);; ;/* module-key = 'com.atlassian.plugins.atlassian-chaperone:feature-discovery', location = '/feature-discovery/feature-discovery.soy' */ // This file was automatically generated from feature-discovery.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace chaperone.featureDiscovery. */ if (typeof chaperone == 'undefined') { var chaperone = {}; } if (typeof chaperone.featureDiscovery == 'undefined') { chaperone.featureDiscovery = {}; } chaperone.featureDiscovery.content = function(opt_data, opt_ignored) { return '' + ((opt_data.step.title) ? '<h2>' + soy.$$escapeHtml(opt_data.step.title) + '</h2>' : '') + ((opt_data.step.content) ? soy.$$filterNoAutoescape(opt_data.step.content) : '') + aui.form.form({action: '', content: '' + ((opt_data.step.action && opt_data.step.action.text) ? aui.buttons.button(soy.$$augmentMap(opt_data.step.action, {extraClasses: aui.renderExtraClasses(opt_data.step.action) + ' feature-discovery-action', extraAttributes: aui.renderExtraAttributes(opt_data.step.action) + ' type="button"'})) : '') + ((opt_data.paging && opt_data.paging.hasNext) ? aui.buttons.button({text: "Next", type: opt_data.step.action && opt_data.step.action.text ? 'link' : null, extraClasses: 'feature-discovery-next', extraAttributes: {type: 'button'}}) : '') + aui.buttons.button({text: "Close", type: opt_data.step.action && opt_data.step.action.text || opt_data.paging && opt_data.paging.hasNext ? 'link' : null, extraClasses: 'feature-discovery-close', extraAttributes: {type: 'button'}}) + ((opt_data.step.moreInfo) ? aui.buttons.button(soy.$$augmentMap(opt_data.step.moreInfo, {text: opt_data.step.moreInfo.text ? opt_data.step.moreInfo.text : "Learn more", type: 'link'})) : '') + ((opt_data.paging && opt_data.paging.numSteps > 1) ? '<span class="multi-step-trigger">' + soy.$$escapeHtml(AJS.format("{0}/{1}",opt_data.paging.stepIndex + 1,opt_data.paging.numSteps)) + '</span>' : '')}); }; if (goog.DEBUG) { chaperone.featureDiscovery.content.soyTemplateName = 'chaperone.featureDiscovery.content'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:chaperone-feature-discovery', location = '/static/lib/chaperone-AMD.js' */ define("chaperone",function(){return Chaperone});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:sidebar', location = '/static/widget/sidebar/sidebar.js' */ define("widget/sidebar",["aui","chaperone","jquery","util/client-storage","util/events","exports"],function(K,D,G,E,L,F){var J="sidebar_expanded";var C=".aui-sidebar";var A;function B(){A=K.sidebar(C);A.on("collapse-end",function(){E.setItem(J,false);L.trigger("stash.feature.sidebar.collapseEnd")});A.on("expand-end",function(){E.setItem(J,true);L.trigger("stash.feature.sidebar.expandEnd")});var M=null;A.$el.find(".aui-sidebar-body").on("mousemove mouseleave",function(O){if(typeof O.srcElement==="undefined"&&O.target!==M){var N=(O.type==="mousemove")&&!G(O.target).parentsUntil(A.$el).filter(".aui-page-header, .aui-navgroup").length;A.$el.toggleClass("aui-is-hover",N);M=O.target}});I()}function I(){var M=E.getItem(J);A.on("expand",function(){M=true});A.on("collapse",function(){M=false});D.registerFeature("sidebar",[{id:"sidebar-discovery",selector:".aui-sidebar[aria-expanded=false] .aui-page-header, .aui-sidebar[aria-expanded=true] .aui-sidebar-group:first-child",title:"Improvements to navigation in Stash",content:stash.widget.sidebar.discoveryContent(),moreInfo:{href:"http://go.atlassian.com/stashsidebar"},gravity:"w",width:350,offsetX:function(){return M?-10:10},once:true}]);A.on("expand",D.checkFeatureAlignment);A.on("collapse",D.checkFeatureAlignment);A.on("expand-end",D.checkFeatureAlignment);A.on("collapse-end",D.checkFeatureAlignment)}function H(){var M=E.getItem(J);G(document.body).toggleClass("aui-sidebar-collapsed",!M);G(C).attr("aria-expanded",M)}F.preload=H;F.onReady=B});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:sidebar', location = '/static/widget/sidebar/sidebar.soy' */ // This file was automatically generated from sidebar.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.sidebar. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.sidebar == 'undefined') { stash.widget.sidebar = {}; } stash.widget.sidebar.discoveryContent = function(opt_data, opt_ignored) { return '<ul><li>' + soy.$$escapeHtml("Actions and navigation in one place") + '</li><li>' + soy.$$escapeHtml("Always visible for faster access") + '</li><li>' + soy.$$filterNoAutoescape(AJS.format("Collapse the sidebar with {0}[{1} when you need more space",'<kbd>','</kbd>')) + '</li></ul>'; }; if (goog.DEBUG) { stash.widget.sidebar.discoveryContent.soyTemplateName = 'stash.widget.sidebar.discoveryContent'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:repository-layout', location = '/static/layout/repository/repository.js' */ define("layout/repository",["aui","jquery","lodash","stash/api/util/navbuilder","util/events","model/page-state","model/repository","widget/quick-copy-text","widget/sidebar","feature/repository/sticky-branches","exports"],function(J,H,S,I,C,L,G,F,M,R,T){function O(V){var U=new G(V);L.setRepository(U);L.setProject(U.getProject());H(".aui-page-header-image > a").on("click",function(){C.trigger("stash.sidebar.clickAvatar.expanded."+H(".aui-sidebar").attr("aria-expanded"),null)})}function B(){return H(".clone-url")}function E(){return H(".repository-protocol")}function D(){var b=B(),W=b.find("input"),Z=E(),V=H("#"+Z.attr("aria-owns")),Y=V.find("li"),a,U,X="";if(Z.is("button")){N(Z,Z.text());a=Z.attr("data-clone-url");U=Z.attr("data-module-key")}else{N(Z,Y.first().children("a").text());a=Y.first().attr("data-clone-url");U=Y.first().attr("data-module-key")}W.val(a);b.addClass(U);X=U;Y.on("click",function(c){var d=H(this);N(Z,d.text());W.val(d.attr("data-clone-url")).select();U=d.attr("data-module-key");b.removeClass(X).addClass(U);X=U;C.trigger("stash.feature.repository.clone.protocol.changed",null,U,d.attr("data-clone-url"));c.stopPropagation();if(V.is(":visible")){Z.trigger("aui-button-invoke")}c.preventDefault()});C.trigger("stash.feature.repository.clone.protocol.initial",null,U,a)}function N(V,W){var U=V.children("span").remove();V.text(W).append(U)}function K(V,Z){var U=H(Z);var Y=null;var X=null;var W=J.InlineDialog(null,"clone-repo-dialog",function(b,a,c){b.append(U);c();S.defer(function(){U.find(".clone-url input").select()})},{noBind:true,width:360,gravity:"w",hideCallback:function(){var b=E(),a=H("#"+b.attr("aria-owns"));if(a.is(":visible")){b.trigger("aui-button-invoke")}},calculatePositions:function(){if(Y===null&&X===null){return J.InlineDialog.opts.calculatePositions.apply(this,arguments)}else{return{gravity:"w",popupCss:Y,arrowCss:X}}}});H(document).on("click",V,function(c){c.preventDefault();if(H(c.target).closest(".aui-sidebar").length===0){var b=H("#inline-dialog-sidebar-submenu");var a=b.find("#arrow-sidebar-submenu");Y=b.offset();X=a.position()}else{Y=null;X=null}W.show(c,this)});H(document).keyup(function(a){if(a.keyCode===J.keyCode.ESCAPE){W.hide()}});U.find("a.sourcetree-clone-button").on("click",function(){W.hide()})}function Q(){var U=H(".aui-page-header-actions .create-pull-request");C.on("stash.layout.branch.revisionRefChanged",function(W){var V=I.currentRepo().createPullRequest();if(!W.isDefault()&&W.isBranch()){V=V.sourceBranch(W.getId())}U.attr("href",V.build())})}function A(){H(".repository-badge .badge").tooltip({gravity:"n"})}function P(){var U=H(".aui-sidebar[aria-expanded=false] .aui-page-header-image");U.tooltip({gravity:"w",delayIn:0,live:true,html:true,aria:true,className:"aui-sidebar-section-tooltip",title:function(){return H(this).find(".aui-avatar").attr("data-tooltip")}})}T.onReady=function(W,U,V){O(W);D();F.onReady();H(document).ready(M.onReady);R.onReady();K(U,V);Q();A();P();C.on("stash.widget.keyboard-shortcuts.register-contexts",function(X){X.enableContext("repository")})}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:revision-reference-selector', location = '/static/feature/repository/revision-reference-selector/revision-reference-selector.js' */ define("feature/repository/revision-reference-selector",["aui","jquery","lodash","stash/api/util/navbuilder","util/ajax","util/events","model/page-state","model/repository","model/revision-reference","widget/searchable-selector"],function(I,C,J,B,G,K,H,D,A,E){function F(M,L){return this.init.apply(this,arguments)}C.extend(F.prototype,E.prototype);F.prototype._addRefTypeAndRepositoryToResults=function(M){if(M&&M.values){var N=C.extend(true,{},M);var L=this._getCurrentType();J.each(N.values,J.bind(function(O){if(!O.type){O.type=L}if(!O.repository){O.repository=this.repository&&this.repository.toJSON()}},this));return N}return M};F.prototype.defaults=C.extend(true,{},E.prototype.defaults,{tabs:[{label:"Branches",type:A.type.BRANCH,url:function(){return this.getBranchesUrl()},resultsTemplate:stash.feature.repository.revisionReferenceSelectorBranchResults,searchPlaceholder:"Search for a branch"},{label:"Tags",type:A.type.TAG,url:function(){return this.getTagsUrl()},resultsTemplate:stash.feature.repository.revisionReferenceSelectorTagResults,searchPlaceholder:"Search for a tag"},{label:"Commits",type:A.type.COMMIT,url:function(){return this.getCommitsUrl()},resultsTemplate:stash.feature.repository.revisionReferenceSelectorCommitResults,searchPlaceholder:"Search for a commit"}],queryParamKey:"filterText",namespace:"revision-reference-selector",itemSelectedEvent:"stash.feature.repository.revisionReferenceSelector.revisionRefChanged",itemUnselectedEvent:"stash.feature.repository.revisionReferenceSelector.revisionRefUnselected",itemDataKey:"revision-ref",statusCodeHandlers:G.ignore404WithinRepository(),triggerContentTemplate:stash.feature.repository.revisionReferenceSelectorTriggerContent,extraClasses:"revision-reference-selector",repository:function(){return H.getRepository()},show:{branches:true,tags:true,commits:false},dataTransform:F.prototype._addRefTypeAndRepositoryToResults,postOptionsInit:function(){this.setRepository(this._getOptionVal("repository"))}});F.prototype.init=function(M,L){E.prototype.init.apply(this,arguments);return this};F.prototype.setOptions=function(N){if(N.extraClasses){N.extraClasses=this.defaults.extraClasses+" "+C.trim(N.extraClasses)}N=C.extend(true,{},this.defaults,N);var M={branches:A.type.BRANCH.id,tags:A.type.TAG.id,commits:A.type.COMMIT.id};var L=J.filter(M,function(P,O){return N.show[O]});N.tabs=J.filter(N.tabs,function(O){return J.indexOf(L,O.type.id)!==-1});this.options=N};F.prototype._getItemFromTrigger=function(){var L=this.$trigger.find(".name");return new A(C.extend({},this._buildObjectFromElementDataAttributes(L),{displayId:L.text(),repository:this.repository}))};F.prototype.getBranchesUrl=function(){return B.rest().project(this.repository.getProject()).repo(this.repository).branches().build()};F.prototype.getTagsUrl=function(){return B.rest().project(this.repository.getProject()).repo(this.repository).tags().build()};F.prototype.getCommitsUrl=function(){return B.rest().project(this.repository.getProject()).repo(this.repository).commits().build()};F.prototype.getRepository=function(){return this.repository};F.prototype.setRepository=function(L){var N=this.repository;if(L instanceof D&&!L.isEqual(N)){this.repository=L;if(N){var M=this._getCurrentScrollable();if(M){this._emptyScrollable(M);M.init()}this.clearSelection();this.dialog.hide();K.trigger("stash.feature.repository.revisionReferenceSelector.repoChanged",this,L,this._getOptionVal("context"))}}};F.prototype._getCurrentType=function(){return this.tabs[this.currentTabId||0].type};F.prototype.setSelectedItem=function(L){if(L instanceof A&&!L.isEqual(this._selectedItem)){this._itemSelected(L)}};F.prototype.clearSelection=function(){E.prototype.clearSelection.apply(this,arguments);K.trigger(this._getOptionVal("itemUnselectedEvent"),this,null,this._getOptionVal("context"))};F.prototype._itemSelected=function(N){var L;var M;if(N instanceof A){L=N.toJSON();M=N}else{L=J.pick(N,J.keys(A.prototype.namedAttributes));M=new A(L)}this._selectedItem=M;if(this._getOptionVal("field")){C(this._getOptionVal("field")).val(L.id)}this.updateTrigger({ref:L});K.trigger(this._getOptionVal("itemSelectedEvent"),this,M,this._getOptionVal("context"))};return F});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:revision-reference-selector', location = '/static/feature/repository/revision-reference-selector/revision-reference-selector.soy' */ // This file was automatically generated from revision-reference-selector.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.repository. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.repository == 'undefined') { stash.feature.repository = {}; } stash.feature.repository.revisionReferenceSelectorBranchResults = function(opt_data, opt_ignored) { return '' + stash.feature.repository.revisionReferenceSelectorResults({values: opt_data.values, isLastPage: opt_data.isLastPage, size: opt_data.size, isPreload: opt_data.isPreload, noResultsText: "No branches", noMoreResultsText: "No more branches"}); }; if (goog.DEBUG) { stash.feature.repository.revisionReferenceSelectorBranchResults.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorBranchResults'; } stash.feature.repository.revisionReferenceSelectorTagResults = function(opt_data, opt_ignored) { return '' + stash.feature.repository.revisionReferenceSelectorResults({values: opt_data.values, isLastPage: opt_data.isLastPage, size: opt_data.size, isPreload: opt_data.isPreload, noResultsText: "No tags", noMoreResultsText: "No more tags"}); }; if (goog.DEBUG) { stash.feature.repository.revisionReferenceSelectorTagResults.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorTagResults'; } stash.feature.repository.revisionReferenceSelectorCommitResults = function(opt_data, opt_ignored) { return '' + stash.feature.repository.revisionReferenceSelectorResults({values: opt_data.values, isLastPage: opt_data.isLastPage, size: opt_data.size, isPreload: opt_data.isPreload, noResultsText: "No commits", noMoreResultsText: "No more commits"}); }; if (goog.DEBUG) { stash.feature.repository.revisionReferenceSelectorCommitResults.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorCommitResults'; } stash.feature.repository.revisionReferenceSelectorResults = function(opt_data, opt_ignored) { var output = ''; var refList27 = opt_data.values; var refListLen27 = refList27.length; for (var refIndex27 = 0; refIndex27 < refListLen27; refIndex27++) { var refData27 = refList27[refIndex27]; output += '<li class="result ' + ((opt_data.isPreload) ? 'preload' : '') + '"><a href="' + soy.$$escapeHtml(refData27.url ? refData27.url : '#') + '" data-id="' + soy.$$escapeHtml(refData27.id) + '" tabindex="-1">' + stash.feature.repository.revisionReferenceSelectorRef({ref: refData27}) + '</a></li>'; } output += (opt_data.isLastPage) ? (opt_data.size > 0) ? '<li class="no-results">' + soy.$$escapeHtml(opt_data.noMoreResultsText ? opt_data.noMoreResultsText : "No more results") + '</li>' : '<li class="no-results">' + soy.$$escapeHtml(opt_data.noResultsText ? opt_data.noResultsText : "No results") + '</li>' : ''; return output; }; if (goog.DEBUG) { stash.feature.repository.revisionReferenceSelectorResults.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorResults'; } stash.feature.repository.revisionReferenceSelectorTrigger = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '' + stash.widget.searchableSelectorTriggerGeneric({id: opt_data.id, content: '' + stash.feature.repository.revisionReferenceSelectorTriggerContent(opt_data), autofocus: opt_data.autofocus, extraClasses: 'revision-reference-selector-trigger' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: opt_data.extraAttributes}); }; if (goog.DEBUG) { stash.feature.repository.revisionReferenceSelectorTrigger.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorTrigger'; } stash.feature.repository.revisionReferenceSelectorTriggerWithField = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '' + stash.feature.repository.revisionReferenceSelectorTrigger(opt_data) + widget.aui.form.input({id: opt_data.fieldId ? opt_data.fieldId : opt_data.id ? opt_data.id + '-field' : opt_data.id, name: opt_data.fieldName ? opt_data.fieldName : opt_data.id + '-field', initialValue: opt_data.ref ? opt_data.ref.id : null, type: 'hidden'}); }; if (goog.DEBUG) { stash.feature.repository.revisionReferenceSelectorTriggerWithField.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorTriggerWithField'; } stash.feature.repository.revisionReferenceSelectorTriggerContent = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '' + ((opt_data.ref) ? stash.feature.repository.revisionReferenceSelectorRef(opt_data) : '<span class="placeholder">' + soy.$$escapeHtml(opt_data.text ? opt_data.text : "Select revision") + '</span>'); }; if (goog.DEBUG) { stash.feature.repository.revisionReferenceSelectorTriggerContent.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorTriggerContent'; } stash.feature.repository.revisionReferenceSelectorRef = function(opt_data, opt_ignored) { return ((opt_data.ref.type) ? aui.icons.icon({size: 'small', useIconFont: true, iconFontSet: 'devtools', icon: opt_data.ref.type.id, accessibilityText: opt_data.ref.type.name}) : '') + '<span class="name" title="' + soy.$$escapeHtml(opt_data.ref.displayId) + '" data-id="' + soy.$$escapeHtml(opt_data.ref.id) + '" data-revision-ref="' + soy.$$escapeHtml(JSON.stringify(opt_data.ref).replace(/\//g, '\\/')) + '">' + soy.$$escapeHtml(opt_data.ref.displayId ? opt_data.ref.displayId : opt_data.ref.id) + '</span>'; }; if (goog.DEBUG) { stash.feature.repository.revisionReferenceSelectorRef.soyTemplateName = 'stash.feature.repository.revisionReferenceSelectorRef'; } ; ;/* module-key = 'com.atlassian.stash.stash-branch-utils:create-branch-action', location = '/web-fragment-placeholder.config' */ WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-branch-utils','key':'create-branch-action','moduleKey':'create-branch-action','completeModuleKey':'com.atlassian.stash.stash-branch-utils:create-branch-action','weight':30.0,'params':{},'styleClass':WebFragments._formatI18n(null, null, 'create-branch'),'location':'stash.branch.layout.actions.dropdown','url':function(ctx) { return WebFragments._getValue(( function (ctx) { var navbuilder = require('stash/api/util/navbuilder'); var urlBuilder = navbuilder.pluginServlets().path('create-branch'); if (ctx.repository) { urlBuilder = urlBuilder.withParams({repoId: ctx.repository.id}); } if (ctx.atRevisionRef && (ctx.atRevisionRef.type.id === 'branch' || ctx.atRevisionRef.type.id === 'tag')) { urlBuilder = urlBuilder.withParams({branchFrom: ctx.atRevisionRef.id}); } return urlBuilder.build(); } ), ctx); },'linkText':WebFragments._formatI18n("Create branch from here", 'stash.branch.actions.create', '')});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:zero-clipboard', location = '/static/lib/zero-clipboard/ZeroClipboard.js' */ /* * zeroclipboard * The Zero Clipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie, and a JavaScript interface. * Copyright 2012 Jon Rohan, James M. Greene, . * Released under the MIT license * http://jonrohan.github.com/ZeroClipboard/ * v1.1.7 */ (function(){var M=function(S,U){var T=S.style[U];if(S.currentStyle){T=S.currentStyle[U]}else{if(window.getComputedStyle){T=document.defaultView.getComputedStyle(S,null).getPropertyValue(U)}}if(T=="auto"&&U=="cursor"){var Q=["a"];for(var R=0;R<Q.length;R++){if(S.tagName.toLowerCase()==Q[R]){return"pointer"}}}return T};var I=function(Q){if(!G.prototype._singleton){return }if(!Q){Q=window.event}var R;if(this!==window){R=this}else{if(Q.target){R=Q.target}else{if(Q.srcElement){R=Q.srcElement}}}G.prototype._singleton.setCurrent(R)};var J=function(Q,S,R){if(Q.addEventListener){Q.addEventListener(S,R,false)}else{if(Q.attachEvent){Q.attachEvent("on"+S,R)}}};var H=function(Q,S,R){if(Q.removeEventListener){Q.removeEventListener(S,R,false)}else{if(Q.detachEvent){Q.detachEvent("on"+S,R)}}};var L=function(R,T){if(R.addClass){R.addClass(T);return R}if(T&&typeof T==="string"){var V=(T||"").split(/\s+/);if(R.nodeType===1){if(!R.className){R.className=T}else{var S=" "+R.className+" ",U=R.className;for(var W=0,Q=V.length;W<Q;W++){if(S.indexOf(" "+V[W]+" ")<0){U+=" "+V[W]}}R.className=U.replace(/^\s+|\s+$/g,"")}}}return R};var A=function(R,T){if(R.removeClass){R.removeClass(T);return R}if(T&&typeof T==="string"||T===undefined){var U=(T||"").split(/\s+/);if(R.nodeType===1&&R.className){if(T){var S=(" "+R.className+" ").replace(/[\n\t]/g," ");for(var V=0,Q=U.length;V<Q;V++){S=S.replace(" "+U[V]+" "," ")}R.className=S.replace(/^\s+|\s+$/g,"")}else{R.className=""}}}return R};var B=function(U){var T={left:0,top:0,width:U.width||U.offsetWidth||0,height:U.height||U.offsetHeight||0,zIndex:9999};var R=M(U,"zIndex");if(R&&R!="auto"){T.zIndex=parseInt(R,10)}while(U){var Q=parseInt(M(U,"borderLeftWidth"),10);var S=parseInt(M(U,"borderTopWidth"),10);T.left+=isNaN(U.offsetLeft)?0:U.offsetLeft;T.left+=isNaN(Q)?0:Q;T.top+=isNaN(U.offsetTop)?0:U.offsetTop;T.top+=isNaN(S)?0:S;U=U.offsetParent}return T};var K=function(Q){return(Q.indexOf("?")>=0?"&":"?")+"nocache="+(new Date).getTime()};var D=function(Q){var R=[];if(Q.trustedDomains){if(typeof Q.trustedDomains==="string"){R.push("trustedDomain="+Q.trustedDomains)}else{R.push("trustedDomain="+Q.trustedDomains.join(","))}}return R.join("&")};var O=function(S,T){if(T.indexOf){return T.indexOf(S)}for(var Q=0,R=T.length;Q<R;Q++){if(T[Q]===S){return Q}}return -1};var P=function(Q){if(typeof Q==="string"){throw new TypeError("ZeroClipboard doesn't accept query strings.")}if(!Q.length){return[Q]}return Q};var G=function(T,S){if(T){(G.prototype._singleton||this).glue(T)}if(G.prototype._singleton){return G.prototype._singleton}G.prototype._singleton=this;this.options={};for(var R in E){this.options[R]=E[R]}for(var Q in S){this.options[Q]=S[Q]}this.handlers={};if(G.detectFlashSupport()){N()}};var F,C=[];G.prototype.setCurrent=function(Q){F=Q;this.reposition();if(Q.getAttribute("title")){this.setTitle(Q.getAttribute("title"))}this.setHandCursor(M(Q,"cursor")=="pointer")};G.prototype.setText=function(Q){if(Q&&Q!==""){this.options.text=Q;if(this.ready()){this.flashBridge.setText(Q)}}};G.prototype.setTitle=function(Q){if(Q&&Q!==""){this.htmlBridge.setAttribute("title",Q)}};G.prototype.setSize=function(R,Q){if(this.ready()){this.flashBridge.setSize(R,Q)}};G.prototype.setHandCursor=function(Q){if(this.ready()){this.flashBridge.setHandCursor(Q)}};G.version="1.1.7";var E={moviePath:"ZeroClipboard.swf",trustedDomains:null,text:null,hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",allowScriptAccess:"sameDomain"};G.setDefaults=function(R){for(var Q in R){E[Q]=R[Q]}};G.destroy=function(){G.prototype._singleton.unglue(C);var Q=G.prototype._singleton.htmlBridge;Q.parentNode.removeChild(Q);delete G.prototype._singleton};G.detectFlashSupport=function(){var Q=false;try{if(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")){Q=true}}catch(R){if(navigator.mimeTypes["application/x-shockwave-flash"]){Q=true}}return Q};var N=function(){var R=G.prototype._singleton;var Q=document.getElementById("global-zeroclipboard-html-bridge");if(!Q){var S=' <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%"> <param name="movie" value="'+R.options.moviePath+'"/> <param name="allowScriptAccess" value="'+R.options.allowScriptAccess+'"/> <param name="scale" value="exactfit"/> <param name="loop" value="false"/> <param name="menu" value="false"/> <param name="quality" value="best" /> <param name="bgcolor" value="#ffffff"/> <param name="wmode" value="transparent"/> <param name="flashvars" value="'+D(R.options)+'"/> <embed src="'+R.options.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="100%" height="100%" name="global-zeroclipboard-flash-bridge" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+D(R.options)+'" scale="exactfit"> </embed> </object>';Q=document.createElement("div");Q.id="global-zeroclipboard-html-bridge";Q.setAttribute("class","global-zeroclipboard-container");Q.setAttribute("data-clipboard-ready",false);Q.style.position="absolute";Q.style.left="-9999px";Q.style.top="-9999px";Q.style.width="15px";Q.style.height="15px";Q.style.zIndex="9999";Q.innerHTML=S;document.body.appendChild(Q)}R.htmlBridge=Q;R.flashBridge=document["global-zeroclipboard-flash-bridge"]||Q.children[0].lastElementChild};G.prototype.resetBridge=function(){this.htmlBridge.style.left="-9999px";this.htmlBridge.style.top="-9999px";this.htmlBridge.removeAttribute("title");this.htmlBridge.removeAttribute("data-clipboard-text");A(F,this.options.activeClass);F=null;this.options.text=null};G.prototype.ready=function(){var Q=this.htmlBridge.getAttribute("data-clipboard-ready");return Q==="true"||Q===true};G.prototype.reposition=function(){if(!F){return false}var Q=B(F);this.htmlBridge.style.top=Q.top+"px";this.htmlBridge.style.left=Q.left+"px";this.htmlBridge.style.width=Q.width+"px";this.htmlBridge.style.height=Q.height+"px";this.htmlBridge.style.zIndex=Q.zIndex+1;this.setSize(Q.width,Q.height)};G.dispatch=function(Q,R){G.prototype._singleton.receiveEvent(Q,R)};G.prototype.on=function(Q,T){var S=Q.toString().split(/\s/g);for(var R=0;R<S.length;R++){Q=S[R].toLowerCase().replace(/^on/,"");if(!this.handlers[Q]){this.handlers[Q]=T}}if(this.handlers.noflash&&!G.detectFlashSupport()){this.receiveEvent("onNoFlash",null)}};G.prototype.addEventListener=G.prototype.on;G.prototype.off=function(Q,U){var S=Q.toString().split(/\s/g);for(var R=0;R<S.length;R++){Q=S[R].toLowerCase().replace(/^on/,"");for(var T in this.handlers){if(T===Q&&this.handlers[T]===U){delete this.handlers[T]}}}};G.prototype.removeEventListener=G.prototype.off;G.prototype.receiveEvent=function(Q,T){Q=Q.toString().toLowerCase().replace(/^on/,"");var U=F;switch(Q){case"load":if(T&&parseFloat(T.flashVersion.replace(",",".").replace(/[^0-9\.]/gi,""))<10){this.receiveEvent("onWrongFlash",{flashVersion:T.flashVersion});return }this.htmlBridge.setAttribute("data-clipboard-ready",true);break;case"mouseover":L(U,this.options.hoverClass);break;case"mouseout":A(U,this.options.hoverClass);this.resetBridge();break;case"mousedown":L(U,this.options.activeClass);break;case"mouseup":A(U,this.options.activeClass);break;case"datarequested":var S=U.getAttribute("data-clipboard-target"),X=!S?null:document.getElementById(S);if(X){var W=X.value||X.textContent||X.innerText;if(W){this.setText(W)}}else{var R=U.getAttribute("data-clipboard-text");if(R){this.setText(R)}}break;case"complete":this.options.text=null;break}if(this.handlers[Q]){var V=this.handlers[Q];if(typeof V=="function"){V.call(U,this,T)}else{if(typeof V=="string"){window[V].call(U,this,T)}}}};G.prototype.glue=function(R){R=P(R);for(var Q=0;Q<R.length;Q++){if(O(R[Q],C)==-1){C.push(R[Q]);J(R[Q],"mouseover",I)}}};G.prototype.unglue=function(S){S=P(S);for(var R=0;R<S.length;R++){H(S[R],"mouseover",I);var Q=O(S[R],C);if(Q!=-1){C.splice(Q,1)}}};if(typeof module!=="undefined"){module.exports=G}else{if(typeof define==="function"&&define.amd){define(function(){return G})}else{window.ZeroClipboard=G}}})();; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:zero-clipboard', location = '/static/lib/zero-clipboard/ZeroClipboard-AMD.js' */ define("zero-clipboard",["aui"],function(B){var A=window.ZeroClipboard;A.setDefaults({moviePath:B.contextPath()+"/s/"+A.version+"/_/download/resources/com.atlassian.stash.stash-web-plugin:zero-clipboard/ZeroClipboard.swf",useNoCache:false});return A});require("zero-clipboard");; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:notifications-center', location = '/static/widget/notifications-center/notifications-center.soy' */ // This file was automatically generated from notifications-center.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget.notifications. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } if (typeof stash.widget.notifications == 'undefined') { stash.widget.notifications = {}; } stash.widget.notifications.center = function(opt_data, opt_ignored) { return '<div id="notifications-center"></div>'; }; if (goog.DEBUG) { stash.widget.notifications.center.soyTemplateName = 'stash.widget.notifications.center'; } stash.widget.notifications.notification = function(opt_data, opt_ignored) { return '<div class="status-notification">' + soy.$$escapeHtml(opt_data.message) + '</div>'; }; if (goog.DEBUG) { stash.widget.notifications.notification.soyTemplateName = 'stash.widget.notifications.notification'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:notifications-center', location = '/static/widget/notifications-center/notifications-center.js' */ define("widget/notifications-center",["jquery","util/navigator","exports"],function(E,C,B){var F;function A(){if(F){return F}F=E(stash.widget.notifications.center()).appendTo("body");return F}function D(G){var H=E(stash.widget.notifications.notification({message:G}));A().prepend(H);if(C.isIE()&&C.majorVersion()<=9){H.fadeIn(function(){window.setTimeout(function(){H.fadeOut(function(){H.remove()})},1500)})}H.on("animationend webkitAnimationEnd MSAnimationEnd oanimationend",function(){H.remove()});return H}B.showNotification=D});; ;/* module-key = 'com.atlassian.stash.stash-branch-utils:branch-copy', location = '/static/branch-copy/feature/branch-copy.js' */ define("feature/branch/branch-copy",["aui","jquery","lodash","zero-clipboard","util/navigator","widget/notifications-center","widget/quick-copy-text","exports"],function(i,e,j,f,h,k,c,d){c.onReady();function b(l){var m=i.dialog2(aui.dialog.dialog2({titleText:"Copy branch name",content:stash.feature.branchCopy.dialogContent({branchName:l,flashSupported:f.detectFlashSupport()}),footerHintText:i.format("{0} to copy the branch name to your clipboard",h.isMac()?"⌘ + c":"Ctrl + c"),removeOnHide:true})).show();m.$el.find("form").on("submit",function(n){n.preventDefault()});m.$el.find("#branch-copy-field").on("copy",function(){j.defer(function(){m.hide()});k.showNotification("Branch name has been copied")}).focus().select()}function a(){e("#global-zeroclipboard-html-bridge").css({top:"-9999px",left:"-9999px"})}function g(q,n,p){var o;var l;var m=function(r,s){r.setText(l)};e(document).on("aui-dropdown2-show",n,function(){var r=e(this);var s=e(q);l=p(r);var t=function(u){u.preventDefault();b(l)};s.on("click",t);r.on("aui-dropdown2-hide",function(){s.off("click",t)});if(o){o.off("dataRequested",m)}if(f.detectFlashSupport()){o=new f(s,{forceHandCursor:true});o.on("dataRequested",m);o.on("complete",function(u,v){a();k.showNotification("Branch name has been copied")})}})}d.bindToDropdownLink=g});; ;/* module-key = 'com.atlassian.stash.stash-branch-utils:branch-copy', location = '/static/branch-copy/feature/branch-copy.soy' */ // This file was automatically generated from branch-copy.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.feature.branchCopy. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.feature == 'undefined') { stash.feature = {}; } if (typeof stash.feature.branchCopy == 'undefined') { stash.feature.branchCopy = {}; } stash.feature.branchCopy.dialogContent = function(opt_data, opt_ignored) { return '' + ((! opt_data.flashSupported) ? '<p class="install-flash-message">' + soy.$$filterNoAutoescape(AJS.format("Install {0}Adobe Flash{1} to automatically copy the branch name to your clipboard.",'<a href="http://get.adobe.com/flashplayer/" target="_blank">','</a>')) + '</p>' : '') + aui.form.form({content: '' + widget.aui.form.text({id: 'branch-copy-field', labelContent: '' + soy.$$escapeHtml("Branch name"), extraClasses: 'quick-copy-text', initialValue: opt_data.branchName, autofocus: true, readonly: true}), action: ''}); }; if (goog.DEBUG) { stash.feature.branchCopy.dialogContent.soyTemplateName = 'stash.feature.branchCopy.dialogContent'; } ; ;/* module-key = 'com.atlassian.stash.stash-branch-utils:branch-copy-branch-layout', location = '/static/branch-copy/branch-layout-copy.js' */ define("feature/branch/branch-selector-copy",["model/page-state","feature/branch/branch-copy","exports"],function(b,c,a){a.onReady=function(){c.bindToDropdownLink(".copy-branch-name","#branch-actions-menu",function(){return b.getRevisionRef().getDisplayId()})}});jQuery(document).ready(function(){require("feature/branch/branch-selector-copy").onReady()});; ;/* module-key = 'com.atlassian.stash.stash-branch-utils:copy-branch-action', location = '/web-fragment-placeholder.config' */ WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-branch-utils','key':'copy-branch-action','moduleKey':'copy-branch-action','completeModuleKey':'com.atlassian.stash.stash-branch-utils:copy-branch-action','weight':15.0,'condition':function(ctx) { return WebFragments._getValue((function(ctx) { return ctx.atRevisionRef.type.id === 'branch'}), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'copy-branch-name'),'location':'stash.branch.layout.actions.dropdown','linkText':WebFragments._formatI18n("Copy branch name", 'stash.branch.actions.copybranch', '')});; ;/* module-key = 'com.atlassian.stash.stash-compare-plugin:compare-branch-action', location = '/web-fragment-placeholder.config' */ WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-compare-plugin','key':'compare-branch-action','moduleKey':'compare-branch-action','completeModuleKey':'com.atlassian.stash.stash-compare-plugin:compare-branch-action','weight':10.0,'condition':function(ctx) { return WebFragments._getValue((function(ctx) { return ctx.atRevisionRef.type.id === 'branch'}), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'compare-branch-action'),'location':'stash.branch.layout.actions.dropdown','url':function(ctx) { return WebFragments._getValue(( function(ctx) { return require('stash/api/util/navbuilder').project(ctx.repository.project).repo(ctx.repository).compare() .sourceBranch(ctx.atRevisionRef.id).build(); } ), ctx); },'linkText':WebFragments._formatI18n("Compare", 'stash.web.repository.branch.actions.compare', '')});; ;/* module-key = 'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-checkout', location = '/static/sourcetree-checkout/sourcetree-checkout.js' */ define("plugin/sourcetree/sourcetree-checkout",["jquery","aui","model/page-state","util/events","util/navbuilder","exports"],function(d,a,h,j,e,b){var g=navigator.platform.indexOf("Mac")!==-1;var i;var c=function(k,l){i=l};function f(){return i||e.currentRepo().clone(h.getRepository().getScmId()).buildAbsolute()}b.init=function(){j.on("stash.feature.repository.clone.protocol.changed",c);j.on("stash.feature.repository.clone.protocol.initial",c);d(".sourcetree-checkout").tipsy({gravity:d.fn.tipsy.autoWE,live:true});d(document).on("aui-dropdown2-hide",".aui-dropdown2",function(){d(".sourcetree-checkout").each(function(){d(this).tipsy("hide")})})};b.getSourceTreeCheckoutUrl=function(k){var m="sourcetree://checkoutRef?type=stash&ref="+encodeURIComponent(k.id)+"&baseWebUrl="+encodeURIComponent(window.location.origin+a.contextPath())+"&cloneUrl="+encodeURIComponent(f());var l=h.getCurrentUser();if(l){m=m+"&user="+encodeURIComponent(l.getName())}return m};b.getMinimumSourceTreeVersionTooltip=function(){var k=g?1.7:1.2;return AJS.format("Requires SourceTree v{0}+",k)}});require("plugin/sourcetree/sourcetree-checkout").init();; ;/* module-key = 'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-checkout-action-branch-layout', location = '/web-fragment-placeholder.config' */ WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-sourcetree-plugin','key':'sourcetree-checkout-action-branch-layout','moduleKey':'sourcetree-checkout-action-branch-layout','completeModuleKey':'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-checkout-action-branch-layout','weight':20.0,'params':{},'tooltip':function(ctx) { return WebFragments._getValue((require('plugin/sourcetree/sourcetree-checkout').getMinimumSourceTreeVersionTooltip()), ctx); },'styleClass':WebFragments._formatI18n(null, null, 'sourcetree-checkout'),'location':'stash.branch.layout.actions.dropdown','url':function(ctx) { return WebFragments._getValue(( function(ctx) { return require('plugin/sourcetree/sourcetree-checkout').getSourceTreeCheckoutUrl(ctx.atRevisionRef); } ), ctx); },'linkText':WebFragments._formatI18n("Check out in SourceTree", 'stash.branch.actions.sourcetree.checkout', '')});; ;/* module-key = 'com.atlassian.stash.stash-branch-utils:copy-commit-action', location = '/web-fragment-placeholder.config' */ WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-branch-utils','key':'copy-commit-action','moduleKey':'copy-commit-action','completeModuleKey':'com.atlassian.stash.stash-branch-utils:copy-commit-action','weight':12.0,'condition':function(ctx) { return WebFragments._getValue((function(ctx) { return ctx.atRevisionRef.type.id === 'commit'}), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'copy-branch-name'),'location':'stash.branch.layout.actions.dropdown','linkText':WebFragments._formatI18n("Copy revision", 'stash.branch.actions.copyrevision', '')});; ;/* module-key = 'com.atlassian.stash.stash-branch-utils:copy-tag-action', location = '/web-fragment-placeholder.config' */ WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-branch-utils','key':'copy-tag-action','moduleKey':'copy-tag-action','completeModuleKey':'com.atlassian.stash.stash-branch-utils:copy-tag-action','weight':11.0,'condition':function(ctx) { return WebFragments._getValue((function(ctx) { return ctx.atRevisionRef.type.id === 'tag'}), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'copy-branch-name'),'location':'stash.branch.layout.actions.dropdown','linkText':WebFragments._formatI18n("Copy tag name", 'stash.branch.actions.copytag', '')});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:web-fragment-templates', location = '/static/widget/web-fragment.soy' */ // This file was automatically generated from web-fragment.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.webItem = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '<' + soy.$$escapeHtml(opt_data.url || opt_data.forceLink ? 'a' : 'span') + ((opt_data.url) ? ' href="' + soy.$$escapeHtml(opt_data.url) + '"' : '') + ((opt_data.linkId) ? ' id="' + soy.$$escapeHtml(opt_data.linkId) + '"' : '') + ((opt_data.styleClass) ? ' class="' + soy.$$escapeHtml(opt_data.styleClass) + '"' : '') + ((opt_data.tooltip) ? ' title="' + soy.$$escapeHtml(opt_data.tooltip) + '"' : '') + ((opt_data.pluginKey && opt_data.moduleKey) ? ' data-web-item-key="' + soy.$$escapeHtml(opt_data.pluginKey) + ':' + soy.$$escapeHtml(opt_data.moduleKey) + '"' : '') + '>' + ((opt_data.content) ? soy.$$filterNoAutoescape(opt_data.content) : (opt_data.params && opt_data.params['stashIconClass']) ? '<span class="aui-icon ' + soy.$$escapeHtml(opt_data.params['stashIconClass']) + '">' + soy.$$escapeHtml(opt_data.linkText) + '</span>' : soy.$$escapeHtml(opt_data.linkText)) + '</' + soy.$$escapeHtml(opt_data.url || opt_data.forceLink ? 'a' : 'span') + '>'; }; if (goog.DEBUG) { stash.widget.webItem.soyTemplateName = 'stash.widget.webItem'; } stash.widget.webItemButton = function(opt_data, opt_ignored) { return '' + stash.buttons.button({buttonText: opt_data.linkText ? opt_data.linkText : '', id: opt_data.linkId, title: opt_data.tooltip, extraClasses: opt_data.styleClass && opt_data.extraClasses ? opt_data.styleClass + ' ' + opt_data.extraClasses : opt_data.styleClass ? opt_data.styleClass : opt_data.extraClasses, href: opt_data.url, iconType: opt_data.params['stashIconClass'] ? 'custom' : '', iconClass: opt_data.params['stashIconClass'], iconText: ! opt_data.linkText ? opt_data.tooltip : ''}); }; if (goog.DEBUG) { stash.widget.webItemButton.soyTemplateName = 'stash.widget.webItemButton'; } stash.widget.webItemtabMenuItem = function(opt_data, opt_ignored) { return '' + widget.aui.tabMenuItem({id: opt_data.linkId, tooltip: opt_data.tooltip, text: opt_data.linkText, url: opt_data.url, extraClasses: opt_data.styleClass, isActive: opt_data.isActive}); }; if (goog.DEBUG) { stash.widget.webItemtabMenuItem.soyTemplateName = 'stash.widget.webItemtabMenuItem'; } stash.widget.webItemDropdownItem = function(opt_data, opt_ignored) { return '' + stash.widget.webItem(soy.$$augmentMap(opt_data, {forceLink: true})); }; if (goog.DEBUG) { stash.widget.webItemDropdownItem.soyTemplateName = 'stash.widget.webItemDropdownItem'; } stash.widget.webFragmentButtons = function(opt_data, opt_ignored) { var output = ''; var webFragmentList70 = opt_data.isReverse ? WebFragments.getWebFragments(opt_data.location,opt_data.context).reverse() : WebFragments.getWebFragments(opt_data.location,opt_data.context); var webFragmentListLen70 = webFragmentList70.length; for (var webFragmentIndex70 = 0; webFragmentIndex70 < webFragmentListLen70; webFragmentIndex70++) { var webFragmentData70 = webFragmentList70[webFragmentIndex70]; switch (webFragmentData70.type) { case 'ITEM': output += stash.buttons.buttons({content: '' + stash.widget.webItemButton(webFragmentData70)}); break; case 'SECTION': var param78 = ''; var webItemList79 = opt_data.isReverse ? WebFragments.getWebItems(opt_data.location + '/' + webFragmentData70.key,opt_data.context).reverse() : WebFragments.getWebItems(opt_data.location + '/' + webFragmentData70.key,opt_data.context); var webItemListLen79 = webItemList79.length; for (var webItemIndex79 = 0; webItemIndex79 < webItemListLen79; webItemIndex79++) { var webItemData79 = webItemList79[webItemIndex79]; param78 += stash.widget.webItemButton(webItemData79); } output += stash.buttons.buttons({extraClasses: webFragmentData70.styleClass, content: param78}); break; } } return output; }; if (goog.DEBUG) { stash.widget.webFragmentButtons.soyTemplateName = 'stash.widget.webFragmentButtons'; } stash.widget.webItemTabs = function(opt_data, opt_ignored) { var param85 = '' + ((opt_data.tabItemsContent) ? soy.$$filterNoAutoescape(opt_data.tabItemsContent) : ''); var itemList90 = opt_data.webItems ? opt_data.webItems : WebFragments.getWebItems(opt_data.location,opt_data.context ? opt_data.context : null); var itemListLen90 = itemList90.length; for (var itemIndex90 = 0; itemIndex90 < itemListLen90; itemIndex90++) { var itemData90 = itemList90[itemIndex90]; var param98 = ''; var subPanelList99 = WebFragments.getWebPanels(itemData90.moduleKey + '.meta',opt_data.context ? opt_data.context : null).map(function(webPanel) { return soydata.VERY_UNSAFE.ordainSanitizedHtml(webPanel); }); var subPanelListLen99 = subPanelList99.length; for (var subPanelIndex99 = 0; subPanelIndex99 < subPanelListLen99; subPanelIndex99++) { var subPanelData99 = subPanelList99[subPanelIndex99]; param98 += soy.$$escapeHtml(subPanelData99); } param85 += widget.aui.tabMenuItem({url: itemData90.url, text: itemData90.linkText, id: itemData90.linkId, extraLinkClasses: itemData90.styleClass, tooltip: itemData90.tooltip, isActive: opt_data.showFirstTab ? itemIndex90 == 0 : opt_data.activeTab ? itemData90.moduleKey == opt_data.activeTab : false, extraAttributes: {'data-module-key': itemData90.moduleKey}, extraLinkContent: param98}); } var output = '' + widget.aui.tabChrome(soy.$$augmentMap(opt_data, {tabItemsContent: param85})); return output; }; if (goog.DEBUG) { stash.widget.webItemTabs.soyTemplateName = 'stash.widget.webItemTabs'; } stash.widget.sidebarWebFragmentNavigation = function(opt_data, opt_ignored) { var output = ''; if (opt_data.primaryNavContent || opt_data.secondaryNavContent || opt_data.webFragments.length > 0) { var param112 = '<ul class="aui-nav">' + ((opt_data.primaryNavContent) ? soy.$$filterNoAutoescape(opt_data.primaryNavContent) : ''); var fragmentList118 = opt_data.webFragments; var fragmentListLen118 = fragmentList118.length; for (var fragmentIndex118 = 0; fragmentIndex118 < fragmentListLen118; fragmentIndex118++) { var fragmentData118 = fragmentList118[fragmentIndex118]; param112 += (fragmentData118.type == 'ITEM') ? stash.widget.sidebarNavItemWebItem({context: opt_data.context, isActive: fragmentData118.moduleKey == opt_data.activeNavItem, isTierOne: opt_data.isTierOne, webItem: fragmentData118}) : (fragmentData118.type == 'SECTION') ? stash.widget.sidebarNavWebSection({activeNavItem: opt_data.activeNavItem, context: opt_data.context, fragment: fragmentData118, isTierOne: opt_data.isTierOne}) : ''; } param112 += '</ul>'; output += widget.aui.sidebarNavGroup({extraClasses: opt_data.extraClasses, isTierOne: opt_data.isTierOne, isActions: opt_data.isActions, title: opt_data.title, navContent: param112, secondaryNavContent: '' + ((opt_data.secondaryNavContent) ? '<ul class="aui-nav">' + soy.$$filterNoAutoescape(opt_data.secondaryNavContent) + '</ul>' : '')}); } return output; }; if (goog.DEBUG) { stash.widget.sidebarWebFragmentNavigation.soyTemplateName = 'stash.widget.sidebarWebFragmentNavigation'; } stash.widget.sidebarNavWebSection = function(opt_data, opt_ignored) { return '' + stash.widget.sidebarNavSectionWithItems({activeNavItem: opt_data.activeNavItem, context: opt_data.context, heading: opt_data.fragment.labelText, isTierOne: opt_data.isTierOne, webItems: WebFragments.getWebItems(opt_data.fragment.location + '/' + opt_data.fragment.key,opt_data.context ? opt_data.context : null)}); }; if (goog.DEBUG) { stash.widget.sidebarNavWebSection.soyTemplateName = 'stash.widget.sidebarNavWebSection'; } stash.widget.sidebarNavSectionWithItems = function(opt_data, opt_ignored) { var output = ''; if (opt_data.webItems.length) { output += widget.aui.navHeading({text: opt_data.heading}) + '<ul class="aui-nav">'; var webItemList155 = opt_data.webItems; var webItemListLen155 = webItemList155.length; for (var webItemIndex155 = 0; webItemIndex155 < webItemListLen155; webItemIndex155++) { var webItemData155 = webItemList155[webItemIndex155]; output += stash.widget.sidebarNavItemWebItem({context: opt_data.context, isActive: webItemData155.moduleKey == opt_data.activeNavItem || webItemData155.linkId == opt_data.activeNavItem, isTierOne: opt_data.isTierOne, webItem: webItemData155}); } output += '</ul>'; } return output; }; if (goog.DEBUG) { stash.widget.sidebarNavSectionWithItems.soyTemplateName = 'stash.widget.sidebarNavSectionWithItems'; } stash.widget.sidebarNavItemWebItem = function(opt_data, opt_ignored) { var param172 = ''; if (opt_data.webItem.moduleKey) { var badgeContentList175 = WebFragments.getWebPanels(opt_data.webItem.moduleKey + '.badge',opt_data.context ? opt_data.context : null).map(function(webPanel) { return soydata.VERY_UNSAFE.ordainSanitizedHtml(webPanel); }); var badgeContentListLen175 = badgeContentList175.length; for (var badgeContentIndex175 = 0; badgeContentIndex175 < badgeContentListLen175; badgeContentIndex175++) { var badgeContentData175 = badgeContentList175[badgeContentIndex175]; param172 += ' ' + soy.$$escapeHtml(badgeContentData175); } } var output = '' + widget.aui.sidebarNavItem({extraClasses: opt_data.webItem.styleClass, iconClass: opt_data.webItem.params['stashIconClass'], id: opt_data.webItem.linkId, isActive: opt_data.isActive, isTierOne: opt_data.isTierOne, text: opt_data.webItem.linkText, tooltip: opt_data.webItem.tooltip, url: opt_data.webItem.url, badgeContent: param172}); return output; }; if (goog.DEBUG) { stash.widget.sidebarNavItemWebItem.soyTemplateName = 'stash.widget.sidebarNavItemWebItem'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:branch-layout', location = '/static/layout/branch/branch.js' */ define("layout/branch",["jquery","lodash","stash/api/util/navbuilder","util/events","model/page-state","model/revision-reference","feature/repository/revision-reference-selector","exports"],function(F,C,H,E,D,G,B,A){A.onReady=function(I,J){J=J||"at";var L=function(M){M=B.prototype._addRefTypeAndRepositoryToResults.call(this,M);var N=H.parse(window.location.href);C.each(M.values,function(P){if(!P.url){var O=N.clone();O.replaceQueryParam(J,P.id);P.url=O.query()+(O.anchor()?O.anchor():"")}});return M};var K=new B(F(I),{id:"repository-layout-revision-selector-dialog",dataTransform:L});D.setRevisionRef(K.getSelectedItem());E.on("stash.feature.repository.revisionReferenceSelector.revisionRefChanged",function(M){if(this===K){E.trigger("stash.layout.branch.revisionRefChanged",this,M);D.setRevisionRef(K.getSelectedItem())}});E.on("stash.page.*.revisionRefChanged",function(M){K.setSelectedItem(G.hydrateDeprecated(M))});E.on("stash.widget.keyboard-shortcuts.register-contexts",function(M){M.enableContext("branch")});F("#branch-actions-menu").on("aui-dropdown2-show",function(){E.trigger("stash.layout.branch.actions.dropdownShown");F("#branch-actions").focus();F(this).html(stash.layout.branch.actionsDropdownMenu({repository:D.getRepository().toJSON(),atRevisionRef:D.getRevisionRef().toJSON()}))}).on("aui-dropdown2-hide",function(){E.trigger("stash.layout.branch.actions.dropdownHidden")})}});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:branch-layout', location = '/static/layout/branch/branch-actions-clientside.soy' */ // This file was automatically generated from branch-actions-clientside.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.layout.branch. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.layout == 'undefined') { stash.layout = {}; } if (typeof stash.layout.branch == 'undefined') { stash.layout.branch = {}; } stash.layout.branch.actionsDropdownMenu = function(opt_data, opt_ignored) { var output = '<ul>'; var webItemList4 = WebFragments.getWebItems('stash.branch.layout.actions.dropdown',{repository: opt_data.repository, atRevisionRef: opt_data.atRevisionRef}); var webItemListLen4 = webItemList4.length; for (var webItemIndex4 = 0; webItemIndex4 < webItemListLen4; webItemIndex4++) { var webItemData4 = webItemList4[webItemIndex4]; output += '<li class="branch-action-item">' + stash.widget.webItem(soy.$$augmentMap(webItemData4, {url: webItemData4.url ? webItemData4.url : '#'})) + '</li>'; } output += '</ul>'; return output; }; if (goog.DEBUG) { stash.layout.branch.actionsDropdownMenu.soyTemplateName = 'stash.layout.branch.actionsDropdownMenu'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:paragraph', location = '/static/widget/paragraph.soy' */ // This file was automatically generated from paragraph.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.widget. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.widget == 'undefined') { stash.widget = {}; } stash.widget.paragraph = function(opt_data, opt_ignored) { return '<p' + ((opt_data.extraClasses) ? ' class="' + soy.$$escapeHtml(opt_data.extraClasses) + '"' : '') + '>' + soy.$$escapeHtml(opt_data.text) + '</p>'; }; if (goog.DEBUG) { stash.widget.paragraph.soyTemplateName = 'stash.widget.paragraph'; } ; ;/* module-key = 'com.atlassian.stash.stash-branch-utils:branch-creation-oncreated', location = '/static/branch-creation/branch-oncreated-discovery.js' */ jQuery(document).ready(function(){require(["aui","chaperone","util/client-storage","util/events"],function(b,e,a,c){function f(){var g=a.getFlashItem("stash.branch.created");return g+(30*1000)>new Date().getTime()}function d(){e.registerFeature("branch-created-actions-discovery",[{id:"action-discovery",selector:"#branch-actions",title:"Working with your new branch",content:stash.widget.paragraph({text:"Now that you\u0027ve created a new branch you can start development on it. Find branch-related actions in this menu."}),once:true}])}c.on("stash.feature.branch-creation.branchCreated",function(){a.setFlashItem("stash.branch.created",new Date().getTime())});if(f()){d()}})});; ;/* module-key = 'com.atlassian.stash.stash-repository-ref-sync:ref-sync-banner', location = '/static/feature/sync/banner/ref-sync-banner.js' */ define("feature/sync/banner/ref-sync-banner",["jquery","util/promise","feature/sync/common/ref-sync-common","exports"],function(c,b,d,a){a.onReady=function(){c("#disable-ref-sync").click(function(){b.spinner(c('<div class="spinner"></div>').insertAfter("#disable-ref-sync"),d.enableRefSyncing(false).done(function(){c("#ref-sync-banner").remove()}))})}});jQuery(function(){require("feature/sync/banner/ref-sync-banner").onReady()});; ;/* module-key = 'com.atlassian.analytics.analytics-client:js-events', location = 'js/store-1.3.1.js' */ (function(){var l={},h=window,k=h.document,c="localStorage",n="globalStorage",d="__storejs__",g;l.disabled=false;l.set=function(e,o){};l.get=function(e){};l.remove=function(e){};l.clear=function(){};l.transact=function(e,o){var p=l.get(e);if(typeof p=="undefined"){p={}}o(p);l.set(e,p)};l.serialize=function(e){return JSON.stringify(e)};l.deserialize=function(e){if(typeof e!="string"){return undefined}return JSON.parse(e)};function b(){try{return(c in h&&h[c])}catch(e){return false}}function m(){try{return(n in h&&h[n]&&h[n][h.location.hostname])}catch(e){return false}}if(b()){g=h[c];l.set=function(e,o){if(o===undefined){return l.remove(e)}g.setItem(e,l.serialize(o))};l.get=function(e){return l.deserialize(g.getItem(e))};l.remove=function(e){g.removeItem(e)};l.clear=function(){g.clear()}}else{if(m()){g=h[n][h.location.hostname];l.set=function(e,o){if(o===undefined){return l.remove(e)}g[e]=l.serialize(o)};l.get=function(e){return l.deserialize(g[e]&&g[e].value)};l.remove=function(e){delete g[e]};l.clear=function(){for(var e in g){delete g[e]}}}else{if(k.documentElement.addBehavior){var j,f;try{f=new ActiveXObject("htmlfile");f.open();f.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></frame>');f.close();j=f.w.frames[0].document;g=j.createElement("div")}catch(i){g=k.createElement("div");j=k.body}function a(e){return function(){var p=Array.prototype.slice.call(arguments,0);p.unshift(g);j.appendChild(g);g.addBehavior("#default#userData");g.load(c);var o=e.apply(l,p);j.removeChild(g);return o}}l.set=a(function(p,e,o){if(o===undefined){return l.remove(e)}p.setAttribute(e,l.serialize(o));p.save(c)});l.get=a(function(o,e){return l.deserialize(o.getAttribute(e))});l.remove=a(function(o,e){o.removeAttribute(e);o.save(c)});l.clear=a(function(q){var o=q.XMLDocument.documentElement.attributes;q.load(c);for(var p=0,e;e=o[p];p++){q.removeAttribute(e.name)}q.save(c)})}}}try{l.set(d,d);if(l.get(d)!=d){l.disabled=true}l.remove(d)}catch(i){l.disabled=true}if(typeof module!="undefined"){module.exports=l}else{if(typeof define==="function"&&define.amd){define(l)}else{this.store=l}}})();; ;/* module-key = 'com.atlassian.analytics.analytics-client:js-events', location = 'js/atlassian-analytics.js' */ (function(b){var m=AJS.$.ajax;var h="atlassian-analytics";var g=typeof AJS.contextPath=="function"?AJS.contextPath():typeof AJS.Confluence!="undefined"?AJS.Confluence.getContextPath():window.contextPath!=null?window.contextPath:"";var l=null;var i=null;var d=null;var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(u){var t=Math.random()*16|0,s=u=="x"?t:(t&3|8);return s.toString(16)});var p=function(){var s="unknown";if(document.body.id=="jira"){s="jira"}else{if(document.body.id=="com-atlassian-confluence"){s="confluence"}}i=h+"."+s;d=i+".lock"};var c=function(){if(store.get(d)){return false}store.set(d,n);return(store.get(d)===n)};var q=function(){store.set(d,null)};var f=function(){var t=[],v,w,s,u;if(AJS.EventQueue.length==0){return}t=store.get(i)||t;for(s=0,u=AJS.EventQueue.length;s<u;++s){w=AJS.EventQueue[s];if(w.name){v={name:w.name,properties:w.properties,time:w.time||0};t.push(v)}}AJS.EventQueue.length=0;store.set(i,t)};var e=function(){var t;if(!c()){return}f();t=store.get(i);if(t&&t.length){store.remove(i);q();if(k(t)){var u=new Date().getTime();for(var s=0;s<t.length;s++){if(t[s].time>0){t[s].timeDelta=t[s].time-u}else{t[s].timeDelta=s-t.length}delete t[s].time}l=m({type:"POST",url:g+"/rest/analytics/1.0/publish/bulk",data:JSON.stringify(t),contentType:"application/json",dataType:"json"});l.fail(function(){AJS.EventQueue.concat(t);f()})}}else{q()}};var k=function(u){for(var t=u.length-1;t>=0;t--){var w="";var v=u[t];var s=v.properties;if(typeof v.name==="undefined"){w="you must provide a name for the event."}else{if(typeof s!=="undefined"&&s!==null){if(s.constructor!==Object){w="properties must be an object with key value pairs."}else{a(s)}}}if(w!==""){AJS.log("WARN: Invalid analytics event detected and ignored, "+w+"\nEvent: "+JSON.stringify(v));u.splice(t,1)}}return u.length};var a=function(u){for(var t in u){if(u.hasOwnProperty(t)){var s=u[t];if(typeof s!=="undefined"&&s!==null&&s.toString){u[t]=s.toString()}else{u[t]=""}}}};var j=function(){if(l&&!(l.state()==="resolved"||l.state()==="rejected")){l.abort()}};AJS.EventQueue=AJS.EventQueue||[];var o=Array.prototype.push;AJS.EventQueue.push=function(s){s.time=new Date().getTime();o.call(AJS.EventQueue,s)};AJS.toInit(function(){p();setTimeout(e,500);setInterval(e,5000);r()});b(window).unload(function(){j();f()});AJS.Analytics={triggerPrivacyPolicySafeEvent:function(s,t){AJS.log("WARN: 'triggerPrivacyPolicySafeEvent' has been deprecated");AJS.EventQueue.push({name:s,properties:t})}};AJS.bind("analytics",function(s,t){AJS.EventQueue.push({name:t.name,properties:t.data})});AJS.bind("analyticsEvent",function(s,t){AJS.EventQueue.push({name:t.name,properties:t.data})});var r=function(){if(window.location.pathname.indexOf("/secure/admin/ViewApplicationProperties")>-1){AJS.$("[data-property-id='analytics-enabled']").remove()}else{if(window.location.pathname.indexOf("/secure/admin/EditApplicationProperties")>-1){var t=AJS.$(":contains(Enable Atlassian analytics)");if(t.size()>0){var s=t[t.size()-2];if(s){s.remove()}}}}}}(AJS.$));; ;/* module-key = 'com.atlassian.analytics.analytics-client:policy-update', location = 'js/policy-update.js' */ ; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:application-header-administration-cog-resource', location = 'header/cog.js' */ var NavLinks=(function(a){a.ApplicationHeader=function(b){b.Cog=(function(){var c=function(){var d=AJS.$("#system-admin-menu-content");if(d.length>0){return d}var e=AJS.$("#admin-menu-link-content");if(e.length>0){return e}return AJS.$("#bamboo\\.global\\.header-admin\\.menu")};return{getDropdown:c}}());return b}(a.ApplicationHeader||{});return a}(NavLinks||{}));; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:administration-shortcuts-resources', location = 'adminshortcuts/adminshortcuts.soy' */ // This file was automatically generated from adminshortcuts.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace navlinks.templates.adminshortcuts. */ if (typeof navlinks == 'undefined') { var navlinks = {}; } if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; } if (typeof navlinks.templates.adminshortcuts == 'undefined') { navlinks.templates.adminshortcuts = {}; } navlinks.templates.adminshortcuts.section = function(opt_data, opt_ignored) { var param5 = '<ul class="aui-list-truncate">'; var linkList7 = opt_data.links; var linkListLen7 = linkList7.length; for (var linkIndex7 = 0; linkIndex7 < linkListLen7; linkIndex7++) { var linkData7 = linkList7[linkIndex7]; param5 += '<li><a href="' + soy.$$escapeHtml(linkData7.link) + '">' + soy.$$escapeHtml(linkData7.label) + '</a></li>'; } param5 += '</ul>'; var output = '' + aui.dropdown2.section({id: 'nl-remote-admin-section', label: "Other applications", content: param5}); return output; }; if (goog.DEBUG) { navlinks.templates.adminshortcuts.section.soyTemplateName = 'navlinks.templates.adminshortcuts.section'; } ; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:administration-shortcuts-resources', location = 'adminshortcuts/adminnavlinks.js' */ var NavLinks=(function(a){a.AdminShortcuts=(function(){var c=function(){return AJS.$.ajax({url:AJS.contextPath()+"/rest/menu/latest/admin",cache:false,dataType:"json"})};var b=function(){AJS.$("#nl-remote-admin-section").on("click","a",function(){NL.trackEvent("remoteAdminItemSelected",NL.getCurrentApplication(),$(this).attr("href"))})};return{render:function(){c().done(function(e){e=_.reject(e,function(f){return f.local===true});if(e.length){var d=navlinks.templates.adminshortcuts.section({links:e});a.ApplicationHeader.Cog.getDropdown().append(d);b()}})}}}());return a}(NavLinks||{}));; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-projectshortcuts', location = 'projectshortcuts/projectshortcuts.soy' */ // This file was automatically generated from projectshortcuts.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace navlinks.templates.projectshortcuts. */ if (typeof navlinks == 'undefined') { var navlinks = {}; } if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; } if (typeof navlinks.templates.projectshortcuts == 'undefined') { navlinks.templates.projectshortcuts = {}; } navlinks.templates.projectshortcuts.dialogContent = function(opt_data, opt_ignored) { return '' + ((opt_data.localShortcuts && opt_data.localShortcuts.length > 0) ? navlinks.templates.projectshortcuts.dialogContentShortcuts({shortcuts: opt_data.localShortcuts, listClass: 'projectshortcut-links'}) : '') + ((opt_data.remoteShortcuts != null) ? (opt_data.remoteShortcuts.length > 0) ? '<h2 class="projectshortcuts-heading">Related Links</h2>' + navlinks.templates.projectshortcuts.dialogContentShortcuts(soy.$$augmentMap(opt_data.remoteShortcuts, {shortcuts: opt_data.remoteShortcuts, listClass: 'projectshortcut-links'})) : '' : navlinks.templates.projectshortcuts.dialogLoading(null)); }; if (goog.DEBUG) { navlinks.templates.projectshortcuts.dialogContent.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogContent'; } navlinks.templates.projectshortcuts.headingWrapper = function(opt_data, opt_ignored) { return '<div class="project-dialog-header-wrapper"><div class="project-header"><img class="project-img" src="' + soy.$$escapeHtml(opt_data.logoUrl) + '"><h2 class="dialog-title">' + soy.$$escapeHtml(opt_data.title) + '</h2></div><div class="project-content-wrapper">' + soy.$$filterNoAutoescape(opt_data.contentHtml) + '</div></div>'; }; if (goog.DEBUG) { navlinks.templates.projectshortcuts.headingWrapper.soyTemplateName = 'navlinks.templates.projectshortcuts.headingWrapper'; } navlinks.templates.projectshortcuts.dialogContentShortcuts = function(opt_data, opt_ignored) { opt_data = opt_data || {}; var output = '<ul' + ((opt_data.listClass) ? ' class="' + soy.$$escapeHtml(opt_data.listClass) + '"' : '') + '>'; var shortcutList35 = opt_data.shortcuts; var shortcutListLen35 = shortcutList35.length; for (var shortcutIndex35 = 0; shortcutIndex35 < shortcutListLen35; shortcutIndex35++) { var shortcutData35 = shortcutList35[shortcutIndex35]; output += '<li' + ((shortcutIndex35 == shortcutListLen35 - 1) ? ' class="last"' : '') + '>' + navlinks.templates.projectshortcuts.dialogContentShortcut(shortcutData35) + '</li>'; } output += '</ul>'; return output; }; if (goog.DEBUG) { navlinks.templates.projectshortcuts.dialogContentShortcuts.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogContentShortcuts'; } navlinks.templates.projectshortcuts.dialogContentShortcut = function(opt_data, opt_ignored) { return '<a href="' + soy.$$escapeHtml(opt_data.link) + '"' + ((opt_data.tooltip) ? ' title="' + soy.$$escapeHtml(opt_data.tooltip) + '"' : '') + '>' + soy.$$escapeHtml(opt_data.label) + '</a>'; }; if (goog.DEBUG) { navlinks.templates.projectshortcuts.dialogContentShortcut.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogContentShortcut'; } navlinks.templates.projectshortcuts.dialogLoading = function(opt_data, opt_ignored) { opt_data = opt_data || {}; return '<div class="projectshortcuts-loading">' + ((opt_data.text) ? soy.$$escapeHtml(opt_data.text) : '') + '</div>'; }; if (goog.DEBUG) { navlinks.templates.projectshortcuts.dialogLoading.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogLoading'; } ; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-projectshortcuts', location = 'projectshortcuts/projectshortcuts.js' */ (function(e,g){var i,k={},m="key",b="name",j="entity-type";function f(s){var n=e(this),o=n.data(m),q=n.data(b),p=n.data(j);if(typeof o==="undefined"){return}s.preventDefault();i=new AJS.Dialog({width:600,keypressListener:function(u){if(u.which==jQuery.ui.keyCode.ESCAPE){i.remove()}},id:"project-shortcuts-dialog"}).addCancel("Close",function(){i.remove()}).addPanel("",navlinks.templates.projectshortcuts.headingWrapper({title:q,logoUrl:h(),contentHtml:navlinks.templates.projectshortcuts.dialogLoading({text:"Retrieving links…"})})).show();c(i);if(!k[o]){k[o]={entity:{title:q},localShortcuts:null,remoteShortcuts:null};d(AJS.contextPath()+"/rest/project-shortcuts/1.0/local/"+o,{entityType:p}).done(t);d(AJS.contextPath()+"/rest/project-shortcuts/1.0/remote/"+o,{entityType:p}).done(r).fail(function(){var u=i.getCurrentPanel().body.find(".project-content-wrapper");u.find(".projectshortcuts-loading").remove();AJS.messages.error(u,{body:"Could not retrieve remote project shortcuts",closeable:false});c(i)})}else{l(k[o])}function t(u){k[o].localShortcuts=u.shortcuts;l(k[o])}function r(u){k[o].remoteShortcuts=u.shortcuts;l(k[o])}}function h(){return e(".project-shortcut-dialog-trigger img").attr("src")}function l(n){if(n.localShortcuts){i.getCurrentPanel().html(navlinks.templates.projectshortcuts.headingWrapper({title:n.entity.title,logoUrl:h(),contentHtml:navlinks.templates.projectshortcuts.dialogContent(n)}));c(i)}}function a(p){var o=210;if(!p||p.length<=o){return p}var n=o;while(n>0&&p.charAt(n)!=" "){n--}if(n==0){n=o}p=p.substring(0,n);if(p.length>=n){p=p+"..."}return p}function c(n){var q=n.popup.element,p=q.find(".dialog-panel-body"),o=q.find(".dialog-components");p.height("auto");q.height(o.outerHeight()-1);e(".aui-shadow").remove()}function d(n,o){return e.ajax({url:n,cache:false,data:o,dataType:"json"})}e(document).on("click",".project-shortcut-dialog-trigger",f)}(jQuery,window.NL=(window.NL||{})));; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:atlassian-ui-popup-display-controller', location = 'popups/DisplayController.js' */ AJS.Popups=AJS.Popups||{};AJS.Popups.DisplayController=function(){var c=[];var a=false;var b=false;AJS.toInit(function(){setTimeout(function(){AJS.Popups.DisplayController.render()},0)});return{request:function(d){c.push(d);if(a&&b===false){this.render()}},render:function(){c.sort(function(e,d){return e.weight-d.weight});a=true;if(c.length!==0){b=true;c[0].show()}}}}();; ;/* module-key = 'com.atlassian.support.stp:stp-license-status-resources', location = 'js/stp-licenseStatus.js' */ (function(b){var a={destroyBanner:function(){AJS.$("#stp-licenseStatus-banner").slideUp(function(){AJS.$("#stp-licenseStatus-banner").remove()})},remindMeNever:function(c){c.preventDefault();AJS.$.ajax({type:"POST",async:true,url:AJS.contextPath()+"/rest/stp/1.0/license/remindMeNever"});a.destroyBanner()},remindMeLater:function(){AJS.$.ajax({type:"POST",async:true,url:AJS.contextPath()+"/rest/stp/1.0/license/remindMeLater"});a.destroyBanner()},recordOutboundLink:function(c,d){var e=e||[];e.push(["_setAccount",c],["_setCampSourceKey","STP"],["_setCampMediumKey","renewals_reminder"],["_setCampNameKey",d],["_trackEvent","renewal"])},createBanner:function(){AJS.$.ajax({type:"GET",dataType:"json",async:true,url:AJS.contextPath()+"/rest/stp/1.0/license/status",statusCode:{200:function(f){var c="\n<div id='stp-licenseStatus-banner' class='aui-message warning'>\n";var e=f.daysToExpiry;var d="http://www.atlassian.com/company/contact?utm_source=STP&utm_medium=renewals_reminder&utm_campaign=";var g="http://www.my.atlassian.com?utm_source=STP&utm_medium=renewals_reminder&utm_campaign=";if(e<=30&&e>14){licenseLink=d+"renewals_30_reminder";c+=AJS.format("Your {0} license maintenance expires in {1} days. {2}Contact Atlassian{3}, {4}remind me later{5} or {6}never remind me again{7}.",f.productName,30,"<a id='stp-licenseStatus-contactAtlassian' target='_blank' href=\""+licenseLink+'">',"</a>","<a id='stp-licenseStatus-remindMeLater' href='#'>","</a>","<a id='stp-licenseStatus-remindMeNever' href='#'>","</a>");c+="<span class ='aui-icon icon-warning'></span>"}else{if(e<=14&&e>7){licenseLink=d+"renewals_14_reminder";c+=AJS.format("You will lose access to Support and Updates for {0} in {1} days. {2}Contact Atlassian{3}, {4}remind me later{5} or {6}never remind me again{7}.",f.productName,14,"<a id='stp-licenseStatus-contactAtlassian' target='_blank' href=\""+licenseLink+'">',"</a>","<a id='stp-licenseStatus-remindMeLater' href='#'>","</a>","<a id='stp-licenseStatus-remindMeNever' href='#'>","</a>");c+="<span class ='aui-icon icon-warning'></span>"}else{if(e<=7){licenseLink=g+"renewals_7_reminder";c+=AJS.format("Your {0} Support and Updates access expires in {1} days. You can renew via {2}my.atlassian.com{3}. {4}Remind me later{5} or {6}never remind me again{7}.",f.productName,7,"<a id='stp-licenseStatus-renewNow' target='_blank' href=\""+licenseLink+'">',"</a>","<a id='stp-licenseStatus-remindMeLater' href='#'>","</a>","<a id='stp-licenseStatus-remindMeNever' href='#'>","</a>");c+="<span class ='aui-icon icon-warning'></span>"}}}c+="\n</div>";b(c).prependTo(document.body);AJS.$("#stp-licenseStatus-remindMeNever").click(a.remindMeNever);AJS.$("#stp-licenseStatus-remindMeLater").click(function(h){h.preventDefault();a.remindMeLater()});AJS.$("#stp-licenseStatus-contactAtlassian").click(function(h){a.remindMeLater()});AJS.$("#stp-licenseStatus-renewNow").click(function(h){a.remindMeLater()})}}})}};AJS.$(document).ready(function(){b("#stp-licenseStatus-banner").length||a.createBanner()})})(AJS.$);; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher.soy' */ // This file was automatically generated from appswitcher.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace navlinks.templates.appswitcher. */ if (typeof navlinks == 'undefined') { var navlinks = {}; } if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; } if (typeof navlinks.templates.appswitcher == 'undefined') { navlinks.templates.appswitcher = {}; } navlinks.templates.appswitcher.linkSection = function(opt_data, opt_ignored) { var output = ''; if (opt_data.list.length > 0) { output += '<div class="aui-nav-heading sidebar-section-header">' + soy.$$escapeHtml(opt_data.title) + '</div><ul class="aui-nav nav-links">'; var linkList8 = opt_data.list; var linkListLen8 = linkList8.length; for (var linkIndex8 = 0; linkIndex8 < linkListLen8; linkIndex8++) { var linkData8 = linkList8[linkIndex8]; output += navlinks.templates.appswitcher.applicationsItem(linkData8); } output += '</ul>'; } return output; }; if (goog.DEBUG) { navlinks.templates.appswitcher.linkSection.soyTemplateName = 'navlinks.templates.appswitcher.linkSection'; } navlinks.templates.appswitcher.applicationsItem = function(opt_data, opt_ignored) { return '<li class="nav-link"><a href="' + soy.$$escapeHtml(opt_data.link) + '" class="interactive' + ((opt_data.self) ? ' checked' : '') + '" title="' + soy.$$escapeHtml(opt_data.link) + '"><span class="nav-link-label">' + soy.$$escapeHtml(opt_data.label) + '</span></a></li>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher.applicationsItem.soyTemplateName = 'navlinks.templates.appswitcher.applicationsItem'; } navlinks.templates.appswitcher.shortcutsItem = function(opt_data, opt_ignored) { return '<li class="nav-link"><a href="' + soy.$$escapeHtml(opt_data.link) + '" class="interactive' + ((opt_data.self) ? ' checked' : '') + '" title="' + soy.$$escapeHtml(opt_data.link) + '"><span class="nav-link-label">' + soy.$$escapeHtml(opt_data.label) + '</span>' + ((opt_data.showDescription && opt_data.description) ? '<span class="nav-link-description">' + soy.$$escapeHtml(opt_data.description) + '</span>' : '') + '</a></li>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher.shortcutsItem.soyTemplateName = 'navlinks.templates.appswitcher.shortcutsItem'; } navlinks.templates.appswitcher.error = function(opt_data, opt_ignored) { return '<div class="app-switcher-error">' + soy.$$filterNoAutoescape("Something went wrong, please \x3cspan class\x3d\x22app-switcher-retry\x22\x3etry again\x3c/span\x3e.") + '</div>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher.error.soyTemplateName = 'navlinks.templates.appswitcher.error'; } navlinks.templates.appswitcher.sidebarContents = function(opt_data, opt_ignored) { return '<div class="aui-page-panel-nav"><nav class="aui-navgroup aui-navgroup-vertical"><div class="app-switcher-section app-switcher-applications"><div class="aui-nav-heading">' + soy.$$escapeHtml("Application Links") + '</div><div class="app-switcher-loading">' + soy.$$filterNoAutoescape("Loading\x26hellip;") + '</div></div><div class="app-switcher-section app-switcher-shortcuts"><div class="aui-nav-heading">' + soy.$$escapeHtml("Shortcuts") + '</div><div class="app-switcher-loading">' + soy.$$filterNoAutoescape("Loading\x26hellip;") + '</div></div></nav></div>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher.sidebarContents.soyTemplateName = 'navlinks.templates.appswitcher.sidebarContents'; } navlinks.templates.appswitcher.trigger = function(opt_data, opt_ignored) { return '<span class="aui-icon aui-icon-small aui-iconfont-appswitcher">' + soy.$$escapeHtml("Linked Applications") + '</span>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher.trigger.soyTemplateName = 'navlinks.templates.appswitcher.trigger'; } navlinks.templates.appswitcher.projectHeaderSection = function(opt_data, opt_ignored) { return '<div class="app-switcher-title">' + aui.avatar.avatar({size: 'large', avatarImageUrl: opt_data.avatarUrl, isProject: true, title: opt_data.name}) + '<div class="sidebar-project-name">' + soy.$$escapeHtml(opt_data.name) + '</div></div>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher.projectHeaderSection.soyTemplateName = 'navlinks.templates.appswitcher.projectHeaderSection'; } navlinks.templates.appswitcher.cogDropdown = function(opt_data, opt_ignored) { var output = ''; var dropdownList__soy74 = '' + navlinks.templates.appswitcher.dropdownList({list: opt_data.links}); output += aui.dropdown2.dropdown2({menu: {id: opt_data.id, content: dropdownList__soy74, extraClasses: 'aui-style-default sidebar-customize-section'}, trigger: {showIcon: false, content: '<span class="aui-icon aui-icon-small aui-iconfont-configure"></span>', container: '#app-switcher'}}); return output; }; if (goog.DEBUG) { navlinks.templates.appswitcher.cogDropdown.soyTemplateName = 'navlinks.templates.appswitcher.cogDropdown'; } navlinks.templates.appswitcher.dropdownList = function(opt_data, opt_ignored) { var output = '<ul class="sidebar-admin-links">'; var linkList82 = opt_data.list; var linkListLen82 = linkList82.length; for (var linkIndex82 = 0; linkIndex82 < linkListLen82; linkIndex82++) { var linkData82 = linkList82[linkIndex82]; output += '<li class="nav-link"><a href="' + soy.$$escapeHtml(linkData82.href) + '" title="' + soy.$$escapeHtml(linkData82.title) + '"><span class="nav-link-label">' + soy.$$escapeHtml(linkData82.label) + '</span></a></li>'; } output += '</ul>'; return output; }; if (goog.DEBUG) { navlinks.templates.appswitcher.dropdownList.soyTemplateName = 'navlinks.templates.appswitcher.dropdownList'; } navlinks.templates.appswitcher.switcher = function(opt_data, opt_ignored) { var output = ''; if (true) { if (AJS.DarkFeatures.isEnabled('rotp.sidebar')) { var sidebarContents__soy97 = '' + navlinks.templates.appswitcher.sidebarContents(null); var triggerContent__soy99 = '' + navlinks.templates.appswitcher.trigger(null); output += navlinks.templates.appswitcher.sidebar({sidebar: {id: 'app-switcher', content: sidebarContents__soy97}, trigger: {showIcon: false, content: triggerContent__soy99}}) + '<script>\n (function (NL) {\n var initialise = function () {\n new NL.SideBar({\n sidebarContents: \'#app-switcher\'\n });\n };\n if (NL.SideBar) {\n initialise();\n } else {\n NL.onInit = initialise;\n }\n }(window.NL = (window.NL || {})));\n window.NL.isUserAdmin = ' + soy.$$escapeHtml(false) + '<\/script>'; } else { output += navlinks.templates.appswitcher_old.switcher(null); } } return output; }; if (goog.DEBUG) { navlinks.templates.appswitcher.switcher.soyTemplateName = 'navlinks.templates.appswitcher.switcher'; } navlinks.templates.appswitcher.sidebar = function(opt_data, opt_ignored) { return '<a href="' + soy.$$escapeHtml(opt_data.sidebar.id) + '" class="sidebar-trigger app-switcher-trigger" aria-owns="' + soy.$$escapeHtml(opt_data.sidebar.id) + '" aria-haspopup="true">' + soy.$$filterNoAutoescape(opt_data.trigger.content) + '</a><div id=' + soy.$$escapeHtml(opt_data.sidebar.id) + ' class="app-switcher-sidebar aui-style-default sidebar-offscreen">' + soy.$$filterNoAutoescape(opt_data.sidebar.content) + '</div>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher.sidebar.soyTemplateName = 'navlinks.templates.appswitcher.sidebar'; } ; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher.js' */ (function(c,a){a.SideBar=function(d){var e=this;this.$sidebar=null;d=c.extend({sidebarContents:null},d);this.getLinks=function(){return c.ajax({url:AJS.contextPath()+"/rest/menu/latest/appswitcher",cache:false,dataType:"json"}).done(this.updateAppLinks).fail(this.showAppSwitcherError)};this.populateProjectHeader=function(g,f){e.getSidebar().find(".app-switcher-shortcuts .aui-nav-heading").after(navlinks.templates.appswitcher.projectHeaderSection({avatarUrl:f,name:g}))};this.getProjectData=function(){var f=c(".project-shortcut-dialog-trigger"),g=f.data("key"),h=f.data("entity-type");if(f.size()==0||!g||!h){c(".app-switcher-shortcuts").remove();return}var j,i;i=c.ajax({url:AJS.contextPath()+"/rest/project-shortcuts/1.0/local/"+g,cache:false,data:{entityType:h},dataType:"json"});j=c.ajax({url:AJS.contextPath()+"/rest/project-shortcuts/1.0/remote/"+g,cache:false,data:{entityType:h},dataType:"json"});c.when(i,j).then(function(l,k){e.updateProjectShortcuts(l,k,{key:g,entityType:h,name:f.data("name"),avatarUrl:f.find("img").prop("src")})},e.showProjectShortcutsError)};this.getSidebar=function(){if(!this.$sidebar){this.$sidebar=c(d.sidebarContents)}return this.$sidebar};this.addApplicationsCog=function(){c(".app-switcher-applications .aui-nav-heading").before(navlinks.templates.appswitcher.cogDropdown({id:"sidebar-applications-admin-dropdown",links:[{href:AJS.contextPath()+"/plugins/servlet/customize-application-navigator",label:"Customize navigator",title:"Add new entries, hide existing or restrict who sees what"},{href:AJS.contextPath()+"/plugins/servlet/applinks/listApplicationLinks",label:"Manage application links",title:"Link to more Atlassian applications"}]}))};this.addProjectShortcutsCog=function(f,h){var g=[{href:AJS.contextPath()+"/plugins/servlet/custom-content-links-admin?entityKey="+f,label:"Customize shortcuts",title:""}];if(e.entityMappings[h]){g.push({href:e.generateEntityLinksUrl(f,e.entityMappings[h]),label:"Manage product links",title:""})}e.getSidebar().find(".app-switcher-shortcuts .aui-nav-heading").before(navlinks.templates.appswitcher.cogDropdown({id:"sidebar-project-shortcuts-admin-dropdown",links:g}))};this.updateAppLinks=function(f){c(function(){e.getSidebar().find(".app-switcher-applications").html(navlinks.templates.appswitcher.linkSection({title:"Application Links",list:f}));if(a.isUserAdmin){e.addApplicationsCog()}e.bindAnalyticsHandlers(e.getSidebar(),f)})};this.updateProjectShortcuts=function(i,g,h){var j=i[0].shortcuts,f=g[0].shortcuts;e.getSidebar().find(".app-switcher-shortcuts").html(navlinks.templates.appswitcher.linkSection({title:"Shortcuts",list:j.concat(f)}));if(a.isUserAdmin){e.addProjectShortcutsCog(h.key,h.entityType)}e.populateProjectHeader(h.name,h.avatarUrl);e.bindAnalyticsHandlers(e.getSidebar(),data)};this.entityMappings={"confluence.space":"com.atlassian.applinks.api.application.confluence.ConfluenceSpaceEntityType","jira.project":"com.atlassian.applinks.api.application.jira.JiraProjectEntityType","bamboo.project":"com.atlassian.applinks.api.application.bamboo.BambooProjectEntityType","stash.project":"com.atlassian.applinks.api.application.stash.StashProjectEntityType"};this.generateEntityLinksUrl=function(f,g){if(g===e.entityMappings["confluence.space"]){return AJS.contextPath()+"/spaces/listentitylinks.action?typeId="+g+"&key="+f}else{return AJS.contextPath()+"/plugins/servlet/applinks/listEntityLinks/"+g+"/"+f}};this.showAppSwitcherError=function(){c(function(){var f=e.getSidebar();f.find(".app-switcher-applications .app-switcher-loading").replaceWith(navlinks.templates.appswitcher.error());f.off(".appswitcher").on("click.appswitcher",".app-switcher-retry",c.proxy(e.retryLoading,e))})};this.showProjectShortcutsError=function(){c(function(){var f=e.getSidebar();f.find(".app-switcher-shortcuts .app-switcher-loading").replaceWith(navlinks.templates.appswitcher.error());f.off(".appswitcher").on("click.appswitcher",".app-switcher-retry",c.proxy(e.retryLoading,e))})};this.retryLoading=function(f){this.getSidebar().html(navlinks.templates.appswitcher.sidebarContents());this.getLinks();this.getProjectData();f&&f.stopPropagation()};this.bindAnalyticsHandlers=function(f,g){};this.getLinks();c(this.getProjectData);this.toggleSidebar=function(h){var i=e.getSidebar(),g=c("body"),f=c(window.document);if(!g.hasClass("app-switcher-open")){var k=c("#header");i.css("left",-i.width());i.parent("body").length||i.appendTo("body");b({data:i});i.animate({left:0},300);function j(l){var n=l.target&&c(l.target),m=l.keyCode;if(l.originalEvent===h.originalEvent){return}if(n&&!m&&!(n.closest(i).length||n.closest(k).length)&&h.which==1&&!(l.shiftKey||l.ctrlKey||l.metaKey)){e.toggleSidebar()}else{if(m===27){e.toggleSidebar()}}}f.on("click.appSwitcher",j);f.on("keydown.appSwitcher",j);f.on("scroll.appSwitcher",i,b)}else{f.off(".appSwitcher")}g.toggleClass("app-switcher-open")};c("#header").on("click",".app-switcher-trigger",this.toggleSidebar)};function b(f){var d=c(document).scrollTop(),g=c("#header"),e=(g.height()+g.offset().top)-d;if(e>=0){f.data.css({top:e,position:"fixed"})}else{f.data.css({top:0,left:0,position:"fixed"})}}if(a.onInit){a.onInit()}}(jQuery,window.NL=(window.NL||{})));; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher_old.js' */ (function(e,c){c.AppSwitcher=function(f){var g=AJS.contextPath()+"/plugins/servlet/customize-application-navigator";var h=this;this.$dropdown=null;f=e.extend({dropdownContents:null},f);this.getLinks=function(){return e.ajax({url:AJS.contextPath()+"/rest/menu/latest/appswitcher",cache:false,dataType:"json"}).done(this.updateDropdown).fail(this.showError)};this.getDropdown=function(){if(!this.$dropdown){this.$dropdown=e(f.dropdownContents)}return this.$dropdown};this.updateDropdown=function(i){e(function(){h.getDropdown().html(navlinks.templates.appswitcher_old.applications({apps:i,showAdminLink:c.isUserAdmin,adminLink:g}));h.bindAnalyticsHandlers(h.getDropdown(),i);h.processSuggestionApps(i)})};this.bindAnalyticsHandlers=function(i,j){};this.processSuggestionApps=function(i){e.ajax({type:"GET",dataType:"json",contentType:"application/json; charset=UTF-8",url:AJS.contextPath()+"/rest/menu/latest/isAppSuggestionAvailable"}).done(function(j){if(j===true){h.handleSuggestionApps(i)}})};this.handleSuggestionApps=function(k){var l=_.map(k,function(m){return m.applicationType.toLowerCase()});$suggestionApps=e("<div id='app-switcher-suggestion-apps' class='aui-dropdown2-section'/>");$suggestionApps.html(navlinks.templates.appswitcher_old.suggestionApps);var j=$suggestionApps.find(".suggestion-apps");var i=false;_.each(a,function(m){if(!_.contains(l,m.appName)){i=true;j.append(navlinks.templates.appswitcher_old.suggestionApp({appName:m.appName,appDesc:m.appDesc}))}});if(!i){return}e("#app-switcher").append($suggestionApps);e(".app-discovery-suggestion-app").click(function(){AJS.trigger("analytics",{name:"appswitcher.discovery.user.select."+e(this).find("a").attr("id").toLowerCase()});window.open(e(this).find("a").attr("title"),"_blank")});e(".app-discovery-suggestion-app").hover(function(){e(this).find("a").removeClass("active").removeClass("aui-dropdown2-active")});e(".app-discovery-cancel-button").click(function(){AJS.trigger("analytics",{name:"appswitcher.discovery.nothanks.button.click"});d(b,"true");$suggestionApps.remove()})};this.showError=function(){e(function(){h.getDropdown().html(navlinks.templates.appswitcher_old.error()).off(".appswitcher").on("click.appswitcher",".app-switcher-retry",e.proxy(h.retryLoading,h))})};this.retryLoading=function(i){this.getDropdown().html(navlinks.templates.appswitcher_old.loading());this.getLinks();i&&i.stopPropagation()};this.getLinks()};var b="key-no-thanks";var a=[{appName:"jira",appDesc:"Issue & Project Tracking Software"},{appName:"confluence",appDesc:"Collaboration and content sharing"},{appName:"bamboo",appDesc:"Continuous integration"}];var d=function(f,g){e.ajax({url:AJS.contextPath()+"/rest/menu/latest/userdata/",type:"PUT",contentType:"application/json",data:JSON.stringify({key:f,value:g})})};if(c.onInit){c.onInit()}}(jQuery,window.NL=(window.NL||{})));; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher_old.soy' */ // This file was automatically generated from appswitcher_old.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace navlinks.templates.appswitcher_old. */ if (typeof navlinks == 'undefined') { var navlinks = {}; } if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; } if (typeof navlinks.templates.appswitcher_old == 'undefined') { navlinks.templates.appswitcher_old = {}; } navlinks.templates.appswitcher_old.applications = function(opt_data, opt_ignored) { return '' + navlinks.templates.appswitcher_old.applicationsSection({list: opt_data.apps, listClass: 'nav-links', showDescription: opt_data.showDescription}) + ((opt_data.custom) ? navlinks.templates.appswitcher_old.applicationsSection({list: opt_data.custom, showDescription: opt_data.showDescription}) : '') + ((opt_data.showAdminLink) ? navlinks.templates.appswitcher_old.adminSection(opt_data) : ''); }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.applications.soyTemplateName = 'navlinks.templates.appswitcher_old.applications'; } navlinks.templates.appswitcher_old.applicationsSection = function(opt_data, opt_ignored) { var output = ''; if (opt_data.list.length > 0) { var param19 = '<ul' + ((opt_data.listClass) ? ' class="' + soy.$$escapeHtml(opt_data.listClass) + '"' : '') + '>'; var linkList27 = opt_data.list; var linkListLen27 = linkList27.length; for (var linkIndex27 = 0; linkIndex27 < linkListLen27; linkIndex27++) { var linkData27 = linkList27[linkIndex27]; param19 += navlinks.templates.appswitcher_old.applicationsItem(soy.$$augmentMap(linkData27, {showDescription: opt_data.showDescription})); } param19 += '</ul>'; output += aui.dropdown2.section({content: param19}); } return output; }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.applicationsSection.soyTemplateName = 'navlinks.templates.appswitcher_old.applicationsSection'; } navlinks.templates.appswitcher_old.applicationsItem = function(opt_data, opt_ignored) { return '<li class="nav-link' + ((opt_data.self) ? ' nav-link-local' : '') + '"><a href="' + soy.$$escapeHtml(opt_data.link) + '" class="aui-dropdown2-radio interactive' + ((opt_data.self) ? ' checked' : '') + '" title="' + soy.$$escapeHtml(opt_data.link) + '"><span class="nav-link-label">' + soy.$$escapeHtml(opt_data.label) + '</span>' + ((opt_data.showDescription && opt_data.description) ? '<span class="nav-link-description">' + soy.$$escapeHtml(opt_data.description) + '</span>' : '') + '</a></li>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.applicationsItem.soyTemplateName = 'navlinks.templates.appswitcher_old.applicationsItem'; } navlinks.templates.appswitcher_old.adminSection = function(opt_data, opt_ignored) { return '' + aui.dropdown2.section({content: '<ul class="nav-links"><li><a class="nav-link-edit-wrapper" href="' + soy.$$escapeHtml(opt_data.adminLink) + '"><span class="nav-link-edit">' + soy.$$filterNoAutoescape("Configure\x26hellip;") + '</span></a></li></ul>'}); }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.adminSection.soyTemplateName = 'navlinks.templates.appswitcher_old.adminSection'; } navlinks.templates.appswitcher_old.error = function(opt_data, opt_ignored) { return '<div class="app-switcher-error">' + soy.$$filterNoAutoescape("Something went wrong, please \x3cspan class\x3d\x22app-switcher-retry\x22\x3etry again\x3c/span\x3e.") + '</div>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.error.soyTemplateName = 'navlinks.templates.appswitcher_old.error'; } navlinks.templates.appswitcher_old.loading = function(opt_data, opt_ignored) { return '<div class="app-switcher-loading">' + soy.$$filterNoAutoescape("Loading\x26hellip;") + '</div>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.loading.soyTemplateName = 'navlinks.templates.appswitcher_old.loading'; } navlinks.templates.appswitcher_old.trigger = function(opt_data, opt_ignored) { return '<span class="aui-icon aui-icon-small aui-iconfont-appswitcher">' + soy.$$escapeHtml("Linked Applications") + '</span>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.trigger.soyTemplateName = 'navlinks.templates.appswitcher_old.trigger'; } navlinks.templates.appswitcher_old.switcher = function(opt_data, opt_ignored) { var output = ''; if (true) { var loadingContent__soy81 = '' + navlinks.templates.appswitcher_old.loading(null); var triggerContent__soy83 = '' + navlinks.templates.appswitcher_old.trigger(null); output += aui.dropdown2.dropdown2({menu: {id: 'app-switcher', content: loadingContent__soy81, extraClasses: 'aui-style-default'}, trigger: {showIcon: false, content: triggerContent__soy83, extraClasses: 'app-switcher-trigger', extraAttributes: {href: '#app-switcher'}}}) + '<script>\n (function (NL) {\n var initialise = function () {\n // For some milestones of AUI, the atlassian soy namespace was renamed to aui. Handle that here by ensuring that window.atlassian is defined.\n window.atlassian = window.atlassian || window.aui;\n new NL.AppSwitcher({\n dropdownContents: \'#app-switcher\'\n });\n };\n if (NL.AppSwitcher) {\n initialise();\n } else {\n NL.onInit = initialise;\n }\n }(window.NL = (window.NL || {})));\n window.NL.isUserAdmin = ' + soy.$$escapeHtml(false) + '<\/script>'; } return output; }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.switcher.soyTemplateName = 'navlinks.templates.appswitcher_old.switcher'; } navlinks.templates.appswitcher_old.suggestionApp = function(opt_data, opt_ignored) { return '<li class="app-discovery-suggestion-app"><a id="' + soy.$$escapeHtml(opt_data.appName) + '" href="#" class="app-discovery-link aui-icon-container app-discovery-' + soy.$$escapeHtml(opt_data.appName) + '-product-icon" title="https://www.atlassian.com/software/' + soy.$$escapeHtml(opt_data.appName) + '"/><div class="app-discovery-small">' + soy.$$escapeHtml(opt_data.appDesc) + '</div></li>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.suggestionApp.soyTemplateName = 'navlinks.templates.appswitcher_old.suggestionApp'; } navlinks.templates.appswitcher_old.suggestionApps = function(opt_data, opt_ignored) { return '<ul class=\'nav-links suggestion-apps\'><li><span class=\'app-discovery-suggest-title nav-link-label\'><h6>' + soy.$$escapeHtml("Try other Atlassian apps") + '</h6></span></li></ul><div class=\'buttons-container app-discovery-suggest-apps-buttons\'><div class=\'buttons\'><button class=\'aui-button aui-button-link app-discovery-cancel-button\' name=\'cancel\' accesskey=\'c\' href=\'#\'>' + soy.$$escapeHtml("Don\x27t show this again") + '</button></div></div>'; }; if (goog.DEBUG) { navlinks.templates.appswitcher_old.suggestionApps.soyTemplateName = 'navlinks.templates.appswitcher_old.suggestionApps'; } ; ;/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/inline-dialog.js' */ (function(d){AJS.CustomInlineDialog=AJS.CustomInlineDialog||function(B,n,r,p){p=p||[];if(p.hasOwnProperty("getArrowAttributes")){getArrowAttributesDeprecationLogger()}if(p.hasOwnProperty("getArrowPath")){getArrowPathDeprecationLogger();if(p.hasOwnProperty("gravity")){getArrowPathWithGravityDeprecationLogger()}}if(p.hasOwnProperty("onTop")){onTopDeprecationLogger();if(p.onTop&&p.gravity===undefined){p.gravity="s"}}if(typeof n==="undefined"){n=String(Math.random()).replace(".","");if(d("#inline-dialog-"+n+", #arrow-"+n+", #inline-dialog-shim-"+n).length){throw"GENERATED_IDENTIFIER_NOT_UNIQUE"}}var z=d.extend(false,AJS.CustomInlineDialog.opts,p);if(z.gravity==="w"){z.offsetX=p.offsetX===undefined?10:p.offsetX;z.offsetY=p.offsetY===undefined?0:p.offsetY}var v=function(){return window.Raphael&&p&&(p.getArrowPath||p.getArrowAttributes)};var j;var q;var K;var u=false;var A=false;var I=false;var J;var x;var g=d('<div id="inline-dialog-'+n+'" class="aui-inline-dialog"><div class="aui-inline-dialog-contents contents"></div><div id="arrow-'+n+'" class="aui-inline-dialog-arrow arrow"></div></div>');var m=d("#arrow-"+n,g);var G=g.find(".contents");if(!v()){g.find(".aui-inline-dialog-arrow").addClass("aui-css-arrow")}if(!z.displayShadow){G.addClass("aui-inline-dialog-no-shadow")}if(z.autoWidth){G.addClass("aui-inline-dialog-auto-width")}else{G.css("width",z.width+"px")}G.mouseover(function(O){clearTimeout(q);g.unbind("mouseover")}).mouseout(function(){E()});var D=function(){if(!j){j={popup:g,hide:function(){E(0)},id:n,show:function(){y()},persistent:z.persistent?true:false,reset:function(){function S(U,T){U.css(T.popupCss);if(v()){if(T.gravity==="s"){T.arrowCss.top-=d.browser.msie?10:9}if(!U.arrowCanvas){U.arrowCanvas=Raphael("arrow-"+n,16,16)}var V=z.getArrowPath,W=d.isFunction(V)?V(T):V;U.arrowCanvas.path(W).attr(z.getArrowAttributes())}else{m.removeClass("aui-bottom-arrow aui-left-arrow aui-right-arrow");if(T.gravity==="s"&&!m.hasClass("aui-bottom-arrow")){m.addClass("aui-bottom-arrow")}else{if(T.gravity==="n"){}else{if(T.gravity==="w"){m.addClass("aui-left-arrow")}else{if(T.gravity==="e"){m.addClass("aui-right-arrow")}}}}}m.css(T.arrowCss)}var P=AJS.$(window).height();var Q=Math.round(P*0.75);g.children(".aui-inline-dialog-contents").css("max-height",Q);var O=z.calculatePositions(g,x,J,z);if(O.hasOwnProperty("displayAbove")){displayAboveDeprecationLogger();O.gravity=O.displayAbove?"s":"n"}S(g,O);g.fadeIn(z.fadeTime,function(){});if(d.browser.msie&&~~(d.browser.version)<10){var R=d("#inline-dialog-shim-"+n);if(!R.length){d(g).prepend(d('<iframe class = "inline-dialog-shim" id="inline-dialog-shim-'+n+'" frameBorder="0" src="javascript:false;"></iframe>'))}R.css({width:G.outerWidth(),height:G.outerHeight()})}}}}return j};var y=function(){if(g.is(":visible")){return}K=setTimeout(function(){if(!I||!A){return}z.addActiveClass&&d(B).addClass("active");u=true;if(!z.persistent){H()}AJS.CustomInlineDialog.current=D();d(document).trigger("showLayer",["inlineDialog",D()]);D().reset()},z.showDelay)};var E=function(O){if(typeof O=="undefined"&&z.persistent){return}A=false;if(u&&z.preHideCallback.call(g[0].popup)){O=(O==null)?z.hideDelay:O;clearTimeout(q);clearTimeout(K);if(O!=null){q=setTimeout(function(){l();z.addActiveClass&&d(B).removeClass("active");g.fadeOut(z.fadeTime,function(){z.hideCallback.call(g[0].popup)});if(g.arrowCanvas){g.arrowCanvas.remove();g.arrowCanvas=null}u=false;A=false;d(document).trigger("hideLayer",["inlineDialog",D()]);AJS.CustomInlineDialog.current=null;if(!z.cacheContent){I=false;w=false}},O)}}};var F=function(R,P){var O=d(P);z.upfrontCallback.call({popup:g,hide:function(){E(0)},id:n,show:function(){y()}});g.each(function(){if(typeof this.popup!="undefined"){this.popup.hide()}});if(z.closeOthers){d(".aui-inline-dialog").each(function(){!this.popup.persistent&&this.popup.hide()})}x={target:O};if(!R){J={x:O.offset().left,y:O.offset().top}}else{J={x:R.pageX,y:R.pageY}}if(!u){clearTimeout(K)}A=true;var Q=function(){w=false;I=true;z.initCallback.call({popup:g,hide:function(){E(0)},id:n,show:function(){y()}});y()};if(!w){w=true;if(d.isFunction(r)){r(G,P,Q)}else{d.get(r,function(T,S,U){G.html(z.responseHandler(T,S,U));I=true;z.initCallback.call({popup:g,hide:function(){E(0)},id:n,show:function(){y()}});y()})}}clearTimeout(q);if(!u){y()}return false};g[0].popup=D();var w=false;var t=false;var s=function(){if(!t){d(z.container).append(g);t=true}};var o=d(B);if(z.onHover){if(z.useLiveEvents){if(o.selector){d(document).on("mousemove",o.selector,function(O){s();F(O,this)}).on("mouseout",o.selector,function(){E()})}else{AJS.log("Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.")}}else{o.mousemove(function(O){s();F(O,this)}).mouseout(function(){E()})}}else{if(!z.noBind){if(z.useLiveEvents){if(o.selector){d(document).on("click",o.selector,function(O){s();if(M()){g.hide()}else{F(O,this)}return false}).on("mouseout",o.selector,function(){E()})}else{AJS.log("Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.")}}else{o.click(function(O){s();if(M()){g.hide()}else{F(O,this)}return false}).mouseout(function(){E()})}}}var M=function(){return u&&z.closeOnTriggerClick};var H=function(){k();f()};var l=function(){C();N()};var i=false;var h=n+".inline-dialog-check";var k=function(){if(!i){d("body").bind("click."+h,function(P){var O=d(P.target);if(O.closest("#inline-dialog-"+n+" .contents").length===0){E(0)}});i=true}};var C=function(){if(i){d("body").unbind("click."+h)}i=false};var L=function(O){if(O.keyCode===27){E(0)}};var f=function(){d(document).on("keydown",L)};var N=function(){d(document).off("keydown",L)};g.show=function(P,O){if(P){P.stopPropagation()}s();if(z.noBind&&!(B&&B.length)){F(P,O===undefined?P.target:O)}else{F(P,B)}};g.hide=function(){E(0)};g.refresh=function(){if(u){D().reset()}};g.getOptions=function(){return z};return g};function c(g){var f=d(g);var h=d.extend({left:0,top:0},f.offset());return{left:h.left,top:h.top,width:f.outerWidth(),height:f.outerHeight()}}function b(h,j,t,f){var m=AJS.$.isFunction(f.offsetX)?f.offsetX(h,j,t,f):f.offsetX;var l=AJS.$.isFunction(f.offsetY)?f.offsetY(h,j,t,f):f.offsetY;var q=AJS.$.isFunction(f.arrowOffsetX)?f.arrowOffsetX(h,j,t,f):f.arrowOffsetX;var p=AJS.$.isFunction(f.arrowOffsetY)?f.arrowOffsetY(h,j,t,f):f.arrowOffsetY;var s=f.container.toLowerCase()!=="body";var g=AJS.$(f.container);var o=s?AJS.$(f.container).parent():AJS.$(window);var r=s?g.offset():{left:0,top:0};var k=s?o.offset():{left:0,top:0};var i=j.target;var u=i.offset();var n=i[0].getBBox&&i[0].getBBox();return{screenPadding:10,arrowMargin:5,window:{top:k.top,left:k.left,scrollTop:o.scrollTop(),scrollLeft:o.scrollLeft(),width:o.width(),height:o.height()},scrollContainer:{width:g.width(),height:g.height()},trigger:{top:u.top-r.top,left:u.left-r.left,width:n?n.width:i.outerWidth(),height:n?n.height:i.outerHeight()},dialog:{width:h.width(),height:h.height(),offset:{top:l,left:m}},arrow:{height:h.find(".arrow").outerHeight(),offset:{top:p,left:q}}}}function e(f,p,G,r){var n=b(f,p,G,r);var j=n.screenPadding;var k=n.window;var t=n.trigger;var D=n.dialog;var i=n.arrow;var z=n.scrollContainer;var E={top:t.top-k.scrollTop,left:t.left-k.scrollLeft};var A=Math.floor(t.height/2);var v=Math.floor(D.height/2);var u=Math.floor(i.height/2);var C=E.left-D.offset.left-j;var H=z.width-E.left-t.width-D.offset.left-j;var B=C>=D.width;var h=H>=D.width;var l=!h&&B?"e":"w";var o=E.top+A-u;var q=k.height-o-i.height;j=Math.min(j,o-n.arrowMargin);j=Math.min(j,q-n.arrowMargin);var g=E.top+A;var x=Math.max(g-j,0);var F=Math.max(k.height-g-j,0);var y=v-D.offset.top>x;var m=v+D.offset.top>F;var w;var s;if(y){w={top:k.scrollTop+j,left:l==="w"?t.left+t.width+D.offset.left:t.left-D.width-D.offset.left};s={top:(t.top+A)-(w.top+u)}}else{if(m){w={top:k.scrollTop+k.height-D.height-j,left:l==="w"?t.left+t.width+D.offset.left:t.left-D.width-D.offset.left};s={top:(t.top+A)-(w.top+u)}}else{w={top:t.top+A-v+D.offset.top,left:l==="w"?t.left+t.width+D.offset.left:t.left-D.width-D.offset.left};s={top:v-u+i.offset.top}}}return{gravity:l,popupCss:w,arrowCss:s}}function a(g,o,z,s){var x=AJS.$.isFunction(s.offsetX)?s.offsetX(g,o,z,s):s.offsetX;var v=AJS.$.isFunction(s.offsetY)?s.offsetY(g,o,z,s):s.offsetY;var m=AJS.$.isFunction(s.arrowOffsetX)?s.arrowOffsetX(g,o,z,s):s.arrowOffsetX;var l=AJS.$.isFunction(s.arrowOffsetY)?s.arrowOffsetY(g,o,z,s):s.arrowOffsetY;var f=c(window);var p=c(o.target);var y=c(g);var j=c(g.find(".aui-inline-dialog-arrow"));var i=p.left+p.width/2;var u=(window.pageYOffset||document.documentElement.scrollTop)+f.height;var k=10;y.top=p.top+p.height+~~v;y.left=p.left+~~x;var r=f.width-(y.left+y.width+k);j.left=i-y.left+~~m;j.top=-(j.height/2);var n=p.top>y.height;var h=(y.top+y.height)<u;var q=(!h&&n)||(n&&s.gravity==="s");if(q){y.top=p.top-y.height-(j.height/2);j.top=y.height}if(s.isRelativeToMouse){if(r<0){y.right=k;y.left="auto";j.left=z.x-(f.width-y.width)}else{y.left=z.x-20;j.left=z.x-y.left}}else{if(r<0){y.right=k;y.left="auto";var w=f.width-y.right;var t=w-y.width;j.right="auto";j.left=i-t-j.width/2}else{if(y.width<=p.width/2){j.left=y.width/2;y.left=i-y.width/2}}}return{gravity:q?"s":"n",displayAbove:q,popupCss:{left:y.left,top:y.top,right:y.right},arrowCss:{left:j.left,top:j.top,right:j.right}}}AJS.CustomInlineDialog.opts={onTop:false,responseHandler:function(g,f,h){return g},closeOthers:true,isRelativeToMouse:false,addActiveClass:true,onHover:false,useLiveEvents:false,noBind:false,fadeTime:100,persistent:false,hideDelay:10000,showDelay:0,width:300,offsetX:0,offsetY:10,arrowOffsetX:0,arrowOffsetY:0,container:"body",cacheContent:true,displayShadow:true,autoWidth:false,gravity:"n",closeOnTriggerClick:false,preHideCallback:function(){return true},hideCallback:function(){},initCallback:function(){},upfrontCallback:function(){},calculatePositions:function(f,i,j,h){h=h||{};var g=h.gravity==="w"?e:a;return g(f,i,j,h)},getArrowPath:function(f){if(f.gravity==="s"){return"M0,8L8,16,16,8"}else{return"M0,8L8,0,16,8"}},getArrowAttributes:function(){return{fill:"#fff",stroke:"#ccc"}}}})(AJS.$);; ;/* module-key = 'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-button-panel', location = '/static/button-panel/sourcetree-button-panel.soy' */ // This file was automatically generated from sourcetree-button-panel.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.sourceTree. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.sourceTree == 'undefined') { stash.sourceTree = {}; } stash.sourceTree.buttonPanel = function(opt_data, opt_ignored) { return '<div class="sourcetree-panel">' + stash.buttons.button({buttonText: opt_data.buttonText, id: opt_data.buttonId, extraClasses: 'sourcetree-button', href: opt_data.sourceTreeActionUrl, isPrimary: true}) + ((opt_data.minVersion) ? '<div class="min-version">' + soy.$$escapeHtml(AJS.format("Requires version {0}+",opt_data.minVersion)) + '</div>' : '') + '<p>' + soy.$$filterNoAutoescape(AJS.format("{0} is the free Git and Mercurial client for Windows or Mac.",'<a href="http://www.sourcetreeapp.com" target="_blank">Atlassian SourceTree</a>')) + '</p></div>'; }; if (goog.DEBUG) { stash.sourceTree.buttonPanel.soyTemplateName = 'stash.sourceTree.buttonPanel'; } ; ;/* module-key = 'com.atlassian.stash.stash-sourcetree-plugin:sourcetree-clone', location = '/static/sourcetree-clone/sourcetree-clone.js' */ define("plugin/sourcetree/sourcetree-clone",["jquery","aui","util/events","util/navbuilder","model/page-state","exports"],function(c,a,i,d,g,b){var e=navigator.platform.indexOf("Mac")!==-1;var h=function(l,m){var k=g.getCurrentUser();var j="sourcetree://cloneRepo?type=stash&baseWebUrl="+encodeURIComponent(window.location.origin+a.contextPath())+"&cloneUrl="+encodeURIComponent(m);if(k){j=j+"&user="+encodeURIComponent(k.getName())}c("#sourcetree-clone-button").attr("href",j)};var f=function(){var k=e?1.7:1.2;var j="<div class='min-version'>"+AJS.format("Requires SourceTree v{0}+",k)+"</div>";c("#sourcetree-clone-button").after(j)};b.onReady=function(){a.$(document).ready(f);i.on("stash.feature.repository.clone.protocol.changed",h);i.on("stash.feature.repository.clone.protocol.initial",h)}});require("plugin/sourcetree/sourcetree-clone").onReady();; ;/* module-key = 'com.atlassian.stash.plugin.stash-archive:archive-resources', location = '/static/archive.js' */ define("plugin/download-archive",["jquery","aui","model/page-state","util/navbuilder","exports"],function(d,b,c,e,a){a.onReady=function(g){var i=d(g);var h=function(j){i.attr("href",b.contextPath()+"/plugins/servlet/archive/projects/"+encodeURIComponent(c.getProject().getKey())+"/repos/"+encodeURIComponent(c.getRepository().getSlug())+(j?"?at="+encodeURIComponent(j):""))};var f=c.getRevisionRef()?c.getRevisionRef().id:null;h(f);eve.on("stash.feature.repository.revisionReferenceSelector.revisionRefChanged",function(j,k){h(j.id)})}});AJS.$(function(){require("plugin/download-archive").onReady("#download-archive-button")});; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:recent-repositories-menu-resources', location = '/static/layout/base/menu/repositories/recent.soy' */ // This file was automatically generated from recent.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.layout.menu. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.layout == 'undefined') { stash.layout = {}; } if (typeof stash.layout.menu == 'undefined') { stash.layout.menu = {}; } stash.layout.menu.loadingRecentReposMenuItem = function(opt_data, opt_ignored) { return '<li><span class="loading-recent-repos">' + soy.$$escapeHtml("Loading...") + '</span></li>'; }; if (goog.DEBUG) { stash.layout.menu.loadingRecentReposMenuItem.soyTemplateName = 'stash.layout.menu.loadingRecentReposMenuItem'; } stash.layout.menu.noRecentReposMenuItem = function(opt_data, opt_ignored) { return '<li><span class="no-recent-repos">' + soy.$$escapeHtml("No recently viewed repositories") + '</span></li>'; }; if (goog.DEBUG) { stash.layout.menu.noRecentReposMenuItem.soyTemplateName = 'stash.layout.menu.noRecentReposMenuItem'; } stash.layout.menu.errorLoadingRecentReposMenuItem = function(opt_data, opt_ignored) { return '<li><span>' + soy.$$escapeHtml("An error occurred") + '</span></li>'; }; if (goog.DEBUG) { stash.layout.menu.errorLoadingRecentReposMenuItem.soyTemplateName = 'stash.layout.menu.errorLoadingRecentReposMenuItem'; } ; ;/* module-key = 'com.atlassian.stash.stash-web-plugin:recent-repositories-menu-resources', location = '/static/layout/base/menu/repositories/recent.js' */ define("layout/base/menu/recent-repos",["jquery","stash/api/util/navbuilder","util/ajax","util/events","util/html","exports"],function(E,F,D,C,B,A){A.initMenu=function(I){var H=E("#"+B.sanitizeId(E("#"+I).attr("aria-owns"))).addClass("recent-repositories-menu"),K=H.find(".recent-repositories-section ul"),J=E(stash.layout.menu.loadingRecentReposMenuItem());H.on("aui-dropdown2-show",function(){C.trigger("internal.stash.ui.nav.repositories.opened")});H.on("click","a",function(){var L=E(this).closest(".aui-dropdown2-section");if(L.is(".recent-repositories-section")){C.trigger("internal.stash.ui.nav.repositories.item.clicked",null,{repositoryId:E(this).attr("data-repo-id")})}if(L.is(".public-repo-list-link-section")){C.trigger("internal.stash.ui.nav.repositories.public.clicked")}});K.append(J);var G=function(){D.rest({url:F.rest().profile().recent().repos().withParams({avatarSize:stash.widget.avatarSizeInPx({size:"xsmall"})}).build(),statusCode:{"*":function(){return false}}}).done(function(M){if(M&&M.size){var L=M.values;L.sort(function(O,N){return O.project.name.localeCompare(N.project.name)||O.name.localeCompare(N.name)});K.append(E(stash.feature.repository.menuItems({repos:L})))}else{K.append(E(stash.layout.menu.noRecentReposMenuItem()))}C.trigger("stash.feature.repositories.recent.loaded",this,M)}).fail(function(){K.append(E(stash.layout.menu.errorLoadingRecentReposMenuItem()))}).always(function(){J.remove()})};E(window).on("load",G)}});; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:curl', location = 'js/wrm/curl-config.js' */ (function(){if(!window.WRM){window.WRM={}}window.curl={apiContext:WRM,defineContext:WRM}}());; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:curl', location = 'js/wrm/lib/curl-0.7.3.js' */ (function(a){var P="0.7.3",u="curl",p="define",G,v,g,d=a.document,l=d&&(d.head||d.getElementsByTagName("head")[0]),V=l&&l.getElementsByTagName("base")[0]||null,i={},N={},c={},A="addEventListener" in a?{}:{loaded:1,complete:1},m={},b=m.toString,y,k={},f={},h=false,O,t=/\?|\.js\b/,e=/^\/|^[^:]+:\/\//,L=/(\.)(\.?)(?:$|\/([^\.\/]+.*)?)/g,E=/\/\*[\s\S]*?\*\/|(?:[^\\])\/\/.*?[\n\r]/g,C=/require\s*\(\s*["']([^"']+)["']\s*\)|(?:[^\\]?)(["'])/g,M,x;function Q(){}function D(X,W){return b.call(X).indexOf("[object "+W)==0}function B(X){var W;X.path=J(X.path||X.location||"");W=X.main||"./main";if(!n(W)){W="./"+W}X.main=s(W,X.name+"/");X.config=X.config;return X}function n(W){return W.charAt(0)=="."}function j(W){return e.test(W)}function o(X,W){return J(X)+"/"+W}function J(W){return W&&W.charAt(W.length-1)=="/"?W.substr(0,W.length-1):W}function s(ab,X){var ac,W,Z,Y,aa;ac=1;W=ab;if(n(W)){Y=true;W=W.replace(L,function(ad,ae,af,ag){if(af){ac++}return ag||""})}if(Y){Z=X.split("/");aa=Z.length-ac;if(aa<0){return ab}Z.splice(aa,ac);return Z.concat(W||[]).join("/")}else{return W}}function S(X){var W=X.indexOf("!");return{resourceId:X.substr(W+1),pluginId:W>=0&&X.substr(0,W)}}function U(){}function z(X,W){U.prototype=X||m;var Z=new U();U.prototype=m;for(var Y in W){Z[Y]=W[Y]}return Z}function F(){var X,aa,W;X=this;aa=[];function ab(ac,ad,ae){aa.push([ac,ad,ae])}function Y(ag,ad){var af,ac,ae=0;while((af=aa[ae++])){ac=af[ag];if(ac){ac(ad)}}}W=function Z(ad,ac){ab=ad?function(ae,af){ae&&ae(ac)}:function(ae,af){af&&af(ac)};W=Q;Y(ad?0:1,ac);Y=Q;aa=y};this.then=function(ac,ad,ae){ab(ac,ad,ae);return X};this.resolve=function(ac){X.resolved=ac;W(true,ac)};this.reject=function(ac){X.rejected=ac;W(false,ac)};this.progress=function(ac){Y(2,ac)}}function r(W){return W instanceof F}function H(W,Z,X,Y){if(r(W)){return W.then(Z,X,Y)}else{return Z(W)}}function q(Y,X,Z){var W;return function(){if(--Y>=0&&X){W=X.apply(y,arguments)}if(Y==0&&Z){Z(W)}return W}}x={toAbsId:function(ab,aa,W){var Y,X,Z;Y=s(ab,aa);if(n(Y)){return Y}Z=S(Y);X=Z.pluginId;Y=X||Z.resourceId;if(Y in W.pathMap){Y=W.pathMap[Y].main||Y}if(X){if(X.indexOf("/")<0&&!(X in W.pathMap)){Y=o(W.pluginPath,X)}Y=Y+"!"+Z.resourceId}return Y},createContext:function(W,X,ab,aa){var Z;Z=new F();Z.id=X||"";Z.isPreload=aa;Z.depNames=ab;Z.config=W;function ad(ae){return x.toAbsId(ae,Z.id,W)}function ac(ae){return x.resolvePathInfo(ad(ae),W).url}function Y(ag,ak,af){var ae,aj,ai,ah;ae=ak&&function(){ak.apply(y,arguments[0])};if(D(ag,"String")){if(ae){throw new Error("require(id, callback) not allowed")}aj=ad(ag);ai=k[aj];if(!(aj in k)){throw new Error("Module not resolved: "+aj)}ah=r(ai)&&ai.exports;return ah||ai}else{H(x.getDeps(x.createContext(W,Z.id,ag,aa)),ae,af)}}Z.require=Y;Y.toUrl=ac;Z.toAbsId=ad;return Z},createResourceDef:function(W,ad,ab){var aa,X,Z;aa=x.createContext(W,ad,y,ab);X=aa.resolve;Z=q(1,function(af){aa.deps=af;try{return x.executeDefFunc(aa)}catch(ae){aa.reject(ae)}});aa.resolve=function Y(ae){H(ab||h,function(){X((k[aa.id]=f[aa.url]=Z(ae)))})};aa.exportsReady=function ac(ae){H(ab||h,function(){if(aa.exports){Z(ae);aa.progress(N)}})};return aa},createPluginDef:function(W,aa,Z,Y){var X;X=x.createContext(W,Z,y,Y);return X},getCjsRequire:function(W){return W.require},getCjsExports:function(W){return W.exports||(W.exports={})},getCjsModule:function(X){var W=X.module;if(!W){W=X.module={id:X.id,uri:x.getDefUrl(X),exports:x.getCjsExports(X),config:function(){return X.config}};W.exports=W.exports}return W},getDefUrl:function(W){return W.url||(W.url=x.checkToAddJsExt(W.require.toUrl(W.id),W.config))},setApi:function(W){var Y,Z,X,aa,ab,ac;Y=u;Z=p;X=aa=a;ab=" already exists";if(W){ac=W.overwriteApi||W.overwriteApi;Y=W.apiName||W.apiName||Y;X=W.apiContext||W.apiContext||X;Z=W.defineName||W.defineName||Z;aa=W.defineContext||W.defineContext||aa;if(v&&D(v,"Function")){a[u]=v}v=null;if(g&&D(g,"Function")){a[p]=g}g=null;if(!ac){if(X[Y]&&X[Y]!=K){throw new Error(Y+ab)}if(aa[Z]&&aa[Z]!=I){throw new Error(Z+ab)}}}X[Y]=K;aa[Z]=I},config:function(aa){var ab,Z,W,X;if("baseUrl" in aa){aa.baseUrl=aa.baseUrl}if("main" in aa){aa.main=aa.main}if("preloads" in aa){aa.preloads=aa.preloads}if("pluginPath" in aa){aa.pluginPath=aa.pluginPath}if("dontAddFileExt" in aa||aa.dontAddFileExt){aa.dontAddFileExt=new RegExp(aa.dontAddFileExt||aa.dontAddFileExt)}ab=G;Z=z(ab,aa);Z.pathMap=z(ab.pathMap);W=aa.plugins||{};Z.plugins=z(ab.plugins);Z.paths=z(ab.paths,aa.paths);Z.packages=z(ab.packages,aa.packages);Z.pathList=[];function ac(af,am){var ah,aj,al,ak,an,ai;for(var ag in af){al=af[ag];if(D(al,"String")){al={path:af[ag]}}al.name=al.name||ag;an=Z;ak=S(J(al.name));ah=ak.resourceId;aj=ak.pluginId;if(aj){an=W[aj];if(!an){an=W[aj]=z(Z);an.pathMap=z(Z.pathMap);an.pathList=[]}delete af[ag]}if(am){ai=B(al);if(ai.config){ai.config=z(Z,ai.config)}}else{ai={path:J(al.path)}}ai.specificity=ah.split("/").length;if(ah){an.pathMap[ah]=ai;an.pathList.push(ah)}else{an.baseUrl=x.resolveUrl(al.path,Z)}}}function ad(af){var ag=af.pathMap;af.pathRx=new RegExp("^("+af.pathList.sort(function(ai,ah){return ag[ah].specificity-ag[ai].specificity}).join("|").replace(/\/|\./g,"\\$&")+")(?=\\/|$)");delete af.pathList}ac(aa.packages,true);ac(aa.paths,false);for(X in W){var Y=x.toAbsId(X+"!","",Z);Z.plugins[Y.substr(0,Y.length-1)]=W[X]}W=Z.plugins;for(X in W){W[X]=z(Z,W[X]);var ae=W[X].pathList;if(ae){W[X].pathList=ae.concat(Z.pathList);ad(W[X])}}for(X in ab.pathMap){if(!Z.pathMap.hasOwnProperty(X)){Z.pathList.push(X)}}ad(Z);return Z},checkPreloads:function(W){var X;X=W&&W.preloads;if(X&&X.length>0){H(h,function(){h=x.getDeps(x.createContext(G,y,X,true))})}},resolvePathInfo:function(Z,X){var Y,ab,aa,W;Y=X.pathMap;if(!j(Z)){aa=Z.replace(X.pathRx,function(ac){ab=Y[ac]||{};W=ab.config;return ab.path||""})}else{aa=Z}return{config:W||G,url:x.resolveUrl(aa,X)}},resolveUrl:function(Y,W){var X=W.baseUrl;return X&&!j(Y)?o(X,Y):Y},checkToAddJsExt:function(X,W){return X+((W||G).dontAddFileExt.test(X)?"":".js")},loadScript:function(Z,ab,X){var Y=d.createElement("script");function aa(ac){ac=ac||a.event;if(ac.type=="load"||A[Y.readyState]){delete c[Z.id];Y.onload=Y.onreadystatechange=Y.onerror="";ab()}}function W(ac){X(new Error("Syntax or http error: "+Z.url))}Y.onload=Y.onreadystatechange=aa;Y.onerror=W;Y.type=Z.mimetype||"text/javascript";Y.charset="utf-8";Y.async=!Z.order;Y.src=Z.url;c[Z.id]=Y;l.insertBefore(Y,V);return Y},extractCjsDeps:function(X){var Y,W=[],Z;Y=typeof X=="string"?X:X.toSource?X.toSource():X.toString();Y.replace(E,"").replace(C,function(aa,ac,ab){if(ab){Z=Z==ab?y:Z}else{if(!Z){W.push(ac)}}return""});return W},fixArgs:function(X){var ac,aa,Y,ab,W,Z;W=X.length;Y=X[W-1];ab=D(Y,"Function")?Y.length:-1;if(W==2){if(D(X[0],"Array")){aa=X[0]}else{ac=X[0]}}else{if(W==3){ac=X[0];aa=X[1]}}if(!aa&&ab>0){Z=true;aa=["require","exports","module"].slice(0,ab).concat(x.extractCjsDeps(Y))}return{id:ac,deps:aa||[],res:ab>=0?Y:function(){return Y},cjs:Z}},executeDefFunc:function(Y){var X,W;W=Y.cjs?Y.exports:y;X=Y.res.apply(W,Y.deps);if(X===y&&Y.exports){X=Y.module?(Y.exports=Y.module.exports):Y.exports}return X},defineResource:function(X,W){X.res=W.res;X.cjs=W.cjs;X.depNames=W.deps;x.getDeps(X)},getDeps:function(X){var ab,af,ai,ad,ag,aa,W,aj,ah;ai=[];af=X.depNames;ad=af.length;if(af.length==0){Y()}function ae(am,ak,al){ai[ak]=am;if(al){aj(am,ak)}}aj=q(ad,ae,ac);ah=q(ad,ae,Y);for(ab=0;ab<ad;ab++){W=af[ab];if(W in M){ah(M[W](X),ab,true);if(X.exports){X.progress(i)}}else{if(!W){ah(y,ab,true)}else{Z(W,ab)}}}return X;function Z(am,al){var an,ak,ap,ao;an=q(1,function(aq){ak(aq);ah(aq,al)});ak=q(1,function(aq){aj(aq,al)});ap=x.fetchDep(am,X);ao=r(ap)&&ap.exports;if(ao){ak(ao)}H(ap,an,X.reject,X.exports&&function(aq){if(ap.exports){if(aq==i){ak(ap.exports)}else{if(aq==N){an(ap.exports)}}}})}function Y(){X.resolve(ai)}function ac(){X.exportsReady&&X.exportsReady(ai)}},fetchResDef:function(W){x.getDefUrl(W);x.loadScript(W,function(){var X=O;O=y;if(W.useNet!==false){if(!X||X.ex){W.reject(new Error(((X&&X.ex)||"define() missing or duplicated: "+W.url)))}else{x.defineResource(W,X)}}},W.reject);return W},fetchDep:function(ai,X){var W,Z,ae,ab,ah,ad,aa,aj,af,Y,ac,ag;W=X.toAbsId;Z=X.isPreload;ae=X.config||G;ab=S(W(ai));aj=ab.resourceId;ah=ab.pluginId||aj;af=x.resolvePathInfo(ah,ae);if(ab.pluginId){ad=ah}else{ad=af.config.moduleLoader||af.config.moduleLoader;if(ad){aj=ah;ah=ad;af=x.resolvePathInfo(ad,ae)}}if(ah in k){Y=k[ah]}else{if(af.url in f){Y=k[ah]=f[af.url]}else{Y=x.createResourceDef(af.config,ah,Z);Y.url=x.checkToAddJsExt(af.url,af.config);k[ah]=f[af.url]=Y;x.fetchResDef(Y)}}if(ah==ad){ac=new F();ag=ae.plugins[ad]||ae;H(Y,function(am){var ao,ak,an;an=am.dynamic;if("normalize" in am){aj=am.normalize(aj,W,Y.config)||""}else{aj=W(aj)}ak=ad+"!"+aj;ao=k[ak];if(!(ak in k)){ao=x.createPluginDef(ag,ak,aj,Z);if(!an){k[ak]=ao}var al=function(ap){ao.resolve(ap);if(!an){k[ak]=ap}};al.resolve=al;al.reject=al.error=ao.reject;am.load(aj,ao.require,al,ag)}if(ac!=ao){H(ao,ac.resolve,ac.reject,ac.progress)}},ac.reject)}return ac||Y},getCurrentDefName:function(){var W;if(!D(a.opera,"Opera")){for(var X in c){if(c[X].readyState=="interactive"){W=X;break}}}return W}};M={require:x.getCjsRequire,exports:x.getCjsExports,module:x.getCjsModule};function K(){var X=[].slice.call(arguments),W;if(D(X[0],"Object")){W=X.shift();R(W)}return new w(X[0],X[1],X[2])}function R(W){if(W){x.setApi(W);G=x.config(W);x.checkPreloads(W);if("main" in W){setTimeout(function(){var X;X=x.createContext(G,y,[].concat(W.main));x.getDeps(X)},0)}}}function w(Y,ab,X,aa){var Z,W;W=x.createContext(G,y,[].concat(Y));this["then"]=Z=function(ac,ad){H(W,function(ae){if(ac){ac.apply(y,ae)}},function(ae){if(ad){ad(ae)}else{throw ae}});return this};this["next"]=function(ae,ac,ad){return new w(ae,ac,ad,W)};this["config"]=R;if(ab||X){Z(ab,X)}H(aa,function(){x.getDeps(W)})}K.version=P;K.config=R;function T(W){var Z,X,Y;Z=W.id;if(Z==y){if(O!==y){O={ex:"Multiple anonymous defines in url"}}else{if(!(Z=x.getCurrentDefName())){O=W}}}if(Z!=y){X=k[Z];if(!(Z in k)){Y=x.resolvePathInfo(Z,G);X=x.createResourceDef(Y.config,Z);k[Z]=X}if(!r(X)){throw new Error("duplicate define: "+Z)}X.useNet=false;x.defineResource(X,W)}}function I(){var W=x.fixArgs(arguments);T(W)}I.amd={plugins:true,jQuery:true,curl:P};G={baseUrl:"",pluginPath:"curl/plugin",dontAddFileExt:t,paths:{},packages:{},plugins:{},pathMap:{},pathRx:/$^/};v=a[u];g=a[p];if(!v||D(v,"Function")){x.setApi()}else{a[u]=y;R(v)}k[u]=K;k["curl/_privileged"]={core:x,cache:k,config:function(){return G},_define:T,_curl:K,Promise:F}}(this.window||(typeof global!="undefined"&&global)||this));; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:curl', location = 'js/wrm/lib/curl-css-0.7.3.js' */ (function(B){var z="createElement",s="parentNode",f=B.setTimeout,H=B.document,k,x=H&&H.createStyleSheet&&!(H.documentMode>=10),v=[],u=[],C=[],i=12,F,g="HTTP or network error.",l={};if(H){k=H.head||H.getElementsByTagName("head")[0];if(x){F=c}else{F=t}}function q(J,I){l[J]=l[J]||I}function y(){var I;I=H[z]("link");I.rel="stylesheet";I.type="text/css";return I}function r(J,I){J.onload=function(){q("load",true);I()}}function n(J,I){J.onerror=function(){q("error",true);I()}}function c(K,I,M){var L;C.push({url:K,cb:I,eb:function J(){M(new Error(g))}});L=h();if(L){m(L)}}function m(K){var J,I;J=C.shift();I=K.styleSheet;if(J){K.onload=function(){J.cb(J.ss);m(K)};K.onerror=function(){J.eb();m(K)};J.ss=I.imports[I.addImport(J.url)]}else{e(K);G(K)}}function G(I){u.push(I)}function h(){var I;I=u.shift();if(!I&&v.length<i){I=H.createElement("style");v.push(I);k.appendChild(I)}return I}function b(L){var K,J,M;if(!L.href||!o()){return false}K=false;try{J=L.sheet;if(J){M=J.cssRules;K=M===null;if(!K&&M){J.insertRule("-curl-css-test {}",0);J.deleteRule(0);K=true}}}catch(I){K=Object.prototype.toString.call(window.opera)!="[object Opera]"&&/security|denied/i.test(I.message)}return K}function e(I){I.onload=I.onerror=j}function w(I){return I.onload==j||!I.onload}function E(J,K,I){if(l.load){return}if(b(J)){I(J.sheet)}else{if(!w(J)){f(function(){E(J,K,I)},K)}}}function A(J,K,I){if(l.error){return}}function p(J,L,I){function K(){if(w(J)){return}e(J);d(function(){I(J.sheet)})}r(J,K);E(J,L,K)}function D(K,L,I){function J(){if(w(K)){return}e(K);I(new Error(g))}n(K,J);A(K,L,J)}function t(J,I,K,M){var L;L=y();p(L,M,I);D(L,M,K);L.href=J;k.appendChild(L)}function d(I){function J(){if(o()){I()}else{f(J,10)}}J()}function o(){return !H.readyState||H.readyState=="complete"}function a(I,J){return I.lastIndexOf(".")<=I.lastIndexOf("/")?I+"."+J:I}function j(){}WRM.define("curl/plugin/css",{normalize:function(N,J){var L,M;if(!N){return N}L=[N];M=[];for(var K=0,I=L.length;K<I;K++){M.push(J(L[K]))}return M.join(",")},load:function(R,L,U,K){var Q,J,V,S,M,O;Q=[];J=[R||""];V=K.cssWatchPeriod||50;S=K.cssNoWait;M=J.length;function N(W){if(J.length>1){Q.push(W)}if(--M==0){U(J.length==1?W:Q)}}function P(X){var W;W=U.reject||function(Y){throw Y};W(X)}for(O=0;O<J.length;O++){R=J[O];var I,T;I=a(L.toUrl(R),"css");if(S){T=y();T.href=I;k.appendChild(T);N(T.sheet||T.styleSheet)}else{F(I,N,P,V)}}},"plugin-builder":"./builder/css",pluginBuilder:"./builder/css"})})(this);; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:curl', location = 'js/wrm/lib/curl-js-0.7.3.js' */ (function(b,c,a){WRM.define("curl/plugin/js",["curl/_privileged"],function(m){var f={},j=[],h=c&&c.createElement("script").async==true,l,k,g;l=m.Promise;function i(n,o){return n.lastIndexOf(".")<=n.lastIndexOf("/")?n+"."+o:n}function e(o,u,q){var v,s,p;v=new Date().valueOf()+(o.timeoutMsec||300000);function n(){s=true;if(o.exports){o.resolved=a(o.exports)}if(!o.exports||o.resolved){u(p)}else{q()}}function r(w){s=true;q(w)}function t(){if(!s){if(v<new Date()){q()}else{setTimeout(t,10)}}}if(q&&o.exports){setTimeout(t,10)}p=m.core.loadScript(o,n,r)}function d(n,o){e(n,function(){var p=j.shift();k=j.length>0;if(p){d.apply(null,p)}o.resolve(n.resolved||true)},function(p){o.reject(p)})}return{dynamic:true,normalize:function(q,p,o){var n=q.indexOf("!");return n>=0?p(q.substr(0,n))+q.substr(n):p(q)},load:function(o,r,w,q){var s,t,u,v,n,p,y;s=o.indexOf("!order")>0;t=o.indexOf("!exports=");u=t>0&&o.substr(t+9);v="prefetch" in q?q.prefetch:true;o=s||t>0?o.substr(0,o.indexOf("!")):o;n=i(r.toUrl(o),"js");function x(z){(w.error||function(A){throw A})(z)}if(n in f){if(f[n] instanceof l){f[n].then(w,x)}else{w(f[n])}}else{p={name:o,url:n,order:s,exports:u,timeoutMsec:q.timeout};f[n]=y=new l();y.then(function(z){f[n]=z;w(z)},x);if(s&&!h&&k){j.push([p,y]);if(v){p.mimetype="text/cache";e(p,function(z){z&&z.parentNode.removeChild(z)},function(){});p.mimetype=""}}else{k=k||s;d(p,y)}}}}})}(this,this.document,function(){try{return eval(arguments[0])}catch(ex){return}}));; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/jquery.js' */ WRM.define("wrm/jquery",function(){return AJS.$});; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/underscore.js' */ WRM.define("wrm/_",function(){var a={filter:function(f,d){var b=[];for(var c=0;c<f.length;++c){var e=f[c];if(d(e)){b.push(e)}}return b},map:function(d,c){var e=[];for(var b=0;b<d.length;++b){e.push(c(d[b]))}return e},each:function(d,c){if(d.length===+d.length){for(var b=0;b<d.length;++b){c(d[b])}}else{for(var e in d){if(d.hasOwnProperty(e)){c(d[e],e)}}}},bind:function(c,b){return function(){c.apply(b,Array.prototype.slice.call(arguments))}},isArray:function(b){return Object.prototype.toString.call(b)=="[object Array]"},isUndefined:function(b){return b===void 0},isNull:function(b){return b===null}};return a});; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/builder.js' */ WRM.define("wrm/builder",function(){var a=function(d){var b="(?:$|\\?.*)";var c="^"+d;this.patterns={js:{superBatch:new RegExp(c+"/superbatch/js/batch.js"+b),contextBatch:new RegExp(c+"/contextbatch/js/(.*?)/batch.js"+b),resourceBatch:new RegExp(c+"/batch/(.*?)/(.*).js"+b),noBatch:new RegExp(c+"/resources/(.*?)/(.*).js"+b)},css:{superBatch:new RegExp(c+"/superbatch/css/batch.css"+b),contextBatch:new RegExp(c+"/contextbatch/css/(.*?)/batch.css"+b),resourceBatch:new RegExp(c+"/batch/(.*?)/(.*).css"+b),noBatch:new RegExp(c+"/resources/(.*?)/(.*).css"+b)}}};a.prototype={initialize:function(c){var g,b=c.getElementsByTagName("script"),e=c.getElementsByTagName("link"),f={superBatch:false,modules:[],contexts:[]};for(g=0;g<b.length;++g){var d=b[g];if(d.getAttribute("src")){this._inspectMatches(d.getAttribute("src"),this.patterns.js,f)}}for(g=0;g<e.length;++g){var h=e[g];if(h.getAttribute("href")){this._inspectMatches(h.getAttribute("href"),this.patterns.css,f)}}return f},getModulesAndContextsFromScriptUrl:function(c){var b={superBatch:false,modules:[],contexts:[]};this._inspectMatches(c,this.patterns.js,b);return b},_inspectMatches:function(d,f,c){var b;b=d.match(f.superBatch);if(b){c.superBatch=true;return}b=d.match(f.contextBatch);if(b){var g=b[1].split(",");for(var e=0;e<g.length;++e){this._addToLoadedList(c.contexts,g[e])}return}b=d.match(f.resourceBatch);if(b){this._addToLoadedList(c.modules,b[1]);return}b=d.match(f.noBatch);if(b){this._addToLoadedList(c.modules,b[1]);return}},_addToLoadedList:function(d,c){for(var b=0;b<d.length;++b){if(d[b]===c){return}}d.push(c)}};return a});; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/ie-only-filter.js' */ WRM.define("wrm/ie-only-filter",["wrm/jquery","wrm/_"],function(c,a){function b(d){var e=c.browser.msie;return a.filter(d,function(f){return f.ieOnly?e:true})}return b});; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/conditional-comment-filter.js' */ WRM.define("wrm/conditional-comment-filter",["wrm/jquery","wrm/_"],function(c,a){function b(e){var f=c.browser.msie;var d=c.browser.version;return a.filter(e,function(h){var g=h.conditionalComment;if(!g){return true}if(!f||d>9){return false}g=g.toLowerCase();switch(g){case"ie":return true;case"lt ie 9":return d<9;case"lte ie 9":return d<=9;case"ie 9":return d==9;case"gt ie 9":return d>9;case"gte ie 9":return d>=9;case"lt ie 8":return d<8;case"lte ie 8":return d<=8;case"ie 8":return d==8;case"gt ie 8":return d>8;case"gte ie 8":return d>=8;default:AJS.log("Cannot parse conditional comment "+g);return false}})}return b});; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/resource-base-url-pattern.js' */ WRM.define("wrm/resource-base-url-pattern",function(){return WRM.data.claim("com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager.resource-base-url-pattern")});; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/require-handler.js' */ WRM.define("wrm/require-handler",["wrm/jquery","wrm/_","wrm/builder","wrm/conditional-comment-filter","wrm/ie-only-filter","wrm/resource-base-url-pattern"],function(e,h,i,g,a,c){var f=/^wr!(.*)$/,d=/^wrc!(.*)$/;var b=function(){this._requireCache={}};b.prototype={require:function(k,j){if(!h.isArray(k)){k=[k]}if(!this._requireCache.hasOwnProperty(k)){this._requireCache[k]=this._resolveAsync(k)}var l=this._requireCache[k];if(j){l.done(function(){j.apply(this,arguments)})}return l},_resolveAsync:function(l){var j=e.Deferred();var k=this;this._getScriptsForResources(l).done(function(p){if(p.unparsedData){window.WRM._unparsedData||(window.WRM._unparsedData={});h.each(p.unparsedData,function(u,t){window.WRM._unparsedData[t]=u})}var q=[];var s=[];var m=k._filter(p.resources);for(var o=0;o<m.length;++o){var r=m[o];var n=r.url;if(r.resourceType==="JAVASCRIPT"){if(!k._isJSInInitLoad(n)){q.push("js!"+n+"!order")}}else{if(r.resourceType==="CSS"){if(!k._isCSSInInitLoad(n)){if(r.media&&"all"!==r.media){s.push(r)}else{q.push("css!"+n)}}}else{AJS.log("Unknown resource type required: "+n)}}}AJS.log("Downloading resources:\n"+q.join("\n"));WRM.curl(q,function(){h.each(s,function(u){k._loadCssImmediate(u)});var t=h.map(l,function(){return window});j.resolveWith(k,t)},function(){j.rejectWith(k,arguments)})});return j.promise()},_loadCssImmediate:function(k){AJS.log("WARN: asynchronously loading a CSS resource containing a media query: "+k.url);var j='<link rel="stylesheet" type="text/css" href="'+k.url+'" media="'+k.media+'" />';e(j).appendTo("head")},_getScriptsForResources:function(k){if(!this._builder){this._builder=new i(c);this._initLoadResources=this._builder.initialize(document)}var j=[];var l=[];h.each(k,function(n){var m;if(m=n.match(f)){j.push(m[1])}else{if(m=n.match(d)){l.push(m[1])}}});return e.ajax({url:AJS.contextPath()+"/rest/webResources/1.0/resources",type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify({r:j,c:l,xc:this._initLoadResources.contexts,xr:this._initLoadResources.modules})})},_isJSInInitLoad:function(j){return e("script[src='"+j+"']").length>0},_isCSSInInitLoad:function(j){return e("link[href='"+j+"']").length>0},_filter:function(k){if(!this._filters){this._filters=[g,a]}var j=k;h.each(this._filters,function(l){j=l(j)});return j}};return b});; ;/* module-key = 'com.atlassian.plugins.atlassian-plugins-webresource-rest:web-resource-manager', location = 'js/wrm/index.js' */ WRM.curl(["wrm/require-handler"],function(b){var a;WRM.require=function(d,c){if(!a){a=new b()}return a.require(d,c)}});; ;/* module-key = 'com.atlassian.stash.plugin.stash-inbox-plugin:inbox-dialog', location = '/static/inbox/inbox.soy' */ // This file was automatically generated from inbox.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace stash.plugin.inbox. */ if (typeof stash == 'undefined') { var stash = {}; } if (typeof stash.plugin == 'undefined') { stash.plugin = {}; } if (typeof stash.plugin.inbox == 'undefined') { stash.plugin.inbox = {}; } stash.plugin.inbox.dialogContents = function(opt_data, opt_ignored) { var output = '<h2>' + soy.$$escapeHtml("My pull requests") + '</h2><div class=\'inbox-table-wrapper aui-tabs horizontal-tabs\'><ul class="tabs-menu">'; var roleList6 = opt_data.roles; var roleListLen6 = roleList6.length; for (var roleIndex6 = 0; roleIndex6 < roleListLen6; roleIndex6++) { var roleData6 = roleList6[roleIndex6]; output += '<li class="menu-item"><a href="#inbox-pull-request-' + soy.$$escapeHtml(roleData6.id) + '">' + soy.$$escapeHtml(roleData6.title) + '</a></li>'; } output += '</ul>'; var roleList14 = opt_data.roles; var roleListLen14 = roleList14.length; for (var roleIndex14 = 0; roleIndex14 < roleListLen14; roleIndex14++) { var roleData14 = roleList14[roleIndex14]; output += '<div id="inbox-pull-request-' + soy.$$escapeHtml(roleData14.id) + '" class="tabs-pane">' + stash.feature.pullRequest.pullRequestTable({pullRequestsPage: null, scope: 'global', id: 'inbox-pull-request-table-' + roleData14.id}) + '</div>'; } output += '</div>'; return output; }; if (goog.DEBUG) { stash.plugin.inbox.dialogContents.soyTemplateName = 'stash.plugin.inbox.dialogContents'; } stash.plugin.inbox.triggerIcon = function(opt_data, opt_ignored) { return '<span class=\'aui-icon aui-icon-small ' + ((opt_data.isEmpty) ? 'aui-iconfont-workbox-empty' : 'aui-iconfont-workbox') + '\'></span>'; }; if (goog.DEBUG) { stash.plugin.inbox.triggerIcon.soyTemplateName = 'stash.plugin.inbox.triggerIcon'; } stash.plugin.inbox.emptyInboxMessage = function(opt_data, opt_ignored) { return '<span class="aui-icon aui-icon-large aui-iconfont-workbox-empty">' + soy.$$escapeHtml("No pull requests to approve") + '</span><h3>' + soy.$$escapeHtml("Inbox Zero") + '</h3>'; }; if (goog.DEBUG) { stash.plugin.inbox.emptyInboxMessage.soyTemplateName = 'stash.plugin.inbox.emptyInboxMessage'; } ; ;/* module-key = 'com.atlassian.stash.plugin.stash-inbox-plugin:inbox-dialog', location = '/static/inbox/inbox.js' */ define("plugin/inbox/inbox",["aui","jquery","underscore","stash/api/util/events","stash/api/util/navbuilder","stash/api/util/state","stash/api/util/server","exports"],function(h,f,s,a,q,i,m,t){var u,b;function k(v){return q.newBuilder().addPathComponents("rest","inbox","latest","pull-requests").withParams({role:v})}function c(){return q.newBuilder().addPathComponents("rest","inbox","latest","pull-requests","count").build()}var o=function(v){if(v.keyCode===f.ui.keyCode.ESCAPE){u.hide();v.preventDefault()}};var p=function(){u.hide()};var n=function(y,v){var z={title:"Could not retrieve inbox",message:"An unknown error occurred"};var x={};if(v){x=v.errors?v.errors[0]:v}var w=f.extend({},z,x);y.html(f(stash.widget.focusMessage.error({title:w.title,text:w.message,extraClasses:"communication-error"})));return false};function r(v){l(v,[{id:"reviewer",title:"Reviewing"},{id:"author",title:"Created"}])}function l(A,w){var z=require("widget/avatar-list");var v=require("feature/pull-request/pull-request-table");var x=f(stash.plugin.inbox.dialogContents({roles:w}));A.append(x);var B=function(E,F,C,D){return n.call(this,A,D)};function y(E,C){var D=new v("open",null,s.partial(k,E),{scope:"global",target:"#inbox-pull-request-table-"+E,scrollPaneSelector:".inbox-table-wrapper",bufferPixels:50,pageSize:10,spinnerSize:"medium",noneFoundMessageHtml:stash.plugin.inbox.emptyInboxMessage(),dataLoadedEvent:"stash.plugin.inbox.dataLoaded."+E,statusCode:{0:B,401:B,500:B,502:B}});D.handleErrors=f.noop;D.init();if(C){h.tabs.change(A.find("[href=#inbox-pull-request-"+E+"]"))}}s.each(w,function(D,C){y(D.id,C===0)});A.find(".tabs-menu").delegate("a","click",function(C){h.tabs.change(f(this),C);C&&C.preventDefault()});z.init()}var j=function(w,v,x){x();f(document).on("keyup",o);h.dialog2.on("show",p);e(w,s.partial(r,w))};var e=s.once(function(v,x){var w=f('<div class="loading-resource-spinner"></div>');v.empty().append(w);w.show().spin("medium");WRM.require("wrc!stash.pullRequest.inbox").always(function(){w.spinStop().remove()}).done(function(){x()})});var g=function(){f(document).off("keyup",o);h.dialog2.off("show",p);if(f(document.activeElement).closest("#inbox-pull-requests-content").length){document.activeElement.blur()}};var d=function(){m.rest({url:c(),type:"GET",statusCode:{"*":false}}).done(function(w){if(w.count>0){var x=f(aui.badges.badge({text:w.count}));b.html(stash.plugin.inbox.triggerIcon({isEmpty:false})).append(x);setTimeout(function(){x.addClass("visible")},0)}else{var v=500;b.find(".aui-badge").removeClass("visible");setTimeout(function(){b.html(stash.plugin.inbox.triggerIcon({isEmpty:true}))},v)}b.attr("data-countLoaded",true)})};t.onReady=function(){b=f("#inbox-pull-requests");if(b.length&&i.getCurrentUser()){b.html(stash.plugin.inbox.triggerIcon({isEmpty:true}));u=h.InlineDialog(b,"inbox-pull-requests-content",j,{width:870,hideCallback:g});d();var v=function(w){if(w.user.name===i.getCurrentUser().name){d()}};a.on("stash.widget.approve-button.added",v);a.on("stash.widget.approve-button.removed",v)}}});AJS.$(document).ready(function(){require("plugin/inbox/inbox").onReady()});;