diff --git a/static/maps/mvc/collection/collection-model.js.map b/static/maps/mvc/collection/collection-model.js.map index 8766fc6463e..56604db3b81 100644 --- a/static/maps/mvc/collection/collection-model.js.map +++ b/static/maps/mvc/collection/collection-model.js.map @@ -1 +1 @@ -{"version":3,"file":"collection-model.js","sources":["../../../src/mvc/collection/collection-model.js"],"names":["define","DATASET_MODEL","BASE_MVC","DatasetCollectionElementMixin","defaults","model_class","element_identifier","element_index","element_type","_mergeObject","attributes","_","extend","object","element_id","id","constructor","this","idAttribute","Backbone","Model","apply","arguments","parse","response","DatasetCollectionElement","LoggableMixin","_logNamespace","DCECollection","Collection","model","toString","length","join","DatasetDCE","DatasetAssociation","mixin","url","has","Galaxy","root","get","console","warn","prototype","_downloadQueryParameters","options","debug","call","hasDetails","elements","objStr","DatasetDCECollection","DatasetCollection","SearchableModelMixin","collection_type","deleted","collectionClass","initialize","_createElementsModel","on","log","unset","silent","self","each","element","parent_hdca_id","toJSON","json","inReadyState","populated","isDeletedOrPurged","getVisibleContents","parsed","create_time","Date","update_time","delete","jQuery","when","save","undelete","searchAttributes","idAndName","ListDatasetCollection","PairDatasetCollection","NestedDCDCE","NestedDCDCECollection","NestedPairDCDCE","NestedPairDCDCECollection","ListPairedDatasetCollection","NestedListDCDCE","NestedListDCDCECollection","ListOfListsDatasetCollection"],"mappings":"AAAAA,QACI,4BACA,eACA,sBACD,SAAUC,EAAeC,GAC5B,YAgDA,IAAIC,IAGAC,UACIC,YAAsB,2BACtBC,mBAAsB,KACtBC,cAAsB,KACtBC,aAAsB,MAI1BC,aAAe,SAAUC,GAKrB,MAFAC,GAAEC,OAAQF,EAAYA,EAAWG,QAAUC,WAAYJ,EAAWK,WAC3DL,GAAWG,OACXH,GAIXM,YAAc,SAAUN,GAEpBA,EAAaO,KAAKR,aAAcC,GAChCO,KAAKC,YAAc,aACnBC,SAASC,MAAMC,MAAOJ,KAAMK,YAIhCC,MAAQ,SAAUC,GACd,GAAId,GAAac,CAEjB,OADAd,GAAaO,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AAM,QAQtDyD,EAA4BF,EAAsB5E,QAIlDkB,MAAO2D,EAGP1D,SAAW,WACN,OAAU,6BAA8Bd,KAAKe,OAAQ,KAAMC,KAAM,OAQtE0D,EAA8BtC,EAAkBzC,QAIhD6C,gBAAkBiC,EAGlB3D,SAAW,WACN,OAAU,+BAAgCd,KAAKwB,IAAK,QAAU,KAAMR,KAAM,OAO/E2D,EAAkBP,EAAsBzE,OAAQV,EAASkC,MAAOjC,GAIhEa,YAAc,SAAUN,EAAYoC,GAChC7B,KAAK8B,MAAO,iCAAmCrC,EAAYoC,GAC3D3C,EAA8Ba,YAAYgC,KAAM/B,KAAMP,EAAYoC,IAItEf,SAAW,WACP,GAAIoB,GAAWlC,KAAY,OAAI,GAAKA,KAAKJ,OAAWI,KAAKwB,IAAK,qBAC9D,QAAU,mBAAoBU,EAAQ,KAAMlB,KAAM,QAOtD4D,EAA4BL,EAAsB5E,QAGlDkB,MAAO8D,EAGP7D,SAAW,WACP,OAAU,6BAA8Bd,KAAKe,OAAQ,KAAMC,KAAM,OAOrE6D,EAA+BzC,EAAkBzC,QAGjD6C,gBAAkBoC,EAGlB9D,SAAW,WACP,OAAU,gCAAiCd,KAAKwB,IAAK,QAAU,KAAMR,KAAM,MAM/E,QACIoD,sBAA8BA,EAC9BC,sBAA8BA,EAC9BK,4BAA8BA,EAC9BG,6BAA8BA"} \ No newline at end of file +{"version":3,"file":"collection-model.js","sources":["../../../src/mvc/collection/collection-model.js"],"names":["define","DATASET_MODEL","BASE_MVC","DatasetCollectionElementMixin","defaults","model_class","element_identifier","element_index","element_type","_mergeObject","attributes","_","extend","object","element_id","id","constructor","this","idAttribute","Backbone","Model","apply","arguments","parse","response","DatasetCollectionElement","LoggableMixin","_logNamespace","DCECollection","Collection","model","toString","length","join","DatasetDCE","DatasetAssociation","mixin","url","has","Galaxy","root","get","console","warn","prototype","_downloadQueryParameters","options","debug","call","hasDetails","elements","objStr","DatasetDCECollection","DatasetCollection","SearchableModelMixin","collection_type","deleted","collectionClass","initialize","_createElementsModel","on","log","unset","silent","self","each","element","parent_hdca_id","toJSON","json","inReadyState","populated","isDeletedOrPurged","getVisibleContents","parsed","create_time","Date","update_time","delete","jQuery","when","save","undelete","searchAttributes","idAndName","ListDatasetCollection","PairDatasetCollection","NestedDCDCE","NestedDCDCECollection","NestedPairDCDCE","NestedPairDCDCECollection","ListPairedDatasetCollection","NestedListDCDCE","NestedListDCDCECollection","ListOfListsDatasetCollection"],"mappings":"AAAAA,QACI,4BACA,eACA,sBACD,SAAUC,EAAeC,GAC5B,YAgDA,IAAIC,IAGAC,UACIC,YAAsB,2BACtBC,mBAAsB,KACtBC,cAAsB,KACtBC,aAAsB,MAI1BC,aAAe,SAAUC,GAKrB,MAFAC,GAAEC,OAAQF,EAAYA,EAAWG,QAAUC,WAAYJ,EAAWK,WAC3DL,GAAWG,OACXH,GAIXM,YAAc,SAAUN,GAEpBA,EAAaO,KAAKR,aAAcC,GAChCO,KAAKC,YAAc,aACnBC,SAASC,MAAMC,MAAOJ,KAAMK,YAIhCC,MAAQ,SAAUC,GACd,GAAId,GAAac,CAEjB,OADAd,GAAaO,KAAKR,aAAcC,KAMpCe,EAA2BN,SAASC,MACnCR,OAAQV,EAASwB,eACjBd,OAAQT,GACRS,QAASe,cAAgB,gBAK1BC,EAAgBT,SAASU,WAAWjB,OAAQV,EAASwB,eAAgBd,QAErEe,cAAgB,cAEhBG,MAAOL,EAGPM,SAAW,WACN,OAAU,sCAAuCd,KAAKe,OAAQ,KAAMC,KAAM,OAQ/EC,EAAajC,EAAckC,mBAAmBvB,OAAQV,EAASkC,MAAOjC,GAItEkC,IAAM,WAEF,MAAKpB,MAAKqB,IAAK,cAKRC,OAAOC,KAAO,iBAAmBvB,KAAKwB,IAAK,cAAiB,aAAexB,KAAKwB,IAAK,OAJxFC,QAAQC,KAAM,oDAEPJ,OAAOC,KAAO,iBAK7BpC,SAAWO,EAAEC,UACTX,EAAckC,mBAAmBS,UAAUxC,SAC3CD,EAA8B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KAAMlB,KAAM,QAOtD4D,EAA4BL,EAAsB5E,QAGlDkB,MAAO8D,EAGP7D,SAAW,WACP,OAAU,6BAA8Bd,KAAKe,OAAQ,KAAMC,KAAM,OAOrE6D,EAA+BzC,EAAkBzC,QAGjD6C,gBAAkBoC,EAGlB9D,SAAW,WACP,OAAU,gCAAiCd,KAAKwB,IAAK,QAAU,KAAMR,KAAM,MAM/E,QACIoD,sBAA8BA,EAC9BC,sBAA8BA,EAC9BK,4BAA8BA,EAC9BG,6BAA8BA"} \ No newline at end of file diff --git a/static/scripts/bundled/analysis.bundled.js b/static/scripts/bundled/analysis.bundled.js index d2e78904d82..e67d29d4812 100644 --- a/static/scripts/bundled/analysis.bundled.js +++ b/static/scripts/bundled/analysis.bundled.js @@ -1,7 +1,7 @@ webpackJsonp([3,1],[function(e,t,i){(function(e,t){var n=i(1),s=n,a=i(33).GalaxyApp,o=i(64),r=i(97),l=i(96),c=i(34),d=i(28),h=i(138),u=i(137),p=i(86),f=i(46),g=i(127),m=i(142),v=i(122),_=i(140),y=i(85),w=i(4),b=i(7);window.app=function(i,n){window.Galaxy=new a(i,n),Galaxy.debug("analysis app"),Galaxy.params=Galaxy.config.params;var x=e.View.extend({initialize:function(e){this.message=e.message||"Undefined Message",this.msg_status=e.type||"info",this.render()},render:function(){this.$el.html(t.escape(this.message)).addClass(this.msg_status+"message")}}),C=e.Router.extend({initialize:function(e,t){this.page=e,this.options=t},push:function(e,t){t=t||{},t.__identifer=Math.random().toString(36).substr(2),s.isEmptyObject(t)||(e+=e.indexOf("?")==-1?"?":"&",e+=s.param(t,!0)),this.navigate(e,{trigger:!0})},execute:function(e,t,i){Galaxy.debug("router execute:",e,t,i);var n=o.parse(t.pop());t.push(n),e&&(this.authenticate(t,i)?e.apply(this,t):this.loginRequired())},routes:{"(/)":"home","(/)root*":"home","(/)tours(/)(:tour_id)":"show_tours","(/)user(/)":"show_user","(/)user(/)(:form_id)":"show_user_form","(/)workflow(/)":"show_workflows","(/)workflow/run(/)":"show_run","(/)pages(/)(:action_id)":"show_pages","(/)visualizations/list_published(/)":"show_visualizations","(/)workflows/list_published(/)":"show_workflows_published","(/)histories(/)(:action_id)":"show_histories","(/)datasets(/)list(/)":"show_datasets","(/)workflow/configure_menu(/)":"show_configure_menu","(/)workflow/import_workflow":"show_import_workflow","(/)custom_builds":"show_custom_builds"},require_login:["show_user","show_user_form","show_workflows","show_configure_menu"],loginRequired:function(){this.page.display(new x({type:"error",message:"You must be logged in to make this request."}))},authenticate:function(e,t){return Galaxy.user&&Galaxy.user.id||this.require_login.indexOf(t)==-1},show_tours:function(e){e?p.giveTour(e):this.page.display(new p.ToursView)},show_user:function(){this.page.display(new h.View)},show_user_form:function(e){this.page.display(new h.Forms({form_id:e,user_id:Galaxy.params.id}))},show_visualizations:function(){this.page.display(new f({url_base:Galaxy.root+"visualization/list_published",dict_format:!0}))},show_workflows_published:function(){this.page.display(new f({url_base:Galaxy.root+"workflow/list_published",dict_format:!0}))},show_histories:function(e){this.page.display(new v.View({action_id:e}))},show_datasets:function(){this.page.display(new f({url_base:Galaxy.root+"dataset/list",dict_format:!0}))},show_pages:function(e){"list"==e?this.page.display(new g.View):this.page.display(new f({url_base:Galaxy.root+"page/list_published",dict_format:!0}))},show_workflows:function(){this.page.display(new m.View)},show_run:function(){this._loadWorkflow()},show_import_workflow:function(){this.page.display(new m.ImportWorkflowView)},show_configure_menu:function(){this.page.display(new _.View)},show_custom_builds:function(){var e=this,t=this.page.historyPanel.historyView;return t&&t.model&&t.model.id?void this.page.display(new u.View):void window.setTimeout(function(){e.show_custom_builds()},500)},home:function(e){e.tool_id||e.job_id?"upload1"===e.tool_id?(this.page.toolPanel.upload.show(),this._loadCenterIframe("welcome")):this._loadToolForm(e):e.workflow_id?this._loadWorkflow():e.m_c?this._loadCenterIframe(e.m_c+"/"+e.m_a):this._loadCenterIframe("welcome")},_loadToolForm:function(e){e.id=e.tool_id,this.page.display(new d.View(e))},_loadCenterIframe:function(e,t){t=t||Galaxy.root,e=t+e,this.page.$("#galaxy_main").prop("src",e)},_loadWorkflow:function(){var e=this;w.get({url:Galaxy.root+"api/workflows/"+w.getQueryString("id")+"/download",data:{style:"run"},success:function(t){e.page.display(new y.View(t))},error:function(t){var i="Error occurred while loading the resource.",n={message:i,status:"error",persistent:!0,cls:"errormessage"};e.page.display(new b.Message(n))}})}});s(function(){Galaxy.page=new c.View(t.extend(i,{Left:r,Right:l,Router:C})),e.history.start({root:Galaxy.root,pushState:!0})})}}).call(t,i(3),i(2))},,,,,,,function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(23),i(60),i(22),i(56),i(12),i(8)],s=function(e,t,i,n,s,l,c){var d=a.View.extend({tagName:"label",initialize:function(e){this.model=e&&e.model||new a.Model(e),this.tagName=e.tagName||this.tagName,this.setElement(o("<"+this.tagName+"/>")),this.listenTo(this.model,"change",this.render,this),this.render()},title:function(e){this.model.set("title",e)},value:function(){return this.model.get("title")},render:function(){return this.$el.removeClass().addClass("ui-label").addClass(this.model.get("cls")).html(this.model.get("title")),this}}),h=a.View.extend({initialize:function(e){this.model=e&&e.model||new a.Model({message:null,status:"info",cls:"",persistent:!1,fade:!0}).set(e),this.listenTo(this.model,"change",this.render,this),this.render()},update:function(e){this.model.set(e)},render:function(){this.$el.removeClass().addClass("ui-message").addClass(this.model.get("cls"));var e=this.model.get("status");if(this.model.get("large")?this.$el.addClass(("success"==e&&"done"||"danger"==e&&"error"||e)+"messagelarge"):this.$el.addClass("alert").addClass("alert-"+e),this.model.get("message")){if(this.$el.html(this.messageForDisplay()),this.$el[this.model.get("fade")?"fadeIn":"show"](),this.timeout&&window.clearTimeout(this.timeout),!this.model.get("persistent")){var t=this;this.timeout=window.setTimeout(function(){t.model.set("message","")},3e3)}}else this.$el.fadeOut();return this},messageForDisplay:function(){return r.escape(this.model.get("message"))}}),u=h.extend({messageForDisplay:function(){return this.model.get("message")}}),p=a.View.extend({initialize:function(e){this.model=e&&e.model||new a.Model({type:"text",placeholder:"",disabled:!1,readonly:!1,visible:!0,cls:"",area:!1,color:null,style:null}).set(e),this.tagName=this.model.get("area")?"textarea":"input",this.setElement(o("<"+this.tagName+"/>")),this.listenTo(this.model,"change",this.render,this),this.render()},events:{input:"_onchange"},value:function(e){return void 0!==e&&this.model.set("value","string"==typeof e?e:""),this.model.get("value")},render:function(){var e=this;this.$el.removeClass().addClass("ui-"+this.tagName).addClass(this.model.get("cls")).addClass(this.model.get("style")).attr("id",this.model.id).attr("type",this.model.get("type")).attr("placeholder",this.model.get("placeholder")).css("color",this.model.get("color")||"").css("border-color",this.model.get("color")||"");var t=this.model.get("datalist");return o.isArray(t)&&t.length>0&&this.$el.autocomplete({source:function(t,i){i(e.model.get("datalist"))},change:function(){e._onchange()}}),this.model.get("value")!==this.$el.val()&&this.$el.val(this.model.get("value")),r.each(["readonly","disabled"],function(t){e.model.get(t)?e.$el.attr(t,!0):e.$el.removeAttr(t)}),this.$el[this.model.get("visible")?"show":"hide"](),this},_onchange:function(){this.value(this.$el.val()),this.model.get("onchange")&&this.model.get("onchange")(this.model.get("value"))}}),f=a.View.extend({initialize:function(e){this.model=e&&e.model||new a.Model(e),this.setElement(o("
").append(this.$info=o("
")).append(this.$hidden=o("
"))),this.listenTo(this.model,"change",this.render,this),this.render()},value:function(e){return void 0!==e&&this.model.set("value",e),this.model.get("value")},render:function(){return this.$el.attr("id",this.model.id),this.$hidden.val(this.model.get("value")),this.model.get("info")?this.$info.show().text(this.model.get("info")):this.$info.hide(),this}}),g=a.View.extend({initialize:function(e){var t=this;this.model=e&&e.model||new a.Model(e),this.setElement(o("
").append(this.$info=o("
")).append(this.$file=o("").attr("type","file").addClass("ui-margin-bottom")).append(this.$text=o("',"
","
"].join("")}});return{CitationView:n,CitationListView:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3))},function(e,t,i){var n,s;(function(a,o,r){n=[i(51),i(41),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=e.FoldoutListItemView,l=e.ListItemView,c=s.extend({className:s.prototype.className+" dataset-collection",id:function(){return["dataset_collection",this.model.get("id")].join("-")},initialize:function(e){this.linkTarget=e.linkTarget||"_blank",this.hasUser=e.hasUser,s.prototype.initialize.call(this,e)},_setUpListeners:function(){s.prototype._setUpListeners.call(this),this.listenTo(this.model,"change",function(e,t){a.has(e.changed,"deleted")?this.render():a.has(e.changed,"element_count")&&this.$("> .title-bar .subtitle").replaceWith(this._renderSubtitle())})},_renderSubtitle:function(){return o(this.templates.subtitle(this.model.toJSON(),this))},_getFoldoutPanelOptions:function(){var e=s.prototype._getFoldoutPanelOptions.call(this);return a.extend(e,{linkTarget:this.linkTarget,hasUser:this.hasUser})},$selector:function(){return this.$("> .selector")},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCListItemView("+e+")"}});c.prototype.templates=function(){var e=a.extend({},s.prototype.templates.warnings,{error:i.wrapTemplate(["<% if( model.error ){ %>",'
',n("There was an error getting the data for this collection"),": <%- model.error %>","
","<% } %>"]),purged:i.wrapTemplate(["<% if( model.purged ){ %>",'
',n("This collection has been deleted and removed from disk"),"
","<% } %>"]),deleted:i.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
',n("This collection has been deleted"),"
","<% } %>"])}),t=i.wrapTemplate(['
','
','<%- collection.element_identifier || collection.name %>',"
",'
',"
"],"collection"),o=i.wrapTemplate(['
','<% var countText = collection.element_count? ( collection.element_count + " " ) : ""; %>','<% if( collection.collection_type === "list" ){ %>',n("a list of <%- countText %>datasets"),'<% } else if( collection.collection_type === "paired" ){ %>',n("a pair of datasets"),'<% } else if( collection.collection_type === "list:paired" ){ %>',n("a list of <%- countText %>dataset pairs"),'<% } else if( collection.collection_type === "list:list" ){ %>',n("a list of <%- countText %>dataset lists"),"<% } %>","
"],"collection");return a.extend({},s.prototype.templates,{warnings:e,titleBar:t,subtitle:o})}();var d=l.extend({className:l.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DCEListItemView.initialize:",e),l.prototype.initialize.call(this,e)},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCEListItemView("+e+")"}});d.prototype.templates=function(){var e=i.wrapTemplate(['
','
','<%- element.element_identifier %>',"
",'
',"
"],"element");return a.extend({},l.prototype.templates,{titleBar:e})}();var h=t.DatasetListItemView.extend({className:t.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DatasetDCEListItemView.initialize:",e),t.DatasetListItemView.prototype.initialize.call(this,e)},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):r.when()},toString:function(){var e=this.model?this.model+"":"(no model)";return"DatasetDCEListItemView("+e+")"}});h.prototype.templates=function(){var e=i.wrapTemplate(['
','','
','<%- element.element_identifier %>',"
","
"],"element");return a.extend({},t.DatasetListItemView.prototype.templates,{titleBar:e})}();var u=c.extend({className:c.prototype.className+" dataset-collection-element",_swapNewRender:function(e){c.prototype._swapNewRender.call(this,e);var t=this.model.get("state")||"ok";return this.$el.addClass("state-"+t),this.$el},toString:function(){var e=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemView("+e+")"}});return{DCListItemView:c,DCEListItemView:d,DatasetDCEListItemView:h,NestedDCDCEListItemView:u}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(78),i(6),i(5)],s=function(e,t,i){"use strict";var n={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(e){return a.extend(e,e.object,{element_id:e.id}),delete e.object,e},constructor:function(e,t){e=this._mergeObject(e),this.idAttribute="element_id",o.Model.apply(this,arguments)},parse:function(e,t){var i=e;return i=this._mergeObject(i)}},s=o.Model.extend(t.LoggableMixin).extend(n).extend({_logNamespace:"collections"}),l=o.Collection.extend(t.LoggableMixin).extend({_logNamespace:"collections",model:s,toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),c=e.DatasetAssociation.extend(t.mixin(n,{url:function(){return this.has("history_id")?Galaxy.root+"api/histories/"+this.get("history_id")+"/contents/"+this.get("id"):(console.warn("no endpoint for non-hdas within a collection yet"),Galaxy.root+"api/datasets")},defaults:a.extend({},e.DatasetAssociation.prototype.defaults,n.defaults),_downloadQueryParameters:function(){return"?to_ext="+this.get("file_ext")+"&hdca_id="+this.get("parent_hdca_id")+"&element_identifier="+this.get("element_identifier")},constructor:function(e,t){this.debug("\t DatasetDCE.constructor:",e,t),n.constructor.call(this,e,t)},hasDetails:function(){return this.elements&&this.elements.length},toString:function(){var e=this.get("element_identifier");return["DatasetDCE(",e,")"].join("")}})),d=l.extend({model:c,toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),h=o.Model.extend(t.LoggableMixin).extend(t.SearchableModelMixin).extend({_logNamespace:"collections",defaults:{collection_type:null,deleted:!1},collectionClass:l,initialize:function(e,t){this.debug(this+"(DatasetCollection).initialize:",e,t,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var e=this.get("elements")||[];this.unset("elements",{silent:!0});var t=this;return a.each(e,function(e,i){a.extend(e,{parent_hdca_id:t.get("id")})}),this.elements=new this.collectionClass(e),this.elements},toJSON:function(){var e=o.Model.prototype.toJSON.call(this);return this.elements&&(e.elements=this.elements.toJSON()),e},inReadyState:function(){var e=this.get("populated");return this.isDeletedOrPurged()||e},hasDetails:function(){return 0!==this.elements.length},getVisibleContents:function(e){return this.elements},parse:function(e,t){var i=o.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},delete:function(e){return this.get("deleted")?r.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},e)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name"],toString:function(){var e=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+e.join(",")+")"}}),u=h.extend({collectionClass:d,toString:function(){return"List"+h.prototype.toString.call(this)}}),p=u.extend({toString:function(){return"Pair"+h.prototype.toString.call(this)}}),f=h.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",e,")"].join("")}})),g=l.extend({model:f,toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),m=p.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedPairDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",e,")"].join("")}})),v=g.extend({model:m,toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),_=h.extend({collectionClass:v,toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}}),y=u.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedListDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedListDCDCE(",e,")"].join("")}})),w=g.extend({model:y,toString:function(){return["NestedListDCDCECollection(",this.length,")"].join("")}}),b=h.extend({collectionClass:w,toString:function(){return["ListOfListsDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:u,PairDatasetCollection:p,ListPairedDatasetCollection:_,ListOfListsDatasetCollection:b}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(3),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(47),i(11),i(6),i(75),i(8),i(93),i(5),i(90)],s=function(e,t,i,n,s,c,d){"use strict";function h(e,t){var i=e.toJSON(),n=m(i,{defaultHideSourceItems:t,creationFn:function(t,i,n){return t=t.map(function(e){return{id:e.id,name:e.name,src:"dataset"===e.history_content_type?"hda":"hdca"}}),e.createHDCA(t,"list",i,n)}});return n}var u="collections",p=a.View.extend(i.LoggableMixin).extend({_logNamespace:u,tagName:"li",className:"collection-element",initialize:function(e){this.element=e.element||{},this.selected=e.selected||!1},render:function(){return this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})),this.selected&&this.$el.addClass("selected"),this},template:o.template(['',"<%- element.name %>","",'"].join("")),select:function(e){this.$el.toggleClass("selected",e),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var e=this,t=this.$el.parent().width();this.$el.animate({"margin-right":t},"fast",function(){e.trigger("discard",{source:e}),e.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(e){e.stopPropagation(),this.select(e)},_clickName:function(e){e.stopPropagation(),e.preventDefault();var t=([d("Enter a new name for the element"),":\n(",d("Note that changing the name here will not rename the dataset"),")"].join(""),prompt(d("Enter a new name for the element")+":",this.element.name));t&&(this.element.name=t,this.render())},_clickDiscard:function(e){e.stopPropagation(),this.discard()},_dragstart:function(e){e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(e){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"DatasetCollectionElementView()"}}),f=a.View.extend(i.LoggableMixin).extend(n.CollectionCreatorMixin).extend({_logNamespace:u,elementViewClass:p,collectionClass:e.HistoryListDatasetCollection,className:"list-collection-creator collection-creator flex-row-container",minElements:1,defaultAttributes:{creationFn:function(){throw new TypeError("no creation fn for creator")},oncreate:function(){},oncancel:function(){},autoscrollDist:24,highlightClr:"rgba( 64, 255, 255, 1.0 )"},footerSettings:{".hide-originals":"hideOriginals"},initialize:function(e){this.metric("ListCollectionCreator.initialize",e);var t=this;o.each(this.defaultAttributes,function(i,n){i=e[n]||i,t[n]=i}),t.initialElements=e.elements||[],this._setUpCommonSettings(e),this._instanceSetUp(),this._elementsSetUp(),this._setUpBehaviors()},_instanceSetUp:function(){this.selectedIds={},this.$dragging=null,this.blocking=!1},_elementsSetUp:function(){this.invalidElements=[],this.workingElements=[],this.elementViews=[],this.workingElements=this.initialElements.slice(0),this._ensureElementIds(),this._validateElements(),this._mangleDuplicateNames(),this._sortElements()},_ensureElementIds:function(){return this.workingElements.forEach(function(e){e.hasOwnProperty("id")||(e.id=o.uniqueId())}),this.workingElements},_validateElements:function(){var e=this;return e.invalidElements=[],this.workingElements=this.workingElements.filter(function(t){var i=e._isElementInvalid(t);return i&&e.invalidElements.push({element:t,text:i}),!i}),this.workingElements},_isElementInvalid:function(e){if("dataset"!==e.history_content_type)return d("is not a dataset");var i=e.state===t.OK||o.contains(t.NOT_READY_STATES,e.state);return i?e.deleted||e.purged?d("has been deleted or purged"):null:d("has errored, is paused, or is not accessible")},_mangleDuplicateNames:function(){var e=900,t=1,i={};this.workingElements.forEach(function(n){for(var s=n.name;i.hasOwnProperty(s);)if(s=n.name+" ("+t+")",t+=1,t>=e)throw new Error("Safety hit in while loop - thats impressive");n.name=s,i[n.name]=!0})},_sortElements:function(e){},render:function(e,t){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(e,t){var i=this,n=l("
"),s=i.$list();o.each(this.elementViews,function(e){e.destroy(),i.removeElementView(e)}),i.workingElements.forEach(function(e){var t=i._createElementView(e);n.append(t.$el)}),i._renderClearSelected(),s.empty().append(n.children()),o.invoke(i.elementViews,"render"),s.height()>s.css("max-height")?s.css("border-width","1px 0px 1px 0px"):s.css("border-width","0px")},_createElementView:function(e){var t=new this.elementViewClass({element:e,selected:o.has(this.selectedIds,e.id)});return this.elementViews.push(t),this._listenToElementView(t),t},_listenToElementView:function(e){var t=this;t.listenTo(e,{select:function(e){var i=e.source.element;e.selected?t.selectedIds[i.id]=!0:delete t.selectedIds[i.id],t.trigger("elements:select",e)},discard:function(e){t.trigger("elements:discard",e)}})},addElementView:function(e){},removeElementView:function(e){delete this.selectedIds[e.element.id],this._renderClearSelected(),this.elementViews=o.without(this.elementViews,e),this.stopListening(e)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(e){return e},createList:function(e){if(!this.workingElements.length){var t=d("No valid elements for final list")+". ";return t+=''+d("Cancel")+" ",t+=d("or"),t+=' '+d("start over")+".",void this._showAlert(t)}var i=this,n=this.workingElements.map(function(e){return i._elementToJSON(e)});return i.blocking=!0,i.creationFn(n,e,i.hideOriginals).always(function(){i.blocking=!1}).fail(function(e,t,n){i.trigger("error",{xhr:e,status:t,message:d("An error occurred while creating this collection")})}).done(function(e,t,n){i.trigger("collection:created",e,t,n),i.metric("collection:created",e),"function"==typeof i.oncreate&&i.oncreate.call(this,e,t,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(e){this._renderClearSelected()}),this.on("elements:discard",function(e){var t=e.source.element;this.removeElementView(e.source),this.workingElements=o.without(this.workingElements,t),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(e){this.error(e);var t=this;if(content=e.message||d("An error occurred"),e.xhr){var i=e.xhr,n=e.message;0===i.readyState&&0===i.status?content+=": "+d("Galaxy could not be reached and may be updating.")+d(" Try again in a few minutes."):i.responseJSON?content+=":
"+JSON.stringify(i.responseJSON)+"
":content+=": "+n}t._showAlert(content,"alert-danger")},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .reset":"reset","click .clear-selected":"clearSelectedElements","click .collection-elements":"clearSelectedElements","dragover .collection-elements":"_dragoverElements","drop .collection-elements":"_dropElements","collection-element.dragstart .collection-elements":"_elementDragstart","collection-element.dragend .collection-elements":"_elementDragend","change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(e){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(e){e.preventDefault();var t=this.$list();this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestElement(e.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=r('
');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=2,n=e.offset(),s=e.scrollTop(),a=t-n.top,o=n.top+e.outerHeight()-t;a>=0&&a=0&&oe&&a-o','',d("More help"),"",'","
",'
','','',"
"].join("")),middle:o.template(['",'
',"
"].join("")),footer:o.template(['
','
','","
",'
','','
',d("Name"),":
","
","
",'
','
','",'
','",'","
","
",'
','","
","
"].join("")),helpContent:o.template(["

",d(["Collections of datasets are permanent, ordered lists of datasets that 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 and re-order the final collection."].join("")),"

","
    ","
  • ",d(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
  • ","
  • ",d(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
  • ","
  • ",d(["Reorder the list by clicking and dragging elements. Select multiple elements by clicking on ",'them and you can then move those selected by dragging the ',"entire group. Deselect them by clicking them again or by clicking the ",'the "Clear selected" link.'].join("")),"
  • ","
  • ",d(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
  • ","
  • ",d(['Click the "Cancel" button to exit the interface.'].join("")),"
  • ","

","

",d(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"

"].join("")),invalidElements:o.template([d("The following selections could not be included due to problems:"),"
    <% _.each( problems, function( problem ){ %>","
  • <%- problem.element.name %>: <%- problem.text %>
  • ","<% }); %>
"].join("")),noElementsLeft:o.template(['
  • ',d("No elements left! "),d("Would you like to "),'',d("start over"),"?","
  • "].join("")),invalidInitial:o.template(['
    ','
    ','',"<% if( _.size( problems ) ){ %>",d("The following selections could not be included due to problems"),":","
      <% _.each( problems, function( problem ){ %>","
    • <%- problem.element.name %>: <%- problem.text %>
    • ","<% }); %>
    ","<% } else if( _.size( elements ) < 1 ){ %>",d("No datasets were selected"),".","<% } %>","
    ",d("At least one element is needed for the collection"),". ",d("You may need to "),'',d("cancel")," ",d("and reselect new elements"),".","
    ","
    ","
    ",'"].join(""))}),toString:function(){return"ListCollectionCreator"}}),g=function(e,t,i){var n,a=l.Deferred(),r=Galaxy.modal||new s.View;return t=o.defaults(t||{},{elements:e,oncancel:function(){r.hide(),a.reject("cancelled")},oncreate:function(e,t){r.hide(),a.resolve(t)}}),n=new i(t),r.show({title:t.title||d("Create a collection"),body:n.$el,width:"80%",height:"100%",closing_events:!0}),n.render(),window._collectionCreator=n,a},m=function(e,t){return t=t||{},t.title=d("Create a collection from a list of datasets"),g(e,t,f)};return{DatasetCollectionElementView:p,ListCollectionCreator:f,collectionCreatorModal:g,listCollectionCreatorModal:m,createListCollection:h}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(51),i(11),i(18),i(6),i(5)],s=function(e,t,i,n,s){"use strict";var c="dataset",d=e.ListItemView,h=d.extend({_logNamespace:c,className:d.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log(this+".initialize:",e),d.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_setUpListeners:function(){d.prototype._setUpListeners.call(this);var e=this;return e.listenTo(e.model,{change:function(t){e.model.changedAttributes().state&&e.model.inReadyState()&&e.expanded&&!e.model.hasDetails()?e.model.fetch({silent:!0}).done(function(){e.render()}):a.has(t.changed,"tags")&&1===a.keys(t.changed).length?e.$(".nametags").html(e._renderNametags()):e.render()}})},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):o.when()},remove:function(e,t){var i=this;e=e||this.fxSpeed,this.$el.fadeOut(e,function(){r.View.prototype.remove.call(i),t&&t.call(i)})},_swapNewRender:function(e){return d.prototype._swapNewRender.call(this,e),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")), +this}"undefined"!=typeof e&&e.exports&&(e.exports=i)},function(e,t,i){var n,s;(function(a){n=[i(6),i(20),i(5)],s=function(e,t,i){var n=a.View.extend({tagName:"div",className:"citations",render:function(){return this.$el.append("

    "+this.formattedReference()+"

    "),this},formattedReference:function(){var e=this.model,t=e.entryType(),i=e.fields(),n="",s=this._asSentence((i.author?i.author:"")+(i.year?" ("+i.year+")":""))+" ",a=i.title||"",o=i.pages?"pp. "+i.pages:"",r=i.address;if("article"==t){var l=(i.volume?i.volume:"")+(i.number?" ("+i.number+")":"")+(o?", "+o:"");n=s+this._asSentence(a)+(i.journal?"In "+i.journal+", ":"")+this._asSentence(l)+this._asSentence(i.address)+""}else n="inproceedings"==t||"proceedings"==t?s+this._asSentence(a)+(i.booktitle?"In "+i.booktitle+", ":"")+(o?o:"")+(r?", "+r:"")+".":"mastersthesis"==t||"phdthesis"==t?s+this._asSentence(a)+(i.howpublished?i.howpublished+". ":"")+(i.note?i.note+".":""):"techreport"==t?s+this._asSentence(a)+this._asSentence(i.institution)+this._asSentence(i.number)+this._asSentence(i.type):"book"==t||"inbook"==t||"incollection"==t?s+" "+this._formatBookInfo(i):s+" "+this._asSentence(a)+this._asSentence(i.howpublished)+this._asSentence(i.note);var c="";i.doi&&(c="http://dx.doi.org/"+i.doi,n+='[doi:'+i.doi+"]");var d=i.url||c;return d&&(n+='[Link]'),n},_formatBookInfo:function(e){var t="";return e.chapter&&(t+=e.chapter+" in "),e.title&&(t+=""+e.title+""),e.editor&&(t+=", Edited by "+e.editor+", "),e.publisher&&(t+=", "+e.publisher),e.pages&&(t+=", pp. "+e.pages),e.series&&(t+=", "+e.series+""),e.volume&&(t+=", Vol."+e.volume),e.issn&&(t+=", ISBN: "+e.issn),t+"."},_asSentence:function(e){return e&&e.trim()?e+". ":""}}),s=a.View.extend({el:"#citations",initialize:function(){this.listenTo(this.collection,"add",this.renderCitation)},events:{"click .citations-to-bibtex":"showBibtex","click .citations-to-formatted":"showFormatted"},renderCitation:function(e){var t=new n({model:e});this.$(".citations-formatted").append(t.render().el);var i=this.$(".citations-bibtex-text");i.val(i.val()+"\n\r"+e.attributes.content)},render:function(){this.$el.html(this.citationsElement()),this.collection.each(function(e){this.renderCitation(e)},this),this.showFormatted()},showBibtex:function(){this.$(".citations-to-formatted").show(),this.$(".citations-to-bibtex").hide(),this.$(".citations-bibtex").show(),this.$(".citations-formatted").hide(),this.$(".citations-bibtex-text").select()},showFormatted:function(){this.$(".citations-to-formatted").hide(),this.$(".citations-to-bibtex").show(),this.$(".citations-bibtex").hide(),this.$(".citations-formatted").show()},partialWarningElement:function(){return this.collection.partial?['
    ',"Warning: This is a experimental feature. Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' cite Galaxy.',"
    "].join(""):""},citationsElement:function(){return['
    ','
    ',i("Citations"),' ',' ',"
    ",'
    ',this.partialWarningElement(),'',"
    ",'
    ','',"
    ","
    "].join("")}});return{CitationView:n,CitationListView:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3))},function(e,t,i){var n,s;(function(a,o,r){n=[i(51),i(41),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=e.FoldoutListItemView,l=e.ListItemView,c=s.extend({className:s.prototype.className+" dataset-collection",id:function(){return["dataset_collection",this.model.get("id")].join("-")},initialize:function(e){this.linkTarget=e.linkTarget||"_blank",this.hasUser=e.hasUser,s.prototype.initialize.call(this,e)},_setUpListeners:function(){s.prototype._setUpListeners.call(this),this.listenTo(this.model,"change",function(e,t){a.has(e.changed,"deleted")?this.render():a.has(e.changed,"element_count")&&this.$("> .title-bar .subtitle").replaceWith(this._renderSubtitle())})},_renderSubtitle:function(){return o(this.templates.subtitle(this.model.toJSON(),this))},_getFoldoutPanelOptions:function(){var e=s.prototype._getFoldoutPanelOptions.call(this);return a.extend(e,{linkTarget:this.linkTarget,hasUser:this.hasUser})},$selector:function(){return this.$("> .selector")},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCListItemView("+e+")"}});c.prototype.templates=function(){var e=a.extend({},s.prototype.templates.warnings,{error:i.wrapTemplate(["<% if( model.error ){ %>",'
    ',n("There was an error getting the data for this collection"),": <%- model.error %>","
    ","<% } %>"]),purged:i.wrapTemplate(["<% if( model.purged ){ %>",'
    ',n("This collection has been deleted and removed from disk"),"
    ","<% } %>"]),deleted:i.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
    ',n("This collection has been deleted"),"
    ","<% } %>"])}),t=i.wrapTemplate(['
    ','
    ','<%- collection.element_identifier || collection.name %>',"
    ",'
    ',"
    "],"collection"),o=i.wrapTemplate(['
    ','<% var countText = collection.element_count? ( collection.element_count + " " ) : ""; %>','<% if( collection.collection_type === "list" ){ %>',n("a list of <%- countText %>datasets"),'<% } else if( collection.collection_type === "paired" ){ %>',n("a pair of datasets"),'<% } else if( collection.collection_type === "list:paired" ){ %>',n("a list of <%- countText %>dataset pairs"),'<% } else if( collection.collection_type === "list:list" ){ %>',n("a list of <%- countText %>dataset lists"),"<% } %>","
    "],"collection");return a.extend({},s.prototype.templates,{warnings:e,titleBar:t,subtitle:o})}();var d=l.extend({className:l.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DCEListItemView.initialize:",e),l.prototype.initialize.call(this,e)},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCEListItemView("+e+")"}});d.prototype.templates=function(){var e=i.wrapTemplate(['
    ','
    ','<%- element.element_identifier %>',"
    ",'
    ',"
    "],"element");return a.extend({},l.prototype.templates,{titleBar:e})}();var h=t.DatasetListItemView.extend({className:t.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DatasetDCEListItemView.initialize:",e),t.DatasetListItemView.prototype.initialize.call(this,e)},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):r.when()},toString:function(){var e=this.model?this.model+"":"(no model)";return"DatasetDCEListItemView("+e+")"}});h.prototype.templates=function(){var e=i.wrapTemplate(['
    ','','
    ','<%- element.element_identifier %>',"
    ","
    "],"element");return a.extend({},t.DatasetListItemView.prototype.templates,{titleBar:e})}();var u=c.extend({className:c.prototype.className+" dataset-collection-element",_swapNewRender:function(e){c.prototype._swapNewRender.call(this,e);var t=this.model.get("state")||"ok";return this.$el.addClass("state-"+t),this.$el},toString:function(){var e=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemView("+e+")"}});return{DCListItemView:c,DCEListItemView:d,DatasetDCEListItemView:h,NestedDCDCEListItemView:u}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(78),i(6),i(5)],s=function(e,t,i){"use strict";var n={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(e){return a.extend(e,e.object,{element_id:e.id}),delete e.object,e},constructor:function(e,t){e=this._mergeObject(e),this.idAttribute="element_id",o.Model.apply(this,arguments)},parse:function(e,t){var i=e;return i=this._mergeObject(i)}},s=o.Model.extend(t.LoggableMixin).extend(n).extend({_logNamespace:"collections"}),l=o.Collection.extend(t.LoggableMixin).extend({_logNamespace:"collections",model:s,toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),c=e.DatasetAssociation.extend(t.mixin(n,{url:function(){return this.has("history_id")?Galaxy.root+"api/histories/"+this.get("history_id")+"/contents/"+this.get("id"):(console.warn("no endpoint for non-hdas within a collection yet"),Galaxy.root+"api/datasets")},defaults:a.extend({},e.DatasetAssociation.prototype.defaults,n.defaults),_downloadQueryParameters:function(){return"?to_ext="+this.get("file_ext")+"&hdca_id="+this.get("parent_hdca_id")+"&element_identifier="+this.get("element_identifier")},constructor:function(e,t){this.debug("\t DatasetDCE.constructor:",e,t),n.constructor.call(this,e,t)},hasDetails:function(){return this.elements&&this.elements.length},toString:function(){var e=this.get("element_identifier");return["DatasetDCE(",e,")"].join("")}})),d=l.extend({model:c,toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),h=o.Model.extend(t.LoggableMixin).extend(t.SearchableModelMixin).extend({_logNamespace:"collections",defaults:{collection_type:null,deleted:!1},collectionClass:l,initialize:function(e,t){this.debug(this+"(DatasetCollection).initialize:",e,t,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var e=this.get("elements")||[];this.unset("elements",{silent:!0});var t=this;return a.each(e,function(e,i){a.extend(e,{parent_hdca_id:t.get("id")})}),this.elements=new this.collectionClass(e),this.elements},toJSON:function(){var e=o.Model.prototype.toJSON.call(this);return this.elements&&(e.elements=this.elements.toJSON()),e},inReadyState:function(){var e=this.get("populated");return this.isDeletedOrPurged()||e},hasDetails:function(){return 0!==this.elements.length},getVisibleContents:function(e){return this.elements},parse:function(e,t){var i=o.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},delete:function(e){return this.get("deleted")?r.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},e)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name","tags"],toString:function(){var e=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+e.join(",")+")"}}),u=h.extend({collectionClass:d,toString:function(){return"List"+h.prototype.toString.call(this)}}),p=u.extend({toString:function(){return"Pair"+h.prototype.toString.call(this)}}),f=h.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",e,")"].join("")}})),g=l.extend({model:f,toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),m=p.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedPairDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",e,")"].join("")}})),v=g.extend({model:m,toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),_=h.extend({collectionClass:v,toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}}),y=u.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedListDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedListDCDCE(",e,")"].join("")}})),w=g.extend({model:y,toString:function(){return["NestedListDCDCECollection(",this.length,")"].join("")}}),b=h.extend({collectionClass:w,toString:function(){return["ListOfListsDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:u,PairDatasetCollection:p,ListPairedDatasetCollection:_,ListOfListsDatasetCollection:b}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(3),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(47),i(11),i(6),i(75),i(8),i(93),i(5),i(90)],s=function(e,t,i,n,s,c,d){"use strict";function h(e,t){var i=e.toJSON(),n=m(i,{defaultHideSourceItems:t,creationFn:function(t,i,n){return t=t.map(function(e){return{id:e.id,name:e.name,src:"dataset"===e.history_content_type?"hda":"hdca"}}),e.createHDCA(t,"list",i,n)}});return n}var u="collections",p=a.View.extend(i.LoggableMixin).extend({_logNamespace:u,tagName:"li",className:"collection-element",initialize:function(e){this.element=e.element||{},this.selected=e.selected||!1},render:function(){return this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})),this.selected&&this.$el.addClass("selected"),this},template:o.template(['',"<%- element.name %>","",'"].join("")),select:function(e){this.$el.toggleClass("selected",e),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var e=this,t=this.$el.parent().width();this.$el.animate({"margin-right":t},"fast",function(){e.trigger("discard",{source:e}),e.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(e){e.stopPropagation(),this.select(e)},_clickName:function(e){e.stopPropagation(),e.preventDefault();var t=([d("Enter a new name for the element"),":\n(",d("Note that changing the name here will not rename the dataset"),")"].join(""),prompt(d("Enter a new name for the element")+":",this.element.name));t&&(this.element.name=t,this.render())},_clickDiscard:function(e){e.stopPropagation(),this.discard()},_dragstart:function(e){e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(e){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"DatasetCollectionElementView()"}}),f=a.View.extend(i.LoggableMixin).extend(n.CollectionCreatorMixin).extend({_logNamespace:u,elementViewClass:p,collectionClass:e.HistoryListDatasetCollection,className:"list-collection-creator collection-creator flex-row-container",minElements:1,defaultAttributes:{creationFn:function(){throw new TypeError("no creation fn for creator")},oncreate:function(){},oncancel:function(){},autoscrollDist:24,highlightClr:"rgba( 64, 255, 255, 1.0 )"},footerSettings:{".hide-originals":"hideOriginals"},initialize:function(e){this.metric("ListCollectionCreator.initialize",e);var t=this;o.each(this.defaultAttributes,function(i,n){i=e[n]||i,t[n]=i}),t.initialElements=e.elements||[],this._setUpCommonSettings(e),this._instanceSetUp(),this._elementsSetUp(),this._setUpBehaviors()},_instanceSetUp:function(){this.selectedIds={},this.$dragging=null,this.blocking=!1},_elementsSetUp:function(){this.invalidElements=[],this.workingElements=[],this.elementViews=[],this.workingElements=this.initialElements.slice(0),this._ensureElementIds(),this._validateElements(),this._mangleDuplicateNames(),this._sortElements()},_ensureElementIds:function(){return this.workingElements.forEach(function(e){e.hasOwnProperty("id")||(e.id=o.uniqueId())}),this.workingElements},_validateElements:function(){var e=this;return e.invalidElements=[],this.workingElements=this.workingElements.filter(function(t){var i=e._isElementInvalid(t);return i&&e.invalidElements.push({element:t,text:i}),!i}),this.workingElements},_isElementInvalid:function(e){if("dataset"!==e.history_content_type)return d("is not a dataset");var i=e.state===t.OK||o.contains(t.NOT_READY_STATES,e.state);return i?e.deleted||e.purged?d("has been deleted or purged"):null:d("has errored, is paused, or is not accessible")},_mangleDuplicateNames:function(){var e=900,t=1,i={};this.workingElements.forEach(function(n){for(var s=n.name;i.hasOwnProperty(s);)if(s=n.name+" ("+t+")",t+=1,t>=e)throw new Error("Safety hit in while loop - thats impressive");n.name=s,i[n.name]=!0})},_sortElements:function(e){},render:function(e,t){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(e,t){var i=this,n=l("
    "),s=i.$list();o.each(this.elementViews,function(e){e.destroy(),i.removeElementView(e)}),i.workingElements.forEach(function(e){var t=i._createElementView(e);n.append(t.$el)}),i._renderClearSelected(),s.empty().append(n.children()),o.invoke(i.elementViews,"render"),s.height()>s.css("max-height")?s.css("border-width","1px 0px 1px 0px"):s.css("border-width","0px")},_createElementView:function(e){var t=new this.elementViewClass({element:e,selected:o.has(this.selectedIds,e.id)});return this.elementViews.push(t),this._listenToElementView(t),t},_listenToElementView:function(e){var t=this;t.listenTo(e,{select:function(e){var i=e.source.element;e.selected?t.selectedIds[i.id]=!0:delete t.selectedIds[i.id],t.trigger("elements:select",e)},discard:function(e){t.trigger("elements:discard",e)}})},addElementView:function(e){},removeElementView:function(e){delete this.selectedIds[e.element.id],this._renderClearSelected(),this.elementViews=o.without(this.elementViews,e),this.stopListening(e)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(e){return e},createList:function(e){if(!this.workingElements.length){var t=d("No valid elements for final list")+". ";return t+=''+d("Cancel")+" ",t+=d("or"),t+=' '+d("start over")+".",void this._showAlert(t)}var i=this,n=this.workingElements.map(function(e){return i._elementToJSON(e)});return i.blocking=!0,i.creationFn(n,e,i.hideOriginals).always(function(){i.blocking=!1}).fail(function(e,t,n){i.trigger("error",{xhr:e,status:t,message:d("An error occurred while creating this collection")})}).done(function(e,t,n){i.trigger("collection:created",e,t,n),i.metric("collection:created",e),"function"==typeof i.oncreate&&i.oncreate.call(this,e,t,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(e){this._renderClearSelected()}),this.on("elements:discard",function(e){var t=e.source.element;this.removeElementView(e.source),this.workingElements=o.without(this.workingElements,t),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(e){this.error(e);var t=this;if(content=e.message||d("An error occurred"),e.xhr){var i=e.xhr,n=e.message;0===i.readyState&&0===i.status?content+=": "+d("Galaxy could not be reached and may be updating.")+d(" Try again in a few minutes."):i.responseJSON?content+=":
    "+JSON.stringify(i.responseJSON)+"
    ":content+=": "+n}t._showAlert(content,"alert-danger")},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .reset":"reset","click .clear-selected":"clearSelectedElements","click .collection-elements":"clearSelectedElements","dragover .collection-elements":"_dragoverElements","drop .collection-elements":"_dropElements","collection-element.dragstart .collection-elements":"_elementDragstart","collection-element.dragend .collection-elements":"_elementDragend","change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(e){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(e){e.preventDefault();var t=this.$list();this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestElement(e.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=r('
    ');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=2,n=e.offset(),s=e.scrollTop(),a=t-n.top,o=n.top+e.outerHeight()-t;a>=0&&a=0&&oe&&a-o','',d("More help"),"",'","
    ",'
    ','','',"
    "].join("")),middle:o.template(['",'
    ',"
    "].join("")),footer:o.template(['
    ','
    ','","
    ",'
    ','','
    ',d("Name"),":
    ","
    ","
    ",'
    ','
    ','",'
    ','",'","
    ","
    ",'
    ','","
    ","
    "].join("")),helpContent:o.template(["

    ",d(["Collections of datasets are permanent, ordered lists of datasets that 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 and re-order the final collection."].join("")),"

    ","
      ","
    • ",d(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
    • ","
    • ",d(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
    • ","
    • ",d(["Reorder the list by clicking and dragging elements. Select multiple elements by clicking on ",'them and you can then move those selected by dragging the ',"entire group. Deselect them by clicking them again or by clicking the ",'the "Clear selected" link.'].join("")),"
    • ","
    • ",d(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
    • ","
    • ",d(['Click the "Cancel" button to exit the interface.'].join("")),"
    • ","

    ","

    ",d(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"

    "].join("")),invalidElements:o.template([d("The following selections could not be included due to problems:"),"
      <% _.each( problems, function( problem ){ %>","
    • <%- problem.element.name %>: <%- problem.text %>
    • ","<% }); %>
    "].join("")),noElementsLeft:o.template(['
  • ',d("No elements left! "),d("Would you like to "),'',d("start over"),"?","
  • "].join("")),invalidInitial:o.template(['
    ','
    ','',"<% if( _.size( problems ) ){ %>",d("The following selections could not be included due to problems"),":","
      <% _.each( problems, function( problem ){ %>","
    • <%- problem.element.name %>: <%- problem.text %>
    • ","<% }); %>
    ","<% } else if( _.size( elements ) < 1 ){ %>",d("No datasets were selected"),".","<% } %>","
    ",d("At least one element is needed for the collection"),". ",d("You may need to "),'',d("cancel")," ",d("and reselect new elements"),".","
    ","
    ","
    ",'"].join(""))}),toString:function(){return"ListCollectionCreator"}}),g=function(e,t,i){var n,a=l.Deferred(),r=Galaxy.modal||new s.View;return t=o.defaults(t||{},{elements:e,oncancel:function(){r.hide(),a.reject("cancelled")},oncreate:function(e,t){r.hide(),a.resolve(t)}}),n=new i(t),r.show({title:t.title||d("Create a collection"),body:n.$el,width:"80%",height:"100%",closing_events:!0}),n.render(),window._collectionCreator=n,a},m=function(e,t){return t=t||{},t.title=d("Create a collection from a list of datasets"),g(e,t,f)};return{DatasetCollectionElementView:p,ListCollectionCreator:f,collectionCreatorModal:g,listCollectionCreatorModal:m,createListCollection:h}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(51),i(11),i(18),i(6),i(5)],s=function(e,t,i,n,s){"use strict";var c="dataset",d=e.ListItemView,h=d.extend({_logNamespace:c,className:d.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log(this+".initialize:",e),d.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_setUpListeners:function(){d.prototype._setUpListeners.call(this);var e=this;return e.listenTo(e.model,{change:function(t){e.model.changedAttributes().state&&e.model.inReadyState()&&e.expanded&&!e.model.hasDetails()?e.model.fetch({silent:!0}).done(function(){e.render()}):a.has(t.changed,"tags")&&1===a.keys(t.changed).length?e.$(".nametags").html(e._renderNametags()):e.render()}})},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):o.when()},remove:function(e,t){var i=this;e=e||this.fxSpeed,this.$el.fadeOut(e,function(){r.View.prototype.remove.call(i),t&&t.call(i)})},_swapNewRender:function(e){return d.prototype._swapNewRender.call(this,e),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")), this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var e=this.model.get("state");if(e===t.NOT_VIEWABLE||e===t.DISCARDED||!this.model.get("accessible"))return null;var n={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged"))n.disabled=!0,n.title=s("Cannot display datasets removed from disk");else if(e===t.UPLOAD)n.disabled=!0,n.title=s("This dataset must finish uploading before it can be viewed");else if(e===t.NEW)n.disabled=!0,n.title=s("This dataset is not yet viewable");else{n.title=s("View data"),n.href=this.model.urls.display;var a=this;n.onclick=function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.addDataset(a.model.get("id")),e.preventDefault())}}return n.faIcon="fa-eye",i(n)},_renderDetails:function(){if(this.model.get("state")===t.NOT_VIEWABLE)return l(this.templates.noAccess(this.model.toJSON(),this));var e=d.prototype._renderDetails.call(this);return e.find(".actions .left").empty().append(this._renderSecondaryActions()),e.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages()),e.find(".display-applications").html(this._renderDisplayApplications()),this._setUpBehaviors(e),e},_renderSummary:function(){var e=this.model.toJSON(),t=this.templates.summaries[e.state];return(t=t||this.templates.summaries.unknown)(e,this)},_renderDetailMessages:function(){var e=this,t=l('
    '),i=e.model.toJSON();return a.each(e.templates.detailMessages,function(n){t.append(l(n(i,e)))}),t},_renderDisplayApplications:function(){return this.model.isDeletedOrPurged()?"":[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){switch(this.debug("_renderSecondaryActions"),this.model.get("state")){case t.NOT_VIEWABLE:return[];case t.OK:case t.FAILED_METADATA:case t.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return i({title:s("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle",onclick:function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:"Dataset details",url:this.href}),e.preventDefault(),e.stopPropagation())}})},_renderDownloadButton:function(){return this.model.get("purged")||!this.model.hasData()?null:a.isEmpty(this.model.get("meta_files"))?l(['','',""].join("")):this._renderMetaFileDownloadButton()},_renderMetaFileDownloadButton:function(){var e=this.model.urls;return l(['"].join("\n"))},_renderNametags:function(){var e=a.template(["<% _.each(_.sortBy(_.uniq(tags), function(x) { return x }), function(tag){ %>",'<% if (tag.indexOf("name:") == 0){ %>','<%- tag.slice(5) %>',"<% } %>","<% }); %>"].join(""));return e({tags:this.model.get("tags")})},events:a.extend(a.clone(d.prototype.events),{"click .display-btn":function(e){this.trigger("display",this,e)},"click .params-btn":function(e){this.trigger("params",this,e)},"click .download-btn":function(e){this.trigger("download",this,e)}}),toString:function(){var e=this.model?this.model+"":"(no model)";return"DatasetListItemView("+e+")"}});return h.prototype.templates=function(){var e=a.extend({},d.prototype.templates.warnings,{failed_metadata:n.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','
    ',s("An error occurred setting the metadata for this dataset"),"
    ","<% } %>"]),error:n.wrapTemplate(["<% if( model.error ){ %>",'
    ',s("There was an error getting the data for this dataset"),": <%- model.error %>","
    ","<% } %>"]),purged:n.wrapTemplate(["<% if( model.purged ){ %>",'
    ',s("This dataset has been deleted and removed from disk"),"
    ","<% } %>"]),deleted:n.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'
    ',s("This dataset has been deleted"),"
    ","<% } %>"])}),i=n.wrapTemplate(['
    ','
    ','
    ','
    ','
    ',"
    ","<% if( !dataset.deleted && !dataset.purged ){ %>",'
    ','
    ','
    ',"<% if( dataset.peek ){ %>",'
    <%= dataset.peek %>
    ',"<% } %>","<% } %>","
    "],"dataset"),o=n.wrapTemplate(['
    ','
    ',s("You do not have permission to view this dataset"),"
    ","
    "],"dataset"),r={};r[t.OK]=r[t.FAILED_METADATA]=n.wrapTemplate(["<% if( dataset.misc_blurb ){ %>",'
    ','<%- dataset.misc_blurb %>',"
    ","<% } %>","<% if( dataset.file_ext ){ %>",'
    ','",'<%- dataset.file_ext %>',"
    ","<% } %>","<% if( dataset.metadata_dbkey ){ %>",'
    ','",'',"<%- dataset.metadata_dbkey %>","","
    ","<% } %>","<% if( dataset.misc_info ){ %>",'
    ','<%- dataset.misc_info %>',"
    ","<% } %>"],"dataset"),r[t.NEW]=n.wrapTemplate(["
    ",s("This is a new dataset and not all of its data are available yet"),"
    "],"dataset"),r[t.NOT_VIEWABLE]=n.wrapTemplate(["
    ",s("You do not have permission to view this dataset"),"
    "],"dataset"),r[t.DISCARDED]=n.wrapTemplate(["
    ",s("The job creating this dataset was cancelled before completion"),"
    "],"dataset"),r[t.QUEUED]=n.wrapTemplate(["
    ",s("This job is waiting to run"),"
    "],"dataset"),r[t.RUNNING]=n.wrapTemplate(["
    ",s("This job is currently running"),"
    "],"dataset"),r[t.UPLOAD]=n.wrapTemplate(["
    ",s("This dataset is currently uploading"),"
    "],"dataset"),r[t.SETTING_METADATA]=n.wrapTemplate(["
    ",s("Metadata is being auto-detected"),"
    "],"dataset"),r[t.PAUSED]=n.wrapTemplate(["
    ",s('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"
    "],"dataset"),r[t.ERROR]=n.wrapTemplate(["<% if( !dataset.purged ){ %>","
    <%- dataset.misc_blurb %>
    ","<% } %>",'',s("An error occurred with this dataset"),":",'
    <%- dataset.misc_info %>
    '],"dataset"),r[t.EMPTY]=n.wrapTemplate(["
    ",s("No data"),": <%- dataset.misc_blurb %>
    "],"dataset"),r.unknown=n.wrapTemplate(['
    Error: unknown dataset state: "<%- dataset.state %>"
    '],"dataset");var l={resubmitted:n.wrapTemplate(["<% if( model.resubmitted ){ %>",'
    ',s("The job creating this dataset has been resubmitted"),"
    ","<% } %>"])},c=n.wrapTemplate(["<% _.each( apps, function( app ){ %>",'
    ','<%- app.label %> ','',"<% _.each( app.links, function( link ){ %>",'',"<% print( _l( link.text ) ); %>"," ","<% }); %>","","
    ","<% }); %>"],"apps");return a.extend({},d.prototype.templates,{warnings:e,details:i,noAccess:o,summaries:r,detailMessages:l,displayApplications:c})}(),{DatasetListItemView:h}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(3),i(1))},function(e,t,i){var n,s;(function(i,a,o){n=[],s=function(){return i.View.extend({initialize:function(e,t){this.app=e,this.app_options=e.model?e.model.attributes:{},this.field=t&&t.field||new i.View,this.model=t&&t.model||new i.Model({text_enable:this.app_options.text_enable||"Enable",text_disable:this.app_options.text_disable||"Disable",cls_enable:this.app_options.cls_enable||"fa fa-caret-square-o-down",cls_disable:this.app_options.cls_disable||"fa fa-caret-square-o-up",always_refresh:this.app_options.always_refresh}).set(t),this.setElement(this._template()),this.$field=this.$(".ui-form-field"),this.$info=this.$(".ui-form-info"),this.$preview=this.$(".ui-form-preview"),this.$collapsible=this.$(".ui-form-collapsible"),this.$collapsible_text=this.$(".ui-form-collapsible-text"),this.$collapsible_icon=this.$(".ui-form-collapsible-icon"),this.$title=this.$(".ui-form-title"),this.$title_text=this.$(".ui-form-title-text"),this.$error_text=this.$(".ui-form-error-text"),this.$error=this.$(".ui-form-error"),this.$backdrop=this.$(".ui-form-backdrop"),this.$field.prepend(this.field.$el);var n=this.model.get("collapsible_value");this.field.collapsed=void 0!==n&&JSON.stringify(this.model.get("value"))==JSON.stringify(n),this.listenTo(this.model,"change",this.render,this),this.render();var s=this;this.$collapsible.on("click",function(){s.field.collapsed=!s.field.collapsed,e.trigger&&e.trigger("change"),s.render()}),this.field.model&&!this.model.get("always_refresh")&&this.listenTo(this.field.model,"change:value",function(){s.reset()})},backdrop:function(){this.model.set("backdrop",!0)},error:function(e){this.model.set("error_text",e)},reset:function(){!this.model.get("fixed")&&this.model.set("error_text",null)},render:function(){a(".tooltip").hide();var e=this.model.get("help",""),t=this.model.get("argument");t&&e.indexOf("("+t+")")==-1&&(e+=" ("+t+")"),this.$info.html(e),this.$el[this.model.get("hidden")?"hide":"show"](),this.$preview[this.field.collapsed&&this.model.get("collapsible_preview")||this.model.get("disabled")?"show":"hide"]().html(o.escape(this.model.get("text_value")));var i=this.model.get("error_text");if(this.$error[i?"show":"hide"](),this.$el[i?"addClass":"removeClass"]("ui-error"),this.$error_text.html(i),this.$backdrop[this.model.get("backdrop")?"show":"hide"](),this.field.collapsed||this.model.get("disabled")?this.$field.hide():this.$field.show(),this.field.model&&this.field.model.set({color:this.model.get("color"),style:this.model.get("style")}),this.model.get("disabled")||void 0===this.model.get("collapsible_value"))this.$title_text.show().text(this.model.get("label")),this.$collapsible.hide();else{var n=this.field.collapsed?"enable":"disable";this.$title_text.hide(),this.$collapsible.show(),this.$collapsible_text.text(this.model.get("label")),this.$collapsible_icon.removeClass().addClass("icon").addClass(this.model.get("cls_"+n)).attr("data-original-title",this.model.get("text_"+n)).tooltip({placement:"bottom"})}},_template:function(){return a("
    ").addClass("ui-form-element").append(a("
    ").addClass("ui-form-error ui-error").append(a("").addClass("fa fa-arrow-down")).append(a("").addClass("ui-form-error-text"))).append(a("
    ").addClass("ui-form-title").append(a("
    ").addClass("ui-form-collapsible").append(a("").addClass("ui-form-collapsible-icon")).append(a("").addClass("ui-form-collapsible-text"))).append(a("").addClass("ui-form-title-text"))).append(a("
    ").addClass("ui-form-field").append(a("").addClass("ui-form-info")).append(a("
    ").addClass("ui-form-backdrop"))).append(a("
    ").addClass("ui-form-preview"))}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(7),i(57),i(59),i(58),i(55)],s=function(e,t,i,n,s,l){return a.Model.extend({types:{text:"_fieldText",password:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider",float:"_fieldSlider",boolean:"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp",upload:"_fieldUpload"},create:function(e){var t=this.types[e.type],i="function"==typeof this[t]?this[t].call(this,e):null;return i||(i=e.options?this._fieldSelect(e):this._fieldText(e),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+e.type+").")),void 0===e.value&&(e.value=null),i.value(e.value),i},_fieldData:function(e){return new i.View({id:"field-"+e.id,extensions:e.extensions,optional:e.optional,multiple:e.multiple,type:e.type,flavor:e.flavor,data:e.options,onchange:e.onchange})},_fieldSelect:function(e){if(e.is_workflow)return this._fieldText(e);"data_column"==e.type&&(e.error_text="Missing columns in referenced dataset.");var i=e.data;i||(i=[],o.each(e.options,function(e){i.push({label:e[0],value:e[1]})}));var n=t.Select;switch(e.display){case"checkboxes":n=t.Checkbox;break;case"radio":n=t.Radio;break;case"radiobutton":n=t.RadioButton}return new n.View({id:"field-"+e.id,data:i,error_text:e.error_text||"No options available",multiple:e.multiple,optional:e.optional,onchange:e.onchange,searchable:"workflow"!==e.flavor})},_fieldDrilldown:function(e){return e.is_workflow?this._fieldText(e):new t.Drilldown.View({id:"field-"+e.id,data:e.options,display:e.display,optional:e.optional,onchange:e.onchange})},_fieldText:function(i){if(i.options&&i.data)if(i.area=i.multiple,e.isEmpty(i.value))i.value=null;else if(r.isArray(i.value)){var n="";for(var s in i.value){if(n+=String(i.value[s]),!i.multiple)break;n+="\n"}i.value=n}return new t.Input({id:"field-"+i.id,type:i.type,area:i.area,readonly:i.readonly,placeholder:i.placeholder,datalist:i.datalist,onchange:i.onchange})},_fieldSlider:function(e){return new t.Slider.View({id:"field-"+e.id,precise:"float"==e.type,is_workflow:e.is_workflow,min:e.min,max:e.max,onchange:e.onchange})},_fieldHidden:function(e){return new t.Hidden({id:"field-"+e.id,info:e.info})},_fieldBoolean:function(e){return new t.RadioButton.View({id:"field-"+e.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:e.onchange})},_fieldColor:function(e){return new l({id:"field-"+e.id,onchange:e.onchange})},_fieldLibrary:function(e){return new n.View({id:"field-"+e.id,optional:e.optional,multiple:e.multiple,onchange:e.onchange})},_fieldFtp:function(e){return new s.View({id:"field-"+e.id,optional:e.optional,multiple:e.multiple,onchange:e.onchange})},_fieldUpload:function(e){return new t.Upload({id:"field-"+e.id,onchange:e.onchange})}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(9),i(7)],s=function(e,t,i){var n=a.View.extend({initialize:function(t){this.list={},this.options=e.merge(t,{title:"Repeat",empty_text:"Not available.",max:null,min:null}),this.button_new=new i.ButtonIcon({icon:"fa-plus",title:"Insert "+this.options.title,tooltip:"Add new "+this.options.title+" block",floating:"clear",cls:"ui-button-icon form-repeat-add",onclick:function(){t.onnew&&t.onnew()}}),this.setElement(o("
    ").append(this.$list=o("
    ")).append(o("
    ").append(this.button_new.$el)))},size:function(){return r.size(this.list)},add:function(e){if(!e.id||this.list[e.id])return void Galaxy.emit.debug("form-repeat::add()","Duplicate or invalid repeat block id.");var n=new i.ButtonIcon({icon:"fa-trash-o",tooltip:"Delete this repeat block",cls:"ui-button-icon-plain form-repeat-delete",onclick:function(){e.ondel&&e.ondel()}}),s=new t.View({id:e.id,title:"placeholder",cls:e.cls||"ui-portlet-repeat",operations:{button_delete:n}});s.append(e.$el),s.$el.addClass("section-row").hide(),this.list[e.id]=s,this.$list.append(s.$el.fadeIn("fast")),this.options.max>0&&this.size()>=this.options.max&&this.button_new.disable(),this._refresh()},del:function(e){return this.list[e]?(this.$list.find("#"+e).remove(),delete this.list[e],this.button_new.enable(),void this._refresh()):void Galaxy.emit.debug("form-repeat::del()","Invalid repeat block id.")},delAll:function(){for(var e in this.list)this.del(e)},hideOptions:function(){this.button_new.$el.hide(),r.each(this.list,function(e){e.hideOperation("button_delete")}),r.isEmpty(this.list)&&this.$el.append(o("
    ").addClass("ui-form-info").html(this.options.empty_text))},_refresh:function(){var e=0;for(var t in this.list){var i=this.list[t];i.title(++e+": "+this.options.title),i[this.size()>this.options.min?"showOperation":"hideOperation"]("button_delete")}}});return{View:n}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(4),i(7),i(9),i(44),i(42),i(43)],s=function(e,t,i,n,s,c){var d=a.View.extend({initialize:function(e,t){this.app=e,this.inputs=t.inputs,this.parameters=new c,this.setElement(o("
    ")),this.render()},render:function(){var e=this;this.$el.empty(),r.each(this.inputs,function(t){e.add(t)})},add:function(t){var i=l.extend(!0,{},t);switch(i.id=t.id=e.uid(),this.app.input_list[i.id]=i,i.type){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(e){var t=this;e.test_param.id=e.id,this.app.model.get("sustain_conditionals")&&(e.test_param.disabled=!0);var i=this._addRow(e.test_param);i.model&&i.model.set("onchange",function(i){var n=t.app.data.matchCase(e,i);for(var s in e.cases){var a=e.cases[s],o=t.$("#"+e.id+"-section-"+s),r=!1;for(var l in a.inputs)if(!a.inputs[l].hidden){r=!0;break}s==n&&r?o.fadeIn("fast"):o.hide()}t.app.trigger("change")});for(var n in e.cases){var s=new d(this.app,{inputs:e.cases[n].inputs});this._append(s.$el.addClass("ui-form-section"),e.id+"-section-"+n)}i.trigger("change")},_addRepeat:function(e){function t(t){var n=e.id+"-section-"+a++,s=new d(i.app,{inputs:t});o.add({id:n,$el:s.$el,ondel:function(){o.del(n),i.app.trigger("change")}})}for(var i=this,a=0,o=new n.View({title:e.title||"Repeat",min:e.min,max:e.max,onnew:function(){t(e.inputs),i.app.trigger("change")}}),l=r.size(e.cache),c=0;c").addClass("ui-form-info").html(e.help)),this.app.on("expand",function(e){t.$("#"+e).length>0&&t.expand()}),this._append(t.$el,e.id)},_addRow:function(e){var t=this,i=e.id;e.onchange=e.onchange||function(){t.app.trigger("change",i)};var n=this.parameters.create(e);this.app.field_list[i]=n;var a=new s(this.app,{name:e.name,label:e.hide_label?"":e.label||e.name,value:e.value,text_value:e.text_value,collapsible_value:e.collapsible_value,collapsible_preview:e.collapsible_preview,help:e.help,argument:e.argument,disabled:e.disabled,color:e.color,style:e.style,backdrop:e.backdrop,hidden:e.hidden,fixed:e.fixed,field:n});return this.app.element_list[i]=a,this._append(a.$el,e.id),n},_append:function(e,t){this.$el.append(e.addClass("section-row").attr("id",t))}});return{View:d}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){a.ajaxSettings.traditional=!0,n=[i(4),i(118),i(119),i(54)],s=function(e,t,i,n){return o.View.extend({grid:null,initialize:function(t){this.dict_format=t.dict_format;var i=this;window.add_tag_to_grid_filter=function(e,t){var n=e+(void 0!==t&&""!==t?":"+t:""),s=r("#advanced-search").is(":visible");s||(r("#standard-search").slideToggle("fast"),r("#advanced-search").slideToggle("fast")),i.add_filter_condition("tags",n)},this.dict_format?(this.setElement("
    "),t.url_base&&!t.items?e.get({url:t.url_base,success:function(e){i.init_grid(e)}}):this.init_grid(t)):(this.setElement("#grid-container"),this.init_grid(t)),t.use_panels&&r("#center").css({padding:"10px",overflow:"auto"})},handle_refresh:function(e){e&&r.inArray("history",e)>-1&&top.Galaxy&&top.Galaxy.currHistoryPanel&&top.Galaxy.currHistoryPanel.loadCurrentHistory()},init_grid:function(e){this.grid=new t(e);var n=this.grid.attributes;this.handle_refresh(n.refresh_frames);var s=this.grid.get("url_base");if(s=s.replace(/^.*\/\/[^\/]+/,""),this.grid.set("url_base",s),this.$el.html(i.grid(n)),this.$el.find("#grid-table-header").html(i.header(n)),this.$el.find("#grid-table-body").html(i.body(n)),this.$el.find("#grid-table-footer").html(i.footer(n)),n.message){this.$el.find("#grid-message").html(i.message(n));var a=this;n.use_hide_message&&setTimeout(function(){a.$el.find("#grid-message").html("")},5e3)}this.init_grid_elements(),this.init_grid_controls(),init_refresh_on_change()},init_grid_controls:function(){var e=this;this.$el.find(".operation-button").each(function(){r(this).off(),r(this).click(function(){return e.submit_operation(this),!1})}),this.$el.find("input[type=text]").each(function(){r(this).off(),r(this).click(function(){r(this).select()}).keyup(function(){r(this).css("font-style","normal")})}),this.$el.find(".sort-link").each(function(){r(this).off(),r(this).click(function(){return e.set_sort_condition(r(this).attr("sort_key")),!1})}),this.$el.find(".text-filter-form").each(function(){r(this).off(),r(this).submit(function(){var t=r(this).attr("column_key"),i=r("#input-"+t+"-filter"),n=i.val();return i.val(""),e.add_filter_condition(t,n),!1})}),this.$el.find(".text-filter-val > a").each(function(){r(this).off(),r(this).click(function(){return r(this).parent().remove(),e.remove_filter_condition(r(this).attr("filter_key"),r(this).attr("filter_val")),!1})}),this.$el.find(".categorical-filter > a").each(function(){r(this).off(),r(this).click(function(){return e.set_categorical_filter(r(this).attr("filter_key"),r(this).attr("filter_val")),!1})}),this.$el.find(".advanced-search-toggle").each(function(){r(this).off(),r(this).click(function(){return e.$el.find("#standard-search").slideToggle("fast"),e.$el.find("#advanced-search").slideToggle("fast"),!1})}),this.$el.find("#check_all").off(),this.$el.find("#check_all").on("click",function(){e.check_all_items()})},init_grid_elements:function(){this.$el.find(".grid").each(function(){var e=r(this).find("input.grid-row-select-checkbox"),t=r(this).find("span.grid-selected-count"),i=function(){t.text(r(e).filter(":checked").length)};r(e).each(function(){r(this).change(i)}),i()}),0!==this.$el.find(".community_rating_star").length&&this.$el.find(".community_rating_star").rating({});var e=this.grid.attributes,t=this;this.$el.find(".page-link > a").each(function(){r(this).click(function(){return t.set_page(r(this).attr("page_num")),!1})}),this.$el.find(".use-target").each(function(){r(this).click(function(e){return t.execute({href:r(this).attr("href"),target:r(this).attr("target")}),!1})});var i=e.items.length;0!=i&&l.each(e.items,function(i,s){var a=t.$("#grid-"+s+"-popup").off(),o=new n(a);l.each(e.operations,function(e){t._add_operation(o,e,i)})})},_add_operation:function(e,t,i){var n=this,s=i.operation_config[t.label];s.allowed&&t.allow_popup&&e.addItem({html:t.label,href:s.url_args,target:s.target,confirmation_text:t.confirm,func:function(e){e.preventDefault();var s=r(e.target).html();t.onclick?t.onclick(i.encode_id):n.execute(this.findItemByHtml(s))}})},add_filter_condition:function(e,t){if(""===t)return!1;this.grid.add_filter(e,t,!0);var n=r(i.filter_element(e,t)),s=this;n.click(function(){r(this).remove(),s.remove_filter_condition(e,t)});var a=this.$el.find("#"+e+"-filtering-criteria");a.append(n),this.go_page_one(),this.execute()},remove_filter_condition:function(e,t){this.grid.remove_filter(e,t),this.go_page_one(),this.execute()},set_sort_condition:function(e){var t=this.grid.get("sort_key"),i=e;t.indexOf(e)!==-1&&"-"!==t.substring(0,1)&&(i="-"+e),this.$el.find(".sort-arrow").remove();var n="-"==i.substring(0,1)?"↑":"↓",s=r(""+n+"").addClass("sort-arrow");this.$el.find("#"+e+"-header").append(s),this.grid.set("sort_key",i),this.go_page_one(),this.execute()},set_categorical_filter:function(e,t){var i=this.grid.get("categorical_filters")[e],n=this.grid.get("filters")[e],s=this;this.$el.find("."+e+"-filter").each(function(){var a=r.trim(r(this).text()),o=i[a],l=o[e];if(l==t)r(this).empty(),r(this).addClass("current-filter"),r(this).append(a);else if(l==n){r(this).empty();var c=r(''+a+"");c.click(function(){s.set_categorical_filter(e,l)}),r(this).removeClass("current-filter"),r(this).append(c)}}),this.grid.add_filter(e,t),this.go_page_one(),this.execute()},set_page:function(e){var t=this;this.$el.find(".page-link").each(function(){var i,n=r(this).attr("id"),s=parseInt(n.split("-")[2],10),a=t.grid.get("cur_page");if(s===e)i=r(this).children().text(),r(this).empty(),r(this).addClass("inactive-link"),r(this).text(i);else if(s===a){i=r(this).text(),r(this).empty(),r(this).removeClass("inactive-link");var o=r(''+i+"");o.click(function(){t.set_page(s)}),r(this).append(o)}}),"all"===e?this.grid.set("cur_page",e):this.grid.set("cur_page",parseInt(e,10)),this.execute()},submit_operation:function(e,t){var i=r(e).val(),n=this.$el.find('input[name="id"]:checked').length;if(!n>0)return!1;var s=l.findWhere(this.grid.attributes.operations,{label:i});s&&!t&&(t=s.confirm||"");var a=[];return this.$el.find("input[name=id]:checked").each(function(){a.push(r(this).val())}),this.execute({operation:i,id:a,confirmation_text:t}),!0},check_all_items:function(){var e,t=document.getElementById("check_all"),i=document.getElementsByTagName("input"),n=0;if(t.checked===!0)for(e=0;e1)for(var r=o[1],l=r.split("&"),c=0;c0?t():n._fetchContentRelatedAttributes().done(function(e){n.numOfUnfinishedJobs()>0?t():n.trigger("ready")})}},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},parse:function(e,t){var i=a.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},fetchWithContents:function(e,t){e=e||{};var i=this;return e.view="dev-detailed",this.fetch(e).then(function(e){return i.contents.history=i,i.contents.setHistoryId(e.id),i.fetchContents(t)})},fetchContents:function(e){e=e||{};var t=this;return t.lastUpdateTime=new Date,t.contents.fetchCurrentPage(e)},_delete:function(e){return this.get("deleted")?o.when():this.save({deleted:!0},e)},purge:function(e){return this.get("purged")?o.when():this.save({deleted:!0,purged:!0},e)},undelete:function(e){return this.get("deleted")?this.save({deleted:!1},e):o.when()},copy:function(e,t,i){if(e=void 0===e||e,!this.id)throw new Error("You must set the history ID before copying it.");var n={history_id:this.id};e&&(n.current=!0),t&&(n.name=t),i||(n.all_datasets=!1),n.view="dev-detailed";var s=this,a=o.post(this.urlRoot,n);return e?a.then(function(e){var t=new d(e);return t.setAsCurrent().done(function(){s.trigger("copied",s,e)})}):a.done(function(e){s.trigger("copied",s,e)})},setAsCurrent:function(){var e=this,t=o.getJSON(Galaxy.root+"history/set_as_current?id="+this.id);return t.done(function(){e.trigger("set-as-current",e)}),t},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}})),h=i.InfinitelyScrollingCollection,u=h.extend(s.LoggableMixin).extend({_logNamespace:"history",model:d,order:"update_time",limitOnFirstFetch:10,limitPerFetch:10,initialize:function(e,t){t=t||{},this.log("HistoryCollection.initialize",e,t),h.prototype.initialize.call(this,e,t),this.includeDeleted=t.includeDeleted||!1,this.currentHistoryId=t.currentHistoryId,this.setUpListeners()},urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot},setUpListeners:function(){return this.on({"change:deleted":function(e){this.debug("change:deleted",this.includeDeleted,e.get("deleted")),!this.includeDeleted&&e.get("deleted")&&this.remove(e)},copied:function(e,t){this.setCurrent(new d(t,[]))},"set-as-current":function(e){var t=this.currentHistoryId;this.trigger("no-longer-current",t),this.currentHistoryId=e.id}})},_buildFetchData:function(e){return r.extend(h.prototype._buildFetchData.call(this,e),{view:"dev-detailed"})},_buildFetchFilters:function(e){var t=h.prototype._buildFetchFilters.call(this,e)||{},i={};return this.includeDeleted?i.deleted=null:(i.deleted=!1,i.purged=!1),r.defaults(t,i)},fetchFirst:function(e){var t=this,i=l.when();return this.currentHistoryId&&(i=h.prototype.fetchFirst.call(t,{silent:!0,limit:1,filters:{purged:"",deleted:"","encoded_id-in":this.currentHistoryId}})),i.then(function(){return e=e||{},e.offset=0,t.fetchMore(e)})},comparators:r.extend(r.clone(h.prototype.comparators),{name:s.buildComparator("name",{ascending:!0}),"name-dsc":s.buildComparator("name",{ascending:!1}),size:s.buildComparator("size",{ascending:!1}),"size-asc":s.buildComparator("size",{ascending:!0})}),sort:function(e){e=e||{};var t=e.silent,i=this.remove(this.get(this.currentHistoryId));return h.prototype.sort.call(this,r.defaults({silent:!0},e)),this.unshift(i,{silent:!0}),t||this.trigger("sort",this,e),this},create:function(e,t,i,n){var s=this,a=o.getJSON(Galaxy.root+"history/create_new_current");return a.done(function(e){s.setCurrent(new d(e,[],i||{}))})},setCurrent:function(e,t){return t=t||{},this.unshift(e,t),this.currentHistoryId=e.get("id"),t.silent||this.trigger("new-current",e,this),this},toString:function(){return"HistoryCollection("+this.length+",current:"+this.currentHistoryId+")"}});return{History:d,HistoryCollection:u}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a){n=[i(6)],s=function(e){"use strict";var t=e.SessionStorageModel.extend({defaults:{expandedIds:{},show_deleted:!1,show_hidden:!1},addExpanded:function(e){var t=this.get("expandedIds");t[e.id]=e.get("id"),this.save("expandedIds",t)},removeExpanded:function(e){var t=this.get("expandedIds");delete t[e.id],this.save("expandedIds",t)},isExpanded:function(e){return a.result(this.get("expandedIds"),e,!1)},allExpanded:function(){return a.values(this.get("expandedIds"))},clearExpanded:function(){this.set("expandedIds",{})},includeDeleted:function(e){return a.isUndefined(e)||this.set("show_deleted",e),this.get("show_deleted")},includeHidden:function(e){return a.isUndefined(e)||this.set("show_hidden",e),this.get("show_hidden")},toString:function(){return"HistoryPrefs("+this.id+")"}},{storageKeyPrefix:"history:",historyStorageKey:function(e){if(!e)throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+e);return t.storageKeyPrefix+e},get:function(e){return new t({id:t.historyStorageKey(e)})},clearAll:function(e){for(var i in sessionStorage)0===i.indexOf(t.storageKeyPrefix)&&sessionStorage.removeItem(i)}});return{HistoryPrefs:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(6),i(5)],s=function(e,t){"use strict";var i="list",n=a.View.extend(e.LoggableMixin).extend({_logNamespace:i,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=o(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)):o(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",r.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=o(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()?l.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)})}}),s=n.extend(e.mixin(e.SelectableViewMixin,e.DraggableViewMixin,{tagName:"div",className:"list-item",initialize:function(t){n.prototype.initialize.call(this,t),e.SelectableViewMixin.initialize.call(this,t),e.DraggableViewMixin.initialize.call(this,t),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=n.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 n.prototype._swapNewRender.call(this,e),this.selectable&&this.showSelector(0),this.draggable&&this.draggableOn(),this.$el},_renderWarnings:function(){var e=this,t=o('
    '),i=e.model.toJSON();return r.each(e.templates.warnings,function(n){t.append(o(n(i,e)))}),t},_renderTitleBar:function(){return o(this.templates.titleBar(this.model.toJSON(),this))},_renderPrimaryActions:function(){return[]},_renderSubtitle:function(){return o(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){var t=32,i=13;return!e||"keydown"!==e.type||e.keyCode!==t&&e.keyCode!==i||(this.toggleExpanded(),e.stopPropagation(),!1)},toString:function(){var e=this.model?this.model+"":"(no model)";return"ListItemView("+e+")"}}));s.prototype.templates=function(){var t=e.wrapTemplate(['
    ','
    ','
    ','',"
    ",'
    ','
    ','
    ',"
    "]),i={},n=e.wrapTemplate(['
    ','','
    ','<%- element.name %>',"
    ",'
    ',"
    "],"element"),s=e.wrapTemplate(['
    ']),a=e.wrapTemplate(['
    ']);return{el:t,warnings:i,titleBar:n,subtitle:s,details:a}}();var c=s.extend({foldoutStyle:"foldout",foldoutPanelClass:null,initialize:function(e){"drilldown"===this.foldoutStyle&&(this.expanded=!1),this.foldoutStyle=e.foldoutStyle||this.foldoutStyle,this.foldoutPanelClass=e.foldoutPanelClass||this.foldoutPanelClass,s.prototype.initialize.call(this,e),this.foldout=this._createFoldoutPanel()},_renderDetails:function(){if("drilldown"===this.foldoutStyle)return o();var e=s.prototype._renderDetails.call(this);return this._attachFoldout(this.foldout,e)},_createFoldoutPanel:function(){var e=this.model,t=this._getFoldoutPanelClass(e),i=this._getFoldoutPanelOptions(e),n=new t(r.extend(i,{model:e}));return n},_getFoldoutPanelClass:function(){return this.foldoutPanelClass},_getFoldoutPanelOptions:function(){return{foldoutStyle:this.foldoutStyle,fxSpeed:this.fxSpeed}},_attachFoldout:function(e,t){return t=t||this.$("> .details"),this.foldout=e.render(0),e.$("> .controls").hide(),t.append(e.$el)},expand:function(){var e=this;return e._fetchModelDetails().always(function(){"foldout"===e.foldoutStyle?e._expand():"drilldown"===e.foldoutStyle&&e._expandByDrilldown()})},_expandByDrilldown:function(){var e=this;e.listenTo(e.foldout,"close",function(){e.trigger("collapsed:drilldown",e,e.foldout)}),e.trigger("expanded:drilldown",e,e.foldout)}});return c.prototype.templates=function(){var t=e.wrapTemplate(['
    ',"
    "],"collection");return r.extend({},s.prototype.templates,{details:t})}(),{ExpandableView:n,ListItemView:s,FoldoutListItemView:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(6),i(5)],s=function(e,t){var i=a.View.extend(e.LoggableMixin).extend(e.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(e){e.usePrompt===!1?this.label="":this.label='",this.hiddenUntilActivated(e.$activator,e)},render:function(){var e=this;return this.$el.html(this._template()),this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return e._getTagsUsed()}}),this._setUpBehaviors(),this},_hashToName:function(e){return e.startsWith("#")?"name:"+e.slice(1):e},_nameToHash:function(e){return e.startsWith("name:")&&(e="#"+e.slice(5)),e},_template:function(){return[this.label,''].join("")},tagsToCSV:function(){var e=this,t=this.model.get("tags");return!o.isArray(t)||o.isEmpty(t)?"":t.map(function(t){return o.escape(e._nameToHash(t))}).sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){var e=this;return o.map(Galaxy.user.get("tags_used"),e._nameToHash)},_setUpBehaviors:function(){var e=this;this.$input().on("change",function(t){t.val=o.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");o.contains(t,e)||(t.push(e),t.sort(),Galaxy.user.set("tags_used",t))},remove:function(){this.$input.off(),this.stopListening(this.model),a.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:i}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2))},function(e,t,i){var n,s;(function(a,o){n=[i(2),i(19),i(10),i(28)],s=function(e,t,i,n){"use strict";var s={hidden:!1,show:function(){this.set("hidden",!1)},hide:function(){this.set("hidden",!0)},toggle:function(){this.set("hidden",!this.get("hidden"))},is_visible:function(){return!this.attributes.hidden}},r=a.Model.extend({defaults:{name:null,label:null,type:null,value:null,html:null,num_samples:5},initialize:function(e){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new r(this.toJSON())},set_value:function(e){this.set("value",e||"")}}),l=a.Collection.extend({model:r}),c=r.extend({}),d=r.extend({set_value:function(e){this.set("value",parseInt(e,10))},get_samples:function(){return d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}}),h=d.extend({set_value:function(e){this.set("value",parseFloat(e))}}),u=r.extend({get_samples:function(){return e.map(this.get("options"),function(e){return e[0]})}});r.subModelTypes={integer:d,float:h,data:c,select:u};var p=a.Model.extend({defaults:{id:null,name:null,description:null,target:null,inputs:[],outputs:[]},urlRoot:Galaxy.root+"api/tools",initialize:function(t){this.set("inputs",new l(e.map(t.inputs,function(e){var t=r.subModelTypes[e.type]||r;return new t(e)})))},toJSON:function(){var e=a.Model.prototype.toJSON.call(this);return e.inputs=this.get("inputs").map(function(e){return e.toJSON()}),e},remove_inputs:function(e){var t=this,i=t.get("inputs").filter(function(t){return e.indexOf(t.get("type"))!==-1});t.get("inputs").remove(i)},copy:function(e){var t=new p(this.toJSON());if(e){var i=new a.Collection;t.get("inputs").each(function(e){e.get_samples()&&i.push(e)}),t.set("inputs",i)}return t},apply_search_results:function(t){return e.indexOf(t,this.attributes.id)!==-1?this.show():this.hide(),this.is_visible()},set_input_value:function(e,t){this.get("inputs").find(function(t){return t.get("name")===e}).set("value",t)},set_input_values:function(t){var i=this;e.each(e.keys(t),function(e){i.set_input_value(e,t[e])})},run:function(){return this._run()},rerun:function(e,t){return this._run({action:"rerun",target_dataset_id:e.id,regions:t})},get_inputs_dict:function(){var e={};return this.get("inputs").each(function(t){e[t.get("name")]=t.get("value")}),e},_run:function(n){var s=e.extend({tool_id:this.id,inputs:this.get_inputs_dict()},n),a=o.Deferred(),r=new t.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(s),dataType:"json",contentType:"application/json",type:"POST"},interval:2e3,success_fn:function(e){return"pending"!==e}});return o.when(r.go()).then(function(e){a.resolve(new i.DatasetCollection(e))}),a}});e.extend(p.prototype,s);var f=(a.View.extend({}),a.Collection.extend({model:p})),g=a.Model.extend(s),m=a.Model.extend({defaults:{elems:[],open:!1},clear_search_results:function(){e.each(this.attributes.elems,function(e){e.show()}),this.show(),this.set("open",!1)},apply_search_results:function(t){var i,n=!0;e.each(this.attributes.elems,function(e){e instanceof g?(i=e,i.hide()):e instanceof p&&e.apply_search_results(t)&&(n=!1,i&&i.show())}),n?this.hide():(this.show(),this.set("open",!0))}});e.extend(m.prototype,s);var v=a.Model.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,clear_btn_url:"",visible:!0,query:"",results:null,clear_key:27},urlRoot:Galaxy.root+"api/tools",initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var e=this.attributes.query;if(e.length");e.append(E.tool_link(this.model.toJSON()));var t=this.model.get("form_style",null);if("upload1"===this.model.id)e.find("a").on("click",function(e){e.preventDefault(),Galaxy.upload.show()});else if("regular"===t){var i=this;e.find("a").on("click",function(e){e.preventDefault(),Galaxy.router.push("/",{tool_id:i.model.id,version:i.model.get("version")})})}return this.$el.append(e),this}}),b=y.extend({tagName:"div",className:"toolPanelLabel",render:function(){return this.$el.append(o("").text(this.model.attributes.text)),this}}),x=y.extend({tagName:"div",className:"toolSectionWrapper",initialize:function(){y.prototype.initialize.call(this),this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(E.panel_section(this.model.toJSON()));var t=this.$el.find(".toolSectionBody");return e.each(this.model.attributes.elems,function(e){if(e instanceof p){var i=new w({model:e,className:"toolTitle"});i.render(),t.append(i.$el)}else if(e instanceof g){var n=new b({model:e});n.render(),t.append(n.$el)}}),this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast")}}),C=a.View.extend({tagName:"div",id:"tool-search",className:"bar",events:{click:"focus_and_select","keyup :input":"query_changed","change :input":"query_changed","click #search-clear-btn":"clear"},render:function(){return this.$el.append(E.tool_search(this.model.toJSON())),this.model.is_visible()||this.$el.hide(),o("#messagebox").is(":visible")&&this.$el.css("top","95px"),this.$el.find("[title]").tooltip(),this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){return this.model.clear_search(),this.$el.find(":input").val(""),this.focus_and_select(),!1},query_changed:function(e){return this.model.attributes.clear_key&&this.model.attributes.clear_key===e.which?(this.clear(),!1):void this.model.set("query",this.$el.find(":input").val())}}),$=a.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.model.get("tool_search").on("change:results",this.handle_search_results,this)},render:function(){var e=this,t=new C({model:this.model.get("tool_search")});return t.render(),e.$el.append(t.$el),this.model.get("layout").each(function(t){if(t instanceof m){var i=new x({model:t});i.render(),e.$el.append(i.$el)}else if(t instanceof p){var n=new w({model:t,className:"toolTitleNoSection"});n.render(),e.$el.append(n.$el)}else if(t instanceof g){var s=new b({model:t});s.render(),e.$el.append(s.$el)}}),e.$el.find("a.tool-link").click(function(t){var i=o(this).attr("class").split(/\s+/)[0],n=e.model.get("tools").get(i);e.trigger("tool_link_click",t,n)}),this},handle_search_results:function(){var e=this.model.get("tool_search").get("results");e&&0===e.length?o("#search-no-results").show():o("#search-no-results").hide()}}),k=a.View.extend({className:"toolForm",render:function(){this.$el.children().remove(),this.$el.append(E.tool_form(this.model.toJSON()))}}),E=(a.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new $({collection:this.collection}),this.tool_form_view=new k},render:function(){this.tool_panel_view.render(),this.tool_panel_view.$el.css("float","left"),this.$el.append(this.tool_panel_view.$el),this.tool_form_view.$el.hide(),this.$el.append(this.tool_form_view.$el);var e=this;this.tool_panel_view.on("tool_link_click",function(t,i){t.preventDefault(),e.show_tool(i)})},show_tool:function(e){var t=this;e.fetch().done(function(){t.tool_form_view.model=e,t.tool_form_view.render(),t.tool_form_view.$el.show(),o("#left").width("650px")})}}),{tool_search:e.template(['',' ',''].join("")),panel_section:e.template(['",'