%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/985914/root/data/old/home/stash/stash-home/tmp/webresources/
Upload File :
Create Path :
Current File : //proc/985914/root/data/old/home/stash/stash-home/tmp/webresources/17.cachedfile

;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-toolbar', location = '/static/feature/file-toolbar/file-toolbar.soy' */
// This file was automatically generated from file-toolbar.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.file.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.file == 'undefined') { stash.feature.file = {}; }


stash.feature.file.fileToolbar = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '<div class="file-toolbar' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '"><div class="secondary">' + ((opt_data.secondaryToolbarContent) ? soy.$$filterNoAutoescape(opt_data.secondaryToolbarContent) : '') + '</div><div class="primary">' + ((opt_data.fileIcon) ? aui.icons.icon({icon: 'file', size: 'small', useIconFont: true, iconFontSet: 'devtools'}) : '') + ((opt_data.breadcrumbs) ? stash.widget.breadcrumbs.breadcrumbs({pathComponents: []}) : '') + ((opt_data.primaryToolbarContent) ? soy.$$filterNoAutoescape(opt_data.primaryToolbarContent) : '') + '</div></div>';
};
if (goog.DEBUG) {
  stash.feature.file.fileToolbar.soyTemplateName = 'stash.feature.file.fileToolbar';
}
;
;/* 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: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:file-change-type-lozenge', location = '/static/feature/file-content/file-change-type-lozenge/file-change-type-lozenge.soy' */
// This file was automatically generated from file-change-type-lozenge.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; }


stash.feature.fileContent.fileChangeTypeLozenge = function(opt_data, opt_ignored) {
  var param4 = 'change-type-lozenge change-type-' + soy.$$escapeHtml(opt_data.changeType) + ' ';
  switch (opt_data.changeType) {
    case 'ADD':
      param4 += 'aui-lozenge-success';
      break;
    case 'COPY':
      param4 += 'aui-lozenge-current';
      break;
    case 'DELETE':
      param4 += 'aui-lozenge-error';
      break;
    case 'MOVE':
    case 'RENAME':
      param4 += 'aui-lozenge-moved';
      break;
    default:
      param4 += 'aui-lozenge-complete';
  }
  var param19 = '';
  if (opt_data.previousPathContent) {
    switch (opt_data.changeType) {
      case 'MOVE':
        param19 += soy.$$filterNoAutoescape(AJS.format("{0} \x26rarr;\x3cbr\x3e{1}",opt_data.previousPathContent,opt_data.pathContent));
        break;
      case 'COPY':
        param19 += soy.$$filterNoAutoescape(AJS.format("{0} \x26rarr;\x3cbr\x3e{1}",opt_data.previousPathContent,opt_data.pathContent));
        break;
      case 'RENAME':
        param19 += soy.$$filterNoAutoescape(AJS.format("Renamed from \x27\x27{0}\x27\x27",opt_data.previousPathContent));
        break;
    }
  }
  var param32 = '';
  switch (opt_data.changeType) {
    case 'ADD':
      param32 += soy.$$escapeHtml("Added");
      break;
    case 'COPY':
      param32 += soy.$$escapeHtml("Copied");
      break;
    case 'DELETE':
      param32 += soy.$$escapeHtml("Deleted");
      break;
    case 'MOVE':
      param32 += soy.$$escapeHtml("Moved");
      break;
    case 'RENAME':
      param32 += soy.$$escapeHtml("Renamed");
      break;
    default:
      param32 += soy.$$escapeHtml("Modified");
  }
  var output = '' + stash.widget.lozenge.lozenge({htmlElement: 'span', extraClasses: param4, tooltip: param19, text: param32});
  return output;
};
if (goog.DEBUG) {
  stash.feature.fileContent.fileChangeTypeLozenge.soyTemplateName = 'stash.feature.fileContent.fileChangeTypeLozenge';
}


stash.feature.fileContent.fileChangeModeLozenge = function(opt_data, opt_ignored) {
  return '' + stash.widget.lozenge.lozenge({htmlElement: 'span', extraClasses: 'change-mode-lozenge change-mode-' + soy.$$escapeHtml(opt_data.added ? 'added aui-lozenge-success' : 'removed aui-lozenge-error'), tooltip: '' + ((opt_data.added) ? soy.$$escapeHtml("This file is now executable") : soy.$$escapeHtml("This file is no longer executable")), text: '' + ((opt_data.added) ? soy.$$escapeHtml("+x") : soy.$$escapeHtml("-x"))});
};
if (goog.DEBUG) {
  stash.feature.fileContent.fileChangeModeLozenge.soyTemplateName = 'stash.feature.fileContent.fileChangeModeLozenge';
}
;
;/* 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: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: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: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: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: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: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: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: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: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&&GT>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&&GT>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+"]("+Z+")":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:file-change-types', location = '/static/model/file-change-types.js' */
define("model/file-change-types",function(){return{ADD:"ADD",DELETE:"DELETE",MODIFY:"MODIFY",COPY:"COPY",MOVE:"MOVE",RENAME:"RENAME",UNKNOWN:"UNKNOWN",changeTypeFromId:function(A){if(Object.prototype.hasOwnProperty.call(this,A)&&typeof this[A]==="string"){return this[A]}return undefined},guessChangeTypeFromDiff:function(B){if(B.binary){if(B.source===null){return this.ADD}else{if(B.destination===null){return this.DELETE}else{return this.MODIFY}}}var A=B.hunks[0];if(A){if(A.sourceLine===0){return this.ADD}else{if(A.destinationLine===0){return this.DELETE}else{return this.MODIFY}}}return this.UNKNOWN}}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-content-modes', location = '/static/model/file-content-modes.js' */
define("model/file-content-modes",function(){return{SOURCE:"source",DIFF:"diff"}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:content-tree-node-types', location = '/static/model/content-tree-node-types.js' */
define("model/content-tree-node-types",function(){return{DIRECTORY:"DIRECTORY",FILE:"FILE",SUBMODULE:"SUBMODULE"}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:breadcrumbs', location = '/static/widget/breadcrumbs/breadcrumbs.js' */
define("widget/breadcrumbs",["jquery","lodash","memoir","stash/api/util/navbuilder","util/dom-event","util/events","model/page-state"],function(E,I,H,A,C,K,G){function F(L){this.$container=E(L);if(H.nativeSupport()){var M=this;this.$container.on("click","a",function(N){if(C.openInSameTab(N)){K.trigger("stash.widget.breadcrumbs.urlChanged",M,E(this).attr("href"));N.preventDefault()}})}}var D=A.currentRepo().browse(),J=function(L,M){if(!M.isDefault()){return D.path(L).at(M.getId()).build()}else{return D.path(L).build()}};function B(O,N){var M=[],L=I.map(N,function(P){M=M.slice(0);M.push(P);return{text:P,url:J(M,O)}});L.unshift({text:G.getRepository().getName(),url:J([],O)});return L}F.prototype.update=function(N,M,L){this.$container.empty().append(stash.widget.breadcrumbs.crumbs({pathComponents:B(N,M.getComponents()),trailingSlash:L}))};return F});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:breadcrumbs', location = '/static/widget/breadcrumbs/breadcrumbs.soy' */
// This file was automatically generated from breadcrumbs.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.breadcrumbs.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }
if (typeof stash.widget.breadcrumbs == 'undefined') { stash.widget.breadcrumbs = {}; }


stash.widget.breadcrumbs.back = function(opt_data, opt_ignored) {
  return '<li><a id="' + soy.$$escapeHtml(opt_data.id) + '" class="breadcrumbs" href="' + soy.$$escapeHtml(opt_data.href) + '"><span class="aui-icon icon-breadcrumbs-back"></span>' + soy.$$escapeHtml(opt_data.text) + '</a></li>' + ((opt_data.crumb) ? '<li>' + soy.$$escapeHtml(opt_data.crumb) + ((opt_data.state) ? stash.widget.lozenge.pullRequestState(opt_data) : '') + '</li>' : '');
};
if (goog.DEBUG) {
  stash.widget.breadcrumbs.back.soyTemplateName = 'stash.widget.breadcrumbs.back';
}


stash.widget.breadcrumbs.crumbs = function(opt_data, opt_ignored) {
  var output = '';
  var pathComponentList20 = opt_data.pathComponents;
  var pathComponentListLen20 = pathComponentList20.length;
  for (var pathComponentIndex20 = 0; pathComponentIndex20 < pathComponentListLen20; pathComponentIndex20++) {
    var pathComponentData20 = pathComponentList20[pathComponentIndex20];
    output += stash.widget.breadcrumbs.breadcrumbFragment({isLast: pathComponentIndex20 == pathComponentListLen20 - 1, url: pathComponentIndex20 == pathComponentListLen20 - 1 ? opt_data.primaryLink : pathComponentData20.url, text: pathComponentData20.text}) + ((! (pathComponentIndex20 == pathComponentListLen20 - 1) || opt_data.trailingSlash) ? stash.widget.breadcrumbs.sep(null) : '');
  }
  return output;
};
if (goog.DEBUG) {
  stash.widget.breadcrumbs.crumbs.soyTemplateName = 'stash.widget.breadcrumbs.crumbs';
}


stash.widget.breadcrumbs.breadcrumbs = function(opt_data, opt_ignored) {
  return '<div class="breadcrumbs">' + stash.widget.breadcrumbs.crumbs(opt_data) + '</div>';
};
if (goog.DEBUG) {
  stash.widget.breadcrumbs.breadcrumbs.soyTemplateName = 'stash.widget.breadcrumbs.breadcrumbs';
}


stash.widget.breadcrumbs.breadcrumbFragment = function(opt_data, opt_ignored) {
  return '' + ((opt_data.url) ? '<a' + ((opt_data.isLast) ? ' class="stub"' : '') + ' href="' + soy.$$escapeHtml(opt_data.url) + '">' + soy.$$escapeHtml(opt_data.text) + '</a>' : '<span' + ((opt_data.isLast) ? ' class="stub"' : '') + '>' + soy.$$escapeHtml(opt_data.text) + '</span>');
};
if (goog.DEBUG) {
  stash.widget.breadcrumbs.breadcrumbFragment.soyTemplateName = 'stash.widget.breadcrumbs.breadcrumbFragment';
}


stash.widget.breadcrumbs.sep = function(opt_data, opt_ignored) {
  return '<span class="sep">/</span>';
};
if (goog.DEBUG) {
  stash.widget.breadcrumbs.sep.soyTemplateName = 'stash.widget.breadcrumbs.sep';
}
;
;/* 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.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:diff-view-options', location = '/static/feature/file-content/diff-view-options.js' */
define("feature/file-content/diff-view-options",["jquery","lodash","util/client-storage","util/events"],function(E,B,A,D){var F=B.once(function(){return A.buildKey(["diff-view","options"],"user")});function C(){}D.addLocalEventMixin(C.prototype);C.prototype.getOptions=B.memoize(function(){return B.extend({},this.defaults,A.getItem(F()))});C.prototype.defaults={ignoreWhitespace:false,hideComments:false,hideEdiff:false,diffType:"unified"};C.prototype.triggerUpdate=function(G,I){var H={key:G,value:I};this.trigger("change",H);D.trigger("stash.feature.fileContent.optionsChanged",null,H)};C.prototype.set=function(G,H,I){this.getOptions()[G]=H;A.setItem(F(),this.getOptions());if(I!==false){this.triggerUpdate(G,H)}};C.prototype.get=function(G){return this.getOptions()[G]};C.prototype.proxy=function(I){var H=this;var G=new C();G.getOptions=function(){return E.extend({},H.getOptions(),I)};G.set=function(J,K,L){if(I[J]===undefined){H.set(J,K,L)}};G.destroy=D.chainWith(H).on("change",function(J){if(I[J.key]===undefined){G.trigger("change",J)}}).destroy;return G};return new C()});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-view-options-panel', location = '/static/feature/file-content/diff-view-options-panel/diff-view-options-panel.js' */
(function(){var A=require("util/bacon").keyboardEvents("requestIgnoreWhitespace");var B=require("util/bacon").keyboardEvents("requestHideComments");var D=require("util/bacon").keyboardEvents("requestHideEdiff");var C=require("util/bacon").keyboardEvents("changeDiffTypeRequested");define("feature/file-content/diff-view-options-panel",["aui","chaperone","jquery","lodash","util/events","util/function"],function(E,J,K,F,G,I){var H="#diff-options-dropdown-trigger";J.registerFeature("side-by-side-diff-discovery",[{id:"side-by-side-diff-discovery",selector:H,title:"Side-by-side diff",content:E.escapeHtml("Stash has a new way to view diffs. Use this menu to try it."),once:true}]);return function(O,P){var U="#diff-options-dropdown";var M="#diff-options-core a";var T=[];function R(Z){L();var X=K(this);var W=X.attr("data-key");var a=X.attr("data-value");var Y=(Z.type==="aui-dropdown2-item-check");if(X.is("[role=radio]")&&!Y){return }P.set(W,a||Y)}function N(W){K(this).find("#diff-options-core a").each(function(){var Y=K(this);var X=Y.attr("data-key");var a=Y.attr("data-value");var Z=P.get(X);var b=(Z&&(Z===a||Z===true));Y.toggleClass("checked",b)});T.push(G.chain().on("window.scroll.throttled",L).destroy)}function Q(W){G.off("window.scroll.throttled",L)}function L(W){if(O.find(U).attr("aria-hidden")==="false"){O.find(H).trigger("aui-button-invoke")}}function V(W){L();P.set(W,!P.get(W))}function S(){L();P.set("diffType",P.get("diffType")==="unified"?"side-by-side":"unified")}T.push(A.onValue(V.bind(null,"ignoreWhitespace")));T.push(B.onValue(V.bind(null,"hideComments")));T.push(D.onValue(V.bind(null,"hideEdiff")));T.push(C.onValue(S));T.push(G.chainWith(O).on("aui-dropdown2-item-check aui-dropdown2-item-uncheck",M,R).on("aui-dropdown2-show",U,N).on("aui-dropdown2-hide",U,Q).destroy);return{destroy:F.partial(I.applyAll,T)}}})})();;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-view-options-panel', location = '/static/feature/file-content/diff-view-options-panel/diff-view-options-panel.soy' */
// This file was automatically generated from diff-view-options-panel.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.diffViewOptionsPanel.
 */

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.diffViewOptionsPanel == 'undefined') { stash.feature.fileContent.diffViewOptionsPanel = {}; }


stash.feature.fileContent.diffViewOptionsPanel.main = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  var output = stash.buttons.button({id: 'diff-options-dropdown-trigger', buttonText: '', extraClasses: 'aui-dropdown2-trigger aui-button-subtle aui-dropdown2-trigger-arrowless', extraAttributes: 'data-container=".diff-view-secondary-panel" aria-owns="diff-options-dropdown" aria-haspopup="true"', iconType: 'aui', iconText: "Diff options", iconClass: 'aui-icon-small aui-iconfont-more'}) + '<div id="diff-options-dropdown-container">';
  var param14 = '<div id="diff-options-core">' + aui.dropdown2.section({extraClasses: 'binary-options', content: '<ul>' + stash.feature.fileContent.diffViewOptionsPanel.item({key: 'ignoreWhitespace', extraClasses: 'aui-dropdown2-checkbox diff-options-ignore-whitespace', tooltipContent: '' + soy.$$escapeHtml("Ignore whitespace for all diffs. (Type \x27Shift + w\x27)"), content: soy.$$escapeHtml("Ignore whitespace") + '<span class="assistive">' + soy.$$escapeHtml("Ignore whitespace for all diffs. (Type \x27Shift + w\x27)") + '</span>'}) + ((!!(require('model/page-state').getCurrentUser()) && opt_data.commentMode != 'none') ? stash.feature.fileContent.diffViewOptionsPanel.item({key: 'hideComments', extraClasses: 'aui-dropdown2-checkbox diff-options-hide-comments', tooltipContent: '' + soy.$$escapeHtml("Hide comments for all diffs. (Type \x27Shift + c\x27)"), content: soy.$$escapeHtml("Hide comments") + '<span class="assistive">' + soy.$$escapeHtml("Hide comments for all diffs. (Type \x27Shift + c\x27)") + '</span>'}) : '') + stash.feature.fileContent.diffViewOptionsPanel.item({key: 'hideEdiff', extraClasses: 'aui-dropdown2-checkbox diff-options-hide-ediff', tooltipContent: '' + soy.$$escapeHtml("Hide e-diff for all diffs. (Type \x27Shift + e\x27)"), content: soy.$$escapeHtml("Hide e-diff") + '<span class="assistive">' + soy.$$escapeHtml("Hide e-diff for all diffs. (Type \x27Shift + e\x27)") + '</span>'}) + '</ul>'}) + aui.dropdown2.section({extraClasses: 'diff-type-options', content: '<ul>' + stash.feature.fileContent.diffViewOptionsPanel.item({key: 'diffType', checked: true, extraClasses: 'aui-dropdown2-radio', extraAttributes: {'data-value': 'unified'}, tooltipContent: '' + soy.$$escapeHtml("Show diffs in one continuous column. (Type \x27Shift + d\x27)"), content: soy.$$escapeHtml("Unified diff") + '<span class="assistive">' + soy.$$escapeHtml("Show diffs in one continuous column. (Type \x27Shift + d\x27)") + '</span>'}) + stash.feature.fileContent.diffViewOptionsPanel.item({key: 'diffType', disabled: true, extraClasses: 'aui-dropdown2-radio', extraAttributes: {'data-value': 'side-by-side', 'data-file-type-compatibility': "Side-by-side diff is not available for added or deleted files"}, tooltipContent: '' + soy.$$escapeHtml("Show diffs split into two columns. (Type \x27Shift + d\x27)"), content: soy.$$escapeHtml("Side-by-side diff") + '<span class="assistive">' + soy.$$escapeHtml("Show diffs split into two columns. (Type \x27Shift + d\x27)") + '</span>'}) + '</ul>'}) + '</div>';
  var param84 = '';
  var webItemsDiffViewOptions__soy85 = WebFragments.getWebItems('stash.file-content.diff-view.options',{displayType: opt_data.displayType, fileChange: opt_data.fileChange});
  if (webItemsDiffViewOptions__soy85.length > 0) {
    param84 += '<ul>';
    var itemList89 = webItemsDiffViewOptions__soy85;
    var itemListLen89 = itemList89.length;
    for (var itemIndex89 = 0; itemIndex89 < itemListLen89; itemIndex89++) {
      var itemData89 = itemList89[itemIndex89];
      param84 += '<li>' + stash.widget.webItemDropdownItem(itemData89) + '</li>';
    }
    param84 += '</ul>';
  }
  param14 += aui.dropdown2.section({id: 'diff-options-pluggable', content: param84});
  output += aui.dropdown2.contents({id: 'diff-options-dropdown', extraClasses: 'aui-style-default diff-options-dropdown', content: param14});
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  stash.feature.fileContent.diffViewOptionsPanel.main.soyTemplateName = 'stash.feature.fileContent.diffViewOptionsPanel.main';
}


stash.feature.fileContent.diffViewOptionsPanel.item = function(opt_data, opt_ignored) {
  return '<li><a data-key="' + soy.$$escapeHtml(opt_data.key) + '"' + ((opt_data.tooltipContent) ? 'title="' + soy.$$filterNoAutoescape(opt_data.tooltipContent) + '"' : '') + 'class="' + aui.renderExtraClasses(opt_data) + soy.$$escapeHtml(opt_data.checked ? ' checked' : '') + soy.$$escapeHtml(opt_data.disabled ? ' disabled' : '') + '"' + aui.renderExtraAttributes(opt_data) + '>' + soy.$$filterNoAutoescape(opt_data.content) + '<span class="assistive">' + soy.$$escapeHtml("Ignore whitespace for all diffs. (Type \x27Shift + w\x27)") + '</span></a></li>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.diffViewOptionsPanel.item.soyTemplateName = 'stash.feature.fileContent.diffViewOptionsPanel.item';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:require-amd-context', location = '/static/util/require-amd-context.js' */
define("util/require-amd-context",["jquery"],function(A){return function B(D,C){return WRM.require("wrc!"+D).pipe(function(){var E=A.Deferred();require(C,function(){E.resolve.apply(E,arguments)});return E.promise()})}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:binary-view', location = '/static/feature/file-content/binary-view/binary-view.soy' */
// This file was automatically generated from binary-view.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.binaryView.
 */

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.binaryView == 'undefined') { stash.feature.fileContent.binaryView = {}; }


stash.feature.fileContent.binaryView.container = function(opt_data, opt_ignored) {
  return '<div class="binary-container"></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.binaryView.container.soyTemplateName = 'stash.feature.fileContent.binaryView.container';
}


stash.feature.fileContent.binaryView.cell = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '<div class="' + soy.$$escapeHtml(opt_data.extraClasses ? opt_data.extraClasses + ' ' : '') + 'binary">' + ((opt_data.titleText) ? '<h5>' + soy.$$escapeHtml(opt_data.titleText) + '</h5>' : '') + ((opt_data.content) ? soy.$$filterNoAutoescape(opt_data.content) : '') + '</div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.binaryView.cell.soyTemplateName = 'stash.feature.fileContent.binaryView.cell';
}


stash.feature.fileContent.binaryView.unrenderable = function(opt_data, opt_ignored) {
  return '<p><b>' + soy.$$escapeHtml("This file cannot be rendered in your browser.") + '</b><br/><a href="' + soy.$$escapeHtml(opt_data.rawUrl) + '">' + soy.$$escapeHtml("Download this file") + '</a></p>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.binaryView.unrenderable.soyTemplateName = 'stash.feature.fileContent.binaryView.unrenderable';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:binary-view', location = '/static/feature/file-content/binary-view/binary-view.js' */
define("feature/file-content/binary-view",["jquery","lodash","stash/api/util/navbuilder","util/deprecation","util/events","exports"],function(G,L,B,I,O,F){function D(Q,P){return B.currentRepo().browse().path(Q.components).at(P).raw().build()}function C(P){return{$elem:G(stash.feature.fileContent.binaryView.unrenderable({rawUrl:P})),type:"link"}}function K(Q){var P=G("<img />");P.attr("src",Q);return{$elem:P,type:"image"}}var J={png:K,jpg:K,jpeg:K,bmp:K,ico:K,gif:K,svg:K};function E(S,Q){var T=S.extension&&S.extension.toLowerCase();var P=D(S,Q),R=J[T]||C;return R(P)}function H(T,S,Q){var R=Q.getUntilRevision();var P=E(S,R&&R.getId());T.empty().addClass("binary").append(P.$elem);I.triggerDeprecated("stash.feature.sourceview.onBinary",null,{path:S,type:P.type,revision:R},"stash.feature.fileContent.binaryShown","3.3","4.0");O.trigger("stash.feature.fileContent.binaryShown",null,{containerEl:T.get(0),path:S,type:P.type,commit:R.toJSON()});return T}var A=["svg"];function N(P){var Q=P.destination&&P.destination.extension;return !!(P&&(P.binary||M(Q)))}function M(P){return P&&(L.indexOf(A,P)>=0)}F.renderBinaryFile=I.fn(H,null,"3.3","4.0");F.shouldRenderBinary=I.fn(N,null,"3.3","4.0");F.getRenderedBinary=E;F.treatTextAsBinary=M});;
;/* 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-web-plugin:content-message', location = '/static/feature/file-content/content-message/content-message.js' */
define("feature/file-content/content-message",["aui","lodash","util/deprecation","util/events","exports"],function(G,I,E,J,C){function A(L,K){L.append(stash.feature.fileContent.contentMessage.conflict({titleContent:G.escapeHtml(K.getConflict().getConflictMessage()),nodeType:K.getNodeType()}))}function D(O,N,K){O.append(stash.feature.fileContent.contentMessage.emptyDiff({fileChangeType:K.getType()}));var L=K.getCommitRange().getSinceRevision();var M=K.getCommitRange().getUntilRevision();J.trigger("stash.feature.fileContent.emptyDiffShown",{containerEl:O.get(0),sourcePath:N.source,sinceRevision:L&&L.toJSON(),destinationPath:N.destination,untilRevision:M&&M.toJSON()})}function H(N,M,K){N.append(stash.feature.fileContent.contentMessage.emptyFile());var L=K.commitRange.untilRevision;E.triggerDeprecated("stash.feature.sourceview.onEmptyFile",{},M,"stash.feature.fileContent.emptyFileShown","3.3","4.0");J.trigger("stash.feature.fileContent.emptyFileShown",{containerEl:N.get(0),path:M.path,commit:L})}function F(L,K){var M=K&&K.errors&&K.errors.length?K.errors:[{message:"An unknown error has occurred"}];L.append(I.map(M,stash.feature.fileContent.contentMessage.error).join(""))}function B(P,O,L,M){var K=L.getCommitRange();var N=K.getPullRequest();P.append(stash.feature.fileContent.contentMessage.tooLargeDiff({filePath:O.destination.toString,revisionId:!N&&K.getUntilRevision()&&K.getUntilRevision().getId(),parentRevisionId:!N&&K.getSinceRevision()&&K.getSinceRevision().getId(),sideBySideDiffEnabled:M}))}C.renderConflict=A;C.renderEmptyDiff=D;C.renderEmptyFile=H;C.renderErrors=F;C.renderTooLargeDiff=B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:content-message', location = '/static/feature/file-content/content-message/content-message.soy' */
// This file was automatically generated from content-message.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.contentMessage.
 */

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.contentMessage == 'undefined') { stash.feature.fileContent.contentMessage = {}; }


stash.feature.fileContent.contentMessage.emptyFile = function(opt_data, opt_ignored) {
  return '' + stash.widget.focusMessage.message({extraClasses: 'content-view source-view empty-file', iconClass: 'icon-empty-file', accessibilityText: "Empty file", title: "This file is empty"});
};
if (goog.DEBUG) {
  stash.feature.fileContent.contentMessage.emptyFile.soyTemplateName = 'stash.feature.fileContent.contentMessage.emptyFile';
}


stash.feature.fileContent.contentMessage.error = function(opt_data, opt_ignored) {
  return '<div class="content-message-container">' + aui.message.warning({extraClasses: 'content-message', content: '' + soy.$$escapeHtml(opt_data.message)}) + '</div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.contentMessage.error.soyTemplateName = 'stash.feature.fileContent.contentMessage.error';
}


stash.feature.fileContent.contentMessage.tooLargeDiff = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '<div class="content-message-container">' + aui.message.warning({extraClasses: 'content-message', content: '' + ((opt_data.filePath && opt_data.revisionId) ? soy.$$escapeHtml("The diff for this file is too large to render. You can still retrieve it manually with the following Git command.") + '<p class="scm-command">' + ((opt_data.parentRevisionId) ? 'git diff -C -M ' + soy.$$escapeHtml(opt_data.parentRevisionId) + ' ' + soy.$$escapeHtml(opt_data.revisionId) + ' -- "' + soy.$$escapeHtml(opt_data.filePath) + '"' : 'git log -p ' + soy.$$escapeHtml(opt_data.revisionId) + ' -- "' + soy.$$escapeHtml(opt_data.filePath) + '"') + '</p>' : '<p>' + soy.$$escapeHtml("The diff for this file is too large to render") + '</p>' + ((opt_data.sideBySideDiffEnabled) ? '<p>' + soy.$$escapeHtml("It might be possible to view this diff using unified diff. You can switch to unified diff via the options menu.") + '</p>' : ''))}) + '</div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.contentMessage.tooLargeDiff.soyTemplateName = 'stash.feature.fileContent.contentMessage.tooLargeDiff';
}


stash.feature.fileContent.contentMessage.emptyDiff = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  var param54 = '';
  switch (opt_data.fileChangeType) {
    case 'ADD':
      param54 += soy.$$escapeHtml("The added file is empty");
      break;
    case 'DELETE':
      param54 += soy.$$escapeHtml("The removed file is empty");
      break;
    default:
      param54 += soy.$$escapeHtml("The contents for this file have not changed");
  }
  var output = '' + stash.widget.focusMessage.message({extraClasses: 'content-view diff-view empty-file', iconClass: 'icon-empty-file', accessibilityText: "No diff", title: param54});
  return output;
};
if (goog.DEBUG) {
  stash.feature.fileContent.contentMessage.emptyDiff.soyTemplateName = 'stash.feature.fileContent.contentMessage.emptyDiff';
}


stash.feature.fileContent.contentMessage.conflict = function(opt_data, opt_ignored) {
  var output = '<div class="diff-conflict-message-container">';
  var param66 = '';
  if (opt_data.messageContent) {
    param66 += soy.$$filterNoAutoescape(opt_data.messageContent);
  } else {
    switch (opt_data.nodeType) {
      case 'SUBMODULE':
        param66 += soy.$$escapeHtml("This submodule is in a conflicted state. You will need to resolve the conflict manually before you can merge this pull request.");
        break;
      default:
        param66 += soy.$$escapeHtml("This file is in a conflicted state. You will need to resolve the conflict manually before you can merge this pull request.");
    }
  }
  output += aui.message.warning({titleContent: opt_data.titleContent, content: param66});
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  stash.feature.fileContent.contentMessage.conflict.soyTemplateName = 'stash.feature.fileContent.contentMessage.conflict';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:request-diff', location = '/static/feature/file-content/request-diff.js' */
define("feature/file-content/request-diff",["jquery","lodash","stash/api/util/navbuilder","util/ajax","model/path","feature/file-content/diff-view-options"],function(F,K,A,J,E,D){var B={};var C=-1;function G(L,M){if(F.isArray(M.diffs)&&M.diffs.length){M=K.find(M.diffs,function(N){if(N.destination){return N.destination.toString===new E(L.path).toString()}else{if(L.srcPath){return N.source.toString===new E(L.srcPath).toString()}}return false})||M.diffs[0]}return M}function I(L){var M=A.rest().project(L.repository.project.key).repo(L.repository.slug);var O=L.commitRange.pullRequest;var N=O?M.pullRequest(O.id):M.changeset(L.commitRange);return N.diff(L)}function H(N,T){var O=N.toJSON?N.toJSON():N;if(O.diff){return F.Deferred().resolve(F.extend({lineComments:T.lineComments||[],fileComments:T.fileComments||[]},O.diff))}T=T||{};var P=T.hasOwnProperty("ignoreWhitespace")?T.ignoreWhitespace:D.get("ignoreWhitespace");var M=isNaN(Number(T.contextLines))?C:Math.floor(T.contextLines);var S=(T.diffUrlBuilder||I)(O);var L=S.withParams({avatarSize:stash.widget.avatarSizeInPx({size:T.avatarSize||"medium"}),markup:true,whitespace:P?"ignore-all":"",contextLines:M,withComments:T.withComments}).build();if(B.hasOwnProperty(L)&&B[L].state()!=="rejected"){return B[L]}var R=J.rest({url:L,statusCode:T.statusCode||J.ignore404WithinRepository()});var Q=R.then(function(U){if(U.errors&&U.errors.length){return F.Deferred().rejectWith(this,[this,null,null,U])}else{U=G(O,U)}setTimeout(function(){delete B[L]});return U});B[L]=Q.promise(R);return B[L]}return H});;
;/* 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:revision', location = '/static/model/revision.js' */
define("model/revision",["backbone-brace","model/repository","model/revision-reference"],function(C,A,D){var B=C.Model.extend({namedAttributes:{id:null,displayId:null,repository:A,message:null,author:null,authorTimestamp:null,parents:null,attributes:null,properties:null},hasParents:function(){return this.getParents()&&this.getParents().length},getRevisionReference:function(){return new D({id:this.getId(),displayId:this.getDisplayId(),type:D.type.COMMIT,repository:this.getRepository(),latestChangeset:this.getId()})}});C.Mixins.applyMixin(B,{namedAttributes:{parents:[B]}});return B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:participant-model', location = '/static/model/participant.js' */
define("model/participant",["backbone-brace","model/stash-user"],function(B,A){return B.Model.extend({namedAttributes:{approved:"boolean",role:"string",user:A}})});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:participant-model', location = '/static/model/participant-collection.js' */
define("model/participant-collection",["backbone-brace","lodash","model/participant"],function(C,A,B){return C.Collection.extend({model:B,comparator:function(E,D){return(E.getApproved()===D.getApproved())?(E.getUser().getDisplayName()).localeCompare(D.getUser().getDisplayName()):E.getApproved()?-1:1},findByUser:function(D){return A.find(this.models,function(E){return E.getUser().getName()===D.getName()})}})});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:pull-request-model', location = '/static/model/pull-request.js' */
define("model/pull-request",["backbone-brace","model/participant","model/participant-collection","model/revision-reference"],function(C,B,A,D){return C.Model.extend({namedAttributes:{id:null,link:null,links:Object,fromRef:D,toRef:D,author:B,reviewers:A,participants:A,state:null,open:"boolean",closed:"boolean",locked:"boolean",title:null,createdDate:Date,updatedDate:Date,version:null,description:null,descriptionAsHtml:null,attributes:null,properties:null},addParticipant:function(E){var F=this.getParticipants().findByUser(E.getUser());if(!F){this.getParticipants().add(E)}}},{state:{OPEN:"OPEN",MERGED:"MERGED",DECLINED:"DECLINED"}})});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:commit-range', location = '/static/model/commit-range.js' */
define("model/commit-range",["backbone-brace","model/pull-request","model/revision"],function(B,E,A){var D="ROOT";function C(F){if(F.getPullRequest()){return F.getPullRequest().getId()}return F.getUntilRevision().getId()+"_"+(F.getSinceRevision()?F.getSinceRevision().getId():D)}return B.Model.extend({namedAttributes:{pullRequest:E,untilRevision:A,sinceRevision:A},initialize:function(){if(!this.getUntilRevision()){if(this.getPullRequest()){var F=this.getPullRequest().getFromRef();this.setUntilRevision(F&&new A({id:F.getLatestChangeset()}));var G=this.getPullRequest().getToRef();this.setSinceRevision(G&&new A({id:G.getLatestChangeset()}))}else{throw new Error("Commits range requires either a pull request or revision(s)")}}if(this.getSinceRevision()&&this.getSinceRevision().getId()===D){this.setSinceRevision(undefined)}this.setId(C(this))}})});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:conflict-change-model', location = '/static/model/conflict-change.js' */
define("model/conflict-change",["backbone-brace","util/deprecation","model/file-change-types","model/path"],function(A,D,C,B){var E=A.Model.extend({namedAttributes:{srcPath:B,path:B,type:null},initialize:function(){this.setType(E._mapChangeType(this.getType(),this.getSrcPath(),this.getPath()))}},{_mapChangeType:function(F,H,G){return(F===C.MOVE&&H&&H.isSameDirectory(G))?C.RENAME:C.changeTypeFromId(F)}});(function(F){E.prototype.toJSON=function(){var G=F.apply(this,arguments);if(this.getPath()){G.path=D.jsonAsBrace(this.getPath(),"3.2","4.0")}if(this.getSrcPath()){G.srcPath=D.jsonAsBrace(this.getSrcPath(),"3.2","4.0")}return G}})(E.prototype.toJSON);return E});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:conflict-model', location = '/static/model/conflict.js' */
define("model/conflict",["aui","backbone-brace","model/conflict-change","model/file-change-types"],function(A,C,F,D){var B={};B[D.ADD]={};B[D.ADD][D.ADD]="Conflict: Added file to Source, Added same file to Target";B[D.ADD][D.RENAME]="Conflict: Added file to Source, Renamed to same on Target";B[D.ADD][D.MOVE]="Conflict: Added file to Source, Moved to same on Target";B[D.MODIFY]={};B[D.MODIFY][D.MODIFY]="Conflict: Modified on Source, Modified on Target";B[D.MODIFY][D.RENAME]="Conflict: Modified on Source, Renamed on Target";B[D.MODIFY][D.MOVE]="Conflict: Modified on Source, Moved on Target";B[D.MODIFY][D.DELETE]="Conflict: Modified on Source, Deleted on Target";B[D.RENAME]={};B[D.RENAME][D.ADD]="Conflict: Renamed on Source, Added same to Target";B[D.RENAME][D.RENAME]="Conflict: Renamed on Source, Renamed on Target";B[D.RENAME][D.MOVE]="Conflict: Renamed on Source, Moved on Target";B[D.RENAME][D.DELETE]="Conflict: Renamed on Source, Deleted on Target";B[D.MOVE]={};B[D.MOVE][D.ADD]="Conflict: Moved on Source, Added same to Target";B[D.MOVE][D.RENAME]="Conflict: Moved on Source, Renamed on Target";B[D.MOVE][D.MOVE]="Conflict: Moved on Source, Moved on Target";B[D.MOVE][D.DELETE]="Conflict: Moved on Source, Deleted on Target";B[D.DELETE]={};B[D.DELETE][D.MODIFY]="Conflict: Deleted on Source, Modified on Target";B[D.DELETE][D.RENAME]="Conflict: Deleted on Source, Renamed on Target";B[D.DELETE][D.MOVE]="Conflict: Deleted on Source, Moved on Target";var E=C.Model.extend({namedAttributes:{ourChange:F,theirChange:F},getConflictMessage:function(){var H=this.getOurChange()&&this.getOurChange().getType(),G=this.getTheirChange()&&this.getTheirChange().getType();return(B[G]&&B[G][H])||""}});return E});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-change', location = '/static/model/file-change.js' */
define("model/file-change",["backbone-brace","util/deprecation","model/commit-range","model/conflict","model/file-change-types","model/path","model/repository"],function(C,F,B,H,E,D,A){var G=C.Model.extend({namedAttributes:{repository:A,commitRange:B,srcPath:D,path:D,line:null,search:null,type:null,nodeType:null,conflict:H,diff:null,srcExecutable:null,executable:null},initialize:function(){if(this.getPath()){this.setPath(new D(this.getPath()))}if(this.getSrcPath()){this.setSrcPath(new D(this.getSrcPath()))}this.setType(G._mapChangeType(this.getType(),this.getSrcPath(),this.getPath()))}},{fromDiff:function(J,I,K){return new G({repository:K,commitRange:I,srcPath:J.source,path:J.destination,diff:J,type:E.guessChangeTypeFromDiff(J)})},_mapChangeType:function(I,K,J){return(I===E.MOVE&&K&&K.isSameDirectory(J))?E.RENAME:E.changeTypeFromId(I)}});(function(I){G.prototype.toJSON=function(){var K=this.getPath();var L=this.getSrcPath();this.setPath(null);this.setSrcPath(null);var J=I.apply(this,arguments);if(K){J.path=F.jsonAsBrace(K,"3.2","4.0")}if(L){J.srcPath=F.jsonAsBrace(L,"3.2","4.0")}this.setPath(K);this.setSrcPath(L);return J}})(G.prototype.toJSON);return G});;
;/* module-key = 'com.atlassian.stash.stash-web-api:file-handlers', location = '/static/util/handler-registry.js' */
define("util/handler-registry",["jquery","lodash"],function(C,A){function B(){this.handlers=[]}B.prototype.register=function(E){if(!A.isFunction(E.handle)){throw new Error("Handler must have a handle function")}E.weight=typeof E.weight==="number"&&!isNaN(E.weight)?E.weight:1000;this.handlers.push(E);this.handlers=A.sortBy(this.handlers,function(G){return G.weight});var F=this;return function D(){var G=F.handlers.indexOf(E);if(G>=0){F.handlers.splice(G,1)}}};B.prototype._handle=function(G){var F=C.Deferred();var I;var D;var E=this.handlers;var J=[];function H(K){if(I){return F.reject(new Error("Handling aborted."))}if(K<E.length){D=E[K].handle(G)||C.Deferred().reject();return C.when(D).done(function(L){F.resolve(L||{},J)}).fail(function(L){L&&J.push(L);H(K+1)})}else{F.reject(new Error("No registered handlers were able to handle file"))}}H(0);return F.promise({abort:function(){if(!I&&D&&D.abort){D.abort()}I=true}})};B.prototype._clear=function(){this.handlers=[]};return B});;
;/* module-key = 'com.atlassian.stash.stash-web-api:file-handlers', location = '/static/stash/api/feature/files/file-handlers.js' */
define("stash/api/feature/files/file-handlers",["util/handler-registry","util/object"],function(B,A){var D=new B();function C(E){}D.builtInHandlers={ERROR:"error",SOURCE_TEXT:"source-text",SOURCE_EMPTY:"source-empty",SOURCE_IMAGE:"source-image",SOURCE_BINARY:"source-binary",DIFF_TEXT_SIDE_BY_SIDE:"diff-text-side-by-side",DIFF_TEXT_UNIFIED:"diff-text-unified",DIFF_EMPTY:"diff-empty",DIFF_TOO_LARGE:"diff-too-large",DIFF_IMAGE:"diff-image",DIFF_BINARY:"diff-binary"};A.freeze(D.builtInHandlers);return D});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:eevee', location = '/static/bower/eevee/lib/eevee.js' */
define("eevee",["backbone","eve","underscore"],function(D,B,A){var C={trigger:function(E,F){return B.apply(this,arguments)},on:function(E,F){return B.on(E,F)},off:function(E,F){return B.off(E,F)},once:function(E,F){return B.once(E,F)},listeners:function(E){return B.listeners(E)},name:function(E){return B.nt(E)},chain:function(){return this.chainWith(this)},chainWith:function(G){var E=[];var F={on:function(I,H){var J=arguments;G.on.apply(G,J);E.push(function(){G.off.apply(G,J)});return this},destroy:function(){for(var H=0;H<E.length;H++){E[H]()}E=[]}};return F},stop:function(){return B.stop()},createEventMixin:function(F,E){E=E||{};return A.extend({},D.Events,{trigger:function(H){var G=D.Events.trigger.apply(this,arguments);if(!E.localOnly){C.trigger.apply(C,[F+"/"+H,this].concat(Array.prototype.slice.call(arguments,1)))}return G},retriggerFrom:function(G){var I=Array.prototype.slice.call(arguments,1);function H(K,J){return K.on(J,this.trigger.bind(this,J))}return I.reduce(H.bind(this),C.chainWith(G))}})},createLocalEventMixin:function(){return this.createEventMixin(null,{localOnly:true})},addEventMixin:function(F,G,E){A.extend(F,this.createEventMixin(G,E))},addLocalEventMixin:function(E){A.extend(E,this.createLocalEventMixin())}};return C});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:image-diff-toolbar', location = '/static/bower/image-differ/lib/image-diff-toolbar.js' */
define("image-diff-toolbar",["aui","eevee","jquery"],function(B,C,D){function A(E){this._$toolbar=D(E);this._$toggle=this._$toolbar.find(".image-diff-toggle")}C.addLocalEventMixin(A.prototype);A.prototype.init=function(J){var M=this;var F=this._$toggle.find(".image-diff-two-up");var I=this._$toggle.find(".image-diff-blend");var E=this._$toggle.find(".image-diff-split");var L=this._$toggle.find(".image-diff-pixeldiff");E.attr("aria-disabled",!J).prop("disabled",!J);if(J){E.attr("title","Compare the image changes by moving your mouse cursor left or right over the image")}L.attr("aria-disabled",!J).prop("disabled",!J);if(J){L.attr("title","Compare the image changes by seeing which pixels have changed")}I.attr("aria-disabled",!J).prop("disabled",!J);if(J){I.attr("title","Compare the image changes by fading in the differences")}function K(N){M.trigger("modeChanged",N,M._mode);M._mode=N}var G=this._$toggle.find(".aui-button");var H=function(N){return function(P){var O=D(this);if(O.attr("aria-disabled")!=="true"&&O.attr("aria-pressed")!=="true"){G.attr("aria-pressed","false");O.attr("aria-pressed","true");K(N)}P.preventDefault()}};F.click(H("two-up"));I.click(H("blend"));E.click(H("split"));L.click(H("pixeldiff"));F.add(I).add(E).add(L).tooltip({gravity:"s"});K("two-up")};A.prototype.getMode=function(){return this._mode};A.prototype.destroy=function(){if(this._$toolbar){this._$toolbar.remove();this._$toolbar=null}this._$toggle=null};return A});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:image-diff-toolbar', location = '/static/bower/image-differ/lib/image-diff-toolbar.soy' */
// This file was automatically generated from image-diff-toolbar.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace imageDiffer.imageDiffToolbar.
 */

if (typeof imageDiffer == 'undefined') { var imageDiffer = {}; }
if (typeof imageDiffer.imageDiffToolbar == 'undefined') { imageDiffer.imageDiffToolbar = {}; }


imageDiffer.imageDiffToolbar.main = function(opt_data, opt_ignored) {
  return '' + aui.toolbar2.toolbar2({content: '' + aui.toolbar2.item({item: 'primary', extraClasses: 'image-diff-toggle', content: '' + imageDiffer.imageDiffToolbar.toggleButtons(null)}), extraClasses: 'image-diff-toolbar'});
};
if (goog.DEBUG) {
  imageDiffer.imageDiffToolbar.main.soyTemplateName = 'imageDiffer.imageDiffToolbar.main';
}


imageDiffer.imageDiffToolbar.toggleButtons = function(opt_data, opt_ignored) {
  return '' + aui.buttons.buttons({content: '' + aui.buttons.button({extraClasses: 'image-diff-two-up', isPressed: true, text: "Two-up", extraAttributes: {title: "Compare images alongside each other"}}) + aui.buttons.button({extraClasses: 'image-diff-blend', isDisabled: true, text: "Blend", extraAttributes: {title: "Blend mode image diff is not available because images are not of the same dimension"}}) + aui.buttons.button({extraClasses: 'image-diff-split', isDisabled: true, text: "Split", extraAttributes: {title: "Split mode image diff is not available because images are not of the same dimension"}}) + aui.buttons.button({extraClasses: 'image-diff-pixeldiff', isDisabled: true, text: "Pixel diff", extraAttributes: {title: "Pixel diff mode image diff is not available because images are not of the same dimension"}})});
};
if (goog.DEBUG) {
  imageDiffer.imageDiffToolbar.toggleButtons.soyTemplateName = 'imageDiffer.imageDiffToolbar.toggleButtons';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:fd-slider', location = '/static/bower/fd-slider/js/fd-slider.js' */
/* Unobtrusive Slider Control / HTML5 Input Range polyfill - MIT/GPL2 @freqdec */
var fdSlider=(function(){var sliders={},uniqueid=0,mouseWheelEnabled=true,fullARIA=true,describedBy="fd-slider-describedby",varSetRules={onfocus:true,onvalue:true},noRangeBar=false,html5Animation="jump",isOpera=Object.prototype.toString.call(window.opera)==="[object Opera]",fpRegExp=/^([\-]{0,1}[0-9]+(\.[0-9]+){0,1})$/,stepRegExp=/^([0-9]+(\.[0-9]+){0,1})$/;var parseJSON=function(str){if(typeof str!=="string"||str===""){return{}}try{if(typeof JSON==="object"&&typeof (JSON.parse)==="function"){return JSON.parse(str)}else{if(/mousewheelenabled|fullaria|describedby|norangebar|html5animation|varsetrules/.test(str.toLowerCase())){var f=Function(["var document,top,self,window,parent,Number,Date,Object,Function,","Array,String,Math,RegExp,Image,ActiveXObject;","return (",str.replace(/<\!--.+-->/gim,"").replace(/\bfunction\b/g,"function-"),");"].join(""));return f()}}}catch(e){}return{err:"Could not parse the JSON object"}};var affectJSON=function(json){if(typeof json!=="object"){return }for(var key in json){value=json[key];switch(key.toLowerCase()){case"mousewheelenabled":mouseWheelEnabled=!!value;break;case"fullaria":fullARIA=!!value;break;case"describedby":describedBy=String(value);break;case"norangebar":noRangeBar=!!value;break;case"html5animation":html5Animation=String(value).search(/^(jump|tween|timed)$/i)!=-1?String(value).toLowerCase():"jump";break;case"varsetrules":if("onfocus" in value){varSetRules.onfocus=!!value.onfocus}if("onvalue" in value){varSetRules.onvalue=!!value.onvalue}break}}};var addEvent=function(obj,type,fn){if(obj.addEventListener){obj.addEventListener(type,fn,true)}else{if(obj.attachEvent){obj.attachEvent("on"+type,fn)}}};var removeEvent=function(obj,type,fn){try{if(obj.removeEventListener){obj.removeEventListener(type,fn,true)}else{if(obj.detachEvent){obj.detachEvent("on"+type,fn)}}}catch(err){}};var stopEvent=function(e){e=e||window.event;if(e.stopPropagation){e.stopPropagation();e.preventDefault();
/*@cc_on@*/
/*@if(@_win32)
        e.cancelBubble = true;
        e.returnValue = false;
        /*@end@*/
}return false};var preventDefault=function(e){e=e||window.event;if(e.preventDefault){e.preventDefault();return }e.returnValue=false};var addClass=function(e,c){if(new RegExp("(^|\\s)"+c+"(\\s|$)").test(e.className)){return }e.className+=(e.className?" ":"")+c};var removeClass=function(e,c){e.className=!c?"":e.className.replace(new RegExp("(^|\\s)"+c+"(\\s|$)")," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var getValueSet=function(){var obj={};for(var id in sliders){obj[id]=sliders[id].getValueSet()}return obj};var setValueSet=function(sliderId,tf){sliders[sliderId].setValueSet(!!tf)};var sliderExists=function(slider){return !!(slider in sliders&&sliders.hasOwnProperty(slider))};var createSlider=function(options){if(!options||!options.inp||!options.inp.tagName||options.inp.tagName.search(/^input|select/i)==-1){return false}options.html5Shim=false;if(options.inp.tagName.toLowerCase()=="select"){if(options.inp.options.length<2){return false}options.min=0;options.max=options.inp.options.length-1;options.step=1;options.precision=0;options.scale=false;options.forceValue=true}else{if(String(options.inp.type).search(/^(text|range)$/i)==-1){return false}options.min=options.min&&String(options.min).search(fpRegExp)!=-1?+options.min:0;options.max=options.max&&String(options.max).search(fpRegExp)!=-1?+options.max:100;options.step=options.step&&String(options.step).search(stepRegExp)!=-1?options.step:1;options.precision=options.precision&&String(options.precision).search(/^[0-9]+$/)!=-1?options.precision:(String(options.step).search(/\.([0-9]+)$/)!=-1?String(options.step).match(/\.([0-9]+)$/)[1].length:0);options.scale=options.scale||false;options.forceValue=("forceValue" in options)?!!options.forceValue:false;options.userSnap=("userSnap" in options)?!!options.userSnap:false}options.ariaFormat=("ariaFormat" in options)&&typeof options.ariaFormat=="function"?options.ariaFormat:false;options.maxStep=options.maxStep&&String(options.maxStep).search(stepRegExp)!=-1?+options.maxStep:+options.step*2;options.classNames=options.classNames||"";options.callbacks=options.callbacks||false;destroySingleSlider(options.inp.id);sliders[options.inp.id]=new fdRange(options);return true};var getAttribute=function(elem,att){return elem.getAttribute(att)||""};var init=function(){var inputs=document.getElementsByTagName("input"),options;for(var i=0,inp;inp=inputs[i];i++){if(inp.tagName.toLowerCase()=="input"&&inp.type.toLowerCase()=="text"&&(getAttribute(inp,"min")&&getAttribute(inp,"min").search(fpRegExp)!=-1||getAttribute(inp,"max")&&getAttribute(inp,"max").search(fpRegExp)!=-1||getAttribute(inp,"step")&&getAttribute(inp,"step").search(/^(any|([0-9]+(\.[0-9]+){0,1}))$/i)!=-1)){if(inp.id&&document.getElementById("fd-slider-"+inp.id)){continue}else{if(inp.id&&!document.getElementById("fd-slider-"+inp.id)){destroySingleSlider(inp.id)}}if(!inp.id){inp.id="fd-slider-form-elem-"+uniqueid++}options={inp:inp,callbacks:[],animation:html5Animation,vertical:getAttribute(inp,"data-fd-slider-vertical")?true:(inp.offsetHeight>inp.offsetWidth),classNames:getAttribute(inp,"data-fd-slider-vertical"),html5Shim:true};if(options.vertical&&!getAttribute(inp,"data-fd-slider-vertical")){options.inpHeight=inp.offsetHeight}options.min=getAttribute(inp,"min")||0;options.max=getAttribute(inp,"max")||100;options.step=getAttribute(inp,"step").search(/^any$/i)!=-1?options.max-options.min:getAttribute(inp,"step").search(stepRegExp)!=-1?inp.getAttribute("step"):1;options.precision=String(options.step).search(/\.([0-9]+)$/)!=-1?String(options.step).match(/\.([0-9]+)$/)[1].length:0;options.maxStep=options.step*2;destroySingleSlider(options.inp.id);sliders[options.inp.id]=new fdRange(options)}}return true};var destroySingleSlider=function(id){if(id in sliders&&sliders.hasOwnProperty(id)){sliders[id].destroy();delete sliders[id];return true}return false};var destroyAllsliders=function(e){for(var slider in sliders){if(sliders.hasOwnProperty(slider)){sliders[slider].destroy()}}sliders=[]};var unload=function(e){destroyAllsliders();sliders=null};var resize=function(e){for(var slider in sliders){if(sliders.hasOwnProperty(slider)){sliders[slider].onResize()}}};var onDomReady=function(){removeOnLoadEvent();init()};var removeOnLoadEvent=function(){removeEvent(window,"load",init)};function fdRange(options){var inp=options.inp,disabled=false,tagName=inp.tagName.toLowerCase(),min=+options.min,max=+options.max,rMin=+options.min,rMax=+options.max,range=Math.abs(max-min),step=tagName=="select"?1:+options.step,maxStep=options.maxStep?+options.maxStep:step*2,precision=options.precision||0,steps=Math.ceil(range/step),scale=options.scale||false,hideInput=!!options.hideInput,animation=options.animation||"",vertical=!!options.vertical,callbacks=options.callbacks||{},classNames=options.classNames||"",html5Shim=!!options.html5Shim,defaultVal=max<min?min:min+((max-min)/2),resetDef=tagName=="select"?inp.selectedIndex:inp.defaultValue||defaultVal,forceValue=html5Shim||!!options.forceValue,inpHeight=html5Shim&&vertical&&("inpHeight" in options)?options.inpHeight:false,ariaFormat=!html5Shim&&options.ariaFormat?options.ariaFormat:false,userSnap=!html5Shim&&!(tagName=="select")&&("userSnap" in options)?!!options.userSnap:false,userInput=false,timer=null,kbEnabled=true,initialVal=tagName=="select"?inp.selectedIndex:inp.value,sliderH=0,sliderW=0,tweenX=0,tweenB=0,tweenC=0,tweenD=0,frame=0,x=0,y=0,rMaxPx=0,rMinPx=0,handlePos=0,destPos=0,mousePos=0,stepPx=0,userSet=false,touchEvents=false,outerWrapper,innerWrapper,ieBlur,handle,rangeBar,bar;if(tagName=="input"&&forceValue&&!inp.defaultValue){inp.defaultValue=getWorkingValueFromInput()}if(max<min){step=-Math.abs(step);maxStep=-Math.abs(maxStep)}if(scale){scale[100]=max}function valueSet(tf){tf=!!tf;if(tf!=userSet){userSet=tf;valueToPixels(getWorkingValueFromInput())}}function disableSlider(noCallback){if(disabled&&!noCallback){return }try{setTabIndex(handle,-1);removeEvent(handle,"focus",onFocus);removeEvent(handle,"blur",onBlur);if(!isOpera){removeEvent(handle,"keydown",onKeyDown);removeEvent(handle,"keypress",onKeyPress)}else{removeEvent(handle,"keypress",onKeyDown)}removeEvent(outerWrapper,"mouseover",onMouseOver);removeEvent(outerWrapper,"mouseout",onMouseOut);removeEvent(outerWrapper,"mousedown",onMouseDown);removeEvent(outerWrapper,"touchstart",onMouseDown);if(mouseWheelEnabled){if(window.addEventListener&&!window.devicePixelRatio){window.removeEventListener("DOMMouseScroll",trackMouseWheel,false)}else{removeEvent(document,"mousewheel",trackMouseWheel);removeEvent(window,"mousewheel",trackMouseWheel)}}}catch(err){}removeClass(innerWrapper,"fd-slider-focused");removeClass(innerWrapper,"fd-slider-active");addClass(innerWrapper,"fd-slider-disabled");outerWrapper.setAttribute("aria-disabled",true);inp.disabled=disabled=true;clearTimeout(timer);if(!noCallback){callback("disable")}}function enableSlider(noCallback){if(!disabled&&!noCallback){return }setTabIndex(handle,0);addEvent(handle,"focus",onFocus);addEvent(handle,"blur",onBlur);if(!isOpera){addEvent(handle,"keydown",onKeyDown);addEvent(handle,"keypress",onKeyPress)}else{addEvent(handle,"keypress",onKeyDown)}addEvent(outerWrapper,"touchstart",onMouseDown);addEvent(outerWrapper,"mousedown",onMouseDown);addEvent(outerWrapper,"mouseover",onMouseOver);addEvent(outerWrapper,"mouseout",onMouseOut);removeClass(innerWrapper,"fd-slider-disabled");outerWrapper.setAttribute("aria-disabled",false);inp.disabled=disabled=touchEvents=false;if(!noCallback){callback("enable")}}function destroySlider(){clearTimeout(timer);ieBlur=bar=handle=outerWrapper=innerWrapper=timer=null;callback("destroy");callbacks=null}function redraw(){locate();try{var sW=outerWrapper.offsetWidth,sH=outerWrapper.offsetHeight,hW=handle.offsetWidth,hH=handle.offsetHeight,bH=bar.offsetHeight,bW=bar.offsetWidth,mPx=vertical?sH-hH:sW-hW;stepPx=mPx/steps;rMinPx=Math.max(scale?percentToPixels(valueToPercent(rMin)):Math.abs((rMin-min)/step)*stepPx,0);rMaxPx=Math.min(scale?percentToPixels(valueToPercent(rMax)):Math.abs((rMax-min)/step)*stepPx,Math.floor(vertical?sH-hH:sW-hW));sliderW=sW;sliderH=sH;valueToPixels(forceValue?getWorkingValueFromInput():(tagName=="select"?inp.selectedIndex:parseFloat(inp.value)),false)}catch(err){}callback("redraw")}function callback(type){if(!html5Shim){if(callbacks.hasOwnProperty(type)){var cbObj={userSet:userSet,disabled:disabled,elem:inp,value:tagName=="select"?inp.options[inp.selectedIndex].value:inp.value};for(var i=0,func;func=callbacks[type][i];i++){func.call(inp,cbObj)}}}else{if(type.match(/^(blur|focus|change)$/i)){var e;if(typeof (document.createEvent)!="undefined"){e=document.createEvent("HTMLEvents");e.initEvent(type,true,true);inp.dispatchEvent(e)}else{if(typeof (document.createEventObject)!="undefined"){try{e=document.createEventObject();inp.fireEvent("on"+type.toLowerCase(),e)}catch(err){}}}}}}function onFocus(e){addClass(innerWrapper,"fd-slider-focused");if(varSetRules.onfocus){userSet=true;valueToPixels(getWorkingValueFromInput())}if(mouseWheelEnabled){addEvent(window,"DOMMouseScroll",trackMouseWheel);addEvent(document,"mousewheel",trackMouseWheel);if(!isOpera){addEvent(window,"mousewheel",trackMouseWheel)}}callback("focus");return true}function onBlur(e){removeClass(innerWrapper,"fd-slider-focused");if(mouseWheelEnabled){removeEvent(document,"mousewheel",trackMouseWheel);removeEvent(window,"DOMMouseScroll",trackMouseWheel);if(!isOpera){removeEvent(window,"mousewheel",trackMouseWheel)}}kbEnabled=true;callback("blur")}function trackMouseWheel(e){if(!kbEnabled){return }e=e||window.event;var delta=0,value;if(e.wheelDelta){delta=e.wheelDelta/120;if(isOpera&&window.opera.version()<9.2){delta=-delta}}else{if(e.detail){delta=-e.detail/3}}if(vertical){delta=-delta}if(delta){value=getWorkingValueFromInput();value+=(delta<0)?-step:step;userSet=true;valueToPixels(getValidValue(value))}preventDefault(e)}function onKeyPress(e){e=e||window.event;if((e.keyCode>=33&&e.keyCode<=40)||!kbEnabled||e.keyCode==45||e.keyCode==46){return stopEvent(e)}return true}function onKeyDown(e){if(!kbEnabled){return true}e=e||window.event;var kc=e.keyCode!==null?e.keyCode:e.charCode,value;if(kc<33||(kc>40&&(kc!=45&&kc!=46))){return true}value=getWorkingValueFromInput();if(kc==37||kc==40||kc==46||kc==34){value-=(e.ctrlKey||kc==34?+maxStep:+step)}else{if(kc==39||kc==38||kc==45||kc==33){value+=(e.ctrlKey||kc==33?+maxStep:+step)}else{if(kc==35){value=rMax}else{if(kc==36){value=rMin}}}}userSet=true;valueToPixels(getValidValue(value));callback("update");preventDefault(e)}function onMouseOver(e){addClass(innerWrapper,"fd-slider-hover")}function onMouseOut(e){removeClass(innerWrapper,"fd-slider-hover")}function onMouseDown(e){e=e||window.event;preventDefault(e);var targ;if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ&&targ.nodeType==3){targ=targ.parentNode}if(e.touches){if(e.targetTouches&&e.targetTouches.length!=1){return false}e=e.touches[0];touchEvents=true}clearTimeout(timer);timer=null;kbEnabled=false;userSet=true;if(targ.className.search("fd-slider-handle")!=-1){mousePos=vertical?e.clientY:e.clientX;handlePos=parseInt(vertical?handle.offsetTop:handle.offsetLeft)||0;trackMouse(e);if(!touchEvents){addEvent(document,"mousemove",trackMouse);addEvent(document,"mouseup",stopDrag)}else{addEvent(document,"touchmove",trackMouse);addEvent(document,"touchend",stopDrag);removeEvent(outerWrapper,"mousedown",onMouseDown)}addClass(innerWrapper,"fd-slider-active");addClass(document.body,"fd-slider-drag-"+(vertical?"vertical":"horizontal"));callback("dragstart")}else{locate();var posx=0;if(e.pageX||e.pageY){posx=vertical?e.pageY:e.pageX}else{if(e.clientX||e.clientY){posx=vertical?e.clientY+document.body.scrollTop+document.documentElement.scrollTop:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft}}posx-=vertical?y+Math.round(handle.offsetHeight/2):x+Math.round(handle.offsetWidth/2);posx=snapToPxValue(posx);if(animation=="tween"){addClass(innerWrapper,"fd-slider-active");tweenTo(posx)}else{if(animation=="timed"){addClass(innerWrapper,"fd-slider-active");addEvent(document,touchEvents?"touchend":"mouseup",onDocMouseUp);destPos=posx;onTimer()}else{pixelsToValue(posx)}}}return false}function onDocMouseUp(e){e=e||window.event;preventDefault(e);removeEvent(document,touchEvents?"touchend":"mouseup",onDocMouseUp);removeClass(innerWrapper,"fd-slider-active");clearTimeout(timer);timer=null;kbEnabled=true;return false}function stopDrag(e){e=e||window.event;preventDefault(e);if(touchEvents){removeEvent(document,"touchmove",trackMouse);removeEvent(document,"touchend",stopDrag)}else{removeEvent(document,"mousemove",trackMouse);removeEvent(document,"mouseup",stopDrag)}kbEnabled=true;removeClass(document.body,"fd-slider-drag-"+(vertical?"vertical":"horizontal"));removeClass(innerWrapper,"fd-slider-active");callback("dragend");return false}function trackMouse(e){e=e||window.event;preventDefault(e);if(e.touches){if(e.targetTouches&&e.targetTouches.length!=1){return false}e=e.touches[0]}pixelsToValue(snapToPxValue(handlePos+(vertical?e.clientY-mousePos:e.clientX-mousePos)));return false}function increment(inc){var value=getWorkingValueFromInput();userSet=true;value+=inc*step;valueToPixels(getValidValue(value))}function locate(){var curleft=0,curtop=0,obj=outerWrapper;try{do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}catch(err){}x=curleft;y=curtop}function onTimer(){var xtmp=parseInt(vertical?handle.offsetTop:handle.offsetLeft,10);xtmp=Math.round((destPos<xtmp)?Math.max(destPos,Math.floor(xtmp-stepPx)):Math.min(destPos,Math.ceil(xtmp+stepPx)));pixelsToValue(snapToPxValue(xtmp));if(xtmp!=destPos){timer=setTimeout(onTimer,steps>20?50:100)}else{kbEnabled=true;removeClass(innerWrapper,"fd-slider-active");callback("finalise")}}var tween=function(){frame++;var c=tweenC,d=20,t=frame,b=tweenB,x=Math.ceil((t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b);pixelsToValue(t==d?tweenX:x);if(t!=d){callback("move");timer=setTimeout(tween,20)}else{clearTimeout(timer);timer=null;kbEnabled=true;removeClass(innerWrapper,"fd-slider-focused");removeClass(innerWrapper,"fd-slider-active");callback("finalise")}};function tweenTo(tx){kbEnabled=false;tweenX=parseInt(tx,10);tweenB=parseInt(vertical?handle.offsetTop:handle.offsetLeft,10);tweenC=tweenX-tweenB;tweenD=20;frame=0;if(!timer){timer=setTimeout(tween,20)}}function checkValue(value){if(isNaN(value)||value===""||typeof value=="undefined"){userSet=false;return defaultVal}else{if(value<Math.min(rMin,rMax)){userSet=false;return Math.min(rMin,rMax)}else{if(value>Math.max(rMin,rMax)){userSet=false;return Math.max(rMin,rMax)}}}userSet=true;return value}function getWorkingValueFromInput(){return getValidValue(tagName=="input"?parseFloat(inp.value):inp.selectedIndex)}function getValidValue(value){return(isNaN(value)||value===""||typeof value=="undefined")?defaultVal:Math.min(Math.max(value,Math.min(rMin,rMax)),Math.max(rMin,rMax))}function pixelsToValue(px){var val=getValidValue(scale?percentToValue(pixelsToPercent(px)):vertical?max-(Math.round(px/stepPx)*step):min+(Math.round(px/stepPx)*step));handle.style[vertical?"top":"left"]=(px||0)+"px";redrawRange();setInputValue((tagName=="select"||step==1)?Math.round(val):val)}function valueToPixels(val,updateInputValue){var clearVal=false,value;if((typeof val==="undefined"||isNaN(val)||val==="")&&tagName=="input"&&!forceValue){value=defaultVal;clearVal=true;userSet=false}else{value=checkValue(val)}handle.style[vertical?"top":"left"]=(scale?percentToPixels(valueToPercent(value)):vertical?Math.round(((max-value)/step)*stepPx):Math.round(((value-min)/step)*stepPx))+"px";redrawRange();if(typeof updateInputValue!==false){setInputValue(clearVal?"":value)}}function snapToPxValue(px){if(scale){return Math.max(Math.min(rMaxPx,px),rMinPx)}else{var rem=px%stepPx;if(rem&&rem>=(stepPx/2)){px+=(stepPx-rem)}else{px-=rem}if(px<Math.min(Math.abs(rMinPx),Math.abs(rMaxPx))){px=Math.min(Math.abs(rMinPx),Math.abs(rMaxPx))}else{if(px>Math.max(Math.abs(rMinPx),Math.abs(rMaxPx))){px=Math.max(Math.abs(rMinPx),Math.abs(rMaxPx))}}return Math.min(Math.max(px,0),rMaxPx)}}function percentToValue(pct){var st=0,fr=min,value;for(var s in scale){if(!scale.hasOwnProperty(s)){continue}if(pct>=st&&pct<=+s){value=fr+((pct-st)*(+scale[s]-fr))/(+s-st)}st=+s;fr=+scale[s]}return value}function valueToPercent(value){var st=0,fr=min,pct=0;for(var s in scale){if(!scale.hasOwnProperty(s)){continue}if(value>=fr&&value<=+scale[s]){pct=st+(value-fr)*(+s-st)/(+scale[s]-fr)}st=+s;fr=+scale[s]}return pct}function percentToPixels(percent){return((outerWrapper[vertical?"offsetHeight":"offsetWidth"]-handle[vertical?"offsetHeight":"offsetWidth"])/100)*percent}function pixelsToPercent(pixels){return pixels/((outerWrapper[vertical?"offsetHeight":"offsetWidth"]-outerWrapper[handle?"offsetHeight":"offsetWidth"])/100)}function setInputValue(val){callback("update");if(!userSet){addClass(innerWrapper,"fd-slider-no-value")}else{removeClass(innerWrapper,"fd-slider-no-value")}if(tagName=="select"){try{val=parseInt(val,10);if(inp.selectedIndex===val){updateAriaValues();return }inp.options[val].selected=true}catch(err){}}else{if(val!==""&&!userInput){val=(min+(Math.round((val-min)/step)*step)).toFixed(precision)}if(inp.value===val){updateAriaValues();return }inp.value=val}updateAriaValues();callback("change")}function checkInputValue(value){return !(isNaN(value)||value===""||value<Math.min(rMin,rMax)||value>Math.max(rMin,rMax))}function setSliderRange(newMin,newMax){if(rMin>rMax){newMin=Math.min(min,Math.max(newMin,newMax));newMax=Math.max(max,Math.min(newMin,newMax));rMin=Math.max(newMin,newMax);rMax=Math.min(newMin,newMax)}else{newMin=Math.max(min,Math.min(newMin,newMax));newMax=Math.min(max,Math.max(newMin,newMax));rMin=Math.min(newMin,newMax);rMax=Math.max(newMin,newMax)}if(defaultVal<Math.min(rMin,rMax)){defaultVal=Math.min(rMin,rMax)}else{if(defaultVal>Math.max(rMin,rMax)){defaultVal=Math.max(rMin,rMax)}}handle.setAttribute("aria-valuemin",rMin);handle.setAttribute("aria-valuemax",rMax);checkValue(tagName=="input"?parseFloat(inp.value):inp.selectedIndex);redraw()}function redrawRange(){if(noRangeBar){return }if(vertical){rangeBar.style.height=Math.max(1,(bar.offsetHeight-handle.offsetTop))+"px"}else{rangeBar.style.width=Math.max(1,handle.offsetLeft)+"px"}}function findLabel(){var label=false,labelList=document.getElementsByTagName("label");for(var i=0,lbl;lbl=labelList[i];i++){if((lbl.htmlFor&&lbl.htmlFor==inp.id)||(lbl.getAttribute("for")==inp.id)){label=lbl;break}}if(label&&!label.id){label.id=inp.id+"_label"}return label}function updateAriaValues(){var val=tagName=="select"?inp.options[inp.selectedIndex].value:inp.value,valTxt=ariaFormat?ariaFormat(val):tagName=="select"?(inp.options[inp.selectedIndex].text?inp.options[inp.selectedIndex].text:val):val;handle.setAttribute("aria-valuenow",val);handle.setAttribute("aria-valuetext",valTxt)}function onInputChange(e){userSet=true;userInput=userSnap;valueToPixels(tagName=="input"?parseFloat(inp.value):inp.selectedIndex);updateAriaValues();userInput=false}function onReset(e){if(tagName=="input"){inp.value=inp.defaultValue}else{inp.selectedIndex=resetDef}checkValue(tagName=="select"?inp.options[inp.selectedIndex].value:inp.value);redraw();updateAriaValues()}function valueSet(tf){userSet=!!tf}function setTabIndex(e,i){e.setAttribute(!
/*@cc_on!@*/
false?"tabIndex":"tabindex",i);e.tabIndex=i}(function(){if(html5Shim||hideInput){addClass(inp,"fd-form-element-hidden")}else{addEvent(inp,"change",onInputChange)}if(html5Shim){inp.stepUp=function(n){increment(n||1)};inp.stepDown=function(n){increment(n||-1)}}outerWrapper=document.createElement("span");outerWrapper.className="fd-slider"+(vertical?"-vertical ":" ")+classNames;outerWrapper.id="fd-slider-"+inp.id;if(vertical&&inpHeight){outerWrapper.style.height=inpHeight+"px"}innerWrapper=document.createElement("span");innerWrapper.className="fd-slider-wrapper"+(!html5Shim?" fd-slider-no-value":"");ieBlur=document.createElement("span");ieBlur.className="fd-slider-inner";bar=document.createElement("span");bar.className="fd-slider-bar";if(fullARIA){handle=document.createElement("span")}else{handle=document.createElement("a");handle.setAttribute("href","#");addEvent(handle,"click",stopEvent)}setTabIndex(handle,0);handle.className="fd-slider-handle";handle.appendChild(document.createTextNode(String.fromCharCode(160)));innerWrapper.appendChild(ieBlur);if(!noRangeBar){rangeBar=document.createElement("span");rangeBar.className="fd-slider-range";innerWrapper.appendChild(rangeBar)}innerWrapper.appendChild(bar);innerWrapper.appendChild(handle);outerWrapper.appendChild(innerWrapper);inp.parentNode.insertBefore(outerWrapper,inp);if(isOpera||
/*@cc_on!@*/
!true){handle.unselectable="on";bar.unselectable="on";ieBlur.unselectable="on";outerWrapper.unselectable="on";innerWrapper.unselectable="on";if(!noRangeBar){rangeBar.unselectable="on"}}outerWrapper.setAttribute("role","application");handle.setAttribute("role","slider");handle.setAttribute("aria-valuemin",tagName=="select"?inp.options[0].value:min);handle.setAttribute("aria-valuemax",tagName=="select"?inp.options[inp.options.length-1].value:max);var lbl=findLabel();if(lbl){handle.setAttribute("aria-labelledby",lbl.id);handle.id="fd-slider-handle-"+inp.id;
/*@cc_on@*/
/*@if(@_win32)
                lbl.setAttribute("htmlFor", handle.id);
                @else @*/
lbl.setAttribute("for",handle.id);
/*@end@*/
}if(document.getElementById(describedBy)){handle.setAttribute("aria-describedby",describedBy)}if(inp.getAttribute("disabled")==true||inp.getAttribute("disabled")=="disabled"){disableSlider(true)}else{enableSlider(true)}if(varSetRules.onvalue){userSet=true;checkValue(tagName=="input"?parseFloat(inp.value):inp.selectedIndex)}if(inp.form){addEvent(inp.form,"reset",onReset)}updateAriaValues();callback("create");redraw()})();return{onResize:function(e){if(outerWrapper.offsetHeight!=sliderH||outerWrapper.offsetWidth!=sliderW){redraw()}},destroy:function(){destroySlider()},reset:function(){valueToPixels(tagName=="input"?parseFloat(inp.value):inp.selectedIndex)},stepUp:function(n){increment(Math.abs(n)||1)},stepDown:function(n){increment(-Math.abs(n)||-1)},increment:function(n){increment(n)},disable:function(){disableSlider()},enable:function(){enableSlider()},setRange:function(mi,mx){setSliderRange(mi,mx)},getValueSet:function(){return !!userSet},setValueSet:function(tf){valueSet(tf)},checkValue:function(){if(varSetRules.onvalue){userSet=true;checkValue(tagName=="input"?parseFloat(inp.value):inp.selectedIndex)}updateAriaValues();redraw()}}}addEvent(window,"load",init);addEvent(window,"load",function(){setTimeout(function(){var slider;for(slider in sliders){sliders[slider].checkValue()}},0)});addEvent(window,"resize",resize);addEvent(window,"unload",unload);(function(){var scriptFiles=document.getElementsByTagName("script"),scriptInner=String(scriptFiles[scriptFiles.length-1].innerHTML).replace(/[\n\r\s\t]+/g," ").replace(/^\s+/,"").replace(/\s+$/,""),json=parseJSON(scriptInner);if(typeof json==="object"&&!("err" in json)){affectJSON(json)}})();
/*@cc_on@*/
/*@if (@_jscript_version < 9)
    addClass(document.documentElement, "oldie");
    /*@end@*/
return{rescanDocument:init,createSlider:function(opts){return createSlider(opts)},onDomReady:function(){onDomReady()},destroyAll:function(){destroyAllsliders()},destroySlider:function(id){return destroySingleSlider(id)},redrawAll:function(){resize()},addEvent:addEvent,removeEvent:removeEvent,stopEvent:stopEvent,increment:function(id,numSteps){if(!sliderExists(id)){return false}sliders[id].increment(numSteps)},stepUp:function(id,n){if(!sliderExists(id)){return false}sliders[id].stepUp(Math.abs(n)||1)},stepDown:function(id,n){if(!sliderExists(id)){return false}sliders[id].stepDown(-Math.abs(n)||-1)},setRange:function(id,newMin,newMax){if(!sliderExists(id)){return false}sliders[id].setRange(newMin,newMax)},updateSlider:function(id){if(!sliderExists(id)){return false}sliders[id].onResize();sliders[id].reset()},disable:function(id){if(!sliderExists(id)){return false}sliders[id].disable()},enable:function(id){if(!sliderExists(id)){return false}sliders[id].enable()},getValueSet:function(){return getValueSet()},setValueSet:function(a,tf){if(!sliderExists(id)){return false}setValueSet(a,tf)},setGlobalVariables:function(json){affectJSON(json)},removeOnload:function(){removeOnLoadEvent()}}})();;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:fd-slider', location = '/static/lib/fdslider-AMD.js' */
define("fd-slider",["util/deprecation"],function(B){var A=window.fdSlider.updateSlider;var C=window.fdSlider.onDomReady;B.obj(window.fdSlider,"fdSlider",null,"3.7","4.0");window.fdSlider._deprecatedUpdateSlider=A;window.fdSlider._deprecatedOnDomReady=C;return window.fdSlider});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:resemblejs', location = '/static/bower/resemblejs/resemble.js' */
(function(G){var I=1;var H={red:255,green:0,blue:255,alpha:255};function F(K,J){return(Math.abs(K.r-J.r)+Math.abs(K.g-J.g)+Math.abs(K.b-J.b))/3}var E={flat:function(K,J){return{r:H.red,g:H.green,b:H.blue,a:H.alpha}},movement:function(K,J){return{r:((J.r*(H.red/255))+H.red)/2,g:((J.g*(H.green/255))+H.green)/2,b:((J.b*(H.blue/255))+H.blue)/2,a:J.a}},flatDifferenceIntensity:function(K,J){return{r:H.red,g:H.green,b:H.blue,a:F(K,J)}},movementDifferenceIntensity:function(L,K){var J=F(L,K)/255*0.8;return{r:((1-J)*(K.r*(H.red/255))+J*H.red),g:((1-J)*(K.g*(H.green/255))+J*H.green),b:((1-J)*(K.b*(H.blue/255))+J*H.blue),a:K.a}}};var A=E.flat;var C=1200;var B=/^https?:\/\//;var D=new RegExp("^https?://"+document.domain);G.resemble=function(l){var n={};var W=[];var T=[];var f={red:16,green:16,blue:16,alpha:16,minBrightness:16,maxBrightness:240};var Z=false;var Y=false;function O(){var o=T.length;var p;for(p=0;p<o;p++){if(typeof T[p]==="function"){T[p](n)}}}function j(o,s,r){var q,p;for(q=0;q<o;q++){for(p=0;p<s;p++){r(q,p)}}}function b(s,v,q){var p=0;var r=0;var u=0;var t=0;var o=0;j(q,v,function(x,AC){var AB=(x*v+AC)*4;var AA=s[AB];var y=s[AB+1];var w=s[AB+2];var z=L(AA,y,w);p++;r+=AA/255*100;u+=y/255*100;t+=w/255*100;o+=z/255*100});n.red=Math.floor(r/p);n.green=Math.floor(u/p);n.blue=Math.floor(t/p);n.brightness=Math.floor(o/p);O()}function e(q,r){var p;var o=new Image();if(B.test(q)&&!D.test(q)){o.setAttribute("crossorigin","anonymous")}o.onload=function(){var u=document.createElement("canvas");var v;var t=o.width;var s=o.height;u.width=t;u.height=s;u.getContext("2d").drawImage(o,0,0,t,s);v=u.getContext("2d").getImageData(0,0,t,s);W.push(v);r(v,t,s)};if(typeof q==="string"){o.src=q;if(o.complete){o.onload()}}else{if(typeof q.data!=="undefined"&&typeof q.width==="number"&&typeof q.height==="number"){W.push(q);r(q,q.width,q.height)}else{p=new FileReader();p.onload=function(s){o.src=s.target.result};p.readAsDataURL(q)}}}function g(p,o,q){var r=Math.abs(p-o);if(typeof p==="undefined"){return false}if(typeof o==="undefined"){return false}if(p===o){return true}else{if(r<f[q]){return true}else{return false}}}function X(o){return !isNaN(parseFloat(o))}function c(p,o){var r=g(p.a,o.a,"alpha");var q=g(p.brightness,o.brightness,"minBrightness");return q&&r}function L(q,p,o){return 0.3*q+0.59*p+0.11*o}function k(r,p){var s=r.r===p.r;var q=r.g===p.g;var o=r.b===p.b;return s&&q&&o}function V(r,p){var t=g(r.r,p.r,"red");var q=g(r.g,p.g,"green");var o=g(r.b,p.b,"blue");var s=g(r.a,p.a,"alpha");return t&&q&&o&&s}function S(p,o){return Math.abs(p.brightness-o.brightness)>f.maxBrightness}function d(u,t,p){u=u/255;t=t/255;p=p/255;var o=Math.max(u,t,p),q=Math.min(u,t,p);var s;var v;if(o==q){s=0}else{v=o-q;switch(o){case u:s=(t-p)/v+(t<p?6:0);break;case t:s=(p-u)/v+2;break;case p:s=(u-t)/v+4;break}s/=6}return s}function K(o,u,w,v,y,q){var s;var z;var p=1;var t;var r;var AB=0;var AA=0;var x=0;h(o);for(t=p*-1;t<=p;t++){for(r=p*-1;r<=p;r++){if(t===0&&r===0){}else{s=((v+r)*q+(y+t))*4;z=R(u,s,w);if(z===null){continue}M(z);h(z);if(S(o,z)){AB++}if(k(o,z)){x++}if(Math.abs(z.h-o.h)>0.3){AA++}if(AA>1||AB>1){return true}}}}if(x<2){return true}return false}function i(p,r,o,s){var q=A(o,s);p[r]=q.r;p[r+1]=q.g;p[r+2]=q.b;p[r+3]=q.a}function a(o,q,p){o[q]=p.r;o[q+1]=p.g;o[q+2]=p.b;o[q+3]=p.a*I}function N(o,q,p){o[q]=p.brightness;o[q+1]=p.brightness;o[q+2]=p.brightness;o[q+3]=p.a*I}function R(u,w,q){var t;var s;var o;var v;var p;t=u[w];if(typeof t!=="undefined"){s=u[w+1];o=u[w+2];p=u[w+3];v={r:t,g:s,b:o,a:p};return v}else{return null}}function M(o){o.brightness=L(o.r,o.g,o.b)}function h(o){o.h=d(o.r,o.g,o.b)}function J(v,u,q,AA){var y=document.createElement("canvas");var w=v.data;var t=u.data;y.width=q;y.height=AA;var r=y.getContext("2d");var p=r.createImageData(q,AA);var x=p.data;var o=0;var s=Date.now();var z;if(!!C&&Z&&(q>C||AA>C)){z=6}j(AA,q,function(AB,AF){if(z){if(AB%z===0||AF%z===0){return }}var AD=(AB*q+AF)*4;var AE=R(w,AD,1);var AC=R(t,AD,2);if(AE===null||AC===null){return }if(Y){M(AE);M(AC);if(c(AE,AC)){N(x,AD,AC)}else{i(x,AD,AE,AC);o++}return }if(V(AE,AC)){a(x,AD,AE,AC)}else{if(Z&&(M(AE),M(AC),K(AE,w,1,AB,AF,q)||K(AC,t,2,AB,AF,q))){if(c(AE,AC)){N(x,AD,AC)}else{i(x,AD,AE,AC);o++}}else{i(x,AD,AE,AC);o++}}});n.misMatchPercentage=(o/(AA*q)*100).toFixed(2);n.analysisTime=Date.now()-s;n.getImageDataUrl=function(AC){var AB=0;if(AC){AB=Q(AC,r,y)}r.putImageData(p,0,AB);return y.toDataURL("image/png")}}function Q(t,o,s){var q=2;o.font="12px sans-serif";var r=o.measureText(t).width+q*2;var p=22;if(r>s.width){s.width=r}s.height+=p;o.fillStyle="#666";o.fillRect(0,0,s.width,p-4);o.fillStyle="#fff";o.fillRect(0,p-4,s.width,4);o.fillStyle="#fff";o.textBaseline="top";o.font="12px sans-serif";o.fillText(t,q,1);return p}function P(p,o,r){var s;var q;if(p.height<r||p.width<o){s=document.createElement("canvas");s.width=o;s.height=r;q=s.getContext("2d");q.putImageData(p,0,0);return q.getImageData(0,0,o,r)}return p}function m(p,o){function q(){var s;var r;if(W.length===2){s=W[0].width>W[1].width?W[0].width:W[1].width;r=W[0].height>W[1].height?W[0].height:W[1].height;if((W[0].width===W[1].width)&&(W[0].height===W[1].height)){n.isSameDimensions=true}else{n.isSameDimensions=false}n.dimensionDifference={width:W[0].width-W[1].width,height:W[0].height-W[1].height};J(P(W[0],s,r),P(W[1],s,r),s,r);O()}}W=[];e(p,q);e(o,q)}function U(r){var q,p=typeof r==="function";if(!p){q=r}var o={ignoreNothing:function(){f.red=16;f.green=16;f.blue=16;f.alpha=16;f.minBrightness=16;f.maxBrightness=240;Z=false;Y=false;if(p){r()}return o},ignoreAntialiasing:function(){f.red=32;f.green=32;f.blue=32;f.alpha=32;f.minBrightness=64;f.maxBrightness=96;Z=true;Y=false;if(p){r()}return o},ignoreColors:function(){f.alpha=16;f.minBrightness=16;f.maxBrightness=240;Z=false;Y=true;if(p){r()}return o},repaint:function(){if(p){r()}return o},onComplete:function(t){T.push(t);var s=function(){m(l,q)};s();return U(s)}};return o}return{onComplete:function(o){T.push(o);e(l,function(r,q,p){b(r.data,q,p)})},compareTo:function(o){return U(o)}}};G.resemble.outputSettings=function(J){var K;var L;if(J.errorColor){for(K in J.errorColor){H[K]=J.errorColor[K]===L?H[K]:J.errorColor[K]}}if(J.errorType&&E[J.errorType]){A=E[J.errorType]}I=isNaN(Number(J.transparency))?I:J.transparency;if(J.largeImageThreshold!==L){C=J.largeImageThreshold}return this}}(this));;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:resemblejs', location = '/static/lib/resemblejs/resemble-AMD.js' */
define("resemble",function(){return resemble});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:image-differ', location = '/static/bower/image-differ/lib/image-differ.js' */
define("image-differ",["eevee","fd-slider","imagesloaded","jquery","resemble"],function(K,C,E,D,H){function B(L){this._$container=L}B.modes={TWO_UP:"two-up",BLEND:"blend",SPLIT:"split",PIXEL_DIFF:"pixeldiff"};Object.freeze&&Object.freeze(B.modes);B.prototype.init=function(){var M=this;var O;var L;var N=this._$imgs=this._$container.find("img");this._$sinceImg=N.eq(0);this._$untilImg=N.eq(1);this._$untilRevision=this._$untilImg.parent();this._$sinceRevision=this._$sinceImg.parent();this._$revisions=this._$untilRevision.add(this._$sinceRevision);this._$untilRevisionLabel=M._$untilRevision.find("h5");this._$sinceRevisionLabel=M._$sinceRevision.find("h5");M.setMode(B.modes.TWO_UP);var P=D.Deferred();N.imagesLoaded().always(function(){var Q=A(M._$sinceImg).done(function(S){O=S});var R=A(M._$untilImg).done(function(S){L=S});D.when(Q,R).done(function(){var T=(O.width===L.width)&&(O.height===L.height);var S=T&&O.width>0;P.resolve(S)}).fail(function(){P.reject()})});return P};B.prototype.destroy=function(){this._cleanOldMode(this._mode);this._mode=null};B.prototype.setMode=function(L){if(this._mode!==L){this._onDiffModeChanged(L,this._mode);this._mode=L}};function I(M,L){M.onchange=L;M.oninput=L}function F(L){L.onchange=null;L.oninput=null}function A(M){if(M.data("natural-size")){return D.Deferred().resolve(M.data("natural-size"))}if(M[0].naturalWidth){var L={width:M[0].naturalWidth,height:M[0].naturalHeight};M.data("natural-size",L);return D.Deferred().resolve(L)}var O=new Image(),Q=D.Deferred(),N=false,P=function(){if(!N){var R={width:O.width,height:O.height};M.data("natural-size",R);Q.resolve(R);N=true}};O.onload=P;O.src=M[0].src;if(O.complete){P()}return Q}B.prototype._cleanOldMode=function(L){switch(L){case B.modes.TWO_UP:this._cleanTwoUpDiff();break;case B.modes.BLEND:this._cleanBlendDiff();break;case B.modes.SPLIT:this._cleanSplitDiff();break;case B.modes.PIXEL_DIFF:this._cleanPixelDiff();break}};B.prototype._onDiffModeChanged=function(M,L){this._$container.removeClass("two-up blend split pixeldiff").addClass(M);this._cleanOldMode(L);switch(M){case B.modes.TWO_UP:this._setupTwoUpDiff();break;case B.modes.BLEND:this._setupBlendDiff();break;case B.modes.SPLIT:this._setupSplitDiff();break;case B.modes.PIXEL_DIFF:this._setupPixelDiff();break}K.trigger("imageDiffer.modeChanged",null,M,L)};B.prototype._cleanTwoUpDiff=D.noop;B.prototype._setupTwoUpDiff=D.noop;B.prototype._cleanBlendDiff=function(){var L=this._$container.children(".opacity-slider-container");var M=L.find("input");L.remove();this._$untilImg.css("opacity","");F(M[0])};B.prototype._setupBlendDiff=function(){var L=this;var M=D('<input type="range" min="0" max="1" step="0.01" value="1" />');this._$container.children(".image-diff-toolbar").after(D('<div class="opacity-slider-container" />').append(M));if(C._deprecatedOnDomReady){C._deprecatedOnDomReady()}else{C.onDomReady()}I(M[0],function(){L._$untilImg.css("opacity",parseFloat(D(this).val()))})};B.prototype._cleanSplitDiff=function(){this._$imgs.css("width","").css("height","");this._$revisions.css("width","");this._$untilRevision.css("margin-left","");this._$untilRevisionLabel.add(this._$sinceRevisionLabel).css("margin-left","").css("margin-right","");this._$untilImg.unwrap();this._$untilRevisionImageContainer.remove();delete this._$untilRevisionImageContainer;this._$revisions.unwrap();this._$splitContainer.remove();delete this._$splitContainer;if(this._onResize){K.off("window.resize.debounced",this._onResize);delete this._onResize}};function J(L,M){var N=L.data("margin_border_padding");if(N==null){N=L.outerWidth(true)-L.width();L.data("margin_border_padding",N)}return M-N}B.prototype._setSplitDiffElementProperties=function(T,N,L){var P=J(this._$container,this._$container.parent().width());var M=J(N,P);var O=J(this._$sinceRevision,M);var R=J(this._$sinceImg,O);var Q=Math.min(L.width,R);this._$imgs.width(Q);this._$imgs.height(Math.floor((Q/L.width)*L.height));T.height(this._$imgs.outerHeight(true));var S=Q+(O-R);this._$revisions.width(S);this._$untilRevision.css("margin-left",-S)};B.prototype._setupSplitDiff=function(){var L=this;return A(this._$imgs).done(function(N){L._$untilImg.wrap('<div class="image-container" />');L._$revisions.wrapAll('<div class="split-container" />');L._$untilRevisionImageContainer=L._$untilImg.parent();L._$splitContainer=L._$container.find(".split-container");var M;L._onResize=function(){L._setSplitDiffElementProperties(L._$untilRevisionImageContainer,L._$splitContainer,N);M=L._$sinceImg.outerWidth(true)};L._onResize();K.on("window.resize.debounced",L._onResize);if(N.width<50){L._$untilRevisionLabel.css("margin-left","-50px");L._$sinceRevisionLabel.css("margin-right","-50px")}else{if(N.width<100){L._$untilRevisionLabel.css("margin-left",-N.width);L._$sinceRevisionLabel.css("margin-right",-N.width)}}var O;L._$splitContainer.on("mouseenter",function(){O=L._$untilRevision.offset();L._$revisions.on("mousemove",P)});L._$splitContainer.on("mouseleave",function(){L._$revisions.off("mousemove",P)});var P=function(Q){L._$untilRevisionImageContainer.css("width",Math.min(Q.pageX-O.left,M))}})};B.prototype._cleanPixelDiff=function(){if(this._$pixelDiffImg){this._$pixelDiffImg.remove()}this._$revisions.unwrap();this._$pixelDiffContainer.remove();delete this._$pixelDiffContainer};B.prototype._setupPixelDiff=function(){var L=this;L._$revisions.wrapAll('<div class="pixeldiff-container" />');L._$pixelDiffContainer=L._$container.find(".pixeldiff-container");if(L._$pixelDiffImg){L._$pixelDiffContainer.append(L._$pixelDiffImg);return }var M=D("<div class='spinner' />");L._$pixelDiffContainer.append(M);M.spin("large");_.defer(function(){var N=G(L._$sinceImg);var O=G(L._$untilImg);D.when(N,O).done(function(P,Q){H.outputSettings({errorColor:{red:208,green:68,blue:55},errorType:"flat",transparency:0.1});H(P).compareTo(Q).onComplete(function(R){M.remove();L._$pixelDiffImg=D("<div />").addClass("pixeldiff binary").append(D("<img />").attr("src",R.getImageDataUrl()));L._$pixelDiffContainer.append(L._$pixelDiffImg)})}).fail(function(){M.remove()})})};function G(N){var M=document.createElement("canvas");var L=M.getContext("2d");return A(N).then(function(O){M.height=O.height;M.width=O.width;L.drawImage(N[0],0,0);return L.getImageData(0,0,M.width,M.height)})}return B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:binary-diff-view', location = '/static/feature/file-content/binary-diff-view/binary-diff-view.js' */
define("feature/file-content/binary-diff-view",["aui","image-diff-toolbar","image-differ","jquery","util/deprecation","util/events","model/file-change","feature/file-content/binary-view"],function(I,D,B,E,H,J,F,C){function G(L,K){this._init(L,K)}G.prototype.isDiffingImages=function(){return this._isDiffingImages};G.prototype._init=function(Q,N){var K=new F(N.fileChange).getCommitRange();var M=K.getUntilRevision();var O=K.getSinceRevision();this._$container=E(stash.feature.fileContent.binaryView.container()).appendTo(N.$container);var L=A(Q.source,O);var R=A(Q.destination,M);this._renderBinaryDiff(L,R).done(function(){N.$container.addClass("fully-loaded")});var P={containerEl:this._$container.get(0),sourcePath:Q.source,sourceType:L&&L.type,sinceRevision:O&&O.toJSON(),destinationPath:Q.destination,destinationType:R&&R.type,untilRevision:M&&M.toJSON()};H.triggerDeprecated("stash.feature.fileContent.onBinaryDiffShown",null,P,"stash.feature.fileContent.binaryDiffShown","3.3","4.0");J.trigger("stash.feature.fileContent.binaryDiffShown",null,P);J.on("imageDiffer.modeChanged",function(T,S){H.triggerDeprecated("stash.feature.fileContent.imageDiffer.modeChanged",null,T,S,"imageDiffer.modeChanged","3.4","4.0")})};function A(L,K){if(L&&K){return C.getRenderedBinary(L,K.getId())}}G.prototype._renderBinaryDiff=function(L,M){var N=this._isDiffingImages=L&&M&&L.type===M.type&&L.type==="image";if(N){this._toolbar=new D(E(imageDiffer.imageDiffToolbar.main()).appendTo(this._$container));this._differ=new B(this._$container)}if(L){E(stash.feature.fileContent.binaryView.cell({extraClasses:"since-revision",titleText:"Old"})).append(L.$elem).appendTo(this._$container)}if(M){E(stash.feature.fileContent.binaryView.cell({extraClasses:"until-revision",titleText:"New"})).append(M.$elem).appendTo(this._$container)}if(N){var K=this;this._toolbar.on("modeChanged",function(O){K._differ.setMode(O)});return this._differ.init().done(function(O){if(K._toolbar){K._toolbar.init(O)}})}return E.Deferred().resolve()};G.prototype.destroy=function(){if(this._toolbar){this._toolbar.destroy();this._toolbar=null}if(this._differ){this._differ.destroy();this._differ=null}if(this._$container){this._$container.remove();this._$container=null}};return G});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-line-info', location = '/static/feature/file-content/diff-line-info.js' */
define("feature/file-content/diff-line-info",["lodash","util/deprecation","feature/file-content/diff-view-segment-types","exports"],function(D,H,G,C){var B={ADDED:"destination",REMOVED:"source",CONTEXT:"source"};function A(O,I,J,M,L,N,K){this.lineType=O;this.lineNumber=I;this.line=J;this.segment=M;this.hunk=L;this.diff=N;this.handles={FROM:null,TO:null,all:[]};this.attributes=K}A.prototype._setHandle=function(I,J){this.handles[I]=J;this.handles.all.push(J);this.handles.all=D.uniq(this.handles.all)};function E(N,L,K,I){var M=N[K-1];var O=N[K+1];if(L.type!==G.CONTEXT){return null}var P=0;var J=L.lines.length;if(M&&(M.type===G.ADDED||M.type===G.REMOVED)){P=I}if(O&&(O.type===G.ADDED||O.type===G.REMOVED)){J=J-I}if(J>P){return{start:P-1,end:J}}return null}function F(J,I){return D.chain(J.hunks).map(function(K){return D.map(K.segments,function(N,M){var L=E(K.segments,N,M,I.relevantContextLines);return{hunk:K,segment:N,expandedRange:L}})}).flatten().map(function(L){var K=L.segment;return D.map(K.lines,function(N,P){var Q=K.type;var M=N[B[K.type]];N.lineType=Q;N.lineNumber=M;H.prop(N,"lineType","info.line.lineType","info.lineType","3.4","4.0");H.prop(N,"lineNumber","info.line.lineNumber","info.lineNumber","3.4","4.0");var O={expanded:L.expandedRange&&P<L.expandedRange.end&&P>L.expandedRange.start};return new A(Q,M,N,K,L.hunk,J,O)})}).flatten().value()}C.convertToLineInfos=F});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:array-util', location = '/static/util/array.js' */
define("util/array",["lodash","util/function","exports"],function(D,F,A){function C(G){return function(I){for(var H=0;H<I.length;H++){if(G(I[H],H,I)){return H}}return -1}}function E(G){return function(I){var H=C(G)(I);return H===-1?[]:I.slice(H)}}function B(G){return function(I){var H=C(G)(I);return H===-1?I:I.slice(0,H)}}A.findIndex=C;A.skipUntil=E;A.skipWhile=D.compose(E,F.not);A.takeUntil=B;A.takeWhile=D.compose(B,F.not)});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:object-util', location = '/static/util/object.js' */
define("util/object",["lodash","exports"],function(F,D){function C(G){return G}var E=Object.prototype.hasOwnProperty;function B(G){if(typeof G==="object"){return JSON.stringify(G)}else{return String(G)}}D.uniqueFromArray=function(M,J,H){var G;var I;var L=J.length;var K=H?B:C;return F.uniq(M,function(N){for(G=0,I="";G<L;G++){I+=K(N[J[G]])}return I})};D.freeze=Object.freeze||C;D.deepFreeze=!Object.freeze?C:function A(J,G){if(J!==null&&typeof J==="object"){var I=Object.isFrozen(J);if(!I){Object.freeze(J)}if(!I||G){for(var H in J){if(E.call(J,H)){A(J[H])}}}}return J}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:mixin-util', location = '/static/util/mixin.js' */
define("util/mixin",["lodash"],function(A){function B(){var C=[].slice.call(arguments);return{into:function(D){return A.extend.apply(A,[D].concat(C))}}}return B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:widget-util', location = '/static/util/widget.js' */
define("util/widget",["lodash","util/mixin"],function(C,E){function B(H,G){if(!H._listeners){H._listeners={}}if(!H._listeners[G]){H._listeners[G]=[]}return H._listeners[G]}var D={on:function(G,I){var H=B(this,G);if(!C.contains(H,I)){H.push(I)}return this},off:function(G,J){var I=B(this,G);var H=I.length;while(H--){if(I[H]===J||I[H]._handler===J){I.splice(H,1)}}return this},once:function(H,I){var G=this.off.bind(this,H,I);G._handler=I;this.on(H,I);this.on(H,G);return this},trigger:function(H){var J=B(this,H).slice();var I=[].slice.call(arguments,1);var G=this;J.forEach(function(K){try{K.apply(G,I)}catch(L){C.defer(function(){throw L})}});return this}};var A={_init:function(G,H){C.bindAll.apply(C,[this].concat(C.functions(this)));this._options=C.extend({},H||this.constructor&&this.constructor.defaults,G);return this},_addDestroyable:function(G){if(!this._destroyables){this._destroyables=[]}if(C.isFunction(G)){G={destroy:G}}if(!G.destroy){throw new Error("Argument is not destroyable")}this._destroyables.push(G);return this},destroy:function(){if(this._destroyables){C.invoke(this._destroyables,"destroy");this._destroyables=null}if(this.trigger){this.trigger("destroy")}if(this._listeners){this._listeners=null}}};var F=E(D,A).into({});return{mixInto:E(F).into}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:text-view', location = '/static/feature/file-content/text-view/common-modes.js' */
(function(A){if(typeof exports==="object"&&typeof module==="object"){exports.commonModes=A()}else{define("feature/file-content/text-view/common-modes",[],A)}})(function(){return["clike","commonlisp","css","htmlmixed","javascript","markdown","perl","php","python","ruby","sass","shell","sql","vbscript","xml","yaml"]});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:text-view', location = '/static/feature/file-content/text-view/text-view.js' */
define("feature/file-content/text-view",["jquery","lodash","util/determine-language","util/events","util/function","util/object","util/performance","util/widget","feature/file-content/stash-codemirror","feature/file-content/text-view/common-modes","feature/file-content/text-view/text-view-api","feature/file-content/text-view/text-view-scrolling"],function(E,N,J,O,L,D,K,F,B,C,M,H){function G(R,Q){var P=this;M.setupAPI(this);this._init(Q);this._internalLines={ADDED:{},REMOVED:{},CONTEXT:{}};this._editors=[];this._gutters=[];this._$container=R;this._$fileToolbar=this._$container.siblings(".file-toolbar");this._$container.addClass("text-view");this.registerGutter("CodeMirror-linewidget",{weight:0});this._addDestroyable(function(){P._$container.removeClass("text-view");P._editors.forEach(function(S){E(S.getWrapperElement()).remove()});P._editors=null;P._gutters=null;P._$container=null})}F.mixInto(G.prototype);M.mixInto(G.prototype);H.mixInto(G.prototype);G.defaults={focusPoint:0.2};G.prototype.init=function(){O.trigger("stash.feature.fileContent.textViewInitializing",null,this._api,this._options)};function I(Q){var P=Q.view;Q.eachLine(function(R){R.handles.all.forEach(function(S){P.addLineClass(S,"wrap","line")})})}G.prototype.markText=function(P,T,S,R){var Q=this;return P.handles.all.map(function(U){var V=Q._editorForHandle(U);var W=V.getLineNumber(U._handle);return V.markText({line:W+T.lineOffset,ch:T.ch},{line:W+S.lineOffset,ch:S.ch},{className:R.className})})};G.prototype.refresh=function(){N.invoke(this._editors,"refresh");this.trigger("resize")};G.prototype._createEditor=function(P,R){P=P||{};var Q=new B(R&&R.length?R[0]:this._$container[0],E.extend({},P,{autoResizing:this._options.autoResizing,gutters:this._getGutters(P.gutterFilter),value:""}));Q._gutterFilter=P.gutterFilter;this._editors.push(Q);if(!this._$firstEditor){this._$firstEditor=E(Q.getWrapperElement())}return Q};G.prototype._editorForHandle=function(P){throw new Error("TextView implementation must define _editorForHandle.")};G.prototype._editorInnerOffset=function A(){return this._$firstEditor[0].getBoundingClientRect().top-this._$container[0].getBoundingClientRect().top};G.prototype._getChangeAttributes=function(){return{}};G.prototype._getGutters=function(Q){var P=this._gutters;if(Q){P=P.filter(Q)}P=P.sort(function(S,R){return S.weight-R.weight});return N.chain(P).pluck("name").uniq().value()};G.prototype._modify=function(P,T,Q){var R=this;var S=[].slice.call(arguments);N.forEach(Q,function(U){R._internalLines[U.lineType||"CONTEXT"][U.lineNumber]=U});this.operation(function(){R._acceptModification.apply(R,S);R.trigger("internal.acceptedModification",S);var U=E.extend({type:P,linesAdded:Q.length,eachLine:function(W){var X;if(!R._options.asyncDiffModifications){X=function(Y){var Z=E.Deferred();Z.resolve(Y.map(W));return Z}}else{X=K.frameBatchedMap(W,{min:500,initial:200},R.operation.bind(R))}var V=X(Q);R._addDestroyable(V.reject.bind(V));return V.promise()},view:R._api},R._getChangeAttributes.apply(R,S));N.chain(Q).pluck("handles").values().flatten().compact().forEach(D.freeze).value();N.chain(Q).pluck("handle").compact().forEach(D.freeze).value();N.chain(Q).pluck("line").compact().forEach(D.freeze).value();D.deepFreeze(Q,!"refreezeFrozen");D.deepFreeze(U,!"refreezeFrozen");I(U);if(P==="INITIAL"){R.trigger("internal-load",U)}R.trigger("internal-change",U);R.trigger("resize")})};G.prototype._highlight=function(P){if(!this._editors){return }this._editors.forEach(function(Q){Q._highlight(P)})};G.prototype._syntaxHighlighting=function(P,Q,S){var T=J.fromFileInfo({firstLine:Q,path:P});var R;if(T.wrmKey){R=WRM.require("wr!"+T.wrmKey)}else{if(T.builtIn&&C.indexOf(T.mode)===-1){R=WRM.require("wr!com.atlassian.stash.stash-highlight-plugin:"+T.mode)}else{R=E.Deferred().resolve()}}R.done(function(){S.setOption("mode",T.mime)})};G.prototype._whenOpDone=function(P){if(this._opCallbacks){this._opCallbacks.push(P)}else{P()}};return G});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:text-view', location = '/static/feature/file-content/text-view/text-view-api.js' */
define("feature/file-content/text-view/text-view-api",["jquery","lodash","util/array","util/function","util/mixin","util/object","exports"],function(E,K,I,J,L,D,B){function F(M){E(M).addClass("stash-gutter-marker");return M}var H={addLineClass:function(M,N,O){this._editorForHandle(M).addLineClass(M._handle,N,O);return M},addLineWidget:function(M,P,O){var Q=this._editorForHandle(M).addLineWidget(M._handle,P,O);var N=this;N.trigger("widgetAdded");return{clear:function(){Q.clear();N.trigger("widgetCleared")},changed:function(){Q.changed();N.trigger("widgetChanged")}}},getLine:function(M){return M._handle.text},getLineHandle:function(M){if(M&&M.lineNumber==null){var O=E(M);if(!O.is(".line-locator")){O=O.closest(".line").find(".line-locator")}M={fileType:O.attr("data-file-type"),lineType:O.attr("data-line-type"),lineNumber:O.attr("data-line-number")}}var N=M&&this._internalLines[M.lineType||"CONTEXT"][M.lineNumber]&&this._internalLines[M.lineType||"CONTEXT"][M.lineNumber].handles;return N&&(N[M.fileType]||N.all[0])},operation:function(M){if(!this._editors){return }var O=this._editors.reduce(function(Q,P){return P.operation.bind(P,Q)},J.arity(M.bind(null),0));try{if(!this._inOp){this._opCallbacks=[];this._inOp=0}this._inOp++;return O()}finally{this._inOp--;if(!this._inOp){try{J.applyAll(this._opCallbacks)}catch(N){setTimeout(function(){throw N},0)}this._opCallbacks=null}}},registerGutter:function(O,N){N=N||{};if(!this._editors){return }var P={name:O,weight:N.weight||0,fileType:N.fileType};this._gutters.push(P);this._gutters=D.uniqueFromArray(this._gutters,["name","fileType"]).sort(function(R,Q){return R.weight-Q.weight||R.name.localeCompare(Q.name)});var M=this;this._editors.forEach(function(Q){var R=M._getGutters(Q._gutterFilter);if(!K.isEqual(Q.getOption("gutters"),R)){Q.setOption("gutters",R)}})},removeLineClass:function(M,N,O){this._editorForHandle(M).removeLineClass(M._handle,N,O);return M},setGutterMarker:function(M,O,N){this._editorForHandle(M).setGutterMarker(M._handle,O,F(N));return M},addContainerClass:function(M){this._$container.addClass(M);this.refresh()},removeContainerClass:function(M){this._$container.removeClass(M);this.refresh()}};var A=Object.keys(H);var G={destroy:0,load:1,change:1};function C(N){var P={};N._api={};var O={on:function(R,S){if(K.has(G,R)){if(!P[R]){P[R]=[]}var Q=J.arity(S.bind(N._api),G[R]);P[R].push({f:S,wrappedF:Q});N.on(R,Q)}},off:function(Q,S){if(P[Q]){var R=I.findIndex(J.dotEq("f",S))(P[Q]||[]);if(R!==-1){N.off(Q,P[Q][R].wrappedF);P[Q].splice(R,1)}}}};var M=[N].concat(A);K.bindAll.apply(K,M);K.extend(N._api,O,K.pick.apply(K,M))}B.setupAPI=C;B.mixInto=L(H).into});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:text-view', location = '/static/feature/file-content/text-view/request-window-scrolls.js' */
define("feature/file-content/text-view/request-window-scrolls",["bacon","jquery","lodash","util/bacon","util/performance","util/region-scroll-forwarder","util/request-page-scrolling","util/scroll"],function(B,C,H,I,G,E,A,D){function F(K,J){return A().done(function(W){var M=new B.Bus();var a=K._$container.addClass("full-window-scrolling");var N=a.closest(".file-content");var S;var Z=D.fakeScroll(a[0]);var Q=["stash.feature.sidebar.expandEnd","stash.feature.sidebar.collapseEnd","stash.feature.changeset.difftree.collapseAnimationFinished","internal.stash.layout.body.resize"];var P=B.mergeAll(Q.map(I.events).concat(I.getWindowSizeProperty().toEventStream()));var R=P.toProperty();function V(b){return b&&b.hasOwnProperty("width")&&b.hasOwnProperty("height")}K._addDestroyable(W);K._addDestroyable(R.scan(0,function(c,b){return(V(b)&&b)||c}).filter(H.identity).onValue(function(b){S=b.height-K._$fileToolbar.outerHeight();J.resize(K._$container.width(),S)}));var U=G.enqueueCapped(K._whenOpDone.bind(K),function(){if(!K._$container){return }W.refresh()});J.onSizeChange(U);K.on("widgetAdded",U);K.on("widgetChanged",U);K.on("widgetCleared",U);K.on("internal-change",U);if(K._options.commentContext){K._options.commentContext.on("fileCommentsResized",U)}var T=new E(M,[{id:"file-comments-and-messages",getHeight:function(){return K._editorInnerOffset()||0},setScrollTop:function(b){Z(0,b)}},{id:"editors",getHeight:function(){return Infinity},setScrollTop:function(b){J.scroll(null,b)}}]);K._addDestroyable(T);if(K._options.commentContext){K._options.commentContext.on("fileCommentsResized",T.heightsChanged.bind(T))}W.setTarget({scrollSizing:function(){var b=J.scrollSizing();return{height:b.height+K._editorInnerOffset(),clientHeight:b.clientHeight}},offset:function(){return N.offset()},scroll:function(b,c){if(c!=null){M.push({top:c})}}});var L=/Chrome\//.test(window.navigator.userAgent);var Y=/Apple Computer/.test(window.navigator.vendor);var X=1;if(L){X=-0.7}else{if(Y){X=-1/3}}var O=C(window);(L||Y)&&K._$container[0].addEventListener("mousewheel",function(b){if(b.wheelDeltaX&&b.wheelDeltaY){if(Math.abs(b.wheelDeltaX)>Math.abs(b.wheelDeltaY)){var c=J.scrollSizing();J.scroll(c.left-b.wheelDeltaX*X,null)}else{O.scrollTop(O.scrollTop()+b.wheelDeltaY*X)}b.stopImmediatePropagation();b.preventDefault()}},true)})}return F});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:text-view', location = '/static/feature/file-content/text-view/text-view-scrolling.js' */
define("feature/file-content/text-view/text-view-scrolling",["jquery","util/mixin","feature/file-content/text-view/request-window-scrolls"],function(C,B,A){var D={scrollHandleIntoFocus:function(G){var E=this._editorForHandle(G);var F=E.getScrollInfo();var I=F.height>F.clientHeight;var H=I?E.heightAtLine(G._handle.lineNo(),"local"):0;this._scrollToFocusedOffset(H,F,E)},scrollHandleIntoView:function(F){var E=this._editorForHandle(F);if(E.lastLine()===F._handle.lineNo()){E.scrollTo(null,E.heightAtLine(E.lastLine()+1));return }E.scrollIntoView(F._handle.lineNo()+1)},scrollToFileComments:function(G,I){var E=this._editors[0];var F=E.getScrollInfo();var H=C("#page").offset().top;if(I!=null){if(G>H&&(G+I)<(H+F.clientHeight)){return }}this._scrollToFocusedOffset(G-this._editorInnerOffset(),F,E)},scrollToTop:function(){this._scrollToSourcePosition(null,0)},scrollToWidgetOffset:function(G,F,I){var H=this._editorForHandle(G);var M=H.getScrollInfo();var E=M.height>M.clientHeight;var L;if(E){var J=H.heightAtLine(G._handle.lineNo(),"local");L=Math.max(0,J+F);if(I!=null){var K=L-M.top;if(K>=0&&K<M.clientHeight-I){return }}}else{L=0}this._scrollToFocusedOffset(L,M,H)},_requestWindowScrolls:function(E){var F=this;return A(this,E).done(function(G){F._scrollToSourcePosition=function(H,I){G.scroll(H,I!=null?Math.max(0,I+F._editorInnerOffset()):null)}}).fail(function(G){F._scrollToSourcePosition=function(H,I){throw new Error("Not implemented")}})},_scrollToFocusedOffset:function(H,G,F){F.getInputField().blur();var E=G.clientHeight*this._options.focusPoint;this._scrollToSourcePosition(null,H-E)},_scrollToSourcePosition:function(){throw new Error("_scrollToSourcePosition can't be called until _requestWindowScrolls returns.")}};return{mixInto:B(D).into}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:text-view', location = '/static/feature/file-content/text-view/attach-simple-scroll-behavior.js' */
define("feature/file-content/text-view/attach-simple-scroll-behavior",["jquery"],function(A){return function B(C,D,E){if(!D){return A.Deferred().reject()}return C._requestWindowScrolls({scrollSizing:function(){return D.getScrollInfo()},scroll:function(F,G){D.scrollTo(null,G)},resize:function(I,F){var G=E.data("height");var H=E.data("width");if(F!==G){E.height(F);E.data("height",F)}if(I!==H){E.data("width",I)}if(F!==G||I!==H){C.refresh()}},onSizeChange:function(F){C.on("resize",F)}})}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:direction-enum', location = '/static/model/direction.js' */
define("model/direction",function(){var A={UP:"UP",DOWN:"DOWN"};return A});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:region-scroll-forwarder', location = '/static/util/region-scroll-forwarder.js' */
define("util/region-scroll-forwarder",["bacon","jquery","lodash","util/bacon","util/function"],function(D,C,A,F,B){function E(H,N){var L=new D.Bus();N=N.map(function(P){var O=null;return C.extend({},P,{getCachedHeight:function(){if(O==null){O=P.getHeight()}return O},invalidateCache:function(){O=null}})});var G;H.subscribe(function(Q){if(!Q.isInitial()){return }var O=Q.value().top;var R=0;var P;A.forEach(N,function(U){var S=U.getCachedHeight();var T=R+S>=O;if(!P&&T){P=U;U.setScrollTop(O-R)}else{U.setScrollTop(T?0:S)}R+=S})})();var M=H.takeUntil(L).slidingWindow(2,2).map(B.spread(function(O,V){var U=0;var Q;var T=V.top-O.top;var S;var P=0;A.some(N,function(X){var W=X.getCachedHeight();if(!S&&P+W>=V.top){S=X;U=P}if(!Q&&P+W>=O.top){Q=X}P+=W;return S&&Q});if(!S){throw new Error("No forwardee handles "+V.top)}var R={scrollInfo:V,localTop:V.top-U,diff:T,forwardTo:S,previousRegion:Q};return R}));function K(P,O){A.chain(P).filter(function(R,Q,S){return !A.some(S.slice(0,Q),function(T){return R.groupId&&R.groupId===T.groupId})}).forEach(function(Q){Q.setScrollTop(O(Q)==="bottom"?Q.getCachedHeight():0)}).value()}var I=M.onValue(function(R){G=R;var O=R.previousRegion;if(O!==R.forwardTo){var P=F.toArray(F.takeBetween(D.fromArray(N),{start:O,end:R.forwardTo,startInclusive:true,endInclusive:false}));var Q=R.diff>0;K(Q?P.reverse():P,B.constant(Q?"bottom":"top"))}R.forwardTo.setScrollTop(R.localTop)});function J(){A.invoke(N,"invalidateCache");if(G){var O=A.indexOf(N,G.forwardTo);K(A.reject(N,function(P){return P===G.forwardTo||(P.groupId&&P.groupId===G.forwardTo.groupId)}),function(P){return A.indexOf(N,P)<O?"bottom":"top"});G.forwardTo.setScrollTop(Math.min(G.localTop,G.forwardTo.getCachedHeight()))}}return{regionChanges:M.map(".forwardTo").skipDuplicates(),forwardingInfo:M,heightsChanged:J,destroy:function(){I();L.push(true);L.end()}}}return E});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:page-scrolling-manager', location = '/static/layout/page-scrolling-manager.js' */
define("layout/page-scrolling-manager",["aui","bacon","jquery","util/bacon","util/events","util/function","util/region-scroll-forwarder","util/scroll","exports"],function(N,B,H,O,P,M,J,I,G){var D=H(window);function F(){var T=H(window);var g=document.body;var W=H(g);var Z=H("#page");var U=Z[0];var e=H(".aui-sidebar");var R=N.sidebar(e);var X=g.style.height;W.addClass("scrolling-forwarded");var d=new B.Bus();var Y=new B.Bus();var Q=new B.Bus();var c=new B.Bus();var f=c.sampledBy(B.mergeAll(c,Y,B.interval(1000).takeUntil(d),O.getWindowSizeProperty().changes())).filter(function(h){return !!h}).takeUntil(d).map(".offset").map(function(i){var h=Z.offset();return{top:Math.round(i.top-h.top)}}).skipDuplicates(function(i,h){return i.top===h.top}).toProperty();var V=c.sampledBy(B.mergeAll(c,Y)).filter(function(h){return !!h}).takeUntil(d).map(".scrollSizing").skipDuplicates(function(i,h){return i.height===h.height&&i.clientHeight===h.clientHeight}).toProperty();B.combineWith(function(j,i,h){return j.top+Math.max(i.height,i.clientHeight)+(h.height-i.clientHeight)},f,V,O.getWindowSizeProperty()).takeUntil(d).onValue(function(h){W.height(h);P.trigger("internal.stash.layout.body.resize")});var b=I.fakeScroll(U);O.getWindowScrollProperty().takeUntil(d).onValue(function(h){b(h.left,null)});B.combineAsArray(Q,f.sampledBy(Q),V.sampledBy(Q)).map(M.spread(function(h,j,i){return{scrollTop:h.scrollTop!=null?j.top+Math.max(0,Math.min(h.scrollTop,i.height-i.clientHeight)):null}})).onValue(function(h){if(h.scrollTop!=null){T.scrollTop(h.scrollTop)}});function a(i){var h=null;var k=i;c.takeUntil(d).onValue(function(l){k=l});var j=new J(O.getWindowScrollProperty(),[{id:"pre",groupId:"outside",setScrollTop:function(l){if(h===null){h=e.offset().top}b(null,l);R.$wrapper.css("top",Math.max(0,l-h));if(!R.$wrapper.hasClass("aui-is-docked")||l===0){R.reflow()}},getHeight:function(){var m=k.offset().top;var l=Z.offset().top;return m-l}},{id:"in",groupId:"inside",setScrollTop:function(l){k.scroll(null,l)},getHeight:function(){return Infinity}}]);f.takeUntil(d).onValue(j,"heightsChanged");return j}var S=c.onValue(function(h){d.onValue(a(h),"destroy");S()});return{setTarget:function(h){c.push(h)},scroll:function(i,h){Q.push({scrollTop:h})},refresh:function(){Y.push(true)},destroy:function(){W.removeClass("scrolling-forwarded");b(0,0);R.$wrapper.css("top","");g.style.height=X||null;Q.end();d.push(true);d.end();Y.end();c.end()}}}var A=false;var C;var K;function L(){if(A){throw new Error("acceptScrollForwardingRequests has already been called. It must be unregistered before it can be called again.")}A=true;C=null;return function(){if(K){N.log("Scroll control is not yet destroyed. Ongoing scroll requests will be ignored.");K.scrollTo=H.noop;K.destroy()}A=false}}function E(){var Q;if(!A){return H.Deferred().reject({reason:"NOT_ACCEPTING"})}if(K){return H.Deferred().reject({reason:"CONTROL_TAKEN"})}H("#footer").hide();K=F();function R(){D.scrollTop(Math.min(C,Q.offset().top-H("#page").offset().top))}K.setTarget=(function(S){return function T(V){var U=S.apply(this,arguments);Q=V;var W=!K;if(C!=null&&!W){R();C=null}return U}})(K.setTarget);K.destroy=(function(S){return function T(){if(Q){C=D.scrollTop();R()}H("#footer").show();K=null;return S.apply(this,arguments)}})(K.destroy);return H.Deferred().resolve(K)}G.acceptScrollForwardingRequests=L;G._requestScrollControl=E});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:request-page-scrolling', location = '/static/util/request-page-scrolling.js' */
define("util/request-page-scrolling",["layout/page-scrolling-manager"],function(A){return function(){return A._requestScrollControl()}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:ediff', location = '/static/feature/file-content/ediff/ediff.js' */
define("feature/file-content/ediff",["util/html"],function(R){var O=/\w+|\s+|./gim,C=/\n[ \u00a0\t\r]+/mg,U=/\s/m,Q="add",V="delete",I="change",E=R.NodeStream,D=R.NodeType,J=D.OPEN,H=D.CLOSE;function P(Y){var W=[],X;O.lastIndex=0;while(X=O.exec(Y)){W.push({start:X.index,value:X[0],end:O.lastIndex})}return W}function L(W){var Y=W.comparableValue,X;if(typeof Y!=="string"){X=Y=W.value;U.lastIndex=0;if(U.test(X)){if(W.start===0){X="\n"+X}if(X.indexOf("\n")!==-1){Y=X.replace(C,"\n")}}W.comparableValue=Y}return Y}function F(W,c){var Y=[];if(W.length!==0||c.length!==0){var e=A(W,c);if(e.snake){e=e.prev}while(e&&e.prev&&e.prev.j>=0){if(e.snake){throw"bad diffpath: found snake when looking for diff"}var a=e.i;var Z=e.j;e=e.prev;var X=e.i;var f=e.j;var b=a-X;var d=Z-f;Y.unshift({from:X,fromCount:b,to:f,toCount:d,type:(b===0&&Q)||(d===0&&V)||I});if(e.snake){e=e.prev}}}return Y}function A(Y,n){var h=Y.length,m=n.length,c=h+m+1,p=1+2*c,q=(p+1)/2,X=[];X.length=p;X[q+1]=N(0,-1,null);for(var l=0;l<c;l++){for(var e=-l;e<=l;e+=2){var o=q+e,a=o+1,W=o-1,b,g;if((e===-l)||(e!==l&&X[W].i<X[a].i)){g=X[a].i;b=X[a]}else{g=X[W].i+1;b=X[W]}X[W]=null;var f=g-e;var Z=M(g,f,b);while(g<h&&f<m&&(L(Y[g])===L(n[f]))){g++;f++}if(g>Z.i){Z=N(g,f,Z)}X[o]=Z;if(g>=h&&f>=m){return X[o]}}X[q+l-1]=null}throw"could not find a diff path"}function N(X,W,Y){return{i:X,j:W,prev:Y,snake:true}}function M(X,W,Y){return{i:X,j:W,prev:B(Y)}}function B(W){while(W&&W.i!==0&&W.j!==0&&!W.snake){if(!W.prev){return W}W=W.prev}return W}function T(c,Z,W,b,d){for(var a=W;a<W+b;a++){var e=Z.length-1;var Y=Z.length&&Z[e];var X=c[a];if(Y&&Y.end===X.start){Z[e]={start:Y.start,end:X.end,type:Y.type}}else{Z.push({start:X.start,end:X.end,type:d})}}}function S(X,c,W){var d=[],e=[];for(var b=0,Y=W.length,a,Z;b<Y;b++){a=W[b];Z=a.type;if(Z===I||Z===V){T(X,d,a.from,a.fromCount,Z)}if(Z===I||Z===Q){T(c,e,a.to,a.toCount,Z)}}return{originalRegions:d,revisedRegions:e}}function K(W,X){var Y=F(W,X);return S(W,X,Y)}function G(W){this._regions=W.slice(0);this._regionsLength=this._regions.length;this._opened=false;this._nextPosition=0;this._current=undefined}G.prototype=new E();G.prototype.hasNext=function(){return this._opened||this._nextPosition<this._regionsLength};G.prototype.next=function(){if(!this.hasNext()){return null}else{if(this._opened){this._opened=false;return{type:H,textPosition:this._current.end,value:"</span>"}}else{this._opened=true;var W=this._current=this._regions[this._nextPosition];this._nextPosition++;return{type:J,textPosition:W.start,value:'<span class="ediff-'+W.type+'">',close:{type:H,value:"</span>"}}}}};G.prototype.getNextType=function(){return this.hasNext()?(this._opened?H:J):null};G.prototype.getNextTextPosition=function(){return this.hasNext()?(this._opened?this._current.end:this._regions[this._nextPosition].start):null};return{tokenizeString:P,getTokensComparableValue:L,diff:K,DiffRegionNodeStream:G}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:ediff', location = '/static/feature/file-content/ediff/ediff-markers.js' */
define("feature/file-content/ediff/ediff-markers",["bacon","jquery","lodash","util/bacon","util/function","feature/file-content/diff-view-segment-types","feature/file-content/ediff"],function(B,F,O,Q,K,E,A){var C=750;function M(R){return O.pluck(R.lines,"line").join("\n")}function H(R,S){return((R.length<C)&&(S.length<C))}function L(S,T){var R=B.fromBinder(function(U){T.eachLine(U).done(O.partial(U,new B.End()));return F.noop});J(R).onValue(function(U){S.markText(U.line,U.from,U.to,U.options)})}function J(R){function T(U){return U[0].segment}var S=K.dot("0.line.conflictMarker");return Q.split(R,K.dot("segment")).slidingWindow(2,2).filter(K.partialRight(O.every,K.not(S))).filter(K.spread(function(V,U){return T(V).type===E.REMOVED&&T(U).type===E.ADDED})).flatMap(K.spread(function(W,U){function V(Y,Z){return B.fromArray(Z).map(function(a){return O.extend({},a,{line:Y[a.line]})})}var X=D(T(W),T(U));return V(W,X.from).merge(V(U,X.to))}))}function D(X,U){function W(Z){var Y=M(Z);return{text:Y,tokens:A.tokenizeString(Y)}}var R=W(U);var T=W(X);if(!H(R.tokens,T.tokens)){return{to:[],from:[]}}function S(Z,Y){return O.map(Z,O.partial(I,Y.text))}var V=A.diff(T.tokens,R.tokens);return{from:S(V.originalRegions,T),to:S(V.revisedRegions,R)}}function I(S,a){var W=S.slice(0,a.start);var T=S.slice(a.start,a.end);var X=W.lastIndexOf("\n")+1;var U=T.lastIndexOf("\n")+1;var Z=U?U+a.start:X;var V=a.start-X;var R=a.end-Z;var b=W.split("\n").length-1;var Y=T.split("\n").length-1;return{line:b,from:{lineOffset:0,ch:V},to:{lineOffset:Y,ch:R},options:{className:"ediff-"+a.type}}}var G;function P(R){G=O.partial(L,R.diffView);R.diffView.on("internal-change",G);return{destroy:O.partial(N,R.diffView)}}function N(R){R.off("internal-change",G)}return{init:P,_convertLinesToMarkers:J}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-view', location = '/static/feature/file-content/diff-view/diff-view.js' */
(function(){var C=require("util/bacon");var A=C.keyboardEvents("requestSecondaryNext");var B=C.keyboardEvents("requestSecondaryPrevious");define("feature/file-content/diff-view",["jquery","lodash","util/array","util/events","util/function","util/navigator","util/object","model/direction","feature/comments/anchors","feature/file-content/diff-view-options","feature/file-content/diff-view-segment-types","feature/file-content/ediff/ediff-markers","feature/file-content/text-view"],function(c,m,G,U,Z,e,E,b,M,N,g,I,k){var D=g.ADDED;var l=g.REMOVED;var R=g.CONTEXT;function f(n,o){return n.concat(o).sort(function(s,r){var p=m.first(s.lines);var q=m.first(r.lines);var t=m.last(s.lines);var u=m.last(r.lines);return p.destination-q.destination||p.source-q.source||t.destination-u.destination||t.source-u.source})}function P(n){return m.chain(n.hunks).pluck("segments").flatten(true).value()}function X(n){return n&&n.type!==g.CONTEXT}function F(n){return Boolean(n.lines[0].conflictMarker)}var J=c(stash.feature.fileContent.diffView.lineNumber());var Y=c(stash.feature.fileContent.diffView.lineNumberMarker());function Q(o,p){var n=[];p.eachLine(function(v){var s=v.line;var t=v.handles.FROM;var q=v.handles.TO;var u=J.clone();var r=J.clone();u.addClass("line-number-from");r.addClass("line-number-to");u.html(v.lineType!==D?s.source:"&nbsp;");r.html(v.lineType!==l?s.destination:"&nbsp;");n.push([t||q,"line-number-from",u[0]]);n.push([q||t,"line-number-to",r[0]]);v.handles.all.forEach(function(x){var w=Y.clone();w.attr("data-file-type",x.fileType);w.attr("data-line-type",v.lineType);w.attr("data-line-number",v.lineNumber);w.html(x.lineType===D?"+":x.lineType===l?"-":"&nbsp;");n.push([x,"line-number-marker",w[0]])})}).done(function(){o.operation(function(){n.forEach(function(r){o.setGutterMarker.apply(o,r)})});o._$container.addClass("fully-loaded diff-api-ready");var q=V(p);h(o,q);if(p.type==="INITIAL"){j(o,q)}})}var H={};H[D]="added";H[l]="removed";H[R]="context";function L(q,p,o,r){var n=H[q];if(q!==R){n+=" modified"}if(r===true||o===true){n+=" expanded"}n+=(p?" conflict conflict-"+p.toLowerCase():"");n+=o?" new":"";return n}function i(p,q){var n=q.type==="INSERT";var o=[];q.eachLine(function(s){var r=L(s.lineType,s.line.conflictMarker,n,s.attributes.expanded);s.handles.all.forEach(function(t){p.addLineClass(t,"wrap",r);if(n){o.push(t)}})}).done(function(){if(o.length){S(p,o)}})}function S(o,n){setTimeout(function(){if(!o._editor){return }o.operation(function(){m.each(n,function(p,q){o.removeLineClass(p,"wrap","new")})})},1500)}function V(o){var n=c.extend({},o);delete n.fileChange;return E.freeze(n)}function h(n,o){n.trigger("change",o);U.trigger("stash.feature.fileContent.diffViewContentChanged",null,o)}function j(n,o){n.trigger("load",o);U.trigger("stash.feature.fileContent.diffViewContentLoaded",null,o)}function K(o,n){k.call(this,n.$container,n);this._data=o;this._scrollingReady=c.Deferred()}m.extend(K.prototype,k.prototype);K.defaults=k.defaults;K.contentChangeType={INITIAL:"INITIAL",INSERT:"INSERT"};K.prototype.init=function(){k.prototype.init.call(this);var q=this._options.diffViewOptions||N;var o=!e.isIE()||e.majorVersion()>=11;this.registerGutter("line-number-marker",{weight:1000});this._$container.addClass("diff-type-"+this._options.fileChange.type).toggleClass("hide-ediff",q.get("hideEdiff")).toggleClass("animated",o);c("html").toggleClass("no-cssanimations",!o);var p=this._data;var n=this;U.trigger("stash.feature.fileContent.diffViewDataLoaded",null,this._data);this.on("internal-change",m.partial(Q,this));this._addDestroyable(I.init({diffView:this}));this._addDestroyable(U.chainWith(c(window)).on("scroll",function(){if(!n._expectFocusScroll){n._invalidateFocus()}n._expectFocusScroll=false}));this._addDestroyable(U.chainWith(q).on("change",function(r){if(r.key==="hideEdiff"){n._$container.toggleClass("hide-ediff",r.value)}}));this.on("internal.acceptedModification",Z.spread(function(r,t,s){i(this,{type:r,eachLine:function(u){return c.Deferred().resolve(m.map(s,u))}})}));if(this._options.attachScroll){m.defer(function(){n._attachScrollBehavior().then(n._scrollingReady.resolve.bind(n._scrollingReady),n._scrollingReady.reject.bind(n._scrollingReady))})}else{this._scrollingReady.resolve()}this.on("internal-load",function(){n._selectLine(n._options.fileChange.line);var r=n._options.fileChange.search;if(r){n._highlight(r)}});this._addDestroyable(U.chain().on("internal.stash.feature.diffView.lineChange",this._selectLine.bind(this)).on("internal.stash.feature.diffView.highlightSearch",this._highlight.bind(this)));this._addDestroyable(A.onValue(this._scrollToChange.bind(this,b.DOWN)));this._addDestroyable(B.onValue(this._scrollToChange.bind(this,b.UP)))};function T(){throw new Error("DiffView implementation must define this.")}K.prototype._findNextChange=function(p,v,z){var AC=this;var q=false;var y=-1;if(p==null){z=b.DOWN;q=true}for(var r=0,x=v.length;r<x;r++){var u=(z===b.DOWN)?r:x-r-1;var w=v[u];if(q){var t=v[u-1];var AA=X(w)&&!(F(w)&&t&&F(t))&&!(AC._options.combineLinkedSegments&&t&&X(t));if(AA){y=u;break}}else{if(w===p){q=true}}}function s(n){return F(n)||(AC._options.combineLinkedSegments&&X(n))}if(y>-1){var AB=y;var o=y+1;while(o<v.length&&s(v[o])){o++}return v.slice(AB,o)}return null};K.prototype._selectLine=function(o){if(!o){return }var n=this.getLineHandleFromNumber(o.no,o.type);if(n){this.scrollHandleIntoFocus(n);this._markLinesFocused([{editor:this._editorForHandle(n),handles:[n]}])}};K.prototype._scrollToChange=function(q){var p=this._focusedSegments&&this._focusedSegments[0];if(!p){var n=this._$fileToolbar.outerHeight();var r=this._$container[0].getBoundingClientRect().top-n;p=this._getFocusSegment(r)}var o=this._findNextChange(p,this._allSegments,q);if(o){this._setFocusSegment(o);this._expectFocusScroll=true;this._focusedSegments=o}};K.prototype._scrollToComment=function(p){N.set("hideComments",false);var o=m.chain(this._options.commentContext._containers).pluck("anchor").filter(function(q){return q instanceof M.LineAnchor}).uniq(Z.invoke("getId")).value();var n=this._findNextAnchor(p,o,this._focusedComment);if(!n){return }this._expectFocusScroll=true;this._focusedComment=n;if(!n.handle){this._scrollToSourcePosition(null,-this._editorInnerOffset());return }this._highlightCommentForLine(n.handle);this.scrollHandleIntoFocus(n.handle)};K.prototype._invalidateFocus=function(){this._focusedSegments=null;this._focusedComment=null};function W(q,n,o){var r;if(o._line!==undefined){var p=n[o._lineType][o._line].handles;r=p[o._fileType]||p.FROM||p.TO}return{anchor:o,handle:r,offset:r?q.heightAtLine(r._handle.lineNo(),"local"):0}}K.prototype._findNextAnchorInEditor=function(s,o,v,r){if(o.length===0){return null}o=m.sortBy(o,Z.dot("_line"));if(r){var q=G.findIndex(Z.propEqual(m.pick(r.anchor,"_line","_lineType","_fileType")))(o);if(q!==-1){var x=o[q+(v===b.UP?-1:1)];return x&&W(s,this._internalLines,x)}}var n;if(r){n=r.offset}else{var w=this._$fileToolbar.outerHeight();var u=this._$container[0].getBoundingClientRect().top-w;var p=s.getScrollInfo();n=p.top+(this._options.focusPoint*p.clientHeight)-u}var t=o.map(W.bind(null,s,this._internalLines));if(v===b.UP){return m.find(t.reverse(),function(y){return y.offset<n})}else{return m.find(t,function(y){return y.offset>n})}};K.prototype._highlightCommentForLine=function(n){this._markLineCommentsFocused([{editor:this._editorForHandle(n),handles:[n]}])};K.prototype.getLineHandleFromNumber=function(n,o){var p=(o==="TO"?this._internalLines[D][n]:this._internalLines[l][n]);var q=(o==="TO"?"line.destination":"line.source");p=p||m.find(this._internalLines[R],Z.dotEq(q,n));p=p&&p.handles;return p&&(p[o]||p.all[0])};K.prototype._acceptModification=T;K._combineTexts=function(n){return m.chain(n).pluck("line").pluck("line").value().join("\n")};K.prototype._getChangeAttributes=function(n,o){return{diff:o,fileChange:this._options.fileChange}};K.prototype._getLineClasses=L;K.prototype._modifyDiff=function(n,q,p){var o=[].slice.call(arguments,3);this._allSegments=f(this._allSegments||[],P(q));this._modify.apply(this,[n,q,p].concat(o))};function d(r,o,p,q){var n=this;if(!this._currAnimationPromise){this._currAnimationPromise={}}if(this._currAnimationPromise[r]){m.invoke(this._currAnimationPromise[r],"abort")}this._currAnimationPromise[r]=q.map(function(v){var w=v.handles;var y=v.editor;if(!w||!w.length){return c.Deferred().reject().promise({abort:c.noop})}function u(AB,AA){var AC=AB?"addLineClass":"removeLineClass";y.operation(function(){w.forEach(function(AD){y[AC](AD._handle,"wrap",AA)})})}var z=false;var t=c.Deferred();var x=c.Deferred();t.done(x.resolve.bind(x));var s=m.once(function(){y.off("scroll",s);if(z){return }if(n._$container){n._$container.attr("data-last-updated",new Date().getTime())}u(true,o);t.always(u.bind(null,false,o));u(true,r);x.always(u.bind(null,false,r));setTimeout(x.resolve.bind(x),p)});y.on("scroll",s);setTimeout(s,100);return t.promise({abort:function(){z=true;t.resolve()}})})}var a=1000;var O=1000;K.prototype._markLinesFocused=m.partial(d,"line-focused","last-focus",a);K.prototype._markLineCommentsFocused=m.partial(d,"line-comment-focused","last-comment-focus",O);return K})}());;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-view', location = '/static/feature/file-content/diff-view/diff-view.soy' */
// This file was automatically generated from diff-view.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.diffView.
 */

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.diffView == 'undefined') { stash.feature.fileContent.diffView = {}; }


stash.feature.fileContent.diffView.editor = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '<div class="diff-editor' + ((opt_data.editorClass) ? ' ' + soy.$$escapeHtml(opt_data.editorClass) : '') + aui.renderExtraClasses(opt_data) + '"' + aui.renderExtraAttributes(opt_data) + '></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.diffView.editor.soyTemplateName = 'stash.feature.fileContent.diffView.editor';
}


stash.feature.fileContent.diffView.lineNumber = function(opt_data, opt_ignored) {
  return '<div class="line-number"></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.diffView.lineNumber.soyTemplateName = 'stash.feature.fileContent.diffView.lineNumber';
}


stash.feature.fileContent.diffView.lineNumberMarker = function(opt_data, opt_ignored) {
  return '<div class="line-number-marker line-locator" data-file-type="" data-line-type="" data-line-number=""></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.diffView.lineNumberMarker.soyTemplateName = 'stash.feature.fileContent.diffView.lineNumberMarker';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:math', location = '/static/util/math.js' */
define("util/math",["lodash","exports"],function(J,E){function B(M,L){return M*L}function K(M,L){return M+L}function I(M,L){return M<L}function D(M,L){return M>L}function H(L){return function(M){return Math.min(L,M)}}function A(L){return function(M){return Math.max(L,M)}}function F(M,L){return J.compose(A(M),H(L))}function G(L,M){if(!(this instanceof G)){return new G(L,M)}this.x=L;this.y=M}function C(M,L){if(!(this instanceof C)){return new C(M,L)}this.width=M;this.height=L}E.add=K;E.clamp=F;E.greaterThan=D;E.highPass=A;E.lowPass=H;E.lessThan=I;E.multiply=B;E.Point=G;E.Size=C});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-hunk-map', location = '/static/feature/file-content/diff-hunk-map/diff-hunk-map.soy' */
// This file was automatically generated from diff-hunk-map.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; }


stash.feature.fileContent.diffHunkMap = function(opt_data, opt_ignored) {
  return '<div class="diff-hunk-map"></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.diffHunkMap.soyTemplateName = 'stash.feature.fileContent.diffHunkMap';
}


stash.feature.fileContent.diffHunkMapCanvas = function(opt_data, opt_ignored) {
  return '<canvas width="' + soy.$$escapeHtml(opt_data.size.width) + '" height="' + soy.$$escapeHtml(opt_data.size.height) + '"></canvas>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.diffHunkMapCanvas.soyTemplateName = 'stash.feature.fileContent.diffHunkMapCanvas';
}


stash.feature.fileContent.diffHunkMapViewportIndicator = function(opt_data, opt_ignored) {
  return '<div class="viewport-indicator hidden"></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.diffHunkMapViewportIndicator.soyTemplateName = 'stash.feature.fileContent.diffHunkMapViewportIndicator';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-hunk-map', location = '/static/feature/file-content/diff-hunk-map/diff-hunk-map.js' */
define("feature/file-content/diff-hunk-map",["jquery","lodash","util/function","util/math","util/scroll"],function(G,B,C,E,A){var F={CONTEXT:"#ffffff",ADDED:"#97f295",REMOVED:"#ffb6ba",CONFLICT:"#FFF986"};function H(I,K,J){this.init.apply(this,arguments)}H.prototype.init=function(I,K,J){this.regions=K;this.options=G.extend({},J);this.$hunkMap=G(stash.feature.fileContent.diffHunkMap()).appendTo(I);this.hunkMapWidth=this.$hunkMap.width();this.$indicator=G(stash.feature.fileContent.diffHunkMapViewportIndicator()).appendTo(this.$hunkMap);this.indicatorScroll=A.fakeScroll(this.$indicator[0],{withDocument:true});this.addCanvas(E.Size(this.hunkMapWidth,this.$hunkMap.height()));this.redraw();if(typeof this.options.scrollToFn==="function"){this.$hunkMap.on("click",this._hunkMapClicked.bind(this,this.options.scrollToFn))}};H.prototype.setIndicator=function(){var I=this.hunkMapHeight*(this.hunkMapHeight/this.totalHeight);var J=this.hunkMapHeight===0||I===this.hunkMapHeight;this.$indicator.toggleClass("hidden",J);if(J){return }this.$indicator.height(I)};H.prototype.diffScrolled=function(J){var I=J.top/J.height;this.indicatorScroll(0,(I*this.hunkMapHeight))};H.prototype._hunkMapClicked=function(K,J){var I=J.pageY-this.$hunkMap.offset().top;K(I/this.hunkMapHeight)};H.prototype.mapHeights=function(){var J=B.invoke(this.regions,"getHeight");var I=this;this.totalHeight=J.reduce(E.add,0);this.hunkMapHeight=Math.min(this.$hunkMap.height(),this.totalHeight);B.chain(this.regions).zip(J).forEach(C.spread(function(L,K){L.fraction=K/I.totalHeight})).value()};function D(I){if(I._seg.lines[0].conflictMarker){return F.CONFLICT}return F[I._seg.type]||F.CONTEXT}H.prototype.addHunkToMap=function(K,J){if(J.fraction===0){return K}var I=this.getHunkHeight(J);this.setFillStyle(D(J));this.drawHunk(E.Point(0,K),E.Size(this.hunkMapWidth,I));return K+I};H.prototype.getHunkHeight=function(I){return Math.max(I.fraction*this.hunkMapHeight,1)};H.prototype.clear=function(){this.canvasContext.clearRect(0,0,this.hunkMapWidth,this.hunkMapHeight)};H.prototype.draw=function(){this.$canvas.attr("height",this.hunkMapHeight);this.regions.reduce(this.addHunkToMap.bind(this),0);this.setIndicator()};H.prototype.redraw=function(){this.clear();this.mapHeights();this.draw()};H.prototype.addCanvas=function(I){this.$canvas=G(stash.feature.fileContent.diffHunkMapCanvas({size:I})).appendTo(this.$hunkMap);this.canvasContext=this.$canvas[0].getContext("2d")};H.prototype.setFillStyle=function(I){this.canvasContext.fillStyle=I};H.prototype.drawHunk=function(I,J){this.canvasContext.fillRect(I.x,I.y,J.width,J.height)};H.prototype.destroy=function(){this.$hunkMap.remove()};return H});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:line-handle', location = '/static/feature/file-content/line-handle.js' */
define("feature/file-content/line-handle",function(){function A(C,E,B,D){this.fileType=C;this.lineType=E;this.lineNumber=B;this._handle=D;D._stashHandle=this}return A});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:synchronized-scroll', location = '/static/util/synchronized-scroll.js' */
define("util/synchronized-scroll",["lodash","util/function","util/math","util/performance","model/direction","exports"],function(X,P,J,Q,A,Y){var O=P.spread(J.multiply);function H(a,b){return X.chain(X.zip(a,b)).map(O).reduce(J.add,0).value()}function S(a){if(a instanceof S){return a}if(!(this instanceof S)){return new S(a)}this._el=a;this._programmatic=false;return this}S.prototype.getScrollInfo=function(){return{top:this._el.scrollTop,left:this._el.scrollLeft,width:this._el.scrollWidth,height:this._el.scrollHeight,clientWidth:this._el.clientWidth,clientHeight:this._el.clientHeight}};S.prototype.scrollTo=function(a,b){if(b!=null){this._programmatic=true;this._el.scrollTop=b}if(a!=null){this._programmatic=true;this._el.scrollLeft=a}};S.prototype.getAndUnsetProgrammaticScrollMarker=function(){var a=this._programmatic;this._programmatic=false;return a};function D(b,a){if(!(this instanceof D)){return new D(b,a)}this._el=a;this._parentScrollable=b;if(!this._parentScrollable._el){throw new Error("Regions can't (yet) be created for custom Scrollables. We would need to solve the API problem of where to put a function to get the offset relative to the top of the scrollable.")}return this}D.prototype.getHeight=function(){return this._el.offsetHeight};D.prototype.getOffsetTop=function(){return this._el.getBoundingClientRect().top-this._parentScrollable._el.getBoundingClientRect().top};function R(a,b){return b}function B(a,b){return a.scrollHeight-a.clientHeight-b}var T=P.dot("scrollTop");function Z(a){return a.scrollHeight-a.clientHeight-a.scrollTop}function G(b,c,s,i,r,l){var q=(c.scrollTop!==b.scrollTop);var j=(c.scrollLeft!==b.scrollLeft);s=X.filter(s,function(w){return(q&&w.canScrollVertically)||(j&&w.canScrollHorizontally)});if(!s.length){return[]}if(!q){return X.map(s,function(w){return L(w,null,c.scrollLeft)})}var p=c.scrollTop>b.scrollTop?A.DOWN:A.UP;var u=s.concat(c);var k=X.filter(u,P.dot("canScrollVertically"));var g=P.binary(Math.max);function v(w,x){return X.chain(w).pluck(x).reduce(g,0).value()}var d=v(k,"topness")*(p===A.UP?1:0);var f=v(k,"bottomness")*(p===A.UP?0:1);var t=U(d*d,f*f,p);var o=t[0];var a=t[1];var e=t[2];var h=o>0?V(l,c,s,i,r):[];var m=a>0?X.map(s,p===A.UP?M(b,c,T,R):W(b,c,T,R)):[];var n=e>0?X.map(s,p===A.DOWN?M(b,c,Z,B):W(b,c,Z,B)):[];return X.chain(s).zip(X.zip(h,m,n)).map(P.spread(function(w,y){var AB=w.scrollLeft!==c.scrollLeft;if(!w.canScrollVertically){return L(w,null,AB&&w.canScrollHorizontally?c.scrollLeft:null)}var AA=y.map(P.defaultValue(0)).map(J.clamp(0,w.scrollHeight));var AC=H(AA,t);var z=AC-w.scrollTop;var x=0<(p===A.UP?-1:1)*z;if(!x&&!AB){return null}return L(w,x?AC:null,AB?c.scrollLeft:null)})).filter(X.identity).value()}function U(e,a,d){var c=Math.max(e,a);var b=Math.min(e,a);var f=(1-c)/(1+b);var h=(1-c)*b/(1+b);var g=e>a||(e===a&&d===A.UP);return[f,g?c:h,g?h:c]}function L(a,b,c){return{scrollable:a.scrollable,scrollTop:b,scrollLeft:c}}function M(a,d,g,f){var b=1;var c=Math.max(g(a),b);var e=(c-g(d))/c;return function(j){var h=Math.max(g(j),b);var i=h-e*h;if(i<1){i=0}return f(j,i)}}function W(a,c,f,d){var b=f(a);var e=f(c)-b;return function(h){var g=f(h)+e;return d(h,g)}}function V(i,j,f,a,e){var b=j.clientHeight*i;var h=a(j.scrollable);var d=N(b,h);var c=f.map(function(k){if(!k.canScrollVertically){return null}return K(e(d.region,k.scrollable))});var g=F(b,d);return X.zip(c,f).map(P.spread(function(m,k){if(!k.canScrollVertically){return null}var l=k.clientHeight*i;var o=I(l,g,m);var n=k.scrollTop;return Math.max(0,n+m.offsetTop-o)}))}function F(d,b){var a=b.offsetTop+b.height;var c=(a-d)/b.height;return Math.max(0,Math.min(1,c))}function I(c,b,a){return(b*a.height)+c-a.height}function N(b,c){var a;X.some(c,function(g){var f=K(g);var e=f.offsetTop;var d=f.height;if(b>e&&b<=e+d){a=f;return true}return false});return a}function K(a){return{region:a,offsetTop:a.getOffsetTop(),height:a.getHeight()}}function C(b){var c=b.getScrollInfo();c={scrollable:b,clientWidth:c.clientWidth,clientHeight:c.clientHeight,scrollWidth:c.width,scrollHeight:c.height,scrollTop:c.top,scrollLeft:c.left,canScrollHorizontally:c.clientWidth<c.width,canScrollVertically:c.clientHeight<c.height};var a=c.clientHeight/2;c.topness=a?Math.max(0,(a-c.scrollTop)/a):0;c.bottomness=a?Math.max(0,1-(c.scrollHeight-(c.scrollTop+c.clientHeight))/a):0;return c}function E(c){c=X.extend({},Y.getScrollHandler.defaults,c);var e=C(c.self);var d;var b=Q.enqueueCapped(requestAnimationFrame,function a(){var g=C(c.self);var h=X.map(c.others,C);var f=G(d,g,h,c.getRegions,c.getLinkedRegion,c.focusHeightFraction);e=g;if(f.length){c.executeCommands(f)}});return{handle:function(){if(c.self.getAndUnsetProgrammaticScrollMarker()){e=C(c.self);return }d=e;b()},reset:function(){e=C(c.self)}}}Y.createScrollable=S;Y.createRegion=D;Y.getScrollHandler=E;Y.getScrollHandler.defaults={self:null,others:null,getRegions:null,getLinkedRegion:null,focusHeightFraction:0.5,executeCommands:function(a){X.forEach(a,function(b){b.scrollable.scrollTo(b.scrollLeft,b.scrollTop)})}}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:svg-util', location = '/static/util/svg.js' */
define("util/svg",["lodash","exports"],function(B,A){var E="http://www.w3.org/2000/svg";function D(G,F){var H=document.createElementNS(E,G);B.forEach(F||[],function(J,I){H.setAttribute(I,J)});return H}function C(){this._buffer=[]}C.prototype.moveTo=function(F,G){this._buffer.push("M",F,G);return this};C.prototype.curve=function(I,K,G,J,F,H){this._buffer.push("C",I,K,G,J,F,H);return this};C.prototype.lineTo=function(F,G){this._buffer.push("L",F,G);return this};C.prototype.close=function(){this._buffer.push("Z");return this};C.prototype.build=function(){return this._buffer.join(" ")};A.svgNS=E;A.createElement=D;A.PathBuilder=C});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:side-by-side-diff-view', location = '/static/feature/file-content/side-by-side-diff-view/side-by-side-diff-view.soy' */
// This file was automatically generated from side-by-side-diff-view.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.sideBySideDiffView.
 */

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.sideBySideDiffView == 'undefined') { stash.feature.fileContent.sideBySideDiffView = {}; }


stash.feature.fileContent.sideBySideDiffView.layout = function(opt_data, opt_ignored) {
  return stash.feature.fileContent.diffView.editor({editorClass: 'side-by-side-diff-editor-from'}) + '<div class="segment-connector-column" ></div>' + stash.feature.fileContent.diffView.editor({editorClass: 'side-by-side-diff-editor-to'});
};
if (goog.DEBUG) {
  stash.feature.fileContent.sideBySideDiffView.layout.soyTemplateName = 'stash.feature.fileContent.sideBySideDiffView.layout';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:side-by-side-diff-view', location = '/static/feature/file-content/side-by-side-diff-view/synchronized-scroll.js' */
define("feature/file-content/side-by-side-diff-view/synchronized-scroll",["jquery","lodash","util/events","util/function","util/math","util/synchronized-scroll","feature/file-content/diff-view-segment-types","exports"],function(E,K,N,H,I,C,A,D){function P(T){var W=null;var S=0;var U=0;var V=0;var R=[];function Q(){if(W){W.end=S;W.from.end=U;W.to.end=V;R.push(W)}}K.forEach(T,function(X){if(!W||X.segment!==W.segment){Q();W={segment:X.segment,lineInfos:[],start:S,end:-1,from:{start:U,end:-1,lineInfos:[]},to:{start:V,end:-1,lineInfos:[]}}}S++;W.lineInfos.push(X);if(X.segment.type!==A.ADDED){U++;W.from.lineInfos.push(X)}if(X.segment.type!==A.REMOVED){V++;W.to.lineInfos.push(X)}});Q();return R}function M(R,Q){this._id=R;this._editor=Q;this._programmatic=false}M.prototype.getScrollInfo=function(){return this._editor.getScrollInfo()};M.prototype.scrollTo=function(Q,R){this._programmatic=this._programmatic||Q!=null||R!=null;this._editor.scrollTo(Q,R)};M.prototype.getAndUnsetProgrammaticScrollMarker=function(){var Q=this._programmatic;this._programmatic=false;return Q};function G(R,U,T,V,S,Q){this._editor=R;this._startIndex=U;this._endIndex=T;this._numLines=T-U;this._id=V;this._seg=S;this._cachedInfo=null;this._lineInfos=Q}G.prototype.getHeight=function(){return this._getCachedInfo().height};G.prototype.getOffsetTop=function(){return this._getCachedInfo().offsetTop-this._editor.getScrollInfo().top};G.prototype._getCachedInfo=function(){if(!this._cachedInfo){this._cachedInfo={height:0,offsetTop:this._editor.heightAtLine(this._startIndex,"local")};if(!this._numLines){return this._cachedInfo}var Q=this._editor.heightAtLine(this._endIndex,"local");this._cachedInfo.height=Q-this._cachedInfo.offsetTop}return this._cachedInfo};G.prototype._invalidateCache=function(){this._cachedInfo=null};function L(T,S){var Q,U,R;return{_linkedRegions:T,_seg:T[0]._seg,_id:"combined_"+K.pluck(T,"_id").join("_"),_scrollable:R,_setCombinedScrollable:function(V){R=V;this._scrollable=V},getHeight:function(){if(Q==null){Q=T.map(function(V){return V.getHeight()}).reduce(H.binary(Math.max),0)}return Q},_getOffset:function(){if(U==null){U=S()}return U},getOffsetTop:function(){return this._getOffset()-R._getScrollTop()},_invalidateCache:function(){Q=null;U=null}}}function J(Q,Y){this._id=Q;var U=H.constant(0);Y=E.extend({initialScrollTop:0,getClientHeight:U,getScrollHeight:U},Y);var V=false;var T=Y.initialScrollTop;var S;var X=E.Callbacks();this._getScrollTop=function W(){return I.clamp(0,Y.getScrollHeight()-Y.getClientHeight())(T)};function R(Z){T=I.clamp(0,Y.getScrollHeight()-Y.getClientHeight())(Z)}this.scrollToNative=function(Z,a){if(a!=null){R(a);if(S){S()}X.fire(Z,a,"native")}};this._setScrollHandler=function(Z){S=Z};this.getScrollInfo=function(){return{top:this._getScrollTop(),left:0,height:Y.getScrollHeight(),width:0,clientHeight:Y.getClientHeight(),clientWidth:0}};this.scrollTo=function(Z,a){if(a!=null){V=true;R(a);X.fire(Z,a,"sync")}};this.on=function(a,Z){if(a==="scroll"){X.add(Z)}};this.getAndUnsetProgrammaticScrollMarker=function(){var Z=V;V=false;return Z}}function O(W,V,S,Z,T){var U=[];var X=[];function h(k,i,m,j,l){return new G(k,i.start,i.end,l+"_"+i.start+"_"+i.end,m,j)}function d(k,l){var j=h(S,k.from,k.segment,k.from.lineInfos,"from");var i=h(Z,l.to,l.segment,l.to.lineInfos,"to");U.push(j);X.push(i)}var g=P(V);var f=K.reduce(g,function(j,i){if(j&&i.segment.type===A.ADDED){d(j,i);return null}if(j){d(j,j)}if(i.segment.type===A.REMOVED){return i}d(i,i);return null},null);if(f){d(f,f)}var e=K.zip(U,X);var a=K.compose(H.partialRight(K.reduce,I.add,0),H.partialRight(K.invoke,"getHeight"),K.take);var Q=T.includeCombinedRegions?K.reduce(e,function(i,j,k){var l=K.partial(a,i,k);i.push(L(j,l));return i},[]):[];var c={};if(Q.length){K.chain(U).zip(X,Q).forEach(H.spread(function(j,i,k){c[j._id]=[i,k];c[i._id]=[j,k];c[k._id]=[j,i]})).value()}else{K.forEach(e,H.spread(function(j,i){c[j._id]=[i];c[i._id]=[j]}))}function Y(i){return K.invoke.bind(K,i,"_invalidateCache")}S.on("change",Y(U.concat(Q)));Z.on("change",Y(X.concat(Q)));var b=Y(U.concat(X,Q));E(window).on("resize",b);W.on("widgetAdded",b);W.on("widgetChanged",b);W.on("widgetCleared",b);W.on("internal.acceptedModification",b);var R=N.chain().on("stash.feature.changeset.difftree.collapseAnimationFinished",b);return{combinedSegments:g,fromRegions:U,toRegions:X,combinedRegions:Q,linkedFromAndToRegions:e,linkedRegionsByRegionId:c,destroy:function(){R.destroy();E(window).off("resize",b)}}}function F(Y,R,U,Q,Z,e){var X={};X[R._id]=Z.fromRegions;X[U._id]=Z.toRegions;if(Q){X[Q._id]=Z.combinedRegions}var d=K.compose(H.lookup(X),H.dot("_id"));var S=K.compose(H.lookup(Z.linkedRegionsByRegionId),H.dot("_id"));function T(h,g){var f=S(h)||[];return K.find(f,H.dotEq("_editor",g._editor))}function a(f){f.scrollable.scrollTo(f.scrollLeft,f.scrollTop)}function W(f){Y.operation(K.forEach.bind(K,f,a));Y.trigger("sync-scroll")}function c(f,i,g){var j;if(g.includeHorizontal){j=W}else{var h=H.partialRight(K.map,H.unary(H.partialRight(K.omit,"scrollLeft")));j=K.compose(W,h)}return C.getScrollHandler({self:f,others:i,getRegions:d,getLinkedRegion:T,executeCommands:j,focusHeightFraction:g.focusHeightFraction})}var b={includeHorizontal:true,focusHeightFraction:e.focusHeightFraction};var V={fromHandler:c(R,K.compact([U,Q]),b),toHandler:c(U,K.compact([R,Q]),b)};if(Q){V.combinedHandler=c(Q,[R,U],{includeHorizontal:false,focusHeightFraction:e.focusHeightFraction})}return V}function B(X,S,Q,c,e){e=e||{};var W=O(X,S,Q,c,{includeCombinedRegions:e.includeCombinedScrollable});var T=new M("from",Q);var U=new M("to",c);var a=0;var R;if(e.includeCombinedScrollable){R=new J("combined",{getScrollHeight:function Z(){return K.chain(W.combinedRegions).invoke("getHeight").reduce(I.add,0).value()},getClientHeight:function b(){return a}})}var V=F(X,T,U,R,W,e);Q.on("scroll",V.fromHandler.handle);c.on("scroll",V.toHandler.handle);var Y={combinedSegments:W.combinedSegments,combinedRegions:W.combinedRegions,combinedScrollable:R,linkedFromAndToRegions:W.linkedFromAndToRegions,destroy:function(){Q.off("scroll",V.fromHandler.handle);c.off("scroll",V.toHandler.handle);W.destroy()}};if(R){R._setScrollHandler(V.combinedHandler.handle);R.setClientHeight=function(f){R.clientHeight=f;a=f;V.combinedHandler.reset()};K.invoke(W.combinedRegions,"_setCombinedScrollable",R);Y.combinedScrollable=R}var d=K.invoke.bind(K,V,"reset");X.on("widgetCleared",d);X.on("widgetChanged",d);X.on("widgetAdded",d);return Y}D.setupScrolling=B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:side-by-side-diff-view', location = '/static/feature/file-content/side-by-side-diff-view/side-by-side-diff-view.js' */
define("feature/file-content/side-by-side-diff-view",["jquery","lodash","util/feature-enabled","util/function","util/math","util/performance","util/svg","model/direction","feature/file-content/diff-hunk-map","feature/file-content/diff-line-info","feature/file-content/diff-view","feature/file-content/diff-view-file-types","feature/file-content/diff-view-segment-types","feature/file-content/line-handle","feature/file-content/side-by-side-diff-view/synchronized-scroll","feature/file-content/stash-codemirror/search"],function(G,Z,C,L,D,O,S,B,E,H,K,F,M,V,J){var X=M.ADDED;var T=M.CONTEXT;var N=M.REMOVED;function P(b,a){a.combineLinkedSegments=true;K.apply(this,arguments)}Z.extend(P.prototype,K.prototype);P.defaults=K.defaults;P.prototype.init=function(){var a=this;if(!this._$container){return }this._$container.addClass("side-by-side-diff");this._$container.append(stash.feature.fileContent.sideBySideDiffView.layout());this.fromEditorEl=this._$container.find(".side-by-side-diff-editor-from");this.toEditorEl=this._$container.find(".side-by-side-diff-editor-to");var b=this._options.commentContext&&this._options.commentContext.getGutterId();if(b){this.registerGutter(b,{weight:100})}this.registerGutter("line-number-from",{weight:200,fileType:F.FROM});this.registerGutter("line-number-to",{weight:200,fileType:F.TO});this._fromEditor=this._createEditor({gutterFilter:function(c){return !c.fileType||c.fileType===F.FROM}},this.fromEditorEl);this._toEditor=this._createEditor({gutterFilter:function(c){return !c.fileType||c.fileType===F.TO}},this.toEditorEl);C.getFromProvider("source.codemirror").then(function(h){if(!h){return }var j=L.dot("hunks.0.segments.0")(a._data);var i=L.dot("hunks.0.segments.0.lines.0.line")(a._data);var g=L.dot("hunks.0.segments.1.lines.0.line")(a._data);var c=j.type===X?g:i;var e=a._options.fileChange.srcPath!==null?a._options.fileChange.srcPath.name:a._options.fileChange.path.name;a._syntaxHighlighting(e,c,a._fromEditor);var f=j.type===N?g:i;var d=a._options.fileChange.path.name;a._syntaxHighlighting(d,f,a._toEditor)});this._lineInfos=H.convertToLineInfos(this._data,this._options);this._scrollingReady.always(function(){a._modifyDiff("INITIAL",a._data,a._lineInfos);a._setupFindScrollIntoViewFunction(a._fromEditor,F.FROM);a._setupFindScrollIntoViewFunction(a._toEditor,F.TO)});this.on("internal-load",function(){if(!this._syncScrollingInfo){return }this.setupHunkmaps(this._syncScrollingInfo.linkedFromAndToRegions);this._initSegmentLinking(this._syncScrollingInfo.linkedFromAndToRegions);this.on("internal-change",function c(){this._whenOpDone(this._scrollEditorToFirstChange.bind(this));this.off("internal-change",c)})});K.prototype.init.call(this)};P.prototype.destroy=function(){K.prototype.destroy.call(this);this._fromEditor=null;this._toEditor=null};P.prototype._acceptModification=function(b,g,d){if(b!=="INITIAL"){throw new Error("Unrecognized change type: "+b)}var c=Z.filter(d,function(h){return h.lineType!==X});var e=Z.filter(d,function(h){return h.lineType!==N});this._fromEditor.setValue(K._combineTexts(c));this._toEditor.setValue(K._combineTexts(e));function f(i,h){return i.segment!==h.segment&&i.lineType===M.CONTEXT&&h.lineType===M.CONTEXT}function a(h,i,j){var k;Z.forEach(h,function(l,m){var n=i.getLineHandle(m);l._setHandle(j,new V(j,l.lineType,l.lineNumber,n));if(k&&f(k,l)){i.addLineClass(n,"wrap","paired-with-change")}k=l})}a(c,this._fromEditor,F.FROM);a(e,this._toEditor,F.TO)};var R={};R[F.FROM]="_fromEditor";R[F.TO]="_toEditor";P.prototype._editorForHandle=function(a){return this[R[a.fileType]]};P.prototype._getFocusSegment=function(c){var a=this._fromEditor.getScrollInfo().clientHeight*this._options.focusPoint;if(c>a){return null}var d=1;var e=a+this._syncScrollingInfo.combinedScrollable._getScrollTop()-c+d;e=Math.ceil(e);var b=Z.find(this._syncScrollingInfo.combinedRegions,function(f){return f._getOffset()<=e&&(f._getOffset()+f.getHeight())>e});return(b||Z.last(this._syncScrollingInfo.combinedRegions))._seg};P.prototype._setFocusSegment=function(c){var f=Z.filter(this._syncScrollingInfo.combinedRegions,function(g){return Z.contains(c,g._seg)});var a=this._fromEditor.getScrollInfo().clientHeight*this._options.focusPoint;this._scrollToSourcePosition(null,f[0]._getOffset()-a);var e=Z.chain(f).pluck("_linkedRegions").flatten().pluck("_lineInfos").flatten().uniq().value();function d(h,g){return Z.compact(h.map(function(i){return i.handles[g]}))}var b=this;this.operation(function(){b._markLinesFocused([{editor:b._fromEditor,handles:d(e,F.FROM)},{editor:b._toEditor,handles:d(e,F.TO)}])})};P.prototype._findNextAnchor=function(f,e,a){var c=Z.groupBy(e,L.dot("_fileType"));var b=c.FROM&&this._findNextAnchorInEditor(this._fromEditor,c.FROM,f,a);var d=c.TO&&this._findNextAnchorInEditor(this._toEditor,c.TO,f,a);if(!b||!d){return b||d||null}else{if((f===B.UP&&d.offset<b.offset)||(f===B.DOWN&&d.offset>=b.offset)){return b}else{return d}}};P.prototype.setupHunkmaps=function(g){var j=this;var e=g.map(Z.first);var b=g.map(Z.last);var d=this._options.focusPoint;function f(r,o,x){var n=r.getScrollInfo();var w=n.height;var q=n.clientHeight;var l=Math.max(0,(w*x)-(q*d));var u=Z.findIndex(o,function(z){var y=n.top+z.getOffsetTop();return y<=l&&y+z.getHeight()>l});var v=o[u];var k=j._syncScrollingInfo.combinedRegions[u];var t=j._syncScrollingInfo.combinedScrollable.getScrollInfo();var s=l-(n.top+v.getOffsetTop());var p=s/v.getHeight();var m=(t.top+k.getOffsetTop())+p*k.getHeight();j._scrollToSourcePosition(0,m)}var a=new E(this.fromEditorEl,e,{scrollToFn:Z.partial(f,this._fromEditor,e)});var h=new E(this.toEditorEl,b,{scrollToFn:Z.partial(f,this._toEditor,b)});var c=[a,h];var i=Z.debounce(Z.invoke.bind(Z,c,"redraw"),100);this._addDestroyable(a);this._addDestroyable(h);this.on("widgetAdded",i);this.on("widgetChanged",i);this.on("widgetCleared",i);this.on("resize",i);this._fromEditor.on("scroll",function(k){a.diffScrolled(k.getScrollInfo())});this._toEditor.on("scroll",function(k){h.diffScrolled(k.getScrollInfo())});this._addDestroyable(function(){j._fromEditor=null;j._toEditor=null})};P.prototype._attachScrollBehavior=function(){var a=this;var h=this._fromEditor;var f=this._toEditor;var e=this._lineInfos;if(!h){return G.Deferred().reject()}var d=J.setupScrolling(this,e,h,f,{includeCombinedScrollable:true,focusHeightFraction:a._options.focusPoint});this._syncScrollingInfo=d;var c=a._$container.children(".diff-editor, .segment-connector-column");var b;var g=this._requestWindowScrolls({scrollSizing:function(){return d.combinedScrollable.getScrollInfo()},scroll:function(i,j){if(j!=null){d.combinedScrollable.scrollToNative(null,j)}},resize:function(j,i){if(b!==i){b=i;d.combinedScrollable.setClientHeight(i);c.height(i);a.refresh()}},onSizeChange:function(i){a.on("resize",i)}});this._addDestroyable(d);return g};P.prototype._initSegmentLinking=function(d){var f=G(".segment-connector-column");var e=S.createElement("svg",{});f.append(e);var a=U.bind(null,A(d),e,this._getLineClasses);var b=O.enqueueCapped(requestAnimationFrame,function b(){e.setAttribute("height",f.height());e.setAttribute("width",f.width());a()});var c=O.enqueueCapped(requestAnimationFrame,a);this.on("sync-scroll",a);this.on("widgetAdded",c);this.on("widgetChanged",c);this.on("widgetCleared",c);this.on("resize",b);b()};P.prototype.scrollHandleIntoFocus=function(c){var d=this._editorForHandle(c);var j=d.getScrollInfo();var i=c.fileType===F.FROM?0:1;if(c.lineType===T&&c.fileType===F.TO){d=this._fromEditor;i=0}var g=Z.findIndex(this._syncScrollingInfo.linkedFromAndToRegions,function(k){return k[i]._startIndex<=c.lineNumber&&k[i]._endIndex>c.lineNumber});var h=this._syncScrollingInfo.linkedFromAndToRegions[g][i];var a=this._syncScrollingInfo.combinedRegions[g];var f=d.heightAtLine(c.lineNumber)-d.heightAtLine(h._startIndex);var e=this._syncScrollingInfo.combinedScrollable.getScrollInfo();var b=(e.top+a.getOffsetTop())+f;this._scrollToFocusedOffset(b,j,d)};P.prototype._setupFindScrollIntoViewFunction=function(c,a){var b=this;c.setOption("scrollLineIntoViewFunc",function(d){b.scrollHandleIntoFocus(b.getLineHandleFromNumber(d.from.line,a))})};function Q(a){return a&&a.type!==M.CONTEXT}function I(a){return Q(a&&a._seg)&&a._numLines>0}function W(a){return Boolean(a.lines[0].conflictMarker)}function Y(a){return a.conflicted||W(a._seg)}P.prototype._scrollEditorToFirstChange=function(){var a=this._findNextChange(null,this._allSegments);if(a){this._setFocusSegment(a)}};function A(c){function b(e){if(!(this instanceof b)){return new b(e)}this._regions=[e];this.conflicted=true;this.classesInfo={lineType:e._seg.type,conflictMarker:e._seg.lines[0].conflictMarker};this.getOffsetTop=function(){return this._regions[0].getOffsetTop()};this.getHeight=function(){return Z.chain(this._regions).invoke("getHeight").reduce(D.add).value()};this.push=function(f){this._regions.push(f)}}return c.reduce(function d(e,g){var h=e.previous;var i=h&&Z.some(h,Y);var f=Z.some(g,Y);if(f&&i){Z.forEach(h,function(j,k){j.push(g[k])});return e}if(f){g=Z.map(g,b)}e.previous=g;e.regions.push(g);return e},{previous:null,regions:[]}).regions.filter(function a(e){return e.some(L.or(I,Y))})}function U(n,s,o){var t;var l=s.offsetHeight||parseFloat((t=window.getComputedStyle(s)).height);var q=s.offsetWidth||parseFloat(t.width);var k=q+1;var j=q*0.4;var f=q*0.6;var i=n.map(function h(v){return v.map(function(x){var y=x.getOffsetTop();var w=y+x.getHeight();return{region:x,top:y+0.5,bottom:w+0.5,above:y<0,inside:w>0&&y<l,below:w>l}})});var m=i.filter(function r(v){return v.some(L.dot("inside"))||(v.some(L.dot("above"))&&v.some(L.dot("below")))});function d(v,w){return new S.PathBuilder().moveTo(-1,v.top).curve(j,v.top,f,w.top,k,w.top).lineTo(k,w.bottom).curve(f,w.bottom,j,v.bottom,-1,v.bottom).close().build()}function u(v,w){if(v.region.classesInfo){return v.region.classesInfo}var y=v.region._lineInfos[0];var x=w.region._lineInfos[0];return y?{conflictMarker:y.line.conflictMarker,lineType:y.lineType}:{conflictMarker:null,lineType:x.lineType}}function c(x,z){var y=u(x,z);var w=u(z,x);var v=o(y.lineType,y.conflictMarker,false)+" "+o(w.lineType,w.conflictMarker,false);return Z.unique(v.split(/\s+/)).join(" ")}var e=m.map(L.spread(function(v,w){return{path:d(v,w),extraClasses:c(v,w)}}));while(s.hasChildNodes()){s.removeChild(s.firstChild)}var p=function(v){return(v.indexOf("added")!==-1)&&(v.indexOf("removed")!==-1)};var b=Z.once(function(w){var v=[{"class":"removed",offset:"0%"},{"class":"removed",offset:"30%"},{"class":"added",offset:"70%"},{"class":"added",offset:"100%"}];v=Z.map(v,S.createElement.bind(S,"stop"));return Z.reduce(v,function(y,x){y.appendChild(x);return y},S.createElement("linearGradient",{id:w}))});var g="added-and-removed-svg-gradient";var a=e.map(function(w){var v={"class":"segment-connector "+w.extraClasses,d:w.path};if(p(w.extraClasses)){v.fill="url(#"+g+")"}return S.createElement("path",v)}).concat(b(g)).reduce(function(w,v){w.appendChild(v);return w},document.createDocumentFragment());s.appendChild(a)}return P});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:skipped-container', location = '/static/feature/file-content/skipped-container/skipped-container.soy' */
// This file was automatically generated from skipped-container.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; }


stash.feature.fileContent.skippedContainer = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '<div class="skipped-container' + aui.renderExtraClasses(opt_data) + '"' + aui.renderExtraAttributes(opt_data) + '>' + ((opt_data.hasContentAbove) ? '<div class="content-above"></div>' : '') + ((opt_data.content) ? soy.$$filterNoAutoescape(opt_data.content) : '') + ((opt_data.canShowMore) ? '<div class="showmore" title="' + soy.$$escapeHtml(opt_data.showMoreTooltip) + '">' + ((opt_data.hasContentAbove && opt_data.hasContentBelow) ? '<span>' + soy.$$escapeHtml("Show more") + '</span>' : '') + '</div>' : '') + ((opt_data.hasContentBelow) ? '<div class="content-below"></div>' : '') + '</div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.skippedContainer.soyTemplateName = 'stash.feature.fileContent.skippedContainer';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-view-context', location = '/static/feature/file-content/diff-view-context/diff-view-context-internal.js' */
define("feature/file-content/diff-view-context/diff-view-context-internal",["jquery","lodash","util/function","model/file-change-types","feature/file-content/diff-view-segment-types","exports"],function(E,I,H,B,A,D){var C={destinationLine:1,destinationSpan:0,sourceLine:1,sourceSpan:0};var G=H.eq(A.ADDED);D.isAdded=G;D.getSeparatedHunkHtml=function(R,N,L){function M(S){switch(S){case B.ADD:return A.ADDED;case B.DELETE:return A.REMOVED;default:return A.CONTEXT}}var K=M(N);var O=G(K);function Q(S){return{line:O?S.destinationLine:S.sourceLine,span:O?S.destinationSpan:S.sourceSpan}}function P(S){return(S.sourceLine+S.sourceSpan)-(S.destinationLine+S.destinationSpan)}return I.map(I.zip([C].concat(R),R.concat({})),function(V){var U=Q(V[0]);var Z=Q(V[1]);var S=Z.line>1;var T=U.span>0;var W=U.line+U.span;var X=Z.line-1;var Y=O?0:P(V[0]);return L(W,X,Y,K,S,T)})};D.fetchContext=function F(R,Q,P,K,N){var L=!isNaN(Q)?Q-R+1:N.maxLimit;function O(T,U,S){return T&&I.extend({},T,{lines:T.lines.slice(U,S)})}var M=function(S){return E.when(R===0?null:S(R,K+(!Q?1:0)),!Q?null:S(R+L-K,K)).then(function(U,T){if(!T){var V=U.lines.length>K;return{startSep:U.start+U.lines.length+(V?-1:0),contexts:V?[O(U,0,-1),null]:[U]}}else{if(!U){return{startSep:0,endSep:T.start,contexts:[null,T]}}else{return{startSep:U.start+K,endSep:T.start,contexts:[U,T]}}}})};if(L<N.maxLimit){return P(R,L).then(function(S){if(L<=K*2){return E.Deferred().resolve({startSep:0,endSep:0,contexts:[S]})}else{return M(function(T){return E.Deferred().resolve({start:T,lines:S.lines})}).then(function(T){return I.extend({},T,{contexts:[O(T.contexts[0],0,K),O(T.contexts[1],-K)]})})}})}else{return M(P)}};D.toHunks=function J(N,K){function L(O){return O+1}return function M(O){var Q=[];I.each(O.contexts,function P(R){if(R){Q.push({segments:[{type:K,lines:I.map(R.lines,function(S){return{line:S.text}})}],sourceLine:L(R.start),destinationLine:L(R.start)-N,isLastPage:R.isLastPage})}});return Q.length?Q:""}}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-view-context', location = '/static/feature/file-content/diff-view-context/diff-view-context.soy' */
// This file was automatically generated from diff-view-context.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; }


stash.feature.fileContent.hunkSeparator = function(opt_data, opt_ignored) {
  return '' + stash.feature.fileContent.skippedContainer({hasContentAbove: opt_data.isAbove, hasContentBelow: opt_data.isBelow, canShowMore: true, showMoreTooltip: opt_data.tooltip, extraAttributes: 'data-line-start="' + soy.$$escapeHtml(opt_data.lineStart) + '"' + ((opt_data.lineEnd) ? ' data-line-end="' + soy.$$escapeHtml(opt_data.lineEnd) + '"' : '') + ' data-dest-offset="' + soy.$$escapeHtml(opt_data.destOffset) + '" data-change-type="' + soy.$$escapeHtml(opt_data.changeType) + '" data-below="' + soy.$$escapeHtml(opt_data.isBelow) + '" data-above="' + soy.$$escapeHtml(opt_data.isAbove) + '"'});
};
if (goog.DEBUG) {
  stash.feature.fileContent.hunkSeparator.soyTemplateName = 'stash.feature.fileContent.hunkSeparator';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-view-context', location = '/static/feature/file-content/diff-view-context/diff-view-context.js' */
define("feature/file-content/diff-view-context",["aui","jquery","lodash","stash/api/util/navbuilder","util/ajax","util/dom-event","util/navigator","model/file-change","feature/file-content/diff-view-context/diff-view-context-internal","exports"],function(L,E,M,A,K,C,J,F,G,D){var N=J.isMac()?"Click to reveal a few more lines\nCmd + Click to reveal them all":"Click to reveal a few more lines\nCtrl + Click to reveal them all";var I=A.parse(location.href).getQueryParamValue("context");var B={maxLimit:J.isIE()?1000:5000,maxContext:(I&&parseInt(I,10))||10};function H(R,S,T,O,P,Q){return(P||Q)?stash.feature.fileContent.hunkSeparator({tooltip:N,lineStart:R,lineEnd:S,destOffset:T,changeType:O,isBelow:P,isAbove:Q}):""}D.attachExpandContext=function(P,O,Q){O=new F(O);return P.on("click",".skipped-container:not(.loading)",function(U){U.preventDefault();var Z=E(U.currentTarget);Z.addClass("loading");Z.find(".showmore span").html("&nbsp;");var R=Z.find(".showmore").spin("small");var Y=Z.data("change-type");function V(c,a){var b=O.getDiff()&&O.getDiff().properties||{};return K.rest({statusCode:{"200":function(g,d,f,e){if(e&&e.message&&e.message.replace(/,/g,"").indexOf(" "+c+" ")>0){return{promise:function(){return{lines:[]}}}}}},url:A.currentRepo().browse().path((O.getSrcPath()&&O.getSrcPath().toString()!=="")?O.getSrcPath():O.getPath()).at(G.isAdded(Y)?b.toHash||O.getCommitRange().getUntilRevision().getId():b.fromHash||O.getCommitRange().getSinceRevision().getId()).withParams({start:c,limit:a}).build()}).then(M.identity).always(function(){R.spinStop()}).fail(function(){Z.removeClass("loading")})}var S=Z.data("dest-offset");var W=C.isCtrlish(U)?B.maxLimit-1:B.maxContext;var X=Z.data("line-start")-1;var T=Z.data("line-end")-1;G.fetchContext(X,T,V,W,B).then(G.toHunks(S,Y)).then(M.bind(Q,null,O,Z))})};D.getSeparatedHunkHtml=function(P,O){return G.getSeparatedHunkHtml(P,O,H)}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:unified-diff-view', location = '/static/feature/file-content/unified-diff-view/unified-diff-view.js' */
define("feature/file-content/unified-diff-view",["jquery","lodash","util/events","util/feature-enabled","util/function","model/file-change-types","feature/file-content/diff-line-info","feature/file-content/diff-view","feature/file-content/diff-view-context","feature/file-content/diff-view-file-types","feature/file-content/diff-view-options","feature/file-content/diff-view-segment-types","feature/file-content/line-handle","feature/file-content/text-view/attach-simple-scroll-behavior","feature/file-content/stash-codemirror/search"],function(F,S,A,B,J,N,G,I,L,D,M,K,Q,R){function P(T){var V=T.destinationLine;var U=T.sourceLine;T.segments[0].lines=S.map(T.segments[0].lines,function(W){W.destination=V++;W.source=U++;return W});return T}function O(Z,a){if(!a.linesAdded){return }var X=a.diff;var V=L.getSeparatedHunkHtml(X.hunks,Z._options.fileChange.type);var U;var T=[];var W;var Y;a.eachLine(function(c){var b=c.handles.FROM||c.handles.TO;if(c.hunk!==Y){Y=c.hunk;T.push(b)}W=b}).done(function(){switch(a.type){case"INSERT":var f=T[0];var b=Z._editor.getLineNumber(f._handle);var c=b===0;var d=Z._editor.lastLine()-a.linesAdded;var e=b>d;if(X.hunks.length>1){T.shift();V.shift();V.pop();W=undefined}else{if(!c){T.shift();V.shift()}if(!e){V.pop();W=undefined}else{U=V.pop()}}break;case"INITIAL":if(T.length===V.length-1){U=V.pop()}break;default:throw new Error("Unrecognized change type: "+a.type)}Z.operation(function(){S.each(S.zip(V,T),J.spread(S.partial(C,Z,!!"isAbove")));if(U&&!Z._isEntireFile()){C(Z,!"isAbove",U,W)}})})}function C(Y,U,T,X){if(!T){return }var V=F(T);var W=Y.addLineWidget(X,V[0],{coverGutter:true,noHScroll:true,above:U});if(U){Y.addLineClass(X,"wrap","first-line-of-hunk")}V.data("widget",W)}function E(T){T&&T.clear()}function H(U,T){I.apply(this,arguments)}S.extend(H.prototype,I.prototype);H.defaults=I.defaults;H.prototype.init=function(){if(!this._$container){return }var U=this;this._$container.addClass("unified-diff");this.on("internal-change",S.partial(O,this));L.attachExpandContext(this._$container,this._options.fileChange,this._expandContextLines);this._$container.append(stash.feature.fileContent.unifiedDiffView.layout());var V=this._options.commentContext&&this._options.commentContext.getGutterId();if(V){this.registerGutter(V,{weight:100})}this.registerGutter("line-number-from",{weight:200});this.registerGutter("line-number-to",{weight:300});this.registerGutter("gutter-border",{weight:1500});this._editor=this._createEditor({},this._$container.children(".diff-editor"));var T=M.getOptions().diffType==="side-by-side";if(this._isEntireFile()&&T){B.getFromProvider("source.codemirror").then(function(X){if(!X){return }var W=J.dot("hunks.0.segments.0.lines.0.line")(U._data);U._syntaxHighlighting(U._options.fileChange.path.name,W,U._editor)})}this._addDestroyable(function(){U._editor=null});this._scrollingReady.always(function(){U._editor.setOption("scrollLineIntoViewFunc",function(W){var X=U._editor.getLineHandle(W.from.line)._stashHandle;U.scrollHandleIntoFocus(X)});U._modifyDiff("INITIAL",U._data,G.convertToLineInfos(U._data,U._options))});I.prototype.init.call(this)};H.prototype._acceptModification=function(U,X,V,T){T=T||0;var W=this._editor;var Y=I._combineTexts(V);switch(U){case"INITIAL":W.setValue(Y);break;case"INSERT":W._insert(Y,T,true);break;default:throw new Error("Unrecognized change type: "+U)}S.each(V,function(Z,a){var b=new Q(undefined,Z.lineType,Z.lineNumber,W.getLineHandle(a+T));if(Z.lineType!==K.ADDED){Z._setHandle(D.FROM,b)}if(Z.lineType!==K.REMOVED){Z._setHandle(D.TO,b)}})};H.prototype._getFocusSegment=function(X){var W=this._editor;var a=W.getScrollInfo();var Z=Math.ceil(a.clientHeight*this._options.focusPoint)-Math.floor(X);if(Z<0){return null}var Y=1;var V=Math.min(W.lastLine(),W.lineAtHeight(a.top+Z+Y,"local"));var U=W.getLineHandle(V);var T=this._internalLines[U._stashHandle.lineType][U._stashHandle.lineNumber];return T&&T.segment};H.prototype._setFocusSegment=function(T){var V=T[0];this.scrollHandleIntoFocus(this.getLineHandle(V.lines&&V.lines[0]));var U=S.chain(T).pluck("lines").flatten().map(this.getLineHandle).value();this._markLinesFocused([{editor:this._editor,handles:U}])};H.prototype._getFocusLine=function(){var X=this._editor;var U=X.getScrollInfo();var b=this._$fileToolbar&&this._$fileToolbar.outerHeight();var Y=this._$container[0].getBoundingClientRect().top-b;var W=Math.ceil(U.clientHeight*this._options.focusPoint)-(this._editorInnerOffset()-Math.abs(Y));var V=Y<=0?W:0;var a=1;var Z=Math.min(X.lastLine(),X.lineAtHeight(U.top+V+a,"local"));var T=X.getLineHandle(Z);return T._stashHandle};H.prototype._findNextAnchor=function(V,U,T){return this._findNextAnchorInEditor(this._editor,U,V,T)};H.prototype._attachScrollBehavior=function(){return R(this,this._editor,this._$container.children(".diff-editor"))};H.prototype._editorForHandle=function(){return this._editor};H.prototype._isEntireFile=function(){var T=this._options.fileChange.type===N.ADD||this._options.fileChange.type===N.DELETE;return T&&!this._options.isExcerpt};H.prototype._expandContextLines=function(T,U,Z){if(!this._editor){return }var X=this.getLineHandle(U);var W=this._editor.getLineNumber(X._handle);var V=this._editor.lastLine()===W?W+1:W;this.removeLineClass(X,"wrap","first-line-of-hunk");Z.forEach(function(a){a.sourceSpan=a.destinationSpan=a.segments[0].lines.length;P(a)});if(Z.length&&Z[0].segments.length&&Z[0].segments[0].lines.length){var Y={hunks:Z};this._modifyDiff("INSERT",Y,G.convertToLineInfos(Y,this._options),V)}E(U.data("widget"));A.trigger("stash.feature.fileContent.diffViewExpanded",null,{$context:U,hunk:Z,at:W})};return H});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:unified-diff-view', location = '/static/feature/file-content/unified-diff-view/unified-diff-view.soy' */
// This file was automatically generated from unified-diff-view.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.unifiedDiffView.
 */

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.unifiedDiffView == 'undefined') { stash.feature.fileContent.unifiedDiffView = {}; }


stash.feature.fileContent.unifiedDiffView.layout = function(opt_data, opt_ignored) {
  return '' + stash.feature.fileContent.diffView.editor(null);
};
if (goog.DEBUG) {
  stash.feature.fileContent.unifiedDiffView.layout.soyTemplateName = 'stash.feature.fileContent.unifiedDiffView.layout';
}


stash.feature.fileContent.unifiedDiffView.lineNumbers = function(opt_data, opt_ignored) {
  return '<div class="diff-line-numbers" data-line-type="' + soy.$$escapeHtml(opt_data.lineType) + '" data-line-number="' + soy.$$escapeHtml(opt_data.lineNum) + '"><span class="from">' + soy.$$escapeHtml(opt_data.fromLine) + '</span><span class="to">' + soy.$$escapeHtml(opt_data.toLine) + '</span>' + ((opt_data.marker) ? '<span class="diff-change-marker">' + soy.$$escapeHtml(opt_data.marker) + '</span>' : '') + '</div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.unifiedDiffView.lineNumbers.soyTemplateName = 'stash.feature.fileContent.unifiedDiffView.lineNumbers';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-handler', location = '/static/feature/file-content/handlers/diff-handler.js' */
require("stash/api/feature/files/file-handlers").register({weight:5000,handle:function(A){return require("feature/file-content/handlers/diff-handler").handler.apply(this,arguments)}});define("feature/file-content/handlers/diff-handler",["jquery","lodash","stash/api/feature/files/file-handlers","stash/api/util/navbuilder","util/ajax","util/function","util/promise","model/file-change","model/file-change-types","model/file-content-modes","model/path","feature/comments","feature/file-content/binary-diff-view","feature/file-content/binary-view","feature/file-content/content-message","feature/file-content/diff-view-options","feature/file-content/diff-view-options-panel","feature/file-content/handlers/diff-handler/diff-handler-internal","feature/file-content/request-diff","feature/file-content/side-by-side-diff-view","feature/file-content/unified-diff-view","exports"],function(H,X,B,K,P,M,U,N,Q,F,T,J,A,G,R,S,E,C,L,O,I,W){function V(Z,b,a){var c=Z.$container;var Y=new N(Z.fileChange);if(Z.commentMode!==J.commentMode.NONE){var d=a?X.groupBy(a.values,function(e){return e.anchor.line?"line":"file"}):{line:b.lineComments||[],file:b.fileComments||[]};return J.bindContext(c,new J.DiffAnchor(Y),{lineComments:d.line,fileComments:d.file,commentMode:Z.commentMode,relevantContextLines:Z.relevantContextLines,diffViewOptions:Z.diffViewOptions,$toolbar:Z.$toolbar})}return null}function D(h,a,d,b){var Y=B.builtInHandlers;var g=h.$container;var e=new N(h.fileChange);if(a.binary||G.treatTextAsBinary(a.destination&&a.destination.extension)){var c=new A(a,h);c.handlerID=c.isDiffingImages()?Y.DIFF_IMAGE:Y.DIFF_BINARY;return c}if(!a||!a.hunks||!a.hunks.length){R.renderEmptyDiff(g,a,e);return{handlerID:Y.DIFF_EMPTY,extraClasses:"empty-diff message-content"}}if(a.hunks[a.hunks.length-1].truncated){R.renderTooLargeDiff(g,a,e,b);return{handlerID:Y.DIFF_TOO_LARGE,extraClasses:"too-large-diff message-content"}}var f=b?O:I;var Z=new f(a,H.extend({commentContext:d},h));if(d){d.setDiffView(Z)}X.defer(Z.init.bind(Z));Z.handlerID=b?Y.DIFF_TEXT_SIDE_BY_SIDE:Y.DIFF_TEXT_UNIFIED;return Z}W.handler=function(n){if(n.contentMode!==F.DIFF){return false}var i=10;var Z=10000;var m=n.$container;var d=H('.diff-type-options .aui-dropdown2-radio[data-value="side-by-side"]');var g=new N(n.fileChange);var l=g.getType();var h=!(l===Q.ADD||l===Q.DELETE||n.isExcerpt);function f(){return S.get("diffType")==="side-by-side"&&h}n.withComments=n.commentMode!==J.commentMode.NONE;if(f()){n.contextLines=Z;n.withComments=false}function Y(w){var s=new N(w.fileChange);var q=s.getRepository();var o=s.getCommitRange();var r=K.rest().project(q.getProject().getKey()).repo(q.getSlug());if(o.getPullRequest()){r=r.pullRequest(o.getPullRequest().getId())}else{r=r.commit(o)}var u=r.comments().withParams({avatarSize:stash.widget.avatarSizeInPx({size:w.avatarSize||"medium"}),path:new T(w.fileChange.path).toString(),markup:true}).build();var p=w.statusCode||P.ignore404WithinRepository();H.extend(p,{"401":function(){return H.Deferred().resolve({start:0,size:0,values:[],isLastPage:true,filter:null}).promise()}});var v=P.rest({url:u,statusCode:p});var t=v.then(function(x){if(x.errors&&x.errors.length){return H.Deferred().rejectWith(this,[this,null,null,x])}return x});return t.promise(v)}var e=f()?Y:H.noop;var a=X.compact([L(g,n),e(n)]);var c=U.whenAbortable.apply(U,a);function b(){if(h){d.removeClass("disabled");return }if(!h){d.tooltip({gravity:"e",delayIn:0,title:"data-file-type-compatibility"})}}function k(s,p){if(!g.getType()||g.getType===Q.UNKNOWN){g.setType(Q.guessChangeTypeFromDiff(s));n.fileChange=g.toJSON()}h=l?h:!C.isAddedOrRemoved(s);b();var t=C.optionsOverride(S,h,n.isExcerpt);n.relevantContextLines=n.relevantContextLines||i;n.diffViewOptions=t;if(g.getConflict()){R.renderConflict(m,g)}var q=new E(H(document),t);var o=V(n,s,p);var r=D(n,s,o,f());return{handlerID:r.handlerID,extraClasses:r.extraClasses,destroy:function(){J.unbindContext(n.$container);X.chain([r,q,t]).compact().filter(M.dot("destroy")).invoke("destroy").value()}}}function j(q,r,p,o){if(p==="abort"){return H.Deferred().resolve()}R.renderErrors(m,o);return H.Deferred().resolve({extraClasses:"diff-error message-content"})}return c.thenAbortable(k,j)}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:diff-handler', location = '/static/feature/file-content/handlers/diff-handler/diff-handler-internal.js' */
define("feature/file-content/handlers/diff-handler/diff-handler-internal",["lodash","feature/file-content/diff-view-segment-types","exports"],function(B,C,A){A.isAddedOrRemoved=function(E){function D(F){return B.all(E.hunks,function(G){return B.all(G.segments,function(H){return H.type===F})})}return D(C.ADDED)||D(C.REMOVED)};A.optionsOverride=function(D,F,E){return D.proxy({diffType:F?undefined:"unified",hideComments:E?false:undefined})}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-content', location = '/static/feature/file-content/file-content.js' */
define("feature/file-content",["aui","jquery","lodash","memoir","require","stash/api/feature/files/file-handlers","stash/api/util/navbuilder","util/deprecation","util/dom-event","util/events","util/promise","model/content-tree-node-types","model/file-change-types","model/file-content-modes","feature/comments","feature/file-content/ediff"],function(I,E,S,N,J,D,H,R,F,B,M,L,O,C,G,Q){function A(W,U){var V=H.currentRepo().browse().path(W);if(U&&!U.isDefault()){V=V.at(U.getId())}return V.raw().build()}function K(U,W){var V=this;this._id=W||undefined;this._containerSelector=U;B.on("stash.feature.filehistory.revisionSelected",function(X){if(this===V.untilRevisionPicker){B.trigger("stash.feature.filecontent.untilRevisionChanged",V,X)}});this._lastInitPromise=M.thenAbortable(E.Deferred().resolve())}K.commentMode=G.commentMode;K.diffPreset={contentMode:C.DIFF,untilRevisionPicker:true,rawLink:false,sourceLink:false,modeToggle:true,changeTypeLozenge:false,changeModeLozenge:false,breadcrumbs:false,commentMode:K.commentMode.NONE};K.sourcePreset={contentMode:C.SOURCE,untilRevisionPicker:true,rawLink:true,sourceLink:false,modeToggle:true,changeTypeLozenge:false,changeModeLozenge:false,breadcrumbs:false,commentMode:K.commentMode.NONE};K.defaults={contentMode:C.SOURCE,untilRevisionPicker:false,rawLink:false,sourceLink:false,modeToggle:false,changeTypeLozenge:false,changeModeLozenge:false,fileIcon:false,breadcrumbs:false,scrollPaneSelector:undefined,commentMode:K.commentMode.REPLY_ONLY,pullRequestDiffLink:false,toolbarWebFragmentLocationPrimary:null,toolbarWebFragmentLocationSecondary:null,asyncDiffModifications:true,attachScroll:true};K.prototype.initToolbarItems=function(X,U){var Z=E(this._containerSelector);var W=U.getCommitRange().getUntilRevision();var Y=E(stash.feature.fileContent.main(E.extend({id:this._id,preloaded:!!U.getDiff(),sourceUrl:this._options.sourceUrl||this._options.modeToggle?H.currentRepo().browse().path(U.getPath()).at(X.getDisplayId()).until(W&&W.getId()).build():"",diffUrl:this._options.modeToggle?H.currentRepo().diff(U).at(X.getDisplayId()).build():"",fileChange:U.toJSON()},this._options)));this.$self&&this.$self.remove();this.$self=Y.appendTo(Z);var V=this.$toolbar=Y.children(".file-toolbar");this.$contentView=Y.children(".content-view");this._initCommands();if(this._options.breadcrumbs){this.$breadcrumbs=V.find(".breadcrumbs")}else{this.$breadcrumbs=null}if(this._options.changeTypeLozenge){this.$changeTypeLozenge=V.find(".change-type-placeholder")}else{this.$changeTypeLozenge=null}if(this._options.changeModeLozenge){this.$changeModeLozenge=V.find(".change-mode-placeholder")}else{this.$changeModeLozenge=null}if(this._options.sourceLink){this.$viewSource=V.find(".source-view-link").tooltip({gravity:"ne"})}else{this.$viewSource=null}if(this._options.pullRequestDiffLink){V.find(".pull-request-diff-outdated-lozenge").tooltip({gravity:"ne"})}};K.prototype._initCommands=function(){var U=this.$contentView;var V=this.$toolbar;if(this._options.scrollPaneSelector==="self"){U.addClass("scroll-x")}if(this.untilRevisionPicker){this.untilRevisionPicker.destroy()}if(this._options.untilRevisionPicker){var W=J("feature/file-content/file-history");this.untilRevisionPicker=new W(V.find(".until-changeset-button"),"until-changeset")}else{this.untilRevisionPicker=null}if(this._options.rawLink){this.$viewRaw=V.find(".raw-view-link")}else{this.$viewRaw=null}if(this._options.modeToggle){this.$modeToggle=V.find(".mode-toggle").tooltip({gravity:"ne"})}else{this.$modeToggle=null}};K.prototype.initForContent=function(X,c,Z){var V=c.getCommitRange().getUntilRevision();if(this.$viewSource){if(c.getType()===O.DELETE||c.getNodeType()===L.SUBMODULE){this.$viewSource.addClass("hidden")}else{this.$viewSource.attr("href",H.currentRepo().browse().path(c.getPath()).at(V&&V.getId()).build())}}if(this.$viewRaw){this.$viewRaw.attr("href",A(c.getPath(),V&&V.getRevisionReference()))}if(this.untilRevisionPicker){this.untilRevisionPicker.init(c.getPath(),V&&V.getRevisionReference(),X)}if(this.$breadcrumbs){this.$breadcrumbs.html(this.renderBreadCrumbs(c.getPath()))}if(this.$changeTypeLozenge){var W;var g;var i=c.getPath();var Y=c.getSrcPath();if(c.getType()===O.RENAME){W=I.escapeHtml(Y.getName());g=I.escapeHtml(i.toString())}else{if(Y){var U=Y.toString();var d=i.toString();var f=Q.diff(Q.tokenizeString(U),Q.tokenizeString(d));W=T(U,f.originalRegions,"deleted");g=T(d,f.revisedRegions,"added")}}this.$changeTypeLozenge.append(stash.feature.fileContent.fileChangeTypeLozenge({changeType:c.getType(),previousPathContent:W,pathContent:g}));var h=function(){var k=E(document).width()-E(this).offset().left-(E(this).width()/2);var j=E(".tipsy").outerWidth();return(k>((j/2)+10))?"n":"ne"};this.$changeTypeLozenge.find(".change-type-lozenge").tooltip({html:true,className:"change-type-lozenge-tooltip",gravity:h})}if(this.$changeModeLozenge){var b=this.getFileChangedModeLozenge(c);if(b){this.$changeModeLozenge.append(E(b).tooltip())}}if(this.$modeToggle&&N.nativeSupport()){this.$modeToggle.on("click","a:not(.active,.disabled)",function(j){if(!F.openInSameTab(j)){return }j.preventDefault();B.trigger("stash.feature.filecontent.requestedModeChange",this,E(this).hasClass("mode-diff")?C.DIFF:C.SOURCE)})}var e={$toolbar:this.$toolbar,$container:this.$contentView,asyncDiffModifications:this._options.asyncDiffModifications,attachScroll:this._options.attachScroll,autoResizing:this._options.autoResizing,contentMode:this._options.contentMode,commentMode:this._options.commentMode,diffUrlBuilder:this._options.diffUrlBuilder,disable:R.fn(this.toggleToolbarDisable.bind(this,true),"FileHandlingContext.disable()","handler-specific events","3.5","4.0"),enable:R.fn(this.toggleToolbarDisable.bind(this,false),"FileHandlingContext.enable()","handler-specific events","3.5","4.0"),fileChange:c.toJSON(),isExcerpt:!!this._options.isExcerpt,lineComments:this._options.lineComments,relevantContextLines:this._options.relevantContextLines,targetLine:Z>0?Z-1:null};var a=E("<div />").addClass("file-content-spinner").appendTo(this.$self);return M.spinner(a,D._handle(e).done(S.bind(function(k,l){this.renderErrors(l);if(k.extraClasses){this.$self.addClass(k.extraClasses);this.extraClasses=k.extraClasses}this.destroyView=S.isFunction(k.destroy)?S.bind(k.destroy,k):E.noop;var j={handlerID:k.handlerID,displayType:this._options.contentMode,fileChange:e.fileChange,commentMode:this._options.commentMode};if(this._options.toolbarWebFragmentLocationPrimary){this.$toolbar.children(".primary").append(stash.widget.webFragmentButtons({location:this._options.toolbarWebFragmentLocationPrimary,context:j}))}if(this._options.toolbarWebFragmentLocationSecondary){this.$toolbar.children(".secondary").prepend(stash.widget.webFragmentButtons({location:this._options.toolbarWebFragmentLocationSecondary,context:j,isReverse:true}))}},this)),"large",{zIndex:10}).done(S.defer.bind(S,function(){B.trigger("stash.feature.fileContent.requestHandled",null,e)}))};K.prototype.renderErrors=function(U){this.$self.parent().find(".file-content-errors").remove();if(U.length>0){this.$self.before(stash.feature.fileContent.errors({errors:S.map(U,function(V){return V.message||V})}))}};K.prototype.toggleToolbarDisable=function(U){this.$self.find(".file-toolbar .aui-button").toggleClass("disabled",U).prop("disabled",U).attr("aria-disabled",U);if(U){R.triggerDeprecated("stash.feature.filecontent.disabled",this,this.$self,"handler-specific events","3.5","4.0")}else{R.triggerDeprecated("stash.feature.filecontent.enabled",this,this.$self,"handler-specific events","3.5","4.0")}};K.prototype.renderBreadCrumbs=function(V){var U=S.map(V.getComponents(),function(W){return{text:W}});return stash.widget.breadcrumbs.crumbs({pathComponents:U,primaryLink:this._options.pullRequestDiffLinkUrl})};K.prototype.getFileChangedModeLozenge=function(U){var X=U.getSrcExecutable(),V=U.getExecutable();var W=null;if((X==null&&V===true)||(X===false&&V===true)){W=true}else{if(X===true&&V===false){W=false}}if(W!==null){return E(stash.feature.fileContent.fileChangeModeLozenge({added:W}))}return null};K.prototype.init=function(U,X,Y,V){var W=this._initInternal.bind(this,U,X,Y,V);this._lastInitPromise=this.reset().thenAbortable(W,W);return this._lastInitPromise};K.prototype._initInternal=function(V,Y,Z,W){W=this._options=E.extend({},K.defaults,W);var U=V.getCommitRange(),X=Y||U.getUntilRevision()&&U.getUntilRevision().getRevisionReference();if(W.changeTypeLozenge&&!V.getType()){throw new Error("Change type is required to show the change type lozenge.")}if(!U.getUntilRevision()&&(W.sourceLink||W.rawLink||W.untilRevisionPicker)){throw new Error("Revision info is required to show a link to the source or raw file, or a revision picker.")}this.initToolbarItems(X,V);return this.initForContent(X,V,Z)};K.prototype.reset=function(){if(this._lastInitPromise){this._lastInitPromise.abort()}var U=this._resetInternal.bind(this);return M.thenAbortable(this._lastInitPromise.then(U,U))};K.prototype._resetInternal=function P(){if(this.extraClasses){this.$self.removeClass(this.extraClasses)}if(S.isFunction(this.destroyView)){this.destroyView()}this.destroyView=null;this.extraClasses=null;return E.Deferred().resolve()};K.prototype.destroy=function(){this.reset()};function T(W,a,Y){var U="";var Z=0;for(var V=0;V<a.length;V++){var X=a[V];U+=I.escapeHtml(W.substring(Z,X.start))+'<span class="'+Y+'">'+I.escapeHtml(W.substring(X.start,X.end))+"</span>";Z=X.end}if(Z<W.length){U+=I.escapeHtml(W.substring(Z))}return U}return K});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-content', location = '/static/feature/file-content/file-content.soy' */
// This file was automatically generated from file-content.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; }


stash.feature.fileContent.main = function(opt_data, opt_ignored) {
  return '<div' + ((opt_data.id) ? ' id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + ' class="file-content' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '">' + stash.feature.file.fileToolbar({fileIcon: opt_data.fileIcon, breadcrumbs: opt_data.breadcrumbs, primaryToolbarContent: '' + ((opt_data.changeTypeLozenge) ? '<div class="change-type-placeholder"></div>' : '') + ((opt_data.changeModeLozenge) ? '<div class="change-mode-placeholder"></div>' : '') + ((opt_data.modeToggle) ? stash.buttons.buttons({extraClasses: 'mode-toggle', content: '' + stash.buttons.button({extraClasses: 'mode-source', isPressed: opt_data.contentMode == 'source', href: opt_data.sourceUrl, buttonText: "Source view", title: "View the full source of this file"}) + stash.buttons.button({extraClasses: 'mode-diff', isPressed: opt_data.contentMode == 'diff', href: opt_data.diffUrl, buttonText: "Diff to previous", title: "View the changes made in this revision"})}) : '') + ((opt_data.untilRevisionPicker) ? stash.buttons.button({extraClasses: 'aui-dd-trigger until-changeset-button', buttonText: "History", title: "View the history of this file"}) : ''), secondaryToolbarContent: '' + ((opt_data.sourceLink) ? stash.buttons.button({href: '#', extraClasses: 'aui-button-subtle source-view-link', title: "View the full source of this file", iconType: 'custom', iconClass: 'aui-icon aui-icon-small aui-iconfont-devtools-file', iconText: "View the full source of this file", buttonText: ''}) : '') + ((opt_data.rawLink) ? stash.buttons.button({href: '#', buttonText: "Raw file", extraClasses: 'aui-button-link raw-view-link'}) : '') + ((opt_data.pullRequestDiffLink) ? (opt_data.pullRequestDiffCurrent == false) ? stash.widget.lozenge.lozenge({text: "Outdated", htmlElement: 'span', extraClasses: 'aui-lozenge-current aui-lozenge-subtle pull-request-diff-outdated-lozenge', tooltip: "This diff has changed in more recent commits"}) : '' : (opt_data.contentMode == 'diff') ? '<div class="diff-view-options">' + stash.feature.fileContent.diffViewOptionsPanel.main({commentMode: opt_data.commentMode, displayType: opt_data.contentMode, fileChange: opt_data.fileChange}) + '</div>' : '')}) + '<div class="content-view ' + soy.$$escapeHtml(opt_data.contentMode) + '-view' + ((opt_data.preloaded) ? ' fully-loaded' : '') + '"></div></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.main.soyTemplateName = 'stash.feature.fileContent.main';
}


stash.feature.fileContent.errors = function(opt_data, opt_ignored) {
  var output = '<div class="file-content-errors">';
  var errorList90 = opt_data.errors;
  var errorListLen90 = errorList90.length;
  for (var errorIndex90 = 0; errorIndex90 < errorListLen90; errorIndex90++) {
    var errorData90 = errorList90[errorIndex90];
    output += aui.message.warning({content: '' + soy.$$escapeHtml(errorData90), isCloseable: true});
  }
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  stash.feature.fileContent.errors.soyTemplateName = 'stash.feature.fileContent.errors';
}
;
;/* 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: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:changeset-badge', location = '/static/feature/changeset/changeset-badge/changeset-badge.js' */
define("feature/changeset/changeset-badge",["jquery","exports"],function(B,A){A.create=function(D,C){return B(stash.feature.changeset.changesetBadge.oneline({changeset:D,repository:C,withAvatar:true}))}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:changeset-badge', location = '/static/feature/changeset/changeset-badge/changeset-badge.soy' */
// This file was automatically generated from changeset-badge.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.changeset.changesetBadge.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.changeset == 'undefined') { stash.feature.changeset = {}; }
if (typeof stash.feature.changeset.changesetBadge == 'undefined') { stash.feature.changeset.changesetBadge = {}; }


stash.feature.changeset.changesetBadge.oneline = function(opt_data, opt_ignored) {
  return '<div class="changeset-badge-oneline">' + ((opt_data.withAvatar) ? stash.widget.avatar({person: opt_data.changeset.author, size: 'small'}) : '') + stash.feature.changeset.changesetBadge.changesetSummary({authorNameContent: '' + ((opt_data.linkAuthor == false) ? '<span class="changeset-author" title="' + soy.$$escapeHtml(opt_data.changeset.author.displayName || opt_data.changeset.author.name) + '">' + soy.$$escapeHtml(soy.$$truncate(opt_data.changeset.author.displayName || opt_data.changeset.author.name, 100, true)) + '</span>' : stash.widget.userLink({user: opt_data.changeset.author, extraClasses: 'changeset-author'})), changesetLinkContent: '' + stash.feature.changeset.link(opt_data) + ((opt_data.changeset.parents.length > 1) ? stash.widget.lozenge.merge({abbreviated: opt_data.abbreviatedMerge}) : '')}) + stash.widget.date.shortAge({date: opt_data.changeset.authorTimestamp}) + '</div>';
};
if (goog.DEBUG) {
  stash.feature.changeset.changesetBadge.oneline.soyTemplateName = 'stash.feature.changeset.changesetBadge.oneline';
}


stash.feature.changeset.changesetBadge.changesetSummary = function(opt_data, opt_ignored) {
  return '' + soy.$$filterNoAutoescape(AJS.format("{0} committed {1}",opt_data.authorNameContent,opt_data.changesetLinkContent));
};
if (goog.DEBUG) {
  stash.feature.changeset.changesetBadge.changesetSummary.soyTemplateName = 'stash.feature.changeset.changesetBadge.changesetSummary';
}


stash.feature.changeset.changesetBadge.detailed = function(opt_data, opt_ignored) {
  return '<div class="changeset-badge-detailed">' + stash.feature.changeset.changesetBadge.oneline({changeset: opt_data.changeset, repository: opt_data.repository, withAvatar: false, linkAuthor: opt_data.linkAuthor, abbreviatedMerge: true}) + '<div class="changeset-message">' + soy.$$escapeHtml(soy.$$truncate(opt_data.changeset.message, opt_data.maxMessageLength ? opt_data.maxMessageLength : 150, true)) + '</div></div>';
};
if (goog.DEBUG) {
  stash.feature.changeset.changesetBadge.detailed.soyTemplateName = 'stash.feature.changeset.changesetBadge.detailed';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:changeset-list', location = '/static/feature/changeset/changeset-list/changeset-list.soy' */
// This file was automatically generated from changeset-list.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.widget.changeset.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.widget == 'undefined') { stash.widget = {}; }
if (typeof stash.widget.changeset == 'undefined') { stash.widget.changeset = {}; }


stash.widget.changeset.changesetList = function(opt_data, opt_ignored) {
  return '<ul class="changeset-list">' + soy.$$filterNoAutoescape(opt_data.content) + '</ul>';
};
if (goog.DEBUG) {
  stash.widget.changeset.changesetList.soyTemplateName = 'stash.widget.changeset.changesetList';
}


stash.widget.changeset.changesetListItem = function(opt_data, opt_ignored) {
  return '<li class="changeset-list-item' + soy.$$escapeHtml(opt_data.isSelected ? ' selected' : ' unselected') + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '"' + ((opt_data.title) ? ' title="' + soy.$$escapeHtml(opt_data.title) + '"' : '') + '><a href="' + soy.$$escapeHtml(opt_data.href ? opt_data.href : '') + '" data-id="' + soy.$$escapeHtml(opt_data.changeset.id) + '">' + ((opt_data.changeset.message) ? stash.widget.avatar({person: opt_data.changeset.author, size: 'small'}) + stash.feature.changeset.changesetBadge.detailed({changeset: opt_data.changeset, maxMessageLength: 90, linkAuthor: false}) : '<span class="icon"></span>' + soy.$$escapeHtml(opt_data.changeset.displayId)) + '</a></li>';
};
if (goog.DEBUG) {
  stash.widget.changeset.changesetListItem.soyTemplateName = 'stash.widget.changeset.changesetListItem';
}
;
;/* 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:file-history', location = '/static/feature/file-content/file-history/file-history.js' */
define("feature/file-content/file-history",["aui","jquery","lodash","stash/api/util/navbuilder","util/ajax","util/events","model/revision","widget/paged-scrollable"],function(H,C,I,B,G,J,D,F){function E(O,L){var N=this._$historyButton=C(O);this._id=L;this._scrollPaneSelector="#inline-dialog-"+L+" .file-history";this._listSelector=this._scrollPaneSelector+" > ul";var V=this;var W=function(Y){if(Y.keyCode===H.keyCode.ESCAPE){V.hide();Y.preventDefault()}},R=function(Y){if(V.isButtonEnabled()){V.show()}Y.preventDefault()},P=function(Y){V.hide();Y.preventDefault()},S=this._itemClicked=function(b){V.hide();var d=C(this),a=d.children("a"),Y=a.attr("data-id"),c=V._visibleChangesets[Y],Z=new D(c);J.trigger("stash.feature.filehistory.revisionSelected",V,Z);b.preventDefault()};var T=null,M=false,Q;var U=function(Z,Y,a){if(!M){M=true;Q=Z.html(stash.feature.fileContent.fileHistory());Q.on("click","li.changeset-list-item",S);a();T=V._createScrollable();V._visibleChangesets={};setTimeout(function(){Z.find(".spinner").spin();T.init()},0)}else{a();I.defer(function(){C(V._listSelector).find(":first a").focus()})}N.off("click",R);N.on("click",P);C(document).on("keyup",W)};var K=function(){C(document).off("keyup",W);N.off("click",P);N.on("click",R);if(C(document.activeElement).closest(V._scrollPaneSelector).length){document.activeElement.blur()}};var X=function(){V.hide();T&&T.reset();C(document).off("keyup",W);Q&&Q.off("click","li.changeset-list-item",S);M=false};this._inlineDialog=H.InlineDialog(N,L,U,{hideDelay:1000,width:483,noBind:true,hideCallback:K});N.on("click",R);J.on("stash.page.*.revisionRefChanged",X);J.on("stash.page.*.pathChanged",X)}E.prototype.init=function(L,M,K){this._path=L;this._selectedRevisionRef=M;this._headRevisionRef=K};E.prototype.destroy=function(){this._inlineDialog.remove()};E.prototype.show=function(){this._inlineDialog.show();C(this._listSelector).find(":first a").focus()};E.prototype.hide=function(){this._inlineDialog.hide()};E.prototype._createScrollable=function(){var L=new F(this._scrollPaneSelector,{bufferPixels:0,pageSize:25});L.requestData=C.proxy(this.requestData,this);L.attachNewContent=C.proxy(this.attachNewContent,this);var M=L.onFirstDataLoaded;var K=this;L.onFirstDataLoaded=function(){C(K._listSelector).find(":first a").focus();return M.apply(this,arguments)};return L};E.prototype.requestData=function(L,K){this._inlineDialog.find(".spinner").spin();return G.rest({url:B.rest().currentRepo().commits().withParams({path:this._path.toString(),until:this._headRevisionRef.getId(),start:L,limit:K,avatarSize:stash.widget.avatarSizeInPx({size:"xsmall"})}).build()})};function A(L,K){I.forEach(L,function(M){K[M.id]=M})}E.prototype.attachNewContent=function(K){A(K.values,this._visibleChangesets);C(this._listSelector).append(C(stash.feature.fileContent.fileHistoryItems({historyPage:K,selectedCsid:(this._selectedRevisionRef&&this._selectedRevisionRef.getId())||"",lastPageMessage:"No more history",headRefId:this._headRevisionRef.getId()})));C(this._scrollPaneSelector).children(".spinner").spinStop();if(K.isLastPage){C(this._scrollPaneSelector).children(".spinner").remove()}};E.prototype.setButtonEnabled=function(K){this._$historyButton.prop("disabled",!K).toggleClass("disabled",!K)};E.prototype.isButtonEnabled=function(){return !this._$historyButton.prop("disabled")};return E});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-history', location = '/static/feature/file-content/file-history/file-history.soy' */
// This file was automatically generated from file-history.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; }


stash.feature.fileContent.fileHistory = function(opt_data, opt_ignored) {
  return '<div class="file-history">' + stash.widget.changeset.changesetList({content: ''}) + '<div class="spinner"/></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.fileHistory.soyTemplateName = 'stash.feature.fileContent.fileHistory';
}


stash.feature.fileContent.fileHistoryItems = function(opt_data, opt_ignored) {
  var output = '';
  var changesetList8 = opt_data.historyPage.values;
  var changesetListLen8 = changesetList8.length;
  for (var changesetIndex8 = 0; changesetIndex8 < changesetListLen8; changesetIndex8++) {
    var changesetData8 = changesetList8[changesetIndex8];
    output += stash.widget.changeset.changesetListItem({changeset: changesetData8, href: '?until=' + soy.$$escapeHtml(changesetData8.id) + ((opt_data.headRefId) ? '&at=' + soy.$$escapeHtml(opt_data.headRefId) : ''), title: AJS.format("Click to view file at revision {0}",changesetData8.displayId), isSelected: changesetData8.id == opt_data.selectedCsid, repository: opt_data.repository});
  }
  output += (opt_data.historyPage.isLastPage && opt_data.lastPageMessage) ? '<li class="no-more-results">' + soy.$$escapeHtml(opt_data.lastPageMessage) + '</li>' : '';
  return output;
};
if (goog.DEBUG) {
  stash.feature.fileContent.fileHistoryItems.soyTemplateName = 'stash.feature.fileContent.fileHistoryItems';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:path-and-line', location = '/static/model/path-and-line.js' */
define("model/path-and-line",["model/path"],function(A){function B(F,D,G){this.path=new A((F&&F.path)||F);if(D){this.line={no:D,type:G||"TO"}}else{if(F&&F.line){this.line=F.line}else{var H=this.path.getComponents();var E=H.length-1;if(E>=0){var C=H[E];var I=Math.max(C.lastIndexOf("?F"),C.lastIndexOf("?T"));if(I>0){D=Number(C.substring(I+2))||undefined;if(D){this.line={no:D,type:C[I+1]==="F"?"FROM":"TO"};H[E]=C.substring(0,I);this.path=new A(H)}}}}}}B.prototype.toString=function(){return this.path.toString()+(this.line?(this.line.type==="FROM"?"?F":"?T")+this.line.no:"")};return B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:binary-source-view', location = '/static/feature/file-content/binary-source-view/binary-source-view.js' */
define("feature/file-content/binary-source-view",["jquery","util/deprecation","util/events","feature/file-content/binary-view"],function(F,E,C,D){function B(G){this._init(G)}B.prototype._init=function(H){var I=H.fileChange.path;var J=H.fileChange.commitRange.untilRevision;this._$container=F(stash.feature.fileContent.binaryView.container()).appendTo(H.$container);var G=D.getRenderedBinary(I,J&&J.id);A(G,this._$container);E.triggerDeprecated("stash.feature.sourceview.onBinary",null,{path:I,type:G.type,revision:J},"stash.feature.fileContent.binaryShown","3.3","4.0");C.trigger("stash.feature.fileContent.binaryShown",null,{containerEl:this._$container.get(0),path:I,type:G&&G.type,revision:J})};function A(G,H){F(stash.feature.fileContent.binaryView.cell({})).append(G.$elem).appendTo(H)}B.prototype.destroy=function(){if(this._$container){this._$container.remove();this._$container=null}};return B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:request-source', location = '/static/feature/file-content/request-source.js' */
define("feature/file-content/request-source",["jquery","lodash","stash/api/util/navbuilder","util/ajax","util/navigator","util/property"],function(E,I,A,H,G,J){var D;J.getFromProvider("page.max.source.lines").done(function(K){D=K});var B={};function C(K,L){var M=E.extend({},{start:L.start||0,limit:L.limit||(D===5000&&G.isIE()?1000:D)||5000,blame:L.includeBlame?true:undefined});return A.currentRepo().browse().path(K.path).at(K.commitRange.untilRevision.displayId).withParams(M).build()}function F(L,N){N=N||{};var K=L.toJSON?L.toJSON():L;var M=C(K,N);if(B.hasOwnProperty(M)&&B[M].state()!=="rejected"){return B[M]}var O=H.rest({url:M,statusCode:N.statusCode||H.ignore404WithinRepository()});var P=O.then(function(Q){if(Q.errors&&Q.errors.length){return E.Deferred().rejectWith(this,[this,null,null,Q])}I.defer(function(){delete B[M]});return Q});B[M]=P.promise(O);return B[M]}return F});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:highlightjs', location = '/static/lib/highlight/highlight.pack.js' */
var hljs=new function(){function L(O){return O.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function B(P){for(var O=P.firstChild;O;O=O.nextSibling){if(O.nodeName=="CODE"){return O}if(!(O.nodeType==3&&O.nodeValue.match(/\s+/))){break}}}function H(P,O){return Array.prototype.map.call(P.childNodes,function(Q){if(Q.nodeType==3){return O?Q.nodeValue.replace(/\n/g,""):Q.nodeValue}if(Q.nodeName=="BR"){return"\n"}return H(Q,O)}).join("")}function A(Q){var P=(Q.className+" "+Q.parentNode.className).split(/\s+/);P=P.map(function(R){return R.replace(/^language-/,"")});for(var O=0;O<P.length;O++){if(E[P[O]]||P[O]=="no-highlight"){return P[O]}}}function C(Q){var O=[];(function P(R,S){for(var T=R.firstChild;T;T=T.nextSibling){if(T.nodeType==3){S+=T.nodeValue.length}else{if(T.nodeName=="BR"){S+=1}else{if(T.nodeType==1){O.push({event:"start",offset:S,node:T});S=P(T,S);O.push({event:"stop",offset:S,node:T})}}}}return S})(Q,0);return O}function J(X,V,W){var P=0;var Y="";var R=[];function T(){if(X.length&&V.length){if(X[0].offset!=V[0].offset){return(X[0].offset<V[0].offset)?X:V}else{return V[0].event=="start"?X:V}}else{return X.length?X:V}}function S(a){function Z(b){return" "+b.nodeName+'="'+L(b.value)+'"'}return"<"+a.nodeName+Array.prototype.map.call(a.attributes,Z).join("")+">"}while(X.length||V.length){var U=T().splice(0,1)[0];Y+=L(W.substr(P,U.offset-P));P=U.offset;if(U.event=="start"){Y+=S(U.node);R.push(U.node)}else{if(U.event=="stop"){var O,Q=R.length;do{Q--;O=R[Q];Y+=("</"+O.nodeName.toLowerCase()+">")}while(O!=U.node);R.splice(Q,1);while(Q<R.length){Y+=S(R[Q]);Q++}}}}return Y+L(W.substr(P))}function F(Q){function O(S,R){return RegExp(S,"m"+(Q.case_insensitive?"i":"")+(R?"g":""))}function P(X,W){if(X.compiled){return }X.compiled=true;var U=[];if(X.keywords){var R={};function Y(Z,a){a.split(" ").forEach(function(b){var c=b.split("|");R[c[0]]=[Z,c[1]?Number(c[1]):1];U.push(c[0])})}X.lexemsRe=O(X.lexems||hljs.IDENT_RE,true);if(typeof X.keywords=="string"){Y("keyword",X.keywords)}else{for(var V in X.keywords){if(!X.keywords.hasOwnProperty(V)){continue}Y(V,X.keywords[V])}}X.keywords=R}if(W){if(X.beginWithKeyword){X.begin="\\b("+U.join("|")+")\\s"}X.beginRe=O(X.begin?X.begin:"\\B|\\b");if(!X.end&&!X.endsWithParent){X.end="\\B|\\b"}if(X.end){X.endRe=O(X.end)}X.terminator_end=X.end||"";if(X.endsWithParent&&W.terminator_end){X.terminator_end+=(X.end?"|":"")+W.terminator_end}}if(X.illegal){X.illegalRe=O(X.illegal)}if(X.relevance===undefined){X.relevance=1}if(!X.contains){X.contains=[]}for(var T=0;T<X.contains.length;T++){if(X.contains[T]=="self"){X.contains[T]=X}P(X.contains[T],X)}if(X.starts){P(X.starts,W)}var S=[];for(var T=0;T<X.contains.length;T++){S.push(X.contains[T].begin)}if(X.terminator_end){S.push(X.terminator_end)}if(X.illegal){S.push(X.illegal)}X.terminators=S.length?O(S.join("|"),true):{exec:function(Z){return null}}}P(Q)}function D(c,d){function O(e,m){for(var l=0;l<m.contains.length;l++){var k=m.contains[l].beginRe.exec(e);if(k&&k.index==0){return m.contains[l]}}}function S(k,e){if(k.end&&k.endRe.test(e)){return k}if(k.endsWithParent){return S(k.parent,e)}}function T(e,k){return k.illegal&&k.illegalRe.test(e)}function Y(l,e){var k=f.case_insensitive?e[0].toLowerCase():e[0];return l.keywords.hasOwnProperty(k)&&l.keywords[k]}function g(){var k=L(W);if(!a.keywords){return k}var e="";var n=0;a.lexemsRe.lastIndex=0;var l=a.lexemsRe.exec(k);while(l){e+=k.substr(n,l.index-n);var m=Y(a,l);if(m){V+=m[1];e+='<span class="'+m[0]+'">'+l[0]+"</span>"}else{e+=l[0]}n=a.lexemsRe.lastIndex;l=a.lexemsRe.exec(k)}return e+k.substr(n)}function Z(){if(a.subLanguage&&!E[a.subLanguage]){return L(W)}var e=a.subLanguage?D(a.subLanguage,W):G(W);if(a.relevance>0){V+=e.keyword_count;P+=e.relevance}return'<span class="'+e.language+'">'+e.value+"</span>"}function j(){return a.subLanguage!==undefined?Z():g()}function i(l,e){var k=l.className?'<span class="'+l.className+'">':"";if(l.returnBegin){X+=k;W=""}else{if(l.excludeBegin){X+=L(e)+k;W=""}else{X+=k;W=e}}a=Object.create(l,{parent:{value:a}});P+=l.relevance}function b(k,e){W+=k;if(e===undefined){X+=j();return 0}var l=O(e,a);if(l){X+=j();i(l,e);return l.returnBegin?0:e.length}var m=S(a,e);if(m){if(!(m.returnEnd||m.excludeEnd)){W+=e}X+=j();do{if(a.className){X+="</span>"}a=a.parent}while(a!=m.parent);if(m.excludeEnd){X+=L(e)}W="";if(m.starts){i(m.starts,"")}return m.returnEnd?0:e.length}if(T(e,a)){throw"Illegal"}W+=e;return e.length||1}var f=E[c];F(f);var a=f;var W="";var P=0;var V=0;var X="";try{var U,R,Q=0;while(true){a.terminators.lastIndex=Q;U=a.terminators.exec(d);if(!U){break}R=b(d.substr(Q,U.index-Q),U[0]);Q=U.index+R}b(d.substr(Q));return{relevance:P,keyword_count:V,value:X,language:c}}catch(h){if(h=="Illegal"){return{relevance:0,keyword_count:0,value:L(d)}}else{throw h}}}function G(S){var O={keyword_count:0,relevance:0,value:L(S)};var Q=O;for(var P in E){if(!E.hasOwnProperty(P)){continue}var R=D(P,S);R.language=P;if(R.keyword_count+R.relevance>Q.keyword_count+Q.relevance){Q=R}if(R.keyword_count+R.relevance>O.keyword_count+O.relevance){Q=O;O=R}}if(Q.language){O.second_best=Q}return O}function I(Q,P,O){if(P){Q=Q.replace(/^((<[^>]+>|\t)+)/gm,function(R,U,T,S){return U.replace(/\t/g,P)})}if(O){Q=Q.replace(/\n/g,"<br>")}return Q}function M(R,U,P){var V=H(R,P);var T=A(R);if(T=="no-highlight"){return }var W=T?D(T,V):G(V);T=W.language;var O=C(R);if(O.length){var Q=document.createElement("pre");Q.innerHTML=W.value;W.value=J(O,C(Q),V)}W.value=I(W.value,U,P);var S=R.className;if(!S.match("(\\s|^)(language-)?"+T+"(\\s|$)")){S=S?(S+" "+T):T}R.innerHTML=W.value;R.className=S;R.result={language:T,kw:W.keyword_count,re:W.relevance};if(W.second_best){R.second_best={language:W.second_best.language,kw:W.second_best.keyword_count,re:W.second_best.relevance}}}function N(){if(N.called){return }N.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),B).filter(Boolean).forEach(function(O){M(O,hljs.tabReplace)})}function K(){window.addEventListener("DOMContentLoaded",N,false);window.addEventListener("load",N,false)}var E={};this.LANGUAGES=E;this.highlight=D;this.highlightAuto=G;this.fixMarkup=I;this.highlightBlock=M;this.initHighlighting=N;this.initHighlightingOnLoad=K;this.IDENT_RE="[a-zA-Z][a-zA-Z0-9_]*";this.UNDERSCORE_IDENT_RE="[a-zA-Z_][a-zA-Z0-9_]*";this.NUMBER_RE="\\b\\d+(\\.\\d+)?";this.C_NUMBER_RE="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BINARY_NUMBER_RE="\\b(0b[01]+)";this.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0};this.APOS_STRING_MODE={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[this.BACKSLASH_ESCAPE],relevance:0};this.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[this.BACKSLASH_ESCAPE],relevance:0};this.C_LINE_COMMENT_MODE={className:"comment",begin:"//",end:"$"};this.C_BLOCK_COMMENT_MODE={className:"comment",begin:"/\\*",end:"\\*/"};this.HASH_COMMENT_MODE={className:"comment",begin:"#",end:"$"};this.NUMBER_MODE={className:"number",begin:this.NUMBER_RE,relevance:0};this.C_NUMBER_MODE={className:"number",begin:this.C_NUMBER_RE,relevance:0};this.BINARY_NUMBER_MODE={className:"number",begin:this.BINARY_NUMBER_RE,relevance:0};this.inherit=function(Q,R){var O={};for(var P in Q){O[P]=Q[P]}if(R){for(var P in R){O[P]=R[P]}}return O}}();hljs.LANGUAGES["1c"]=function(B){var F="[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*";var C="возврат дата для если и или иначе иначеесли исключение конецесли конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл число экспорт";var E="ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить стрколичествострок стрполучитьстроку  стрчисловхождений сформироватьпозициюдокумента счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты установитьтана установитьтапо фиксшаблон формат цел шаблон";var A={className:"dquote",begin:'""'};var D={className:"string",begin:'"',end:'"|$',contains:[A],relevance:0};var G={className:"string",begin:"\\|",end:'"|$',contains:[A]};return{case_insensitive:true,lexems:F,keywords:{keyword:C,built_in:E},contains:[B.C_LINE_COMMENT_MODE,B.NUMBER_MODE,D,G,{className:"function",begin:"(процедура|функция)",end:"$",lexems:F,keywords:"процедура функция",contains:[{className:"title",begin:F},{className:"tail",endsWithParent:true,contains:[{className:"params",begin:"\\(",end:"\\)",lexems:F,keywords:"знач",contains:[D,G]},{className:"export",begin:"экспорт",endsWithParent:true,lexems:F,keywords:"экспорт",contains:[B.C_LINE_COMMENT_MODE]}]},B.C_LINE_COMMENT_MODE]},{className:"preprocessor",begin:"#",end:"$"},{className:"date",begin:"'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})'"}]}}(hljs);hljs.LANGUAGES.actionscript=function(A){var C="[a-zA-Z_$][a-zA-Z0-9_$]*";var D="([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)";var E={className:"rest_arg",begin:"[.]{3}",end:C,relevance:10};var B={className:"title",begin:C};return{keywords:{keyword:"as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",literal:"true false null undefined"},contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.C_NUMBER_MODE,{className:"package",beginWithKeyword:true,end:"{",keywords:"package",contains:[B]},{className:"class",beginWithKeyword:true,end:"{",keywords:"class interface",contains:[{beginWithKeyword:true,keywords:"extends implements"},B]},{className:"preprocessor",beginWithKeyword:true,end:";",keywords:"import include"},{className:"function",beginWithKeyword:true,end:"[{;]",keywords:"function",illegal:"\\S",contains:[B,{className:"params",begin:"\\(",end:"\\)",contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,E]},{className:"type",begin:":",end:D,relevance:10}]}]}}(hljs);hljs.LANGUAGES.apache=function(A){var B={className:"number",begin:"[\\$%]\\d+"};return{case_insensitive:true,keywords:{keyword:"acceptfilter acceptmutex acceptpathinfo accessfilename action addalt addaltbyencoding addaltbytype addcharset adddefaultcharset adddescription addencoding addhandler addicon addiconbyencoding addiconbytype addinputfilter addlanguage addmoduleinfo addoutputfilter addoutputfilterbytype addtype alias aliasmatch allow allowconnect allowencodedslashes allowoverride anonymous anonymous_logemail anonymous_mustgiveemail anonymous_nouserid anonymous_verifyemail authbasicauthoritative authbasicprovider authdbduserpwquery authdbduserrealmquery authdbmgroupfile authdbmtype authdbmuserfile authdefaultauthoritative authdigestalgorithm authdigestdomain authdigestnccheck authdigestnonceformat authdigestnoncelifetime authdigestprovider authdigestqop authdigestshmemsize authgroupfile authldapbinddn authldapbindpassword authldapcharsetconfig authldapcomparednonserver authldapdereferencealiases authldapgroupattribute authldapgroupattributeisdn authldapremoteuserattribute authldapremoteuserisdn authldapurl authname authnprovideralias authtype authuserfile authzdbmauthoritative authzdbmtype authzdefaultauthoritative authzgroupfileauthoritative authzldapauthoritative authzownerauthoritative authzuserauthoritative balancermember browsermatch browsermatchnocase bufferedlogs cachedefaultexpire cachedirlength cachedirlevels cachedisable cacheenable cachefile cacheignorecachecontrol cacheignoreheaders cacheignorenolastmod cacheignorequerystring cachelastmodifiedfactor cachemaxexpire cachemaxfilesize cacheminfilesize cachenegotiateddocs cacheroot cachestorenostore cachestoreprivate cgimapextension charsetdefault charsetoptions charsetsourceenc checkcaseonly checkspelling chrootdir contentdigest cookiedomain cookieexpires cookielog cookiename cookiestyle cookietracking coredumpdirectory customlog dav davdepthinfinity davgenericlockdb davlockdb davmintimeout dbdexptime dbdkeep dbdmax dbdmin dbdparams dbdpersist dbdpreparesql dbdriver defaulticon defaultlanguage defaulttype deflatebuffersize deflatecompressionlevel deflatefilternote deflatememlevel deflatewindowsize deny directoryindex directorymatch directoryslash documentroot dumpioinput dumpiologlevel dumpiooutput enableexceptionhook enablemmap enablesendfile errordocument errorlog example expiresactive expiresbytype expiresdefault extendedstatus extfilterdefine extfilteroptions fileetag filterchain filterdeclare filterprotocol filterprovider filtertrace forcelanguagepriority forcetype forensiclog gracefulshutdowntimeout group header headername hostnamelookups identitycheck identitychecktimeout imapbase imapdefault imapmenu include indexheadinsert indexignore indexoptions indexorderdefault indexstylesheet isapiappendlogtoerrors isapiappendlogtoquery isapicachefile isapifakeasync isapilognotsupported isapireadaheadbuffer keepalive keepalivetimeout languagepriority ldapcacheentries ldapcachettl ldapconnectiontimeout ldapopcacheentries ldapopcachettl ldapsharedcachefile ldapsharedcachesize ldaptrustedclientcert ldaptrustedglobalcert ldaptrustedmode ldapverifyservercert limitinternalrecursion limitrequestbody limitrequestfields limitrequestfieldsize limitrequestline limitxmlrequestbody listen listenbacklog loadfile loadmodule lockfile logformat loglevel maxclients maxkeepaliverequests maxmemfree maxrequestsperchild maxrequestsperthread maxspareservers maxsparethreads maxthreads mcachemaxobjectcount mcachemaxobjectsize mcachemaxstreamingbuffer mcacheminobjectsize mcacheremovalalgorithm mcachesize metadir metafiles metasuffix mimemagicfile minspareservers minsparethreads mmapfile mod_gzip_on mod_gzip_add_header_count mod_gzip_keep_workfiles mod_gzip_dechunk mod_gzip_min_http mod_gzip_minimum_file_size mod_gzip_maximum_file_size mod_gzip_maximum_inmem_size mod_gzip_temp_dir mod_gzip_item_include mod_gzip_item_exclude mod_gzip_command_version mod_gzip_can_negotiate mod_gzip_handle_methods mod_gzip_static_suffix mod_gzip_send_vary mod_gzip_update_static modmimeusepathinfo multiviewsmatch namevirtualhost noproxy nwssltrustedcerts nwsslupgradeable options order passenv pidfile protocolecho proxybadheader proxyblock proxydomain proxyerroroverride proxyftpdircharset proxyiobuffersize proxymaxforwards proxypass proxypassinterpolateenv proxypassmatch proxypassreverse proxypassreversecookiedomain proxypassreversecookiepath proxypreservehost proxyreceivebuffersize proxyremote proxyremotematch proxyrequests proxyset proxystatus proxytimeout proxyvia readmename receivebuffersize redirect redirectmatch redirectpermanent redirecttemp removecharset removeencoding removehandler removeinputfilter removelanguage removeoutputfilter removetype requestheader require rewritebase rewritecond rewriteengine rewritelock rewritelog rewriteloglevel rewritemap rewriteoptions rewriterule rlimitcpu rlimitmem rlimitnproc satisfy scoreboardfile script scriptalias scriptaliasmatch scriptinterpretersource scriptlog scriptlogbuffer scriptloglength scriptsock securelisten seerequesttail sendbuffersize serveradmin serveralias serverlimit servername serverpath serverroot serversignature servertokens setenv setenvif setenvifnocase sethandler setinputfilter setoutputfilter ssienableaccess ssiendtag ssierrormsg ssistarttag ssitimeformat ssiundefinedecho sslcacertificatefile sslcacertificatepath sslcadnrequestfile sslcadnrequestpath sslcarevocationfile sslcarevocationpath sslcertificatechainfile sslcertificatefile sslcertificatekeyfile sslciphersuite sslcryptodevice sslengine sslhonorciperorder sslmutex ssloptions sslpassphrasedialog sslprotocol sslproxycacertificatefile sslproxycacertificatepath sslproxycarevocationfile sslproxycarevocationpath sslproxyciphersuite sslproxyengine sslproxymachinecertificatefile sslproxymachinecertificatepath sslproxyprotocol sslproxyverify sslproxyverifydepth sslrandomseed sslrequire sslrequiressl sslsessioncache sslsessioncachetimeout sslusername sslverifyclient sslverifydepth startservers startthreads substitute suexecusergroup threadlimit threadsperchild threadstacksize timeout traceenable transferlog typesconfig unsetenv usecanonicalname usecanonicalphysicalport user userdir virtualdocumentroot virtualdocumentrootip virtualscriptalias virtualscriptaliasip win32disableacceptex xbithack",literal:"on off"},contains:[A.HASH_COMMENT_MODE,{className:"sqbracket",begin:"\\s\\[",end:"\\]$"},{className:"cbracket",begin:"[\\$%]\\{",end:"\\}",contains:["self",B]},B,{className:"tag",begin:"</?",end:">"},A.QUOTE_STRING_MODE]}}(hljs);hljs.LANGUAGES.applescript=function(A){var B=A.inherit(A.QUOTE_STRING_MODE,{illegal:""});var E={className:"title",begin:A.UNDERSCORE_IDENT_RE};var D={className:"params",begin:"\\(",end:"\\)",contains:["self",A.C_NUMBER_MODE,B]};var C=[{className:"comment",begin:"--",end:"$"},{className:"comment",begin:"\\(\\*",end:"\\*\\)",contains:["self",{begin:"--",end:"$"}]},A.HASH_COMMENT_MODE];return{keywords:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the then third through thru timeout times to transaction try until where while whose with without",constant:"AppleScript false linefeed return pi quote result space tab true",type:"alias application boolean class constant date file integer list number real record string text",command:"activate beep count delay launch log offset read round run say summarize write",property:"character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},contains:[B,A.C_NUMBER_MODE,{className:"type",begin:"\\bPOSIX file\\b"},{className:"command",begin:"\\b(clipboard info|the clipboard|info for|list (disks|folder)|mount volume|path to|(close|open for) access|(get|set) eof|current date|do shell script|get volume settings|random number|set volume|system attribute|system info|time to GMT|(load|run|store) script|scripting components|ASCII (character|number)|localized string|choose (application|color|file|file name|folder|from list|remote application|URL)|display (alert|dialog))\\b|^\\s*return\\b"},{className:"constant",begin:"\\b(text item delimiters|current application|missing value)\\b"},{className:"keyword",begin:"\\b(apart from|aside from|instead of|out of|greater than|isn't|(doesn't|does not) (equal|come before|come after|contain)|(greater|less) than( or equal)?|(starts?|ends|begins?) with|contained by|comes (before|after)|a (ref|reference))\\b"},{className:"property",begin:"\\b(POSIX path|(date|time) string|quoted form)\\b"},{className:"function_start",beginWithKeyword:true,keywords:"on",illegal:"[${=;\\n]",contains:[E,D]}].concat(C)}}(hljs);hljs.LANGUAGES.avrasm=function(A){return{case_insensitive:true,keywords:{keyword:"adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf"},contains:[A.C_BLOCK_COMMENT_MODE,{className:"comment",begin:";",end:"$"},A.C_NUMBER_MODE,A.BINARY_NUMBER_MODE,{className:"number",begin:"\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"},A.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",illegal:"[^\\\\][^']"},{className:"label",begin:"^[A-Za-z0-9_.$]+:"},{className:"preprocessor",begin:"#",end:"$"},{className:"preprocessor",begin:"\\.[a-zA-Z]+"},{className:"localvars",begin:"@[0-9]+"}]}}(hljs);hljs.LANGUAGES.axapta=function(A){return{keywords:"false int abstract private char interface boolean static null if for true while long throw finally protected extends final implements return void enum else break new catch byte super class case short default double public try this switch continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count order group by asc desc index hint like dispaly edit client server ttsbegin ttscommit str real date container anytype common div mod",contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_NUMBER_MODE,{className:"preprocessor",begin:"#",end:"$"},{className:"class",beginWithKeyword:true,end:"{",illegal:":",keywords:"class interface",contains:[{className:"inheritance",beginWithKeyword:true,keywords:"extends implements",relevance:10},{className:"title",begin:A.UNDERSCORE_IDENT_RE}]}]}}(hljs);hljs.LANGUAGES.bash=function(A){var G="true false";var E="if then else elif fi for break continue while in do done echo exit return set declare";var C={className:"variable",begin:"\\$[a-zA-Z0-9_#]+"};var B={className:"variable",begin:"\\${([^}]|\\\\})+}"};var H={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[A.BACKSLASH_ESCAPE,C,B],relevance:0};var D={className:"string",begin:"'",end:"'",contains:[{begin:"''"}],relevance:0};var F={className:"test_condition",begin:"",end:"",contains:[H,D,C,B],keywords:{literal:G},relevance:0};return{keywords:{keyword:E,literal:G},contains:[{className:"shebang",begin:"(#!\\/bin\\/bash)|(#!\\/bin\\/sh)",relevance:10},C,B,A.HASH_COMMENT_MODE,H,D,A.inherit(F,{begin:"\\[ ",end:" \\]",relevance:0}),A.inherit(F,{begin:"\\[\\[ ",end:" \\]\\]"})]}}(hljs);hljs.LANGUAGES.brainfuck=function(A){return{contains:[{className:"comment",begin:"[^\\[\\]\\.,\\+\\-<> \r\n]",excludeEnd:true,end:"[\\[\\]\\.,\\+\\-<> \r\n]",relevance:0},{className:"title",begin:"[\\[\\]]",relevance:0},{className:"string",begin:"[\\.,]"},{className:"literal",begin:"[\\+\\-]"}]}}(hljs);hljs.LANGUAGES.clojure=function(K){var I={built_in:"def cond apply if-not if-let if not not= = &lt; < > &lt;= <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for doseq dosync dotimes and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import intern refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! import use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if throw printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time ns assert re-find re-groups rand-int rand mod locking assert-valid-fdecl alias namespace resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! memfn to-array future future-call into-array aset gen-class reduce merge map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"};var E="[a-zA-Z_0-9\\!\\.\\?\\-\\+\\*\\/\\<\\=\\>\\&\\#\\$';]+";var A="[\\s:\\(\\{]+\\d+(\\.\\d+)?";var D={className:"number",begin:A,relevance:0};var J={className:"string",begin:'"',end:'"',contains:[K.BACKSLASH_ESCAPE],relevance:0};var N={className:"comment",begin:";",end:"$",relevance:0};var M={className:"collection",begin:"[\\[\\{]",end:"[\\]\\}]"};var C={className:"comment",begin:"\\^"+E};var B={className:"comment",begin:"\\^\\{",end:"\\}"};var G={className:"attribute",begin:"[:]"+E};var L={className:"list",begin:"\\(",end:"\\)",relevance:0};var F={endsWithParent:true,excludeEnd:true,keywords:{literal:"true false nil"},relevance:0};var H={keywords:I,lexems:E,className:"title",begin:E,starts:F};L.contains=[{className:"comment",begin:"comment"},H];F.contains=[L,J,C,B,N,G,M,D];M.contains=[L,J,C,N,G,M,D];return{illegal:"\\S",contains:[N,L]}}(hljs);hljs.LANGUAGES.cmake=function(A){return{case_insensitive:true,keywords:"add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_minimum_required cmake_policy configure_file create_test_sourcelist define_property else elseif enable_language enable_testing endforeach endfunction endif endmacro endwhile execute_process export find_file find_library find_package find_path find_program fltk_wrap_ui foreach function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install link_directories load_cache load_command macro mark_as_advanced message option output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_link_libraries try_compile try_run unset variable_watch while build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file",contains:[{className:"envvar",begin:"\\${",end:"}"},A.HASH_COMMENT_MODE,A.QUOTE_STRING_MODE,A.NUMBER_MODE]}}(hljs);hljs.LANGUAGES.coffeescript=function(C){var B={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off ",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf"};var A="[A-Za-z$_][0-9A-Za-z$_]*";var E={className:"title",begin:A};var D={className:"subst",begin:"#\\{",end:"}",keywords:B,contains:[C.BINARY_NUMBER_MODE,C.C_NUMBER_MODE]};return{keywords:B,contains:[C.BINARY_NUMBER_MODE,C.C_NUMBER_MODE,C.APOS_STRING_MODE,{className:"string",begin:'"""',end:'"""',contains:[C.BACKSLASH_ESCAPE,D]},{className:"string",begin:'"',end:'"',contains:[C.BACKSLASH_ESCAPE,D],relevance:0},{className:"comment",begin:"###",end:"###"},C.HASH_COMMENT_MODE,{className:"regexp",begin:"///",end:"///",contains:[C.HASH_COMMENT_MODE]},{className:"regexp",begin:"//[gim]*"},{className:"regexp",begin:"/\\S(\\\\.|[^\\n])*/[gim]*"},{begin:"`",end:"`",excludeBegin:true,excludeEnd:true,subLanguage:"javascript"},{className:"function",begin:A+"\\s*=\\s*(\\(.+\\))?\\s*[-=]>",returnBegin:true,contains:[E,{className:"params",begin:"\\(",end:"\\)"}]},{className:"class",beginWithKeyword:true,keywords:"class",end:"$",illegal:":",contains:[{beginWithKeyword:true,keywords:"extends",endsWithParent:true,illegal:":",contains:[E]},E]},{className:"property",begin:"@"+A}]}}(hljs);hljs.LANGUAGES.cpp=function(A){var B={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr"};return{keywords:B,illegal:"</",contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.QUOTE_STRING_MODE,{className:"string",begin:"'\\\\?.",end:"'",illegal:"."},{className:"number",begin:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},A.C_NUMBER_MODE,{className:"preprocessor",begin:"#",end:"$"},{className:"stl_container",begin:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",end:">",keywords:B,relevance:10,contains:["self"]}]}}(hljs);hljs.LANGUAGES.cs=function(A){return{keywords:"abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while ascending descending from get group into join let orderby partial select set value var where yield",contains:[{className:"comment",begin:"///",end:"$",returnBegin:true,contains:[{className:"xmlDocTag",begin:"///|<!--|-->"},{className:"xmlDocTag",begin:"</?",end:">"}]},A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,{className:"preprocessor",begin:"#",end:"$",keywords:"if else elif endif define undef warning error line region endregion pragma checksum"},{className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_NUMBER_MODE]}}(hljs);hljs.LANGUAGES.css=function(A){var B={className:"function",begin:A.IDENT_RE+"\\(",end:"\\)",contains:[A.NUMBER_MODE,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE]};return{case_insensitive:true,illegal:"[=/|']",contains:[A.C_BLOCK_COMMENT_MODE,{className:"id",begin:"\\#[A-Za-z0-9_-]+"},{className:"class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},{className:"attr_selector",begin:"\\[",end:"\\]",illegal:"$"},{className:"pseudo",begin:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{className:"at_rule",begin:"@(font-face|page)",lexems:"[a-z-]+",keywords:"font-face page"},{className:"at_rule",begin:"@",end:"[{;]",excludeEnd:true,keywords:"import page media charset",contains:[B,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.NUMBER_MODE]},{className:"tag",begin:A.IDENT_RE,relevance:0},{className:"rules",begin:"{",end:"}",illegal:"[^\\s]",relevance:0,contains:[A.C_BLOCK_COMMENT_MODE,{className:"rule",begin:"[^\\s]",returnBegin:true,end:";",endsWithParent:true,contains:[{className:"attribute",begin:"[A-Z\\_\\.\\-]+",end:":",excludeEnd:true,illegal:"[^\\s]",starts:{className:"value",endsWithParent:true,excludeEnd:true,contains:[B,A.NUMBER_MODE,A.QUOTE_STRING_MODE,A.APOS_STRING_MODE,A.C_BLOCK_COMMENT_MODE,{className:"hexcolor",begin:"\\#[0-9A-F]+"},{className:"important",begin:"!important"}]}}]}]}]}}(hljs);hljs.LANGUAGES.d=function(X){var B={keyword:"abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",built_in:"bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",literal:"false null true"};var C="(0|[1-9][\\d_]*)",Q="(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)",H="0[bB][01_]+",V="([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)",Y="0[xX]"+V,P="([eE][+-]?"+Q+")",O="("+Q+"(\\.\\d*|"+P+")|\\d+\\."+Q+Q+"|\\."+C+P+"?)",K="(0[xX]("+V+"\\."+V+"|\\.?"+V+")[pP][+-]?"+Q+")",L="("+C+"|"+H+"|"+Y+")",N="("+K+"|"+O+")";var Z="\\\\(['\"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};";var M={className:"number",begin:"\\b"+L+"(L|u|U|Lu|LU|uL|UL)?",relevance:0};var J={className:"number",begin:"\\b("+N+"([fF]|L|i|[fF]i|Li)?|"+L+"(i|[fF]i|Li))",relevance:0};var S={className:"string",begin:"'("+Z+"|.)",end:"'",illegal:"."};var R={begin:Z,relevance:0};var W={className:"string",begin:'"',contains:[R],end:'"[cwd]?',relevance:0};var F={className:"string",begin:'[rq]"',end:'"[cwd]?',relevance:5};var U={className:"string",begin:"`",end:"`[cwd]?"};var I={className:"string",begin:'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',relevance:10};var T={className:"string",begin:'q"\\{',end:'\\}"'};var E={className:"shebang",begin:"^#!",end:"$",relevance:5};var G={className:"preprocessor",begin:"#(line)",end:"$",relevance:5};var D={className:"keyword",begin:"@[a-zA-Z_][a-zA-Z_\\d]*"};var A={className:"comment",begin:"\\/\\+",contains:["self"],end:"\\+\\/",relevance:10};return{lexems:X.UNDERSCORE_IDENT_RE,keywords:B,contains:[X.C_LINE_COMMENT_MODE,X.C_BLOCK_COMMENT_MODE,A,I,W,F,U,T,J,M,S,E,G,D]}}(hljs);hljs.LANGUAGES.delphi=function(B){var F="and safecall cdecl then string exports library not pascal set virtual file in array label packed end. index while const raise for to implementation with except overload destructor downto finally program exit unit inherited override if type until function do begin repeat goto nil far initialization object else var uses external resourcestring interface end finalization class asm mod case on shr shl of register xorwrite threadvar try record near stored constructor stdcall inline div out or procedure";var E="safecall stdcall pascal stored const implementation finalization except to finally program inherited override then exports string read not mod shr try div shl set library message packed index for near overload label downto exit public goto interface asm on of constructor or private array unit raise destructor var type until function else external with case default record while protected property procedure published and cdecl do threadvar file in if end virtual write far out begin repeat nil initialization object uses resourcestring class register xorwrite inline static";var A={className:"comment",begin:"{",end:"}",relevance:0};var G={className:"comment",begin:"\\(\\*",end:"\\*\\)",relevance:10};var C={className:"string",begin:"'",end:"'",contains:[{begin:"''"}],relevance:0};var D={className:"string",begin:"(#\\d+)+"};var H={className:"function",beginWithKeyword:true,end:"[:;]",keywords:"function constructor|10 destructor|10 procedure|10",contains:[{className:"title",begin:B.IDENT_RE},{className:"params",begin:"\\(",end:"\\)",keywords:F,contains:[C,D]},A,G]};return{case_insensitive:true,keywords:F,illegal:'("|\\$[G-Zg-z]|\\/\\*|</)',contains:[A,G,B.C_LINE_COMMENT_MODE,C,D,B.NUMBER_MODE,H,{className:"class",begin:"=\\bclass\\b",end:"end;",keywords:E,contains:[C,D,A,G,B.C_LINE_COMMENT_MODE,H]}]}}(hljs);hljs.LANGUAGES.diff=function(A){return{contains:[{className:"chunk",begin:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",relevance:10},{className:"chunk",begin:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",relevance:10},{className:"chunk",begin:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",relevance:10},{className:"header",begin:"Index: ",end:"$"},{className:"header",begin:"=====",end:"=====$"},{className:"header",begin:"^\\-\\-\\-",end:"$"},{className:"header",begin:"^\\*{3} ",end:"$"},{className:"header",begin:"^\\+\\+\\+",end:"$"},{className:"header",begin:"\\*{5}",end:"\\*{5}$"},{className:"addition",begin:"^\\+",end:"$"},{className:"deletion",begin:"^\\-",end:"$"},{className:"change",begin:"^\\!",end:"$"}]}}(hljs);hljs.LANGUAGES.xml=function(A){var C="[A-Za-z0-9\\._:-]+";var B={endsWithParent:true,contains:[{className:"attribute",begin:C,relevance:0},{begin:'="',returnBegin:true,end:'"',contains:[{className:"value",begin:'"',endsWithParent:true}]},{begin:"='",returnBegin:true,end:"'",contains:[{className:"value",begin:"'",endsWithParent:true}]},{begin:"=",contains:[{className:"value",begin:"[^\\s/>]+"}]}]};return{case_insensitive:true,contains:[{className:"pi",begin:"<\\?",end:"\\?>",relevance:10},{className:"doctype",begin:"<!DOCTYPE",end:">",relevance:10,contains:[{begin:"\\[",end:"\\]"}]},{className:"comment",begin:"<!--",end:"-->",relevance:10},{className:"cdata",begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},{className:"tag",begin:"<style(?=\\s|>|$)",end:">",keywords:{title:"style"},contains:[B],starts:{end:"</style>",returnEnd:true,subLanguage:"css"}},{className:"tag",begin:"<script(?=\\s|>|$)",end:">",keywords:{title:"script"},contains:[B],starts:{end:"<\/script>",returnEnd:true,subLanguage:"javascript"}},{begin:"<%",end:"%>",subLanguage:"vbscript"},{className:"tag",begin:"</?",end:"/?>",contains:[{className:"title",begin:"[^ />]+"},B]}]}}(hljs);hljs.LANGUAGES.django=function(C){function E(H,G){return(G==undefined||(!H.className&&G.className=="tag")||H.className=="value")}function F(L,K){var G={};for(var J in L){if(J!="contains"){G[J]=L[J]}var I=[];for(var H=0;L.contains&&H<L.contains.length;H++){I.push(F(L.contains[H],L))}if(E(L,K)){I=B.concat(I)}if(I.length){G.contains=I}}return G}var D={className:"filter",begin:"\\|[A-Za-z]+\\:?",excludeEnd:true,keywords:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone",contains:[{className:"argument",begin:'"',end:'"'}]};var B=[{className:"template_comment",begin:"{%\\s*comment\\s*%}",end:"{%\\s*endcomment\\s*%}"},{className:"template_comment",begin:"{#",end:"#}"},{className:"template_tag",begin:"{%",end:"%}",keywords:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor in ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup by as ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone",contains:[D]},{className:"variable",begin:"{{",end:"}}",contains:[D]}];var A=F(C.LANGUAGES.xml);A.case_insensitive=true;return A}(hljs);hljs.LANGUAGES.dos=function(A){return{case_insensitive:true,keywords:{flow:"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",keyword:"shift cd dir echo setlocal endlocal set pause copy",stream:"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux",winutils:"ping net ipconfig taskkill xcopy ren del"},contains:[{className:"envvar",begin:"%%[^ ]"},{className:"envvar",begin:"%[^ ]+?%"},{className:"envvar",begin:"![^ ]+?!"},{className:"number",begin:"\\b\\d+",relevance:0},{className:"comment",begin:"@?rem",end:"$"}]}}(hljs);hljs.LANGUAGES["erlang-repl"]=function(A){return{keywords:{special_functions:"spawn spawn_link self",reserved:"after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"},contains:[{className:"prompt",begin:"^[0-9]+> ",relevance:10},{className:"comment",begin:"%",end:"$"},{className:"number",begin:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",relevance:0},A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,{className:"constant",begin:"\\?(::)?([A-Z]\\w*(::)?)+"},{className:"arrow",begin:"->"},{className:"ok",begin:"ok"},{className:"exclamation_mark",begin:"!"},{className:"function_or_atom",begin:"(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",relevance:0},{className:"variable",begin:"[A-Z][a-zA-Z0-9_']*",relevance:0}]}}(hljs);hljs.LANGUAGES.erlang=function(I){var C="[a-z'][a-zA-Z0-9_']*";var O="("+C+":"+C+"|"+C+")";var F={keyword:"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun let not of orelse|10 query receive rem try when xor",literal:"false true"};var L={className:"comment",begin:"%",end:"$",relevance:0};var E={className:"number",begin:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",relevance:0};var G={begin:"fun\\s+"+C+"/\\d+"};var N={begin:O+"\\(",end:"\\)",returnBegin:true,relevance:0,contains:[{className:"function_name",begin:O,relevance:0},{begin:"\\(",end:"\\)",endsWithParent:true,returnEnd:true,relevance:0}]};var H={className:"tuple",begin:"{",end:"}",relevance:0};var A={className:"variable",begin:"\\b_([A-Z][A-Za-z0-9_]*)?",relevance:0};var M={className:"variable",begin:"[A-Z][a-zA-Z0-9_]*",relevance:0};var B={begin:"#",end:"}",illegal:".",relevance:0,returnBegin:true,contains:[{className:"record_name",begin:"#"+I.UNDERSCORE_IDENT_RE,relevance:0},{begin:"{",endsWithParent:true,relevance:0}]};var K={keywords:F,begin:"(fun|receive|if|try|case)",end:"end"};K.contains=[L,G,I.inherit(I.APOS_STRING_MODE,{className:""}),K,N,I.QUOTE_STRING_MODE,E,H,A,M,B];var J=[L,G,K,N,I.QUOTE_STRING_MODE,E,H,A,M,B];N.contains[1].contains=J;H.contains=J;B.contains[1].contains=J;var D={className:"params",begin:"\\(",end:"\\)",contains:J};return{keywords:F,illegal:"(</|\\*=|\\+=|-=|/=|/\\*|\\*/|\\(\\*|\\*\\))",contains:[{className:"function",begin:"^"+C+"\\s*\\(",end:"->",returnBegin:true,illegal:"\\(|#|//|/\\*|\\\\|:",contains:[D,{className:"title",begin:C}],starts:{end:";|\\.",keywords:F,contains:J}},L,{className:"pp",begin:"^-",end:"\\.",relevance:0,excludeEnd:true,returnBegin:true,lexems:"-"+I.IDENT_RE,keywords:"-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior",contains:[D]},E,I.QUOTE_STRING_MODE,B,A,M,H]}}(hljs);hljs.LANGUAGES.glsl=function(A){return{keywords:{keyword:"atomic_uint attribute bool break bvec2 bvec3 bvec4 case centroid coherent const continue default discard dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 do double dvec2 dvec3 dvec4 else flat float for highp if iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray in inout int invariant isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 layout lowp mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 mediump noperspective out patch precision readonly restrict return sample sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow smooth struct subroutine switch uimage1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint uniform usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D usamplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 varying vec2 vec3 vec4 void volatile while writeonly",built_in:"gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffsetgl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_PerVertex gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicCounter atomicCounterDecrement atomicCounterIncrement barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow gl_TextureMatrix gl_TextureMatrixInverse",literal:"true false"},illegal:'"',contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.C_NUMBER_MODE,{className:"preprocessor",begin:"#",end:"$"}]}}(hljs);hljs.LANGUAGES.go=function(A){var B={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer",constant:"true false iota nil",typename:"bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{keywords:B,illegal:"</",contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",relevance:0},{className:"string",begin:"`",end:"`"},{className:"number",begin:"[^a-zA-Z_0-9](\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?",relevance:0},A.C_NUMBER_MODE]}}(hljs);hljs.LANGUAGES.haskell=function(A){var D={className:"type",begin:"\\b[A-Z][\\w']*",relevance:0};var C={className:"container",begin:"\\(",end:"\\)",contains:[{className:"type",begin:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},{className:"title",begin:"[_a-z][\\w']*"}]};var B={className:"container",begin:"{",end:"}",contains:C.contains};return{keywords:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance not as foreign ccall safe unsafe",contains:[{className:"comment",begin:"--",end:"$"},{className:"preprocessor",begin:"{-#",end:"#-}"},{className:"comment",contains:["self"],begin:"{-",end:"-}"},{className:"string",begin:"\\s+'",end:"'",contains:[A.BACKSLASH_ESCAPE],relevance:0},A.QUOTE_STRING_MODE,{className:"import",begin:"\\bimport",end:"$",keywords:"import qualified as hiding",contains:[C],illegal:"\\W\\.|;"},{className:"module",begin:"\\bmodule",end:"where",keywords:"module where",contains:[C],illegal:"\\W\\.|;"},{className:"class",begin:"\\b(class|instance)",end:"where",keywords:"class where instance",contains:[D]},{className:"typedef",begin:"\\b(data|(new)?type)",end:"$",keywords:"data type newtype deriving",contains:[D,C,B]},A.C_NUMBER_MODE,{className:"shebang",begin:"#!\\/usr\\/bin\\/env runhaskell",end:"$"},D,{className:"title",begin:"^[_a-z][\\w']*"}]}}(hljs);hljs.LANGUAGES.http=function(A){return{illegal:"\\S",contains:[{className:"status",begin:"^HTTP/[0-9\\.]+",end:"$",contains:[{className:"number",begin:"\\b\\d{3}\\b"}]},{className:"request",begin:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",returnBegin:true,end:"$",contains:[{className:"string",begin:" ",end:" ",excludeBegin:true,excludeEnd:true}]},{className:"attribute",begin:"^\\w",end:": ",excludeEnd:true,illegal:"\\n|\\s|=",starts:{className:"string",end:"$"}},{begin:"\\n\\n",starts:{subLanguage:"",endsWithParent:true}}]}}(hljs);hljs.LANGUAGES.ini=function(A){return{case_insensitive:true,illegal:"[^\\s]",contains:[{className:"comment",begin:";",end:"$"},{className:"title",begin:"^\\[",end:"\\]"},{className:"setting",begin:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",end:"$",contains:[{className:"value",endsWithParent:true,keywords:"on off true false yes no",contains:[A.QUOTE_STRING_MODE,A.NUMBER_MODE]}]}]}}(hljs);hljs.LANGUAGES.java=function(A){return{keywords:"false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws",contains:[{className:"javadoc",begin:"/\\*\\*",end:"\\*/",contains:[{className:"javadoctag",begin:"@[A-Za-z]+"}],relevance:10},A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,{className:"class",beginWithKeyword:true,end:"{",keywords:"class interface",illegal:":",contains:[{beginWithKeyword:true,keywords:"extends implements",relevance:10},{className:"title",begin:A.UNDERSCORE_IDENT_RE}]},A.C_NUMBER_MODE,{className:"annotation",begin:"@[A-Za-z]+"}]}}(hljs);hljs.LANGUAGES.javascript=function(A){return{keywords:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const",literal:"true false null undefined NaN Infinity"},contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.C_NUMBER_MODE,{begin:"("+A.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,{className:"regexp",begin:"/",end:"/[gim]*",illegal:"\\n",contains:[{begin:"\\\\/"}]},{begin:"<",end:">;",subLanguage:"xml"}],relevance:0},{className:"function",beginWithKeyword:true,end:"{",keywords:"function",contains:[{className:"title",begin:"[A-Za-z$_][0-9A-Za-z$_]*"},{className:"params",begin:"\\(",end:"\\)",contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE],illegal:"[\"'\\(]"}],illegal:"\\[|%"}]}}(hljs);hljs.LANGUAGES.json=function(A){var E={literal:"true false null"};var D=[A.QUOTE_STRING_MODE,A.C_NUMBER_MODE];var C={className:"value",end:",",endsWithParent:true,excludeEnd:true,contains:D,keywords:E};var B={begin:"{",end:"}",contains:[{className:"attribute",begin:'\\s*"',end:'"\\s*:\\s*',excludeBegin:true,excludeEnd:true,contains:[A.BACKSLASH_ESCAPE],illegal:"\\n",starts:C}],illegal:"\\S"};var F={begin:"\\[",end:"\\]",contains:[A.inherit(C,{className:null})],illegal:"\\S"};D.splice(D.length,0,B,F);return{contains:D,keywords:E,illegal:"\\S"}}(hljs);hljs.LANGUAGES.lisp=function(I){var K="[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#]*";var L="(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?";var A={className:"literal",begin:"\\b(t{1}|nil)\\b"};var D=[{className:"number",begin:L},{className:"number",begin:"#b[0-1]+(/[0-1]+)?"},{className:"number",begin:"#o[0-7]+(/[0-7]+)?"},{className:"number",begin:"#x[0-9a-f]+(/[0-9a-f]+)?"},{className:"number",begin:"#c\\("+L+" +"+L,end:"\\)"}];var H={className:"string",begin:'"',end:'"',contains:[I.BACKSLASH_ESCAPE],relevance:0};var M={className:"comment",begin:";",end:"$"};var G={className:"variable",begin:"\\*",end:"\\*"};var N={className:"keyword",begin:"[:&]"+K};var B={begin:"\\(",end:"\\)",contains:["self",A,H].concat(D)};var E={className:"quoted",begin:"['`]\\(",end:"\\)",contains:D.concat([H,G,N,B])};var C={className:"quoted",begin:"\\(quote ",end:"\\)",keywords:{title:"quote"},contains:D.concat([H,G,N,B])};var J={className:"list",begin:"\\(",end:"\\)"};var F={className:"body",endsWithParent:true,excludeEnd:true};J.contains=[{className:"title",begin:K},F];F.contains=[E,C,J,A].concat(D).concat([H,M,G,N]);return{illegal:"[^\\s]",contains:D.concat([A,H,M,E,C,J])}}(hljs);hljs.LANGUAGES.lua=function(B){var A="\\[=*\\[";var E="\\]=*\\]";var C={begin:A,end:E,contains:["self"]};var D=[{className:"comment",begin:"--(?!"+A+")",end:"$"},{className:"comment",begin:"--"+A,end:E,contains:[C],relevance:10}];return{lexems:B.UNDERSCORE_IDENT_RE,keywords:{keyword:"and break do else elseif end false for if in local nil not or repeat return then true until while",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},contains:D.concat([{className:"function",beginWithKeyword:true,end:"\\)",keywords:"function",contains:[{className:"title",begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"},{className:"params",begin:"\\(",endsWithParent:true,contains:D}].concat(D)},B.C_NUMBER_MODE,B.APOS_STRING_MODE,B.QUOTE_STRING_MODE,{className:"string",begin:A,end:E,contains:[C],relevance:10}])}}(hljs);hljs.LANGUAGES.markdown=function(A){return{contains:[{className:"header",begin:"^#{1,3}",end:"$"},{className:"header",begin:"^.+?\\n[=-]{2,}$"},{begin:"<",end:">",subLanguage:"xml",relevance:0},{className:"bullet",begin:"^([*+-]|(\\d+\\.))\\s+"},{className:"strong",begin:"[*_]{2}.+?[*_]{2}"},{className:"emphasis",begin:"\\*.+?\\*"},{className:"emphasis",begin:"_.+?_",relevance:0},{className:"blockquote",begin:"^>\\s+",end:"$"},{className:"code",begin:"`.+?`"},{className:"code",begin:"^    ",end:"$",relevance:0},{className:"horizontal_rule",begin:"^-{3,}",end:"$"},{begin:"\\[.+?\\]\\(.+?\\)",returnBegin:true,contains:[{className:"link_label",begin:"\\[.+\\]"},{className:"link_url",begin:"\\(",end:"\\)",excludeBegin:true,excludeEnd:true}]}]}}(hljs);hljs.LANGUAGES.matlab=function(A){var B=[A.C_NUMBER_MODE,{className:"string",begin:"'",end:"'",contains:[A.BACKSLASH_ESCAPE,{begin:"''"}],relevance:0}];return{keywords:{keyword:"break case catch classdef continue else elseif end enumerated events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson"},illegal:'(//|"|#|/\\*|\\s+/\\w+)',contains:[{className:"function",beginWithKeyword:true,end:"$",keywords:"function",contains:[{className:"title",begin:A.UNDERSCORE_IDENT_RE},{className:"params",begin:"\\(",end:"\\)"},{className:"params",begin:"\\[",end:"\\]"}]},{className:"transposed_variable",begin:"[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",end:""},{className:"matrix",begin:"\\[",end:"\\]'*[\\.']*",contains:B},{className:"cell",begin:"\\{",end:"\\}'*[\\.']*",contains:B},{className:"comment",begin:"\\%",end:"$"}].concat(B)}}(hljs);hljs.LANGUAGES.mel=function(A){return{keywords:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",illegal:"</",contains:[A.C_NUMBER_MODE,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,{className:"string",begin:"`",end:"`",contains:[A.BACKSLASH_ESCAPE]},{className:"variable",begin:"\\$\\d",relevance:5},{className:"variable",begin:"[\\$\\%\\@\\*](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)"},A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE]}}(hljs);hljs.LANGUAGES.nginx=function(B){var C=[{className:"variable",begin:"\\$\\d+"},{className:"variable",begin:"\\${",end:"}"},{className:"variable",begin:"[\\$\\@]"+B.UNDERSCORE_IDENT_RE}];var A={endsWithParent:true,lexems:"[a-z/_]+",keywords:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},relevance:0,illegal:"=>",contains:[B.HASH_COMMENT_MODE,{className:"string",begin:'"',end:'"',contains:[B.BACKSLASH_ESCAPE].concat(C),relevance:0},{className:"string",begin:"'",end:"'",contains:[B.BACKSLASH_ESCAPE].concat(C),relevance:0},{className:"url",begin:"([a-z]+):/",end:"\\s",endsWithParent:true,excludeEnd:true},{className:"regexp",begin:"\\s\\^",end:"\\s|{|;",returnEnd:true,contains:[B.BACKSLASH_ESCAPE].concat(C)},{className:"regexp",begin:"~\\*?\\s+",end:"\\s|{|;",returnEnd:true,contains:[B.BACKSLASH_ESCAPE].concat(C)},{className:"regexp",begin:"\\*(\\.[a-z\\-]+)+",contains:[B.BACKSLASH_ESCAPE].concat(C)},{className:"regexp",begin:"([a-z\\-]+\\.)+\\*",contains:[B.BACKSLASH_ESCAPE].concat(C)},{className:"number",begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{className:"number",begin:"\\b\\d+[kKmMgGdshdwy]*\\b",relevance:0}].concat(C)};return{contains:[B.HASH_COMMENT_MODE,{begin:B.UNDERSCORE_IDENT_RE+"\\s",end:";|{",returnBegin:true,contains:[{className:"title",begin:B.UNDERSCORE_IDENT_RE,starts:A}]}],illegal:"[^\\s\\}]"}}(hljs);hljs.LANGUAGES.objectivec=function(A){var B={keyword:"int float while private char catch export sizeof typedef const struct for union unsigned long volatile static protected bool mutable if public do return goto void enum else break extern class asm case short default double throw register explicit signed typename try this switch continue wchar_t inline readonly assign property protocol self synchronized end synthesize id optional required implementation nonatomic interface super unichar finally dynamic IBOutlet IBAction selector strong weak readonly",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection class UIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"};return{keywords:B,illegal:"</",contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.C_NUMBER_MODE,A.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",illegal:"[^\\\\][^']"},{className:"preprocessor",begin:"#import",end:"$",contains:[{className:"title",begin:'"',end:'"'},{className:"title",begin:"<",end:">"}]},{className:"preprocessor",begin:"#",end:"$"},{className:"class",beginWithKeyword:true,end:"({|$)",keywords:"interface class protocol implementation",contains:[{className:"id",begin:A.UNDERSCORE_IDENT_RE}]},{className:"variable",begin:"\\."+A.UNDERSCORE_IDENT_RE}]}}(hljs);hljs.LANGUAGES.parser3=function(A){return{subLanguage:"xml",contains:[{className:"comment",begin:"^#",end:"$"},{className:"comment",begin:"\\^rem{",end:"}",relevance:10,contains:[{begin:"{",end:"}",contains:["self"]}]},{className:"preprocessor",begin:"^@(?:BASE|USE|CLASS|OPTIONS)$",relevance:10},{className:"title",begin:"@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"},{className:"variable",begin:"\\$\\{?[\\w\\-\\.\\:]+\\}?"},{className:"keyword",begin:"\\^[\\w\\-\\.\\:]+"},{className:"number",begin:"\\^#[0-9a-fA-F]+"},A.C_NUMBER_MODE]}}(hljs);hljs.LANGUAGES.perl=function(E){var A="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when";var D={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:A,relevance:10};var B={className:"variable",begin:"\\$\\d"};var I={className:"variable",begin:"[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)"};var F=[E.BACKSLASH_ESCAPE,D,B,I];var H={begin:"->",contains:[{begin:E.IDENT_RE},{begin:"{",end:"}"}]};var G={className:"comment",begin:"^(__END__|__DATA__)",end:"\\n$",relevance:5};var C=[B,I,E.HASH_COMMENT_MODE,G,{className:"comment",begin:"^\\=\\w",end:"\\=cut",endsWithParent:true},H,{className:"string",begin:"q[qwxr]?\\s*\\(",end:"\\)",contains:F,relevance:5},{className:"string",begin:"q[qwxr]?\\s*\\[",end:"\\]",contains:F,relevance:5},{className:"string",begin:"q[qwxr]?\\s*\\{",end:"\\}",contains:F,relevance:5},{className:"string",begin:"q[qwxr]?\\s*\\|",end:"\\|",contains:F,relevance:5},{className:"string",begin:"q[qwxr]?\\s*\\<",end:"\\>",contains:F,relevance:5},{className:"string",begin:"qw\\s+q",end:"q",contains:F,relevance:5},{className:"string",begin:"'",end:"'",contains:[E.BACKSLASH_ESCAPE],relevance:0},{className:"string",begin:'"',end:'"',contains:F,relevance:0},{className:"string",begin:"`",end:"`",contains:[E.BACKSLASH_ESCAPE]},{className:"string",begin:"{\\w+}",relevance:0},{className:"string",begin:"-?\\w+\\s*\\=\\>",relevance:0},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"("+E.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[E.HASH_COMMENT_MODE,G,{className:"regexp",begin:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",relevance:10},{className:"regexp",begin:"(m|qr)?/",end:"/[a-z]*",contains:[E.BACKSLASH_ESCAPE],relevance:0}]},{className:"sub",beginWithKeyword:true,end:"(\\s*\\(.*?\\))?[;{]",keywords:"sub",relevance:5},{className:"operator",begin:"-\\w\\b",relevance:0}];D.contains=C;H.contains[1].contains=C;return{keywords:A,contains:C}}(hljs);hljs.LANGUAGES.php=function(A){var E={className:"variable",begin:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var B=[A.inherit(A.APOS_STRING_MODE,{illegal:null}),A.inherit(A.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:'b"',end:'"',contains:[A.BACKSLASH_ESCAPE]},{className:"string",begin:"b'",end:"'",contains:[A.BACKSLASH_ESCAPE]}];var C=[A.BINARY_NUMBER_MODE,A.C_NUMBER_MODE];var D={className:"title",begin:A.UNDERSCORE_IDENT_RE};return{case_insensitive:true,keywords:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return implements parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception php_user_filter default die require __FUNCTION__ enddeclare final try this switch continue endfor endif declare unset true false namespace trait goto instanceof insteadof __DIR__ __NAMESPACE__ __halt_compiler",contains:[A.C_LINE_COMMENT_MODE,A.HASH_COMMENT_MODE,{className:"comment",begin:"/\\*",end:"\\*/",contains:[{className:"phpdoc",begin:"\\s@[A-Za-z]+"}]},{className:"comment",excludeBegin:true,begin:"__halt_compiler.+?;",endsWithParent:true},{className:"string",begin:"<<<['\"]?\\w+['\"]?$",end:"^\\w+;",contains:[A.BACKSLASH_ESCAPE]},{className:"preprocessor",begin:"<\\?php",relevance:10},{className:"preprocessor",begin:"\\?>"},E,{className:"function",beginWithKeyword:true,end:"{",keywords:"function",illegal:"\\$|\\[|%",contains:[D,{className:"params",begin:"\\(",end:"\\)",contains:["self",E,A.C_BLOCK_COMMENT_MODE].concat(B).concat(C)}]},{className:"class",beginWithKeyword:true,end:"{",keywords:"class",illegal:"[:\\(\\$]",contains:[{beginWithKeyword:true,endsWithParent:true,keywords:"extends",contains:[D]},D]},{begin:"=>"}].concat(B).concat(C)}}(hljs);hljs.LANGUAGES.profile=function(A){return{contains:[A.C_NUMBER_MODE,{className:"builtin",begin:"{",end:"}$",excludeBegin:true,excludeEnd:true,contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE],relevance:0},{className:"filename",begin:"[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",end:":",excludeEnd:true},{className:"header",begin:"(ncalls|tottime|cumtime)",end:"$",keywords:"ncalls tottime|10 cumtime|10 filename",relevance:10},{className:"summary",begin:"function calls",end:"$",contains:[A.C_NUMBER_MODE],relevance:10},A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,{className:"function",begin:"\\(",end:"\\)$",contains:[{className:"title",begin:A.UNDERSCORE_IDENT_RE,relevance:0}],relevance:0}]}}(hljs);hljs.LANGUAGES.python=function(A){var F={className:"prompt",begin:"^(>>>|\\.\\.\\.) "};var C=[{className:"string",begin:"(u|b)?r?'''",end:"'''",contains:[F],relevance:10},{className:"string",begin:'(u|b)?r?"""',end:'"""',contains:[F],relevance:10},{className:"string",begin:"(u|r|ur)'",end:"'",contains:[A.BACKSLASH_ESCAPE],relevance:10},{className:"string",begin:'(u|r|ur)"',end:'"',contains:[A.BACKSLASH_ESCAPE],relevance:10},{className:"string",begin:"(b|br)'",end:"'",contains:[A.BACKSLASH_ESCAPE]},{className:"string",begin:'(b|br)"',end:'"',contains:[A.BACKSLASH_ESCAPE]}].concat([A.APOS_STRING_MODE,A.QUOTE_STRING_MODE]);var E={className:"title",begin:A.UNDERSCORE_IDENT_RE};var D={className:"params",begin:"\\(",end:"\\)",contains:["self",A.C_NUMBER_MODE,F].concat(C)};var B={beginWithKeyword:true,end:":",illegal:"[${=;\\n]",contains:[E,D],relevance:10};return{keywords:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10",built_in:"None True False Ellipsis NotImplemented"},illegal:"(</|->|\\?)",contains:C.concat([F,A.HASH_COMMENT_MODE,A.inherit(B,{className:"function",keywords:"def"}),A.inherit(B,{className:"class",keywords:"class"}),A.C_NUMBER_MODE,{className:"decorator",begin:"@",end:"$"},{begin:"\\b(print|exec)\\("}])}}(hljs);hljs.LANGUAGES.r=function(A){var B="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{contains:[A.HASH_COMMENT_MODE,{begin:B,lexems:B,keywords:{keyword:"function if in break next repeat else for return switch while try tryCatch|10 stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...|10",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},relevance:0},{className:"number",begin:"0[xX][0-9a-fA-F]+[Li]?\\b",relevance:0},{className:"number",begin:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",relevance:0},{className:"number",begin:"\\d+\\.(?!\\d)(?:i\\b)?",relevance:0},{className:"number",begin:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",relevance:0},{className:"number",begin:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",relevance:0},{begin:"`",end:"`",relevance:0},{className:"string",begin:'"',end:'"',contains:[A.BACKSLASH_ESCAPE],relevance:0},{className:"string",begin:"'",end:"'",contains:[A.BACKSLASH_ESCAPE],relevance:0}]}}(hljs);hljs.LANGUAGES.rib=function(A){return{keywords:"ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",illegal:"</",contains:[A.HASH_COMMENT_MODE,A.C_NUMBER_MODE,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE]}}(hljs);hljs.LANGUAGES.rsl=function(A){return{keywords:{keyword:"float color point normal vector matrix while for if do return else break extern continue",built_in:"abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp faceforward filterstep floor format fresnel incident length lightsource log match max min mod noise normalize ntransform opposite option phong pnoise pow printf ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan texture textureinfo trace transform vtransform xcomp ycomp zcomp"},illegal:"</",contains:[A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.QUOTE_STRING_MODE,A.APOS_STRING_MODE,A.C_NUMBER_MODE,{className:"preprocessor",begin:"#",end:"$"},{className:"shader",beginWithKeyword:true,end:"\\(",keywords:"surface displacement light volume imager"},{className:"shading",beginWithKeyword:true,end:"\\(",keywords:"illuminate illuminance gather"}]}}(hljs);hljs.LANGUAGES.ruby=function(E){var A="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var J="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var G={keyword:"and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include"};var C={className:"yardoctag",begin:"@[A-Za-z]+"};var K=[{className:"comment",begin:"#",end:"$",contains:[C]},{className:"comment",begin:"^\\=begin",end:"^\\=end",contains:[C],relevance:10},{className:"comment",begin:"^__END__",end:"\\n$"}];var D={className:"subst",begin:"#\\{",end:"}",lexems:A,keywords:G};var I=[E.BACKSLASH_ESCAPE,D];var B=[{className:"string",begin:"'",end:"'",contains:I,relevance:0},{className:"string",begin:'"',end:'"',contains:I,relevance:0},{className:"string",begin:"%[qw]?\\(",end:"\\)",contains:I},{className:"string",begin:"%[qw]?\\[",end:"\\]",contains:I},{className:"string",begin:"%[qw]?{",end:"}",contains:I},{className:"string",begin:"%[qw]?<",end:">",contains:I,relevance:10},{className:"string",begin:"%[qw]?/",end:"/",contains:I,relevance:10},{className:"string",begin:"%[qw]?%",end:"%",contains:I,relevance:10},{className:"string",begin:"%[qw]?-",end:"-",contains:I,relevance:10},{className:"string",begin:"%[qw]?\\|",end:"\\|",contains:I,relevance:10}];var H={className:"function",beginWithKeyword:true,end:" |$|;",keywords:"def",contains:[{className:"title",begin:J,lexems:A,keywords:G},{className:"params",begin:"\\(",end:"\\)",lexems:A,keywords:G}].concat(K)};var F=K.concat(B.concat([{className:"class",beginWithKeyword:true,end:"$|;",keywords:"class module",contains:[{className:"title",begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",relevance:0},{className:"inheritance",begin:"<\\s*",contains:[{className:"parent",begin:"("+E.IDENT_RE+"::)?"+E.IDENT_RE}]}].concat(K)},H,{className:"constant",begin:"(::)?(\\b[A-Z]\\w*(::)?)+",relevance:0},{className:"symbol",begin:":",contains:B.concat([{begin:J}]),relevance:0},{className:"symbol",begin:A+":",relevance:0},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{className:"number",begin:"\\?\\w"},{className:"variable",begin:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{begin:"("+E.RE_STARTERS_RE+")\\s*",contains:K.concat([{className:"regexp",begin:"/",end:"/[a-z]*",illegal:"\\n",contains:[E.BACKSLASH_ESCAPE,D]}]),relevance:0}]));D.contains=F;H.contains[1].contains=F;return{lexems:A,keywords:G,contains:F}}(hljs);hljs.LANGUAGES.rust=function(B){var D={className:"title",begin:B.UNDERSCORE_IDENT_RE};var C={className:"number",begin:"\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)",relevance:0};var A="alt any as assert be bind block bool break char check claim const cont dir do else enum export f32 f64 fail false float fn for i16 i32 i64 i8 if iface impl import in int let log mod mutable native note of prove pure resource ret self str syntax true type u16 u32 u64 u8 uint unchecked unsafe use vec while";return{keywords:A,illegal:"</",contains:[B.C_LINE_COMMENT_MODE,B.C_BLOCK_COMMENT_MODE,B.inherit(B.QUOTE_STRING_MODE,{illegal:null}),B.APOS_STRING_MODE,C,{className:"function",beginWithKeyword:true,end:"(\\(|<)",keywords:"fn",contains:[D]},{className:"preprocessor",begin:"#\\[",end:"\\]"},{beginWithKeyword:true,end:"(=|<)",keywords:"type",contains:[D],illegal:"\\S"},{beginWithKeyword:true,end:"({|<)",keywords:"iface enum",contains:[D],illegal:"\\S"}]}}(hljs);hljs.LANGUAGES.scala=function(A){var C={className:"annotation",begin:"@[A-Za-z]+"};var B={className:"string",begin:'u?r?"""',end:'"""',relevance:10};return{keywords:"type yield lazy override def with val var false true sealed abstract private trait object null if for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws",contains:[{className:"javadoc",begin:"/\\*\\*",end:"\\*/",contains:[{className:"javadoctag",begin:"@[A-Za-z]+"}],relevance:10},A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,B,{className:"class",begin:"((case )?class |object |trait )",end:"({|$)",illegal:":",keywords:"case class trait object",contains:[{beginWithKeyword:true,keywords:"extends with",relevance:10},{className:"title",begin:A.UNDERSCORE_IDENT_RE},{className:"params",begin:"\\(",end:"\\)",contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,B,C]}]},A.C_NUMBER_MODE,C]}}(hljs);hljs.LANGUAGES.smalltalk=function(A){var B="[a-z][a-zA-Z0-9_]*";var D={className:"char",begin:"\\$.{1}"};var C={className:"symbol",begin:"#"+A.UNDERSCORE_IDENT_RE};return{keywords:"self super nil true false thisContext",contains:[{className:"comment",begin:'"',end:'"',relevance:0},A.APOS_STRING_MODE,{className:"class",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{className:"method",begin:B+":"},A.C_NUMBER_MODE,C,D,{className:"localvars",begin:"\\|\\s*(("+B+")\\s*)+\\|"},{className:"array",begin:"\\#\\(",end:"\\)",contains:[A.APOS_STRING_MODE,D,A.C_NUMBER_MODE,C]}]}}(hljs);hljs.LANGUAGES.sql=function(A){return{case_insensitive:true,contains:[{className:"operator",begin:"(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b(?!:)",end:";",endsWithParent:true,keywords:{keyword:"all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma exists number",aggregate:"count sum min max avg"},contains:[{className:"string",begin:"'",end:"'",contains:[A.BACKSLASH_ESCAPE,{begin:"''"}],relevance:0},{className:"string",begin:'"',end:'"',contains:[A.BACKSLASH_ESCAPE,{begin:'""'}],relevance:0},{className:"string",begin:"`",end:"`",contains:[A.BACKSLASH_ESCAPE]},A.C_NUMBER_MODE]},A.C_BLOCK_COMMENT_MODE,{className:"comment",begin:"--",end:"$"}]}}(hljs);hljs.LANGUAGES.tex=function(A){var D={className:"command",begin:"\\\\[a-zA-Zа-яА-я]+[\\*]?"};var C={className:"command",begin:"\\\\[^a-zA-Zа-яА-я0-9]"};var B={className:"special",begin:"[{}\\[\\]\\&#~]",relevance:0};return{contains:[{begin:"\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",returnBegin:true,contains:[D,C,{className:"number",begin:" *=",end:"-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",excludeBegin:true}],relevance:10},D,C,B,{className:"formula",begin:"\\$\\$",end:"\\$\\$",contains:[D,C,B],relevance:0},{className:"formula",begin:"\\$",end:"\\$",contains:[D,C,B],relevance:0},{className:"comment",begin:"%",end:"$",relevance:0}]}}(hljs);hljs.LANGUAGES.vala=function(A){return{keywords:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object",literal:"false true null"},contains:[{className:"class",beginWithKeyword:true,end:"{",keywords:"class interface delegate namespace",contains:[{beginWithKeyword:true,keywords:"extends implements"},{className:"title",begin:A.UNDERSCORE_IDENT_RE}]},A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,{className:"string",begin:'"""',end:'"""',relevance:5},A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,A.C_NUMBER_MODE,{className:"preprocessor",begin:"^#",end:"$",relevance:2},{className:"constant",begin:" [A-Z_]+ ",relevance:0}]}}(hljs);hljs.LANGUAGES.vbscript=function(A){return{case_insensitive:true,keywords:{keyword:"call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",built_in:"lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion scriptengine split scriptengineminorversion cint sin datepart ltrim sqr scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw chrw regexp server response request cstr err",literal:"true false null nothing empty"},illegal:"//",contains:[A.inherit(A.QUOTE_STRING_MODE,{contains:[{begin:'""'}]}),{className:"comment",begin:"'",end:"$"},A.C_NUMBER_MODE]}}(hljs);hljs.LANGUAGES.vhdl=function(A){return{case_insensitive:true,keywords:{keyword:"abs access after alias all and architecture array assert attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable vmode vprop vunit wait when while with xnor xor",typename:"boolean bit character severity_level integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector std_logic std_logic_vector unsigned signed boolean_vector integer_vector real_vector time_vector"},illegal:"{",contains:[A.C_BLOCK_COMMENT_MODE,{className:"comment",begin:"--",end:"$"},A.QUOTE_STRING_MODE,A.C_NUMBER_MODE,{className:"literal",begin:"'(U|X|0|1|Z|W|L|H|-)'",contains:[A.BACKSLASH_ESCAPE]},{className:"attribute",begin:"'[A-Za-z](_?[A-Za-z0-9])*",contains:[A.BACKSLASH_ESCAPE]}]}}(hljs);;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:highlightjs', location = '/static/lib/highlight/highlight-overrides.js' */
(function(A){var C={className:"annotation",begin:"@[A-Za-z]+"};var B={className:"string",begin:'u?r?"""',end:'"""',relevance:10};A.LANGUAGES.scala.contains=[{className:"javadoc",begin:"/\\*\\*",end:"\\*/",contains:[{className:"javadoctag",begin:"@[A-Za-z]+"}],relevance:10},A.C_LINE_COMMENT_MODE,A.C_BLOCK_COMMENT_MODE,B,A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,{className:"class",begin:"((case )?class |object |trait )",end:"({|$)",illegal:":",keywords:"case class trait object",contains:[{beginWithKeyword:true,keywords:"extends with",relevance:10},{className:"title",begin:A.UNDERSCORE_IDENT_RE},{className:"params",begin:"\\(",end:"\\)",contains:[A.APOS_STRING_MODE,A.QUOTE_STRING_MODE,B,C]}]},A.C_NUMBER_MODE,C]})(hljs);;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:faux-scrollbar', location = '/static/widget/faux-scrollbar/faux-scrollbar.js' */
define("widget/faux-scrollbar",["jquery","lodash","util/dom-event","util/events","util/function","util/navigator"],function(G,D,A,E,F,B){function C(){this._destroyables=[];this._scroller=document.createElement("div");this._scrollee=document.createElement("div");this._scroller.appendChild(this._scrollee);this._scroller.className="faux-scrollbar";this._scrollee.className="scrollee";this._scrollerHeight=17;if(B.isIE()){this._scroller.style.height="18px"}document.body.appendChild(this._scroller);this._userActivatedScroll=true;this._firstInit=true;this._contentWidth=0}C.prototype._onFirstInit=function(){var K=this;C._bind(this._scroller,"scroll",function(){if(K._userActivatedScroll){K._userActivatedScroll=false;K._puppet.scrollLeft=K._scroller.scrollLeft*K._scrollLeftRatio}else{K._userActivatedScroll=true}});var M=false;var J=16,L=37,I=39;C._bind(document,"keydown",function(P){var O=P.keyCode,Q=D.any([I,L],F.eq(O));if(Q&&!A.modifiersPreventScroll(P)){var N=P.target,R=N&&/INPUT|SELECT|TEXTAREA/i.test(N.tagName);if(!R){if(O===I){K._scroller.scrollLeft+=40}else{if(O===L){K._scroller.scrollLeft-=40}}}}else{if(O===J){M=true}}});C._bind(document,"keyup",function(N){if(N.keyCode===J){M=false}});if(B.isMozilla()){C._bind(document,"DOMMouseScroll",function(O){O=O.originalEvent;var N=M||(O.axis===O.HORIZONTAL_AXIS)?O.detail:0;if(N){K._scroller.scrollLeft+=N*100}})}else{C._bind(document,"mousewheel",function(O){O=O.originalEvent;var P=O.wheelDeltaX||(M&&O.wheelDelta)||0,N=(P/120)||(M&&O.detail);if(N){if(B.isChrome()&&O.webkitDirectionInvertedFromDevice){N=-N}K._scroller.scrollLeft-=N*100}})}this._destroyables.push(E.chain().on("stash.feature.sidebar.collapseEnd",this.containerSizeChanged.bind(this)).on("stash.feature.sidebar.expandEnd",this.containerSizeChanged.bind(this)));C._bind(window,"resize",this.containerSizeChanged.bind(this));C._bind(window,"scroll",function(){K._hideIfAbovePuppet(true)})};C.prototype.containerSizeChanged=function(I){this._hideIfAbovePuppet(false);this._setContentWidthIfKnown(I);this._updateContainerWidths();this._updateScrollLeftRatio()};C.prototype.init=function(J,L){var I=this;if(this._firstInit){this._onFirstInit();this._firstInit=false}if(this._puppet){C._unbindAll(this._puppet,".fauxscrollbar")}this._puppet=J;this._contentWidth=0;this._setContentWidthIfKnown(true);if(L){this.setOptions(L)}else{this._updateContainerWidths();this._updateScrollLeftRatio()}function K(){if(I._userActivatedScroll){I._userActivatedScroll=false;I._scroller.scrollLeft=I._puppet.scrollLeft/I._scrollLeftRatio}else{I._userActivatedScroll=true}}C._bind(this._puppet,"scroll",K);K();I._userActivatedScroll=true};var H=["top","left","bottom","right"];C.prototype.setOptions=function(I){var J=G(this._scroller);var K=D.some(H,D.has.bind(D,I));if(K){D.each(H,function(L){J.css(L,I[L]!=null?I[L]:"auto")})}if(D.has(I,"hideAbove")){this._hideAbove=I.hideAbove}this._updateContainerWidths();this._updateScrollLeftRatio()};C.prototype.destroy=function(){C._unbindAll(document,".fauxscrollbar");C._unbindAll(window,".fauxscrollbar");if(this._puppet){C._unbindAll(this._puppet,".fauxscrollbar")}C._unbindAll(this._scroller);this._scroller.parentNode.removeChild(this._scroller);this._puppet=this._scroller=this._scrollee=null;D.invoke(this._destroyables,"destroy")};C.prototype._setContentWidthIfKnown=function(J){var K,I;var L=this._contentIsClipped;if(J||!L){this._contentIsClipped=(K=this._puppet.clientWidth)&&(I=this._puppet.scrollWidth)>K;if(this._contentIsClipped){I=I||this._puppet.scrollWidth;this._contentWidth=I;return true}else{if(J){this._contentWidth=0;return false}}}return this._contentIsClipped};C.prototype._updateScrollLeftRatio=function(){this._scrollLeftRatio=(this._contentWidth-this._puppetWidth)/(this._scrolleeWidth-this._scrollerWidth)};C.prototype._updateContainerWidths=function(){this._scrollerWidth=this._scroller.clientWidth;this._puppetWidth=this._puppet.clientWidth;this._scrolleeWidth=Math.round(this._contentWidth*this._scrollerWidth/this._puppetWidth);this._scrollee.style.width=isNaN(this._scrolleeWidth)?"0px":(this._scrolleeWidth+"px");E.trigger("stash.widget.faux.scrollbar.visibilityChanged",null,(this._scrolleeWidth>=this._scrollerWidth))};C.prototype._hideIfAbovePuppet=function(J){if(this._hideAbove===false){return }var M=G(window),K=G(this._puppet),L=G(this._scroller);var I=M.scrollTop()+M.height()<(this._hideAbove||K.offset().top)+this._scrollerHeight;if(I!==this._isHidden){this._isHidden=I;L.toggleClass("hidden",I);if(!I&&J){this._setContentWidthIfKnown();this._updateContainerWidths();this._updateScrollLeftRatio()}}};C.prototype.getScrollLeft=function(){return this._scroller.scrollLeft};C.prototype.setScrollLeft=function(I){this._userActivatedScroll=true;this._scroller.scrollLeft=I};C.prototype.isShowing=function(){return this._scroller.scrollWidth>this._scroller.clientWidth};C._bind=function(J,I,K){G(J).on(I+".fauxscrollbar",K)};C._unbindAll=function(I){G(I).off(".fauxscrollbar")};return C});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:button-trigger', location = '/static/widget/button-trigger/button-trigger.js' */
define("widget/button-trigger",["jquery","lodash"],function(C,B){var D={triggerEvent:"click",stopEvent:true,triggerHandler:function(F,E){throw new Error("triggerHandler must be implemented")}};function A(G,F){this._opts=C.extend({},D,F);var E=this;this._$trigger=C(G).on(this._opts.triggerEvent,B.bind(this.triggerClicked,E))}A.prototype.setTriggerDisabled=function(E){E=E===undefined?true:!!E;this._$trigger.prop("disabled",E).attr("aria-disabled",E)};A.prototype.isTriggerDisabled=function(){return this._$trigger.attr("aria-disabled")==="true"};A.prototype.setTriggerActive=function(E){this._$trigger.attr("aria-pressed",E===undefined?true:!!E)};A.prototype.isTriggerActive=function(){return this._$trigger.attr("aria-pressed")==="true"};A.prototype.triggerClicked=function(E){var F=this.isTriggerActive();if(this.isTriggerDisabled()){if(this._opts.stopEvent){E&&E.stopPropagation&&E.stopPropagation();return false}return }this._opts.triggerHandler.call(this,!F,E);if(this._opts.stopEvent){E&&E.stopPropagation&&E.stopPropagation();return false}};return A});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:css-util', location = '/static/util/css.js' */
define("util/css",["util/function"],function(B){function E(){var F=document.createElement("style");F.appendChild(document.createTextNode(""));document.head.appendChild(F);return F.sheet}var D=[];var A=E();var C={chain:function(){var F=[];return{appendRule:function(G){F.push(C.appendRule(G));return this},destroy:function(){B.applyAll(F);F=[]}}},appendRule:function(I){var H={};var G=D.length;D.push(H);A.insertRule(I,G);return function F(){var J=D.indexOf(H);if(J!==-1){A.deleteRule(J);D.splice(J,1)}}},__sheet:A};return C});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-blame', location = '/static/feature/file-content/file-blame/blame-source.js' */
define("feature/file-content/file-blame/blame-source",["stash/api/util/navbuilder","stash/api/util/server","util/property"],function(D,C,A){function B(E){var F;this.get=function(){if(!F){F=G(E)}return F};function G(H){return A.getFromProvider("display.max.source.lines").then(function(I){return C.rest({url:D.currentRepo().browse().path(H.path).at(H.commitRange.untilRevision.id).build(),data:{blame:true,noContent:true,start:0,limit:I,avatarSize:stash.widget.avatarSizeInPx({size:"xsmall"})}})})}}return B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-blame', location = '/static/feature/file-content/file-blame/blame-gutter.js' */
define("feature/file-content/file-blame/blame-gutter",["jquery","lodash","stash/api/util/events","stash/api/util/state","util/css","util/deprecation","util/widget"],function(B,J,K,F,D,E,C){function H(Q){var N=F.getRepository();var M=F.getFilePath().components.join("/");var L=Q.map(function(U){var T={spannedLines:U.spannedLines,filePath:M,repository:N,changeset:J.extend({id:U.commitHash,displayId:U.displayCommitHash},U)};var S=B(stash.feature.fileContent.fileBlameGutterDetailed(T))[0];if(U.spannedLines===1){return{csid:U.commitHash,els:[S]}}var R=B(stash.feature.fileContent.fileBlameGutterSpan(T))[0];return{csid:U.commitHash,els:[S,R].concat(J.times(U.spannedLines-2,function(){return R.cloneNode(true)}))}});var P=J.chain(L).pluck("els").flatten().value();var O={byLine:{},byCsid:{},all:P};J.transform(O.all,function(R,T,S){R[S+1]=T},O.byLine);J.transform(L,function(R,S){if(R[S.csid]){R[S.csid]=R[S.csid].concat(S.els)}else{R[S.csid]=S.els}},O.byCsid);return O}var I="blame";function A(L,N){var M=[];return N.eachLine(function(O){var P=L[O.lineNumber];M.push([O.handles.SOURCE,I,P])}).then(function(){return M})}function G(L,N){this._enabled=false;this._sourceView=L;this._blameSource=N;this._pendingChanges=[];var M=this;L.on("destroy",function(){M.destroy()});L.on("change",function(O){if(M._pendingChanges){M._pendingChanges.push(O)}else{M._fillForChange(O)}});this._init();this._sourceView.addContainerClass("blame-disabled");L.registerGutter(I,{weight:0})}C.mixInto(G.prototype);G.prototype.setEnabled=function(N){N=Boolean(N);var M;if(this._enabled!==N){this._enabled=N;E.triggerDeprecated("stash.feature.fileblame.enabledStateChanged",this,this._enabled,"stash.feature.fileContent.fileBlameExpandedStateChanged","3.5","4.0");if(this._enabled===N){if(N){this._sourceView.removeContainerClass("blame-disabled");M=this._fillGutter()}else{this._sourceView.addContainerClass("blame-disabled");M=B.Deferred().resolve()}var L=this;M.done(function(){K.trigger("stash.feature.fileContent.fileBlameExpandedStateChanged",null,L._enabled)})}}return M||B.Deferred().resolve()};G.prototype._addHoverBehavior=function(){var M=this._sourceView;var L=B(this._blameElCache.all);var O=J.transform(this._blameElCache.byCsid,function(V,U,T){V[T]=B(U)},{});var R;var P;var S;function N(V){if(V.target!==this){return }var T=this.getAttribute("data-csid");clearTimeout(S);if(P===T){return }if(R){R()}P=T;var W=O[T];var U;if(W.length<500){W.addClass("csid-hovered");U=W.removeClass.bind(W,"csid-hovered")}else{U=D.appendRule('.blame-row.blame-row[data-csid="'+T+'"] {background-color: #f5f5f5;border-right-color: #3b73af;}')}R=function(){U();P=null;R=null}}function Q(T){if(T.target!==this){return }if(R){S=setTimeout(function(){if(R){R()}},100)}}this._blameElCache.all.forEach(function(T){T.addEventListener("mouseenter",N);T.addEventListener("mouseleave",Q)});this._addDestroyable(function(){if(R){R()}})};G.prototype._fillForChange=function(M){var L=this;A(L._blameElCache.byLine,M).done(function(N){L._sourceView.operation(function(){N.forEach(function(O){L._sourceView.setGutterMarker.apply(L._sourceView,O)})})})};G.prototype._fillGutter=function(){if(this._gutterFilled){return B.Deferred().resolve()}this._gutterFilled=true;var L=this;return this._blameSource.get().then(function(M){L._blameElCache=H(M);L._addHoverBehavior();L._sourceView.operation(function(){L._pendingChanges.forEach(L._fillForChange.bind(L))});L._pendingChanges=null})};return G});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-blame', location = '/static/feature/file-content/file-blame/file-blame.js' */
define("feature/file-content/file-blame",["jquery","stash/api/util/events","util/feature-enabled","util/promise","widget/button-trigger","feature/file-content/file-blame/blame-gutter","feature/file-content/file-blame/blame-source","exports"],function(F,D,A,H,C,G,E,B){B.init=function(){A.getFromProvider("source.codemirror").done(function(K){if(K){D.on("stash.feature.fileContent.textViewInitializing",J)}});function J(L,O){if(O.contentMode!=="source"){return }var M=new E(O.fileChange);var N=new G(L,M);var Q=O.$toolbar.find(".file-blame");var P=F('<div class="blame-spinner"></div>');var K=new C(Q,{stopEvent:false,triggerHandler:function(){this.setTriggerActive(!this.isTriggerActive());H.spinner(P.insertBefore(Q),N.setEnabled(this.isTriggerActive()))}})}return{destroy:function I(){D.off("stash.feature.fileContent.textViewInitializing",J)}}}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-blame', location = '/static/feature/file-content/file-blame/legacy-file-blame.js' */
define("feature/file-content/legacy-file-blame",["jquery","lodash","stash/api/util/navbuilder","util/ajax","util/dom-event","util/events","util/feature-detect","util/html","model/page-state","widget/loaded-range","widget/submit-spinner"],function(F,M,B,L,H,O,D,C,K,E,G){function I(Q,R,P){return L.rest({url:Q,data:{blame:true,noContent:true,start:R,limit:P}})}function J(P){return stash.feature.fileContent.fileBlameEntry({repository:K.getRepository().toJSON(),changeset:F.extend({id:P.commitHash,displayId:P.displayCommitHash},P)})}function A(P){return M.map(P,J).join("")}function N(V,T,X,Q){var W=this;var R=F(V),U=new G(R,"before"),P=F(stash.feature.fileContent.fileBlame()).prependTo(F(T));this.$blameColumn=P;this.$blameButton=R;this.blameSpinner=U;this.loadedRange=new E();this.pendingPages=[];this.path=X;this.untilRevision=Q;this._enabled=!!R.attr("aria-pressed")&&R.attr("aria-pressed")==="true";P.toggleClass("expanded",this.isEnabled());function S(){O.trigger("stash.feature.fileContent.fileBlameExpandedStateChanged",null,W.isEnabled())}if(D.cssTransition){P.on("transitionend",H.filterByTarget(P,S))}else{O.on("stash.feature.fileblame.enabledStateChanged",setTimeout.bind(null,S))}R.click(function(Y){if(W.isButtonEnabled()){W.setEnabled(!W.isEnabled())}Y.preventDefault()})}N.prototype.reset=function(){};N.prototype.isEnabled=function(){return this._enabled};N.prototype.setEnabled=function(Q){Q=!!Q;if(this._enabled!==Q){var P=this;this._enabled=Q;this.$blameButton.attr("aria-pressed",P.isEnabled());P.$blameColumn.toggleClass("expanded",P.isEnabled());if(this.isEnabled()){this.loadPendingPages()}O.trigger("stash.feature.fileblame.enabledStateChanged",this,this.isEnabled())}};N.prototype.setButtonEnabled=function(P){this.$blameButton.attr("aria-disabled",!P)};N.prototype.isButtonEnabled=function(){return !this.$blameButton.attr("aria-disabled")||this.$blameButton.attr("aria-disabled")!=="true"};N.prototype.loadPendingPages=function(){if(this.pendingPages.length){this.setButtonEnabled(false);this.blameSpinner.show();var S=M.min(this.pendingPages,function(U){return U.start}),P=M.max(this.pendingPages,function(U){return U.start+U.limit});this.pendingPages=[];var Q=this,T=S.start,R=P.start+P.limit-S.start;return this.requestData(T,R).done(function(U){Q.onDataLoaded(T,R,{start:T,size:R,isLastPage:P.isLastPage,blame:U})}).always(function(){Q.setButtonEnabled(true);Q.blameSpinner.hide()})}return F.Deferred().reject()};N.prototype.requestData=function(Q,P){return I(B.currentRepo().browse().path(this.path).at(this.untilRevision.getId()).build(),Q,P)};N.prototype.onDataLoaded=function(S,P,R){if(this.isEnabled()){var Q=this.loadedRange.getAttachmentMethod(S,R.size);C.quickNDirtyAttach(this.$blameColumn[0],A(R.blame),Q);this.loadedRange.add(S,R.size,R.isLastPage)}else{this.pendingPages.push({start:S,limit:R.size,isLastPage:R.isLastPage||false})}};return N});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-blame', location = '/static/feature/file-content/file-blame/legacy-file-blame.soy' */
// This file was automatically generated from legacy-file-blame.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; }


stash.feature.fileContent.fileBlame = function(opt_data, opt_ignored) {
  return '<div class="blame legacy-blame"></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.fileBlame.soyTemplateName = 'stash.feature.fileContent.fileBlame';
}


stash.feature.fileContent.fileBlameEntry = function(opt_data, opt_ignored) {
  var output = '<div class="legacy-blame-row">' + stash.widget.userLink({user: opt_data.changeset.author, extraClasses: 'legacy-blame-author secondary-link'}) + stash.feature.changeset.link(opt_data) + '<div class="blame-timestamp" title="' + soy.$$escapeHtml(require('util/time').format(opt_data.changeset.authorTimestamp, 'full')) + '">' + soy.$$escapeHtml(require('util/time').format(opt_data.changeset.authorTimestamp, 'short')) + '</div>';
  var iLimit17 = opt_data.changeset.spannedLines;
  for (var i17 = 1; i17 < iLimit17; i17++) {
    output += '<div class="legacy-blame-span" title="' + soy.$$escapeHtml(opt_data.changeset.author.displayName || opt_data.changeset.author.name) + '">&nbsp;</div>';
  }
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  stash.feature.fileContent.fileBlameEntry.soyTemplateName = 'stash.feature.fileContent.fileBlameEntry';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-blame', location = '/static/feature/file-content/file-blame/file-blame.soy' */
// This file was automatically generated from file-blame.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; }


stash.feature.fileContent.fileBlameGutterDetailed = function(opt_data, opt_ignored) {
  return '<div class="blame" data-csid="' + soy.$$escapeHtml(opt_data.changeset.id) + '" data-span="' + soy.$$escapeHtml(opt_data.spannedLines) + '">' + stash.widget.avatar({person: opt_data.changeset.author, size: 'xsmall'}) + stash.widget.userLink({user: opt_data.changeset.author, extraClasses: 'blame-author secondary-link'}) + stash.feature.changeset.link(opt_data) + '<div class="blame-timestamp" title="' + soy.$$escapeHtml(require('util/time').format(opt_data.changeset.authorTimestamp, 'full')) + '">' + soy.$$escapeHtml(require('util/time').format(opt_data.changeset.authorTimestamp, 'short')) + '</div></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.fileBlameGutterDetailed.soyTemplateName = 'stash.feature.fileContent.fileBlameGutterDetailed';
}


stash.feature.fileContent.fileBlameGutterSpan = function(opt_data, opt_ignored) {
  return '<div class="blame" data-csid="' + soy.$$escapeHtml(opt_data.changeset.id) + '" title="' + soy.$$escapeHtml(opt_data.changeset.author.displayName || opt_data.changeset.author.name) + '">&nbsp;</div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.fileBlameGutterSpan.soyTemplateName = 'stash.feature.fileContent.fileBlameGutterSpan';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:file-blame', location = '/static/feature/file-content/file-blame/file-blame-init.js' */
require(["feature/file-content/file-blame"],function(A){A.init()});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:legacy-source-view', location = '/static/feature/file-content/legacy-source-view/legacy-source-view.soy' */
// This file was automatically generated from legacy-source-view.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.fileContent == 'undefined') { stash.feature.fileContent = {}; }


stash.feature.fileContent.sourceView = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '<div' + ((opt_data.id) ? ' id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + ' data-skate-ignore="true" class="content-view source-view' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '"><div class="line-numbers"><div class="numbers"></div></div><div class="source-container"><pre class="code"></pre></div><div class="binary-container"></div></div>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.sourceView.soyTemplateName = 'stash.feature.fileContent.sourceView';
}


stash.feature.fileContent.emptyFile = function(opt_data, opt_ignored) {
  return '' + stash.widget.focusMessage.message({iconClass: 'icon-empty-file', accessibilityText: "Empty file", title: "This file is empty"});
};
if (goog.DEBUG) {
  stash.feature.fileContent.emptyFile.soyTemplateName = 'stash.feature.fileContent.emptyFile';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:legacy-source-view', location = '/static/feature/file-content/legacy-source-view/legacy-source-view.js' */
define("feature/file-content/legacy-source-view",["aui","jquery","lodash","stash/api/util/navbuilder","util/ajax","util/determine-language","util/dom-event","util/events","util/function","util/html","util/navigator","util/promise","model/file-change","widget/loaded-range","widget/paged-scrollable","feature/file-content/binary-view","feature/file-content/legacy-file-blame"],function(J,F,b,I,Q,L,e,C,K,W,d,S,N,M,H,D,Z){e.listenForFontSizeChange();var V="<br />",O='<span title="'+"This line has been truncated."+'">&hellip;</span>'+V,E={lineStart:"",lineEnd:function(f){return f.truncated?O:V},emptyLine:""},R=d.isIE()&&d.majorVersion()===9,a=d.isIE()?1000:5000,G=20000;function P(h,g,i){var f=I.currentRepo().browse().path(h).at(g.getDisplayId()).build();return Q.rest({url:f,data:i,statusCode:Q.ignore404WithinRepository(function(j){return F.Deferred().resolve(j)})})}var X="text";function c(f){var g=J.escapeHtml(f.text);return E.lineStart+(g||E.emptyLine)+E.lineEnd(f)}function U(f){return b.map(f,c).join("")}function T(k,j){var h="";for(var g=k,f=k+j;g<f;g++){h+='<pre id="l'+g+'"><a href="#'+g+'">'+g+"</a></pre>"}return h}function B(h,g){H.call(this,g.$scrollPane,{pageSize:a,dataLoadedEvent:"stash.feature.sourceview.dataLoaded"});var f=new N(g.fileChange);this.$table=F(g.$container);this.$linesContainer=this.$table.children(".line-numbers");this.$linesBlock=this.$linesContainer.children(".numbers");this.$sourceBlock=this.$table.find(".code");this.$source=F("<code />").appendTo(this.$sourceBlock);this.$viewRaw=F(".raw-view-link");this.scrollbarPadding=0;if(R){this.$table.addClass("padded-scrollbar");this.scrollbarPadding=parseInt(this.$linesBlock.css("padding-bottom"),10)}this.initialData=h;this.init=this.init.bind(this,f,g)}F.extend(B.prototype,H.prototype);B.prototype.init=function(f,h){var j=this.$table.closest(".file-content").find(".file-blame");this.blame=new Z(j,this.$table,f.getPath(),f.getCommitRange().getUntilRevision());var i=h&&h.targetLine;this.fileChange=f;this.startingLine=i!=null?Math.min(i+1,G):null;var g=this;this.includeBlame=function(k){if(this===g.blame){g.includeBlame=k}};C.on("stash.feature.fileblame.enabledStateChanged",this.includeBlame);return H.prototype.init.call(this,{targetedItem:i,loadedRange:new M(G)})};function Y(f){while(f.hasChildNodes()){f.removeChild(f.firstChild)}}B.prototype.reset=function(){this.startingLine=0;this.fileChange=undefined;this.language=undefined;this.blame=undefined;this.$viewRaw=undefined;Y(this.$linesBlock[0]);Y(this.$source[0]);this.fontSizeHandler&&C.off("stash.util.events.fontSizeChanged",this.fontSizeHandler);C.off("stash.feature.fileblame.enabledStateChanged",this.includeBlame);this.$linesBlock.off("click.source-view","a");H.prototype.reset.call(this)};B.prototype.destroy=function(){this.reset();if(this.$overCapacityMessage){this.$overCapacityMessage.remove();this.$overCapacityMessage=null}};B.prototype.requestData=function(h,f){if(h===0&&this.initialData){try{if(this.initialData.errors){return F.Deferred().rejectWith(this,[this,null,null,this.initialData])}return F.Deferred().resolve(this.initialData)}finally{this.initialData=null}}var g=F("<div />").addClass("file-content-spinner").appendTo(F(".source-view"));return S.spinner(g,A(this.fileChange,this.includeBlame,h,f),"large")};function A(f,i,j,g){var h={start:j,limit:g};if(i){h.blame=true}return P(f.getPath(),f.getCommitRange().getUntilRevision(),h)}B.prototype.disableBlame=function(){this.blame.setButtonEnabled(false);this.blame.setEnabled(false)};B.prototype.handleErrors=function(f){if(f){this.$source.prepend(b.reduce(f,function(g,h){var j=h&&h.message||"Source could not be loaded";var i=aui.message.warning({content:J.escapeHtml(j)});return g+i},""));C.trigger("stash.feature.sourceview.onError",this,{errors:f});this.disableBlame();this.$viewRaw.attr("disabled",true)}};B.prototype.onBinary=function(f){var g=this.$table.find(".binary-container");D.renderBinaryFile(F("<div>"),f.path,this.fileChange.getCommitRange()).appendTo(g);C.trigger("stash.feature.sourceview.onBinary",this,{path:f.path});this.disableBlame()};B.prototype.onEmptyFile=function(f){this.$table.addClass("empty-file").html(stash.feature.fileContent.emptyFile());C.trigger("stash.feature.sourceview.onEmptyFile",this,f);this.disableBlame()};B.prototype.onDataLoaded=function(i,f,h){if(h.errors){this.handleErrors(h.errors);return }var g=this;if(D.shouldRenderBinary(h)){this.$table.find(".source-container, .line-numbers").hide().end().find(".binary-container").show();this.onBinary(h)}else{if(h.lines&&h.lines.length===0){this.$table.find(".source-container, .line-numbers").show().end().find(".binary-container").hide().empty();this.onEmptyFile(h)}else{this.blame.setButtonEnabled(true);this.$viewRaw.attr("disabled",false);H.prototype.onDataLoaded.call(this,i,f,h);this.blame.onDataLoaded(i,f,h)}}if(g.loadedRange.reachedEnd()||h.binary){g.$table.addClass("fully-loaded");if(g.loadedRange.reachedCapacity()&&!g.$overCapacityMessage){g.$overCapacityMessage=F(aui.message.warning({content:J.format("This file is too large to render. {0}Download the full file{1}.",I.currentRepo().browse().path(g.fileChange.getPath()).at(g.fileChange.getUntilRevision().getId()).raw().build())}));g.$table.after(g.$overCapacityMessage)}}};B.prototype.attachNewContent=function(j,i){var k=this.language=this.language||(L.fromFileInfo({firstLine:j.lines[0].text,path:this.fileChange.getPath().toString(),legacy:true})||X);var f;if(k===X){f=U(j.lines)}else{var h=b.map(j.lines,K.dot("text")).join("\n")+"\n",g=hljs.highlight(k,h).value;f=W.mergeStreams(h,W.lineNodeStream(j.lines,null,E),W.highlightJsNodeStream(g)).replace(/\n/g,"")}W.quickNDirtyAttach(this.$source[0],f,i);if(i==="prepend"){this._resizePlaceholder()}W.quickNDirtyAttach(this.$linesBlock[0],T(Number(j.start)+1,Number(j.size)),i)};B.prototype._resizePlaceholder=function(){var i=this,g=i.loadedRange.start,f=i.loadedRange.nextPageStart;if(g>0){var k=i.$linesBlock[0],h=i.scrollbarPadding,j;if(!(j=i.$precedingSourcePlaceholder)){j=i.$precedingSourcePlaceholder=F("<div/>").prependTo(i.$sourceBlock).add(F("<div/>").prependTo(i.$linesContainer))}j.height(0);j.height(((k.offsetHeight-h)/(f-g))*g);j.addClass("source-placeholder")}else{if(i.$precedingSourcePlaceholder){i.$precedingSourcePlaceholder.remove();i.$precedingSourcePlaceholder=null}}};B.prototype.onFirstDataLoaded=function(i,f,h){var g=this;if(i>0){this._resizePlaceholder()}C.on("stash.util.events.fontSizeChanged",this.fontSizeHandler=function(){g._resizePlaceholder()});if(this.startingLine){this.selectLine(this.startingLine,true)}this.$linesBlock.on("click.source-view","a",function(){var j=this.parentNode.id.match(/\d+/)[0];C.trigger("stash.feature.sourceview.selectedLineChanged",g,j);g.selectLine(j)});H.prototype.onFirstDataLoaded.call(this)};B.prototype.selectLine=function(f,g){var h=this.$lineLink;if(h){h.removeClass("target")}if(f){h=this.$lineLink=this.$linesBlock.find("#l"+f);if(h.length){this.$scrollElement.scrollTop(h.offset().top-(F(window).height()/4));h.addClass("target");if(g){h.addClass("initial-target")}}}};return B});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:source-line-info', location = '/static/feature/file-content/source-line-info.js' */
define("feature/file-content/source-line-info",["exports"],function(B){function A(C,D,E){this.lineNumber=C;this.line=D;this.handles={SOURCE:null,all:[]};this.attributes=E}A.prototype._setHandle=function(C){this.handles.SOURCE=C;this.handles.all=[C]};B.convertToLineInfos=function(C){var D=C.start||0;return C.lines.map(function(E,F){return new A(F+1+D,E,{})})}});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:source-view', location = '/static/feature/file-content/source-view/source-view.soy' */
// This file was automatically generated from source-view.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.fileContent.sourceView.
 */

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.sourceView == 'undefined') { stash.feature.fileContent.sourceView = {}; }


stash.feature.fileContent.sourceView.lineNumber = function(opt_data, opt_ignored) {
  return '<a class="line-number line-locator" data-line-number=""></a>';
};
if (goog.DEBUG) {
  stash.feature.fileContent.sourceView.lineNumber.soyTemplateName = 'stash.feature.fileContent.sourceView.lineNumber';
}


stash.feature.fileContent.sourceView.capacityReachedLineWidget = function(opt_data, opt_ignored) {
  var output = '';
  var escapedRawUrl__soy5 = '' + soy.$$escapeHtml(opt_data.rawUrl);
  output += stash.feature.fileContent.skippedContainer({extraClasses: 'capacity-reached-message', hasContentAbove: true, hasContentBelow: false, canShowMore: false, content: '' + aui.message.warning({content: '' + soy.$$filterNoAutoescape(AJS.format("This file is too large to render. {0}Download the full file{1}.",'<a href="' + escapedRawUrl__soy5 + '">','</a>'))})});
  return output;
};
if (goog.DEBUG) {
  stash.feature.fileContent.sourceView.capacityReachedLineWidget.soyTemplateName = 'stash.feature.fileContent.sourceView.capacityReachedLineWidget';
}
;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:source-view', location = '/static/feature/file-content/source-view/source-view.js' */
(function(){var D=require("util/bacon");var A=D.keyboardEvents("sourceViewFind");var B=D.keyboardEvents("sourceViewFindNext");var C=D.keyboardEvents("sourceViewFindPrev");define("feature/file-content/source-view",["jquery","lodash","stash/api/util/events","stash/api/util/navbuilder","util/object","util/property","feature/file-content/line-handle","feature/file-content/request-source","feature/file-content/source-line-info","feature/file-content/text-view","feature/file-content/text-view/attach-simple-scroll-behavior"],function(I,O,R,E,H,S,F,K,Q,J,G){function M(U){var T=O.extend({},U);return H.freeze(T)}var N=I(stash.feature.fileContent.sourceView.lineNumber());function P(T,V){var U=[];return V.eachLine(function(X){var W=N.clone();W.attr("data-line-number",X.lineNumber);W.attr("href","#"+X.lineNumber);W.text(X.lineNumber);U.push([X.handles.SOURCE,"line-number",W[0]])}).done(function(){T.operation(function(){U.forEach(function(X){T.setGutterMarker.apply(T,X)})});var W=M(V);T.trigger("change",W);R.trigger("stash.feature.fileContent.sourceViewContentChanged",null,W);if(V.type==="INITIAL"){T.trigger("load",W);R.trigger("stash.feature.fileContent.sourceViewContentLoaded",null,W)}})}L.prototype._setFocusLine=function(T){if(this._$focusedLine){this._$focusedLine.removeClass("target");this._$focusedLine=null}if(!T){return }this._$focusedLine=I(T._handle.gutterMarkers["line-number"]);this._$focusedLine.addClass("target");this.scrollHandleIntoFocus(T)};function L(V,U){J.call(this,U.$container,U);var T=this;this._editor=this._createEditor();this._syntaxHighlighting(U.fileChange.path.name,V.lines[0].text,this._editor);this.registerGutter("line-number",{weight:1000});this._addDestroyable(R.chainWith(I(window)).on("hashchange",function(Y){var W=location.hash.substring(1);var X=W?T.getLineHandle({lineNumber:W}):null;T._setFocusLine(X)}));this.on("internal-change",function(W){P(T,W).done(function(){if(U.targetLine!=null){T._whenOpDone(function(){T._setFocusLine(T.getLineHandle({lineNumber:U.targetLine+1}))})}})});this._scrollingReady=I.Deferred();this._scrollingReady.done(function(){T._modify("INITIAL",V,Q.convertToLineInfos(V));T._editor.setOption("scrollLineIntoViewFunc",function(W){T.scrollHandleIntoFocus(T.getLineHandle({lineNumber:W.from.line}))})}).done(this._loadRest.bind(this,V))}O.extend(L.prototype,J.prototype);L.defaults=J.defaults;L.prototype.init=function(){J.prototype.init.call(this);var T=this;if(this._options.attachScroll){O.defer(function(){T._attachScrollBehavior().then(T._scrollingReady.resolve.bind(T._scrollingReady),T._scrollingReady.reject.bind(T._scrollingReady))})}else{this._scrollingReady.resolve()}C.onValue(function(){T._editor.execCommand("findPrev")});B.onValue(function(){T._editor.execCommand("findNext")});A.onValue(function(){T._editor.execCommand("find")})};L.prototype._acceptModification=function(U,X,V,T){T=T||0;var W=this._editor;var Y=O.chain(X.lines).pluck("text").invoke("replace",/[\r\n]/g,"").join("\n").value();switch(U){case"INITIAL":W.setValue(Y);break;case"INSERT":W._insert(Y,T);break;default:throw new Error("Unrecognized change type: "+U)}V.forEach(function(Z,a){var b=new F(undefined,undefined,Z.lineNumber,W.getLineHandle(a+T));Z._setHandle(b)})};L.prototype._attachScrollBehavior=function(){return G(this,this._editor,I(this._editor.getWrapperElement()))};L.prototype._loadRest=function(U){var W=this;function V(c,b){var a={start:c,limit:b-c};return K(W._options.fileChange,a).then(function(d){if(d.size<a.limit&&!d.isLastPage){return V(c+d.size,b).then(function(e){return Z(d,e)})}return d})}function Z(b,a){return{start:b.start,lines:b.lines.concat(a.lines),size:b.size+a.size,isLastPage:a.isLastPage}}function Y(a,b){if(b){W._modify("INSERT",b,Q.convertToLineInfos(b),a)}}var T=U.start;var X=U.start+U.size;S.getFromProvider("display.max.source.lines").done(function(a){var b=T>0?V(0,T):I.Deferred().resolve();var c=!U.isLastPage&&X<a?V(X,a):I.Deferred().resolve();I.when(b,c).done(function(d,e){if(!W._editor){return }W._editor.operation(function(){Y(0,d);Y(W._editor.lastLine()+1,e);c.then(function f(h){var g=h?!h.isLastPage:X>=a&&!U.isLastPage;if(g){W._renderCapacityReached()}})});W._$container.addClass("fully-loaded");W.trigger("resize")})})};L.prototype._renderCapacityReached=function(){var T=this._options.fileChange;var U=I(stash.feature.fileContent.sourceView.capacityReachedLineWidget({rawUrl:E.currentRepo().browse().path(T.path).at(T.commitRange.untilRevision.id).raw().build()}))[0];this._$container.addClass("capacity-reached");this._editor.addLineWidget(this._editor.lastLine(),U,{coverGutter:true,noHScroll:true});this.trigger("resize")};L.prototype._editorForHandle=function(){return this._editor};return L})})();;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:source-handler', location = '/static/feature/file-content/handlers/source-handler.js' */
define("feature/file-content/source-handler",["jquery","lodash","stash/api/feature/files/file-handlers","util/error","model/file-content-modes","feature/file-content/binary-source-view","feature/file-content/binary-view","feature/file-content/content-message","feature/file-content/request-source","exports"],function(G,L,D,C,J,A,B,F,H,E){function K(M,N){if(!N){throw new Error("Every handler we expose from core needs to have a handlerID.")}return function(O){if(O.contentMode!==J.SOURCE){return G.Deferred().reject()}var P=O.$container;return H(O.fileChange,{includeBlame:false,start:O.targetLine?O.targetLine-(O.targetLine%5000):0}).then(function(Q){return M(Q,O)}).then(function(Q){if(!Q.handlerID){Q.handlerID=N}return Q},function(T,S,R,Q){if(Q&&Q.errors&&C.isErrorEntityWithinRepository(Q.errors[0])){F.renderErrors(P,Q);return G.Deferred().resolve({handlerID:D.builtInHandlers.ERROR})}return G.Deferred().reject()})}}E.handleBinary=K(function(N,M){if(!N.binary&&!B.treatTextAsBinary(M.fileChange.path.extension)){return G.Deferred().reject()}return G.Deferred().resolve(new A(M))},D.builtInHandlers.SOURCE_BINARY);E.handleImage=K(function(P,O){if(!P.binary&&!B.treatTextAsBinary(O.fileChange.path.extension)){return G.Deferred().reject()}var Q=O.fileChange.path;var N=O.fileChange.commitRange.untilRevision;var M=B.getRenderedBinary(Q,N);if(M.type!=="image"){return G.Deferred().reject()}return G.Deferred().resolve(new A(O))},D.builtInHandlers.SOURCE_IMAGE);E.handleEmptyFile=K(function(N,M){if(!N.lines||N.lines.length!==0){return G.Deferred().reject()}F.renderEmptyFile(M.$container,N,M.fileChange);return G.Deferred().resolve({})},D.builtInHandlers.SOURCE_EMPTY);var I=require("util/feature-enabled").getFromProvider("source.codemirror");E.handleText=K(function(N,M){if(!N.lines||N.lines.length===0){return G.Deferred().reject()}return I.then(function(P){var Q=P?require("feature/file-content/source-view"):require("feature/file-content/legacy-source-view");if(!P){var R=G(stash.feature.fileContent.sourceView({}));M.$container.replaceWith(R);M.$container=R}var O=new Q(N,M);L.defer(O.init.bind(O));return G.Deferred().resolve(O)})},D.builtInHandlers.SOURCE_TEXT)});(function(){var A=require("stash/api/feature/files/file-handlers");function B(D,C){A.register({weight:D,extraClasses:"source-file-content",handle:function(E){return require("feature/file-content/source-handler")[C](E)}})}B(10000,"handleImage");B(10300,"handleBinary");B(10700,"handleEmptyFile");B(11000,"handleText")})();;
;/* module-key = 'com.stiltsoft.stash.graphs:file-contributors-button', location = '/web-fragment-placeholder.config' */
WebFragments.addWebItemDescriptor({'pluginKey':'com.stiltsoft.stash.graphs','key':'file-contributors-button','moduleKey':'file-contributors-button','completeModuleKey':'com.stiltsoft.stash.graphs:file-contributors-button','weight':10.0,'params':{},'styleClass':WebFragments._formatI18n(null, null, 'file-contributors'),'location':'stash.file-content.source.toolbar.primary','linkText':WebFragments._formatI18n(null, null, 'Contributors')});;
;/* module-key = 'com.atlassian.stash.stash-client-web-fragments-plugin:source-file-blame', location = '/web-fragment-placeholder.config' */
WebFragments.addWebItemDescriptor({'pluginKey':'com.atlassian.stash.stash-client-web-fragments-plugin','key':'source-file-blame','moduleKey':'source-file-blame','completeModuleKey':'com.atlassian.stash.stash-client-web-fragments-plugin:source-file-blame','weight':10.0,'condition':function(ctx) { return WebFragments._getValue((ctx.handlerID === 'source-text'), ctx); },'params':{},'styleClass':WebFragments._formatI18n(null, null, 'file-blame'),'location':'stash.file-content.source.toolbar.secondary','linkText':WebFragments._formatI18n("Blame", 'stash.web.file.content.sourceview.showblame', '')});;
;/* module-key = 'com.kostmo.stash.line-ending-stats:line-ending-stats-item', location = '/web-fragment-placeholder.config' */
WebFragments.addWebItemDescriptor({'pluginKey':'com.kostmo.stash.line-ending-stats','key':'line-ending-stats-item','moduleKey':'line-ending-stats-item','completeModuleKey':'com.kostmo.stash.line-ending-stats:line-ending-stats-item','weight':1000.0,'params':{},'location':'stash.file-content.source.toolbar.secondary','url':WebFragments._formatI18n(null, null, 'http:\/\/timclem.wordpress.com\/2012\/03\/01\/mind-the-end-of-your-line\/'),'linkText':function(ctx) { return WebFragments._getValue((require('plugin/stash-line-endings').labelfunc), ctx); }});;
;/* module-key = 'com.atlassian.stash.stash-web-plugin:source-page', location = '/static/page/source/source.js' */
define("page/source",["aui","jquery","lodash","memoir","stash/api/util/navbuilder","util/ajax","util/events","model/commit-range","model/file-change","model/file-content-modes","model/page-state","model/path","model/revision","model/revision-reference","widget/faux-scrollbar","feature/changeset/changeset-badge","feature/file-content","layout/page-scrolling-manager","exports"],function(I,E,T,O,H,N,A,G,L,B,M,R,K,U,F,D,J,C,S){var P;S.onReady=function(k,u,Z,i,f,Y,n){C.acceptScrollForwardingRequests();var s=new F();A.on("stash.feature.fileContent.fileBlameExpandedStateChanged",function(){s.containerSizeChanged(true)});var r=window.location.href,X=new R(k),h=new U(u),b=new K(Z),W=B.DIFF===i?B.DIFF:B.SOURCE;var m=new J(f,Y,J.sourcePreset);A.on("memoir.changestate",function(AE){var AC,z,AF,v;var w=AE.state;if(w){AC=new R(w.path);z=new U(w.headRef);AF=w.untilRevision?new K(w.untilRevision):null;v=w.mode?w.mode:B.SOURCE;var AG=b?b.getId():null,AH=AF?AF.getId():null;var x=AC.toString()!==X.toString(),AB=h.getId()!==z.getId(),AD=AH!==AG,y=v!==W,AA=x||AB||AD||y;X=AC;b=AF;h=z;W=v;if(AB){A.trigger("stash.page.source.revisionRefChanged",null,h)}if(AA){p()}r=window.location.href}else{var AI=q(a(window.location.href),a(r));if(!AI){window.location.reload()}}});function g(){return new G({untilRevision:b,sinceRevision:b.hasParents()?b.getParents()[0]:undefined})}function a(v){var w=v.lastIndexOf("#");return w===-1?v:v.substring(0,w-1)}function q(w,v){return w.lastIndexOf(v)===w.length-v.length}A.on("stash.feature.fileContent.optionsChanged",function(w){var v=["hideComments","hideEdiff"];if(!T.contains(v,w.key)){p()}});var d=null;function p(){if(d){d.abort();d=null}if(!b){d=e(X,h);m.reset();d.always(function(){d=null}).done(function(v){b=v;p()})}else{c().then(V);o(b)}}function c(){var w=E.extend({toolbarWebFragmentLocationPrimary:"stash.file-content."+W+".toolbar.primary",toolbarWebFragmentLocationSecondary:"stash.file-content."+W+".toolbar.secondary"},J[W+"Preset"]);w.relevantContextLines=n;var v=new L({commitRange:g(),path:X,repository:M.getRepository()});return m.init(v,h,l(),w)}function V(){var w=W===B.DIFF;var v=!w&&m.$self.find(".CodeMirror-hscrollbar")[0];if(v){s.init(v,{hideAbove:false})}else{s.destroy();s=new F()}}function o(v){E(".branch-selector-toolbar .changeset-badge-container").empty().append(D.create(v.toJSON(),M.getRepository().toJSON())).fadeIn("fast")}function t(x,w,v,y){return{path:x.toString(),headRef:w.toJSON(),untilRevision:v?v.toJSON():null,mode:y}}function j(y,w,v,z){var x=H.currentRepo();if(z===B.DIFF){x=x.diff(new L({commitRange:new G({untilRevision:v}),path:y,repository:M.getRepository()}))}else{x=x.browse().path(y);if(v){x=x.until(v.getId())}}if(!w.isDefault()){x=x.at(w.getId())}O.pushState(t(y,w,v,z),null,x.build())}function l(){var w=window.location.hash,v=w.match(/#(\d+)/);return v&&Number(v[1])}function e(x,z){var w=H.rest().currentRepo().commit(z.getLatestChangeset());var y=N.rest({url:w.withParams({path:x.toString(),avatarSize:stash.widget.avatarSizeInPx({size:"xsmall"})}).build(),statusCode:{"404":function(){return E.Deferred().resolve({id:z.getId(),displayId:z.getDisplayId(),author:{name:"Unknown"},authorTimestamp:NaN})}}}),v=y.then(function(AA){return new K(AA)});A.trigger("stash.page.source.requestedRevisionData");return v.promise(y)}O.initialState(t(X,h,b,W));c().then(V);A.on("stash.layout.branch.revisionRefChanged",function(v){if(h!==v){j(X,v,null,"source")}});A.on("stash.feature.*.untilRevisionChanged",function(v){if(b.getId()!==v.getId()){j(X,h,v,W)}});A.on("stash.feature.*.requestedModeChange",function(v){if(W!==v){j(X,h,b,v)}});A.on("stash.feature.sourceview.onError",function(v){E(".branch-selector-toolbar .changeset-badge-container").fadeOut("fast")});A.on("stash.layout.*.urlChanged",function(v){window.location=v});A.on("stash.feature.*.urlChanged",function(v){window.location=v});A.on("stash.widget.branchselector.dialogShown",function(){P=true});A.on("stash.widget.branchselector.dialogHidden",function(){P=false});E(window).on("hashchange",function(){r=window.location.href;if(O.nativeSupport()){O.replaceState(t(X,h,b),null,r)}var v=window.location.hash.substring(1).match(/\d+/);A.trigger("stash.page.source.selectedLineChanged",null,v?Number(v[0]):null)});A.on("stash.widget.keyboard-shortcuts.register-contexts",function(v){v.enableContext("sourceview");v.enableContext("diff-view")});Q()};function Q(){A.on("stash.keyboard.shortcuts.requestOpenParentHandler",function(V){(this.execute?this:I.whenIType(V)).execute(function(){if(!P){var W=E(".breadcrumbs").find("a:last");if(W.length){if(O.nativeSupport()){W.click()}else{window.location.href=W.attr("href")}}}})})}});;
;/* module-key = 'com.stiltsoft.stash.graphs:file-contributors-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:file-contributors-resources', location = 'js/repository/file-contributors.js' */
define('page/file-contributors', ['jquery', 'graph/navbuilder', 'util/ajax', 'model/page-state', 'model/file-change', 'exports'],
    function($, nav, ajax, pageState, fileChange, exports) {

        var FileContributors = {
            init: function() {
                var onShowDialog = function ($content, trigger, showPopup) {
                    var spinner = $("<div class='spin'/>").spin('small');
                    $content.html(spinner);

                    showPopup();

                    ajax.rest({
                        url : AJS.contextPath() + '/rest/stash-graph/1.0/reports/file-contributors',
                        type: 'GET',
                        data: {
                            projectKey: pageState.getProject().getKey(),
                            repoSlug: pageState.getRepository().getSlug(),
                            // todo: try to get the value from pageState
                            changesetId: $('.changesetid').text().substr(0, 7),
                            filePath: pageState.getFilePath()
                        }
                    }).done(function (data) {
                        if (data.payload) {
                            var view = Graph.Files.contributors({
                                contributors: data.payload.values,
                                repoContributorsUrl: nav.getRepoGraphsURL({graph: "contributors"})
                            });

                            $content.html(view);
                        } else {
                            $content.html(Graph.Files.licenseNotActive({}));
                        }
                    }).always(function() {
                        spinner.spinStop().remove();
                    });

                    return false;
                };

                AJS.InlineDialog($('.file-contributors'), "file-contributors-dialog", onShowDialog, {
                    hideDelay: 2000,
                    width: 320,
                    useLiveEvents: true
                });
            }
        };

        exports.onReady = function() {
            FileContributors.init();
        };
    });

AJS.$(document).ready(function() {
    require('page/file-contributors').onReady();
});;
;/* module-key = 'com.stiltsoft.stash.graphs:file-contributors-resources', location = 'soy/client/file-contributors.soy' */
// This file was automatically generated from file-contributors.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Graph.Files.
 */

if (typeof Graph == 'undefined') { var Graph = {}; }
if (typeof Graph.Files == 'undefined') { Graph.Files = {}; }


Graph.Files.contributors = function(opt_data, opt_ignored) {
  var output = '<div class="contributors"><ul>';
  var contributorList4 = opt_data.contributors;
  var contributorListLen4 = contributorList4.length;
  for (var contributorIndex4 = 0; contributorIndex4 < contributorListLen4; contributorIndex4++) {
    var contributorData4 = contributorList4[contributorIndex4];
    output += '<li class="contributor-item"><div class="item"><div class="contributor"><img src="' + contributorData4.author.avatarLink + '" class="avatar"><strong>' + ((contributorData4.author.link) ? '<a href="' + contributorData4.author.link + '" title="' + "graph.file.contributors.author.title" + '">' + contributorData4.author.login + '</a>' : '<span>' + contributorData4.author.login + '</span>') + '</strong></div><div class="description"><span class="lines">' + ((contributorData4.lines == 1) ? AJS.format("{0} line,",contributorData4.lines) : AJS.format("{0} lines,",contributorData4.lines)) + '</span><span class="commits">' + ((contributorData4.commits == 1) ? AJS.format("{0} commit",contributorData4.commits) : AJS.format("{0} commits",contributorData4.commits)) + '</span></div></div></li>';
  }
  output += '<li class="last"><div class="item"><a href="' + opt_data.repoContributorsUrl + '" title="' + "View all repository contributors" + '">' + "View all repository contributors" + '</a></div></li></ul></div>';
  return output;
};
if (goog.DEBUG) {
  Graph.Files.contributors.soyTemplateName = 'Graph.Files.contributors';
}


Graph.Files.licenseNotActive = function(opt_data, opt_ignored) {
  return '<div class="no-license"><p>' + "Contributors report can be activated by generating an \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3eevaluation\x3c/a\x3e license or purchasing a \x3ca href\x3d\x22https://marketplace.atlassian.com/plugins/com.stiltsoft.stash.graphs\x22 target\x3d\x22_blank\x22\x3ecommercial\x3c/a\x3e license." + '</p><p>' + "If you have any questions, please, feel free to \x3ca href\x3d\x22https://helpdesk.stiltsoft.com/support/feedback.html\x22 target\x3d\x22_blank\x22\x3econtact us\x3c/a\x3e." + '</p></div>';
};
if (goog.DEBUG) {
  Graph.Files.licenseNotActive.soyTemplateName = 'Graph.Files.licenseNotActive';
}
;
;/* 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.kostmo.stash.line-ending-stats:line-endings-resources', location = '/static/line-endings.js' */
define("plugin/stash-line-endings",["exports","jquery","underscore","aui","eve"],function(d,e,i,h,j){function f(k){e.each(k,function(m,l){console.log("key: "+m+"\nvalue: "+l)})}var g=require("model/page-state");function b(){return g.getProject().getKey()}function a(){return g.getRepository().getSlug()}function c(){return h.contextPath()+"/rest/stash-line-endings/latest"}d.labelfunc=function(l){var n;var q=false;e.ajax({type:"GET",url:c()+"/api",dataType:"json",success:function(r){n=r;q=true},data:{project_key:b(),repo_slug:a(),file_ref:l.fileChange.commitRange.untilRevision.id,file_path:l.fileChange.path},async:false});if(!q){return"<no file>"}var p=n.lf_count+n.crlf_count;var k=Math.floor(100*n.lf_count/p);var m=Math.floor(100*n.crlf_count/p);var o;if(p==0){o="No line endings"}else{if(n.crlf_count==0){o="Pure LF (Unix-style)"}else{if(n.lf_count==0){o="Pure CRLF (Windows-style)"}else{o="Mixed line endings: "+n.lf_count+"/"+p+" ("+k+"%) LF, "+n.crlf_count+"/"+p+" ("+m+"%) CRLF"}}}return o}});;
;/* module-key = 'com.atlassian.stash.stash-readme-plugin:stash-readme-common-resources', location = '/static/feature/readme/common/common.js' */
define("feature/readme/common",["jquery","lib/jsuri","stash/api/util/navbuilder","util/text","model/page-state","exports"],function(e,c,g,f,d,b){function a(i,j,k){return i+(i.indexOf("?")!==-1?"&":"?")+encodeURIComponent(j)+"="+encodeURIComponent(k)}b.createUrl=function h(j,i,l){var k=e.extend({},{blob:l,at:i});return g.newBuilder(["rest","readme","latest","projects",d.getProject().getKey(),"repos",d.getRepository().getSlug(),"markup"].concat(j)).withParams(k).build()};b.updateLinks=function(j,i){function k(m,l,n){j.find(m).each(function(){e(this).attr(l,b._appendAtIfRelative(e(this).attr(l),d.getRevisionRef().getId(),i,n))})}k("a","href");k("img","src",function(l){return(new c(l).getQueryParamValues("raw").length===0)?a(l,"raw",""):l});return j};b._appendAtIfRelative=function(k,i,j,l){if(k&&!new c(k).protocol()){if(j&&!f.endsWith(j,"/")&&k.indexOf("/")!==0){k=j+"/"+k}if(!d.getRevisionRef().isDefault()){k=a(k,"at",i)}k=l?l(k):k}return k};b.DATA=e.Deferred();_PageDataPlugin.ready("com.atlassian.stash.stash-readme-plugin:readme-provider","stash.layout.repository",function(i){b.DATA.resolve(i)})});;
;/* module-key = 'com.atlassian.stash.stash-readme-plugin:stash-readme-files-resources', location = '/static/feature/readme/files/readme.soy' */
// This file was automatically generated from readme.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.readme.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.readme == 'undefined') { stash.feature.readme = {}; }


stash.feature.readme.readme = function(opt_data, opt_ignored) {
  return '<div class="filebrowser-readme-header"><span class="readme-icon aui-icon aui-icon-small aui-iconfont-devtools-file"></span><span class="filebrowser-readme-title"></span></div><div class="filebrowser-readme-content markup-content markup"></div>';
};
if (goog.DEBUG) {
  stash.feature.readme.readme.soyTemplateName = 'stash.feature.readme.readme';
}
;
;/* module-key = 'com.atlassian.stash.stash-readme-plugin:stash-readme-files-resources', location = '/static/feature/readme/files/readme.js' */
define("feature/readme/main",["aui","jquery","lodash","util/ajax","util/events","util/syntax-highlight","model/path","feature/readme/common","exports"],function(l,e,n,k,o,a,c,i,d){var m;var h={abort:e.noop};function j(q,s){var r=n.filter(q,function(u){var t=u.name.toUpperCase();return(t===s.name||t.indexOf(s.name+".")===0)&&u.type==="FILE"});var p=n.groupBy(r,function(t){return new c(t.name).getExtension()});return n.chain(s.extensions).map(function(t){return p[t]}).map(function(t){return t&&t[0]}).find(function(t){return !!t}).value()}var f=h;function g(p){i.DATA.then(n.bind(j,null,p.files)).done(function(s){if(!s){return}var q=m.find(".filebrowser-readme-content").empty();m.find(".filebrowser-readme-title").text(s.name);var t=function(){b();return false};var r=function(u){m.show();q.html(i.updateLinks(e(u),window.location.pathname));a.container(q)};f=k.rest({url:i.createUrl(p.path.getComponents().concat(s.name),p.revision,s.contentId),dataType:"html",statusCode:{"400":t,"413":function(){r("File content too large to display");return false},"415":t,"500":t}}).done(function(u){if(e.trim(u)){r(u)}else{b()}})})}function b(){f.abort();m.hide()}d.onReady=function(p){var q;m=e(p).html(stash.feature.readme.readme());b();o.on("stash.page.filebrowser.revisionRefChanged",b);o.on("stash.page.filebrowser.urlChanged",b);o.on("stash.feature.filetable.showSpinner",b);o.on("stash.feature.filebrowser.filesChanged",function(r){q=r;g(r)});o.on("stash.feature.filetable.showFind",b);o.on("stash.feature.filetable.hideFind",function(){if(q){g(q)}})}});;
;/* 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: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: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={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;","`":"&#96;"};if(F.hasOwnProperty(G)){return F[G]}return"&quot;"};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.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: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:files-layout', location = '/static/layout/files/files.js' */
define("layout/files",["util/events","model/page-state","model/path","model/revision-reference","widget/breadcrumbs","exports"],function(C,B,D,F,E,A){A.onReady=function(K,J,L,I){B.setFilePath(new D(K));var H=new F(J);var G=new E(L);C.on("stash.widget.breadcrumbs.urlChanged",function(M){if(this===G){C.trigger("stash.layout.files.urlChanged",this,M)}});C.on("stash.page.*.revisionRefChanged",function(M){H=F.hydrateDeprecated(M);G.update(H,new D(B.getFilePath()),I)});C.on("stash.page.*.pathChanged",function(M){M=new D(M);B.setFilePath(M);G.update(H,M,I)})}});;
;/* 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-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: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.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.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-readme-plugin:stash-readme-filecontent-resources', location = '/static/feature/readme/filecontent/file-content.soy' */
// This file was automatically generated from file-content.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace stash.feature.readme.
 */

if (typeof stash == 'undefined') { var stash = {}; }
if (typeof stash.feature == 'undefined') { stash.feature = {}; }
if (typeof stash.feature.readme == 'undefined') { stash.feature.readme = {}; }


stash.feature.readme.renderMarkup = function(opt_data, opt_ignored) {
  return '<div class="markup-content markup">' + soy.$$filterNoAutoescape(opt_data.content) + '</div>';
};
if (goog.DEBUG) {
  stash.feature.readme.renderMarkup.soyTemplateName = 'stash.feature.readme.renderMarkup';
}
;
;/* module-key = 'com.atlassian.stash.stash-readme-plugin:stash-readme-filecontent-resources', location = '/static/feature/readme/filecontent/file-content.js' */
define("feature/readme/filecontent",["aui","jquery","lodash","util/ajax","feature/readme/common"],function(a,e,b,d,c){return function(g){if(g.contentMode!=="source"){return null}var f=g.fileChange;return c.DATA.then(function(i){var h=f.path.extension.toLowerCase();if(h&&b.contains(i.extensions,h)&&!b.contains(i.extensionsRaw,h)){var j=f.commitRange.untilRevision.id;return d.rest({url:c.createUrl(f.path.components,j,j),dataType:"html",statusCode:{"413":function(){return e.Deferred().reject("The markup for this file is too large to render.")}}}).then(function(k){g.$container.empty().append(c.updateLinks(e(stash.feature.readme.renderMarkup({content:k}))));return{}})}return e.Deferred().reject()})}});require("stash/api/feature/files/file-handlers").register({weight:3000,handle:function(a){return require("feature/readme/filecontent").apply(this,arguments)}});;
;/* 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()});;

Zerion Mini Shell 1.0