text: define("backbone.marionette",[],function(){return window.Marionette}),define("jquery",[],function(){return window.jQuery}),define("underscore",[],function(){return window._}),define("backbone",[],function(){return window.Backbone}),define("components/source-viewer/source",["exports","module","underscore","backbone"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r);t.exports=o["default"].Model.extend({idAttribute:"uuid",defaults:function(){return{exist:!0,hasSource:!1,hasCoverage:!1,hasITCoverage:!1,hasDuplications:!1,hasSCM:!1,canSeeCode:!0}},key:function(){return this.get("key")},addMeta:function(t){var n=this.get("source"),r=0,i=t[r];n.forEach(function(e){while(i!=null&&e.line>i.line)i=t[++r];i!=null&&e.line===i.line&&(s["default"].extend(e,i),i=t[++r])}),this.set({source:n})},addDuplications:function(t){var n=this.get("source");n!=null&&n.forEach(function(e){var n=[];t.forEach(function(t,r){var i=!1;t.blocks.forEach(function(t){if(t._ref==="1"){var n=t.from,r=t.from+t.size-1;e.line>=n&&e.line<=r&&(i=!0)}}),n.push(i?r+1:!1)}),e.duplications=n}),this.set({source:n})},checkIfHasDuplications:function(){var t=!1,n=this.get("source");n!=null&&n.forEach(function(e){e.duplicated&&(t=!0)}),this.set({hasDuplications:t})},hasUTCoverage:function(t){return s["default"].some(t,function(e){return e.utCoverageStatus!=null})},hasITCoverage:function(t){return s["default"].some(t,function(e){return e.itCoverageStatus!=null})}})}),define("components/issue/models/issue",["exports","module","underscore","backbone"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r);t.exports=o["default"].Model.extend({idAttribute:"key",defaults:function(){return{flows:[]}},url:function(){return window.baseUrl+"/api/issues"},urlRoot:function(){return window.baseUrl+"/api/issues"},parse:function(t){var n=s["default"].size(t.issues)>0?t.issues[0]:t.issue;return n?(n=this._injectRelational(n,t.components,"component","key"),n=this._injectRelational(n,t.components,"project","key"),n=this._injectRelational(n,t.components,"subProject","key"),n=this._injectRelational(n,t.rules,"rule","key"),n=this._injectRelational(n,t.users,"assignee","login"),n=this._injectRelational(n,t.users,"reporter","login"),n=this._injectRelational(n,t.actionPlans,"actionPlan","key"),n=this._injectCommentsRelational(n,t.users),n=this._prepareClosed(n),n=this.ensureTextRange(n),n):t},_injectRelational:function(t,n,r,i){var o=t[r];if(o!=null&&s["default"].size(n)){var u=s["default"].find(n,function(e){return e[i]===o});u!=null&&Object.keys(u).forEach(function(e){var n=r+e.charAt(0).toUpperCase()+e.slice(1);t[n]=u[e]})}return t},_injectCommentsRelational:function(t,n){if(t.comments){var r=this,i=t.comments.map(function(e){var t=s["default"].extend({},e,{author:e.login});return delete t.login,t=r._injectRelational(t,n,"author","login"),t});t=s["default"].extend({},t,{comments:i})}return t},_prepareClosed:function(t){return t.status==="CLOSED"&&(t.flows=[],delete t.textRange),t},ensureTextRange:function(t){return t.line&&!t.textRange&&(t.textRange={startLine:t.line,endLine:t.line,startOffset:0,endOffset:999999}),t},sync:function(t,n,r){var i=r||{};i.contentType="application/x-www-form-urlencoded",t==="read"&&s["default"].extend(i,{type:"GET",url:this.urlRoot()+"/search",data:{issues:n.id,additionalFields:"_all"}}),t==="create"&&s["default"].extend(i,{type:"POST",url:this.urlRoot()+"/create",data:{component:n.get("component"),line:n.get("line"),message:n.get("message"),rule:n.get("rule"),severity:n.get("severity")}});var u=r.xhr=o["default"].ajax(i);return n.trigger("request",n,u,i),u},reset:function(t,n){for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&!(r in t)&&(t[r]=void 0);return this.set(t,n)},_action:function(t){var n=this,r=function(r){var i=n.parse(r);n.reset(i),t.success&&t.success(n,r,t)},i=s["default"].extend({type:"POST"},t,{success:r}),u=t.xhr=o["default"].ajax(i);return n.trigger("request",n,u,i),u},assign:function(t,n){var r=s["default"].extend({url:this.urlRoot()+"/assign",data:{issue:this.id,assignee:t}},n);return this._action(r)},plan:function(t,n){var r=s["default"].extend({url:this.urlRoot()+"/plan",data:{issue:this.id,plan:t}},n);return this._action(r)},setSeverity:function(t,n){var r=s["default"].extend({url:this.urlRoot()+"/set_severity",data:{issue:this.id,severity:t}},n);return this._action(r)},transition:function(t,n){var r=this,i=s["default"].extend({url:this.urlRoot()+"/do_transition",data:{issue:this.id,transition:t}},n);return this._action(i).done(function(){r.trigger("transition",t)})},customAction:function(t,n){var r=s["default"].extend({type:"POST",url:this.urlRoot()+"/do_action",data:{issue:this.id,actionKey:t}},n),i=o["default"].ajax(r);return this.trigger("request",this,i,r),i},getLinearLocations:function(){var t=this.get("textRange");if(!t)return[];var n=[];for(var r=t.startLine;r<=t.endLine;r++){var i=r===t.startLine?t.startOffset:0,s=r===t.endLine?t.endOffset:999999;n.push({line:r,from:i,to:s})}return n}})}),define("components/issue/collections/issues",["exports","module","underscore","backbone","../models/issue"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r),a=s(i);t.exports=u["default"].Collection.extend({model:a["default"],url:function(){return baseUrl+"/api/issues/search"},_injectRelational:function(t,n,r,i){var s=t[r];if(s!=null&&o["default"].size(n)){var u=o["default"].find(n,function(e){return e[i]===s});u!=null&&Object.keys(u).forEach(function(e){var n=r+e.charAt(0).toUpperCase()+e.slice(1);t[n]=u[e]})}return t},_injectCommentsRelational:function(t,n){if(t.comments){var r=this,i=t.comments.map(function(e){var t=o["default"].extend({},e,{author:e.login});return delete t.login,t=r._injectRelational(t,n,"author","login"),t});t=o["default"].extend({},t,{comments:i})}return t},_prepareClosed:function(t){return t.status==="CLOSED"&&(t.flows=[],delete t.textRange),t},ensureTextRange:function(t){return t.line&&!t.textRange&&(t.textRange={startLine:t.line,endLine:t.line,startOffset:0,endOffset:999999}),t},parse:function(t){var n=this;return this.paging={p:t.p,ps:t.ps,total:t.total,maxResultsReached:t.p*t.ps>=t.total},t.issues.map(function(e){return e=n._injectRelational(e,t.components,"component","key"),e=n._injectRelational(e,t.components,"project","key"),e=n._injectRelational(e,t.components,"subProject","key"),e=n._injectRelational(e,t.rules,"rule","key"),e=n._injectRelational(e,t.users,"assignee","login"),e=n._injectRelational(e,t.users,"reporter","login"),e=n._injectRelational(e,t.actionPlans,"actionPlan","key"),e=n._injectCommentsRelational(e,t.users),e=n._prepareClosed(e),e=n.ensureTextRange(e),e})}})}),define("components/issue/models/changelog",["exports","module","backbone"],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=r(n);t.exports=i["default"].Collection.extend({url:function(){return baseUrl+"/api/issues/changelog"},parse:function(t){return t.changelog}})}),define("components/common/popup",["exports","module","jquery","backbone.marionette"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r);t.exports=o["default"].ItemView.extend({className:"bubble-popup",onRender:function(){this.$el.detach().appendTo((0,s["default"])("body")),this.options.bottom?(this.$el.addClass("bubble-popup-bottom"),this.$el.css({top:this.options.triggerEl.offset().top+this.options.triggerEl.outerHeight(),left:this.options.triggerEl.offset().left})):this.options.bottomRight?(this.$el.addClass("bubble-popup-bottom-right"),this.$el.css({top:this.options.triggerEl.offset().top+this.options.triggerEl.outerHeight(),right:(0,s["default"])(window).width()-this.options.triggerEl.offset().left-this.options.triggerEl.outerWidth()})):this.$el.css({top:this.options.triggerEl.offset().top,left:this.options.triggerEl.offset().left+this.options.triggerEl.outerWidth()}),this.attachCloseEvents()},attachCloseEvents:function(){var t=this;key("escape",function(){t.destroy()}),(0,s["default"])("body").on("click.bubble-popup",function(){(0,s["default"])("body").off("click.bubble-popup"),t.destroy()}),this.options.triggerEl.on("click.bubble-popup",function(e){t.options.triggerEl.off("click.bubble-popup"),e.stopPropagation(),t.destroy()})},onDestroy:function(){(0,s["default"])("body").off("click.bubble-popup"),this.options.triggerEl.off("click.bubble-popup")}})}),Handlebars.registerPartial("_markdown-tips",Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return"<div class=\"markdown-tips\">\n  <a href=\"#\" onclick=\"window.open(baseUrl + '/markdown/help','markdown','height=300,width=600,scrollbars=1,resizable=1');return false;\">"+s((t.t||e&&e.t||i).call(e,"markdown.helplink",{name:"t",hash:{},data:r}))+"</a> :\n  &nbsp; *"+s((t.t||e&&e.t||i).call(e,"bold",{name:"t",hash:{},data:r}))+"* &nbsp;&nbsp; ``"+s((t.t||e&&e.t||i).call(e,"code",{name:"t",hash:{},data:r}))+"`` &nbsp;&nbsp; * "+s((t.t||e&&e.t||i).call(e,"bulleted_point",{name:"t",hash:{},data:r}))+"\n</div>\n"},useData:!0})),this.Templates=this.Templates||{},this.Templates["comment-form"]=Handlebars.template({1:function(e,t,n,r){return'placeholder="Please tell why?"'},3:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.t||e&&e.t||i).call(e,"save",{name:"t",hash:{},data:r}))},5:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.t||e&&e.t||i).call(e,"issue.comment.submit",{name:"t",hash:{},data:r}))},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='<div class="issue-comment-form-text">\n  <textarea rows="2" ';return i=t["if"].call(e,(i=e!=null?e.options:e)!=null?i.fromTransition:i,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+=">"+o((t.show||e&&e.show||s).call(e,e!=null?e.raw:e,e!=null?e.markdown:e,{name:"show",hash:{},data:r}))+'</textarea>\n</div>\n\n<div class="issue-comment-form-footer">\n  <div class="issue-comment-form-actions">\n    <div class="button-group">\n      <button class="js-issue-comment-submit" disabled>\n        ',i=t["if"].call(e,e!=null?e.id:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.program(5,r),data:r}),i!=null&&(u+=i),u+='\n      </button>\n    </div>\n    <a class="js-issue-comment-cancel">'+o((t.t||e&&e.t||s).call(e,"cancel",{name:"t",hash:{},data:r}))+'</a>\n  </div>\n\n  <div class="issue-comment-form-tips">',i=this.invokePartial(n["_markdown-tips"],"","_markdown-tips",e,undefined,t,n,r),i!=null&&(u+=i),u+'</div>\n</div>\n\n<div class="bubble-popup-arrow"></div>\n'},usePartial:!0,useData:!0}),this.Templates["issue-assign-form-option"]=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'<li>\n  <a href="#" class="js-issue-assignee" data-value="'+u((i=(i=t.id||(e!=null?e.id:e))!=null?i:o,typeof i===s?i.call(e,{name:"id",hash:{},data:r}):i))+'" data-text="'+u((i=(i=t.text||(e!=null?e.text:e))!=null?i:o,typeof i===s?i.call(e,{name:"text",hash:{},data:r}):i))+'">\n    '+u((i=(i=t.text||(e!=null?e.text:e))!=null?i:o,typeof i===s?i.call(e,{name:"text",hash:{},data:r}):i))+"\n  </a>\n</li>\n"},useData:!0}),this.Templates["issue-assign-form"]=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'<div class="search-box menu-search">\n  <button class="search-box-submit button-clean">\n    <i class="icon-search-new"></i>\n  </button>\n  <input class="search-box-input" type="search" placeholder="Search" value="'+u((i=(i=t.query||(e!=null?e.query:e))!=null?i:o,typeof i===s?i.call(e,{name:"query",hash:{},data:r}):i))+'">\n</div>\n\n<ul class="menu"></ul>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0}),this.Templates["issue-changelog"]=Handlebars.template({1:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression;return"          "+o((t.t||e&&e.t||s).call(e,"issue.reported_by",{name:"t",hash:{},data:r}))+" "+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.issue:e)!=null?i.reporterName:i,(i=e!=null?e.issue:e)!=null?i.reporter:i,{name:"default",hash:{},data:r}))+"\n"},3:function(e,t,n,r){var i,s="";return i=t["if"].call(e,(i=e!=null?e.issue:e)!=null?i.author:i,{name:"if",hash:{},fn:this.program(4,r),inverse:this.program(6,r),data:r}),i!=null&&(s+=i),s},4:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return"            "+o((t.t||e&&e.t||s).call(e,"created_by",{name:"t",hash:{},data:r}))+" "+o(u((i=e!=null?e.issue:e)!=null?i.author:i,e))+"\n"},6:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return"            "+s((t.t||e&&e.t||i).call(e,"created",{name:"t",hash:{},data:r}))+"\n"},8:function(e,t,n,r){var i,s,o=t.helperMissing,u=this.escapeExpression,a="function",f='      <tr>\n        <td class="thin text-left text-top" nowrap>'+u((t.dt||e&&e.dt||o).call(e,e!=null?e.creationDate:e,{name:"dt",hash:{},data:r}))+'</td>\n        <td class="thin text-left text-top" nowrap>\n';return i=t["if"].call(e,e!=null?e.userName:e,{name:"if",hash:{},fn:this.program(9,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="          "+u((s=(s=t.userName||(e!=null?e.userName:e))!=null?s:o,typeof s===a?s.call(e,{name:"userName",hash:{},data:r}):s))+'\n        </td>\n        <td class="text-left text-top">\n',i=t.each.call(e,e!=null?e.diffs:e,{name:"each",hash:{},fn:this.program(12,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+"        </td>\n      </tr>\n"},9:function(e,t,n,r){var i,s,o,u="function",a=t.helperMissing,f=t.blockHelperMissing,l="            ";return i=(s=(s=t.ifShowAvatars||(e!=null?e.ifShowAvatars:e))!=null?s:a,o={name:"ifShowAvatars",hash:{},fn:this.program(10,r),inverse:this.noop,data:r},typeof s===u?s.call(e,o):s),t.ifShowAvatars||(i=f.call(e,i,o)),i!=null&&(l+=i),l+"\n"},10:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.avatarHelper||e&&e.avatarHelper||i).call(e,e!=null?e.email:e,16,{name:"avatarHelper",hash:{},data:r}))},12:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return"            "+s((t.changelog||e&&e.changelog||i).call(e,e,{name:"changelog",hash:{},data:r}))+"<br>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='<div class="issue-changelog">\n  <table class="spaced">\n    <tbody>\n\n    <tr>\n      <td class="thin text-left text-top" nowrap>'+o((t.dt||e&&e.dt||s).call(e,(i=e!=null?e.issue:e)!=null?i.creationDate:i,{name:"dt",hash:{},data:r}))+'</td>\n      <td class="thin text-left text-top" nowrap></td>\n      <td class="text-left text-top">\n';return i=t["if"].call(e,(i=e!=null?e.issue:e)!=null?i.reporter:i,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),i!=null&&(u+=i),u+="      </td>\n    </tr>\n\n",i=t.each.call(e,e!=null?e.items:e,{name:"each",hash:{},fn:this.program(8,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+'    </tbody>\n  </table>\n</div>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0}),this.Templates["issue-more-actions"]=Handlebars.template({1:function(e,t,n,r){var i=this.lambda,s=this.escapeExpression,o=t.helperMissing;return'    <li>\n      <a class="issue-action js-issue-action" href="#" data-action="'+s(i(e,e))+'">'+s((t.t||e&&e.t||o).call(e,"issue.action",e,"formlink",{name:"t",hash:{},data:r}))+"</a>\n    </li>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o='<ul class="menu">\n';return i=(t.pluginActions||e&&e.pluginActions||s).call(e,e!=null?e.actions:e,{name:"pluginActions",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o+'</ul>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0}),this.Templates["issue-plan-form"]=Handlebars.template({1:function(e,t,n,r){var i,s=t.helperMissing,o="";return i=(t.notEq||e&&e.notEq||s).call(e,e!=null?e.status:e,"CLOSED",{name:"notEq",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o},2:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'      <li>\n        <a href="#" class="js-issue-assignee" data-value="'+u((i=(i=t.key||(e!=null?e.key:e))!=null?i:o,typeof i===s?i.call(e,{name:"key",hash:{},data:r}):i))+'" data-text="'+u((i=(i=t.name||(e!=null?e.name:e))!=null?i:o,typeof i===s?i.call(e,{name:"name",hash:{},data:r}):i))+'">\n          '+u((i=(i=t.name||(e!=null?e.name:e))!=null?i:o,typeof i===s?i.call(e,{name:"name",hash:{},data:r}):i))+"\n        </a>\n      </li>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s='<ul class="menu">\n';return i=t.each.call(e,e!=null?e.items:e,{name:"each",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+'</ul>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0}),this.Templates["issue-set-severity-form"]=Handlebars.template({1:function(e,t,n,r){var i=this.lambda,s=this.escapeExpression,o=t.helperMissing;return'    <li>\n      <a href="#" class="js-issue-severity" data-value="'+s(i(e,e))+'">\n        '+s((t.severityIcon||e&&e.severityIcon||o).call(e,e,{name:"severityIcon",hash:{},data:r}))+" "+s((t.t||e&&e.t||o).call(e,"severity",e,{name:"t",hash:{},data:r}))+"\n      </a>\n    </li>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s='<ul class="menu">\n';return i=t.each.call(e,e!=null?e.items:e,{name:"each",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+'</ul>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0}),this.Templates["issue-tags-form-option"]=Handlebars.template({1:function(e,t,n,r){return"data-selected"},3:function(e,t,n,r){return'      <i class="icon-checkbox icon-checkbox-checked"></i>\n'},5:function(e,t,n,r){return'      <i class="icon-checkbox"></i>\n'},7:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return"      + "+u((i=(i=t.tag||(e!=null?e.tag:e))!=null?i:o,typeof i===s?i.call(e,{name:"tag",hash:{},data:r}):i))+"\n"},9:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return"      "+u((i=(i=t.tag||(e!=null?e.tag:e))!=null?i:o,typeof i===s?i.call(e,{name:"tag",hash:{},data:r}):i))+"\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='<li>\n  <a href="#" data-value="'+a((s=(s=t.tag||(e!=null?e.tag:e))!=null?s:u,typeof s===o?s.call(e,{name:"tag",hash:{},data:r}):s))+'" data-text="'+a((s=(s=t.tag||(e!=null?e.tag:e))!=null?s:u,typeof s===o?s.call(e,{name:"tag",hash:{},data:r}):s))+'"\n     ';return i=t["if"].call(e,e!=null?e.selected:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+=">\n\n",i=t["if"].call(e,e!=null?e.selected:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.program(5,r),data:r}),i!=null&&(f+=i),f+="\n",i=t["if"].call(e,e!=null?e.custom:e,{name:"if",hash:{},fn:this.program(7,r),inverse:this.program(9,r),data:r}),i!=null&&(f+=i),f+"  </a>\n</li>\n"},useData:!0}),this.Templates["issue-tags-form"]=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'<div class="search-box menu-search">\n  <button class="search-box-submit button-clean">\n    <i class="icon-search-new"></i>\n  </button>\n  <input class="search-box-input" type="search" placeholder="Search" value="'+u((i=(i=t.query||(e!=null?e.query:e))!=null?i:o,typeof i===s?i.call(e,{name:"query",hash:{},data:r}):i))+'">\n</div>\n\n<ul class="menu"></ul>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0}),this.Templates["issue-transitions-form"]=Handlebars.template({1:function(e,t,n,r){var i=this.lambda,s=this.escapeExpression,o=t.helperMissing;return'    <li>\n      <a href="#" class="js-issue-transition" data-value="'+s(i(e,e))+'"\n         title="'+s((t.t||e&&e.t||o).call(e,"issue.transition",e,"description",{name:"t",hash:{},data:r}))+'" data-placement="right" data-container="body">\n        '+s((t.t||e&&e.t||o).call(e,"issue.transition",e,{name:"t",hash:{},data:r}))+"\n      </a>\n    </li>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s='<ul class="menu">\n';return i=t.each.call(e,e!=null?e.transitions:e,{name:"each",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+'</ul>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0}),this.Templates.issue=Handlebars.template({1:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="function";return'            <li class="issue-meta">\n              <span class="issue-meta-label" title="'+o((t.t||e&&e.t||s).call(e,"line_number",{name:"t",hash:{},data:r}))+'">L'+o((i=(i=t.line||(e!=null?e.line:e))!=null?i:s,typeof i===u?i.call(e,{name:"line",hash:{},data:r}):i))+"</span>\n            </li>\n"},3:function(e,t,n,r){return'            <li class="issue-meta issue-meta-locations">\n              <button class="button-link issue-action js-issue-locations">\n                <i class="icon-issue-flow"></i>\n              </button>\n            </li>\n'},5:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'              <button class="button-link issue-action issue-action-with-options js-issue-set-severity">\n                <span class="issue-meta-label">'+s((t.severityHelper||e&&e.severityHelper||i).call(e,e!=null?e.severity:e,{name:"severityHelper",hash:{},data:r}))+'</span>&nbsp;<i class="icon-dropdown"></i>\n              </button>\n'},7:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return"              "+s((t.severityHelper||e&&e.severityHelper||i).call(e,e!=null?e.severity:e,{name:"severityHelper",hash:{},data:r}))+"\n"},9:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'              <button class="button-link issue-action issue-action-with-options js-issue-transition">\n                <span class="issue-meta-label">'+s((t.statusHelper||e&&e.statusHelper||i).call(e,e!=null?e.status:e,e!=null?e.resolution:e,{name:"statusHelper",hash:{},data:r}))+'</span>&nbsp;<i\n                  class="icon-dropdown"></i>\n              </button>\n'},11:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return"              "+s((t.statusHelper||e&&e.statusHelper||i).call(e,e!=null?e.status:e,e!=null?e.resolution:e,{name:"statusHelper",hash:{},data:r}))+"\n"},13:function(e,t,n,r){var i,s='              <button class="button-link issue-action issue-action-with-options js-issue-assign">\n';return i=t["if"].call(e,e!=null?e.assignee:e,{name:"if",hash:{},fn:this.program(14,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+='                <span class="issue-meta-label">',i=t["if"].call(e,e!=null?e.assignee:e,{name:"if",hash:{},fn:this.program(17,r),inverse:this.program(19,r),data:r}),i!=null&&(s+=i),s+'</span>&nbsp;<i class="icon-dropdown"></i>\n              </button>\n'},14:function(e,t,n,r){var i,s,o,u="function",a=t.helperMissing,f=t.blockHelperMissing,l="";return i=(s=(s=t.ifShowAvatars||(e!=null?e.ifShowAvatars:e))!=null?s:a,o={name:"ifShowAvatars",hash:{},fn:this.program(15,r),inverse:this.noop,data:r},typeof s===u?s.call(e,o):s),t.ifShowAvatars||(i=f.call(e,i,o)),i!=null&&(l+=i),l},15:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'                    <span class="text-top">'+s((t.avatarHelper||e&&e.avatarHelper||i).call(e,e!=null?e.assigneeEmail:e,16,{name:"avatarHelper",hash:{},data:r}))+"</span>\n"},17:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return u((i=(i=t.assigneeName||(e!=null?e.assigneeName:e))!=null?i:o,typeof i===s?i.call(e,{name:"assigneeName",hash:{},data:r}):i))},19:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.t||e&&e.t||i).call(e,"unassigned",{name:"t",hash:{},data:r}))},21:function(e,t,n,r){var i,s="";return i=t["if"].call(e,e!=null?e.assignee:e,{name:"if",hash:{},fn:this.program(22,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+='              <span class="issue-meta-label">',i=t["if"].call(e,e!=null?e.assignee:e,{name:"if",hash:{},fn:this.program(17,r),inverse:this.program(19,r),data:r}),i!=null&&(s+=i),s+"</span>\n"},22:function(e,t,n,r){var i,s,o,u="function",a=t.helperMissing,f=t.blockHelperMissing,l="";return i=(s=(s=t.ifShowAvatars||(e!=null?e.ifShowAvatars:e))!=null?s:a,o={name:"ifShowAvatars",hash:{},fn:this.program(23,r),inverse:this.noop,data:r},typeof s===u?s.call(e,o):s),t.ifShowAvatars||(i=f.call(e,i,o)),i!=null&&(l+=i),l},23:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'                  <span class="text-top">'+s((t.avatarHelper||e&&e.avatarHelper||i).call(e,e!=null?e.assigneeEmail:e,16,{name:"avatarHelper",hash:{},data:r}))+"</span>\n"},25:function(e,t,n,r){var i,s='              <button class="button-link issue-action issue-action-with-options js-issue-plan">\n          <span\n              class="issue-meta-label">';return i=t["if"].call(e,e!=null?e.actionPlan:e,{name:"if",hash:{},fn:this.program(26,r),inverse:this.program(28,r),data:r}),i!=null&&(s+=i),s+'</span>&nbsp;<i\n                  class="icon-dropdown"></i>\n              </button>\n'},26:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t["default"]||e&&e["default"]||i).call(e,e!=null?e.actionPlanName:e,e!=null?e.actionPlan:e,{name:"default",hash:{},data:r}))},28:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.t||e&&e.t||i).call(e,"issue.unplanned",{name:"t",hash:{},data:r}))},30:function(e,t,n,r){var i,s='              <span\n                  class="issue-meta-label">';return i=t["if"].call(e,e!=null?e.actionPlan:e,{name:"if",hash:{},fn:this.program(26,r),inverse:this.program(28,r),data:r}),i!=null&&(s+=i),s+"</span>\n"},32:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'            <li class="issue-meta">\n              <span class="issue-meta-label">\n                '+s((t.tp||e&&e.tp||i).call(e,"issue.x_debt",e!=null?e.debt:e,{name:"tp",hash:{},data:r}))+"\n              </span>\n            </li>\n"},34:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'            <li class="issue-meta">\n              <button class="button-link issue-action js-issue-comment"><span\n                  class="issue-meta-label">'+s((t.t||e&&e.t||i).call(e,"issue.comment.formlink",{name:"t",hash:{},data:r}))+"</span></button>\n            </li>\n"},36:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'            <li class="issue-meta">\n              <button class="button-link issue-action issue-action-with-options js-issue-more">\n                <span class="issue-meta-label">'+s((t.t||e&&e.t||i).call(e,"more",{name:"t",hash:{},data:r}))+'</span>&nbsp;<i class="icon-dropdown"></i>\n              </button>\n            </li>\n'},38:function(e,t,n,r){return'          <button class="button-link hidden js-issue-assign-to-me"></button>\n'},40:function(e,t,n,r){var i,s='              <button class="button-link issue-action issue-action-with-options js-issue-edit-tags">\n              <span>\n                <i class="icon-tags icon-half-transparent"></i>&nbsp;<span>';return i=t["if"].call(e,e!=null?e.tags:e,{name:"if",hash:{},fn:this.program(41,r),inverse:this.program(43,r),data:r}),i!=null&&(s+=i),s+'</span>\n              </span>&nbsp;<i class="icon-dropdown"></i>\n              </button>\n'},41:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.join||e&&e.join||i).call(e,e!=null?e.tags:e,", ",{name:"join",hash:{},data:r}))},43:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.t||e&&e.t||i).call(e,"issue.no_tag",{name:"t",hash:{},data:r}))},45:function(e,t,n,r){var i,s='              <span>\n              <i class="icon-tags icon-half-transparent"></i>&nbsp;<span>';return i=t["if"].call(e,e!=null?e.tags:e,{name:"if",hash:{},fn:this.program(41,r),inverse:this.program(43,r),data:r}),i!=null&&(s+=i),s+"</span>\n            </span>\n"},47:function(e,t,n,r){var i,s='    <div class="issue-comments">\n';return i=t.each.call(e,e!=null?e.comments:e,{name:"each",hash:{},fn:this.program(48,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+"    </div>\n"},48:function(e,t,n,r){var i,s,o,u="function",a=t.helperMissing,f=this.escapeExpression,l=t.blockHelperMissing,c='        <div class="issue-comment" data-comment-key="'+f((s=(s=t.key||(e!=null?e.key:e))!=null?s:a,typeof s===u?s.call(e,{name:"key",hash:{},data:r}):s))+'">\n          <div class="issue-comment-author" title="'+f((s=(s=t.authorName||(e!=null?e.authorName:e))!=null?s:a,typeof s===u?s.call(e,{name:"authorName",hash:{},data:r}):s))+'">\n            ';return i=(s=(s=t.ifShowAvatars||(e!=null?e.ifShowAvatars:e))!=null?s:a,o={name:"ifShowAvatars",hash:{},fn:this.program(49,r),inverse:this.program(51,r),data:r},typeof s===u?s.call(e,o):s),t.ifShowAvatars||(i=l.call(e,i,o)),i!=null&&(c+=i),c+="&nbsp;"+f((s=(s=t.authorName||(e!=null?e.authorName:e))!=null?s:a,typeof s===u?s.call(e,{name:"authorName",hash:{},data:r}):s))+'\n          </div>\n          <div class="issue-comment-text markdown">',i=(t.show||e&&e.show||a).call(e,e!=null?e.html:e,e!=null?e.htmlText:e,{name:"show",hash:{},data:r}),i!=null&&(c+=i),c+='</div>\n          <div class="issue-comment-age">('+f((t.fromNow||e&&e.fromNow||a).call(e,e!=null?e.createdAt:e,{name:"fromNow",hash:{},data:r}))+')</div>\n          <div class="issue-comment-actions">\n',i=t["if"].call(e,e!=null?e.updatable:e,{name:"if",hash:{},fn:this.program(53,r),inverse:this.noop,data:r}),i!=null&&(c+=i),c+"          </div>\n        </div>\n"},49:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.avatarHelper||e&&e.avatarHelper||i).call(e,e!=null?e.authorEmail:e,16,{name:"avatarHelper",hash:{},data:r}))},51:function(e,t,n,r){return'\n              <i class="icon-comment icon-half-transparent"></i>'},53:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'              <button class="js-issue-comment-edit button-link icon-edit icon-half-transparent"></button>\n              <button class="js-issue-comment-delete button-link icon-delete icon-half-transparent"\n                      data-confirm-msg="'+s((t.t||e&&e.t||i).call(e,"issue.comment.delete_confirm_message",{name:"t",hash:{},data:r}))+'"></button>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='<div class="issue-inner">\n\n  <table class="issue-table">\n    <tr>\n      <td>\n        <div class="issue-message">\n          '+a((s=(s=t.message||(e!=null?e.message:e))!=null?s:u,typeof s===o?s.call(e,{name:"message",hash:{},data:r}):s))+'&nbsp;\n          <button class="button-link js-issue-rule issue-rule icon-ellipsis-h"></button>\n        </div>\n      </td>\n\n      <td class="issue-table-meta-cell issue-table-meta-cell-first">\n        <ul class="list-inline issue-meta-list">\n          <li class="issue-meta">\n            <button class="button-link issue-action issue-action-with-options js-issue-show-changelog" title="'+a((t.dt||e&&e.dt||u).call(e,e!=null?e.creationDate:e,{name:"dt",hash:{},data:r}))+'">\n              <span class="issue-meta-label">'+a((t.fromNow||e&&e.fromNow||u).call(e,e!=null?e.creationDate:e,{name:"fromNow",hash:{},data:r}))+'</span>&nbsp;<i class="icon-dropdown"></i>\n            </button>\n          </li>\n\n';return i=t["if"].call(e,e!=null?e.line:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="\n",i=t["if"].call(e,e!=null?e.hasSecondaryLocations:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+='\n          <li class="issue-meta">\n            <a class="js-issue-permalink icon-link" href="'+a((s=(s=t.permalink||(e!=null?e.permalink:e))!=null?s:u,typeof s===o?s.call(e,{name:"permalink",hash:{},data:r}):s))+'" target="_blank"></a>\n          </li>\n        </ul>\n      </td>\n    </tr>\n  </table>\n\n  <table class="issue-table">\n    <tr>\n      <td>\n        <ul class="list-inline issue-meta-list">\n          <li class="issue-meta">\n',i=(t.inArray||e&&e.inArray||u).call(e,e!=null?e.actions:e,"set_severity",{name:"inArray",hash:{},fn:this.program(5,r),inverse:this.program(7,r),data:r}),i!=null&&(f+=i),f+='          </li>\n\n          <li class="issue-meta">\n',i=(t.notEmpty||e&&e.notEmpty||u).call(e,e!=null?e.transitions:e,{name:"notEmpty",hash:{},fn:this.program(9,r),inverse:this.program(11,r),data:r}),i!=null&&(f+=i),f+='          </li>\n\n          <li class="issue-meta">\n',i=(t.inArray||e&&e.inArray||u).call(e,e!=null?e.actions:e,"assign",{name:"inArray",hash:{},fn:this.program(13,r),inverse:this.program(21,r),data:r}),i!=null&&(f+=i),f+='          </li>\n\n          <li class="issue-meta">\n',i=(t.inArray||e&&e.inArray||u).call(e,e!=null?e.actions:e,"plan",{name:"inArray",hash:{},fn:this.program(25,r),inverse:this.program(30,r),data:r}),i!=null&&(f+=i),f+="          </li>\n\n",i=t["if"].call(e,e!=null?e.debt:e,{name:"if",hash:{},fn:this.program(32,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="\n",i=(t.inArray||e&&e.inArray||u).call(e,e!=null?e.actions:e,"comment",{name:"inArray",hash:{},fn:this.program(34,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="\n",i=(t.ifHasExtraActions||e&&e.ifHasExtraActions||u).call(e,e!=null?e.actions:e,{name:"ifHasExtraActions",hash:{},fn:this.program(36,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="        </ul>\n\n",i=(t.inArray||e&&e.inArray||u).call(e,e!=null?e.actions:e,"assign_to_me",{name:"inArray",hash:{},fn:this.program(38,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+='      </td>\n\n      <td class="issue-table-meta-cell">\n        <ul class="list-inline">\n          <li class="issue-meta js-issue-tags">\n',i=(t.inArray||e&&e.inArray||u).call(e,e!=null?e.actions:e,"set_tags",{name:"inArray",hash:{},fn:this.program(40,r),inverse:this.program(45,r),data:r}),i!=null&&(f+=i),f+="          </li>\n        </ul>\n      </td>\n    </tr>\n  </table>\n\n",i=(t.notEmpty||e&&e.notEmpty||u).call(e,e!=null?e.comments:e,{name:"notEmpty",hash:{},fn:this.program(47,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+'\n</div>\n\n<a class="issue-navigate js-issue-navigate">\n  <i class="issue-navigate-to-left icon-chevron-left"></i>\n  <i class="issue-navigate-to-right icon-chevron-right"></i>\n</a>\n'},useData:!0}),this.Templates["manual-issue"]=Handlebars.template({1:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'        <option value="'+u((i=(i=t.key||(e!=null?e.key:e))!=null?i:o,typeof i===s?i.call(e,{name:"key",hash:{},data:r}):i))+'">'+u((i=(i=t.name||(e!=null?e.name:e))!=null?i:o,typeof i===s?i.call(e,{name:"name",hash:{},data:r}):i))+"</option>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='<form class="js-manual-issue-form spacer-top spacer-bottom">\n\n  <div class="spacer-bottom">\n    <select name="rule">\n';return i=t.each.call(e,e!=null?e.rules:e,{name:"each",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+'    </select>\n  </div>\n\n  <div class="spacer-top">\n    <textarea rows="4" name="message" class="width-100" required></textarea>\n  </div>\n\n  <div class="spacer-top">\n    <input type="submit" value="'+o((t.t||e&&e.t||s).call(e,"create",{name:"t",hash:{},data:r}))+'">\n    <a class="js-cancel" href="#">'+o((t.t||e&&e.t||s).call(e,"cancel",{name:"t",hash:{},data:r}))+"</a>\n  </div>\n\n</form>\n"},useData:!0}),define("components/issue/templates",function(){}),define("components/issue/views/changelog-view",["exports","module","underscore","components/common/popup","../templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=u["default"].extend({template:Templates["issue-changelog"],collectionEvents:{sync:"render"},serializeData:function(){return o["default"].extend(u["default"].prototype.serializeData.apply(this,arguments),{issue:this.options.issue.toJSON()})}})}),define("components/issue/collections/action-plans",["exports","module","backbone"],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=r(n);t.exports=i["default"].Collection.extend({url:function(){return baseUrl+"/api/action_plans/search"},parse:function(t){return t.actionPlans}})}),define("components/common/action-options-view",["exports","module","jquery","components/common/popup"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r);t.exports=o["default"].extend({className:"bubble-popup bubble-popup-menu",keyScope:"action-options",ui:{options:".menu > li > a"},events:function(){return{"click @ui.options":"selectOption","mouseenter @ui.options":"activateOptionByPointer"}},initialize:function(){this.bindShortcuts()},onRender:function(){o["default"].prototype.onRender.apply(this,arguments),this.selectInitialOption()},getOptions:function(){return this.$(".menu > li > a")},getActiveOption:function(){return this.getOptions().filter(".active")},makeActive:function(t){t.length>0&&(this.getOptions().removeClass("active").tooltip("hide"),t.addClass("active").tooltip("show"))},selectInitialOption:function(){this.makeActive(this.getOptions().first())},selectNextOption:function(){return this.makeActive(this.getActiveOption().parent().nextAll("li:not(.divider)").first().children("a")),!1},selectPreviousOption:function(){return this.makeActive(this.getActiveOption().parent().prevAll("li:not(.divider)").first().children("a")),!1},activateOptionByPointer:function(t){this.makeActive((0,s["default"])(t.currentTarget))},bindShortcuts:function(){var t=this;this.currentKeyScope=key.getScope(),key.setScope(this.keyScope),key("down",this.keyScope,function(){return t.selectNextOption()}),key("up",this.keyScope,function(){return t.selectPreviousOption()}),key("return",this.keyScope,function(){return t.selectActiveOption()}),key("escape",this.keyScope,function(){return t.destroy()}),key("backspace",this.keyScope,function(){return!1}),key("shift+tab",this.keyScope,function(){return!1})},unbindShortcuts:function(){key.unbind("down",this.keyScope),key.unbind("up",this.keyScope),key.unbind("return",this.keyScope),key.unbind("escape",this.keyScope),key.unbind("backspace",this.keyScope),key.unbind("tab",this.keyScope),key.unbind("shift+tab",this.keyScope),key.setScope(this.currentKeyScope)},onDestroy:function(){o["default"].prototype.onDestroy.apply(this,arguments),this.unbindShortcuts(),this.$('[data-toggle="tooltip"]').tooltip("destroy"),(0,s["default"])(".tooltip").remove()},selectOption:function(t){t.preventDefault(),this.destroy()},selectActiveOption:function(){this.getActiveOption().click()}})}),define("components/issue/views/transitions-form-view",["exports","module","jquery","components/common/action-options-view","../templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=u["default"].extend({template:Templates["issue-transitions-form"],selectInitialOption:function(){this.makeActive(this.getOptions().first())},selectOption:function(t){var n=(0,o["default"])(t.currentTarget).data("value");return this.submit(n),u["default"].prototype.selectOption.apply(this,arguments)},submit:function(t){return this.model.transition(t)}})}),define("components/issue/views/assign-form-view",["exports","module","jquery","underscore","components/common/action-options-view","../templates"],function(e,n,r,i,s,o){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}var a=u(r),f=u(i),l=u(s);n.exports=l["default"].extend({template:Templates["issue-assign-form"],optionTemplate:Templates["issue-assign-form-option"],events:function(){return f["default"].extend(l["default"].prototype.events.apply(this,arguments),{"click input":"onInputClick","keydown input":"onInputKeydown","keyup input":"onInputKeyup"})},initialize:function(){this._super(),this.assignees=null,this.debouncedSearch=f["default"].debounce(this.search,250)},getAssignee:function(){return this.model.get("assignee")},getAssigneeName:function(){return this.model.get("assigneeName")},onRender:function(){var t=this;this._super(),this.renderTags(),setTimeout(function(){t.$("input").focus()},100)},renderTags:function(){this.$(".menu").empty(),this.getAssignees().forEach(this.renderAssignee,this),this.bindUIElements(),this.selectInitialOption()},renderAssignee:function(t){var n=this.optionTemplate(t);this.$(".menu").append(n)},selectOption:function(t){var n=(0,a["default"])(t.currentTarget).data("value"),r=(0,a["default"])(t.currentTarget).data("text");return this.submit(n,r),this._super(t)},submit:function(t){return this.model.assign(t)},onInputClick:function(t){t.stopPropagation()},onInputKeydown:function(t){this.query=this.$("input").val(),t.keyCode===38&&this.selectPreviousOption(),t.keyCode===40&&this.selectNextOption(),t.keyCode===13&&this.selectActiveOption(),t.keyCode===27&&this.destroy();if([9,13,27,38,40].indexOf(t.keyCode)!==-1)return!1},onInputKeyup:function(){var t=this.$("input").val();t!==this.query&&(t.length<2&&(t=""),this.query=t,this.debouncedSearch(t))},search:function(t){var n=this;t.length>1?a["default"].get(baseUrl+"/api/users/search",{q:t}).done(function(e){n.resetAssignees(e.users)}):this.resetAssignees()},resetAssignees:function(t){t?this.assignees=t.map(function(e){return{id:e.login,text:e.name}}):this.assignees=null,this.renderTags()},getAssignees:function(){if(this.assignees)return this.assignees;var n=[{id:"",text:t("unassigned")}],r=window.SS.user,i=window.SS.userName;return n.push({id:r,text:i}),this.getAssignee()&&n.push({id:this.getAssignee(),text:this.getAssigneeName()}),this.makeUnique(n)},makeUnique:function(t){return f["default"].uniq(t,!1,function(e){return e.id})}})}),define("components/issue/views/comment-form-view",["exports","module","jquery","underscore","components/common/popup","../templates"],function(e,t,n,r,i,s){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var u=o(n),a=o(r),f=o(i);t.exports=f["default"].extend({className:"bubble-popup issue-comment-bubble-popup",template:Templates["comment-form"],ui:{textarea:".issue-comment-form-text textarea",cancelButton:".js-issue-comment-cancel",submitButton:".js-issue-comment-submit"},events:{click:"onClick","keydown @ui.textarea":"onKeydown","keyup @ui.textarea":"toggleSubmit","click @ui.cancelButton":"cancel","click @ui.submitButton":"submit"},onRender:function(){var t=this;f["default"].prototype.onRender.apply(this,arguments),setTimeout(function(){t.ui.textarea.focus()},100)},toggleSubmit:function(){this.ui.submitButton.prop("disabled",this.ui.textarea.val().length===0)},onClick:function(t){t.stopPropagation()},onKeydown:function(t){t.keyCode===27&&this.destroy()},cancel:function(){this.options.detailView.updateAfterAction(!1)},disableForm:function(){this.$(":input").prop("disabled",!0)},enableForm:function(){this.$(":input").prop("disabled",!1)},submit:function(){var t=this,n=this.ui.textarea.val(),r=this.model&&this.model.has("key"),i=r?"edit_comment":"add_comment",s=baseUrl+"/api/issues/"+i,o={text:n};return r?o.key=this.model.get("key"):o.issue=this.options.issue.id,this.disableForm(),this.options.detailView.disableControls(),u["default"].post(s,o).done(function(){t.options.detailView.updateAfterAction(!0)}).fail(function(){t.enableForm(),t.options.detailView.enableControls()})},serializeData:function(){var t=a["default"].defaults(this.options.additionalOptions,{fromTransition:!1});return a["default"].extend(f["default"].prototype.serializeData.apply(this,arguments),{options:t})}})}),define("components/issue/views/plan-form-view",["exports","module","jquery","underscore","components/common/action-options-view","../templates"],function(e,n,r,i,s,o){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}var a=u(r),f=u(i),l=u(s);n.exports=l["default"].extend({template:Templates["issue-plan-form"],getActionPlan:function(){return this.model.get("actionPlan")||""},selectInitialOption:function(){this.makeActive(this.getOptions().filter('[data-value="'+this.getActionPlan()+'"]'))},selectOption:function(t){var n=(0,a["default"])(t.currentTarget).data("value"),r=(0,a["default"])(t.currentTarget).data("text");return this.submit(n,r),l["default"].prototype.selectOption.apply(this,arguments)},submit:function(t){return this.model.plan(t)},getActionPlans:function(){return[{key:"",name:t("issue.unplanned")}].concat(this.collection.toJSON())},serializeData:function(){return f["default"].extend(l["default"].prototype.serializeData.apply(this,arguments),{items:this.getActionPlans()})}})}),define("components/issue/views/set-severity-form-view",["exports","module","jquery","underscore","components/common/action-options-view","../templates"],function(e,t,n,r,i,s){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var u=o(n),a=o(r),f=o(i);t.exports=f["default"].extend({template:Templates["issue-set-severity-form"],getTransition:function(){return this.model.get("severity")},selectInitialOption:function(){return this.makeActive(this.getOptions().filter('[data-value="'+this.getTransition()+'"]'))},selectOption:function(t){var n=(0,u["default"])(t.currentTarget).data("value");return this.submit(n),f["default"].prototype.selectOption.apply(this,arguments)},submit:function(t){return this.model.setSeverity(t)},serializeData:function(){return a["default"].extend(f["default"].prototype.serializeData.apply(this,arguments),{items:["BLOCKER","CRITICAL","MAJOR","MINOR","INFO"]})}})}),define("components/issue/views/more-actions-view",["exports","module","jquery","components/common/action-options-view","../templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=u["default"].extend({template:Templates["issue-more-actions"],selectOption:function(t){var n=(0,o["default"])(t.currentTarget).data("action");return this.submit(n),u["default"].prototype.selectOption.apply(this,arguments)},submit:function(t){return this.options.detailView.action(t)}})}),define("components/issue/views/tags-form-view",["exports","module","jquery","underscore","components/common/action-options-view","../templates"],function(e,t,n,r,i,s){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var u=o(n),a=o(r),f=o(i);t.exports=f["default"].extend({template:Templates["issue-tags-form"],optionTemplate:Templates["issue-tags-form-option"],modelEvents:{"change:tags":"renderTags"},events:function(){return a["default"].extend(f["default"].prototype.events.apply(this,arguments),{"click input":"onInputClick","keydown input":"onInputKeydown","keyup input":"onInputKeyup"})},initialize:function(){f["default"].prototype.initialize.apply(this,arguments),this.query="",this.tags=[],this.selected=0,this.debouncedSearch=a["default"].debounce(this.search,250),this.requestTags()},requestTags:function(t){var n=this;return u["default"].get(baseUrl+"/api/issues/tags",{ps:10,q:t}).done(function(e){n.tags=e.tags,n.renderTags()})},onRender:function(){var t=this;f["default"].prototype.onRender.apply(this,arguments),this.renderTags(),setTimeout(function(){t.$("input").focus()},100)},selectInitialOption:function(){this.selected=Math.max(Math.min(this.selected,this.getOptions().length-1),0),this.makeActive(this.getOptions().eq(this.selected))},filterTags:function(t){var n=this;return a["default"].filter(t,function(e){return e.indexOf(n.query)!==-1})},renderTags:function(){this.$(".menu").empty(),this.filterTags(this.getTags()).forEach(this.renderSelectedTag,this),this.filterTags(a["default"].difference(this.tags,this.getTags())).forEach(this.renderTag,this),this.query.length>0&&this.tags.indexOf(this.query)===-1&&this.getTags().indexOf(this.query)===-1&&this.renderCustomTag(this.query),this.selectInitialOption()},renderSelectedTag:function(t){var n=this.optionTemplate({tag:t,selected:!0,custom:!1});return this.$(".menu").append(n)},renderTag:function(t){var n=this.optionTemplate({tag:t,selected:!1,custom:!1});return this.$(".menu").append(n)},renderCustomTag:function(t){var n=this.optionTemplate({tag:t,selected:!1,custom:!0});return this.$(".menu").append(n)},selectOption:function(t){t.preventDefault(),t.stopPropagation();var n=this.getTags().slice(),r=(0,u["default"])(t.currentTarget).data("value");return(0,u["default"])(t.currentTarget).data("selected")!=null?n=a["default"].without(n,r):n.push(r),this.selected=this.getOptions().index((0,u["default"])(t.currentTarget)),this.submit(n)},submit:function(t){var n=this,r=this.getTags();return this.model.set({tags:t}),u["default"].ajax({type:"POST",url:baseUrl+"/api/issues/set_tags",data:{key:this.model.id,tags:t.join()}}).fail(function(){return n.model.set({tags:r})})},onInputClick:function(t){t.stopPropagation()},onInputKeydown:function(t){this.query=this.$("input").val(),t.keyCode===38&&this.selectPreviousOption(),t.keyCode===40&&this.selectNextOption(),t.keyCode===13&&this.selectActiveOption(),t.keyCode===27&&this.destroy();if([9,13,27,38,40].indexOf(t.keyCode)!==-1)return!1},onInputKeyup:function(){var t=this.$("input").val();t!==this.query&&(this.query=t,this.debouncedSearch(t))},search:function(t){return this.query=t,this.requestTags(t)},resetAssignees:function(t){this.assignees=t.map(function(e){return{id:e.login,text:e.name}}),this.renderTags()},getTags:function(){return this.model.get("tags")||[]}})}),define("components/workspace/models/item",["exports","module","backbone"],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=r(n);t.exports=i["default"].Model.extend({validate:function(){if(!this.has("type"))return"type is missing";if(this.get("type")==="component"&&!this.has("uuid"))return"uuid is missing";if(this.get("type")==="rule"&&!this.has("key"))return"key is missing"},isComponent:function(){return this.get("type")==="component"},isRule:function(){return this.get("type")==="rule"},destroy:function(t){this.stopListening(),this.trigger("destroy",this,this.collection,t)}})}),define("components/workspace/models/items",["exports","module","backbone","./item"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r),u="sonarqube-workspace";t.exports=s["default"].Collection.extend({model:o["default"],initialize:function(){this.on("remove",this.save)},save:function(){var t=JSON.stringify(this.toJSON());window.localStorage.setItem(u,t)},load:function(){var t=window.localStorage.getItem(u);if(t!=null)try{var n=JSON.parse(t);this.reset(n)}catch(r){}},has:function(t){var n=t.isComponent()&&this.findWhere({uuid:t.get("uuid")})!=null,r=t.isRule()&&this.findWhere({key:t.get("key")})!=null;return n||r},add2:function(t){var n=t.isComponent()?this.findWhere({uuid:t.get("uuid")}):this.findWhere({key:t.get("key")});return n!=null?n:this.add(t)}})}),this.Templates=this.Templates||{},this.Templates["workspace-item"]=Handlebars.template({1:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.qualifierIcon||e&&e.qualifierIcon||i).call(e,e!=null?e.q:e,{name:"qualifierIcon",hash:{},data:r}))+"&nbsp;"},3:function(e,t,n,r){return'<i class="icon-workspace-doc"></i>&nbsp;'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="";return i=t["if"].call(e,e!=null?e.q:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(u+=i),i=(t.eq||e&&e.eq||s).call(e,e!=null?e.type:e,"rule",{name:"eq",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+o((t.limitString||e&&e.limitString||s).call(e,e!=null?e.name:e,{name:"limitString",hash:{},data:r}))+'\n\n<button class="js-close button-clean" style="color: #fff;">&times;</button>\n'},useData:!0}),this.Templates["workspace-items"]=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){return'<ul class="workspace-nav-list"></ul>\n'},useData:!0}),this.Templates["workspace-rule"]=Handlebars.template({1:function(e,t,n,r){var i,s,o=t.helperMissing,u=this.escapeExpression,a="function",f='\n    <ul class="coding-rules-detail-properties">\n';return i=t["if"].call(e,e!=null?e.severity:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="\n",i=(t.notEq||e&&e.notEq||o).call(e,e!=null?e.status:e,"READY",{name:"notEq",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+='\n      <li class="coding-rules-detail-property coding-rules-detail-tag-list ',i=t["if"].call(e,e!=null?e.canWrite:e,{name:"if",hash:{},fn:this.program(7,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+='"\n          data-toggle="tooltip" data-placement="bottom" title="Rule tags">\n        <i class="icon-tags"></i>\n        <span>',i=t["if"].call(e,e!=null?e.allTags:e,{name:"if",hash:{},fn:this.program(9,r),inverse:this.program(11,r),data:r}),i!=null&&(f+=i),f+='</span>\n      </li>\n\n      <li class="coding-rules-detail-property">'+u((t.t||e&&e.t||o).call(e,"coding_rules.available_since",{name:"t",hash:{},data:r}))+" "+u((t.d||e&&e.d||o).call(e,e!=null?e.createdAt:e,{name:"d",hash:{},data:r}))+'</li>\n\n      <li class="pull-right spacer-left">\n        <a class="icon-link" target="_blank" href="'+u((t.rulePermalink||e&&e.rulePermalink||o).call(e,e!=null?e.key:e,{name:"rulePermalink",hash:{},data:r}))+'"></a>\n      </li>\n\n      <li class="pull-right">\n        <span class="note">'+u((s=(s=t.key||(e!=null?e.key:e))!=null?s:o,typeof s===a?s.call(e,{name:"key",hash:{},data:r}):s))+"</span>\n      </li>\n    </ul>\n\n",i=t["if"].call(e,e!=null?e.debtCharName:e,{name:"if",hash:{},fn:this.program(13,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+='\n    <div class="coding-rules-detail-description rule-desc markdown">',i=(s=(s=t.htmlDesc||(e!=null?e.htmlDesc:e))!=null?s:o,typeof s===a?s.call(e,{name:"htmlDesc",hash:{},data:r}):s),i!=null&&(f+=i),f+="</div>\n\n",i=t["if"].call(e,e!=null?e.htmlNote:e,{name:"if",hash:{},fn:this.program(24,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+"\n"},2:function(e,t,n,r){var i,s="";return i=t.unless.call(e,e!=null?e.isManual:e,{name:"unless",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s},3:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'          <li class="coding-rules-detail-property"\n              data-toggle="tooltip" data-placement="bottom" title="Default rule severity">\n            '+s((t.severityIcon||e&&e.severityIcon||i).call(e,e!=null?e.severity:e,{name:"severityIcon",hash:{},data:r}))+"&nbsp;"+s((t.t||e&&e.t||i).call(e,"severity",e!=null?e.severity:e,{name:"t",hash:{},data:r}))+"\n          </li>\n"},5:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'        <li class="coding-rules-detail-property"\n            data-toggle="tooltip" data-placement="bottom" title="Rule status">'+u((i=(i=t.status||(e!=null?e.status:e))!=null?i:o,typeof i===s?i.call(e,{name:"status",hash:{},data:r}):i))+"</li>\n"},7:function(e,t,n,r){return"coding-rules-detail-tags-change"},9:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.join||e&&e.join||i).call(e,e!=null?e.allTags:e,", ",{name:"join",hash:{},data:r}))},11:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.t||e&&e.t||i).call(e,"coding_rules.no_tags",{name:"t",hash:{},data:r}))},13:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='      <ul class="coding-rules-detail-properties">\n        <li class="coding-rules-detail-property"\n            data-toggle="tooltip" data-placement="bottom" title="Rule characteristic">\n          '+a((s=(s=t.debtCharName||(e!=null?e.debtCharName:e))!=null?s:u,typeof s===o?s.call(e,{name:"debtCharName",hash:{},data:r}):s));return i=t["if"].call(e,e!=null?e.debtSubCharName:e,{name:"if",hash:{},fn:this.program(14,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="\n        </li>\n\n",i=t["if"].call(e,e!=null?e.debtRemFnType:e,{name:"if",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+"      </ul>\n"},14:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return" > "+u((i=(i=t.debtSubCharName||(e!=null?e.debtSubCharName:e))!=null?i:o,typeof i===s?i.call(e,{name:"debtSubCharName",hash:{},data:r}):i))},16:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='          <li class="coding-rules-detail-property"\n              data-toggle="tooltip" data-placement="bottom" title="'+o((t.t||e&&e.t||s).call(e,"coding_rules.remediation_function",{name:"t",hash:{},data:r}))+'">\n            '+o((t.t||e&&e.t||s).call(e,"coding_rules.remediation_function",e!=null?e.debtRemFnType:e,{name:"t",hash:{},data:r}))+":\n\n            ";return i=t["if"].call(e,e!=null?e.debtRemFnOffset:e,{name:"if",hash:{},fn:this.program(17,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+="\n            ",i=t["if"].call(e,e!=null?e.debtRemFnCoeff:e,{name:"if",hash:{},fn:this.program(19,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+="\n            ",i=t["if"].call(e,e!=null?e.effortToFixDescription:e,{name:"if",hash:{},fn:this.program(22,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+"\n          </li>\n"},17:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return u((i=(i=t.debtRemFnOffset||(e!=null?e.debtRemFnOffset:e))!=null?i:o,typeof i===s?i.call(e,{name:"debtRemFnOffset",hash:{},data:r}):i))},19:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f="";return i=t["if"].call(e,e!=null?e.debtRemFnOffset:e,{name:"if",hash:{},fn:this.program(20,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+a((s=(s=t.debtRemFnCoeff||(e!=null?e.debtRemFnCoeff:e))!=null?s:u,typeof s===o?s.call(e,{name:"debtRemFnCoeff",hash:{},data:r}):s))},20:function(e,t,n,r){return"+"},22:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return u((i=(i=t.effortToFixDescription||(e!=null?e.effortToFixDescription:e))!=null?i:o,typeof i===s?i.call(e,{name:"effortToFixDescription",hash:{},data:r}):i))},24:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a='      <div id="coding-rules-detail-description-extra">\n        <div class="rule-desc markdown">';return i=(s=(s=t.htmlNote||(e!=null?e.htmlNote:e))!=null?s:u,typeof s===o?s.call(e,{name:"htmlNote",hash:{},data:r}):s),i!=null&&(a+=i),a+"</div>\n      </div>\n"},26:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'\n    <div class="alert alert-warning">'+s((t.t||e&&e.t||i).call(e,"workspace.no_rule",{name:"t",hash:{},data:r}))+"</div>\n\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s='<div class="workspace-viewer-header"></div>\n\n<div class="workspace-viewer-container">\n\n';return i=t["if"].call(e,e!=null?e.exist:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(26,r),data:r}),i!=null&&(s+=i),s+"\n</div>\n"},useData:!0}),this.Templates["workspace-viewer-header"]=Handlebars.template({1:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.qualifierIcon||e&&e.qualifierIcon||i).call(e,e!=null?e.q:e,{name:"qualifierIcon",hash:{},data:r}))+"&nbsp;"},3:function(e,t,n,r){return'<i class="icon-workspace-doc"></i>&nbsp;'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s,o=t.helperMissing,u="function",a=this.escapeExpression,f='<h6 class="workspace-viewer-name">';return i=t["if"].call(e,e!=null?e.q:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(f+=i),i=(t.eq||e&&e.eq||o).call(e,e!=null?e.type:e,"rule",{name:"eq",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+a((s=(s=t.name||(e!=null?e.name:e))!=null?s:o,typeof s===u?s.call(e,{name:"name",hash:{},data:r}):s))+'</h6>\n\n<div class="workspace-viewer-resize js-resize"></div>\n\n<div class="workspace-viewer-actions">\n  <a href="#" class="js-minimize icon-minimize spacer-right"\n     title="'+a((t.t||e&&e.t||o).call(e,"workspace.minimize",{name:"t",hash:{},data:r}))+'" data-placement="bottom" data-toggle="tooltip"></a>\n\n  <a href="#" class="js-full-screen icon-bigger-size spacer-right"\n     title="'+a((t.t||e&&e.t||o).call(e,"workspace.full_window",{name:"t",hash:{},data:r}))+'" data-placement="bottom" data-toggle="tooltip"></a>\n\n  <a href="#" class="js-normal-size icon-smaller-size spacer-right"\n     title="'+a((t.t||e&&e.t||o).call(e,"workspace.normal_size",{name:"t",hash:{},data:r}))+'" data-placement="bottom" data-toggle="tooltip"></a>\n\n  <a href="#" class="js-close icon-close"\n     title="'+a((t.t||e&&e.t||o).call(e,"workspace.close",{name:"t",hash:{},data:r}))+'" data-placement="bottom" data-toggle="tooltip"></a>\n</div>\n'},useData:!0}),this.Templates["workspace-viewer"]=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){return'<div class="workspace-viewer-header"></div>\n\n<div class="workspace-viewer-container"></div>\n'},useData:!0}),define("components/workspace/templates",function(){}),define("components/workspace/views/item-view",["exports","module","backbone.marionette","../templates"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n);t.exports=s["default"].ItemView.extend({tagName:"li",className:"workspace-nav-item",template:Templates["workspace-item"],modelEvents:{change:"render",showViewer:"onViewerShow",hideViewer:"onViewerHide"},events:{click:"onClick","click .js-close":"onCloseClick"},onClick:function(t){t.preventDefault(),this.options.collectionView.trigger("click",this.model)},onCloseClick:function(t){t.preventDefault(),t.stopPropagation(),this.model.destroy()},onViewerShow:function(){this.$el.addClass("hidden")},onViewerHide:function(){this.$el.removeClass("hidden")}})}),define("components/workspace/views/items-view",["exports","module","backbone.marionette","./item-view","../templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=o["default"].CompositeView.extend({className:"workspace-nav",template:Templates["workspace-items"],childViewContainer:".workspace-nav-list",childView:u["default"],childViewOptions:function(){return{collectionView:this}}})}),define("components/workspace/views/viewer-header-view",["exports","module","jquery","underscore","backbone.marionette","../templates"],function(e,t,n,r,i,s){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var u=o(n),a=o(r),f=o(i);t.exports=f["default"].ItemView.extend({template:Templates["workspace-viewer-header"],modelEvents:{change:"render"},events:{"mousedown .js-resize":"onResizeClick","click .js-minimize":"onMinimizeClick","click .js-full-screen":"onFullScreenClick","click .js-normal-size":"onNormalSizeClick","click .js-close":"onCloseClick"},onRender:function(){this.$('[data-toggle="tooltip"]').tooltip({container:"body"}),this.$(".js-normal-size").addClass("hidden")},onDestroy:function(){this.$('[data-toggle="tooltip"]').tooltip("destroy"),(0,u["default"])(".tooltip").remove()},onResizeClick:function(t){t.preventDefault(),this.startResizing(t)},onMinimizeClick:function(t){t.preventDefault(),this.trigger("viewerMinimize")},onFullScreenClick:function(t){t.preventDefault(),this.toFullScreen()},onNormalSizeClick:function(t){t.preventDefault(),this.toNormalSize()},onCloseClick:function(t){t.preventDefault(),this.trigger("viewerClose")},startResizing:function(t){this.initialResizePosition=t.clientY,this.initialResizeHeight=(0,u["default"])(".workspace-viewer-container").height();var n=a["default"].bind(this.processResizing,this),r=a["default"].bind(this.stopResizing,this);(0,u["default"])("body").on("mousemove.workspace",n).on("mouseup.workspace",r)},processResizing:function(t){var n=t.clientY,r=this.initialResizePosition-n,i=this.initialResizeHeight+r;(0,u["default"])(".workspace-viewer-container").height(i)},stopResizing:function(){(0,u["default"])("body").off("mousemove.workspace").off("mouseup.workspace")},toFullScreen:function(){this.$(".js-normal-size").removeClass("hidden"),this.$(".js-full-screen").addClass("hidden"),this.initialResizeHeight=(0,u["default"])(".workspace-viewer-container").height(),(0,u["default"])(".workspace-viewer-container").height("9999px")},toNormalSize:function(){this.$(".js-normal-size").addClass("hidden"),this.$(".js-full-screen").removeClass("hidden"),(0,u["default"])(".workspace-viewer-container").height(this.initialResizeHeight)}})}),define("components/workspace/views/base-viewer-view",["exports","module","backbone.marionette","./viewer-header-view"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r);t.exports=s["default"].LayoutView.extend({className:"workspace-viewer",modelEvents:{destroy:"destroy"},regions:{headerRegion:".workspace-viewer-header",viewerRegion:".workspace-viewer-container"},onRender:function(){this.showHeader(),this.$(".workspace-viewer-container").isolatedScroll()},onViewerMinimize:function(){this.trigger("viewerMinimize")},onViewerClose:function(){this.trigger("viewerClose",this.model)},showHeader:function(){var t=new o["default"]({model:this.model});this.listenTo(t,"viewerMinimize",this.onViewerMinimize),this.listenTo(t,"viewerClose",this.onViewerClose),this.headerRegion.show(t)}})}),define("components/workspace/views/viewer-view",["exports","module","./base-viewer-view","components/source-viewer/main","../templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=o["default"].extend({template:Templates["workspace-viewer"],onRender:function(){o["default"].prototype.onRender.apply(this,arguments),this.showViewer()},showViewer:function(){var t=u["default"].on?u["default"]:require("components/source-viewer/main"),n=this,r=new t,i=this.model.toJSON();r.open(this.model.get("uuid"),{workspace:!0}),r.on("loaded",function(){n.model.set({name:r.model.get("name"),q:r.model.get("q")}),i.line!=null&&(r.highlightLine(i.line),r.scrollToLine(i.line))}),this.viewerRegion.show(r)}})}),define("components/workspace/views/rule-view",["exports","module","underscore","backbone.marionette","./base-viewer-view","../templates"],function(e,t,n,r,i,s){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var u=o(n),a=o(r),f=o(i);t.exports=f["default"].extend({template:Templates["workspace-rule"],onRender:function(){f["default"].prototype.onRender.apply(this,arguments),this.$('[data-toggle="tooltip"]').tooltip({container:"body"})},onDestroy:function(){this.$('[data-toggle="tooltip"]').tooltip("destroy")},serializeData:function(){return u["default"].extend(a["default"].LayoutView.prototype.serializeData.apply(this,arguments),{allTags:u["default"].union(this.model.get("sysTags"),this.model.get("tags"))})}})}),define("components/workspace/main",["exports","module","jquery","underscore","./models/item","./models/items","./views/items-view","./views/viewer-view","./views/rule-view"],function(e,t,n,r,i,s,o,u,a){"use strict";function f(e){return e&&e.__esModule?e:{"default":e}}var l=f(n),c=f(r),h=f(i),p=f(s),d=f(o),v=f(u),m=f(a),g=null,y=function(){if(g!=null)throw new Error("Cannot instantiate more than one Workspace, use Workspace.getInstance()");this.initialize()};y.prototype={initialize:function(){var t=this;this.items=new p["default"],this.items.load(),this.items.on("change",function(){t.save()}),this.itemsView=new d["default"]({collection:this.items}),this.itemsView.render().$el.appendTo(document.body),this.itemsView.on("click",function(e){t.open(e)})},save:function(){this.items.save()},addComponent:function(t){var n=this.items.add2(t);return this.save(),n},open:function(t){var n=typeof t.toJSON=="function"?t:new h["default"](t);if(!n.isValid())throw new Error(n.validationError);var r=this.addComponent(n);r.isComponent()&&this.showComponentViewer(r),r.isRule()&&this.showRule(r)},openComponent:function(t){return this.open(c["default"].extend(t,{type:"component"}))},openRule:function(t){return this.open(c["default"].extend(t,{type:"rule"}))},showViewer:function(t,n){var r=this;this.viewerView!=null&&(this.viewerView.model.trigger("hideViewer"),this.viewerView.destroy()),(0,l["default"])("html").addClass("with-workspace"),n.trigger("showViewer"),this.viewerView=new t({model:n}),this.viewerView.on("viewerMinimize",function(){n.trigger("hideViewer"),r.closeComponentViewer()}).on("viewerClose",function(e){r.closeComponentViewer(),e.destroy()}),this.viewerView.render().$el.appendTo(document.body)},showComponentViewer:function(t){this.showViewer(v["default"],t)},closeComponentViewer:function(){this.viewerView!=null&&(this.viewerView.destroy(),(0,l["default"])(".with-workspace").removeClass("with-workspace"))},showRule:function(t){var n=this;this.fetchRule(t).done(function(){t.set({exist:!0}),n.showViewer(m["default"],t)}).fail(function(){t.set({exist:!1}),n.showViewer(m["default"],t)})},fetchRule:function(t){var n=baseUrl+"/api/rules/show",r={key:t.get("key")};return l["default"].get(n,r).done(function(e){t.set(e.rule)})}},y.getInstance=function(){return g==null&&(g=new y),g},t.exports=y.getInstance()}),define("components/issue/issue-view",["exports","module","jquery","underscore","backbone","backbone.marionette","./models/changelog","./views/changelog-view","./collections/action-plans","./views/transitions-form-view","./views/assign-form-view","./views/comment-form-view","./views/plan-form-view","./views/set-severity-form-view","./views/more-actions-view","./views/tags-form-view","components/workspace/main","./templates"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g){"use strict";function y(e){return e&&e.__esModule?e:{"default":e}}var b=y(n),w=y(r),E=y(i),S=y(s),x=y(o),T=y(u),N=y(a),C=y(f),k=y(l),L=y(c),A=y(h),O=y(p),M=y(d),_=y(v),D=y(m);t.exports=S["default"].ItemView.extend({className:"issue",template:Templates.issue,modelEvents:{change:"render",transition:"onTransition"},events:function(){return{"click .js-issue-comment":"onComment","click .js-issue-comment-edit":"editComment","click .js-issue-comment-delete":"deleteComment","click .js-issue-transition":"transition","click .js-issue-set-severity":"setSeverity","click .js-issue-assign":"assign","click .js-issue-assign-to-me":"assignToMe","click .js-issue-plan":"plan","click .js-issue-show-changelog":"showChangeLog","click .js-issue-more":"showMoreActions","click .js-issue-rule":"showRule","click .js-issue-edit-tags":"editTags","click .js-issue-locations":"showLocations"}},onRender:function(){this.$el.attr("data-key",this.model.get("key"))},disableControls:function(){this.$(":input").prop("disabled",!0)},enableControls:function(){this.$(":input").prop("disabled",!1)},resetIssue:function(t){var n=this,r=this.model.get("key"),i=this.model.get("componentUuid");return this.model.reset({key:r,componentUuid:i},{silent:!0}),this.model.fetch(t).done(function(){return n.trigger("reset")})},showChangeLog:function(t){var n=this,r=(0,b["default"])(t.currentTarget),i=new x["default"];return i.fetch({data:{issue:this.model.get("key")}}).done(function(){n.popup&&n.popup.destroy(),n.popup=new T["default"]({triggerEl:r,bottomRight:!0,collection:i,issue:n.model}),n.popup.render()})},updateAfterAction:function(t){this.popup&&this.popup.destroy(),t&&this.resetIssue()},onComment:function(t){t.stopPropagation(),this.comment()},comment:function(t){(0,b["default"])("body").click(),this.popup=new L["default"]({triggerEl:this.$(".js-issue-comment"),bottom:!0,issue:this.model,detailView:this,additionalOptions:t}),this.popup.render()},editComment:function(t){t.stopPropagation(),(0,b["default"])("body").click();var n=(0,b["default"])(t.currentTarget).closest(".issue-comment"),r=n.data("comment-key"),i=w["default"].findWhere(this.model.get("comments"),{key:r});this.popup=new L["default"]({triggerEl:(0,b["default"])(t.currentTarget),bottomRight:!0,model:new E["default"].Model(i),issue:this.model,detailView:this}),this.popup.render()},deleteComment:function(t){var n=this,r=(0,b["default"])(t.target).closest("[data-comment-key]").data("comment-key"),i=(0,b["default"])(t.target).data("confirm-msg");if(confirm(i))return this.disableControls(),b["default"].ajax({type:"POST",url:baseUrl+"/api/issues/delete_comment?key="+r}).done(function(){n.updateAfterAction(!0)})},transition:function(t){t.stopPropagation(),(0,b["default"])("body").click(),this.popup=new C["default"]({triggerEl:(0,b["default"])(t.currentTarget),bottom:!0,model:this.model,view:this}),this.popup.render()},setSeverity:function(t){t.stopPropagation(),(0,b["default"])("body").click(),this.popup=new O["default"]({triggerEl:(0,b["default"])(t.currentTarget),bottom:!0,model:this.model}),this.popup.render()},assign:function(t){t.stopPropagation(),(0,b["default"])("body").click(),this.popup=new k["default"]({triggerEl:(0,b["default"])(t.currentTarget),bottom:!0,model:this.model}),this.popup.render()},assignToMe:function(){var t=new k["default"]({model:this.model,triggerEl:(0,b["default"])("body")});t.submit(window.SS.user,window.SS.userName),t.destroy()},plan:function(t){var n=this,r=(0,b["default"])(t.currentTarget),i=new N["default"];return i.fetch({reset:!0,data:{project:this.model.get("project")}}).done(function(){t.stopPropagation(),(0,b["default"])("body").click(),n.popup=new A["default"]({triggerEl:r,bottom:!0,model:n.model,collection:i}),n.popup.render()})},showRule:function(){var t=this.model.get("rule"),n=D["default"].openComponent?D["default"]:require("components/workspace/main");n.openRule({key:t})},showMoreActions:function(t){t.stopPropagation(),(0,b["default"])("body").click(),this.popup=new M["default"]({triggerEl:(0,b["default"])(t.currentTarget),bottomRight:!0,model:this.model,detailView:this}),this.popup.render()},action:function(t){var n=this;return this.disableControls(),this.model.customAction(t).done(function(){n.updateAfterAction(!0)}).fail(function(){n.enableControls()})},editTags:function(t){t.stopPropagation(),(0,b["default"])("body").click(),this.popup=new _["default"]({triggerEl:(0,b["default"])(t.currentTarget),bottomRight:!0,model:this.model}),this.popup.render()},showLocations:function(){this.model.trigger("locations",this.model)},onTransition:function(t){(t==="falsepositive"||t==="wontfix")&&this.comment({fromTransition:!0})},serializeData:function(){var t=encodeURIComponent(this.model.get("key"));return w["default"].extend(S["default"].ItemView.prototype.serializeData.apply(this,arguments),{permalink:baseUrl+"/issues/search#issues="+t,hasSecondaryLocations:this.model.get("flows").length})}})}),Handlebars.registerPartial("_source-viewer-measures-all",Handlebars.template({1:function(e,t,n,r){var i,s=t.helperMissing,o='  <div class="source-viewer-measures-section source-viewer-measures-section-big">\n';return i=(t.eachEven||e&&e.eachEven||s).call(e,e!=null?e.measuresToDisplay:e,{name:"eachEven",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o+='  </div>\n\n  <div class="source-viewer-measures-section source-viewer-measures-section-big">\n',i=(t.eachOdd||e&&e.eachOdd||s).call(e,e!=null?e.measuresToDisplay:e,{name:"eachOdd",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o+"  </div>\n"},2:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='      <div class="source-viewer-measures-card">\n        <div class="measures">\n          <div class="measures-list">\n            <div class="measure measure-one-line measure-big">\n              <span class="measure-name">'+a((s=(s=t.name||(e!=null?e.name:e))!=null?s:u,typeof s===o?s.call(e,{name:"name",hash:{},data:r}):s))+"</span>\n            </div>\n";return i=t.each.call(e,e!=null?e.metrics:e,{name:"each",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+"          </div>\n        </div>\n      </div>\n"},3:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'                <div class="measure measure-one-line" data-metric="'+u((i=(i=t.key||(e!=null?e.key:e))!=null?i:o,typeof i===s?i.call(e,{name:"key",hash:{},data:r}):i))+'">\n                  <span class="measure-name">'+u((i=(i=t.name||(e!=null?e.name:e))!=null?i:o,typeof i===s?i.call(e,{name:"name",hash:{},data:r}):i))+'</span>\n                  <span class="measure-value">&nbsp;'+u((i=(i=t.value||(e!=null?e.value:e))!=null?i:o,typeof i===s?i.call(e,{name:"value",hash:{},data:r}):i))+"</span>\n                </div>\n"},5:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='      <div class="source-viewer-measures-card">\n        <div class="measures">\n          <div class="measures-list">\n            <div class="measure measure-one-line measure-big">\n              <span class="measure-name">'+a((s=(s=t.name||(e!=null?e.name:e))!=null?s:u,typeof s===o?s.call(e,{name:"name",hash:{},data:r}):s))+"</span>\n            </div>\n";return i=t.each.call(e,e!=null?e.metrics:e,{name:"each",hash:{},fn:this.program(6,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+"          </div>\n        </div>\n      </div>\n"},6:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'              <div class="measure measure-one-line" data-metric="'+u((i=(i=t.key||(e!=null?e.key:e))!=null?i:o,typeof i===s?i.call(e,{name:"key",hash:{},data:r}):i))+'">\n                <span class="measure-name">'+u((i=(i=t.name||(e!=null?e.name:e))!=null?i:o,typeof i===s?i.call(e,{name:"name",hash:{},data:r}):i))+'</span>\n                <span class="measure-value">&nbsp;'+u((i=(i=t.value||(e!=null?e.value:e))!=null?i:o,typeof i===s?i.call(e,{name:"value",hash:{},data:r}):i))+"</span>\n              </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o="";return i=(t.notEmpty||e&&e.notEmpty||s).call(e,e!=null?e.measuresToDisplay:e,{name:"notEmpty",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o+"\n"},useData:!0})),Handlebars.registerPartial("_source-viewer-measures-coverage",Handlebars.template({1:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='  <div class="measures">\n    <div class="measures-chart">\n      <span class="js-pie-chart"\n            data-value="'+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.measures:e)!=null?i.overall_coverage_raw:i,(i=e!=null?e.measures:e)!=null?i.coverage_raw:i,(i=e!=null?e.measures:e)!=null?i.it_coverage_raw:i,{name:"default",hash:{},data:r}))+'"\n            data-max="100"\n            data-color="#85bb43"\n            data-base-color="#d4333f"\n            data-size="47"></span>\n    </div>\n    <div class="measure measure-big" data-metric="coverage">\n      <span class="measure-value">'+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.measures:e)!=null?i.overall_coverage:i,(i=e!=null?e.measures:e)!=null?i.coverage:i,(i=e!=null?e.measures:e)!=null?i.it_coverage:i,{name:"default",hash:{},data:r}))+'</span>\n      <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.coverage.name",{name:"t",hash:{},data:r}))+"</span>\n    </div>\n  </div>\n\n";return i=(t.any||e&&e.any||s).call(e,(i=e!=null?e.measures:e)!=null?i.covered_lines:i,(i=e!=null?e.measures:e)!=null?i.lines_to_cover:i,(i=e!=null?e.measures:e)!=null?i.covered_conditions:i,(i=e!=null?e.measures:e)!=null?i.conditions_to_cover:i,{name:"any",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+="\n",i=(t.any||e&&e.any||s).call(e,(i=e!=null?e.measures:e)!=null?i.it_covered_lines:i,(i=e!=null?e.measures:e)!=null?i.it_lines_to_cover:i,(i=e!=null?e.measures:e)!=null?i.it_covered_conditions:i,(i=e!=null?e.measures:e)!=null?i.it_conditions_to_cover:i,{name:"any",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u},2:function(e,t,n,r){var i,s=this.lambda,o=this.escapeExpression,u='    <div class="measures">\n      <div class="measures-list">\n        <div class="measure measure-one-line">\n          <span class="measure-name">Covered by Unit Tests</span>\n        </div>\n        <div class="measure measure-one-line" data-metric="lines_to_cover">\n          <span class="measure-name">Lines</span>\n          <span class="measure-value">'+o(s((i=e!=null?e.measures:e)!=null?i.covered_lines:i,e))+"/"+o(s((i=e!=null?e.measures:e)!=null?i.lines_to_cover:i,e))+"</span>\n        </div>\n";return i=t["if"].call(e,(i=e!=null?e.measures:e)!=null?i.conditions_to_cover:i,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+"      </div>\n    </div>\n"},3:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'          <div class="measure measure-one-line" data-metric="conditions_to_cover">\n            <span class="measure-name">Conditions</span>\n            <span class="measure-value">'+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.measures:e)!=null?i.covered_conditions:i,0,{name:"default",hash:{},data:r}))+"/"+o(u((i=e!=null?e.measures:e)!=null?i.conditions_to_cover:i,e))+"</span>\n          </div>\n"},5:function(e,t,n,r){var i,s=this.lambda,o=this.escapeExpression,u='    <div class="measures">\n      <div class="measures-list">\n        <div class="measure measure-one-line">\n          <span class="measure-name">Covered by Integration Tests</span>\n        </div>\n        <div class="measure measure-one-line" data-metric="it_lines_to_cover">\n          <span class="measure-name">Lines</span>\n          <span class="measure-value">'+o(s((i=e!=null?e.measures:e)!=null?i.it_uncovered_lines:i,e))+"/"+o(s((i=e!=null?e.measures:e)!=null?i.it_lines_to_cover:i,e))+"</span>\n        </div>\n";return i=t["if"].call(e,(i=e!=null?e.measures:e)!=null?i.it_conditions_to_cover:i,{name:"if",hash:{},fn:this.program(6,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+"      </div>\n    </div>\n"},6:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'          <div class="measure measure-one-line" data-metric="it_conditions_to_cover">\n            <span class="measure-name">Conditions</span>\n            <span class="measure-value">'+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.measures:e)!=null?i.it_uncovered_conditions:i,0,{name:"default",hash:{},data:r}))+"/"+o(u((i=e!=null?e.measures:e)!=null?i.it_conditions_to_cover:i,e))+"</span>\n          </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o="";return i=(t.any||e&&e.any||s).call(e,(i=e!=null?e.measures:e)!=null?i.coverage:i,(i=e!=null?e.measures:e)!=null?i.it_coverage:i,{name:"any",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o},useData:!0})),Handlebars.registerPartial("_source-viewer-measures-duplications",Handlebars.template({1:function(e,t,n,r){var i,s=this.lambda,o=this.escapeExpression,u=t.helperMissing;return'  <div class="source-viewer-measures-card">\n    <div class="measures">\n      <div class="measures-chart">\n          <span class="js-pie-chart"\n                data-value="'+o(s((i=e!=null?e.measures:e)!=null?i.duplicated_lines_density_raw:i,e))+'"\n                data-max="100"\n                data-size="50"\n                data-color="#f3ca8e"></span>\n      </div>\n      <div class="measure measure-big" data-metric="duplicated_lines_density">\n        <span class="measure-value">'+o(s((i=e!=null?e.measures:e)!=null?i.duplicated_lines_density:i,e))+'</span>\n        <span class="measure-name">Duplications</span>\n      </div>\n    </div>\n\n    <div class="measures">\n      <div class="measures-list">\n        <div class="measure measure-one-line" data-metric="duplicated_blocks">\n          <span class="measure-name">'+o((t.t||e&&e.t||u).call(e,"metric.duplicated_blocks.name",{name:"t",hash:{},data:r}))+'</span>\n          <span class="measure-value">'+o(s((i=e!=null?e.measures:e)!=null?i.duplicated_blocks:i,e))+'</span>\n        </div>\n        <div class="measure measure-one-line" data-metric="duplicated_lines">\n          <span class="measure-name">'+o((t.t||e&&e.t||u).call(e,"metric.duplicated_lines.name",{name:"t",hash:{},data:r}))+'</span>\n          <span class="measure-value">'+o(s((i=e!=null?e.measures:e)!=null?i.duplicated_lines:i,e))+"</span>\n        </div>\n      </div>\n    </div>\n  </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o="";return i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.duplicated_lines_density:i,{name:"notNull",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o},useData:!0})),Handlebars.registerPartial("_source-viewer-measures-issues",Handlebars.template({1:function(e,t,n,r){var i,s=this.lambda,o=this.escapeExpression;return'        <div class="measure measure-big" data-metric="sqale_rating">\n          <span class="rating rating-'+o(s((i=e!=null?e.measures:e)!=null?i.sqale_rating:i,e))+'">'+o(s((i=e!=null?e.measures:e)!=null?i.sqale_rating:i,e))+"</span>\n        </div>\n"},3:function(e,t,n,r,i){var s,o='    <div class="measures">\n      <div class="measures-list">\n';return s=t.each.call(e,(s=e!=null?e.issuesFacets:e)!=null?s.severities:s,{name:"each",hash:{},fn:this.program(4,r,i),inverse:this.noop,data:r}),s!=null&&(o+=s),o+='      </div>\n    </div>\n\n    <div class="measures">\n      <div class="measures-list">\n',s=t.each.call(e,(s=e!=null?e.issuesFacets:e)!=null?s.tags:s,{name:"each",hash:{},fn:this.program(6,r,i),inverse:this.noop,data:r}),s!=null&&(o+=s),o+"      </div>\n    </div>\n"},4:function(e,t,n,r,i){var s,o=t.helperMissing,u=this.escapeExpression,a="function";return'          <div class="measure measure-one-line measure-with-bar">\n            <span class="measure-name">'+u((t.severityHelper||e&&e.severityHelper||o).call(e,e!=null?e.val:e,{name:"severityHelper",hash:{},data:r}))+'</span>\n            <span class="measure-value">'+u((s=(s=t.count||(e!=null?e.count:e))!=null?s:o,typeof s===a?s.call(e,{name:"count",hash:{},data:r}):s))+'</span>\n            <span class="measure-bar">\n              <span class="measure-bar-inner measure-bar-inner-'+u((s=(s=t.val||(e!=null?e.val:e))!=null?s:o,typeof s===a?s.call(e,{name:"val",hash:{},data:r}):s))+'"\n                    style="width: '+u((t.percent||e&&e.percent||o).call(e,e!=null?e.count:e,i[1]!=null?i[1].maxCountBySeverity:i[1],{name:"percent",hash:{},data:r}))+'"></span>\n            </span>\n          </div>\n'},6:function(e,t,n,r,i){var s,o="function",u=t.helperMissing,a=this.escapeExpression;return'          <div class="measure measure-one-line measure-with-bar">\n            <span class="measure-name">'+a((s=(s=t.val||(e!=null?e.val:e))!=null?s:u,typeof s===o?s.call(e,{name:"val",hash:{},data:r}):s))+'</span>\n            <span class="measure-value">'+a((s=(s=t.count||(e!=null?e.count:e))!=null?s:u,typeof s===o?s.call(e,{name:"count",hash:{},data:r}):s))+'</span>\n            <span class="measure-bar">\n              <span class="measure-bar-inner"\n                    style="width: '+a((t.percent||e&&e.percent||u).call(e,e!=null?e.count:e,i[1]!=null?i[1].maxCountByTag:i[1],{name:"percent",hash:{},data:r}))+'"></span>\n            </span>\n          </div>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r,i){var s,o=t.helperMissing,u=this.escapeExpression,a='<div class="source-viewer-measures-card">\n    <div class="measures">\n';return s=t["if"].call(e,(s=e!=null?e.measures:e)!=null?s.sqale_rating:s,{name:"if",hash:{},fn:this.program(1,r,i),inverse:this.noop,data:r}),s!=null&&(a+=s),a+='      <div class="measure measure-big" data-metric="sqale_index">\n        <span class="measure-value">'+u((t["default"]||e&&e["default"]||o).call(e,(s=e!=null?e.measures:e)!=null?s.sqale_index:s,0,{name:"default",hash:{},data:r}))+'</span>\n        <span class="measure-name">'+u((t.t||e&&e.t||o).call(e,"metric.sqale_index.short_name",{name:"t",hash:{},data:r}))+'</span>\n      </div>\n      <div class="measure measure-big" data-metric="violations">\n        <span class="measure-value">'+u((t["default"]||e&&e["default"]||o).call(e,e!=null?e.issuesCount:e,0,{name:"default",hash:{},data:r}))+'</span>\n        <span class="measure-name">'+u((t.t||e&&e.t||o).call(e,"metric.violations.name",{name:"t",hash:{},data:r}))+"</span>\n      </div>\n    </div>\n\n",s=t["if"].call(e,e!=null?e.issuesCount:e,{name:"if",hash:{},fn:this.program(3,r,i),inverse:this.noop,data:r}),s!=null&&(a+=s),a+"</div>\n"},useData:!0,useDepths:!0})),Handlebars.registerPartial("_source-viewer-measures-lines",Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'<div class="measures">\n  <div class="measures-list">\n    <div class="measure measure-one-line" data-metric="lines">\n      <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.lines.name",{name:"t",hash:{},data:r}))+'</span>\n      <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.lines:i,e))+'</span>\n    </div>\n    <div class="measure measure-one-line" data-metric="ncloc">\n      <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.ncloc.name",{name:"t",hash:{},data:r}))+'</span>\n      <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.ncloc:i,e))+'</span>\n    </div>\n    <div class="measure measure-one-line" data-metric="comment_lines">\n      <span class="measure-name">Comments</span>\n      <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.comment_lines_density:i,e))+" / "+o(u((i=e!=null?e.measures:e)!=null?i.comment_lines:i,e))+'</span>\n    </div>\n  </div>\n</div>\n\n<div class="measures">\n  <div class="measures-list">\n    <div class="measure measure-one-line" data-metric="complexity">\n      <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.complexity.name",{name:"t",hash:{},data:r}))+'</span>\n      <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.complexity:i,e))+'</span>\n    </div>\n    <div class="measure measure-one-line" data-metric="function_complexity">\n      <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.function_complexity.name",{name:"t",hash:{},data:r}))+'</span>\n      <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.function_complexity:i,e))+"</span>\n    </div>\n  </div>\n</div>\n"},useData:!0})),Handlebars.registerPartial("_source-viewer-measures-test-cases",Handlebars.template({1:function(e,t,n,r){return"active-link"},3:function(e,t,n,r){var i,s=t.helperMissing,o="          <tr>\n";return i=(t.eq||e&&e.eq||s).call(e,e!=null?e.status:e,"SKIPPED",{name:"eq",hash:{},fn:this.program(4,r),inverse:this.program(6,r),data:r}),i!=null&&(o+=i),o+"          </tr>\n"},4:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="function";return'              <td class="source-viewer-test-status note">'+o((t.testStatusIcon||e&&e.testStatusIcon||s).call(e,e!=null?e.status:e,{name:"testStatusIcon",hash:{},data:r}))+'</td>\n              <td class="source-viewer-test-duration note"></td>\n              <td class="source-viewer-test-name">'+o((i=(i=t.name||(e!=null?e.name:e))!=null?i:s,typeof i===u?i.call(e,{name:"name",hash:{},data:r}):i))+'</td>\n              <td class="source-viewer-test-covered-lines note"></td>\n'},6:function(e,t,n,r){var i,s=t.helperMissing,o="";return i=(t.ifTestData||e&&e.ifTestData||s).call(e,e,{name:"ifTestData",hash:{},fn:this.program(7,r),inverse:this.program(9,r),data:r}),i!=null&&(o+=i),o},7:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="function";return'                <td class="source-viewer-test-status note">'+o((t.testStatusIcon||e&&e.testStatusIcon||s).call(e,e!=null?e.status:e,{name:"testStatusIcon",hash:{},data:r}))+'</td>\n                <td class="source-viewer-test-duration note">'+o((i=(i=t.durationInMs||(e!=null?e.durationInMs:e))!=null?i:s,typeof i===u?i.call(e,{name:"durationInMs",hash:{},data:r}):i))+'ms</td>\n                <td class="source-viewer-test-name"><a class="js-show-test" data-id="'+o((i=(i=t.id||(e!=null?e.id:e))!=null?i:s,typeof i===u?i.call(e,{name:"id",hash:{},data:r}):i))+'">'+o((i=(i=t.name||(e!=null?e.name:e))!=null?i:s,typeof i===u?i.call(e,{name:"name",hash:{},data:r}):i))+'</a></td>\n                <td class="source-viewer-test-covered-lines note">'+o((i=(i=t.coveredLines||(e!=null?e.coveredLines:e))!=null?i:s,typeof i===u?i.call(e,{name:"coveredLines",hash:{},data:r}):i))+"</td>\n"},9:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="function";return'                <td class="source-viewer-test-status note">'+o((t.testStatusIcon||e&&e.testStatusIcon||s).call(e,e!=null?e.status:e,{name:"testStatusIcon",hash:{},data:r}))+'</td>\n                <td class="source-viewer-test-duration note">'+o((i=(i=t.durationInMs||(e!=null?e.durationInMs:e))!=null?i:s,typeof i===u?i.call(e,{name:"durationInMs",hash:{},data:r}):i))+'ms</td>\n                <td class="source-viewer-test-name">'+o((i=(i=t.name||(e!=null?e.name:e))!=null?i:s,typeof i===u?i.call(e,{name:"name",hash:{},data:r}):i))+"</td>\n"},11:function(e,t,n,r){var i,s=t.helperMissing,o='  <div class="source-viewer-measures-section source-viewer-measures-section-big js-selected-test">\n    <div class="source-viewer-measures-card source-viewer-measures-card-fixed-height">\n';return i=(t.notEq||e&&e.notEq||s).call(e,(i=e!=null?e.selectedTest:e)!=null?i.status:i,"ERROR",{name:"notEq",hash:{},fn:this.program(12,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o+="\n",i=(t.notEq||e&&e.notEq||s).call(e,(i=e!=null?e.selectedTest:e)!=null?i.status:i,"OK",{name:"notEq",hash:{},fn:this.program(18,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o+"    </div>\n  </div>\n"},12:function(e,t,n,r){var i,s=t.helperMissing,o="";return i=(t.notEq||e&&e.notEq||s).call(e,(i=e!=null?e.selectedTest:e)!=null?i.status:i,"FAILURE",{name:"notEq",hash:{},fn:this.program(13,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o},13:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='          <div class="bubble-popup-title">'+o((t.t||e&&e.t||s).call(e,"component_viewer.transition.covers",{name:"t",hash:{},data:r}))+"</div>\n";return i=t.each.call(e,e!=null?e.coveredFiles:e,{name:"each",hash:{},fn:this.program(14,r),inverse:this.program(16,r),data:r}),i!=null&&(u+=i),u},14:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="function";return'            <div class="bubble-popup-section">\n              <a target="_blank" href="'+o((t.dashboardUrl||e&&e.dashboardUrl||s).call(e,e!=null?e.key:e,{name:"dashboardUrl",hash:{},data:r}))+'" title="'+o((i=(i=t.longName||(e!=null?e.longName:e))!=null?i:s,typeof i===u?i.call(e,{name:"longName",hash:{},data:r}):i))+'">'+o((i=(i=t.longName||(e!=null?e.longName:e))!=null?i:s,typeof i===u?i.call(e,{name:"longName",hash:{},data:r}):i))+'</a>\n              <span class="note">'+o((t.tp||e&&e.tp||s).call(e,"component_viewer.x_lines_are_covered",e!=null?e.coveredLines:e,{name:"tp",hash:{},data:r}))+"</span>\n            </div>\n"},16:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return"            "+s((t.t||e&&e.t||i).call(e,"none",{name:"t",hash:{},data:r}))+"\n"},18:function(e,t,n,r){var i,s=this.escapeExpression,o=t.helperMissing,u=this.lambda,a="        "+s(t.log.call(e,e!=null?e.selectedTest:e,{name:"log",hash:{},data:r}))+'\n        <div class="bubble-popup-title">'+s((t.t||e&&e.t||o).call(e,"component_viewer.details",{name:"t",hash:{},data:r}))+"</div>\n";return i=t["if"].call(e,(i=e!=null?e.selectedTest:e)!=null?i.message:i,{name:"if",hash:{},fn:this.program(19,r),inverse:this.noop,data:r}),i!=null&&(a+=i),a+"        <pre>"+s(u((i=e!=null?e.selectedTest:e)!=null?i.stacktrace:i,e))+"</pre>\n"},19:function(e,t,n,r){var i,s=this.lambda,o=this.escapeExpression;return"          <pre>"+o(s((i=e!=null?e.selectedTest:e)!=null?i.message:i,e))+"</pre>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='<div class="source-viewer-measures-section source-viewer-measures-section-big">\n  <div class="source-viewer-measures-card source-viewer-measures-card-fixed-height js-test-list">\n    <div class="measures">\n      <table class="source-viewer-tests-list">\n        <tr>\n          <td class="source-viewer-test-status note" colspan="3">\n            '+o((t.t||e&&e.t||s).call(e,"component_viewer.measure_section.unit_tests",{name:"t",hash:{},data:r}))+"<br>\n            "+o((t.t||e&&e.t||s).call(e,"component_viewer.tests.ordered_by",{name:"t",hash:{},data:r}))+'\n            <a class="js-sort-tests-by-duration ';return i=(t.eq||e&&e.eq||s).call(e,e!=null?e.testSorting:e,"duration",{name:"eq",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+='">\n              '+o((t.t||e&&e.t||s).call(e,"component_viewer.tests.duration",{name:"t",hash:{},data:r}))+'</a>\n            /\n            <a class="js-sort-tests-by-name ',i=(t.eq||e&&e.eq||s).call(e,e!=null?e.testSorting:e,"name",{name:"eq",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+='">\n              '+o((t.t||e&&e.t||s).call(e,"component_viewer.tests.test_name",{name:"t",hash:{},data:r}))+'</a>\n            /\n            <a class="js-sort-tests-by-status ',i=(t.eq||e&&e.eq||s).call(e,e!=null?e.testSorting:e,"status",{name:"eq",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+='">\n              '+o((t.t||e&&e.t||s).call(e,"component_viewer.tests.status",{name:"t",hash:{},data:r}))+'</a>\n          </td>\n          <td class="source-viewer-test-covered-lines note">'+o((t.t||e&&e.t||s).call(e,"component_viewer.covered_lines",{name:"t",hash:{},data:r}))+"</td>\n        </tr>\n",i=t.each.call(e,e!=null?e.tests:e,{name:"each",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+="      </table>\n    </div>\n  </div>\n</div>\n\n",i=t["if"].call(e,e!=null?e.selectedTest:e,{name:"if",hash:{},fn:this.program(11,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u},useData:!0})),Handlebars.registerPartial("_source-viewer-measures-tests",Handlebars.template({1:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'        <div class="measure measure-one-line" data-metric="test_success_density">\n          <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.test_success_density.name",{name:"t",hash:{},data:r}))+'</span>\n          <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.test_success_density:i,e))+"</span>\n        </div>\n"},3:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'        <div class="measure measure-one-line" data-metric="test_failures">\n          <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.test_failures.name",{name:"t",hash:{},data:r}))+'</span>\n          <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.test_failures:i,e))+"</span>\n        </div>\n"},5:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'        <div class="measure measure-one-line" data-metric="test_errors">\n          <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.test_errors.name",{name:"t",hash:{},data:r}))+'</span>\n          <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.test_errors:i,e))+"</span>\n        </div>\n"},7:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'        <div class="measure measure-one-line" data-metric="skipped_tests">\n          <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.skipped_tests.name",{name:"t",hash:{},data:r}))+'</span>\n          <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.skipped_tests:i,e))+"</span>\n        </div>\n"},9:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'        <div class="measure measure-one-line" data-metric="test_execution_time">\n          <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.test_execution_time.name",{name:"t",hash:{},data:r}))+'</span>\n          <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.test_execution_time:i,e))+"</span>\n        </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda,a='<div class="source-viewer-measures-card">\n  <div class="measures">\n    <div class="measures-list">\n      <div class="measure measure-big" data-metric="tests">\n        <span class="measure-name">'+o((t.t||e&&e.t||s).call(e,"metric.tests.name",{name:"t",hash:{},data:r}))+'</span>\n        <span class="measure-value">'+o(u((i=e!=null?e.measures:e)!=null?i.tests:i,e))+"</span>\n      </div>\n";return i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.test_success_density:i,{name:"notNull",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(a+=i),i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.test_failures:i,{name:"notNull",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(a+=i),i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.test_errors:i,{name:"notNull",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),i!=null&&(a+=i),i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.skipped_tests:i,{name:"notNull",hash:{},fn:this.program(7,r),inverse:this.noop,data:r}),i!=null&&(a+=i),i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.test_execution_time:i,{name:"notNull",hash:{},fn:this.program(9,r),inverse:this.noop,data:r}),i!=null&&(a+=i),a+"    </div>\n  </div>\n</div>\n"},useData:!0})),this.Templates=this.Templates||{},this.Templates["source-viewer-coverage-popup"]=Handlebars.template({1:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="      "+o((t.t||e&&e.t||s).call(e,"source_viewer",e!=null?e.tests:e,"covered",{name:"t",hash:{},data:r}))+"\n";return i=t["if"].call(e,(i=e!=null?e.row:e)!=null?i.conditions:i,{name:"if",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u},2:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return"        ("+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.row:e)!=null?i.coveredConditions:i,0,{name:"default",hash:{},data:r}))+" of "+o(u((i=e!=null?e.row:e)!=null?i.conditions:i,e))+" "+o((t.t||e&&e.t||s).call(e,"source_viewer.conditions",{name:"t",hash:{},data:r}))+")\n"},4:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="      "+o((t.t||e&&e.t||s).call(e,"source_viewer",e!=null?e.tests:e,"not_covered",{name:"t",hash:{},data:r}))+"\n";return i=t["if"].call(e,(i=e!=null?e.row:e)!=null?i.conditions:i,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u},5:function(e,t,n,r){var i,s=this.lambda,o=this.escapeExpression,u=t.helperMissing;return"        ("+o(s((i=e!=null?e.row:e)!=null?i.conditions:i,e))+" "+o((t.t||e&&e.t||u).call(e,"source_viewer.conditions",{name:"t",hash:{},data:r}))+")\n"},7:function(e,t,n,r,i){var s,o=this.lambda,u=this.escapeExpression,a=t.helperMissing,f='    <div class="bubble-popup-section">\n      <a class="component-viewer-popup-test-file link-action" data-id="'+u(o((s=e!=null?e.file:e)!=null?s.id:s,e))+'" title="'+u(o((s=e!=null?e.file:e)!=null?s.longName:s,e))+'">\n        <span>'+u((t.collapsedDirFromPath||e&&e.collapsedDirFromPath||a).call(e,(s=e!=null?e.file:e)!=null?s.longName:s,{name:"collapsedDirFromPath",hash:{},data:r}))+'</span><span class="component-name-file">'+u((t.fileFromPath||e&&e.fileFromPath||a).call(e,(s=e!=null?e.file:e)!=null?s.longName:s,{name:"fileFromPath",hash:{},data:r}))+'</span>\n      </a>\n      <ul class="bubble-popup-list">\n';return s=t.each.call(e,e!=null?e.tests:e,{name:"each",hash:{},fn:this.program(8,r,i),inverse:this.noop,data:r}),s!=null&&(f+=s),f+"      </ul>\n    </div>\n"},8:function(e,t,n,r,i){var s,o,u="function",a=t.helperMissing,f=this.escapeExpression,l=this.lambda;return'          <li class="component-viewer-popup-test" title="'+f((o=(o=t.name||(e!=null?e.name:e))!=null?o:a,typeof o===u?o.call(e,{name:"name",hash:{},data:r}):o))+'">\n            <i class="component-viewer-popup-test-status '+f((t.testStatusIconClass||e&&e.testStatusIconClass||a).call(e,e!=null?e.status:e,{name:"testStatusIconClass",hash:{},data:r}))+'"></i>\n            <span class="component-viewer-popup-test-name">\n              <a class="component-viewer-popup-test-file link-action" title="'+f((o=(o=t.name||(e!=null?e.name:e))!=null?o:a,typeof o===u?o.call(e,{name:"name",hash:{},data:r}):o))+'"\n                 data-id="'+f(l((s=i[1]!=null?i[1].file:i[1])!=null?s.id:s,e))+'" data-method="'+f((o=(o=t.name||(e!=null?e.name:e))!=null?o:a,typeof o===u?o.call(e,{name:"name",hash:{},data:r}):o))+'">\n                '+f((o=(o=t.name||(e!=null?e.name:e))!=null?o:a,typeof o===u?o.call(e,{name:"name",hash:{},data:r}):o))+'\n              </a>\n            </span>\n            <span class="component-viewer-popup-test-duration">'+f((o=(o=t.durationInMs||(e!=null?e.durationInMs:e))!=null?o:a,typeof o===u?o.call(e,{name:"durationInMs",hash:{},data:r}):o))+"ms</span>\n          </li>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r,i){var s,o='<div class="bubble-popup-container">\n  <div class="bubble-popup-title">\n';return s=t["if"].call(e,(s=e!=null?e.row:e)!=null?s.lineHits:s,{name:"if",hash:{},fn:this.program(1,r,i),inverse:this.program(4,r,i),data:r}),s!=null&&(o+=s),o+="  </div>\n\n",s=t.each.call(e,e!=null?e.testFiles:e,{name:"each",hash:{},fn:this.program(7,r,i),inverse:this.noop,data:r}),s!=null&&(o+=s),o+'</div>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0,useDepths:!0}),this.Templates["source-viewer-duplication-popup"]=Handlebars.template({1:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'    <div class="alert alert-warning spacer-bottom">'+s((t.t||e&&e.t||i).call(e,"duplications.dups_found_on_deleted_resource",{name:"t",hash:{},data:r}))+"</div>\n"},3:function(e,t,n,r,i){var s,o=t.helperMissing,u=this.escapeExpression,a='    <div class="bubble-popup-title">'+u((t.t||e&&e.t||o).call(e,"component_viewer.transition.duplication",{name:"t",hash:{},data:r}))+"</div>\n";return s=t.each.call(e,e!=null?e.duplications:e,{name:"each",hash:{},fn:this.program(4,r,i),inverse:this.noop,data:r}),s!=null&&(a+=s),a},4:function(e,t,n,r,i){var s,o=t.helperMissing,u='      <div class="bubble-popup-section">\n        <div class="component-name">\n';return s=(t.notEqComponents||e&&e.notEqComponents||o).call(e,e!=null?e.file:e,i[1]!=null?i[1].component:i[1],{name:"notEqComponents",hash:{},fn:this.program(5,r,i),inverse:this.noop,data:r}),s!=null&&(u+=s),u+="\n",s=(t.notEq||e&&e.notEq||o).call(e,(s=e!=null?e.file:e)!=null?s.key:s,(s=i[1]!=null?i[1].component:i[1])!=null?s.key:s,{name:"notEq",hash:{},fn:this.program(8,r,i),inverse:this.noop,data:r}),s!=null&&(u+=s),u+='\n          <div class="component-name-path">\n            Lines:\n',s=(t.joinEach||e&&e.joinEach||o).call(e,e!=null?e.blocks:e,",",{name:"joinEach",hash:{},fn:this.program(10,r,i),inverse:this.noop,data:r}),s!=null&&(u+=s),u+"          </div>\n        </div>\n      </div>\n"},5:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda,a='            <div class="component-name-parent">\n              <i class="icon-qualifier-trk"></i>&nbsp;<a href="'+o((t.dashboardUrl||e&&e.dashboardUrl||s).call(e,(i=e!=null?e.file:e)!=null?i.project:i,{name:"dashboardUrl",hash:{},data:r}))+'">'+o(u((i=e!=null?e.file:e)!=null?i.projectName:i,e))+"</a>\n            </div>\n";return i=t["if"].call(e,(i=e!=null?e.file:e)!=null?i.subProjectName:i,{name:"if",hash:{},fn:this.program(6,r),inverse:this.noop,data:r}),i!=null&&(a+=i),a},6:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'              <div class="component-name-parent">\n                <i class="icon-qualifier-trk"></i>&nbsp;<a\n                  href="'+o((t.dashboardUrl||e&&e.dashboardUrl||s).call(e,(i=e!=null?e.file:e)!=null?i.subProject:i,{name:"dashboardUrl",hash:{},data:r}))+'">'+o(u((i=e!=null?e.file:e)!=null?i.subProjectName:i,e))+"</a>\n              </div>\n"},8:function(e,t,n,r){var i,s=this.lambda,o=this.escapeExpression,u=t.helperMissing;return'            <div class="component-name-path">\n              <a class="link-action" data-uuid="'+o(s((i=e!=null?e.file:e)!=null?i.uuid:i,e))+'" title="'+o(s((i=e!=null?e.file:e)!=null?i.name:i,e))+'">\n                <span>'+o((t.collapsedDirFromPath||e&&e.collapsedDirFromPath||u).call(e,(i=e!=null?e.file:e)!=null?i.name:i,{name:"collapsedDirFromPath",hash:{},data:r}))+'</span><span\n                  class="component-name-file">'+o((t.fileFromPath||e&&e.fileFromPath||u).call(e,(i=e!=null?e.file:e)!=null?i.name:i,{name:"fileFromPath",hash:{},data:r}))+"</span>\n              </a>\n            </div>\n"},10:function(e,t,n,r,i){var s,o,u=this.lambda,a=this.escapeExpression,f="function",l=t.helperMissing;return'              <a class="link-action" data-uuid="'+a(u((s=i[1]!=null?i[1].file:i[1])!=null?s.uuid:s,e))+'" data-line="'+a((o=(o=t.from||(e!=null?e.from:e))!=null?o:l,typeof o===f?o.call(e,{name:"from",hash:{},data:r}):o))+'">\n                '+a((o=(o=t.from||(e!=null?e.from:e))!=null?o:l,typeof o===f?o.call(e,{name:"from",hash:{},data:r}):o))+" – "+a((t.sum||e&&e.sum||l).call(e,e!=null?e.from:e,e!=null?e.size:e,-1,{name:"sum",hash:{},data:r}))+"\n              </a>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r,i){var s,o=t.helperMissing,u='<div class="bubble-popup-container">\n';return s=t["if"].call(e,e!=null?e.inRemovedComponent:e,{name:"if",hash:{},fn:this.program(1,r,i),inverse:this.noop,data:r}),s!=null&&(u+=s),s=(t.notEmpty||e&&e.notEmpty||o).call(e,e!=null?e.duplications:e,{name:"notEmpty",hash:{},fn:this.program(3,r,i),inverse:this.noop,data:r}),s!=null&&(u+=s),u+'</div>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0,useDepths:!0}),this.Templates["source-viewer-header"]=Handlebars.template({1:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="";return i=t["if"].call(e,e!=null?e.projectName:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+='\n      <div class="component-name-path">\n        '+o((t.qualifierIcon||e&&e.qualifierIcon||s).call(e,e!=null?e.q:e,{name:"qualifierIcon",hash:{},data:r}))+"&nbsp;<span>"+o((t.collapsedDirFromPath||e&&e.collapsedDirFromPath||s).call(e,e!=null?e.path:e,{name:"collapsedDirFromPath",hash:{},data:r}))+'</span><span class="component-name-file">'+o((t.fileFromPath||e&&e.fileFromPath||s).call(e,e!=null?e.path:e,{name:"fileFromPath",hash:{},data:r}))+"</span>\n\n",i=t["if"].call(e,e!=null?e.canMarkAsFavourite:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+"      </div>\n"},2:function(e,t,n,r){var i,s,o=t.helperMissing,u=this.escapeExpression,a="function",f='        <div class="component-name-parent">\n          '+u((t.qualifierIcon||e&&e.qualifierIcon||o).call(e,"TRK",{name:"qualifierIcon",hash:{},data:r}))+'&nbsp;<a href="'+u((t.dashboardUrl||e&&e.dashboardUrl||o).call(e,e!=null?e.project:e,{name:"dashboardUrl",hash:{},data:r}))+'">'+u((s=(s=t.projectName||(e!=null?e.projectName:e))!=null?s:o,typeof s===a?s.call(e,{name:"projectName",hash:{},data:r}):s))+"</a>\n        </div>\n";return i=t["if"].call(e,e!=null?e.subProjectName:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f},3:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="function";return'          <div class="component-name-parent">\n            '+o((t.qualifierIcon||e&&e.qualifierIcon||s).call(e,"TRK",{name:"qualifierIcon",hash:{},data:r}))+'&nbsp;<a href="'+o((t.dashboardUrl||e&&e.dashboardUrl||s).call(e,e!=null?e.subProject:e,{name:"dashboardUrl",hash:{},data:r}))+'">'+o((i=(i=t.subProjectName||(e!=null?e.subProjectName:e))!=null?i:s,typeof i===u?i.call(e,{name:"subProjectName",hash:{},data:r}):i))+"</a>\n          </div>\n"},5:function(e,t,n,r){var i,s='          <a class="js-favorite component-name-favorite ';return i=t["if"].call(e,e!=null?e.fav:e,{name:"if",hash:{},fn:this.program(6,r),inverse:this.program(8,r),data:r}),i!=null&&(s+=i),s+='"\n             title="',i=t["if"].call(e,e!=null?e.fav:e,{name:"if",hash:{},fn:this.program(10,r),inverse:this.program(12,r),data:r}),i!=null&&(s+=i),s+'">\n          </a>\n'},6:function(e,t,n,r){return"icon-favorite"},8:function(e,t,n,r){return"icon-not-favorite"},10:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.t||e&&e.t||i).call(e,"click_to_remove_from_favorites",{name:"t",hash:{},data:r}))},12:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return s((t.t||e&&e.t||i).call(e,"click_to_add_to_favorites",{name:"t",hash:{},data:r}))},14:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'      <div class="source-viewer-header-component-project removed">'+u((i=(i=t.removedMessage||(e!=null?e.removedMessage:e))!=null?i:o,typeof i===s?i.call(e,{name:"removedMessage",hash:{},data:r}):i))+"</div>\n"},16:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='  <a class="js-actions source-viewer-header-actions icon-list" title="'+o((t.t||e&&e.t||s).call(e,"component_viewer.more_actions",{name:"t",hash:{},data:r}))+'"></a>\n\n  <div class="source-viewer-header-measures">\n';return i=t["if"].call(e,e!=null?e.isUnitTest:e,{name:"if",hash:{},fn:this.program(17,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+="\n",i=t.unless.call(e,e!=null?e.isUnitTest:e,{name:"unless",hash:{},fn:this.program(19,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+="\n",i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.sqaleRating:i,{name:"notNull",hash:{},fn:this.program(21,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+="\n",i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.debt:i,{name:"notNull",hash:{},fn:this.program(24,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+='\n    <div class="source-viewer-header-measure">\n      <span class="source-viewer-header-measure-value">\n        <a class="source-viewer-header-external-link" target="_blank"\n           href="'+o((t.link||e&&e.link||s).call(e,"/issues/search#resolved=false|fileUuids=",e!=null?e.uuid:e,{name:"link",hash:{},data:r}))+'">\n          '+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.measures:e)!=null?i.issues:i,0,{name:"default",hash:{},data:r}))+'&nbsp;<i class="icon-detach"></i>\n        </a>\n      </span>\n      <span class="source-viewer-header-measure-label">'+o((t.t||e&&e.t||s).call(e,"metric.violations.name",{name:"t",hash:{},data:r}))+"</span>\n    </div>\n\n",i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.coverage:i,{name:"notNull",hash:{},fn:this.program(26,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+="\n",i=(t.notNull||e&&e.notNull||s).call(e,(i=e!=null?e.measures:e)!=null?i.duplicationDensity:i,{name:"notNull",hash:{},fn:this.program(28,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+"\n  </div>\n"},17:function(e,t,n,r){var i,s=this.lambda,o=this.escapeExpression,u=t.helperMissing;return'      <div class="source-viewer-header-measure">\n        <span class="source-viewer-header-measure-value">'+o(s((i=e!=null?e.measures:e)!=null?i.tests:i,e))+'</span>\n        <span class="source-viewer-header-measure-label">'+o((t.t||e&&e.t||u).call(e,"metric.tests.name",{name:"t",hash:{},data:r}))+"</span>\n      </div>\n"},19:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression;return'      <div class="source-viewer-header-measure">\n        <span class="source-viewer-header-measure-value">'+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.measures:e)!=null?i.lines:i,{name:"default",hash:{},data:r}))+'</span>\n        <span class="source-viewer-header-measure-label">'+o((t.t||e&&e.t||s).call(e,"metric.lines.name",{name:"t",hash:{},data:r}))+"</span>\n      </div>\n"},21:function(e,t,n,r){var i,s=this.lambda,o=this.escapeExpression,u='      <div class="source-viewer-header-measure">\n        <span class="rating rating-'+o(s((i=e!=null?e.measures:e)!=null?i.sqaleRating:i,e))+'"\n              ';return i=t["if"].call(e,(i=e!=null?e.measures:e)!=null?i.debtRatio:i,{name:"if",hash:{},fn:this.program(22,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+">\n          "+o(s((i=e!=null?e.measures:e)!=null?i.sqaleRating:i,e))+"\n        </span>\n      </div>\n"},22:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u=this.lambda;return'title="'+o((t.t||e&&e.t||s).call(e,"metric.sqale_debt_ratio.name",{name:"t",hash:{},data:r}))+": "+o(u((i=e!=null?e.measures:e)!=null?i.debtRatio:i,e))+'"'},24:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression;return'      <div class="source-viewer-header-measure">\n        <span class="source-viewer-header-measure-value">'+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.measures:e)!=null?i.debt:i,{name:"default",hash:{},data:r}))+'</span>\n        <span class="source-viewer-header-measure-label">'+o((t.t||e&&e.t||s).call(e,"component_viewer.header.debt",{name:"t",hash:{},data:r}))+"</span>\n      </div>\n"},26:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression;return'      <div class="source-viewer-header-measure">\n        <span class="source-viewer-header-measure-value">'+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.measures:e)!=null?i.coverage:i,{name:"default",hash:{},data:r}))+'</span>\n        <span class="source-viewer-header-measure-label">'+o((t.t||e&&e.t||s).call(e,"metric.coverage.name",{name:"t",hash:{},data:r}))+"</span>\n      </div>\n"},28:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression;return'      <div class="source-viewer-header-measure">\n        <span class="source-viewer-header-measure-value">'+o((t["default"]||e&&e["default"]||s).call(e,(i=e!=null?e.measures:e)!=null?i.duplicationDensity:i,{name:"default",hash:{},data:r}))+'</span>\n        <span class="source-viewer-header-measure-label">'+o((t.t||e&&e.t||s).call(e,"duplications",{name:"t",hash:{},data:r}))+"</span>\n      </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s='<div class="source-viewer-header-component">\n  <div class="component-name">\n\n';return i=t.unless.call(e,e!=null?e.removed:e,{name:"unless",hash:{},fn:this.program(1,r),inverse:this.program(14,r),data:r}),i!=null&&(s+=i),s+="  </div>\n</div>\n\n",i=t.unless.call(e,e!=null?e.removed:e,{name:"unless",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s},useData:!0}),this.Templates["source-viewer-issue-location"]=Handlebars.template({1:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return"<strong>"+u((i=(i=t.index||(e!=null?e.index:e))!=null?i:o,typeof i===s?i.call(e,{name:"index",hash:{},data:r}):i))+": </strong>"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='<div class="source-viewer-issue-location" title="'+a((s=(s=t.msg||(e!=null?e.msg:e))!=null?s:u,typeof s===o?s.call(e,{name:"msg",hash:{},data:r}):s))+'">\n  ';return i=t["if"].call(e,e!=null?e.index:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+"\n  "+a((t.limitString||e&&e.limitString||u).call(e,e!=null?e.msg:e,{name:"limitString",hash:{},data:r}))+"\n</div>\n"},useData:!0}),this.Templates["source-viewer-line-options-popup"]=Handlebars.template({1:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'    <div class="bubble-popup-section">\n      <a href="#" class="js-add-manual-issue link-action">'+s((t.t||e&&e.t||i).call(e,"component_viewer.add_manual_issue",{name:"t",hash:{},data:r}))+"</a>\n    </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='<div class="bubble-popup-container">\n  <div class="bubble-popup-section">\n    <a href="#" class="js-get-permalink link-action">'+o((t.t||e&&e.t||s).call(e,"component_viewer.get_permalink",{name:"t",hash:{},data:r}))+"</a>\n  </div>\n\n";return i=t["if"].call(e,e!=null?e.canCreateManualIssue:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+'</div>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0}),this.Templates["source-viewer-measures"]=Handlebars.template({1:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="";return i=t["if"].call(e,e!=null?e.projectName:e,{name:"if",hash:{},fn:this.program(2,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+'\n      <div class="source-viewer-header-component-name">\n        '+o((t.qualifierIcon||e&&e.qualifierIcon||s).call(e,e!=null?e.q:e,{name:"qualifierIcon",hash:{},data:r}))+" "+o((t["default"]||e&&e["default"]||s).call(e,e!=null?e.path:e,e!=null?e.longName:e,{name:"default",hash:{},data:r}))+"\n      </div>\n"},2:function(e,t,n,r){var i,s,o=t.helperMissing,u=this.escapeExpression,a="function",f='        <div class="source-viewer-header-component-project">\n          '+u((t.qualifierIcon||e&&e.qualifierIcon||o).call(e,"TRK",{name:"qualifierIcon",hash:{},data:r}))+'&nbsp;<a href="'+u((t.dashboardUrl||e&&e.dashboardUrl||o).call(e,e!=null?e.project:e,{name:"dashboardUrl",hash:{},data:r}))+'">'+u((s=(s=t.projectName||(e!=null?e.projectName:e))!=null?s:o,typeof s===a?s.call(e,{name:"projectName",hash:{},data:r}):s))+"</a>\n";return i=t["if"].call(e,e!=null?e.subProjectName:e,{name:"if",hash:{},fn:this.program(3,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+"        </div>\n"},3:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u="function";return"            &nbsp;&nbsp;&nbsp;\n            "+o((t.qualifierIcon||e&&e.qualifierIcon||s).call(e,"TRK",{name:"qualifierIcon",hash:{},data:r}))+'&nbsp;<a href="'+o((t.dashboardUrl||e&&e.dashboardUrl||s).call(e,e!=null?e.subProject:e,{name:"dashboardUrl",hash:{},data:r}))+'">'+o((i=(i=t.subProjectName||(e!=null?e.subProjectName:e))!=null?i:s,typeof i===u?i.call(e,{name:"subProjectName",hash:{},data:r}):i))+"</a>\n"},5:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'      <div class="source-viewer-header-component-project removed">'+u((i=(i=t.removedMessage||(e!=null?e.removedMessage:e))!=null?i:o,typeof i===s?i.call(e,{name:"removedMessage",hash:{},data:r}):i))+"</div>\n"},7:function(e,t,n,r){var i,s=t.helperMissing,o='    <div class="source-viewer-measures">\n      <div class="source-viewer-measures-section">\n        <div class="source-viewer-measures-card">\n';return i=this.invokePartial(n["_source-viewer-measures-lines"],"          ","_source-viewer-measures-lines",e,undefined,t,n,r),i!=null&&(o+=i),o+='        </div>\n      </div>\n\n      <div class="source-viewer-measures-section">\n',i=this.invokePartial(n["_source-viewer-measures-issues"],"        ","_source-viewer-measures-issues",e,undefined,t,n,r),i!=null&&(o+=i),o+="      </div>\n\n",i=(t.any||e&&e.any||s).call(e,(i=e!=null?e.measures:e)!=null?i.coverage:i,(i=e!=null?e.measures:e)!=null?i.it_coverage:i,{name:"any",hash:{},fn:this.program(8,r),inverse:this.noop,data:r}),i!=null&&(o+=i),o+='\n      <div class="source-viewer-measures-section">\n',i=this.invokePartial(n["_source-viewer-measures-duplications"],"        ","_source-viewer-measures-duplications",e,undefined,t,n,r),i!=null&&(o+=i),o+"      </div>\n    </div>\n"},8:function(e,t,n,r){var i,s='        <div class="source-viewer-measures-section">\n          <div class="source-viewer-measures-card">\n';return i=this.invokePartial(n["_source-viewer-measures-coverage"],"            ","_source-viewer-measures-coverage",e,undefined,t,n,r),i!=null&&(s+=i),s+"          </div>\n        </div>\n"},10:function(e,t,n,r){var i,s='    <div class="source-viewer-measures">\n      <div class="source-viewer-measures-section">\n';return i=this.invokePartial(n["_source-viewer-measures-tests"],"        ","_source-viewer-measures-tests",e,undefined,t,n,r),i!=null&&(s+=i),s+='      </div>\n    </div>\n    <div class="source-viewer-measures">\n',i=this.invokePartial(n["_source-viewer-measures-test-cases"],"      ","_source-viewer-measures-test-cases",e,undefined,t,n,r),i!=null&&(s+=i),s+"    </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='<div class="modal-container source-viewer-measures-modal">\n  <div class="source-viewer-header-component source-viewer-measures-component">\n';return i=t.unless.call(e,e!=null?e.removed:e,{name:"unless",hash:{},fn:this.program(1,r),inverse:this.program(5,r),data:r}),i!=null&&(u+=i),u+="  </div>\n\n",i=t.unless.call(e,e!=null?e.isUnitTest:e,{name:"unless",hash:{},fn:this.program(7,r),inverse:this.program(10,r),data:r}),i!=null&&(u+=i),u+='\n\n  <div class="marginbottom10">&nbsp;</div>\n  <a class="js-show-all-measures">'+o((t.t||e&&e.t||s).call(e,"component_viewer.show_all_measures",{name:"t",hash:{},data:r}))+'</a>\n\n  <div class="source-viewer-measures source-viewer-measures-secondary js-all-measures hidden">\n',i=this.invokePartial(n["_source-viewer-measures-all"],"    ","_source-viewer-measures-all",e,undefined,t,n,r),i!=null&&(u+=i),u+'  </div>\n</div>\n\n<div class="modal-foot">\n  <a class="js-modal-close" href="#">'+o((t.t||e&&e.t||s).call(e,"close",{name:"t",hash:{},data:r}))+"</a>\n</div>\n"},usePartial:!0,useData:!0}),this.Templates["source-viewer-more-actions"]=Handlebars.template({1:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'  <br>\n  <a class="js-workspace">'+s((t.t||e&&e.t||i).call(e,"component_viewer.open_in_workspace",{name:"t",hash:{},data:r}))+"</a>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s=t.helperMissing,o=this.escapeExpression,u='<a class="js-measures">'+o((t.t||e&&e.t||s).call(e,"component_viewer.show_details",{name:"t",hash:{},data:r}))+'</a>\n<br>\n<a class="js-new-window">'+o((t.t||e&&e.t||s).call(e,"component_viewer.new_window",{name:"t",hash:{},data:r}))+"</a>\n";return i=t.unless.call(e,(i=e!=null?e.options:e)!=null?i.workspace:i,{name:"unless",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(u+=i),u+'<br>\n<a class="js-raw-source">'+o((t.t||e&&e.t||s).call(e,"component_viewer.show_raw_source",{name:"t",hash:{},data:r}))+"</a>\n"},useData:!0}),this.Templates["source-viewer-scm-popup"]=Handlebars.template({1:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'    <div class="bubble-popup-section">\n      '+u((i=(i=t.scmRevision||(e!=null?e.scmRevision:e))!=null?i:o,typeof i===s?i.call(e,{name:"scmRevision",hash:{},data:r}):i))+"\n    </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='<div class="bubble-popup-container">\n  <div class="bubble-popup-section">\n    '+a((s=(s=t.scmAuthor||(e!=null?e.scmAuthor:e))!=null?s:u,typeof s===o?s.call(e,{name:"scmAuthor",hash:{},data:r}):s))+'\n  </div>\n  <div class="bubble-popup-section">\n    '+a((t.dt||e&&e.dt||u).call(e,e!=null?e.scmDate:e,{name:"dt",hash:{},data:r}))+"\n  </div>\n";return i=t["if"].call(e,e!=null?e.scmRevision:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+'</div>\n\n<div class="bubble-popup-arrow"></div>\n'},useData:!0}),this.Templates["source-viewer"]=Handlebars.template({1:function(e,t,n,r,i){var s,o="\n";return s=t["if"].call(e,e!=null?e.exist:e,{name:"if",hash:{},fn:this.program(2,r,i),inverse:this.program(46,r,i),data:r}),s!=null&&(o+=s),o+"\n"},2:function(e,t,n,r,i){var s,o="\n";return s=t["if"].call(e,e!=null?e.hasSourceBefore:e,{name:"if",hash:{},fn:this.program(3,r,i),inverse:this.noop,data:r}),s!=null&&(o+=s),o+='\n    <table class="source-table">\n',s=t.each.call(e,e!=null?e.source:e,{name:"each",hash:{},fn:this.program(5,r,i),inverse:this.noop,data:r}),s!=null&&(o+=s),o+="    </table>\n\n",s=t["if"].call(e,e!=null?e.hasSourceAfter:e,{name:"if",hash:{},fn:this.program(44,r,i),inverse:this.noop,data:r}),s!=null&&(o+=s),o+"\n"},3:function(e,t,n,r){return'      <i class="spinner js-component-viewer-source-before"></i>\n'},5:function(e,t,n,r,i){var s,o,u=t.helperMissing,a="function",f=this.escapeExpression,l='        <tr class="source-line ';return s=(t.eq||e&&e.eq||u).call(e,e!=null?e.line:e,0,{name:"eq",hash:{},fn:this.program(6,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+='" ',s=t["if"].call(e,e!=null?e.line:e,{name:"if",hash:{},fn:this.program(9,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+='>\n          <td class="source-meta source-line-number" ',s=t["if"].call(e,e!=null?e.line:e,{name:"if",hash:{},fn:this.program(9,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+='></td>\n\n          <td class="source-meta source-line-scm" ',s=t["if"].call(e,e!=null?e.line:e,{name:"if",hash:{},fn:this.program(9,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+=">\n",s=(t.ifSCMChanged2||e&&e.ifSCMChanged2||u).call(e,i[1]!=null?i[1].source:i[1],e!=null?e.line:e,{name:"ifSCMChanged2",hash:{},fn:this.program(11,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+="          </td>\n\n",s=t["if"].call(e,i[1]!=null?i[1].hasUTCoverage:i[1],{name:"if",hash:{},fn:this.program(13,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+="\n",s=t["if"].call(e,i[1]!=null?i[1].hasITCoverage:i[1],{name:"if",hash:{},fn:this.program(18,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+="\n",s=t["if"].call(e,i[1]!=null?i[1].hasDuplications:i[1],{name:"if",hash:{},fn:this.program(23,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+='\n          <td class="source-meta source-line-issues ',s=(t.notEmpty||e&&e.notEmpty||u).call(e,e!=null?e.issues:e,{name:"notEmpty",hash:{},fn:this.program(31,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+='"\n              data-line-number="'+f((o=(o=t.line||(e!=null?e.line:e))!=null?o:u,typeof o===a?o.call(e,{name:"line",hash:{},data:r}):o))+'">\n',s=(t.withFirst||e&&e.withFirst||u).call(e,e!=null?e.issues:e,{name:"withFirst",hash:{},fn:this.program(33,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),s=(t.ifLengthGT||e&&e.ifLengthGT||u).call(e,e!=null?e.issues:e,1,{name:"ifLengthGT",hash:{},fn:this.program(35,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+='          </td>\n\n          <td class="source-meta source-line-filtered-container" data-line-number="'+f((o=(o=t.line||(e!=null?e.line:e))!=null?o:u,typeof o===a?o.call(e,{name:"line",hash:{},data:r}):o))+'">\n            <div class="source-line-bar"></div>\n          </td>\n\n          <td class="source-line-code code ',s=(t.notEmpty||e&&e.notEmpty||u).call(e,e!=null?e.issues:e,{name:"notEmpty",hash:{},fn:this.program(37,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+='" data-line-number="'+f((o=(o=t.line||(e!=null?e.line:e))!=null?o:u,typeof o===a?o.call(e,{name:"line",hash:{},data:r}):o))+'">\n            <div class="source-line-code-inner">\n',s=(t.notNull||e&&e.notNull||u).call(e,e!=null?e.code:e,{name:"notNull",hash:{},fn:this.program(39,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+='\n              <div class="source-line-issue-locations"></div>\n            </div>\n\n',s=(t.notEmpty||e&&e.notEmpty||u).call(e,e!=null?e.issues:e,{name:"notEmpty",hash:{},fn:this.program(41,r,i),inverse:this.noop,data:r}),s!=null&&(l+=s),l+"          </td>\n        </tr>\n"},6:function(e,t,n,r){var i,s=t.helperMissing;return i=(t.empty||e&&e.empty||s).call(e,e!=null?e.issues:e,{name:"empty",hash:{},fn:this.program(7,r),inverse:this.noop,data:r}),i!=null?i:""},7:function(e,t,n,r){return"hidden"},9:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'data-line-number="'+u((i=(i=t.line||(e!=null?e.line:e))!=null?i:o,typeof i===s?i.call(e,{name:"line",hash:{},data:r}):i))+'"'},11:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'              <div class="source-line-scm-inner" data-author="'+u((i=(i=t.scmAuthor||(e!=null?e.scmAuthor:e))!=null?i:o,typeof i===s?i.call(e,{name:"scmAuthor",hash:{},data:r}):i))+'"></div>\n'},13:function(e,t,n,r){var i,s,o=t.helperMissing,u="function",a=this.escapeExpression,f='            <td class="source-meta source-line-coverage ';return i=(t.notNull||e&&e.notNull||o).call(e,e!=null?e.utCoverageStatus:e,{name:"notNull",hash:{},fn:this.program(14,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+='"\n                data-tests="ut"\n                data-line-number="'+a((s=(s=t.line||(e!=null?e.line:e))!=null?s:o,typeof s===u?s.call(e,{name:"line",hash:{},data:r}):s))+'" ',i=(t.notNull||e&&e.notNull||o).call(e,e!=null?e.utCoverageStatus:e,{name:"notNull",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+'>\n              <div class="source-line-bar"></div>\n            </td>\n'},14:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return"source-line-"+u((i=(i=t.utCoverageStatus||(e!=null?e.utCoverageStatus:e))!=null?i:o,typeof i===s?i.call(e,{name:"utCoverageStatus",hash:{},data:r}):i))},16:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'title="'+s((t.t||e&&e.t||i).call(e,"source_viewer.tooltip.ut",e!=null?e.utCoverageStatus:e,{name:"t",hash:{},data:r}))+'" data-placement="right" data-toggle="tooltip"'},18:function(e,t,n,r){var i,s,o=t.helperMissing,u="function",a=this.escapeExpression,f='            <td class="source-meta source-line-coverage ';return i=(t.notNull||e&&e.notNull||o).call(e,e!=null?e.itCoverageStatus:e,{name:"notNull",hash:{},fn:this.program(19,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+='"\n                data-tests="it"\n                data-line-number="'+a((s=(s=t.line||(e!=null?e.line:e))!=null?s:o,typeof s===u?s.call(e,{name:"line",hash:{},data:r}):s))+'" ',i=(t.notNull||e&&e.notNull||o).call(e,e!=null?e.itCoverageStatus:e,{name:"notNull",hash:{},fn:this.program(21,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+'>\n              <div class="source-line-bar"></div>\n            </td>\n'},19:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return"source-line-"+u((i=(i=t.itCoverageStatus||(e!=null?e.itCoverageStatus:e))!=null?i:o,typeof i===s?i.call(e,{name:"itCoverageStatus",hash:{},data:r}):i))},21:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'title="'+s((t.t||e&&e.t||i).call(e,"source_viewer.tooltip.it",e!=null?e.itCoverageStatus:e,{name:"t",hash:{},data:r}))+'" data-placement="right" data-toggle="tooltip"'},23:function(e,t,n,r,i){var s,o='            <td class="source-meta source-line-duplications ';return s=t["if"].call(e,e!=null?e.duplicated:e,{name:"if",hash:{},fn:this.program(24,r,i),inverse:this.noop,data:r}),s!=null&&(o+=s),o+='"\n              ',s=t["if"].call(e,e!=null?e.duplicated:e,{name:"if",hash:{},fn:this.program(26,r,i),inverse:this.noop,data:r}),s!=null&&(o+=s),o+='>\n              <div class="source-line-bar"></div>\n            </td>\n\n',s=t.each.call(e,e!=null?e.duplications:e,{name:"each",hash:{},fn:this.program(28,r,i),inverse:this.noop,data:r}),s!=null&&(o+=s),o},24:function(e,t,n,r){return"source-line-duplicated"},26:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'title="'+s((t.t||e&&e.t||i).call(e,"source_viewer.tooltip.duplicated_line",{name:"t",hash:{},data:r}))+'" data-placement="right" data-toggle="tooltip"'},28:function(e,t,n,r,i){var s,o=this.lambda,u=this.escapeExpression,a='              <td class="source-meta source-line-duplications-extra ';return s=t["if"].call(e,e,{name:"if",hash:{},fn:this.program(24,r,i),inverse:this.noop,data:r}),s!=null&&(a+=s),a+='"\n                  data-index="'+u(o(e,e))+'" data-line-number="'+u(o(i[1]!=null?i[1].line:i[1],e))+'"\n                ',s=t["if"].call(e,e,{name:"if",hash:{},fn:this.program(29,r,i),inverse:this.noop,data:r}),s!=null&&(a+=s),a+'>\n                <div class="source-line-bar"></div>\n              </td>\n'},29:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'title="'+s((t.t||e&&e.t||i).call(e,"source_viewer.tooltip.duplicated_block",{name:"t",hash:{},data:r}))+'" data-placement="right" data-toggle="tooltip"'},31:function(e,t,n,r){return"source-line-with-issues"},33:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return"              "+s((t.severityIcon||e&&e.severityIcon||i).call(e,e!=null?e.severity:e,{name:"severityIcon",hash:{},data:r}))+"\n"},35:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'              <span class="source-line-issues-counter">'+s((t.length||e&&e.length||i).call(e,e!=null?e.issues:e,{name:"length",hash:{},data:r}))+"</span>\n"},37:function(e,t,n,r){return"has-issues"},39:function(e,t,n,r){var i,s=t.helperMissing,o="                <pre>";return i=(t.codeWithIssueLocations||e&&e.codeWithIssueLocations||s).call(e,e!=null?e.code:e,e!=null?e.issueLocations:e,{name:"codeWithIssueLocations",hash:{},data:r}),i!=null&&(o+=i),o+"</pre>\n"},41:function(e,t,n,r){var i,s='              <div class="issue-list">\n';return i=t.each.call(e,e!=null?e.issues:e,{name:"each",hash:{},fn:this.program(42,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+"              </div>\n"},42:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'                  <div class="issue" id="issue-'+u((i=(i=t.key||(e!=null?e.key:e))!=null?i:o,typeof i===s?i.call(e,{name:"key",hash:{},data:r}):i))+'"></div>\n'},44:function(e,t,n,r){return'      <i class="spinner js-component-viewer-source-after"></i>\n'},46:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'\n    <div class="alert alert-warning spacer-top">'+s((t.t||e&&e.t||i).call(e,"component_viewer.no_component",{name:"t",hash:{},data:r}))+"</div>\n\n"},48:function(e,t,n,r){var i=t.helperMissing,s=this.escapeExpression;return'\n  <div class="alert alert-warning spacer-top">'+s((t.t||e&&e.t||i).call(e,"code_viewer.no_source_code_displayed_due_to_security",{name:"t",hash:{},data:r}))+"</div>\n\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r,i){var s,o='<div class="source-viewer-header"></div>\n\n';return s=t["if"].call(e,e!=null?e.canSeeCode:e,{name:"if",hash:{},fn:this.program(1,r,i),inverse:this.program(48,r,i),data:r}),s!=null&&(o+=s),o},useData:!0,useDepths:!0}),define("components/source-viewer/templates",function(){}),define("components/source-viewer/more-actions",["exports","module","jquery","underscore","backbone.marionette","components/workspace/main","./templates"],function(e,t,n,r,i,s,o){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}var a=u(n),f=u(r),l=u(i),c=u(s);t.exports=l["default"].ItemView.extend({className:"source-viewer-header-more-actions",template:Templates["source-viewer-more-actions"],events:{"click .js-measures":"showMeasures","click .js-new-window":"openNewWindow","click .js-workspace":"openInWorkspace","click .js-raw-source":"showRawSource"},onRender:function(){var t=this;(0,a["default"])("body").on("click.component-viewer-more-actions",function(){(0,a["default"])("body").off("click.component-viewer-more-actions"),t.destroy()})},showMeasures:function(){this.options.parent.showMeasures()},openNewWindow:function(){this.options.parent.getPermalink()},openInWorkspace:function(){var t=this.options.parent.model.id,n=c["default"].openComponent?c["default"]:require("components/workspace/main");n.openComponent({uuid:t})},showRawSource:function(){this.options.parent.showRawSources()},serializeData:function(){var t=this.options.parent.options.viewer.options;return f["default"].extend(l["default"].ItemView.prototype.serializeData.apply(this,arguments),{options:t})}})}),define("components/common/modals",["exports","module","jquery","backbone.marionette"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r),u="modal";t.exports=o["default"].ItemView.extend({className:"modal",overlayClassName:"modal-overlay",htmlClassName:"modal-open",events:function(){return{"click .js-modal-close":"onCloseClick"}},onRender:function(){var t=this;this.$el.detach().appendTo((0,s["default"])("body")),(0,s["default"])("html").addClass(this.htmlClassName),this.renderOverlay(),this.keyScope=key.getScope(),key.setScope("modal"),key("escape","modal",function(){return t.destroy(),!1}),this.show(),!this.options.large||this.$el.addClass("modal-large")},show:function(){var t=this;setTimeout(function(){t.$el.addClass("in"),(0,s["default"])("."+t.overlayClassName).addClass("in")},0)},onDestroy:function(){(0,s["default"])("html").removeClass(this.htmlClassName),this.removeOverlay(),key.deleteScope("modal"),key.setScope(this.keyScope)},onCloseClick:function(t){t.preventDefault(),this.destroy()},renderOverlay:function(){var t=(0,s["default"])("."+this.overlayClassName);t.length===0&&(0,s["default"])('<div class="'+this.overlayClassName+'"></div>').appendTo((0,s["default"])("body"))},removeOverlay:function(){(0,s["default"])("."+this.overlayClassName).remove()},attachCloseEvents:function(){var t=this;(0,s["default"])("body").on("click."+u,function(){(0,s["default"])("body").off("click."+u),t.destroy()})}})}),define("components/source-viewer/measures-overlay",["exports","module","jquery","underscore","components/common/modals","./templates"],function(e,t,n,r,i,s){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}var u=o(n),a=o(r),f=o(i);t.exports=f["default"].extend({template:Templates["source-viewer-measures"],testsOrder:["ERROR","FAILURE","OK","SKIPPED"],initialize:function(){var t=this,n=[this.requestMeasures(),this.requestIssues()];this.model.get("isUnitTest")&&n.push(this.requestTests()),this.testsScroll=0,u["default"].when.apply(u["default"],n).done(function(){t.render()})},events:function(){return a["default"].extend(f["default"].prototype.events.apply(this,arguments),{"click .js-sort-tests-by-duration":"sortTestsByDuration","click .js-sort-tests-by-name":"sortTestsByName","click .js-sort-tests-by-status":"sortTestsByStatus","click .js-show-test":"showTest","click .js-show-all-measures":"showAllMeasures"})},onRender:function(){f["default"].prototype.onRender.apply(this,arguments),this.$(".js-pie-chart").pieChart(),this.$(".js-test-list").scrollTop(this.testsScroll)},getMetrics:function(){var t="",n=baseUrl+"/api/metrics/search";return u["default"].ajax({url:n,async:!1,data:{ps:9999}}).done(function(e){t=a["default"].filter(e.metrics,function(e){return e.type!=="DATA"&&!e.hidden}),t=a["default"].sortBy(t,"name")}),t},calcAdditionalMeasures:function(t){return t.lines_to_cover&&t.uncovered_lines&&(t.covered_lines=t.lines_to_cover-t.uncovered_lines),t.conditions_to_cover&&t.uncovered_conditions&&(t.covered_conditions=t.conditions_to_cover-t.uncovered_conditions),t.it_lines_to_cover&&t.it_uncovered_lines&&(t.it_covered_lines=t.it_lines_to_cover-t.it_uncovered_lines),t.it_conditions_to_cover&&t.it_uncovered_conditions&&(t.it_covered_conditions=t.it_conditions_to_cover-t.it_uncovered_conditions),t},prepareMetrics:function(t){return t=a["default"].filter(t,function(e){return e.value!=null}),a["default"].sortBy(a["default"].map(a["default"].pairs(a["default"].groupBy(t,"domain")),function(e){return{name:e[0],metrics:e[1]}}),"name")},requestMeasures:function(){var t=this,n=baseUrl+"/api/resources",r=this.getMetrics(),i={resource:this.model.key(),metrics:a["default"].pluck(r,"key").join()};return u["default"].get(n,i).done(function(e){var n=e[0].msr||[],i=t.model.get("measures")||{};n.forEach(function(e){var t=a["default"].findWhere(r,{key:e.key});t.value=e.frmt_val||e.data,i[e.key]=e.frmt_val||e.data,i[e.key+"_raw"]=e.val}),i=t.calcAdditionalMeasures(i),t.model.set({measures:i,measuresToDisplay:t.prepareMetrics(r)})})},requestIssues:function(){var t=this,n=baseUrl+"/api/issues/search",r={componentUuids:this.model.id,resolved:!1,ps:1,facets:"severities,tags"};return u["default"].get(n,r).done(function(e){var n={};e.facets.forEach(function(e){n[e.property]=e.values});var r=["BLOCKER","CRITICAL","MAJOR","MINOR","INFO"],i=a["default"].max(n.severities,function(e){return e.count}).count,s=a["default"].max(n.tags,function(e){return e.count}).count;n.severities=a["default"].sortBy(n.severities,function(e){return r.indexOf(e.val)}),t.model.set({issuesFacets:n,issuesCount:e.total,maxCountBySeverity:i,maxCountByTag:s})})},requestTests:function(){var t=this,n=baseUrl+"/api/tests/list",r={testFileId:this.model.id};return u["default"].get(n,r).done(function(e){t.model.set({tests:e.tests}),t.testSorting="status",t.testAsc=!0,t.sortTests(function(e){return""+t.testsOrder.indexOf(e.status)+"_______"+e.name})})},sortTests:function(t){var n=this.model.get("tests");a["default"].isArray(n)&&(n=a["default"].sortBy(n,t),this.testAsc||n.reverse(),this.model.set({tests:n}))},sortTestsByDuration:function(){this.testSorting==="duration"&&(this.testAsc=!this.testAsc),this.sortTests("durationInMs"),this.testSorting="duration",this.render()},sortTestsByName:function(){this.testSorting==="name"&&(this.testAsc=!this.testAsc),this.sortTests("name"),this.testSorting="name",this.render()},sortTestsByStatus:function(){var t=this;this.testSorting==="status"&&(this.testAsc=!this.testAsc),this.sortTests(function(e){return""+t.testsOrder.indexOf(e.status)+"_______"+e.name}),this.testSorting="status",this.render()},showTest:function(t){var n=this,r=(0,u["default"])(t.currentTarget).data("id"),i=baseUrl+"/api/tests/covered_files",s={testId:r};return this.testsScroll=(0,u["default"])(t.currentTarget).scrollParent().scrollTop(),u["default"].get(i,s).done(function(e){n.coveredFiles=e.files,n.selectedTest=a["default"].findWhere(n.model.get("tests"),{id:r}),n.render()})},showAllMeasures:function(){this.$(".js-all-measures").removeClass("hidden"),this.$(".js-show-all-measures").remove()},serializeData:function(){return a["default"].extend(f["default"].prototype.serializeData.apply(this,arguments),{testSorting:this.testSorting,selectedTest:this.selectedTest,coveredFiles:this.coveredFiles||[]})}})}),define("components/source-viewer/header",["exports","module","jquery","underscore","backbone.marionette","./more-actions","./measures-overlay","./templates"],function(e,t,n,r,i,s,o,u){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}var f=a(n),l=a(r),c=a(i),h=a(s),p=a(o),d=baseUrl+"/api/favourites";t.exports=c["default"].ItemView.extend({template:Templates["source-viewer-header"],events:function(){return{"click .js-favorite":"toggleFavorite","click .js-actions":"showMoreActions","click .js-permalink":"getPermalink"}},toggleFavorite:function(){var t=this;this.model.get("fav")?f["default"].ajax({url:d+"/"+this.model.get("key"),type:"DELETE"}).done(function(){t.model.set("fav",!1),t.render()}):f["default"].ajax({url:d,type:"POST",data:{key:this.model.get("key")}}).done(function(){t.model.set("fav",!0),t.render()})},showMoreActions:function(t){t.stopPropagation(),(0,f["default"])("body").click();var n=new h["default"]({parent:this});n.render().$el.appendTo(this.$el)},getPermalink:function(){var t="id="+encodeURIComponent(this.model.get("key")),n="resizable=1,scrollbars=1,status=1";this.options.viewer.highlightedLine&&(t=t+"&line="+this.options.viewer.highlightedLine),window.open(baseUrl+"/component/index?"+t,this.model.get("name"),n)},showRawSources:function(){var t=baseUrl+"/api/sources/raw?key="+encodeURIComponent(this.model.get("key")),n="resizable=1,scrollbars=1,status=1";window.open(t,this.model.get("name"),n)},showMeasures:function(){(new p["default"]({model:this.model,large:!0})).render()},serializeData:function(){return l["default"].extend(c["default"].ItemView.prototype.serializeData.apply(this,arguments),{path:this.model.get("path")||this.model.get("longName")})}})}),define("components/source-viewer/popups/scm-popup",["exports","module","components/common/popup","../templates"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n);t.exports=s["default"].extend({template:Templates["source-viewer-scm-popup"],events:{click:"onClick"},onRender:function(){s["default"].prototype.onRender.apply(this,arguments),this.$(".bubble-popup-container").isolatedScroll()},onClick:function(t){t.stopPropagation()}})}),define("components/source-viewer/popups/coverage-popup",["exports","module","jquery","underscore","components/common/popup","components/workspace/main","../templates"],function(e,t,n,r,i,s,o){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}var a=u(n),f=u(r),l=u(i),c=u(s);t.exports=l["default"].extend({template:Templates["source-viewer-coverage-popup"],events:{"click a[data-id]":"goToFile"},onRender:function(){l["default"].prototype.onRender.apply(this,arguments),this.$(".bubble-popup-container").isolatedScroll()},goToFile:function(t){t.stopPropagation();var n=(0,a["default"])(t.currentTarget).data("id"),r=c["default"].openComponent?c["default"]:require("components/workspace/main");r.openComponent({uuid:n})},serializeData:function(){var t=this.options.row||{},n=f["default"].groupBy(this.collection.toJSON(),"fileId"),r=f["default"].map(n,function(e){var t=e[0];return{file:{id:t.fileId,longName:t.fileLongName},tests:e}});return f["default"].extend(t,{lineHits:t[this.options.tests+"LineHits"],conditions:t[this.options.tests+"Conditions"],coveredConditions:t[this.options.tests+"CoveredConditions"]}),{testFiles:r,tests:this.options.tests,row:t}}})}),define("components/source-viewer/popups/duplication-popup",["exports","module","jquery","underscore","components/common/popup","components/workspace/main","../templates"],function(e,t,n,r,i,s,o){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}var a=u(n),f=u(r),l=u(i),c=u(s);t.exports=l["default"].extend({template:Templates["source-viewer-duplication-popup"],events:{"click a[data-uuid]":"goToFile"},goToFile:function(t){t.stopPropagation();var n=(0,a["default"])(t.currentTarget).data("uuid"),r=(0,a["default"])(t.currentTarget).data("line"),i=c["default"].openComponent?c["default"]:require("components/workspace/main");i.openComponent({uuid:n,line:r})},serializeData:function(){var t=this,n=this.model.get("duplicationFiles"),r=f["default"].groupBy(this.collection.toJSON(),"_ref"),i=f["default"].map(r,function(e,t){return{blocks:e,file:n[t]}});return i=f["default"].sortBy(i,function(e){var n=e.file.projectName!==t.model.get("projectName"),r=e.file.subProjectName!==t.model.get("subProjectName"),i=e.file.key!==t.model.get("key");return""+n+r+i}),{component:this.model.toJSON(),duplications:i,inRemovedComponent:this.options.inRemovedComponent}}})}),define("components/issue/manual-issue-view",["exports","module","jquery","underscore","backbone.marionette","./models/issue","./templates"],function(e,t,n,r,i,s,o){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}var a=u(n),f=u(r),l=u(i),c=u(s);t.exports=l["default"].ItemView.extend({template:Templates["manual-issue"],events:{"submit .js-manual-issue-form":"formSubmit","click .js-cancel":"cancel"},initialize:function(){var t=this;this.rules=[],a["default"].get(baseUrl+"/api/rules/search?repositories=manual&f=name&ps=9999999").done(function(e){t.rules=e.rules,t.render()})},onRender:function(){this.delegateEvents(),this.$("[name=rule]").select2({width:"250px",minimumResultsForSearch:10}),this.rules.length>0&&this.$("[name=rule]").select2("open"),key!=null&&(this.key=key.getScope(),key.setScope(""))},onDestroy:function(){key!=null&&this.key!=null&&key.setScope(this.key)},formSubmit:function(t){var n=this;t.preventDefault();var r=new c["default"]({component:this.options.component,line:this.options.line,message:this.$('[name="message"]').val(),rule:this.$('[name="rule"]').val()});r.save().done(function(){n.addIssue(r)})},addIssue:function(t){var n=this;return t.fetch().done(function(){n.trigger("add",t),n.destroy()})},cancel:function(t){t.preventDefault(),this.destroy()},serializeData:function(){return f["default"].extend(this._super(),{rules:f["default"].sortBy(this.rules,"name")})}})}),define("components/source-viewer/popups/line-actions-popup",["exports","module","components/common/popup","components/issue/manual-issue-view","../templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=o["default"].extend({template:Templates["source-viewer-line-options-popup"],events:{"click .js-get-permalink":"getPermalink","click .js-add-manual-issue":"addManualIssue"},getPermalink:function(t){t.preventDefault();var n=baseUrl+"/component/index?id="+encodeURIComponent(this.model.key())+"&line="+this.options.line,r="resizable=1,scrollbars=1,status=1";window.open(n,this.model.get("name"),r)},addManualIssue:function(t){t.preventDefault();var n=this,r=this.options.line,i=this.model.key(),s=new u["default"]({line:r,component:i});s.render().$el.appendTo(this.options.row.find(".source-line-code")),s.on("add",function(e){n.trigger("onManualIssueAdded",e)})}})}),define("components/source-viewer/helpers/code-with-issue-locations-helper",["exports","module","underscore"],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t,n,r){return{from:Math.max(e,n),to:Math.min(t,r)}}function o(e,t,n,r){return t>=r?e.substr(t-r,n-t):e.substr(0,n-t)}function u(e){var t=document.createElement("div"),n=[];return t.innerHTML=e,[].forEach.call(t.childNodes,function(e){e.nodeType===1&&n.push({className:e.className,text:e.textContent}),e.nodeType===3&&n.push({className:"",text:e.nodeValue})}),n}function a(e,t,n){return t.forEach(function(t){var r=[],i=0;e.forEach(function(e){var u=s(i,i+e.text.length,t.from,t.to),a=o(e.text,i,u.from,i),f=o(e.text,u.from,u.to,i),l=o(e.text,u.to,i+e.text.length,i);a.length&&r.push({className:e.className,text:a});if(f.length){var c=e.className.indexOf(n)===-1?[e.className,n].join(" "):e.className;r.push({className:c,text:f})}l.length&&r.push({className:e.className,text:l}),i+=e.text.length}),e=r.slice()}),e}function f(e){return e.map(function(e){return'<span class="'+e.className+'">'+i["default"].escape(e.text)+"</span>"}).join("")}function l(e,t,n){var r=e||"&nbsp;",i=t||[],s=n?n:"source-line-code-issue";return f(a(u(r),i,s))}var i=r(n);typeof Handlebars!="undefined"&&Handlebars.registerHelper("codeWithIssueLocations",function(e,t){return l(e,t)}),t.exports=l}),define("components/source-viewer/main",["exports","module","jquery","underscore","backbone","backbone.marionette","./source","components/issue/collections/issues","components/issue/issue-view","./header","./popups/scm-popup","./popups/coverage-popup","./popups/duplication-popup","./popups/line-actions-popup","./helpers/code-with-issue-locations-helper","./templates"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v){"use strict";function m(e){return e&&e.__esModule?e:{"default":e}}var g=m(n),y=m(r),b=m(i),w=m(s),E=m(o),S=m(u),x=m(a),T=m(f),N=m(l),C=m(c),k=m(h),L=m(p),A=m(d),O="source-line-highlighted";t.exports=w["default"].LayoutView.extend({className:"source-viewer",template:Templates["source-viewer"],issueLocationTemplate:Templates["source-viewer-issue-location"],ISSUES_LIMIT:3e3,LINES_LIMIT:1e3,TOTAL_LINES_LIMIT:3e3,LINES_AROUND:500,regions:{headerRegion:".source-viewer-header"},ui:{sourceBeforeSpinner:".js-component-viewer-source-before",sourceAfterSpinner:".js-component-viewer-source-after"},events:function(){return{"click .sym":"highlightUsages","click .source-line-scm":"showSCMPopup","click .source-line-covered":"showCoveragePopup","click .source-line-partially-covered":"showCoveragePopup","click .source-line-uncovered":"showCoveragePopup","click .source-line-duplications":"showDuplications","click .source-line-duplications-extra":"showDuplicationPopup","click .source-line-with-issues":"onLineIssuesClick","click .source-line-number[data-line-number]":"onLineNumberClick","mouseenter .source-line-filtered .source-line-filtered-container":"showFilteredTooltip","mouseleave .source-line-filtered .source-line-filtered-container":"hideFilteredTooltip"}},initialize:function(){this.model==null&&(this.model=new E["default"]),this.issues=new S["default"],this.listenTo(this.issues,"change:severity",this.onIssuesSeverityChange),this.listenTo(this.issues,"locations",this.toggleIssueLocations),this.issueViews=[],this.loadSourceBeforeThrottled=y["default"].throttle(this.loadSourceBefore,1e3),this.loadSourceAfterThrottled=y["default"].throttle(this.loadSourceAfter,1e3),this.highlightedLine=null,this.listenTo(this,"loaded",this.onLoaded)},renderHeader:function(){this.headerRegion.show(new T["default"]({viewer:this,model:this.model}))},onRender:function(){this.renderHeader(),this.renderIssues(),this.model.has("filterLinesFunc")&&this.filterLines(this.model.get("filterLinesFunc")),this.$('[data-toggle="tooltip"]').tooltip({container:"body"})},onDestroy:function(){this.issueViews.forEach(function(e){return e.destroy()}),this.issueViews=[],this.clearTooltips()},clearTooltips:function(){this.$('[data-toggle="tooltip"]').tooltip("destroy")},onLoaded:function(){this.bindScrollEvents()},open:function(t,n){var r=this,i=typeof n=="object"?n:{},s=function(){r.requestIssues().done(function(){r.render(),r.trigger("loaded")})};return y["default"].extend(this.options,y["default"].defaults(i,{workspace:!1})),this.model.clear().set(y["default"].result(this.model,"defaults")).set({uuid:t}),this.requestComponent().done(function(){r.requestSource().done(s).fail(function(){r.model.set({source:[{line:0}]}),s()})}),this},requestComponent:function(){var t=this,n=baseUrl+"/api/components/app",r={uuid:this.model.id};return g["default"].ajax({type:"GET",url:n,data:r,statusCode:{404:function(){t.model.set({exist:!1}),t.render(),t.trigger("loaded")}}}).done(function(e){t.model.set(e),t.model.set({isUnitTest:e.q==="UTS"})})},linesLimit:function(){return{from:1,to:this.LINES_LIMIT}},getUTCoverageStatus:function(t){var n=null;t.utLineHits>0&&(n="partially-covered"),t.utLineHits>0&&t.utConditions===t.utCoveredConditions&&(n="covered");if(t.utLineHits===0||t.utCoveredConditions===0)n="uncovered";return n},getItCoverageStatus:function(t){var n=null;t.itLineHits>0&&(n="partially-covered"),t.itLineHits>0&&t.itConditions===t.itCoveredConditions&&(n="covered");if(t.itLineHits===0||t.itCoveredConditions===0)n="uncovered";return n},requestSource:function(){var t=this,n=baseUrl+"/api/sources/lines",r=y["default"].extend({uuid:this.model.id},this.linesLimit());return g["default"].get(n,r).done(function(e){var n=(e.sources||[]).slice(0);(n.length===0||n.length>0&&y["default"].first(n).line===1)&&n.unshift({line:0}),n=n.map(function(e){return y["default"].extend(e,{utCoverageStatus:t.getUTCoverageStatus(e),itCoverageStatus:t.getItCoverageStatus(e)})});var i=y["default"].first(n).line,s=r.to-r.from+1;t.model.set({source:n,hasUTCoverage:t.model.hasUTCoverage(n),hasITCoverage:t.model.hasITCoverage(n),hasSourceBefore:i>1,hasSourceAfter:e.sources.length===s}),t.model.checkIfHasDuplications()}).fail(function(e){e.status===403&&t.model.set({source:[],hasSourceBefore:!1,hasSourceAfter:!1,canSeeCode:!1})})},requestDuplications:function(){var t=this,n=baseUrl+"/api/duplications/show",r={uuid:this.model.id};return g["default"].get(n,r,function(e){var n=e!=null&&e.duplications!=null,r=[];n&&(r={},e.duplications.forEach(function(e){e.blocks.forEach(function(e){if(e._ref==="1"){var t=e.from,n=e.from+e.size-1;for(var i=t;i<=n;i++)r[i]=!0}})}),r=y["default"].pairs(r).map(function(e){return{line:+e[0],duplicated:e[1]}})),t.model.addMeta(r),t.model.addDuplications(e.duplications),t.model.set({duplications:e.duplications,duplicationsParsed:r,duplicationFiles:e.files})})},requestIssues:function(){var t=this,n={data:{componentUuids:this.model.id,f:"component,componentId,project,subProject,rule,status,resolution,author,reporter,assignee,debt,line,message,severity,actionPlan,creationDate,updateDate,closeDate,tags,comments,attr,actions,transitions,actionPlanName",additionalFields:"_all",resolved:!1,s:"FILE_LINE",asc:!0,ps:this.ISSUES_LIMIT}};return this.issues.fetch(n).done(function(){t.addIssuesPerLineMeta(t.issues)})},_sortBySeverity:function(t){var n=["BLOCKER","CRITICAL","MAJOR","MINOR","INFO"];return y["default"].sortBy(t,function(e){return n.indexOf(e.severity)})},addIssuesPerLineMeta:function(t){var n=this,r={};t.forEach(function(e){var t=e.get("line")||0;y["default"].isArray(r[t])||(r[t]=[]),r[t].push(e.toJSON())});var i=y["default"].pairs(r).map(function(e){return{line:+e[0],issues:n._sortBySeverity(e[1])}});this.model.addMeta(i),this.addIssueLocationsMeta(t)},addIssueLocationsMeta:function(t){var n=[];t.forEach(function(e){e.getLinearLocations().forEach(function(e){var t=y["default"].findWhere(n,{line:e.line});t?t.issueLocations.push({from:e.from,to:e.to}):n.push({line:e.line,issueLocations:[{from:e.from,to:e.to}]})})}),this.model.addMeta(n)},renderIssues:function(){this.$(".issue-list").addClass("hidden")},renderIssue:function(t){var n=new x["default"]({el:"#issue-"+t.get("key"),model:t});this.issueViews.push(n),n.render()},addIssue:function(t){var n=t.get("line")||0,r=this.$(".source-line-code[data-line-number="+n+"]"),i='<div class="issue" id="issue-'+t.get("key")+'" data-key="'+t.get("key")+'">';r.addClass("has-issues");var s=r.find(".issue-list");s.length===0&&(r.append('<div class="issue-list"></div>'),s=r.find(".issue-list")),s.append(i).removeClass("hidden"),this.renderIssue(t)},showIssuesForLine:function(t){this.$('.source-line-code[data-line-number="'+t+'"]').find(".issue-list").removeClass("hidden");var n=this.issues.filter(function(e){return e.get("line")===t||!e.get("line")&&!t});n.forEach(this.renderIssue,this)},onIssuesSeverityChange:function(){var t=this;this.addIssuesPerLineMeta(this.issues),this.$(".source-line-with-issues").each(function(){var e=+(0,g["default"])(this).data("line-number"),n=y["default"].findWhere(t.model.get("source"),{line:e}),r=y["default"].first(n.issues);(0,g["default"])(this).html('<i class="icon-severity-'+r.severity.toLowerCase()+'"></i>')})},highlightUsages:function(t){var n=(0,g["default"])(t.currentTarget).is(".highlighted"),r=t.currentTarget.className.split(/\s+/)[0];this.$(".sym.highlighted").removeClass("highlighted"),n||this.$(".sym."+r).addClass("highlighted")},showSCMPopup:function(t){t.stopPropagation(),(0,g["default"])("body").click();var n=+(0,g["default"])(t.currentTarget).data("line-number"),r=y["default"].findWhere(this.model.get("source"),{line:n}),i=new N["default"]({triggerEl:(0,g["default"])(t.currentTarget),model:new b["default"].Model(r)});i.render()},showCoveragePopup:function(t){t.stopPropagation(),(0,g["default"])("body").click(),this.clearTooltips();var n=(0,g["default"])(t.currentTarget).data("line-number"),r=y["default"].findWhere(this.model.get("source"),{line:n}),i=baseUrl+"/api/tests/list",s={sourceFileId:this.model.id,sourceFileLineNumber:n,ps:1e3};return g["default"].get(i,s).done(function(e){var n=new C["default"]({collection:new b["default"].Collection(e.tests),row:r,tests:(0,g["default"])(t.currentTarget).data("tests"),triggerEl:(0,g["default"])(t.currentTarget)});n.render()})},showDuplications:function(t){var n=this,r=(0,g["default"])(t.currentTarget).closest(".source-line").data("line-number");this.clearTooltips(),this.requestDuplications().done(function(){n.render(),n.$el.addClass("source-duplications-expanded");if(n.model.get("duplications").length===1){var e=n.$(".source-line[data-line-number="+r+"]").find(".source-line-duplications-extra");e.click()}})},showDuplicationPopup:function(t){t.stopPropagation(),(0,g["default"])("body").click(),this.clearTooltips();var n=(0,g["default"])(t.currentTarget).data("index"),r=(0,g["default"])(t.currentTarget).data("line-number"),i=this.model.get("duplications")[n-1].blocks,s=y["default"].some(i,function(e){return e._ref==null}),o=!1;i=y["default"].filter(i,function(e){var t=e.from>r||e.from+e.size<r,n=e._ref==="1",i=t||o,s=!n||n&&i,u=e._ref!=null&&s;return e._ref==="1"&&!t&&(o=!0),u});var u=new k["default"]({triggerEl:(0,g["default"])(t.currentTarget),model:this.model,inRemovedComponent:s,collection:new b["default"].Collection(i)});u.render()},onLineIssuesClick:function(t){var n=(0,g["default"])(t.currentTarget).data("line-number"),r=(0,g["default"])(t.currentTarget).parent().find(".issue-list"),i=r.find(".issue-inner").length>0;r.is(".hidden")?i?r.removeClass("hidden"):this.showIssuesForLine(n):r.addClass("hidden")},showLineActionsPopup:function(t){t.stopPropagation(),(0,g["default"])("body").click();var n=this,r=(0,g["default"])(t.currentTarget).data("line-number"),i=new L["default"]({triggerEl:(0,g["default"])(t.currentTarget),model:this.model,line:r,row:(0,g["default"])(t.currentTarget).closest(".source-line")});i.on("onManualIssueAdded",function(e){n.addIssue(e)}),i.render()},onLineNumberClick:function(t){var n=(0,g["default"])(t.currentTarget).closest(".source-line"),r=n.data("line-number"),i=n.is("."+O);i?this.removeHighlighting():(this.highlightLine(r),this.showLineActionsPopup(t))},removeHighlighting:function(){this.highlightedLine=null,this.$("."+O).removeClass(O)},highlightLine:function(t){var n=this.$(".source-line[data-line-number="+t+"]");return this.removeHighlighting(),this.highlightedLine=t,n.addClass(O),this},bindScrollEvents:function(){var t=this;this.$el.scrollParent().on("scroll.source-viewer",function(){t.onScroll()})},unbindScrollEvents:function(){this.$el.scrollParent().off("scroll.source-viewer")},onScroll:function(){var t=this.$el.scrollParent();t.is(document)&&(t=(0,g["default"])(window));var n=t.offset()!=null?t.offset().top:0,r=t.scrollTop()+n;this.model.get("hasSourceBefore")&&r<=this.ui.sourceBeforeSpinner.offset().top&&this.loadSourceBeforeThrottled();if(this.model.get("hasSourceAfter")&&r+t.height()>=this.ui.sourceAfterSpinner.offset().top)return this.loadSourceAfterThrottled()},scrollToLine:function(t){var n=this.$(".source-line[data-line-number="+t+"]");if(n.length>0){var r=this.$el.scrollParent();r.is(document)&&(r=(0,g["default"])(window));var i=r.offset()!=null?r.offset().top:0,s=r.height(),o=n.offset().top-s/3-i;r.scrollTop(o)}return this},scrollToFirstLine:function(t){var n=this.$(".source-line[data-line-number="+t+"]");if(n.length>0){var r=this.$el.scrollParent();r.is(document)&&(r=(0,g["default"])(window));var i=r.offset()!=null?r.offset().top:0,s=n.offset().top-i;r.scrollTop(s)}return this},scrollToLastLine:function(t){var n=this.$(".source-line[data-line-number="+t+"]");if(n.length>0){var r=this.$el.scrollParent();r.is(document)&&(r=(0,g["default"])(window));var i=r.offset()!=null?r.offset().top:0,s=r.height(),o=n.offset().top-i-s+n.height();r.scrollTop(o)}return this},loadSourceBefore:function(){this.unbindScrollEvents();var t=this,n=this.model.get("source"),r=y["default"].first(n).line,i=baseUrl+"/api/sources/lines",s={uuid:this.model.id,from:r-this.LINES_AROUND,to:r-1};return g["default"].get(i,s).done(function(e){n=(e.sources||[]).concat(n),n.length>t.TOTAL_LINES_LIMIT+1&&(n=n.slice(0,t.TOTAL_LINES_LIMIT),t.model.set({hasSourceAfter:!0})),(n.length===0||n.length>0&&y["default"].first(n).line===1)&&n.unshift({line:0}),n=n.map(function(e){return y["default"].extend(e,{utCoverageStatus:t.getUTCoverageStatus(e),itCoverageStatus:t.getItCoverageStatus(e)})}),t.model.set({source:n,hasUTCoverage:t.model.hasUTCoverage(n),hasITCoverage:t.model.hasITCoverage(n),hasSourceBefore:e.sources.length===t.LINES_AROUND&&y["default"].first(n).line>0}),t.addIssuesPerLineMeta(t.issues),t.model.has("duplications")&&(t.model.addDuplications(t.model.get("duplications")),t.model.addMeta(t.model.get("duplicationsParsed"))),t.model.checkIfHasDuplications(),t.render(),t.scrollToFirstLine(r),(t.model.get("hasSourceBefore")||t.model.get("hasSourceAfter"))&&t.bindScrollEvents()})},loadSourceAfter:function(){this.unbindScrollEvents();var t=this,n=this.model.get("source"),r=y["default"].last(n).line,i=baseUrl+"/api/sources/lines",s={uuid:this.model.id,from:r+1,to:r+this.LINES_AROUND};return g["default"].get(i,s).done(function(e){n=n.concat(e.sources),n.length>t.TOTAL_LINES_LIMIT+1&&(n=n.slice(n.length-t.TOTAL_LINES_LIMIT),t.model.set({hasSourceBefore:!0})),n=n.map(function(e){return y["default"].extend(e,{utCoverageStatus:t.getUTCoverageStatus(e),itCoverageStatus:t.getItCoverageStatus(e)})}),t.model.set({source:n,hasUTCoverage:t.model.hasUTCoverage(n),hasITCoverage:t.model.hasITCoverage(n),hasSourceAfter:e.sources.length===t.LINES_AROUND}),t.addIssuesPerLineMeta(t.issues),t.model.has("duplications")&&(t.model.addDuplications(t.model.get("duplications")),t.model.addMeta(t.model.get("duplicationsParsed"))),t.model.checkIfHasDuplications(),t.render(),t.scrollToLastLine(r),(t.model.get("hasSourceBefore")||t.model.get("hasSourceAfter"))&&t.bindScrollEvents()}).fail(function(){t.model.set({hasSourceAfter:!1}),t.render(),(t.model.get("hasSourceBefore")||t.model.get("hasSourceAfter"))&&t.bindScrollEvents()})},filterLines:function(t){var n=this.model.get("source"),r=this.$(".source-line");this.model.set("filterLinesFunc",t),n.forEach(function(e,n){var i=(0,g["default"])(r[n]),s=t(e)&&e.line>0;i.toggleClass("source-line-shadowed",!s),i.toggleClass("source-line-filtered",s)})},filterLinesByDate:function(t,n){var r=moment(t).toDate();this.sinceLabel=n,this.filterLines(function(e){var t=moment(e.scmDate).toDate();return t>=r})},showFilteredTooltip:function(t){(0,g["default"])(t.currentTarget).tooltip({container:"body",placement:"right",title:tp("source_viewer.tooltip.new_code",this.sinceLabel),trigger:"manual"}).tooltip("show")},hideFilteredTooltip:function(t){(0,g["default"])(t.currentTarget).tooltip("destroy")},toggleIssueLocations:function(t){this.locationsShowFor===t?this.hideIssueLocations():(this.hideIssueLocations(),this.showIssueLocations(t))},showIssueLocations:function(t){this.locationsShowFor=t;var n={msg:t.get("message"),textRange:t.get("textRange")},r=[n];t.get("flows").forEach(function(e){var t=y["default"].size(e.locations),n=e.locations.map(function(e,n){var r=y["default"].extend({},e);return t>1&&y["default"].extend(r,{index:t-n}),r});r=[].concat(r,n)}),r.forEach(this.showIssueLocation,this)},showIssueLocation:function(t,n){if(t&&t.textRange){var r=t.textRange.startLine,i=this.$('.source-line-code[data-line-number="'+r+'"]');if(n>0&&y["default"].size(t.msg)){var s=this.renderIssueLocation(t);i.find(".source-line-issue-locations").prepend(s)}this.highlightIssueLocationInCode(t)}},renderIssueLocation:function(t){return t.msg=t.msg?t.msg:" ",this.issueLocationTemplate(t)},highlightIssueLocationInCode:function(t){for(var n=t.textRange.startLine;n<=t.textRange.endLine;n++){var r=this.$('.source-line-code[data-line-number="'+n+'"]'),i=n===t.textRange.startLine?t.textRange.startOffset:0,s=n===t.textRange.endLine?t.textRange.endOffset:999999,o={from:i,to:s},u=r.find(".source-line-code-inner > pre"),a=u.html(),f=(0,A["default"])(a,[o],"source-line-code-secondary-issue");u.html(f)}},hideIssueLocations:function(){this.locationsShowFor=null,this.$(".source-line-issue-locations").empty(),this.$(".source-line-code-secondary-issue").removeClass("source-line-code-secondary-issue")}})}),define("apps/source-viewer/app",["exports","module","backbone.marionette","components/source-viewer/main"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r),u=new s["default"].Application,a=function(t){this.addRegions({mainRegion:t.el});var n=new o["default"];this.mainRegion.show(n),n.open(t.file.uuid),typeof t.file.line=="number"&&n.on("loaded",function(){n.highlightLine(t.file.line).scrollToLine(t.file.line)})};u.on("start",function(e){window.requestMessages().done(function(){a.call(u,e)})}),t.exports=u});