diff --git a/client/galaxy/scripts/components/RuleCollectionBuilder.vue b/client/galaxy/scripts/components/RuleCollectionBuilder.vue index 11169a8fb68..9890d763c1b 100644 --- a/client/galaxy/scripts/components/RuleCollectionBuilder.vue +++ b/client/galaxy/scripts/components/RuleCollectionBuilder.vue @@ -1725,7 +1725,7 @@ export default { if (mappingAsDict.file_type) { const fileTypeColumn = mappingAsDict.file_type.columns[0]; const fileType = data[dataIndex][fileTypeColumn]; - res["ext"] = file_type; + res["ext"] = fileType; } else if (this.extension) { res["ext"] = this.extension; } diff --git a/client/galaxy/scripts/mvc/history/hdca-li-edit.js b/client/galaxy/scripts/mvc/history/hdca-li-edit.js index 3529063051a..a95f0554dd4 100644 --- a/client/galaxy/scripts/mvc/history/hdca-li-edit.js +++ b/client/galaxy/scripts/mvc/history/hdca-li-edit.js @@ -41,7 +41,7 @@ var HDCAListItemEdit = _super.extend(
<%= dataset.peek %>',"<% } %>","<% } %>","
"+t.message+"",buttons:{Close:function(){Galaxy.modal.hide()}}})})),a.append(e("").text(" ")),a.append(e("").text("Try again").click(function(){i.init(!0)})))}}),this.update_icons(),n}},predraw_init:function(){var t=this;return e.getJSON(t.dataset.url(),{data_type:"data",stats:!0,chrom:t.view.chrom,low:0,high:t.view.max_high,hda_ldda:t.dataset.get("hda_ldda")},function(e){var i=e.data;if(i&&void 0!==i.min&&void 0!==i.max){var n=i.min,a=i.max;n=Math.floor(Math.min(0,Math.max(n,i.mean-2*i.sd))),a=Math.ceil(Math.max(0,Math.min(a,i.mean+2*i.sd))),t.config.set_default_value("min_value",n),t.config.set_default_value("max_value",a),t.config.set_value("min_value",n),t.config.set_value("max_value",a)}})},get_drawables:function(){return this}});var K=function(t,i,n){X.call(this,t,i,n);var a=this;if(o(a.container_div,a.drag_handle_class,".group",a),this.filters_manager=new T.default.FiltersManager(this,"filters"in n?n.filters:null),this.data_manager.set("filters_manager",this.filters_manager),this.filters_available=!1,this.tool=n.tool?new F(h.extend(n.tool,{track:this,tool_state:n.tool_state})):null,this.tile_cache=new m.default.Cache(10),this.left_offset=0,this.header_div&&(this.set_filters_manager(this.filters_manager),this.tool)){var s=new q({model:this.tool});s.render(),this.dynamic_tool_div=s.$el,this.header_div.after(this.dynamic_tool_div)}this.tiles_div=e("").addClass("tiles").appendTo(this.content_div),this.config.get_value("content_visible")||this.tiles_div.hide(),this.overlay_div=e("").addClass("overlay").appendTo(this.content_div),n.mode&&this.change_mode(n.mode)};I(K.prototype,R.prototype,X.prototype,{action_icons_def:X.prototype.action_icons_def.concat([{name:"show_more_rows_icon",title:"To minimize track height, not all feature rows are displayed. Click to display more rows.",css_class:"exclamation",on_click_fn:function(t){e(".tooltip").remove(),t.slotters[t.view.resolution_px_b].max_rows*=2,t.request_draw({clear_tile_cache:!0})},hide:!0}]),copy:function(e){var t=this.to_dict();I(t,{data_manager:this.data_manager});var i=new this.constructor(this.view,e,t);return i.change_mode(this.mode),i.enabled=this.enabled,i},set_filters_manager:function(e){this.filters_manager=e,this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),dataset:{id:this.dataset.id,hda_ldda:this.dataset.get("hda_ldda")},prefs:this.config.to_key_value_dict(),mode:this.mode,filters:this.filters_manager.to_dict(),tool_state:this.tool?this.tool.state_dict():{}}},set_min_max:function(){var t=this;return e.getJSON(t.dataset.url(),{data_type:"data",stats:!0,chrom:t.view.chrom,low:0,high:t.view.max_high,hda_ldda:t.dataset.get("hda_ldda")},function(e){var i=e.data;if(isNaN(parseFloat(t.config.get_value("min_value")))||isNaN(parseFloat(t.config.get_value("max_value")))){var n=i.min,a=i.max;n=Math.floor(Math.min(0,Math.max(n,i.mean-2*i.sd))),a=Math.ceil(Math.max(0,Math.min(a,i.mean+2*i.sd))),t.config.set_value("min_value",n),t.config.set_value("max_value",a)}})},change_mode:function(e){var t=this;return t.mode=e,t.config.set_value("mode",e),"Auto"===e&&this.data_manager.clear(),t.request_draw({clear_tile_cache:!0}),this.action_icons.mode_icon.attr("title","Set display mode (now: "+t.mode+")"),t},update_icons:function(){var e=this;e.action_icons.filters_icon.toggle(e.filters_available),e.action_icons.tools_icon.toggle(null!==e.tool),e.action_icons.param_space_viz_icon.toggle(null!==e.tool)},_gen_tile_cache_key:function(e,t){return e+"_"+t},request_draw:function(e){e&&e.clear_tile_cache&&this.tile_cache.clear(),this.view.request_redraw(e,this)},before_draw:function(){this.max_height_px=0},_draw:function(t){var i=this;if(this.can_draw()){var n=t&&t.clear_after,a=this.view.low,s=this.view.high,o=this.view.container.width(),r=this.view.resolution_px_b,l=1/r;this.is_overview&&(a=this.view.max_low,s=this.view.max_high,r=o/(this.view.max_high-this.view.max_low),l=1/r),this.before_draw(),this.tiles_div.children().addClass("remove");for(var d,c,u=Math.floor(400*l),f=Math.floor(a/u),p=[],_=[];f*u
| '+this.grid_header(e)+' | \n\n | \n |
| \n | \n | \n |
| ",a&&(_+='Advanced Search'),_+=" |
| Close Advanced Search |
u)return-3;this.u[v]=S=this.hn[0],this.hn[0]+=P,0!=v?(this.x[v]=w,this.r[0]=y,this.r[1]=x,y=w>>>T-x,this.r[2]=S-this.u[v-1]-y,o(this.r,0,d,3*(this.u[v-1]+y),3)):r[0]=S}for(this.r[1]=b-T,C>=i?this.r[0]=192:h[C] >>=1)w^=y;for(w^=y,k=(1< '+this.progressive+"... ",(0,p.default)(["Pair collections are permanent collections containing two datasets: one forward and one reverse. ","Often these are forward and reverse reads. The pair collections can be passed to tools and ","workflows in order to have analyses done on both datasets. This interface allows ","you to create a pair, name it, and swap which is forward and which reverse."].join(""))," ",(0,p.default)(['Once your collection is complete, enter a name and ','click "Create list".'].join(""))," ",(0,v.default)(["Collections of paired datasets are ordered lists of dataset pairs (often forward and reverse reads). ","These collections can be passed to tools and workflows in order to have analyses done on each member of ","the entire group. This interface allows you to create a collection, choose which datasets are paired, ","and re-order the final collection."].join(""))," ",(0,v.default)(['Unpaired datasets are shown in the unpaired section ',"(hover over the underlined words to highlight below). ",'Paired datasets are shown in the paired section.'," ",(0,v.default)([" ",(0,v.default)(["To unpair individual dataset pairs, click the ",'unpair buttons ( ). ','Click the "Unpair all" link to unpair all pairs.'].join(""))," ",(0,v.default)(['You can include or remove the file extensions (e.g. ".fastq") from your pair names by toggling the ','"Remove file extensions from pair names?" control.'].join(""))," ",(0,v.default)(['Once your collection is complete, enter a name and ','click "Create list". ',"(Note: you do not have to pair all unpaired datasets to finish.)"].join(""))," You are using '+e.nice_total_disk_usage+" of disk space in this Galaxy instance. "+(Galaxy.config.enable_quotas?"Your disk quota is: "+e.quota+". ":"")+'Is your usage more than expected? See the documentation for tips on how to find all of the data in your account. The length format is two-column, separated by whitespace, of the form: For example, the first few entries of mm9.len are as follows: Trackster uses this information to populate the select box for chrom/contig, andto set the maximum basepair of the track browser. You may either upload a .len fileof this format (Len File option), or directly enter the information into the box (Len Entry option). This is a multi-fasta file from your current history that provides the genomesequences for each chromosome/contig in your build. Here is a snippet from an example multi-fasta file: Drop workflow files here to import An error occured while running the tool "+t.tool_id+'. Tool execution generated the following messages: \n Usually the local Galaxy administrators regularly review errors that occur on the server\n However, if you would like to provide additional information (such as what you were trying\n to do when the error occurred) and a contact e-mail address, we will be better able to\n investigate your problem and get back to you.\n \n \',\n
',"
","
',(0,h.default)("Unhide it"),"","
",a+=t.help):a+="Tool help is unavailable for this dataset.
",a+="
',(0,v.default)("Set it manually or retry auto-detection"),"","
',(0,v.default)("Undelete it"),"","<% if( view.purgeAllowed ){ %>",'
',(0,v.default)("Permanently remove it from disk"),"","<% } %>","',"<% _.each( visualizations, function( visualization ){ %>",'
","","
","<% _.each( problems, function( problem ){ %>","
","<% } else if( _.size( elements ) === 0 ){ %>",(0,p.default)("No datasets were selected"),".","<% } else if( _.size( elements ) === 1 ){ %>",(0,p.default)("Only one dataset was selected"),": <%- elements[0].name %>","<% } else if( _.size( elements ) > 2 ){ %>",(0,p.default)("Too many datasets were selected"),': <%- _.pluck( elements, "name" ).join( ", ") %>',"<% } %>","
",(0,p.default)("Two (and only two) elements are needed for the pair"),". ",(0,p.default)("You may need to "),'',(0,p.default)("cancel")," ",(0,p.default)("and reselect new elements"),".","",""+JSON.stringify(e.responseJSON)+"
":a+=": "+i),n._showAlert(a,"alert-danger")},render:function(e,t){return this.$el.empty().html(this.templates.main()),this._renderHeader(e),this._renderMiddle(e),this._renderFooter(e),this._addPluginComponents(),this.trigger("rendered",this),this},_renderHeader:function(e,t){var i=this.$(".header").empty().html(this.templates.header()).find(".help-content").prepend(s(this.templates.helpContent()));return this._renderFilters(),i},_renderFilters:function(){return this.$(".forward-column .column-header input").val(this.filters[0]).add(this.$(".reverse-column .column-header input").val(this.filters[1]))},_renderMiddle:function(e,t){var i=this.$(".middle").empty().html(this.templates.middle());return this.unpairedPanelHidden?this.$(".unpaired-columns").hide():this.pairedPanelHidden&&this.$(".paired-columns").hide(),this._renderUnpaired(),this._renderPaired(),i},_renderUnpaired:function(e,t){var i,n,a=this,s=[],o=this._splitByFilters();return this.$(".forward-column .title").text([o[0].length,(0,v.default)("unpaired forward")].join(" ")),this.$(".forward-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-o[0].length)),this.$(".reverse-column .title").text([o[1].length,(0,v.default)("unpaired reverse")].join(" ")),this.$(".reverse-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-o[1].length)),this.$(".unpaired-columns .column-datasets").empty(),this.$(".autopair-link").toggle(0!==this.unpaired.length),0===this.unpaired.length?void this._renderUnpairedEmpty():(n=o[1].map(function(e,t){return void 0!==o[0][t]&&o[0][t]!==e&&s.push(a._renderPairButton()),a._renderUnpairedDataset(e)}),i=o[0].map(function(e){return a._renderUnpairedDataset(e)}),i.length||n.length?(this.$(".unpaired-columns .forward-column .column-datasets").append(i).add(this.$(".unpaired-columns .paired-column .column-datasets").append(s)).add(this.$(".unpaired-columns .reverse-column .column-datasets").append(n)),void this._adjUnpairedOnScrollbar()):void this._renderUnpairedNotShown())},_renderUnpairedDisplayStr:function(e){return["(",e," ",(0,v.default)("filtered out"),")"].join("")},_renderUnpairedDataset:function(e){return s("").attr("id","dataset-"+e.id).addClass("dataset unpaired").attr("draggable",!0).addClass(e.selected?"selected":"").append(s("").addClass("dataset-name").text(e.name)).data("dataset",e)},_renderPairButton:function(){return s("").addClass("dataset unpaired").append(s("").addClass("dataset-name").text((0,v.default)("Pair these datasets")))},_renderUnpairedEmpty:function(){var e=s('').text("("+(0,v.default)("no remaining unpaired datasets")+")");return this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(e),e},_renderUnpairedNotShown:function(){var e=s('').text("("+(0,v.default)("no datasets were found matching the current filters")+")");return this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(e),e},_adjUnpairedOnScrollbar:function(){var e=this.$(".unpaired-columns").last(),t=this.$(".unpaired-columns .reverse-column .dataset").first();if(t.length){var i=e.offset().left+e.outerWidth(),n=t.offset().left+t.outerWidth(),a=Math.floor(i)-Math.floor(n);this.$(".unpaired-columns .forward-column").css("margin-left",a>0?a:0)}},_renderPaired:function(e,t){if(this.$(".paired-column-title .title").text([this.paired.length,(0,v.default)("paired")].join(" ")),this.$(".unpair-all-link").toggle(0!==this.paired.length),0===this.paired.length)return void this._renderPairedEmpty();this.$(".remove-extensions-link").show(),this.$(".paired-columns .column-datasets").empty();var i=this;this.paired.forEach(function(e,t){var n=new w({pair:e});i.$(".paired-columns .column-datasets").append(n.render().$el).append(['"].join(""))})},_renderPairedEmpty:function(){var e=s('').text("("+(0,v.default)("no paired datasets yet")+")");return this.$(".paired-columns .column-datasets").empty().prepend(e),e},footerSettings:{".hide-originals":"hideOriginals",".remove-extensions":"removeExtensions"},_addPluginComponents:function(){this._chooseFiltersPopover(".choose-filters-link"),this.$(".help-content i").hoverhighlight(".collection-creator","rgba( 64, 255, 255, 1.0 )")},_chooseFiltersPopover:function(e){function t(e,t){return['"].join("")}var i=s(n.template(['',"
',"
',"
',"
To pair datasets, you can:","
"].join("")),"","You can filter what is shown in the unpaired sections by:","
"].join("")),"","").addClass("upload-settings-table ui-table-striped").append("")),this.$cover=this.$(".upload-settings-cover"),this.$table=this.$(".upload-settings-table > tbody"),this.listenTo(this.model,"change",this.render,this),this.model.trigger("change")},render:function(){var e=this;this.$table.empty(),a.each(this.options.parameters,function(t){var i=n("").addClass("upload-"+t.id+" upload-icon-button fa").addClass(e.model.get(t.id)&&e.options.class_check||e.options.class_uncheck).on("click",function(){e.model.get("enabled")&&e.model.set(t.id,!e.model.get(t.id))});e.$table.append(n("
").append(n(" ").append(i)).append(n(" ").append(t.title)))}),this.$cover[this.model.get("enabled")&&"hide"||"show"]()}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(5),r=s(o),l=i(183),d=s(l);t.default=e.View.extend({initialize:function(t){this.model=new e.Model({cls:"upload-ftp",class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o",class_partial:"upload-icon-button fa fa-minus-square-o",help_enabled:!0,oidc_text:"
If you are signed-in to Galaxy using a third-party identity and you don't have a Galaxy password please go to this page and request a password for your Galaxy account.',help_text:"This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at "+t.ftp_upload_site+' using your Galaxy credentials.\n For help visit the tutorial.',collection:null,onchange:function(){},onadd:function(){},onremove:function(){}}).set(t),this.collection=this.model.get("collection"),Galaxy.config.enable_oidc&&this.model.set("help_text",this.model.get("help_text")+this.model.get("oidc_text")),this.setElement(this._template()),this.$content=this.$(".upload-ftp-content"),this.$wait=this.$(".upload-ftp-wait"),this.$help=this.$(".upload-ftp-help"),this.$number=this.$(".upload-ftp-number"),this.$disk=this.$(".upload-ftp-disk"),this.$body=this.$(".upload-ftp-body"),this.$warning=this.$(".upload-ftp-warning"),this.$select=this.$(".upload-ftp-select-all"),this.render()},render:function(){var e=this;this.$wait.show(),this.$content.hide(),this.$warning.hide(),this.$help.hide(),d.default.getRemoteFiles(function(t){e.model.set("ftp_files",t),e._index(),e._renderTable()},function(){e._renderTable()})},_renderTable:function(){var e=this,t=this.model.get("ftp_files");if(this.rows=[],t&&t.length>0){this.$body.empty();var i=0;n.each(t,function(t){e.rows.push(e._renderRow(t)),i+=t.size}),this.$number.html(t.length+" files"),this.$disk.html(r.default.bytesToString(i,!0)),this.collection&&(this.$("._has_collection").show(),this.$select.addClass(this.model.get("class_add")).off().on("click",function(){e._all()}),this._refresh()),this.$content.show()}else this.$warning.show();this.model.get("help_enabled")&&this.$help.show(),this.$wait.hide()},_renderRow:function(e){var t=this,i=this.model.attributes,n=a(this._templateRow(e)),s=n.find(".icon");if(this.$body.append(n),this.collection){var o=this.ftp_index[e.path];s.addClass(void 0===o?i.class_add:i.class_remove),n.on("click",function(){t._switch(s,e),t._refresh()})}else n.on("click",function(){i.onchange(e)});return s},_index:function(){var e=this;this.ftp_index={},this.collection&&this.collection.each(function(t){"ftp"==t.get("file_mode")&&(e.ftp_index[t.get("file_path")]=t.id)})},_all:function(){var e=this.model.attributes,t=this.model.get("ftp_files"),i=this.$select.hasClass(e.class_add);for(var n in t){var a=t[n],s=this.ftp_index[a.path];(void 0===s&&i||void 0!==s&&!i)&&this._switch(this.rows[n],a)}this._refresh()},_switch:function(e,t){e.removeClass();var i=this.model.attributes,n=this.ftp_index[t.path];if(void 0===n){var a=i.onadd(t);e.addClass(i.class_remove),this.ftp_index[t.path]=a}else i.onremove(n),e.addClass(i.class_add),this.ftp_index[t.path]=void 0},_refresh:function(){var e=n.reduce(this.ftp_index,function(e,t){return void 0!==t&&e++,e},0);this.$select.removeClass(),0==e?this.$select.addClass(this.model.get("class_add")):this.$select.addClass(e==this.rows.length?this.model.get("class_remove"):this.model.get("class_partial"))},_templateRow:function(e){return' "},_template:function(){return''+n.escape(e.path)+' '+r.default.bytesToString(e.size)+' '+e.ctime+" Name Size Created \n \n
\n \n \n \n \n Name \n Size \n Type \n Genome \n Settings \n Status \n \n '}})}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,i,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e.View.extend({initialize:function(e){this.$container=e.$container,this.collection=e.collection,this.new_content=e.new_content,this.max=e.max||50,this.content_list={},this.$message=i("").addClass("ui-limitloader").append("...only the first "+this.max+" entries are visible."),this.$container.append(this.$message),this.listenTo(this.collection,"reset",this._reset,this),this.listenTo(this.collection,"add",this._refresh,this),this.listenTo(this.collection,"remove",this._remove,this)},_done:function(){var e=n.size(this.content_list)>this.max;return this.$message[e?"show":"hide"](),e},_reset:function(){n.each(this.content_list,function(e){e.remove()}),this.content_list={},this.$message.hide()},_remove:function(e){var t=e.id,i=this.content_list[t];i&&(i.remove(),delete this.content_list[t]),this._refresh()},_refresh:function(){if(!this._done())for(var e in this.collection.models){var t=this.collection.models[e];this.content_list[t.id];if(!this.content_list[t.id]){var i=this.new_content(t);if(this.content_list[t.id]=i,this._done())break}}}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(5),d=(s(l),i(174)),c=s(d),u=i(650),h=s(u),f=i(189),p=s(f),_=i(64),m=(s(_),i(39)),g=s(m),v=i(10),w=s(v);t.default=e.View.extend({collection:new c.default.Collection,initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.btnStart=new w.default.Button({title:(0,r.default)("Start"),onclick:function(){t._eventStart()}}),this.btnClose=new w.default.Button({title:(0,r.default)("Close"),onclick:function(){t.app.modal.hide()}}),n.each([this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.select_extension=new g.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:n.filter(this.list_extensions,function(e){return e.composite_files}),onchange:function(e){t.collection.reset();var i=n.findWhere(t.list_extensions,{id:e});i&&i.composite_files&&n.each(i.composite_files,function(e){t.collection.add({id:t.collection.size(),file_desc:e.description||e.name})})}}),this.$(".upload-footer-extension-info").on("click",function(e){new p.default({$el:a(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new g.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome}),this.listenTo(this.collection,"add",function(e){t._eventAnnounce(e)}),this.listenTo(this.collection,"change add",function(){t.render()}),this.select_extension.options.onchange(this.select_extension.value()),this.render()},render:function(){var e=this.collection.first();e&&"running"==e.get("status")?(this.select_genome.disable(),this.select_extension.disable()):(this.select_genome.enable(),this.select_extension.enable()),this.collection.where({status:"ready"}).length==this.collection.length&&this.collection.length>0?(this.btnStart.enable(),this.btnStart.$el.addClass("btn-primary")):(this.btnStart.disable(),this.btnStart.$el.removeClass("btn-primary")),this.$(".upload-table")[this.collection.length>0?"show":"hide"]()},_eventAnnounce:function(e){var t=new h.default(this,{model:e});this.$(".upload-table > tbody:first").append(t.$el),this.$(".upload-table")[this.collection.length>0?"show":"hide"](),t.render()},_eventStart:function(){var e=this;this.collection.each(function(t){t.set({genome:e.select_genome.value(),extension:e.select_extension.value()})}),a.uploadpost({url:this.app.options.upload_path,data:this.app.toData(this.collection.filter()),success:function(t){e._eventSuccess(t)},error:function(t){e._eventError(t)},progress:function(t){e._eventProgress(t)}})},_eventProgress:function(e){this.collection.each(function(t){t.set("percentage",e)})},_eventSuccess:function(e){this.collection.each(function(e){e.set("status","success")}),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e){this.collection.each(function(t){t.set({status:"error",info:e})})},_template:function(){return'   Description Name Size Settings Status '}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(5),d=(s(l),i(174)),c=s(d),u=i(652),h=s(u),f=i(214),p=s(f),_=i(189),m=s(_),g=i(64),v=s(g),w=i(39),y=s(w),b=i(10),x=s(b),k=i(85);s(k);i(215),t.default=e.View.extend({upload_size:0,collection:new c.default.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.btnLocal=new x.default.Button({id:"btn-local",title:(0,r.default)("Choose local files"),onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new x.default.Button({id:"btn-ftp",title:(0,r.default)("Choose FTP files"),onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new x.default.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new x.default.Button({id:"btn-start",title:(0,r.default)("Start"),onclick:function(){t._eventStart()}}),this.btnBuild=new x.default.Button({id:"btn-build",title:(0,r.default)("Build"),onclick:function(){t._eventBuild()}}),this.btnStop=new x.default.Button({id:"btn-stop",title:(0,r.default)("Pause"),onclick:function(){t._eventStop()}}),this.btnReset=new x.default.Button({id:"btn-reset",title:(0,r.default)("Reset"),onclick:function(){t._eventReset()}}),this.btnClose=new x.default.Button({id:"btn-close",title:(0,r.default)("Close"),onclick:function(){t.app.modal.hide()}}),n.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnBuild,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$(".upload-box").uploadbox({url:this.app.options.upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$(".upload-box").addClass("highlight")},ondragleave:function(){t.$(".upload-box").removeClass("highlight")}}),this.ftp=new v.default.View({title:(0,r.default)("FTP files"),container:this.btnFtp.$el}),this.select_extension=new y.default.View({css:"upload-footer-selection-compressed",container:this.$(".upload-footer-extension"),data:n.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t.updateExtension(e)}}),this.collectionType="list",this.select_collection=new y.default.View({css:"upload-footer-selection-compressed",container:this.$(".upload-footer-collection-type"),data:[{id:"list",text:"List"},{id:"paired",text:"Paired"},{id:"list:paired",text:"List of Pairs"}],value:"list",onchange:function(e){t.updateCollectionType(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){new m.default({$el:a(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new y.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t.updateGenome(e)}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this._updateScreen()},_eventAnnounce:function(e,t){this.counter.announce++;var i=new c.default.Model({id:e,file_name:t.name,file_size:t.size,file_mode:t.mode||"local",file_path:t.path,file_data:t,extension:this.select_extension.value(),genome:this.select_genome.value()});this.collection.add(i);var n=new h.default(this,{model:i});this.$(".upload-table > tbody:first").append(n.$el),this._updateScreen(),n.render()},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=n.pluck(t.outputs,"hid"),a=this.collection.get(e);a.set({percentage:100,status:"success",hids:i}),this.ui_button.model.set("percentage",this._uploadPercentage(100,a.get("file_size"))),this.upload_completed+=100*a.get("file_size"),this.counter.announce--,this.counter.success++,this._updateScreen(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this._updateScreen()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this._updateScreen()},_eventBuild:function(){var e=[];n.forEach(this.collection.models,function(t){e.push.apply(e,t.get("hids"))});var t=n.map(e,function(e){return Galaxy.currHistoryPanel.collection.getByHid(e)}),i=new Galaxy.currHistoryPanel.collection.constructor(t);i.historyId=Galaxy.currHistoryPanel.collection.historyId,Galaxy.currHistoryPanel.buildCollection(this.collectionType,i,!0),this.counter.running=0,this._updateScreen(),this._eventReset(),this.app.modal.hide()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this._updateScreen()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new p.default({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){return e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(!(0==this.counter.announce||this.counter.running>0)){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this.uploadbox.start(),this._updateScreen()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),a(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){0==this.counter.running&&(this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this._updateScreen())},updateExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},updateCollectionType:function(e){this.collectionType=e},updateGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_updateScreen:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running&&0==this.counter.announce&&this.counter.success>0&&0==this.counter.error,a=0==this.counter.running,s=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnBuild[n?"enable":"disable"](),this.btnBuild.$el[n?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[a?"enable":"disable"](),this.btnFtp[a?"enable":"disable"](),this.btnCreate[a?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[s?"show":"hide"](),this.$(".upload-helper")[s?"hide":"show"]()},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(){return'Name Size Status '}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),o=a(s),r=i(10),l=a(r),d=i(39),c=a(d),u=i(183),h=a(u),f=i(35),p=a(f);t.default=e.View.extend({initialize:function(e){var t=this;this.app=e,this.options=e.options,this.ftpFiles=[],this.ftpUploadSite=e.currentFtp(),this.setElement(this._template()),this.btnBuild=new l.default.Button({id:"btn-build",title:(0,o.default)("Build"),onclick:function(){t._eventBuild()}}),this.btnBuild.$el.addClass("btn-primary"),this.btnReset=new l.default.Button({id:"btn-reset",title:(0,o.default)("Reset"),onclick:function(){return t._eventReset()}}),this.btnClose=new l.default.Button({id:"btn-close",title:(0,o.default)("Close"),onclick:function(){return t.app.modal.hide()}}),n.each([this.btnReset,this.btnBuild,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)});var i=[{id:"datasets",text:"Datasets"},{id:"collections",text:"Collection(s)"}];this.dataType="datasets",this.dataTypeView=new c.default.View({css:"upload-footer-selection",container:this.$(".rule-data-type"),data:i,value:this.dataType,onchange:function(e){t.dataType=e}});var a=[{id:"paste",text:"Pasted Table"},{id:"dataset",text:"History Dataset"}];this.ftpUploadSite&&a.push({id:"ftp",text:"FTP Directory"}),this.selectionType="paste",this.selectionTypeView=new c.default.View({css:"upload-footer-selection",container:this.$(".rule-select-type"),data:a,value:this.selectionType,onchange:function(e){t.selectionType=e,t._renderSelectedType()}}),this.selectedDatasetId=null,this.$sourceContent=this.$(".upload-rule-source-content"),this.$sourceContent.on("change keyup paste",function(){t._updateBuildState()}),this._renderSelectedType()},_renderSelectedType:function(){var e=this,t=this.selectionType;if("dataset"==t)if(this.datasetSelectorView)this.datasetSelectorView.value(null);else{this.selectedDatasetId=null;var i=parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.model,a=i.contents.models,s=[],r=!0,l=!1,d=void 0;try{for(var u,f=a[Symbol.iterator]();!(r=(u=f.next()).done);r=!0){var p=u.value,_=p.attributes;"dataset"===_.history_content_type&&s.push({id:_.id,text:_.hid+": "+n.escape(_.name)})}}catch(e){l=!0,d=e}finally{try{!r&&f.return&&f.return()}finally{if(l)throw d}}this.datasetSelectorView=new c.default.View({container:this.$(".dataset-selector"),data:s,placeholder:(0,o.default)("Select a dataset"),onchange:function(t){e._onDataset(t)}})}else"ftp"==t&&h.default.getRemoteFiles(function(t){e._setPreview(t.map(function(e){return e.path}).join("\n")),e.ftpFiles=t});this._updateScreen()},_onDataset:function(e){var t=this;if(this.selectedDatasetId=e,!e)return void this._setPreview("");p.default.get(Galaxy.root+"api/histories/"+Galaxy.currHistoryPanel.model.id+"/contents/"+e+"/display").then(function(e){t._setPreview(e.data)}).catch(function(e){return console.log(e)})},_eventReset:function(){this.datasetSelectorView&&this.datasetSelectorView.value(null),this.$sourceContent.val(""),this._updateScreen()},_eventBuild:function(){var e=this.$sourceContent.val();this._buildSelection(e)},_buildSelection:function(e){var t=this.selectionType,i={};"dataset"==t||"paste"==t?(i.selectionType="raw",i.content=e):"ftp"==t&&(i.selectionType="ftp",i.elements=this.ftpFiles,i.ftpUploadSite=this.ftpUploadSite),i.dataType=this.dataType,Galaxy.currHistoryPanel.buildCollection("rules",i,!0),this.app.modal.hide()},_setPreview:function(e){this.$sourceContent.val(e),this._updateScreen()},_updateScreen:function(){this._updateBuildState();var e=this.selectionType;this.$("#upload-rule-dataset-option")["dataset"==e?"show":"hide"](),this.$sourceContent.attr("disabled","paste"!==e)},_updateBuildState:function(){var e=this.$sourceContent.val();this.btnBuild[e?"enable":"disable"](),this.btnBuild.$el[e?"addClass":"removeClass"]("btn-primary")},_template:function(){return'\n \n Tabular source data to extract collection files and metadata from\n
\n ").addClass("ui-panel-table"));var s=h.default.get("message"),o=h.default.get("status");s&&o&&e.$preferences.prepend(new c.default.Message({message:s,status:o}).$el),t.use_remote_user||(e._addLink("information"),e._addLink("password")),t.enable_communication_server&&e._addLink("communication"),e._addLink("custom_builds"),e._addLink("permissions"),e._addLink("api_key"),t.has_user_tool_filters&&e._addLink("toolbox_filters"),t.enable_openid&&!t.use_remote_user&&e._addLink("openids"),Galaxy.session_csrf_token&&e._addLink("logout"),e.$preferences.append(e._templateFooter(i)),e.$el.empty().append(e.$preferences)})},_addLink:function(e){var t=this.model.get(e),i=n(this._templateLink(t)),a=i.find("a");t.onclick?a.on("click",function(){t.onclick()}):a.attr("href",Galaxy.root+"user/"+e),this.$table.append(i)},_templateLink:function(e){return'
"},_templateFooter:function(e){return''+e.title+' Length Format
chrom/contig length of chrom/contig
chr1 197195432\nchr2 181748087\nchr3 159599783\nchr4 155630120\nchr5 152537259
FASTA format
>chr1\nATTATATATAAGACCACAGAGAGAATATTTTGCCCGG...\n\n>chr2\nGGCGGCCGCGGCGATATAGAACTACTCATTATATATA...\n\n...
"}});t.default={View:_}}).call(t,i(2),i(0))},function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0});var a=i(5),s=function(e){return e&&e.__esModule?e:{default:e}}(a),o=e.View.extend({initialize:function(e){this.options=s.default.merge(e,{content:"No content available.",onchange:null,ondblclick:null,onconfirm:null,cls:"ui-table",selectable:!0,cls_tr:""}),this.setElement(this._template()),this.$thead=this.$("thead"),this.$tbody=this.$("tbody"),this.$tmessage=this.$("tmessage"),this.row=this._row(),this.row_count=0},events:{click:"_onclick",dblclick:"_ondblclick"},addHeader:function(e){this.row.append(n("").append(e))},appendHeader:function(){this.$thead.append(this.row),this.row=n(" ")},add:function(e,t,i){var a=n(" ");t&&a.css("width",t),i&&a.css("text-align",i),this.row.append(a.append(e))},append:function(e,t){this._commit(e,t,!1)},prepend:function(e,t){this._commit(e,t,!0)},get:function(e){return this.$("#"+e)},del:function(e){var t=this.$tbody.find("#"+e);t.length>0&&(t.remove(),this.row_count--,this._refresh())},delAll:function(){this.$tbody.empty(),this.row_count=0,this._refresh()},value:function(e){if(this.options.selectable){this.before=this.$tbody.find(".current").attr("id"),void 0!==e&&(this.$tbody.find("tr").removeClass("current"),e&&this.$tbody.find("#"+e).addClass("current"));var t=this.$tbody.find(".current").attr("id");return void 0===t?null:(t!=this.before&&this.options.onchange&&this.options.onchange(e),t)}},size:function(){return this.$tbody.find("tr").length},_commit:function(e,t,i){this.del(e),this.row.attr("id",e),i?this.$tbody.prepend(this.row):this.$tbody.append(this.row),t&&(this.row.hide(),this.row.fadeIn()),this.row=this._row(),this.row_count++,this._refresh()},_row:function(){return n(' ')},_onclick:function(e){var t=this.value(),i=n(e.target).closest("tr").attr("id");""!=i&&i&&t!=i&&(this.options.onconfirm?this.options.onconfirm(i):this.value(i))},_ondblclick:function(e){var t=this.value();t&&this.options.ondblclick&&this.options.ondblclick(t)},_refresh:function(){0==this.row_count?this.$tmessage.show():this.$tmessage.hide()},_template:function(){return' "+this.model.get("plural")+" shared with you by others
');a.each(i.shared_by_others,function(t,i){var n=Galaxy.root+e.item+"/display_by_username_and_slug?username="+t.username+"&slug="+t.slug;s.append('Title Owner ")}),t.append(s)}else t.append("No "+this.model.get("plural").toLowerCase()+" have been shared with you.");return t}});t.default={View:c}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0});var s=i(20),o=a(s),r=i(9),l=a(r),d=i(1),c=a(d),u=i(68),h=n(u),f=i(662),p=n(f),_=i(32),m=n(_),g=i(3),v=n(g),w=i(34),y=n(w),b=l.View.extend({tagName:"tr",initialize:function(){c.bindAll(this,"render","_rowTemplate","renderTagEditor","_templateActions","removeWorkflow","copyWorkflow"),o.options.timeOut=1500},events:{"click #show-in-tool-panel":"showInToolPanel","click #delete-workflow":"removeWorkflow","click #rename-workflow":"renameWorkflow","click #copy-workflow":"copyWorkflow"},render:function(){return e(this.el).html(this._rowTemplate()),this},showInToolPanel:function(){this.model.save({show_in_tool_panel:!this.model.get("show_in_tool_panel")},{success:function(){window.location=Galaxy.root+"workflows/list"}})},removeWorkflow:function(){var e=this.model.get("name");window.confirm("Are you sure you want to delete workflow '"+e+"'?")&&(this.model.destroy({success:function(){o.success("Successfully deleted workflow '"+e+"'")}}),this.remove())},renameWorkflow:function(){var e=this.model.get("name"),t=window.prompt("Enter a new Name for workflow '"+e+"'",e);t&&(this.model.save({name:t},{success:function(){o.success("Successfully renamed workflow '"+e+"' to '"+t+"'")}}),this.render())},copyWorkflow:function(){var t=this,i=this.model.get("name");e.getJSON(this.model.urlRoot+"/"+this.model.id+"/download",function(e){var n="Copy of "+i,a=t.model.get("owner");a!=Galaxy.user.attributes.username&&(n+=" shared by user "+a),e.name=n,t.collection.create(e,{at:0,wait:!0,success:function(){o.success("Successfully copied workflow '"+i+"' to '"+n+"'")},error:function(e,t,i){o.error(i.errorThrown)}})}).error(function(e,t,i){o.error(e.responseJSON.err_msg)})},_rowTemplate:function(){var e=this.model.get("show_in_tool_panel"),t=this.model.id,i='';return'\n '+a.escape(t.title)+" "+a.escape(t.username)+" \n \n \n \n \n '+(this.model.get("owner")===Galaxy.user.attributes.username?"You":this.model.get("owner"))+"\n \n "+this.model.get("number_of_steps")+" \n "+(this.model.get("published")?"Yes":"No")+" \n "+i+" "},renderTagEditor:function(){var t=new h.default.TagsEditor({model:this.model,el:e.find("."+this.model.id+".tags-display"),workflow_mode:!0});t.toggle(!0),t.render()},_templateActions:function(){return this.model.get("owner")===Galaxy.user.attributes.username?'':''}}),x=l.View.extend({title:(0,v.default)("Workflows"),active_tab:"workflow",initialize:function(){y.default.markViewAsLoading(this),c.bindAll(this,"adjustActiondropdown"),this.collection=new p.default.WorkflowCollection,this.collection.fetch().done(this.render()),this.collection.bind("add",this.appendItem),this.collection.on("sync",this.render,this)},events:{dragleave:"unhighlightDropZone",drop:"drop",dragover:function(t){e(".hidden_description_layer").addClass("dragover"),e(".menubutton").addClass("background-none"),t.preventDefault()}},unhighlightDropZone:function(){e(".hidden_description_layer").removeClass("dragover"),e(".menubutton").removeClass("background-none")},drop:function(e){this.unhighlightDropZone(),e.preventDefault();for(var t,i=e.dataTransfer.files,n=0;t=i[n];n++)this.readWorkflowFiles(t)},readWorkflowFiles:function(e){var t=this,i=new FileReader;i.onload=function(n){var a=void 0;try{a=JSON.parse(i.result)}catch(t){o.error("Could not read file '"+e.name+"'. Verify it is a valid Galaxy workflow"),a=null}a&&t.collection.create(a,{at:0,wait:!0,success:function(){o.success("Successfully imported workflow '"+a.name+"'")},error:function(e,t,i){o.error(i.errorThrown)}})},i.readAsText(e,"utf-8")},_showArgErrors:c.once(function(){var e=m.default.get("message");"error"===m.default.get("status")?o.error(c.escape(e||"Unknown Error, please report this to an administrator.")):e&&o.info(c.escape(e))}),render:function(){var e=this,t=this._templateHeader(),i=this._templateActionButtons(),n=this._templateWorkflowTable();this.$el.html(t+i+n),c.each(this.collection.models,function(t){e.appendItem(t),e.confirmDelete(t)});return this.searchWorkflow(this.$(".search-wf"),this.$(".workflow-search tr"),3),this.adjustActiondropdown(),this._showArgErrors(),this},appendItem:function(t){var i=new b({model:t,collection:this.collection});e(".workflow-search").append(i.render().el),i.renderTagEditor()},confirmDelete:function(e){this.$(".link-confirm-shared-"+e.id).click(function(){return window.confirm("Are you sure you want to remove the shared workflow '"+e.attributes.name+"'?")})},searchWorkflow:function(t,i,n){t.on("keyup",function(){var t=e(this).val();if(t.length>=n){var a=new RegExp(t,"i");i.hide(),i.filter(function(){return a.test(e(this).text())}).show()}else i.show()})},adjustActiondropdown:function(){e(this.el).on("show.bs.dropdown",function(){e(this.el).css("overflow","inherit")}),e(this.el).on("hide.bs.dropdown",function(){e(this.el).css("overflow","auto")})},_templateNoWorkflow:function(){return'Name Tags Owner # of Steps Published Show in tools panel '+(0,v.default)("Your workflows")+"
Dataset Error
\n '+n.escape(t.stderr)+"
\n Report This Error
\n ").attr({id:"content_table",cellpadding:0});this.$el.append(e);var t=this.model.get_metadata("column_names"),i=a("").appendTo(e),n=a("
").appendTo(i);if(t)n.append(" "+t.join(" ")+" ");else for(var s=1;s<=this.model.get_metadata("columns");s++)n.append(""+s+" ");var o=this,r=this.model.get("first_data_chunk");r?this._renderChunk(r):a.when(o.model.get_next_chunk()).then(function(e){o._renderChunk(e)}),this.scroll_elt.scroll(function(){o.attempt_to_fetch()})},scrolled_to_bottom:function(){return!1},_renderCell:function(e,t,i){var n=a("").text(e),s=this.model.get_metadata("column_types");return void 0!==i?n.attr("colspan",i).addClass("stringalign"):s&&t "))})),this.row_count++,i},_renderChunk:function(e){var t=this.$el.find("table");n.each(e.ck_data.split("\n"),function(e,i){""!==e&&t.append(this._renderRow(e))},this)}}),_=p.extend({initialize:function(e){p.prototype.initialize.call(this,e);var t=n.find(this.$el.parents(),function(e){return"auto"===a(e).css("overflow")});t||(t=window),this.scroll_elt=a(t)},scrolled_to_bottom:function(){return this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0}}),m=p.extend({initialize:function(e){p.prototype.initialize.call(this,e),this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:e.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}}),g=e.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,file_ext:null,initialize:function(e){var t=parent.Galaxy;if(t&&t.modal&&(this.modal=t.modal),t&&t.frame&&(this.frame=t.frame),this.modal&&this.frame){var i=e.model,n=i.get("metadata");if(i.get("file_ext")){if(this.file_ext=i.get("file_ext"),"bed"==this.file_ext){if(!(n.get("chromCol")&&n.get("startCol")&&n.get("endCol")))return void console.log("TabularButtonTrackster : Bed-file metadata incomplete.");this.col.chrom=n.get("chromCol")-1,this.col.start=n.get("startCol")-1,this.col.end=n.get("endCol")-1}if("vcf"==this.file_ext){var a=function(e,t){for(var i=0;i
"),r.addClass("editable-text"),a&&a(e)},u="cur_text"in e?e.cur_text:r.text();n?(l=s("").attr({rows:i,cols:t}).text(s.trim(u)).keyup(function(e){27===e.keyCode&&c(u)}),d=s("").text("Done").click(function(){return c(l.val()),!1})):l=s("").attr({value:s.trim(u),size:t}).blur(function(){c(u)}).keyup(function(e){27===e.keyCode?s(this).trigger("blur"):13===e.keyCode&&c(s(this).val()),e.stopPropagation()}),r.text(""),r.append(l),d&&r.append(d),l.focus(),l.select(),o.stopPropagation()}}),o&&r.attr("title",o).tooltip(),r}},,,,,function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0});var s=i(9),o=a(s),r=i(1),l=a(r),d=i(5),c=n(d),u=i(78),h=n(u),f=i(79),p=n(f),_=i(41),m=n(_),g=i(34),v=n(g);e.ajaxSettings.traditional=!0,t.default=o.View.extend({grid:null,initialize:function(t){this.grid=new h.default,this.title=t.title,this.active_tab=t.active_tab;var i=this;if(window.add_tag_to_grid_filter=function(t,n){var a=t+(void 0!==n&&""!==n?":"+n:"");e("#advanced-search").is(":visible")||(e("#standard-search").slideToggle("fast"),e("#advanced-search").slideToggle("fast")),i.add_filter_condition("tags",a)},t.url_base&&!t.items){v.default.markViewAsLoading(this);var n=t.url_data||{};l.each(t.filters,function(e,t){n["f-"+t]=e}),e.ajax({url:t.url_base+"?"+e.param(n),success:function(e){e.embedded=t.embedded,e.filters=t.filters||{},i.init_grid(e)}})}else this.setElement("',this._templateOptions(t),"
"].join("")},_templateOptions:function(e){return e.length?n.map(e,function(e){return e.divider?'':e.header?['\n
\n <%= dataset.peek %>
',"<% } %>","<% } %>","You can add this dataset as:
",buttons:{Cancel:function(){window.top.location=Galaxy.root+"visualizations/list"},"View in saved visualization":function(){e.view_in_saved(n)},"View in new visualization":function(){e.view_new()}}})}},{key:"view_in_saved",value:function(t){var i=this,n=new C.default({url_base:Galaxy.root+"visualization/list_tracks",embedded:!0});Galaxy.modal.show({title:(0,c.default)("Add Data to Saved Visualization"),body:n.$el,buttons:{Cancel:function(){window.top.location=Galaxy.root+"visualizations/list"},"Add to visualization":function(){e(window.parent.document).find("input[name=id]:checked").each(function(){t.id=e(i).val(),window.top.location=Galaxy.root+"visualization/trackster?"+e.param(t)})}}})}},{key:"view_existing",value:function(){var t=window.galaxy_config.app.viz_config;this.ui.create_visualization({container:e("#center .unified-panel-body"),name:t.title,vis_id:t.vis_id,dbkey:t.dbkey},t.viewport,t.tracks,t.bookmarks,!0),this.init_editor()}},{key:"view_new",value:function(){var t=this;e.ajax({url:Galaxy.root+"api/genomes?chrom_info=True",data:{},error:function(){alert("Couldn't create new browser.")},success:function(i){Galaxy.modal.show({title:(0,c.default)("New Visualization"),body:t.template_view_new(i),buttons:{Cancel:function(){window.top.location=Galaxy.root+"visualizations/list"},Create:function(){t.create_browser(e("#new-title").val(),e("#new-dbkey").val()),Galaxy.modal.hide()}}});var n=i.map(function(e){return e[1]});window.galaxy_config.app.default_dbkey&&h.contains(n,window.galaxy_config.app.default_dbkey)&&e("#new-dbkey").val(window.galaxy_config.app.default_dbkey),e("#new-title").focus(),e("select[name='dbkey']").select2(),e("#overlay").css("overflow","auto")}})}},{key:"template_view_new",value:function(e){for(var t=''}},{key:"init_editor",value:function(){var t=this;e("#center .unified-panel-title").text(this.ui.view.config.get_value("name")+" ("+this.ui.view.dbkey+")"),window.galaxy_config.app.add_dataset&&e.ajax({url:Galaxy.root+"api/datasets/"+window.galaxy_config.app.add_dataset,data:{hda_ldda:"hda",data_type:"track_config"},dataType:"json",success:function(e){t.ui.view.add_drawable(m.default.object_from_template(e,t.ui.view,t.ui.view))}}),e("#add-bookmark-button").click(function(){var e=t.ui.view.chrom+":"+t.ui.view.low+"-"+t.ui.view.high;return t.ui.add_bookmark(e,"Bookmark description",!0)}),this.ui.init_keyboard_nav(this.ui.view),e(window).on("beforeunload",function(){if(t.ui.view.has_changes)return"There are unsaved changes to your visualization that will be lost if you leave this page."})}},{key:"create_browser",value:function(t,i){e(document).trigger("convert_to_values"),this.ui.create_visualization({container:e("#center .unified-panel-body"),name:t,dbkey:i},window.galaxy_config.app.gene_region),this.init_editor(),this.ui.view.editor=!0}}]),i}(p.View);t.default={TracksterUI:M,GalaxyApp:$}}).call(t,i(0))},function(e,t,i){"use strict";(function(e){function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){j[e.attr("id")]=t}function o(t,i,n,a){n=".group",j[t.attr("id")]=a,t.bind("drag",{handle:"."+i,relative:!0},function(t,i){var a,s,o,r,l,d=e(this),c=d.parent(),u=c.children(".track,.group"),h=j[e(this).attr("id")];if(s=e(this).parents(n),0!==s.length){o=s.position().top,r=o+s.outerHeight();var f=j[s.attr("id")];if(i.offsetY
\n Dataset:"+t.config.get_value("name")+'
\n Region(s):\n \n ',n=function(){Galaxy.modal.hide(),e(window).unbind("keypress.check_enter_esc")},a=function(){var i,n=e('select[name="regions"] option:selected').val(),a=new m.default.GenomeRegion({chrom:(void 0).view.chrom,start:(void 0).view.low,end:(void 0).view.high}),s=h.map(e(".bookmark"),function(t){return new m.default.GenomeRegion({from_str:e(t).children(".position").text()})});i="cur"===n?[a]:"bookmarks"===n?s:[a].concat(s),Galaxy.modal.hide(),window.top.location.href=Galaxy.root+"visualization/sweepster?"+e.param({dataset_id:t.dataset.id,hda_ldda:t.dataset.get("hda_ldda"),regions:JSON.stringify(new p.Collection(i).toJSON())})};Galaxy.modal.show({title:"Visualize tool parameter space and output from different parameter settings?",body:i,buttons:{No:n,Yes:a}})}},R.prototype.action_icons_def[2]],can_draw:function(){return this.dataset&&R.prototype.can_draw.call(this)},build_container_div:function(){return e("").addClass("track").attr("id","track_"+this.id)},set_dataset:function(e){this.dataset=e,this.data_manager.set("dataset",e)},on_resize:function(){this.request_draw({clear_tile_cache:!0})},add_resize_handle:function(){var t=this,i=!1,n=!1,a=e(""+t.message+"
",buttons:{Close:function(){Galaxy.modal.hide()}}})})),a.append(e("").text(" ")),a.append(e("").text("Try again").click(function(){i.init(!0)})))}}),this.update_icons(),n}},predraw_init:function(){var t=this;return e.getJSON(t.dataset.url(),{data_type:"data",stats:!0,chrom:t.view.chrom,low:0,high:t.view.max_high,hda_ldda:t.dataset.get("hda_ldda")},function(e){var i=e.data;if(i&&void 0!==i.min&&void 0!==i.max){var n=i.min,a=i.max;n=Math.floor(Math.min(0,Math.max(n,i.mean-2*i.sd))),a=Math.ceil(Math.max(0,Math.min(a,i.mean+2*i.sd))),t.config.set_default_value("min_value",n),t.config.set_default_value("max_value",a),t.config.set_value("min_value",n),t.config.set_value("max_value",a)}})},get_drawables:function(){return this}});var K=function(t,i,n){X.call(this,t,i,n);var a=this;if(o(a.container_div,a.drag_handle_class,".group",a),this.filters_manager=new T.default.FiltersManager(this,"filters"in n?n.filters:null),this.data_manager.set("filters_manager",this.filters_manager),this.filters_available=!1,this.tool=n.tool?new F(h.extend(n.tool,{track:this,tool_state:n.tool_state})):null,this.tile_cache=new m.default.Cache(10),this.left_offset=0,this.header_div&&(this.set_filters_manager(this.filters_manager),this.tool)){var s=new q({model:this.tool});s.render(),this.dynamic_tool_div=s.$el,this.header_div.after(this.dynamic_tool_div)}this.tiles_div=e("").addClass("tiles").appendTo(this.content_div),this.config.get_value("content_visible")||this.tiles_div.hide(),this.overlay_div=e("").addClass("overlay").appendTo(this.content_div),n.mode&&this.change_mode(n.mode)};I(K.prototype,R.prototype,X.prototype,{action_icons_def:X.prototype.action_icons_def.concat([{name:"show_more_rows_icon",title:"To minimize track height, not all feature rows are displayed. Click to display more rows.",css_class:"exclamation",on_click_fn:function(t){e(".tooltip").remove(),t.slotters[t.view.resolution_px_b].max_rows*=2,t.request_draw({clear_tile_cache:!0})},hide:!0}]),copy:function(e){var t=this.to_dict();I(t,{data_manager:this.data_manager});var i=new this.constructor(this.view,e,t);return i.change_mode(this.mode),i.enabled=this.enabled,i},set_filters_manager:function(e){this.filters_manager=e,this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),dataset:{id:this.dataset.id,hda_ldda:this.dataset.get("hda_ldda")},prefs:this.config.to_key_value_dict(),mode:this.mode,filters:this.filters_manager.to_dict(),tool_state:this.tool?this.tool.state_dict():{}}},set_min_max:function(){var t=this;return e.getJSON(t.dataset.url(),{data_type:"data",stats:!0,chrom:t.view.chrom,low:0,high:t.view.max_high,hda_ldda:t.dataset.get("hda_ldda")},function(e){var i=e.data;if(isNaN(parseFloat(t.config.get_value("min_value")))||isNaN(parseFloat(t.config.get_value("max_value")))){var n=i.min,a=i.max;n=Math.floor(Math.min(0,Math.max(n,i.mean-2*i.sd))),a=Math.ceil(Math.max(0,Math.min(a,i.mean+2*i.sd))),t.config.set_value("min_value",n),t.config.set_value("max_value",a)}})},change_mode:function(e){var t=this;return t.mode=e,t.config.set_value("mode",e),"Auto"===e&&this.data_manager.clear(),t.request_draw({clear_tile_cache:!0}),this.action_icons.mode_icon.attr("title","Set display mode (now: "+t.mode+")"),t},update_icons:function(){var e=this;e.action_icons.filters_icon.toggle(e.filters_available),e.action_icons.tools_icon.toggle(null!==e.tool),e.action_icons.param_space_viz_icon.toggle(null!==e.tool)},_gen_tile_cache_key:function(e,t){return e+"_"+t},request_draw:function(e){e&&e.clear_tile_cache&&this.tile_cache.clear(),this.view.request_redraw(e,this)},before_draw:function(){this.max_height_px=0},_draw:function(t){var i=this;if(this.can_draw()){var n=t&&t.clear_after,a=this.view.low,s=this.view.high,o=this.view.container.width(),r=this.view.resolution_px_b,l=1/r;this.is_overview&&(a=this.view.max_low,s=this.view.max_high,r=o/(this.view.max_high-this.view.max_low),l=1/r),this.before_draw(),this.tiles_div.children().addClass("remove");for(var d,c,u=Math.floor(400*l),f=Math.floor(a/u),p=[],_=[];f*u").text(d).make_text_editable({num_cols:12,on_finish:function(t){e(".tooltip").remove(),this.config.set_value(o,r(t,1)),i()},help_text:"Set "+s+" value"}).addClass("yaxislabel "+a).css("color",this.config.get_value("label_color")),this.container_div.prepend(l))},postdraw_actions:function(e,t,i,n){var a=this;h.filter(e,function(e){return e instanceof J}).length>0?(this.max_height_px=0,h.each(e,function(e){e instanceof J||(e.html_elt.remove(),a.draw_helper(e.region,i,{force:!0,mode:"Coverage"}))}),this._add_yaxis_label("max")):(this.container_div.find(".yaxislabel").remove(),h.find(e,function(e){return e.has_icons})&&h.each(e,function(e){e.has_icons||e.html_elt.css("padding-top",20)}))},get_mode:function(e){return this.mode},update_auto_mode:function(e){},_get_drawables:function(){return[this]},draw_helper:function(t,i,n){var a=this;n||(n={});var s=n.force,o=n.mode||this.mode,r=1/i,l=this._get_drawables(),d=this._gen_tile_cache_key(i,t),c=s?void 0:this.tile_cache.get_elt(d);if(c)return function(e){return e&&"track"in e}(c)&&this.show_tile(c,i),c;if(!1===n.data_fetch)return null;var u=function(){var e=h.find(G,function(e){return e===o})?"Coverage":o,i=h.map(l,function(i){return i.data_manager.get_data(t,e,r,a.data_url_extra_params)});return a.view.reference_track&&i.push(a.view.reference_track.data_manager.get_data(t,o,r,a.view.reference_track.data_url_extra_params)),i},f=e.Deferred();return this.tile_cache.set_elt(d,f),e.when.apply(e,u()).then(function(){var s,o=u(),r=o;if(h.find(o,function(e){return y.default.is_deferred(e)}))return a.tile_cache.set_elt(d,void 0),void e.when(a.draw_helper(t,i,n)).then(function(e){f.resolve(e)});a.view.reference_track&&(s=a.view.reference_track.data_manager.subset_entry(o.pop(),t));var c=[],p=[];h.each(l,function(e,t){var n=r[t];"Auto"===e.mode&&(e.mode=e.get_mode(n),e.update_auto_mode(e.mode)),c.push(e.mode),p.push(e.get_canvas_height(n,e.mode,i,w))});var _,m=a.view.canvas_manager.new_canvas(),g=t.get("start"),v=t.get("end"),w=Math.ceil((v-g)*i)+a.left_offset,b=h.max(p);m.width=w,m.height=n.height||b;var x=m.getContext("2d");x.translate(a.left_offset,0),l.length>1&&(x.globalAlpha=.5,x.globalCompositeOperation="source-over"),h.each(l,function(e,n){_=e.draw_tile(r[n],x,c[n],t,i,s)}),void 0!==_&&(a.tile_cache.set_elt(d,_),a.show_tile(_,i)),f.resolve(_)}),f},get_canvas_height:function(e,t,i,n){return this.visible_height_px},_draw_line_track_tile:function(e,t,i,n,a){-1!==[void 0,null].indexOf(this.config.get_value("min_value"))&&this.config.set_value("min_value",0),-1!==[void 0,null,0].indexOf(this.config.get_value("max_value"))&&this.config.set_value("max_value",h.max(h.map(e.data,function(e){return e[1]}))||0);var s=t.canvas;return new C.default.LinePainter(e.data,n.get("start"),n.get("end"),this.config.to_key_value_dict(),i).draw(t,s.width,s.height,a),new J(this,n,a,s,e.data)},draw_tile:function(e,t,i,n,a,s){},show_tile:function(e,t){var i=e.html_elt;e.predisplay_actions();var n=Math.round((e.low-(this.is_overview?this.view.max_low:this.view.low))*t);this.left_offset&&(n-=this.left_offset),i.css("left",n),i.hasClass("remove")?i.removeClass("remove"):this.tiles_div.append(i),i.css("height","auto"),this.max_height_px=Math.max(this.max_height_px,i.height()-2),i.parent().children().css("height",this.max_height_px+"px");var a=this.max_height_px;0!==this.visible_height_px&&(a=Math.min(this.max_height_px,this.visible_height_px)),this.tiles_div.css("height",a+"px")},tool_region_and_parameters_str:function(e){var t=this;return" - region=["+(void 0!==e?e.toString():"all")+"], parameters=["+h.values(t.tool.get_inputs_dict()).join(", ")+"]"},data_and_mode_compatible:function(e,t){return"Auto"===t||("Coverage"===t?"bigwig"===e.dataset_type:"bigwig"!==e.dataset_type&&"no_detail"!==e.extra_info)},can_subset:function(e){return!e.message&&"no_detail"!==e.extra_info&&("bigwig"!==e.dataset_type||e.data[1][0]-e.data[0][0]==1)},init_for_tool_data:function(){this.data_manager.set("data_type","raw_data"),this.data_query_wait=1e3,this.dataset_check_type="state"}});var Q=function(e,t){X.call(this,e,t,{resize:!1,header:!1}),this.container_div.addClass("label-track")};I(Q.prototype,X.prototype,{init:function(){this.enabled=!0},predraw_init:function(){},_draw:function(t){for(var i=this.view,n=i.high-i.low,a=Math.floor(Math.pow(10,Math.floor(Math.log(n)/Math.log(10)))),s=Math.floor(i.low/a)*a,o=this.view.container.width(),r=e("").addClass("label-container");s
");this.tiles_div.prepend(e("").html(l).addClass("yaxislabel variant top sample").css({top:this.config.get_value("summary_height")}))}r=("Squish"===this.mode?5:10)+"px",e(this.tiles_div).find(".sample").css({"font-size":r,"line-height":r}),e(this.tiles_div).find(".yaxislabel").css("color",this.config.get_value("label_color"))}else this.container_div.find(".yaxislabel.variant").remove()}});var se=function(e,t,i){ne.call(this,e,t,i),this.painter=C.default.ReadPainter,this.update_icons()};I(se.prototype,R.prototype,K.prototype,ne.prototype,{build_config_params:function(){return h.union(R.prototype.config_params,[{key:"block_color",label:"Histogram color",type:"color"},{key:"detail_block_color",label:"Sense strand block color",type:"color",default_value:"#AAAAAA"},{key:"reverse_strand_color",label:"Antisense strand block color",type:"color",default_value:"#DDDDDD"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:!1},{key:"show_differences",label:"Show differences only",type:"bool",default_value:!0},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:!0},{key:"mode",type:"string",default_value:this.mode,hidden:!0},{key:"min_value",label:"Histogram minimum",type:"float",default_value:void 0,help:"clear value to set automatically"},{key:"max_value",label:"Histogram maximum",type:"float",default_value:void 0,help:"clear value to set automatically"},{key:"height",type:"int",default_value:0,hidden:!0}])},config_onchange:function(){this.set_name(this.config.get_value("name")),this.request_draw({clear_tile_cache:!0})}});var oe={CompositeTrack:Z,DrawableGroup:V,DiagonalHeatmapTrack:ie,FeatureTrack:ne,LineTrack:te,ReadTrack:se,VariantTrack:ae,VcfTrack:ae},re=function(e,t,i){if("copy"in e)return e.copy(i);var n=e.obj_type;return n||(n=e.track_type),new oe[n](t,i,e)};t.default={TracksterView:H,DrawableGroup:V,LineTrack:te,FeatureTrack:ne,DiagonalHeatmapTrack:ie,ReadTrack:se,VariantTrack:ae,CompositeTrack:Z,object_from_template:re}}).call(t,i(0))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(5),d=s(l),c=i(10),u=s(c),h=i(17),f=s(h),p=i(55),_=s(p),m=i(25),g=s(m),v=e.View.extend({initialize:function(e){var t=this;this.modal=parent.Galaxy.modal||new f.default.View,this.form=new _.default(d.default.merge({listen_to_history:!0,always_refresh:!1,buildmodel:function(e,i){var a=i.model.attributes,s="",o={},l=a.job_id;l?s=Galaxy.root+"api/jobs/"+l+"/build_for_rerun":(s=Galaxy.root+"api/tools/"+a.id+"/build",o=n.extend({},Galaxy.params),o.tool_id&&delete o.tool_id),a.version&&(o.tool_version=a.version),d.default.get({url:s,data:o,success:function(n){if(!n.display)return void(window.location=Galaxy.root);i.model.set(n),t._customize(i),Galaxy.emit.debug("tool-form-base::_buildModel()","Initial tool model ready.",n),e.resolve()},error:function(t,s){var o=t&&t.err_msg||"Uncaught error.";401==s?window.location=Galaxy.root+"user/login?"+n.param({redirect:Galaxy.root+"?tool_id="+a.id}):i.$el.is(":empty")?i.$el.prepend(new u.default.Message({message:o,status:"danger",persistent:!0,large:!0}).$el):Galaxy.modal&&Galaxy.modal.show({title:(0,r.default)("Tool request failed"),body:o,buttons:{Close:function(){Galaxy.modal.hide()}}}),Galaxy.emit.debug("tool-form-base::_buildModel()","Initial tool model request failed.",t),e.reject()}})},postchange:function(e,t){var i={tool_id:t.model.get("id"),tool_version:t.model.get("version"),inputs:n.extend(!0,{},t.data.create())};t.wait(!0),Galaxy.emit.debug("tool-form::postchange()","Sending current state.",i),d.default.request({type:"POST",url:Galaxy.root+"api/tools/"+t.model.get("id")+"/build",data:i,success:function(i){t.update(i),t.wait(!1),Galaxy.emit.debug("tool-form::postchange()","Received new model.",i),e.resolve()},error:function(t){Galaxy.emit.debug("tool-form::postchange()","Refresh request failed.",t),e.reject()}})}},e)),this.deferred=this.form.deferred,this.setElement(""),this.$el.append(this.form.$el)},_customize:function(e){var t=this,i=e.model.attributes,n=new u.default.Button({icon:"fa-check",tooltip:"Execute: "+i.name+" ("+i.version+")",title:(0,r.default)("Execute"),cls:"btn btn-primary ui-clear-float",wait_cls:"btn btn-info ui-clear-float",onclick:function(){n.wait(),e.portlet.disable(),t.submit(i,function(){n.unwait(),e.portlet.enable()})}});if(i.buttons={execute:n},i.job_id&&i.job_remap){if("job_produced_collection_elements"===i.job_remap)var a="Replace elements in collection ?",s="The previous run of this tool failed. Use this option to replace the failed element(s) in the dataset collectio that were produced during the previous tool run.";else var a="Resume dependencies from this job ?",s="The previous run of this tool failed and other tools were waiting for it to finish successfully. Use this option to resume those tools using the new output(s) of this tool run.";i.inputs.push({label:a,name:"rerun_remap_job_id",type:"select",display:"radio",ignore:"__ignore__",value:"__ignore__",options:[["Yes",i.job_id],["No","__ignore__"]],help:s})}var o={};Galaxy.user.attributes.preferences&&"extra_user_preferences"in Galaxy.user.attributes.preferences&&(o=JSON.parse(Galaxy.user.attributes.preferences.extra_user_preferences)),"true"===("use_cached_job|use_cached_job_checkbox"in o&&o["use_cached_job|use_cached_job_checkbox"])&&i.inputs.push({label:"BETA: Attempt to re-use jobs with identical parameters ?",help:"This may skip executing jobs that you have already run",name:"use_cached_job",type:"select",display:"radio",ignore:"__ignore__",value:"__ignore__",options:[["No",!1],["Yes",!0]]})},submit:function(e,t){var i=this,s={tool_id:e.id,tool_version:e.version,inputs:this.form.data.create()};if(this.form.trigger("reset"),!i.validate(s))return Galaxy.emit.debug("tool-form::submit()","Submission canceled. Validation failed."),void(t&&t());if(e.action!==Galaxy.root+"tool_runner/index"){var o=n("").attr({action:e.action,method:e.method,enctype:e.enctype});return a.each(s.inputs,function(e,t){o.append(n("").attr({name:t,value:e}))}),o.hide().appendTo("body").submit().remove(),void(t&&t())}Galaxy.emit.debug("tool-form::submit()","Validation complete.",s),d.default.request({type:"POST",url:Galaxy.root+"api/tools",data:s,success:function(e){if(t&&t(),i.$el.children().hide(),i.$el.append(i._templateSuccess(e)),e.jobs&&e.jobs.length>0){i.$el.append(n("",{id:"webhook-view"}));new g.default.WebhookView({type:"tool",toolId:s.tool_id})}parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents()},error:function(e){t&&t(),Galaxy.emit.debug("tool-form::submit","Submission failed.",e);var n=!1;if(e&&e.err_data){var a=i.form.data.matchResponse(e.err_data);for(var o in a){i.form.highlight(o,a[o]),n=!0;break}}n||i.modal.show({title:(0,r.default)("Job submission failed"),body:i._templateError(s,e&&e.err_msg),buttons:{Close:function(){i.modal.hide()}}})}})},validate:function(e){var t=this,i=e.inputs,n=-1,a=null;for(var s in i){var o=i[s],r=this.form.data.match(s),l=this.form.field_list[r],d=this.form.input_list[r];if(r&&d&&l){if(!d.optional&&null==o)return this.form.highlight(r),!1;if(l.validate){var c=function(){t.form.trigger("reset")},u=l.validate(c);if(!u.valid)return this.form.highlight(r,u.message),!1}if(o&&o.batch){var h=o.values.length,f=h>0&&o.values[0]&&o.values[0].src;if(f)if(null===a)a=f;else if(a!==f)return this.form.highlight(r,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(-1===n)n=h;else if(n!==h)return this.form.highlight(r,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains "+h+" selection(s) while a previous field contains "+n+"."),!1}}else Galaxy.emit.debug("tool-form::validate()","Retrieving input objects failed.")}return!0},_templateSuccess:function(e){if(e.jobs&&e.jobs.length>0){var t=e.jobs.length,i=1==t?"1 job has":t+" jobs have",s=n("").addClass("donemessagelarge").append(n("").text(i+" been successfully added to the queue - resulting in the following datasets:"));return a.each(e.outputs,function(e){s.append(n("").addClass("messagerow").append(n("").text(e.hid+": "+e.name)))}),s.append(n("").append("").text("You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered.")),s}return this._templateError(e,"Invalid success response. No jobs found.")},_templateError:function(e,t){return n("").addClass("errormessagelarge").append(n("").text("The server could not complete the request. Please contact the Galaxy Team if this error persists. "+(t||""))).append(n("").text(JSON.stringify(e,null,4)))}});t.default={View:v}}).call(t,i(2),i(0),i(1))},,,function(e,t,i){"use strict";function n(e){i(88)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(43),s=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);var r=i(136),l=i(23),d=n,c=Object(l.a)(s.a,r.a,r.b,!1,d,null,null);t.default=c.exports},function(e,t,i){"use strict";(function(e,n,a,s){function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(6),l=o(r),d=i(3),c=(o(d),e.View.extend(l.default.LoggableMixin).extend({_logNamespace:"list",initialize:function(e){this.expanded=e.expanded||!1,this.log("\t expanded:",this.expanded),this.fxSpeed=void 0!==e.fxSpeed?e.fxSpeed:this.fxSpeed},fxSpeed:"fast",render:function(e){var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){var e=n(this.templates.el(this.model.toJSON(),this));return this.expanded&&this.$details(e).replaceWith(this._renderDetails().show()),e},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;0===t?(i._swapNewRender(e),i.trigger("rendered",i)):n(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",a.isFunction(this.className)?this.className():this.className).append(e.children())},_setUpBehaviors:function(e){e=e||this.$el,e.find("[title]").tooltip({placement:"bottom"})},$details:function(e){return e=e||this.$el,e.find("> .details")},_renderDetails:function(){var e=n(this.templates.details(this.model.toJSON(),this));return this._setUpBehaviors(e),e},toggleExpanded:function(e){return e=void 0===e?!this.expanded:e,e?this.expand():this.collapse(),this},expand:function(){var e=this;return e._fetchModelDetails().always(function(){e._expand()})},_fetchModelDetails:function(){return this.model.hasDetails()?s.when():this.model.fetch()},_expand:function(){var e=this,t=e._renderDetails();e.$details().replaceWith(t),e.expanded=!0,e.$details().slideDown(e.fxSpeed,function(){e.trigger("expanded",e)})},collapse:function(){this.debug(this+"(ExpandableView).collapse");var e=this;e.expanded=!1,this.$details().slideUp(e.fxSpeed,function(){e.trigger("collapsed",e)})}})),u=c.extend(l.default.mixin(l.default.SelectableViewMixin,l.default.DraggableViewMixin,{tagName:"div",className:"list-item",initialize:function(e){c.prototype.initialize.call(this,e),l.default.SelectableViewMixin.initialize.call(this,e),l.default.DraggableViewMixin.initialize.call(this,e),this._setUpListeners()},_setUpListeners:function(){return this.on("selectable",function(e){e?this.$(".primary-actions").hide():this.$(".primary-actions").show()},this),this},_buildNewRender:function(){var e=c.prototype._buildNewRender.call(this);return e.children(".warnings").replaceWith(this._renderWarnings()),e.children(".title-bar").replaceWith(this._renderTitleBar()),e.children(".primary-actions").append(this._renderPrimaryActions()),e.find("> .title-bar .subtitle").replaceWith(this._renderSubtitle()),e},_swapNewRender:function(e){return c.prototype._swapNewRender.call(this,e),this.selectable&&this.showSelector(0),this.draggable&&this.draggableOn(),this.$el},_renderWarnings:function(){var e=this,t=n(''),i=e.model.toJSON();return a.each(e.templates.warnings,function(a){t.append(n(a(i,e)))}),t},_renderTitleBar:function(){return n(this.templates.titleBar(this.model.toJSON(),this))},_renderPrimaryActions:function(){return[]},_renderSubtitle:function(){return n(this.templates.subtitle(this.model.toJSON(),this))},events:{"click .title-bar":"_clickTitleBar","keydown .title-bar":"_keyDownTitleBar","click .selector":"toggleSelect"},_clickTitleBar:function(e){e.stopPropagation(),e.altKey?(this.toggleSelect(e),this.selectable||this.showSelector()):this.toggleExpanded()},_keyDownTitleBar:function(e){return!e||"keydown"!==e.type||32!==e.keyCode&&13!==e.keyCode||(this.toggleExpanded(),e.stopPropagation(),!1)},toString:function(){return"ListItemView("+(this.model?""+this.model:"(no model)")+")"}}));u.prototype.templates=function(){return{el:l.default.wrapTemplate([''),i.join(" ")},tagsToCSV:function(){var e=this,t=this.model.get("tags");return!n.isArray(t)||n.isEmpty(t)?"":t.map(function(t){return n.escape(e._nameToHash(t))}).sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){var e=this;return n.map(Galaxy.user.get("tags_used"),e._nameToHash)},_setUpBehaviors:function(){var e=this;this.$input().on("change",function(t){t.val=n.map(t.val,e._hashToName),e.model.save({tags:t.val}),t.added&&e._addNewTagToTagsUsed(""+t.added.text)})},_addNewTagToTagsUsed:function(e){var t=Galaxy.user.get("tags_used");n.contains(t,e)||(t.push(e),t.sort(),Galaxy.user.set("tags_used",t))},remove:function(){this.$input.off(),this.stopListening(this.model),e.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",""+this.model,")"].join("")}});t.default={TagsEditor:d}}).call(t,i(2),i(1))},,function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function s(e,t){return this._init(e||{},t||{})}Object.defineProperty(t,"__esModule",{value:!0});var o=i(1),r=a(o),l=i(2),d=a(l),c=i(6),u=n(c),h=i(60),f=n(h),p=i(72),_=n(p),m=i(71),g=n(m),v=i(3),w=n(v);(0,g.default)(s,"GalaxyApp");var y="galaxy:debug:namespaces",b=!1;try{b="true"==localStorage.getItem("galaxy:debug")}catch(e){console.log((0,w.default)("localStorage not available for debug flag retrieval"))}s.prototype._init=function(e,t){var i=this;return r.extend(i,d.Events),b&&(i.logger=console,console.debug("debugging galaxy:","options:",e,"bootstrapped:",t)),i._processOptions(e),i.root=e.root||"/",i.params=e.params||{},i.session_csrf_token=e.session_csrf_token||null,i._initConfig(e.config||{}),i._patchGalaxy(window.Galaxy),i._initLogger(i.options.loggerOptions||{}),i.debug("GalaxyApp.options: ",i.options),i.debug("GalaxyApp.config: ",i.config),i.debug("GalaxyApp.logger: ",i.logger),i._initLocale(),i.debug("GalaxyApp.localize: ",i.localize),i.config=e.config||{},i.debug("GalaxyApp.config: ",i.config),i._initUser(e.user||{}),i.debug("GalaxyApp.user: ",i.user),i._initUserLocale(),i.debug("currentLocale: ",sessionStorage.getItem("currentLocale")),i._setUpListeners(),i.trigger("ready",i),i},s.prototype.defaultOptions={patchExisting:!0,root:"/",session_csrf_token:null},s.prototype._processOptions=function(e){var t=this,i=t.defaultOptions;t.options={};for(var n in i)i.hasOwnProperty(n)&&(t.options[n]=e.hasOwnProperty(n)?e[n]:i[n]);return t},s.prototype._initConfig=function(e){var t=this;return t.config=e,t.config.debug=b||t.config.debug,t},s.prototype._patchGalaxy=function(e){var t=this;if(t.options.patchExisting&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},s.prototype._initLogger=function(e){var t=this;if(t.config.debug){e.consoleLogger=e.consoleLogger||console,e.consoleLevel=e.consoleLevel||_.default.MetricsLogger.ALL;try{e.consoleNamespaceWhitelist=localStorage.getItem(y).split(",")}catch(e){}try{e.consoleFlattenMessages="true"==localStorage.getItem("galaxy:debug:flatten")}catch(e){}console.log(e.consoleFlattenMessages)}return t.logger=new _.default.MetricsLogger(e),t.emit={},["log","debug","info","warn","error","metric"].map(function(e){t.emit[e]=function(i){t.logger.emit(e,arguments[0],Array.prototype.slice.call(arguments,1))}}),t.config.debug&&(u.default.LoggableMixin.logger=t.logger),t},s.prototype._initLocale=function(e){var t=this;return t.debug("_initLocale:",e),t.localize=w.default,window._l=t.localize,t},s.prototype._initUserLocale=function(e){var t=this,i=!!t.config.default_locale&&t.config.default_locale.toLowerCase(),n={};t.user&&t.user.attributes.preferences&&"extra_user_preferences"in t.user.attributes.preferences&&(n=JSON.parse(t.user.attributes.preferences.extra_user_preferences));var a="localization|locale"in n&&n["localization|locale"].toLowerCase();"auto"==a&&(a=!1);var s="undefined"==typeof navigator?"__root":(navigator.language||navigator.userLanguage||"__root").toLowerCase(),o=a||i||s;sessionStorage.setItem("currentLocale",o)},s.prototype._initUser=function(e){var t=this;return t.debug("_initUser:",e),t.user=new f.default.User(e),t.user.logger=t.logger,t},s.prototype._setUpListeners=function(){var t=this;return t.lastAjax={},e(document).bind("ajaxSend",function(e,i,n){var a=n.data;try{a=JSON.parse(a)}catch(e){}t.lastAjax={url:location.href.slice(0,-1)+n.url,data:a}}),t},s.prototype.debugging=function(e){var t=this;try{if(void 0===e)return"true"===localStorage.getItem("galaxy:debug");if(e)return localStorage.setItem("galaxy:debug",!0),!0;localStorage.removeItem("galaxy:debug"),t.debuggingNamespaces(null)}catch(e){console.log((0,w.default)("localStorage not available for debug flag retrieval"))}return!1},s.prototype.debuggingNamespaces=function(e){var t=this;try{if(void 0===e){var i=localStorage.getItem(y);return"string"==typeof i?i.split(","):[]}null===e?localStorage.removeItem(y):localStorage.setItem(y,e);var n=t.debuggingNamespaces();return t.logger&&(t.logger.options.consoleNamespaceWhitelist=n),n}catch(e){console.log((0,w.default)("localStorage not available for debug namespace retrieval"))}},s.prototype.toString=function(){return"GalaxyApp("+(this.user?this.user.get("email")||"(anonymous)":"uninitialized")+")"},window.Galaxy=window.Galaxy||new s,t.default={GalaxyApp:s}}).call(t,i(0))},,function(e,t,i){"use strict";(function(e){function i(e){e=e||{};var t=this;return t.userId=window.bootstrapped&&window.bootstrapped.user?window.bootstrapped.user.id:null,t.userId=t.userId||e.userId||null,t.consoleLogger=e.consoleLogger||null,t._init(e),t}function n(e){var t=String(e);return"[object Object]"==t&&(t=JSON.stringify(e)),t}function a(e){return this._init(e||{})}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i.ALL=0,i.LOG=0,i.DEBUG=10,i.INFO=20,i.WARN=30,i.ERROR=40,i.METRIC=50,i.NONE=100,i.defaultOptions={logLevel:i.NONE,consoleLevel:i.NONE,defaultNamespace:"Galaxy",consoleNamespaceWhitelist:null,consoleFlattenMessages:!1,clientPrefix:"client.",maxCacheSize:3e3,postSize:1e3,addTime:!0,cacheKeyPrefix:"logs-",postUrl:"/api/metrics",delayPostInMs:6e5,getPingData:void 0,onServerResponse:void 0},i.prototype._init=function(e){var t=this;t.options={};for(var n in i.defaultOptions)i.defaultOptions.hasOwnProperty(n)&&(t.options[n]=e.hasOwnProperty(n)?e[n]:i.defaultOptions[n]);return t.options.logLevel=t._parseLevel(t.options.logLevel),t.options.consoleLevel=t._parseLevel(t.options.consoleLevel),t._sending=!1,t._waiting=null,t._postSize=t.options.postSize,t._initCache(),t},i.prototype._initCache=function(){try{this.cache=new a({maxSize:this.options.maxCacheSize,key:this.options.cacheKeyPrefix+this.userId})}catch(e){this._emitToConsole("warn","MetricsLogger",["Could not intitialize logging cache:",e]),this.options.logLevel=i.NONE}},i.prototype._parseLevel=function(e){var t=void 0===e?"undefined":s(e);if("number"===t)return e;if("string"===t){var n=e.toUpperCase();if(i.hasOwnProperty(n))return i[n]}throw new Error("Unknown log level: "+e)},i.prototype.emit=function(e,t,i){var n=this;return t=t||n.options.defaultNamespace,e&&i?(e=n._parseLevel(e),e>=n.options.logLevel&&n._addToCache(e,t,i),n.consoleLogger&&e>=n.options.consoleLevel&&n._emitToConsole(e,t,i),n):n},i.prototype._addToCache=function(e,t,i){this._emitToConsole("debug","MetricsLogger",["_addToCache:",arguments,this.options.addTime,this.cache.length()]);var n=this;try{n.cache.add(n._buildEntry(e,t,i))>=n._postSize&&n._postCache()}catch(e){n._emitToConsole("warn","MetricsLogger",["Metrics logger could not stringify logArguments:",t,i]),n._emitToConsole("error","MetricsLogger",[e])}return n},i.prototype._buildEntry=function(e,t,i){this._emitToConsole("debug","MetricsLogger",["_buildEntry:",arguments]);var n={level:e,namespace:this.options.clientPrefix+t,args:i};return this.options.addTime&&(n.time=(new Date).toISOString()),n},i.prototype._postCache=function(t){if(t=t||{},this._emitToConsole("info","MetricsLogger",["_postCache",t,this._postSize]),!this.options.postUrl||this._sending)return e.when({});var i=this,n=t.count||i._postSize,a=i.cache.get(n),s=a.length,o="function"==typeof i.options.getPingData?i.options.getPingData():{};return o.metrics=JSON.stringify(a),i._sending=!0,e.post(i.options.postUrl,o).always(function(){i._sending=!1}).fail(function(e,t,n){i._postSize=i.options.maxCacheSize,i.emit("error","MetricsLogger",["_postCache error:",e.readyState,e.status,e.responseJSON||e.responseText])}).done(function(e){"function"==typeof i.options.onServerResponse&&i.options.onServerResponse(e),i.cache.remove(s),i._postSize=i.options.postSize})},i.prototype._delayPost=function(){var e=this;e._waiting=setTimeout(function(){e._waiting=null},e.options.delayPostInMs)},i.prototype._emitToConsole=function(e,t,a){var s=this,o=s.options.consoleNamespaceWhitelist;if(!s.consoleLogger)return s;if(o&&-1===o.indexOf(t))return s;var r=Array.prototype.slice.call(a,0);return r.unshift(t),s.options.consoleFlattenMessages&&(r=[r.map(n).join(" ")]),e>=i.METRIC&&"function"==typeof s.consoleLogger.info?s.consoleLogger.info.apply(s.consoleLogger,r):e>=i.ERROR&&"function"==typeof s.consoleLogger.error?s.consoleLogger.error.apply(s.consoleLogger,r):(e>=i.WARN&&"function"==typeof s.consoleLogger.warn?s.consoleLogger.warn.apply(s.consoleLogger,r):e>=i.INFO&&"function"==typeof s.consoleLogger.info?s.consoleLogger.info.apply(s.consoleLogger,r):e>=i.DEBUG&&"function"==typeof s.consoleLogger.debug?s.consoleLogger.debug.apply(s.consoleLogger,r):"function"==typeof s.consoleLogger.log&&s.consoleLogger.log.apply(s.consoleLogger,r),s)},i.prototype.log=function(){this.emit(1,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.debug=function(){this.emit(i.DEBUG,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.info=function(){this.emit(i.INFO,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.warn=function(){this.emit(i.WARN,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.error=function(){this.emit(i.ERROR,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},i.prototype.metric=function(){this.emit(i.METRIC,this.options.defaultNamespace,Array.prototype.slice.call(arguments,0))},a.defaultOptions={maxSize:5e3},a.prototype._init=function(e){if(!this._hasStorage())throw new Error("LoggingCache needs localStorage");if(!e.key)throw new Error("LoggingCache needs key for localStorage");return this.key=e.key,this._initStorage(),this.maxSize=e.maxSize||a.defaultOptions.maxSize,this},a.prototype._hasStorage=function(){try{return localStorage.setItem("test","test"),localStorage.removeItem("test"),!0}catch(e){return!1}},a.prototype._initStorage=function(){return null===localStorage.getItem(this.key)?this.empty():this},a.prototype.add=function(e){var t=this,i=t._fetchAndParse(),n=i.length+1-t.maxSize;return n>0&&i.splice(0,n),i.push(e),t._unparseAndStore(i),i.length},a.prototype._fetchAndParse=function(){var e=this;return JSON.parse(localStorage.getItem(e.key))},a.prototype._unparseAndStore=function(e){var t=this;return localStorage.setItem(t.key,JSON.stringify(e))},a.prototype.length=function(){return this._fetchAndParse().length},a.prototype.get=function(e){return this._fetchAndParse().slice(0,e)},a.prototype.remove=function(e){var t=this._fetchAndParse(),i=t.splice(0,e);return this._unparseAndStore(t),i},a.prototype.empty=function(){return localStorage.setItem(this.key,"[]"),this},a.prototype.stringify=function(e){return JSON.stringify(this.get(e))},a.prototype.print=function(){console.log(JSON.stringify(this._fetchAndParse(),null," "))},t.default={MetricsLogger:i,LoggingCache:a}}).call(t,i(0))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(9),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(a),o=i(74),r=n(o),l=i(76),d=n(l),c=i(142),u=n(c),h=s.View.extend({initialize:function(t){var i=this;this.options=t,this.setElement(this._template()),this.$navbarBrandLink=this.$(".navbar-brand"),this.$navbarBrandImage=this.$(".navbar-brand-image"),this.$navbarBrandTitle=this.$(".navbar-brand-title"),this.$navbarTabs=this.$(".navbar-nav"),this.$quoteMeter=this.$(".quota-meter-container"),this.collection=new r.default.Collection,this.collection.on("add",function(e){i.$navbarTabs.append(new r.default.Tab({model:e}).render().$el)}).on("reset",function(){i.$navbarTabs.empty()}).on("dispatch",function(e){i.collection.each(function(t){e(t)})}).fetch(this.options),this.highlight(t.active_view),Galaxy.frame=this.frame=new d.default({collection:this.collection}),Galaxy.quotaMeter=this.quotaMeter=new u.default.UserQuotaMeter({model:Galaxy.user,el:this.$quoteMeter}),e(window).on("click",function(t){var i=e(t.target).closest("a[download]");1==i.length&&(0===e("iframe[id=download]").length&&e("body").append(e("").attr("id","download").hide()),e("iframe[id=download]").attr("src",i.attr("href")),t.preventDefault())}).on("beforeunload",function(){var e="";if(i.collection.each(function(t){var i=t.get("onbeforeunload")&&t.get("onbeforeunload")();i&&(e+=i+" ")}),""!==e)return e})},render:function(){return this.$navbarBrandTitle.html("Galaxy "+(this.options.brand&&"/ "+this.options.brand||"")),this.$navbarBrandLink.attr("href",this.options.logo_url),this.$navbarBrandImage.attr("src",this.options.logo_src),this.quotaMeter.render(),this},highlight:function(e){this.collection.forEach(function(t){t.set("active",t.id==e)})},_template:function(){return'\n '}});t.default={View:h}}).call(t,i(0))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0});var s=i(9),o=a(s),r=i(1),l=a(r),d=i(75),c=i(25),u=n(c),h=i(3),f=n(h),p=i(5),_=n(p),m=o.Collection.extend({model:o.Model.extend({defaults:{visible:!0,target:"_parent"}}),fetch:function(t){t=t||{},this.reset();var i=new d.CommunicationServerView;this.add(i.render()),this.add({id:"analysis",title:(0,f.default)("Analyze Data"),url:"",tooltip:(0,f.default)("Analysis home view")}),this.add({id:"workflow",title:(0,f.default)("Workflow"),tooltip:(0,f.default)("Chain tools into workflows"),disabled:!Galaxy.user.id,url:"workflows/list"}),this.add({id:"visualization",title:(0,f.default)("Visualize"),url:"visualizations/list",tooltip:(0,f.default)("Visualize datasets"),disabled:!Galaxy.user.id,menu:[{title:(0,f.default)("Create Visualization"),url:"visualizations"},{title:(0,f.default)("Interactive Environments"),url:"visualization/gie_list",target:"galaxy_main"},{title:(0,f.default)("Saved Visualizations"),url:"visualizations/list",target:"_frame"}]}),this.add({id:"shared",title:(0,f.default)("Shared Data"),url:"library/index",tooltip:(0,f.default)("Access published resources"),menu:[{title:(0,f.default)("Data Libraries"),url:"library/list"},{title:(0,f.default)("Histories"),url:"histories/list_published"},{title:(0,f.default)("Workflows"),url:"workflows/list_published"},{title:(0,f.default)("Visualizations"),url:"visualizations/list_published"},{title:(0,f.default)("Pages"),url:"pages/list_published"}]}),u.default.load({type:"masthead",callback:function(t){e(document).ready(function(){t.each(function(e){var t=e.toJSON();if(t.activate){var i={id:t.id,icon:t.config.icon,url:t.config.url,tooltip:t.config.tooltip,onclick:t.config.function&&new Function(t.config.function)};Galaxy.page?Galaxy.page.masthead.collection.add(i):Galaxy.masthead&&Galaxy.masthead.collection.add(i),_.default.appendScriptStyle(t)}})})}}),Galaxy.user.get("is_admin")&&this.add({id:"admin",title:(0,f.default)("Admin"),url:"admin",tooltip:(0,f.default)("Administer this Galaxy"),cls:"admin-only"});var n={id:"help",title:(0,f.default)("Help"),tooltip:(0,f.default)("Support, contact, and community"),menu:[{title:(0,f.default)("Support"),url:t.support_url,target:"_blank"},{title:(0,f.default)("Search"),url:t.search_url,target:"_blank"},{title:(0,f.default)("Mailing Lists"),url:t.mailing_lists,target:"_blank"},{title:(0,f.default)("Videos"),url:t.screencasts_url,target:"_blank"},{title:(0,f.default)("Wiki"),url:t.wiki_url,target:"_blank"},{title:(0,f.default)("How to Cite Galaxy"),url:t.citation_url,target:"_blank"},{title:(0,f.default)("Interactive Tours"),url:"tours"}]};t.terms_url&&n.menu.push({title:(0,f.default)("Terms and Conditions"),url:t.terms_url,target:"_blank"}),t.biostar_url&&n.menu.unshift({title:(0,f.default)("Ask a question"),url:"biostar/biostar_question_redirect",target:"_blank"}),t.biostar_url&&n.menu.unshift({title:(0,f.default)("Galaxy Biostar"),url:t.biostar_url_redirect,target:"_blank"}),this.add(n);var a={};return a=Galaxy.user.id?{id:"user",title:(0,f.default)("User"),cls:"loggedin-only",tooltip:(0,f.default)("Account and saved data"),menu:[{title:(0,f.default)("Logged in as")+" "+Galaxy.user.get("email")},{title:(0,f.default)("Preferences"),url:"user"},{title:(0,f.default)("Custom Builds"),url:"custom_builds"},{title:(0,f.default)("Logout"),url:"user/logout?session_csrf_token="+Galaxy.session_csrf_token,target:"_top",divider:!0},{title:(0,f.default)("Saved Datasets"),url:"datasets/list",target:"_top"},{title:(0,f.default)("Saved Histories"),url:"histories/list",target:"_top"},{title:(0,f.default)("Saved Pages"),url:"pages/list",target:"_top"},{title:(0,f.default)("Saved Visualizations"),url:"visualizations/list",target:"_top"}]}:t.allow_user_creation?{id:"user",title:(0,f.default)("Login or Register"),cls:"loggedout-only",tooltip:(0,f.default)("Account registration or login"),menu:[{title:(0,f.default)("Login"),url:"user/login",target:"galaxy_main",noscratchbook:!0},{title:(0,f.default)("Register"),url:"user/create",target:"galaxy_main",noscratchbook:!0}]}:{id:"user",title:(0,f.default)("Login"),cls:"loggedout-only",tooltip:(0,f.default)("Login"),url:"user/login",target:"galaxy_main",noscratchbook:!0},this.add(a),(new e.Deferred).resolve().promise()}}),g=o.View.extend({initialize:function(e){this.model=e.model,this.setElement(this._template()),this.$link=this.$(".nav-link"),this.$note=this.$(".nav-note"),this.$menu=this.$(".dropdown-menu"),this.listenTo(this.model,"change",this.render,this)},events:{"click .nav-link":"_toggleClick"},render:function(){var t=this;return e(".tooltip").remove(),this.$el.removeClass().addClass(this.model.get("disabled")&&"disabled").addClass(this.model.get("active")&&"active").addClass(this.model.get("menu")&&"dropdown").attr("id",this.model.id).css({visibility:this.model.get("visible")&&"visible"||"hidden"}),this.model.set("url",this._formatUrl(this.model.get("url"))),this.$note.html(this.model.get("note")||"").removeClass().addClass("nav-note").addClass(this.model.get("note_cls")).css({display:this.model.get("show_note")&&"block"||"none"}),this.$link.html(this.model.get("title")||"").removeClass().addClass("nav-link").addClass(this.model.get("cls")).addClass(this.model.get("icon")&&"nav-icon fa "+this.model.get("icon")).addClass(this.model.get("menu")&&"dropdown-toggle").addClass(this.model.get("toggle")&&"toggle").attr("target",this.model.get("target")).attr("href",this.model.get("url")).attr("title",this.model.get("tooltip")).tooltip("dispose"),this.model.get("tooltip")&&this.$link.tooltip({placement:"bottom"}),this.model.get("menu")&&this.model.get("show_menu")?(this.$menu.show(),e("#dd-helper").show().off().on("click",function(){e("#dd-helper").hide(),t.model.set("show_menu",!1)})):(this.$menu.hide(),e("#dd-helper").hide()),this.$menu.empty().removeClass(),this.model.get("menu")&&(l.each(this.model.get("menu"),function(i){t.$menu.append(t._buildMenuItem(i)),i.divider&&t.$menu.append(e("").addClass("dropdown-divider"))}),this.$menu.addClass("dropdown-menu"),this.$link.append(e("").addClass("caret"))),this},_buildMenuItem:function(t){var i=this;return t=l.defaults(t||{},{title:"",url:"",target:"_parent",noscratchbook:!1}),t.url=this._formatUrl(t.url),e("").addClass("dropdown-item").attr("href",t.url).attr("target",t.target).html(t.title).on("click",function(e){e.preventDefault(),i.model.set("show_menu",!1),t.onclick?t.onclick():Galaxy.frame.add(t)})},buildLink:function(t,i){return e("").append(e("").attr("href",Galaxy.root+i).html(t)).html()},_toggleClick:function(t){var i=this,n=this.model;t.preventDefault(),e(".tooltip").hide(),n.trigger("dispatch",function(e){n.id!==e.id&&e.get("menu")&&e.set("show_menu",!1)}),n.get("disabled")?(this.$link.popover&&this.$link.popover("dispose"),this.$link.popover({html:!0,placement:"bottom",content:"Please "+this.buildLink("login","user/login?use_panels=True")+" or "+this.buildLink("register","user/create?use_panels=True")+" to use this feature."}).popover("show"),window.setTimeout(function(){i.$link.popover("dispose")},3e3)):n.get("menu")?n.set("show_menu",!0):n.get("onclick")?n.get("onclick")():Galaxy.frame.add(n.attributes)},_formatUrl:function(e){return"string"==typeof e&&-1===e.indexOf("//")&&"/"!=e.charAt(0)?Galaxy.root+e:e},_template:function(){return'\n
\n
\n '+this.grid_table(e)+"\n ",e.info_text&&(t+='\n \n '+this.grid_header(e)+' \n \n \n \n \n \n \n \n "+e.title+"
"}if(e.global_actions){t+='';var n=e.global_actions.length>=3;n&&(t+='
"}return e.insert&&(t+=e.insert),t+=this.grid_filters(e),t+="";e.show_item_checkboxes&&(t+=" "},body:function(t){var i="";0===t.items.length&&(i+='",e.items.length>0&&(t+=''),t+=" ");var i=!0,n=!1,a=void 0;try{for(var s,o=e.columns[Symbol.iterator]();!(i=(s=o.next()).done);i=!0){var r=s.value;r.visible&&(t+='',r.sortable?t+=''+r.label+"":t+=r.label,t+=''+r.extra+" ")}}catch(e){n=!0,a=e}finally{try{!i&&o.return&&o.return()}finally{if(n)throw a}}return t+=" ');var n=!0,a=!1,s=void 0;try{for(var o,r=t.items[Symbol.iterator]();!(n=(o=r.next()).done);n=!0){var l=o.value;i+="No Items ",t.show_item_checkboxes&&(i+=' "}}catch(e){a=!0,s=e}finally{try{!n&&r.return&&r.return()}finally{if(a)throw s}}return i},footer:function(e){var t="";if(e.use_paging&&e.num_pages>1){var i=e.num_page_links,n=e.cur_page_num,a=e.num_pages,s=i/2,o=n-s,r=0;o<=0&&(o=1,r=s-(n-o));var l,d=s+r,c=n+d;c<=a?l=0:(c=a,l=d-(c+1-n)),0!==l&&(o-=l)<1&&(o=1),t+='');var d=!0,c=!1,u=void 0;try{for(var h,f=t.columns[Symbol.iterator]();!(d=(h=f.next()).done);d=!0){var p=h.value;if(p.visible){var _="";p.nowrap&&(_='style="white-space:nowrap;"');var m=l.column_config[p.label],g=m.link,v=m.value,w=m.target;"string"===e.type(v)&&(v=v.replace(/\/\//g,"/"));var y="";p.attach_popup&&(y="grid-"+l.encode_id+"-popup"),i+=" ",p.delayed?i+=' "}}}catch(e){c=!0,u=e}finally{try{!d&&f.return&&f.return()}finally{if(c)throw u}}i+="',e.show_item_checkboxes&&(t+=" '}if(e.show_item_checkboxes){t+='\n "),t+=' Page:',o>1&&(t+='1 ...');for(var u=o;u \n \n \n "}var v=!1,w=!0,y=!1,b=void 0;try{for(var x,k=e.operations[Symbol.iterator]();!(w=(x=k.next()).done);w=!0){if(x.value.global_operation){v=!0;break}}}catch(e){y=!0,b=e}finally{try{!w&&k.return&&k.return()}finally{if(y)throw b}}if(v){t+='\n \n For selected items: \n ';var h=!0,f=!1,p=void 0;try{for(var _,m=e.operations[Symbol.iterator]();!(h=(_=m.next()).done);h=!0){var g=_.value;g.allow_multiple&&(t+=' ')}}catch(e){f=!0,p=e}finally{try{!h&&m.return&&m.return()}finally{if(f)throw p}}t+=" "}return e.legend&&(t+='';var C=!0,S=!1,T=void 0;try{for(var M,$=e.operations[Symbol.iterator]();!(C=(M=$.next()).done);C=!0){var P=M.value;P.global_operation&&(t+=''+P.label+"")}}catch(e){S=!0,T=e}finally{try{!C&&$.return&&$.return()}finally{if(S)throw T}}t+=" "),t},message:function(e){var t=e.status;return-1!=["success","ok"].indexOf(t)&&(t="done"),''+e.legend+" ',m=!0,g=!1,v=void 0;try{for(var w,y=e.columns[Symbol.iterator]();!(m=(w=y.next()).done);m=!0){var b=w.value;"standard"==b.filterable&&(_+=this.grid_column_filter(e,b))}}catch(e){g=!0,v=e}finally{try{!m&&y.return&&y.return()}finally{if(g)throw v}}_+="
",a&&(_+='Advanced Search'),_+=" ';var x=!0,k=!1,C=void 0;try{for(var S,T=e.columns[Symbol.iterator]();!(x=(S=T.next()).done);x=!0){var M=S.value;"advanced"==M.filterable&&(_+=this.grid_column_filter(e,M))}}catch(e){k=!0,C=e}finally{try{!x&&T.return&&T.return()}finally{if(k)throw C}}return _+="Close Advanced Search ";if("advanced"==i.filterable&&(o+=' "},filter_element:function(e,t){return''+(t=a.default.sanitize(t))+''}}}).call(t,i(0))},,function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0});var a=i(1),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(a),o=e.View.extend({className:"track-header",initialize:function(){this.model.config.get("name").on("change:value",this.update_name,this),this.render()},render:function(){this.$el.append(n("").addClass(this.model.drag_handle_class)),this.$el.append(n("").addClass("track-name").text(this.model.config.get_value("name"))),this.action_icons={},this.render_action_icons(),this.$el.dblclick(function(e){e.stopPropagation()}),this.$el.append(n(""))},update_name:function(){this.$el.find(".track-name").text(this.model.config.get_value("name"))},render_action_icons:function(){var e=this;this.icons_div=n("").addClass("track-icons").hide().appendTo(this.$el),s.each(this.model.action_icons_def,function(t){e.add_action_icon(t.name,t.title,t.css_class,t.on_click_fn,t.prepend,t.hide)}),this.set_display_modes(this.model.display_modes)},add_action_icon:function(e,t,i,a,s,o){var r=this;this.action_icons[e]=n("").attr("title",t).addClass("icon-button").addClass(i).tooltip().click(function(){a(r.model)}).appendTo(this.icons_div),o&&this.action_icons[e].hide()},set_display_modes:function(e,t){if(e){this.model.display_modes=e,this.model.mode=t||this.model.config.get_value("mode")||this.model.display_modes[0],this.action_icons.mode_icon.attr("title","Set display mode (now: "+this.mode+")");for(var i=this.model,n={},a=0,s=i.display_modes.length;a'+a+": "),o+='',i.is_text){o+=''}else{o+='';var y=!1;for(var b in t.categorical_filters[s]){var x=t.categorical_filters[s][b],k="",C="";for(var S in x)k=S,C=x[S];y&&(o+=" | "),y=!0;var T=n[s];T&&x[s]&&T==C?o+=''+b+"":o+=''+b+""}o+=""}return o+=" =0?t-=a:i+=a}return[t,i]},_find_slot:function(e){for(var t=e[0],i=e[1],n=0;n<=this.max_rows;n++){var a=!1,s=this.start_end_dct[n];if(void 0!==s)for(var o=0,r=s.length;o