From 296105ee395194c48d962671a8c367469ea74907 Mon Sep 17 00:00:00 2001 From: Brad Langhorst Date: Sun, 26 Aug 2018 12:20:47 -0400 Subject: [PATCH 1/2] row ids that are all numeric become ints... Since the "F" prefix is checked with substring, row_id must always be a string --- .../scripts/mvc/library/library-foldertoolbar-view.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js index 2164fcabaf8..5c124cacca5 100644 --- a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js +++ b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js @@ -1072,7 +1072,8 @@ var FolderToolbarView = Backbone.View.extend({ $checkedValues.each(function() { var row_id = $(this) .closest("tr") - .data("id"); + .data("id") + .toString(); if (row_id !== undefined) { if (row_id.substring(0, 1) == "F") { folder_ids.push(row_id); @@ -1201,7 +1202,8 @@ var FolderToolbarView = Backbone.View.extend({ this.findCheckedRows().each(function() { var row_id = $(this) .closest("tr") - .data("id"); + .data("id") + .toString(); if (row_id.substring(0, 1) == "F") { folder_ids.push(row_id); } else { From 55d350d015f20afc1c350130caaa0aa9858b7aa0 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 26 Aug 2018 20:36:51 +0200 Subject: [PATCH 2/2] Add static for 2a148ff1ec37c68e280c431fceee88ee0510e017 --- static/scripts/admin.toolshed.js | 3 ++- static/scripts/bundled/admin.bundled.js | 3 ++- static/scripts/bundled/analysis.bundled.js | 3 ++- static/scripts/bundled/chart.bundled.js | 3 ++- static/scripts/bundled/extended.bundled.js | 3 ++- static/scripts/bundled/libs.bundled.js | 3 ++- static/scripts/bundled/login.bundled.js | 3 ++- static/scripts/galaxy.interactive_environments.js | 3 ++- static/scripts/galaxy.js | 3 ++- static/scripts/galaxy.library.js | 3 ++- static/scripts/galaxy.pages.js | 3 ++- static/scripts/i18n.js | 3 ++- static/scripts/layout/communication-server-view.js | 3 ++- static/scripts/layout/masthead.js | 3 ++- static/scripts/layout/menu.js | 3 ++- static/scripts/layout/modal.js | 3 ++- static/scripts/layout/page.js | 3 ++- static/scripts/layout/panel.js | 3 ++- static/scripts/layout/router.js | 3 ++- static/scripts/layout/scratchbook.js | 3 ++- static/scripts/legacy/grid/grid-model.js | 3 ++- static/scripts/legacy/grid/grid-template.js | 3 ++- static/scripts/legacy/grid/grid-view.js | 3 ++- static/scripts/mocha/test.js | 3 ++- static/scripts/mocha/tests/rules_tests.js | 3 ++- static/scripts/mvc/annotation.js | 3 ++- static/scripts/mvc/base-mvc.js | 3 ++- static/scripts/mvc/base/controlled-fetch-collection.js | 3 ++- static/scripts/mvc/collection/base-creator.js | 3 ++- static/scripts/mvc/collection/collection-li-edit.js | 3 ++- static/scripts/mvc/collection/collection-li.js | 3 ++- static/scripts/mvc/collection/collection-model.js | 3 ++- static/scripts/mvc/collection/collection-view-edit.js | 3 ++- static/scripts/mvc/collection/collection-view.js | 3 ++- static/scripts/mvc/collection/list-collection-creator.js | 3 ++- .../scripts/mvc/collection/list-of-pairs-collection-creator.js | 3 ++- static/scripts/mvc/collection/pair-collection-creator.js | 3 ++- static/scripts/mvc/dataset/data.js | 3 ++- static/scripts/mvc/dataset/dataset-choice.js | 3 ++- static/scripts/mvc/dataset/dataset-edit-attributes.js | 3 ++- static/scripts/mvc/dataset/dataset-error.js | 3 ++- static/scripts/mvc/dataset/dataset-li-edit.js | 3 ++- static/scripts/mvc/dataset/dataset-li.js | 3 ++- static/scripts/mvc/dataset/dataset-list.js | 3 ++- static/scripts/mvc/dataset/dataset-model.js | 3 ++- static/scripts/mvc/dataset/states.js | 3 ++- static/scripts/mvc/form/form-data.js | 3 ++- static/scripts/mvc/form/form-input.js | 3 ++- static/scripts/mvc/form/form-parameters.js | 3 ++- static/scripts/mvc/form/form-repeat.js | 3 ++- static/scripts/mvc/form/form-section.js | 3 ++- static/scripts/mvc/form/form-view.js | 3 ++- static/scripts/mvc/form/form-wrapper.js | 3 ++- static/scripts/mvc/grid/grid-model.js | 3 ++- static/scripts/mvc/grid/grid-shared.js | 3 ++- static/scripts/mvc/grid/grid-template.js | 3 ++- static/scripts/mvc/grid/grid-view.js | 3 ++- static/scripts/mvc/history/copy-dialog.js | 3 ++- static/scripts/mvc/history/hda-li-edit.js | 3 ++- static/scripts/mvc/history/hda-li.js | 3 ++- static/scripts/mvc/history/hda-model.js | 3 ++- static/scripts/mvc/history/hdca-li-edit.js | 3 ++- static/scripts/mvc/history/hdca-li.js | 3 ++- static/scripts/mvc/history/hdca-model.js | 3 ++- static/scripts/mvc/history/history-content-model.js | 3 ++- static/scripts/mvc/history/history-contents.js | 3 ++- static/scripts/mvc/history/history-item-li.js | 3 ++- static/scripts/mvc/history/history-list.js | 3 ++- static/scripts/mvc/history/history-model.js | 3 ++- static/scripts/mvc/history/history-preferences.js | 3 ++- static/scripts/mvc/history/history-structure-view.js | 3 ++- static/scripts/mvc/history/history-view-annotated.js | 3 ++- static/scripts/mvc/history/history-view-edit-current.js | 3 ++- static/scripts/mvc/history/history-view-edit.js | 3 ++- static/scripts/mvc/history/history-view.js | 3 ++- static/scripts/mvc/history/job-dag.js | 3 ++- static/scripts/mvc/history/job-states-model.js | 3 ++- static/scripts/mvc/history/multi-panel.js | 3 ++- static/scripts/mvc/history/options-menu.js | 3 ++- static/scripts/mvc/job/job-li.js | 3 ++- static/scripts/mvc/job/job-model.js | 3 ++- static/scripts/mvc/job/job-params.js | 3 ++- static/scripts/mvc/lazy/lazy-limited.js | 3 ++- static/scripts/mvc/library/library-dataset-view.js | 3 ++- static/scripts/mvc/library/library-folder-view.js | 3 ++- static/scripts/mvc/library/library-folderlist-view.js | 3 ++- static/scripts/mvc/library/library-folderrow-view.js | 3 ++- static/scripts/mvc/library/library-foldertoolbar-view.js | 3 ++- static/scripts/mvc/library/library-library-view.js | 3 ++- static/scripts/mvc/library/library-librarylist-view.js | 3 ++- static/scripts/mvc/library/library-libraryrow-view.js | 3 ++- static/scripts/mvc/library/library-librarytoolbar-view.js | 3 ++- static/scripts/mvc/library/library-model.js | 3 ++- static/scripts/mvc/library/library-util.js | 3 ++- static/scripts/mvc/list/list-item.js | 3 ++- static/scripts/mvc/list/list-view.js | 3 ++- static/scripts/mvc/rules/rule-definitions.js | 3 ++- static/scripts/mvc/tag.js | 3 ++- static/scripts/mvc/tool/tool-form-base.js | 3 ++- static/scripts/mvc/tool/tool-form-composite.js | 3 ++- static/scripts/mvc/tool/tool-form.js | 3 ++- static/scripts/mvc/tool/tool-genomespace.js | 3 ++- static/scripts/mvc/tool/tools.js | 3 ++- static/scripts/mvc/toolshed/categories-view.js | 3 ++- static/scripts/mvc/toolshed/repo-queue-view.js | 3 ++- static/scripts/mvc/toolshed/repo-status-view.js | 3 ++- static/scripts/mvc/toolshed/repositories-view.js | 3 ++- static/scripts/mvc/toolshed/repository-queue-view.js | 3 ++- static/scripts/mvc/toolshed/repository-view.js | 3 ++- static/scripts/mvc/toolshed/shed-list-view.js | 3 ++- static/scripts/mvc/toolshed/toolshed-model.js | 3 ++- static/scripts/mvc/toolshed/util.js | 3 ++- static/scripts/mvc/toolshed/workflows-view.js | 3 ++- static/scripts/mvc/tours.js | 3 ++- static/scripts/mvc/ui/error-modal.js | 3 ++- static/scripts/mvc/ui/icon-button.js | 3 ++- static/scripts/mvc/ui/popup-menu.js | 3 ++- static/scripts/mvc/ui/ui-buttons.js | 3 ++- static/scripts/mvc/ui/ui-color-picker.js | 3 ++- static/scripts/mvc/ui/ui-drilldown.js | 3 ++- static/scripts/mvc/ui/ui-frames.js | 3 ++- static/scripts/mvc/ui/ui-list.js | 3 ++- static/scripts/mvc/ui/ui-misc.js | 3 ++- static/scripts/mvc/ui/ui-modal.js | 3 ++- static/scripts/mvc/ui/ui-options.js | 3 ++- static/scripts/mvc/ui/ui-popover.js | 3 ++- static/scripts/mvc/ui/ui-portlet.js | 3 ++- static/scripts/mvc/ui/ui-rules-edit.js | 3 ++- static/scripts/mvc/ui/ui-select-content.js | 3 ++- static/scripts/mvc/ui/ui-select-default.js | 3 ++- static/scripts/mvc/ui/ui-select-ftp.js | 3 ++- static/scripts/mvc/ui/ui-select-genomespace.js | 3 ++- static/scripts/mvc/ui/ui-select-library.js | 3 ++- static/scripts/mvc/ui/ui-select.js | 3 ++- static/scripts/mvc/ui/ui-slider.js | 3 ++- static/scripts/mvc/ui/ui-table.js | 3 ++- static/scripts/mvc/ui/ui-tabs.js | 3 ++- static/scripts/mvc/ui/ui-thumbnails.js | 3 ++- static/scripts/mvc/upload/collection/collection-row.js | 3 ++- static/scripts/mvc/upload/collection/collection-view.js | 3 ++- static/scripts/mvc/upload/collection/rules-input-view.js | 3 ++- static/scripts/mvc/upload/composite/composite-row.js | 3 ++- static/scripts/mvc/upload/composite/composite-view.js | 3 ++- static/scripts/mvc/upload/default/default-row.js | 3 ++- static/scripts/mvc/upload/default/default-view.js | 3 ++- static/scripts/mvc/upload/upload-button.js | 3 ++- static/scripts/mvc/upload/upload-extension.js | 3 ++- static/scripts/mvc/upload/upload-ftp.js | 3 ++- static/scripts/mvc/upload/upload-model.js | 3 ++- static/scripts/mvc/upload/upload-settings.js | 3 ++- static/scripts/mvc/upload/upload-utils.js | 3 ++- static/scripts/mvc/upload/upload-view.js | 3 ++- static/scripts/mvc/user/user-custom-builds.js | 3 ++- static/scripts/mvc/user/user-model.js | 3 ++- static/scripts/mvc/user/user-preferences.js | 3 ++- static/scripts/mvc/user/user-quotameter.js | 3 ++- static/scripts/mvc/visualization/chart/chart-client.js | 3 ++- static/scripts/mvc/visualization/chart/components/model.js | 3 ++- .../scripts/mvc/visualization/chart/components/screenshot.js | 3 ++- static/scripts/mvc/visualization/chart/utilities/datasets.js | 3 ++- static/scripts/mvc/visualization/chart/utilities/jobs.js | 3 ++- static/scripts/mvc/visualization/chart/utilities/series.js | 3 ++- static/scripts/mvc/visualization/chart/views/description.js | 3 ++- static/scripts/mvc/visualization/chart/views/editor.js | 3 ++- static/scripts/mvc/visualization/chart/views/groups.js | 3 ++- static/scripts/mvc/visualization/chart/views/menu.js | 3 ++- static/scripts/mvc/visualization/chart/views/settings.js | 3 ++- static/scripts/mvc/visualization/chart/views/viewer.js | 3 ++- static/scripts/mvc/visualization/visualization-model.js | 3 ++- static/scripts/mvc/webhooks.js | 3 ++- static/scripts/mvc/workflow/workflow-canvas.js | 3 ++- static/scripts/mvc/workflow/workflow-connector.js | 3 ++- static/scripts/mvc/workflow/workflow-forms.js | 3 ++- static/scripts/mvc/workflow/workflow-icons.js | 3 ++- static/scripts/mvc/workflow/workflow-manager.js | 3 ++- static/scripts/mvc/workflow/workflow-model.js | 3 ++- static/scripts/mvc/workflow/workflow-node.js | 3 ++- static/scripts/mvc/workflow/workflow-terminals.js | 3 ++- static/scripts/mvc/workflow/workflow-view-data.js | 3 ++- static/scripts/mvc/workflow/workflow-view-node.js | 3 ++- static/scripts/mvc/workflow/workflow-view-terminals.js | 3 ++- static/scripts/mvc/workflow/workflow-view.js | 3 ++- static/scripts/mvc/workflow/workflow.js | 3 ++- static/scripts/nls/de/locale.js | 3 ++- static/scripts/nls/es/locale.js | 3 ++- static/scripts/nls/fr/locale.js | 3 ++- static/scripts/nls/ja/locale.js | 3 ++- static/scripts/nls/locale.js | 3 ++- static/scripts/nls/zh/locale.js | 3 ++- static/scripts/onload.js | 3 ++- static/scripts/polyfills.js | 3 ++- static/scripts/reports/run_stats.js | 3 ++- static/scripts/toolshed/groups/group-detail-view.js | 3 ++- static/scripts/toolshed/groups/group-list-view.js | 3 ++- static/scripts/toolshed/groups/group-listrow-view.js | 3 ++- static/scripts/toolshed/groups/group-model.js | 3 ++- static/scripts/toolshed/toolshed.groups.js | 3 ++- static/scripts/ui/autocom_tagging.js | 3 ++- static/scripts/ui/editable-text.js | 3 ++- static/scripts/ui/fa-icon-button.js | 3 ++- static/scripts/ui/filter-control.js | 3 ++- static/scripts/ui/hoverhighlight.js | 3 ++- static/scripts/ui/loading-indicator.js | 3 ++- static/scripts/ui/mode-button.js | 3 ++- static/scripts/ui/pagination.js | 3 ++- static/scripts/ui/peek-column-selector.js | 3 ++- static/scripts/ui/popupmenu.js | 3 ++- static/scripts/ui/scroll-panel.js | 3 ++- static/scripts/ui/search-input.js | 3 ++- static/scripts/utils/add-logging.js | 3 ++- static/scripts/utils/ajax-queue.js | 3 ++- static/scripts/utils/async-save-text.js | 3 ++- static/scripts/utils/config.js | 3 ++- static/scripts/utils/deferred.js | 3 ++- static/scripts/utils/graph.js | 3 ++- static/scripts/utils/levenshtein.js | 3 ++- static/scripts/utils/localization.js | 3 ++- static/scripts/utils/metrics-logger.js | 3 ++- static/scripts/utils/natural-sort.js | 3 ++- static/scripts/utils/query-string-parsing.js | 3 ++- static/scripts/utils/uploadbox.js | 3 ++- static/scripts/utils/utils.js | 3 ++- static/scripts/viz/bbi-data-manager.js | 3 ++- static/scripts/viz/circster.js | 3 ++- static/scripts/viz/phyloviz.js | 3 ++- static/scripts/viz/sweepster.js | 3 ++- static/scripts/viz/trackster.js | 3 ++- static/scripts/viz/trackster/filters.js | 3 ++- static/scripts/viz/trackster/painters.js | 3 ++- static/scripts/viz/trackster/slotting.js | 3 ++- static/scripts/viz/trackster/tracks.js | 3 ++- static/scripts/viz/trackster/util.js | 3 ++- static/scripts/viz/visualization.js | 3 ++- static/scripts/viz/viz_views.js | 3 ++- 234 files changed, 468 insertions(+), 234 deletions(-) diff --git a/static/scripts/admin.toolshed.js b/static/scripts/admin.toolshed.js index b673be740c2..a2fadfea25f 100644 --- a/static/scripts/admin.toolshed.js +++ b/static/scripts/admin.toolshed.js @@ -1 +1,2 @@ -define("admin.toolshed",["exports","mvc/toolshed/shed-list-view","mvc/toolshed/categories-view","mvc/toolshed/repositories-view","mvc/toolshed/repository-view","mvc/toolshed/repository-queue-view","mvc/toolshed/repo-status-view","mvc/toolshed/workflows-view"],function(e,o,t,a,i,s,d,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var l=n(o),p=n(t),h=n(a),u=n(i),w=n(s),m=n(d),y=n(r),c=Backbone.Router.extend({initialize:function(){this.routesHit=0,Backbone.history.on("route",function(){this.routesHit++},this),this.bind("route",this.trackPageview)},routes:{"":"toolsheds",sheds:"toolsheds",queue:"queue",workflows:"workflows","status/r/:repositories":"status",status:"status","categories/s/:tool_shed":"categories","category/s/:tool_shed/c/:cateory_id":"repositories","repository/s/:tool_shed/r/:repository_id":"repository"},back:function(){this.routesHit>1?window.history.back():this.navigate("#",{trigger:!0,replace:!0})}}),f=Backbone.View.extend({app_config:{known_views:["toolsheds","queue","status","categories","repositories","repoository"]},initialize:function(){Galaxy.admintoolshedapp=this,this.admin_toolshed_router=new c,this.admin_toolshed_router.on("route:queue",function(){Galaxy.admintoolshedapp.adminRepoQueueView?Galaxy.admintoolshedapp.adminRepoQueueView.reDraw():Galaxy.admintoolshedapp.adminRepoQueueView=new w.default.RepoQueueView}),this.admin_toolshed_router.on("route:toolsheds",function(){Galaxy.admintoolshedapp.adminShedListView?Galaxy.admintoolshedapp.adminShedListView.reDraw():Galaxy.admintoolshedapp.adminShedListView=new l.default.ShedListView}),this.admin_toolshed_router.on("route:categories",function(e){Galaxy.admintoolshedapp.adminShedCategoriesView?Galaxy.admintoolshedapp.adminShedCategoriesView.reDraw({tool_shed:e.replace(/\//g,"%2f")}):Galaxy.admintoolshedapp.adminShedCategoriesView=new p.default.CategoryView({tool_shed:e.replace(/\//g,"%2f")})}),this.admin_toolshed_router.on("route:repositories",function(e,o){Galaxy.admintoolshedapp.adminShedCategoryView?Galaxy.admintoolshedapp.adminShedCategoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),category_id:o}):Galaxy.admintoolshedapp.adminShedCategoryView=new h.default.Category({tool_shed:e.replace(/\//g,"%2f"),category_id:o})}),this.admin_toolshed_router.on("route:repository",function(e,o){Galaxy.admintoolshedapp.adminRepositoryView?Galaxy.admintoolshedapp.adminRepositoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),repository_id:o}):Galaxy.admintoolshedapp.adminRepositoryView=new u.default.RepoDetails({tool_shed:e.replace(/\//g,"%2f"),repository_id:o})}),this.admin_toolshed_router.on("route:status",function(e){Galaxy.admintoolshedapp.adminRepoStatusView?Galaxy.admintoolshedapp.adminRepoStatusView.reDraw({repositories:e.split("|")}):Galaxy.admintoolshedapp.adminRepoStatusView=new m.default.RepoStatus({repositories:e.split("|")})}),this.admin_toolshed_router.on("route:workflows",function(){Galaxy.admintoolshedapp.adminWorkflowsView?Galaxy.admintoolshedapp.adminWorkflowsView.reDraw():Galaxy.admintoolshedapp.adminWorkflowsView=new y.default.Workflows}),Backbone.history.start({pushState:!1})}});e.default={GalaxyApp:f}}); \ No newline at end of file +define("admin.toolshed",["exports","mvc/toolshed/shed-list-view","mvc/toolshed/categories-view","mvc/toolshed/repositories-view","mvc/toolshed/repository-view","mvc/toolshed/repository-queue-view","mvc/toolshed/repo-status-view","mvc/toolshed/workflows-view"],function(e,o,t,a,i,s,d,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var l=n(o),p=n(t),h=n(a),u=n(i),w=n(s),m=n(d),y=n(r),c=Backbone.Router.extend({initialize:function(){this.routesHit=0,Backbone.history.on("route",function(){this.routesHit++},this),this.bind("route",this.trackPageview)},routes:{"":"toolsheds",sheds:"toolsheds",queue:"queue",workflows:"workflows","status/r/:repositories":"status",status:"status","categories/s/:tool_shed":"categories","category/s/:tool_shed/c/:cateory_id":"repositories","repository/s/:tool_shed/r/:repository_id":"repository"},back:function(){this.routesHit>1?window.history.back():this.navigate("#",{trigger:!0,replace:!0})}}),f=Backbone.View.extend({app_config:{known_views:["toolsheds","queue","status","categories","repositories","repoository"]},initialize:function(){Galaxy.admintoolshedapp=this,this.admin_toolshed_router=new c,this.admin_toolshed_router.on("route:queue",function(){Galaxy.admintoolshedapp.adminRepoQueueView?Galaxy.admintoolshedapp.adminRepoQueueView.reDraw():Galaxy.admintoolshedapp.adminRepoQueueView=new w.default.RepoQueueView}),this.admin_toolshed_router.on("route:toolsheds",function(){Galaxy.admintoolshedapp.adminShedListView?Galaxy.admintoolshedapp.adminShedListView.reDraw():Galaxy.admintoolshedapp.adminShedListView=new l.default.ShedListView}),this.admin_toolshed_router.on("route:categories",function(e){Galaxy.admintoolshedapp.adminShedCategoriesView?Galaxy.admintoolshedapp.adminShedCategoriesView.reDraw({tool_shed:e.replace(/\//g,"%2f")}):Galaxy.admintoolshedapp.adminShedCategoriesView=new p.default.CategoryView({tool_shed:e.replace(/\//g,"%2f")})}),this.admin_toolshed_router.on("route:repositories",function(e,o){Galaxy.admintoolshedapp.adminShedCategoryView?Galaxy.admintoolshedapp.adminShedCategoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),category_id:o}):Galaxy.admintoolshedapp.adminShedCategoryView=new h.default.Category({tool_shed:e.replace(/\//g,"%2f"),category_id:o})}),this.admin_toolshed_router.on("route:repository",function(e,o){Galaxy.admintoolshedapp.adminRepositoryView?Galaxy.admintoolshedapp.adminRepositoryView.reDraw({tool_shed:e.replace(/\//g,"%2f"),repository_id:o}):Galaxy.admintoolshedapp.adminRepositoryView=new u.default.RepoDetails({tool_shed:e.replace(/\//g,"%2f"),repository_id:o})}),this.admin_toolshed_router.on("route:status",function(e){Galaxy.admintoolshedapp.adminRepoStatusView?Galaxy.admintoolshedapp.adminRepoStatusView.reDraw({repositories:e.split("|")}):Galaxy.admintoolshedapp.adminRepoStatusView=new m.default.RepoStatus({repositories:e.split("|")})}),this.admin_toolshed_router.on("route:workflows",function(){Galaxy.admintoolshedapp.adminWorkflowsView?Galaxy.admintoolshedapp.adminWorkflowsView.reDraw():Galaxy.admintoolshedapp.adminWorkflowsView=new y.default.Workflows}),Backbone.history.start({pushState:!1})}});e.default={GalaxyApp:f}}); +//# sourceMappingURL=../maps/admin.toolshed.js.map diff --git a/static/scripts/bundled/admin.bundled.js b/static/scripts/bundled/admin.bundled.js index d3a3b52a729..4526e48ecb0 100644 --- a/static/scripts/bundled/admin.bundled.js +++ b/static/scripts/bundled/admin.bundled.js @@ -1 +1,2 @@ -webpackJsonp([2],{100:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.slashed_o="ø",e.slashed_O="Ø",e.slashedOUnicodeChart={o:e.slashed_o,O:e.slashed_O},e.slashedOUnicode=function(t){return e.slashedOUnicodeChart[t]}},101:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cyrillicUnicodeChart={CYRF:"Ф",CYRII:"І",CYROMEGA:"Ѡ",CYRG:"Г",cyrkvcrs:"ҝ",cyryo:"ё",CYRH:"Х",CYRZHDSC:"Җ",cyrphk:"ҧ",CYRTDSC:"Ҭ",CYRI:"И",cyryi:"ї",CYRDZHE:"Џ",cyriote:"ѥ",CYRK:"К",CYRSHHA:"Һ",CYRL:"Л",CYRM:"М",CYRCHLDSC:"Ӌ",CYRNJE:"Њ",CYRYAT:"Ѣ",CYRA:"А",CYRB:"Б",cyrchrdsc:"ҷ",cyrschwa:"ә",CYRDZE:"Ѕ",CYRIE:"Є",CYRC:"Ц",CYRZH:"Ж",CYRD:"Д",CYRABHCHDSC:"Ҿ",CYRFITA:"Ѳ",CYRE:"Е",CYRABHHA:"Ҩ",cyrya:"я",cyrdzhe:"џ",CYRIOTLYUS:"Ѩ",cyrsemisftsn:"ҍ",CYRV:"В",cyrishrt:"й",cyrdje:"ђ",cyrchldsc:"ӌ",CYRY:"Ү",cyrndsc:"ң",CYRZ:"З",CYRKHCRS:"Ҟ",CYRNG:"Ҥ",CYRCHRDSC:"Ҷ",CYRYHCRS:"Ұ",CYRSHCH:"Щ",CYRUSHRT:"Ў",cyryu:"ю",cyrksi:"ѯ",CYRN:"Н",CYRO:"О",CYRBYUS:"Ѫ",CYRP:"П",CYRZDSC:"Ҙ",CYRAE:"Ӕ",CYRR:"Р",CYRS:"С",CYRT:"Т",CYRABHCH:"Ҽ",cyruk:"ѹ",CYRU:"У",cyrii:"і",CYRSEMISFTSN:"Ҍ",cyrghcrs:"ғ",CYRISHRT:"Й",cyromegatitlo:"ѽ",cyrkbeak:"ҡ",cyrie:"є",cyrzdsc:"ҙ",CYRNDSC:"Ң",CYRGUP:"Ґ",cyrshch:"щ",CYRKHK:"Ӄ",cyrzh:"ж",CYRJE:"Ј",cyrthousands:"҂",cyrabhch:"ҽ",textnumero:"№",cyrng:"ҥ",CYRPSI:"Ѱ",CYRTETSE:"Ҵ",CYRIOTBYUS:"Ѭ",cyrnje:"њ",CYRIOTE:"Ѥ",cyrdze:"ѕ",cyrae:"ӕ",CYRHRDSN:"Ъ",CYRKOPPA:"Ҁ",CYRRTICK:"Ҏ",CYRSCHWA:"Ә",cyrtdsc:"ҭ",CYRGHK:"Ҕ",cyrabhha:"ҩ",cyrshha:"һ",CYRSH:"Ш",cyru:"у",cyrkhcrs:"ҟ",cyrt:"т",CYRERY:"Ы",cyrs:"с",cyrr:"р",CYROT:"Ѿ",cyrlyus:"ѧ",CYRNHK:"Ӈ",CYRSFTSN:"Ь",cyrghk:"ҕ",cyrp:"п",cyrabhdze:"ӡ",cyro:"о",CYRTSHE:"Ћ",cyrn:"н",CYRSDSC:"Ҫ",cyryhcrs:"ұ",cyrpsi:"ѱ",cyrz:"з",cyry:"ү",cyrje:"ј",cyrv:"в",cyrchvcrs:"ҹ",cyrkhk:"ӄ",cyre:"е",cyromega:"ѡ",cyrd:"д",cyrc:"ц",cyrb:"б",CYROTLD:"Ө",cyrgup:"ґ",CYRLJE:"Љ",cyra:"а",CYROMEGATITLO:"Ѽ",CYRGHCRS:"Ғ",CYRCHVCRS:"Ҹ",cyrm:"м",cyrl:"л",cyrsh:"ш",cyrk:"к",cyri:"и",cyrh:"х",CYRHDSC:"Ҳ",CYRIZH:"Ѵ",CYRABHDZE:"Ӡ",cyrkdsc:"қ",cyrg:"г",CYRCH:"Ч",cyrf:"ф",CYRYI:"Ї",cyrmillions:"҉",CYRKSI:"Ѯ",CYROMEGARND:"Ѻ",cyrot:"ѿ",cyrtetse:"ҵ",cyrhdsc:"ҳ",cyrushrt:"ў",cyriotlyus:"ѩ",CYRYA:"Я",cyrlje:"љ",cyrotld:"ө",CYRKDSC:"Қ",cyrhrdsn:"ъ",cyrrtick:"ҏ",cyrkoppa:"ҁ",CYRDJE:"Ђ",cyriotbyus:"ѭ",cyrhundredthousands:"҈",CYRpalochka:"Ӏ",CYRKVCRS:"Ҝ",cyromegarnd:"ѻ",cyrsftsn:"ь",cyrabhchdsc:"ҿ",cyrzhdsc:"җ",cyrerev:"э",CYRLYUS:"Ѧ",CYRKBEAK:"Ҡ",cyrery:"ы",CYREREV:"Э",cyrnhk:"ӈ",cyrsdsc:"ҫ",cyrch:"ч",cyrtshe:"ћ",CYRPHK:"Ҧ",CYRYO:"Ё",CYRYU:"Ю",CYRUK:"Ѹ"},e.cyrillicUnicode=function(t){return e.cyrillicUnicodeChart[t]}},102:function(t,e,i){"use strict";function n(t){return e.specialCharacters.hasOwnProperty(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.specialCharacters={i:"ı",j:"ȷ",oe:"œ",OE:"Œ",ae:"æ",AE:"Æ",aa:"å",AA:"Å",o:"ø",O:"Ø",ss:"ß",l:"ł",L:"Ł"},e.isSpecialCharacter=n,e.specialCharacter=function(t){return n(t)?e.specialCharacters[t]:void 0}},103:function(t,e,i){"use strict";function n(t,e){switch(t){case"cyrchar":var i=o.translateCharToCyrillic(e);if(i)return i;break;default:for(var n=0,s=[a.diacriticUnicode,r.formattingUnicode];n=e}),d=function(t,e){if(a.bwg.instrument&&console.log("level="+e+"; offset="+t+"; time="+(0|Date.now())),u+=t.length,1==t.length&&t[0]-a.cirTreeOffset==48&&a.cachedCirRoot)return p(a.cachedCirRoot,0,e),void(0===--u&&n.when(a.fetchFeatures(c,l)).then(function(t){r.resolve(t)}));for(var i,o=4+32*a.cirBlockSize,s=0;st||g==t&&w>=e)&&l.push({offset:b,size:y}),a+=32}else{for(var x=[],_=0;_t||g==t&&w>=e)&&x.push(b),a+=24}x.length>0&&d(x,r+1)}};return d([a.cirTreeOffset+48],1),r},u.prototype.fetchFeatures=function(t,e){var a=this,r=n.Deferred();if(e.sort(function(t,e){return(0|t.offset)-(0|e.offset)}),0===e.length)return[];var s=[],l=function(t,e,n,r){r||(r={});var o=new i;o._chromId=t,o.segment=a.bwg.idsToChroms[t],o.min=e,o.max=n,o.type=a.bwg.type;for(var l in r)o[l]=r[l];s.push(o)},u=function(){if(0===e.length){Date.now();return r.resolve(s)}var i=e[0];if(i.data)a.parseFeatures(i.data,l,t),e.splice(0,1),u();else{for(var c=i.offset,d=i.size,h=1;h0)r=p(t,i+2,o.size-2);else{var s=new Uint8Array(o.size);m(new Uint8Array(t,i,o.size),0,s,0,o.size),r=s.buffer}o.data=r,i+=o.size,++n}u()})}};return u(),r},u.prototype.parseFeatures=function(t,e,i){var r=new Uint8Array(t);if(this.isSummary)for(var o=new Int16Array(t),s=new Int32Array(t),l=new Float32Array(t),u=t.byteLength/32,c=0;cm&&(p=m),i(d,p,m)&&e(d,p,m,{score:T})}else console.log("Currently not handling bwgType="+C)}else{if("bigbed"!=this.bwg.type)throw Error("Don't know what to do with "+this.bwg.type);for(var A=0,z=this.bwg.definedFieldCount,P=this.bwg.schema;A0?R.split("\t"):[],E.length>0&&z>3&&(q.label=E[0]),E.length>1&&z>4){var T=parseInt(E[1]);isNaN(T)||(q.score=T)}if(E.length>2&&z>5&&(q.orientation=E[2]),E.length>5&&z>8){var $=E[5];M.test($)&&(q.itemRgb="rgb("+$+")")}if(E.length>z-3&&P)for(var I=z-3;I9){var H=q.geneName||E[9],Y=H;E.length>10&&(Y=E[10]),q.geneName2&&(Y=q.geneName2);var X=n.extend({},F);X.id=H,X.label=Y,X.type="gene",q.groups.push(X)}for(var J=[],W=0;WL){var at="+"==q.orientation?new h(L,G+3):new h(L-3,G),rt=_(tt,at);if(rt){q.type="translation";for(var ot=rt.ranges(),st=0,lt=0;ot[0].min()>et[lt].max();)lt++;for(var it=0;it=0&&ct<=2&&(q.readframe=ct,q.readframeExplicit=!0)}var dt=nt.max()-nt.min();st=(st+dt)%3,e(d,nt.min()+1,nt.max(),q)}}}}}}},u.prototype.getFirstAdjacent=function(t,e,i,n){var a=this.bwg.chromsToIDs[t];if(void 0===a)return n([]);this.getFirstAdjacentById(a,e,i,n)},u.prototype.getFirstAdjacentById=function(t,e,i,n){var a=this;if(!this.cirHeader)return void this.bwg.data.slice(this.cirTreeOffset,48).fetch(function(r){a.cirHeader=r;var o=new Int32Array(a.cirHeader);a.cirBlockSize=o[1],a.getFirstAdjacentById(t,e,i,n)});var r=null,o=-1,l=-1,u=0,c=(Date.now(),function(t,e){u+=t.length;for(var i,n=4+32*a.cirBlockSize,r=0;r0&&(0!=t||e>0)?a.getFirstAdjacentById(0,0,i,n):i<0&&(t!=a.bwg.maxID||e<1e9)?a.getFirstAdjacentById(a.bwg.maxID,1e9,i,n):n([]);a.fetchFeatures(function(n,a,r,o){return i<0&&(n0&&(n>t||a>e)},[r],function(t){for(var e=null,a=-1,r=-1,o=0;oa||c>r)||i>0&&(l0&&(y>t||y==t&&x>=e))&&(/_random/.exec(a.bwg.idsToChroms[w])||(null==r||i<0&&(y>o||y==o&&x>l)||i>0&&(w=t||i>0&&(y>t||y==t&&x>=e)&&w<=t)&&(M<0||x>T)&&(M=k,T=i<0?x:b,i<0?y:w),u+=24}M>=0&&c([M],d+1)}};c([a.cirTreeOffset+48],1)},l.prototype.readWigData=function(t,e,i){var n,a=i-e;if(a<=25e3||0===this.zoomLevels.length)n=this.getUnzoomedView();else for(var r=0;r=this.zoomLevels.length-1)){var o;return o=t<0?this.getUnzoomedView():this.getZoomedView(t),o.readWigDataById(e,i,n,a)}if(this.topLevelReductionCache){for(var s=[],l=this.topLevelReductionCache,u=0;u0?0:3e8;t.fromRef&&(s=e);for(var u=0;u0){if(c>n)if(t.zoom<0){if(d.min>s)return a(d)}else d.max>s&&l.push({chr:t.chr,chrOrd:t.chrOrd,zoom:t.zoom-2,min:d.min,max:d.max,fromRef:t.fromRef})}else if(c>n)if(t.zoom<0){if(d.maxi.field-3)return r[i.field-3]==t},[{offset:g,size:w}],e)}f+=d}return e([])}for(var b=null,_=0;_n._max&&(n._max=t._max):(i.push(n),n=t)}),i.push(n),this._ranges=i}function i(t,i){return t instanceof e||(t instanceof Array||(t=[t]),t=new e(t)),i&&t.insertRange(i),t}function n(i,n){for(var a=i.ranges(),r=n.ranges(),o=a.length,s=r.length,l=0,u=0,c=[];l=d&&c.push(new t(d,h)),i.max()>n.max()?++u:++l}return 0==c.length?null:1==c.length?c[0]:new e(c)}function a(t){for(var e=0,i=t.ranges(),n=0;ne.min()?1:t.max()t.max()?1:0}function o(t,e){return t._mine._min?1:t._maxt._max?1:0}return t.prototype.min=function(){return this._min},t.prototype.max=function(){return this._max},t.prototype.contains=function(t){return t>=this._min&&t<=this._max},t.prototype.isContiguous=function(){return!0},t.prototype.ranges=function(){return[this]},t.prototype._pushRanges=function(t){t.push(this)},t.prototype.toString=function(){return"["+this._min+"-"+this._max+"]"},e.prototype.min=function(){return this._ranges[0].min()},e.prototype.max=function(){return this._ranges[this._ranges.length-1].max()},e.prototype.lower_bound=function(t){var e=this.ranges();if(t>this.max())return e.length;if(te[a]._max)i=a+1;else{if(!(tt._max&&(t._max=i[n]._max),this._ranges.splice(e,n-e+1,t)},e.prototype.isContiguous=function(){return this._ranges.length>1},e.prototype.ranges=function(){return this._ranges},e.prototype._pushRanges=function(t){for(var e=0;e0&&(t+=","),t+=this._ranges[e].toString();return t},{Range:t,union:i,intersection:n,coverage:a,rangeOver:r,_rangeOrder:o}}.apply(e,n))&&(t.exports=a)},14:function(t,e,i){"use strict";(function(t,n,a){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=i(3),s=r(o),l=i(31),u=r(l),c=t.Model.extend({}),d=t.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this.get("metadata")||this._set_metadata(),this.on("change",this._set_metadata,this)},_set_metadata:function(){var t=new c;n.each(n.keys(this.attributes),function(e){if(0===e.indexOf("metadata_")){var i=e.split("metadata_")[1];t.set(i,this.attributes[e]),delete this.attributes[e]}},this),this.set("metadata",t,{silent:!0})},get_metadata:function(t){return this.attributes.metadata.get(t)},urlRoot:Galaxy.root+"api/datasets"}),h=d.extend({defaults:n.extend({},d.prototype.defaults,{chunk_url:null,first_data_chunk:null,offset:0,at_eof:!1}),initialize:function(t){d.prototype.initialize.call(this),this.attributes.first_data_chunk&&(this.attributes.offset=this.attributes.first_data_chunk.offset),this.attributes.chunk_url=Galaxy.root+"dataset/display?dataset_id="+this.id,this.attributes.url_viz=Galaxy.root+"visualization"},get_next_chunk:function(){if(this.attributes.at_eof)return null;var t=this,e=a.Deferred();return a.getJSON(this.attributes.chunk_url,{offset:t.attributes.offset}).success(function(i){var n;""!==i.ck_data?(n=i,t.attributes.offset=i.offset):(t.attributes.at_eof=!0,n=null),e.resolve(n)}),e}}),f=t.Collection.extend({model:d}),_=t.View.extend({initialize:function(t){this.row_count=0,this.loading_chunk=!1,new v({model:t.model,$el:this.$el})},expand_to_container:function(){this.$el.height()").attr("id","loading_indicator"),this.$el.append(this.loading_indicator);var t=a("").attr({id:"content_table",cellpadding:0});this.$el.append(t);var e=this.model.get_metadata("column_names"),i=a("").appendTo(t),n=a("").appendTo(i);if(e)n.append("");else for(var r=1;r<=this.model.get_metadata("columns");r++)n.append("");var o=this,s=this.model.get("first_data_chunk");s?this._renderChunk(s):a.when(o.model.get_next_chunk()).then(function(t){o._renderChunk(t)}),this.scroll_elt.scroll(function(){o.attempt_to_fetch()})},scrolled_to_bottom:function(){return!1},_renderCell:function(t,e,i){var n=a("")}),t.append(s)}else t.append("No "+this.model.get("plural").toLowerCase()+" have been shared with you.");return t}});t.default={View:c}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0});var s=i(20),o=a(s),r=i(9),l=a(r),d=i(1),c=a(d),u=i(68),h=n(u),f=i(662),p=n(f),_=i(32),m=n(_),g=i(3),v=n(g),w=i(34),y=n(w),b=l.View.extend({tagName:"tr",initialize:function(){c.bindAll(this,"render","_rowTemplate","renderTagEditor","_templateActions","removeWorkflow","copyWorkflow"),o.options.timeOut=1500},events:{"click #show-in-tool-panel":"showInToolPanel","click #delete-workflow":"removeWorkflow","click #rename-workflow":"renameWorkflow","click #copy-workflow":"copyWorkflow"},render:function(){return e(this.el).html(this._rowTemplate()),this},showInToolPanel:function(){this.model.save({show_in_tool_panel:!this.model.get("show_in_tool_panel")},{success:function(){window.location=Galaxy.root+"workflows/list"}})},removeWorkflow:function(){var e=this.model.get("name");window.confirm("Are you sure you want to delete workflow '"+e+"'?")&&(this.model.destroy({success:function(){o.success("Successfully deleted workflow '"+e+"'")}}),this.remove())},renameWorkflow:function(){var e=this.model.get("name"),t=window.prompt("Enter a new Name for workflow '"+e+"'",e);t&&(this.model.save({name:t},{success:function(){o.success("Successfully renamed workflow '"+e+"' to '"+t+"'")}}),this.render())},copyWorkflow:function(){var t=this,i=this.model.get("name");e.getJSON(this.model.urlRoot+"/"+this.model.id+"/download",function(e){var n="Copy of "+i,a=t.model.get("owner");a!=Galaxy.user.attributes.username&&(n+=" shared by user "+a),e.name=n,t.collection.create(e,{at:0,wait:!0,success:function(){o.success("Successfully copied workflow '"+i+"' to '"+n+"'")},error:function(e,t,i){o.error(i.errorThrown)}})}).error(function(e,t,i){o.error(e.responseJSON.err_msg)})},_rowTemplate:function(){var e=this.model.get("show_in_tool_panel"),t=this.model.id,i='';return'\n \n \n \n \n \n "},renderTagEditor:function(){var t=new h.default.TagsEditor({model:this.model,el:e.find("."+this.model.id+".tags-display"),workflow_mode:!0});t.toggle(!0),t.render()},_templateActions:function(){return this.model.get("owner")===Galaxy.user.attributes.username?'':''}}),x=l.View.extend({title:(0,v.default)("Workflows"),active_tab:"workflow",initialize:function(){y.default.markViewAsLoading(this),c.bindAll(this,"adjustActiondropdown"),this.collection=new p.default.WorkflowCollection,this.collection.fetch().done(this.render()),this.collection.bind("add",this.appendItem),this.collection.on("sync",this.render,this)},events:{dragleave:"unhighlightDropZone",drop:"drop",dragover:function(t){e(".hidden_description_layer").addClass("dragover"),e(".menubutton").addClass("background-none"),t.preventDefault()}},unhighlightDropZone:function(){e(".hidden_description_layer").removeClass("dragover"),e(".menubutton").removeClass("background-none")},drop:function(e){this.unhighlightDropZone(),e.preventDefault();for(var t,i=e.dataTransfer.files,n=0;t=i[n];n++)this.readWorkflowFiles(t)},readWorkflowFiles:function(e){var t=this,i=new FileReader;i.onload=function(n){var a=void 0;try{a=JSON.parse(i.result)}catch(t){o.error("Could not read file '"+e.name+"'. Verify it is a valid Galaxy workflow"),a=null}a&&t.collection.create(a,{at:0,wait:!0,success:function(){o.success("Successfully imported workflow '"+a.name+"'")},error:function(e,t,i){o.error(i.errorThrown)}})},i.readAsText(e,"utf-8")},_showArgErrors:c.once(function(){var e=m.default.get("message");"error"===m.default.get("status")?o.error(c.escape(e||"Unknown Error, please report this to an administrator.")):e&&o.info(c.escape(e))}),render:function(){var e=this,t=this._templateHeader(),i=this._templateActionButtons(),n=this._templateWorkflowTable();this.$el.html(t+i+n),c.each(this.collection.models,function(t){e.appendItem(t),e.confirmDelete(t)});return this.searchWorkflow(this.$(".search-wf"),this.$(".workflow-search tr"),3),this.adjustActiondropdown(),this._showArgErrors(),this},appendItem:function(t){var i=new b({model:t,collection:this.collection});e(".workflow-search").append(i.render().el),i.renderTagEditor()},confirmDelete:function(e){this.$(".link-confirm-shared-"+e.id).click(function(){return window.confirm("Are you sure you want to remove the shared workflow '"+e.attributes.name+"'?")})},searchWorkflow:function(t,i,n){t.on("keyup",function(){var t=e(this).val();if(t.length>=n){var a=new RegExp(t,"i");i.hide(),i.filter(function(){return a.test(e(this).text())}).show()}else i.show()})},adjustActiondropdown:function(){e(this.el).on("show.bs.dropdown",function(){e(this.el).css("overflow","inherit")}),e(this.el).on("hide.bs.dropdown",function(){e(this.el).css("overflow","auto")})},_templateNoWorkflow:function(){return'
You have no workflows.
'},_templateActionButtons:function(){return'
'},_templateWorkflowTable:function(){return'
"+e.join("")+""+r+"").text(t),r=this.model.get_metadata("column_types");return void 0!==i?n.attr("colspan",i).addClass("stringalign"):r&&e"),r=this.model.get_metadata("columns");return this.row_count%2!=0&&i.addClass("dark_row"),e.length===r?n.each(e,function(t,e){i.append(this._renderCell(t,e))},this):e.length>r?(n.each(e.slice(0,r-1),function(t,e){i.append(this._renderCell(t,e))},this),i.append(this._renderCell(e.slice(r-1).join("\t"),r-1))):1===e.length?i.append(this._renderCell(t,0,r)):(n.each(e,function(t,e){i.append(this._renderCell(t,e))},this),n.each(n.range(r-e.length),function(){i.append(a(""))})),this.row_count++,i},_renderChunk:function(t){var e=this.$el.find("table");n.each(t.ck_data.split("\n"),function(t,i){""!==t&&e.append(this._renderRow(t))},this)}}),p=_.extend({initialize:function(t){_.prototype.initialize.call(this,t);var e=n.find(this.$el.parents(),function(t){return"auto"===a(t).css("overflow")});e||(e=window),this.scroll_elt=a(e)},scrolled_to_bottom:function(){return this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0}}),m=_.extend({initialize:function(t){_.prototype.initialize.call(this,t),this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:t.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}}),v=t.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,file_ext:null,initialize:function(t){var e=parent.Galaxy;if(e&&e.modal&&(this.modal=e.modal),e&&e.frame&&(this.frame=e.frame),this.modal&&this.frame){var i=t.model,n=i.get("metadata");if(i.get("file_ext")){if(this.file_ext=i.get("file_ext"),"bed"==this.file_ext){if(!(n.get("chromCol")&&n.get("startCol")&&n.get("endCol")))return void console.log("TabularButtonTrackster : Bed-file metadata incomplete.");this.col.chrom=n.get("chromCol")-1,this.col.start=n.get("startCol")-1,this.col.end=n.get("endCol")-1}if("vcf"==this.file_ext){var a=function(t,e){for(var i=0;i100?l(new Uint8Array(t.buffer,t.byteOffset+e,a),i,n):s(t,e,i,n,a)}}function s(t,e,i,n,a){for(var r=0;r15?(this.inflateEnd(t),-2):(this.wbits=e,t.istate.blocks=new i(t,0!=t.istate.nowrap?null:this,1<>4)>t.istate.wbits){t.istate.mode=13,t.msg="invalid window size",t.istate.marker=5;break}t.istate.mode=1;case 1:if(0==t.avail_in)return i;if(i=e,t.avail_in--,t.total_in++,n=255&t.next_in[t.next_in_index++],((t.istate.method<<8)+n)%31!=0){t.istate.mode=13,t.msg="incorrect header check",t.istate.marker=5;break}if(0==(32&n)){t.istate.mode=7;break}t.istate.mode=2;case 2:if(0==t.avail_in)return i;i=e,t.avail_in--,t.total_in++,t.istate.need=(255&t.next_in[t.next_in_index++])<<24&4278190080,t.istate.mode=3;case 3:if(0==t.avail_in)return i;i=e,t.avail_in--,t.total_in++,t.istate.need+=(255&t.next_in[t.next_in_index++])<<16&16711680,t.istate.mode=4;case 4:if(0==t.avail_in)return i;i=e,t.avail_in--,t.total_in++,t.istate.need+=(255&t.next_in[t.next_in_index++])<<8&65280,t.istate.mode=5;case 5:return 0==t.avail_in?i:(i=e,t.avail_in--,t.total_in++,t.istate.need+=255&t.next_in[t.next_in_index++],t.adler=t.istate.need,t.istate.mode=6,2);case 6:return t.istate.mode=13,t.msg="need dictionary",t.istate.marker=0,-2;case 7:if(-3==(i=t.istate.blocks.proc(t,i))){t.istate.mode=13,t.istate.marker=0;break}if(i==f&&(i=e),i!=_)return i;if(i=e,t.istate.blocks.reset(t,t.istate.was),0!=t.istate.nowrap){t.istate.mode=12;break}t.istate.mode=8;case 8:if(0==t.avail_in)return i;i=e,t.avail_in--,t.total_in++,t.istate.need=(255&t.next_in[t.next_in_index++])<<24&4278190080,t.istate.mode=9;case 9:if(0==t.avail_in)return i;i=e,t.avail_in--,t.total_in++,t.istate.need+=(255&t.next_in[t.next_in_index++])<<16&16711680,t.istate.mode=10;case 10:if(0==t.avail_in)return i;i=e,t.avail_in--,t.total_in++,t.istate.need+=(255&t.next_in[t.next_in_index++])<<8&65280,t.istate.mode=11;case 11:if(0==t.avail_in)return i;if(i=e,t.avail_in--,t.total_in++,t.istate.need+=255&t.next_in[t.next_in_index++],t.istate.was[0]!=t.istate.need){t.istate.mode=13,t.msg="incorrect data check",t.istate.marker=5;break}t.istate.mode=12;case 12:return _;case 13:return-3;default:return-2}},e.prototype.inflateSetDictionary=function(t,e,i){var n=0,a=i;return null==t||null==t.istate||6!=t.istate.mode?-2:t._adler.adler32(1,e,0,i)!=t.adler?-3:(t.adler=t._adler.adler32(0,null,0,0),a>=1<>>1){case 0:n>>>=3,a-=3,i=7&a,n>>>=i,a-=i,this.mode=1;break;case 1:var d=new Int32Array(1),h=new Int32Array(1),p=[],g=[];r(d,h,p,g,t),this.codes.init(d[0],h[0],p[0],0,g[0],0,t),n>>>=3,a-=3,this.mode=6;break;case 2:n>>>=3,a-=3,this.mode=3;break;case 3:return n>>>=3,a-=3,this.mode=13,t.msg="invalid block type",e=-3,this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,this.write=u,this.inflate_flush(t,e)}break;case 1:for(;a<32;){if(0==l)return this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,this.write=u,this.inflate_flush(t,e);e=f,l--,n|=(255&t.next_in[s++])<>>16&65535)!=(65535&n))return this.mode=13,t.msg="invalid stored block lengths",e=-3,this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,this.write=u,this.inflate_flush(t,e);this.left=65535&n,n=a=0,this.mode=0!=this.left?2:0!=this.last?7:v;break;case 2:if(0==l)return this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,write=u,this.inflate_flush(t,e);if(0==c&&(u==end&&0!=read&&(u=0,c=ul&&(i=l),i>c&&(i=c),o(t.next_in,s,this.window,u,i),s+=i,l-=i,u+=i,c-=i,0!=(this.left-=i))break;this.mode=0!=this.last?7:v;break;case 3:for(;a<14;){if(0==l)return this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,this.write=u,this.inflate_flush(t,e);e=f,l--,n|=(255&t.next_in[s++])<29||(i>>5&31)>29)return this.mode=9,t.msg="too many length or distance symbols",e=-3,this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,this.write=u,this.inflate_flush(t,e);if(i=258+(31&i)+(i>>5&31),null==this.blens||this.blens.length>>=14,a-=14,this.index=0,mode=4;case 4:for(;this.index<4+(this.table>>>10);){for(;a<3;){if(0==l)return this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,this.write=u,this.inflate_flush(t,e);e=f,l--,n|=(255&t.next_in[s++])<>>=3,a-=3}for(;this.index<19;)this.blens[S[this.index++]]=0;if(this.bb[0]=7,(i=this.inftree.inflate_trees_bits(this.blens,this.bb,this.tb,this.hufts,t))!=f)return e=i,-3==e&&(this.blens=null,this.mode=9),this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,write=u,this.inflate_flush(t,e);this.index=0,this.mode=5;case 5:for(;;){if(i=this.table,!(this.index<258+(31&i)+(i>>5&31)))break;var w,b,y;for(i=this.bb[0];a>>=i,a-=i,this.blens[this.index++]=y;else{for(w=18==y?7:y-14,b=18==y?11:3;a>>=i,a-=i,b+=n&m[w],n>>>=w,a-=w,w=this.index,i=this.table,w+b>258+(31&i)+(i>>5&31)||16==y&&w<1)return this.blens=null,this.mode=9,t.msg="invalid bit length repeat",e=-3,this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,this.write=u,this.inflate_flush(t,e);y=16==y?this.blens[w-1]:0;do{this.blens[w++]=y}while(0!=--b);this.index=w}}this.tb[0]=-1;var d=new Int32Array(1),h=new Int32Array(1),p=new Int32Array(1),g=new Int32Array(1);if(d[0]=9,h[0]=6,i=this.table,(i=this.inftree.inflate_trees_dynamic(257+(31&i),1+(i>>5&31),this.blens,d,h,p,g,this.hufts,t))!=f)return-3==i&&(this.blens=null,this.mode=13),e=i,this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,this.write=u,this.inflate_flush(t,e);this.codes.init(d[0],h[0],this.hufts,p[0],this.hufts,g[0],t),this.mode=6;case 6:if(this.bitb=n,this.bitk=a,t.avail_in=l,t.total_in+=s-t.next_in_index,t.next_in_index=s,this.write=u,(e=this.codes.proc(this,t,e))!=_)return this.inflate_flush(t,e);if(e=f,this.codes.free(t),s=t.next_in_index,l=t.avail_in,n=this.bitb,a=this.bitk,u=this.write,c=ut.avail_out&&(i=t.avail_out),0!=i&&e==p&&(e=f),t.avail_out-=i,t.total_out+=i,null!=this.checkfn&&(t.adler=this.check=t._adler.adler32(this.check,this.window,a,i)),o(this.window,a,t.next_out,n,i),n+=i,a+=i,a==this.end&&(a=0,this.write==this.end&&(this.write=0),i=this.write-a,i>t.avail_out&&(i=t.avail_out),0!=i&&e==p&&(e=f),t.avail_out-=i,t.total_out+=i,null!=this.checkfn&&(t.adler=this.check=t._adler.adler32(this.check,this.window,a,i)),o(this.window,a,t.next_out,n,i),n+=i,a+=i),t.next_out_index=n,this.read=a,e};n.prototype.init=function(t,e,i,n,a,r,o){this.mode=0,this.lbits=t,this.dbits=e,this.ltree=i,this.ltree_index=n,this.dtree=a,this.dtree_index=r,this.tree=null},n.prototype.proc=function(t,e,i){var n,a,r,o,s,l,u,c=0,d=0,h=0;for(h=e.next_in_index,o=e.avail_in,c=t.bitb,d=t.bitk,s=t.write,l=s=258&&o>=10&&(t.bitb=c,t.bitk=d,e.avail_in=o,e.total_in+=h-e.next_in_index,e.next_in_index=h,t.write=s,i=this.inflate_fast(this.lbits,this.dbits,this.ltree,this.ltree_index,this.dtree,this.dtree_index,t,e),h=e.next_in_index,o=e.avail_in,c=t.bitb,d=t.bitk,s=t.write,l=s>>=this.tree[a+1],d-=this.tree[a+1],0==(r=this.tree[a])){this.lit=this.tree[a+2],this.mode=6;break}if(0!=(16&r)){this.get=15&r,this.len=this.tree[a+2],this.mode=2;break}if(0==(64&r)){this.need=r,this.tree_index=a/3+this.tree[a+2];break}if(0!=(32&r)){this.mode=7;break}return this.mode=9,e.msg="invalid literal/length code",i=-3,t.bitb=c,t.bitk=d,e.avail_in=o,e.total_in+=h-e.next_in_index,e.next_in_index=h,t.write=s,t.inflate_flush(e,i);case 2:for(n=this.get;d>=n,d-=n,this.need=this.dbits,this.tree=this.dtree,this.tree_index=this.dtree_index,this.mode=3;case 3:for(n=this.need;d>=this.tree[a+1],d-=this.tree[a+1],0!=(16&(r=this.tree[a]))){this.get=15&r,this.dist=this.tree[a+2],this.mode=4;break}if(0==(64&r)){this.need=r,this.tree_index=a/3+this.tree[a+2];break}return this.mode=9,e.msg="invalid distance code",i=-3,t.bitb=c,t.bitk=d,e.avail_in=o,e.total_in+=h-e.next_in_index,e.next_in_index=h,t.write=s,t.inflate_flush(e,i);case 4:for(n=this.get;d>=n,d-=n,this.mode=5;case 5:for(u=s-this.dist;u<0;)u+=t.end;for(;0!=this.len;){if(0==l&&(s==t.end&&0!=t.read&&(s=0,l=s7&&(d-=8,o++,h--),t.write=s,i=t.inflate_flush(e,i),s=t.write,l=s>=c[S+1],v-=c[S+1],0!=(16&h)){for(h&=15,C=c[S+2]+(p&m[h]),p>>=h,v-=h;v<15;)w--,p|=(255&l.next_in[g++])<>=c[S+1],v-=c[S+1],0!=(16&h)){for(h&=15;v>=h,v-=h,y-=C,b>=M)T=b-M,s.window[b++]=s.window[T++],s.window[b++]=s.window[T++],C-=2;else{T=b-M;do{T+=s.end}while(T<0);if(h=s.end-T,C>h){if(C-=h,b-T>0&&h>b-T)do{s.window[b++]=s.window[T++]}while(0!=--h);else o(s.window,T,s.window,b,h),b+=h,T+=h,h=0;T=0}}do{s.window[b++]=s.window[T++]}while(0!=--C);break}if(0!=(64&h))return l.msg="invalid distance code",C=l.avail_in-w,C=v>>3>3:C,w+=C,g-=C,v-=C<<3,s.bitb=p,s.bitk=v,l.avail_in=w,l.total_in+=g-l.next_in_index,l.next_in_index=g,s.write=b,-3;u+=c[S+2],u+=p&m[h],S=3*(d+u),h=c[S]}break}if(0!=(64&h))return 0!=(32&h)?(C=l.avail_in-w,C=v>>3>3:C,w+=C,g-=C,v-=C<<3,s.bitb=p,s.bitk=v,l.avail_in=w,l.total_in+=g-l.next_in_index,l.next_in_index=g,s.write=b,_):(l.msg="invalid literal/length code",C=l.avail_in-w,C=v>>3>3:C,w+=C,g-=C,v-=C<<3,s.bitb=p,s.bitk=v,l.avail_in=w,l.total_in+=g-l.next_in_index,l.next_in_index=g,s.write=b,-3);if(u+=c[S+2],u+=p&m[h],S=3*(d+u),0==(h=c[S])){p>>=c[S+1],v-=c[S+1],s.window[b++]=c[S+2],y--;break}}else p>>=c[S+1],v-=c[S+1],s.window[b++]=c[S+2],y--}while(y>=258&&w>=10);return C=l.avail_in-w,C=v>>3>3:C,w+=C,g-=C,v-=C<<3,s.bitb=p,s.bitk=v,l.avail_in=w,l.total_in+=g-l.next_in_index,l.next_in_index=g,s.write=b,f},a.prototype.huft_build=function(t,e,i,n,a,r,s,l,u,c,h){var _,m,v,g,w,b,y,x,k,C,M,T,S,O,A;C=0,w=i;do{this.c[t[e+C]]++,C++,w--}while(0!=w);if(this.c[0]==i)return s[0]=-1,l[0]=0,f;for(x=l[0],b=1;b<=15&&0==this.c[b];b++);for(y=b,xw&&(x=w),l[0]=x,O=1<T+x;){if(g++,T+=x,A=v-T,A=A>x?x:A,(m=1<<(b=y-T))>_+1&&(m-=_+1,S=y,bd)return-3;this.u[g]=M=this.hn[0],this.hn[0]+=A,0!=g?(this.x[g]=w,this.r[0]=b,this.r[1]=x,b=w>>>T-x,this.r[2]=M-this.u[g-1]-b,o(this.r,0,u,3*(this.u[g-1]+b),3)):s[0]=M}for(this.r[1]=y-T,C>=i?this.r[0]=192:h[C]>>T;b>>=1)w^=b;for(w^=b,k=(1<257?(-3==u?l.msg="oversubscribed distance tree":u==p?(l.msg="incomplete distance tree",u=-3):-4!=u&&(l.msg="empty distance tree with lengths",u=-3),u):f)},a.prototype.initWorkArea=function(t){null==this.hn&&(this.hn=new Int32Array(1),this.v=new Int32Array(t),this.c=new Int32Array(16),this.r=new Int32Array(3),this.u=new Int32Array(15),this.x=new Int32Array(16)),this.v.length=this.options.errorAtPercent},_render_quota:function(){var e=this.model.toJSON(),i=e.quota_percent,n=t(this._templateQuotaMeter(e)),a=n.find(".progress-bar");return this.isOverQuota()?(a.attr("class","progress-bar bg-danger"),n.find(".quota-meter-text").css("color","white"),this.trigger("quota:over",e)):i>=this.options.warnAtPercent?(a.attr("class","progress-bar bg-warning"),this.trigger("quota:under quota:under:approaching",e)):(a.attr("class","progress-bar bg-success"),this.trigger("quota:under quota:under:ok",e)),n},_render_usage:function(){var e=t(this._templateUsage(this.model.toJSON()));return this.log(this+".rendering usage:",e),e},render:function(){var t=null;return this.log(this+".model.quota_percent:",this.model.get("quota_percent")),t=null===this.model.get("quota_percent")||void 0===this.model.get("quota_percent")?this._render_usage():this._render_quota(),this.$el.html(t),this.$el.find(".quota-meter-text").tooltip(),this},_templateQuotaMeter:function(t){return['"].join("")},_templateUsage:function(t){return['
','
',t.nice_total_disk_usage?(0,h.default)("Using ")+t.nice_total_disk_usage:"","
","
"].join("")},toString:function(){return"UserQuotaMeter("+this.model+")"}});e.default={UserQuotaMeter:f}}).call(e,i(0))},15:function(t,e,i){"use strict";(function(t,n){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),o=a(r),s=i(1),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(s),u=i(14),c=a(u),d=i(18),h=a(d),f=i(33),_=a(f),p=i(24),m=a(p),v=i(80),g=a(v),w={toJSON:function(){var t=this,e={};return l.each(t.constructor.to_json_keys,function(i){var n=t.get(i);i in t.constructor.to_json_mappers&&(n=t.constructor.to_json_mappers[i](n,t)),e[i]=n}),e}},b=function(e,i){var n=new m.default({url_base:Galaxy.root+"visualization/list_history_datasets",filters:e,embedded:!0}),a=new m.default({url_base:Galaxy.root+"visualization/list_library_datasets",embedded:!0}),r=new g.default.View;r.add({id:"histories",title:(0,o.default)("Histories"),$el:t("
").append(n.$el)}),r.add({id:"libraries",title:(0,o.default)("Libraries"),$el:t("
").append(a.$el)}),Galaxy.modal.show({title:(0,o.default)("Select datasets for new tracks"),body:r.$el,closing_events:!0,buttons:{Cancel:function(){Galaxy.modal.hide()},Add:function(){var e=[];r.$("input.grid-row-select-checkbox[name=id]:checked").each(function(){window.console.log(t(this).val()),e[e.length]=t.ajax({url:Galaxy.root+"api/datasets/"+t(this).val(),dataType:"json",data:{data_type:"track_config",hda_ldda:"histories"==r.current()?"hda":"ldda"}})}),t.when.apply(t,e).then(function(){var e=arguments[0]instanceof Array?t.map(arguments,function(t){return t[0]}):[arguments[0]];i(e)}),Galaxy.modal.hide()}}})},y=function(t){this.default_font=void 0!==t?t:"9px Monaco, Lucida Console, monospace",this.dummy_canvas=this.new_canvas(),this.dummy_context=this.dummy_canvas.getContext("2d"),this.dummy_context.font=this.default_font,this.char_width_px=this.dummy_context.measureText("A").width,this.patterns={},this.load_pattern("right_strand","/visualization/strand_right.png"),this.load_pattern("left_strand","/visualization/strand_left.png"),this.load_pattern("right_strand_inv","/visualization/strand_right_inv.png"),this.load_pattern("left_strand_inv","/visualization/strand_left_inv.png")};l.extend(y.prototype,{load_pattern:function(t,e){var i=this.patterns,n=this.dummy_context,a=new Image;a.src=Galaxy.root+"static/images"+e,a.onload=function(){i[t]=n.createPattern(a,"repeat")}},get_pattern:function(t){return this.patterns[t]},new_canvas:function(){var e=t("")[0];return e.manager=this,e}});var x=n.Model.extend({defaults:{num_elements:20,obj_cache:null,key_ary:null},initialize:function(t){this.clear()},get_elt:function(t){var e=this.attributes.obj_cache,i=this.attributes.key_ary,n=t.toString(),a=l.indexOf(i,function(t){return t.toString()===n});return-1!==a&&(e[n].stale?(i.splice(a,1),delete e[n]):this.move_key_to_end(t,a)),e[n]},set_elt:function(t,e){var i=this.attributes.obj_cache,n=this.attributes.key_ary,a=t.toString(),r=this.attributes.num_elements;if(!i[a]){if(n.length>=r){delete i[n.shift().toString()]}n.push(t)}return i[a]=e,e},move_key_to_end:function(t,e){this.attributes.key_ary.splice(e,1),this.attributes.key_ary.push(t)},clear:function(){this.attributes.obj_cache={},this.attributes.key_ary=[]},size:function(){return this.attributes.key_ary.length},most_recently_added:function(){return 0===this.size()?null:this.attributes.key_ary[this.attributes.key_ary.length-1]}}),k=x.extend({defaults:l.extend({},x.prototype.defaults,{dataset:null,genome:null,init_data:null,min_region_size:200,filters_manager:null,data_type:"data",data_mode_compatible:function(t,e){return!0},can_subset:function(t){return!1}}),initialize:function(t){x.prototype.initialize.call(this);var e=this.get("init_data");e&&this.add_data(e)},add_data:function(t){this.get("num_elements")d.get("start")?t.set("end",t.get("start")+this.attributes.min_region_size):t.set("start",t.get("end")-this.attributes.min_region_size),t.set("genome",this.attributes.genome),t.trim()}return this.load_data(t,e,i,n)},set_data:function(t,e){this.set_elt(t,e)},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(e,i,n,a,r){var o=this._mark_stale(e);if(!o||!this.get("data_mode_compatible")(o,i))return void console.log("ERROR: problem with getting more data: current data is not compatible");var s=e.get("start");r===this.DEEP_DATA_REQ?t.extend(a,{start_val:o.data.length+1}):r===this.BROAD_DATA_REQ&&(s=(o.max_high?o.max_high:o.data[o.data.length-1][2])+1);var l=e.copy().set("start",s),u=this,c=this.load_data(l,i,n,a),d=t.Deferred();return this.set_data(e,d),t.when(c).then(function(t){t.data&&(t.data=o.data.concat(t.data),t.max_low&&(t.max_low=o.max_low),t.message&&(t.message=t.message.replace(/[0-9]+/,t.data.length))),u.set_data(e,t),d.resolve(t)}),d},can_get_more_detailed_data:function(t){var e=this.get_elt(t);return"bigwig"===e.dataset_type&&e.data.length<8e3},get_more_detailed_data:function(t,e,i,n,a){var r=this._mark_stale(t);return r?(a||(a={}),"bigwig"===r.dataset_type&&(a.num_samples=1e3*n),this.load_data(t,e,i,a)):void console.log("ERROR getting more detailed data: no current data")},_mark_stale:function(t){var e=this.get_elt(t);return e||console.log("ERROR: no data to mark as stale: ",this.get("dataset"),t.toString()),e.stale=!0,e},get_genome_wide_data:function(e){var i=this,n=!0,a=l.map(e.get("chroms_info").chrom_info,function(t){var e=i.get_elt(new T({chrom:t.chrom,start:0,end:t.len}));return e||(n=!1),e});if(n)return a;var r=t.Deferred();return t.getJSON(this.get("dataset").url(),{data_type:"genome_data"},function(t){i.add_data(t.data),r.resolve(t.data)}),r},subset_entry:function(t,e){var i={bigwig:function(t,e){return l.filter(t,function(t){return t[0]>=e.get("start")&&t[0]<=e.get("end")})},refseq:function(e,i){var n=i.get("start")-t.region.get("start");return t.data.slice(n,n+i.length())}},n=t.data;return!t.region.same(e)&&t.dataset_type in i&&(n=i[t.dataset_type](t.data,e)),{region:e,data:n,dataset_type:t.dataset_type}}}),C=k.extend({initialize:function(t){var e=new n.Model;e.urlRoot=t.data_url,this.set("dataset",e)},load_data:function(t,e,i,n){return t.length()<=1e5?k.prototype.load_data.call(this,t,e,i,n):{data:null,region:t}}}),M=n.Model.extend({defaults:{name:null,key:null,chroms_info:null},initialize:function(t){this.id=t.dbkey},get_chroms_info:function(){return this.attributes.chroms_info.chrom_info},get_chrom_region:function(t){var e=l.find(this.get_chroms_info(),function(e){return e.chrom===t});return new T({chrom:e.chrom,end:e.len})},get_chrom_len:function(t){return l.find(this.get_chroms_info(),function(e){return e.chrom===t}).len}}),T=n.Model.extend({defaults:{chrom:null,start:0,end:0,str_val:null,genome:null},same:function(t){return this.attributes.chrom===t.get("chrom")&&this.attributes.start===t.get("start")&&this.attributes.end===t.get("end")},initialize:function(t){if(t.from_str){var e=t.from_str.split(":"),i=e[0],n=e[1].split("-");this.set({chrom:i,start:parseInt(n[0],10),end:parseInt(n[1],10)})}this.attributes.str_val=this.get("chrom")+":"+this.get("start")+"-"+this.get("end"),this.on("change",function(){this.attributes.str_val=this.get("chrom")+":"+this.get("start")+"-"+this.get("end")},this)},copy:function(){return new T({chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")})},length:function(){return this.get("end")-this.get("start")},toString:function(){return this.attributes.str_val},toJSON:function(){return{chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")}},compute_overlap:function(t){var e=this.get("chrom"),i=t.get("chrom"),n=this.get("start"),a=t.get("start"),r=this.get("end"),o=t.get("end");return e&&i&&e!==i?T.overlap_results.DIF_CHROMS:na?n>o?T.overlap_results.AFTER:r<=o?T.overlap_results.CONTAINED_BY:T.overlap_results.OVERLAP_END:r>=o?T.overlap_results.CONTAINS:T.overlap_results.CONTAINED_BY},trim:function(t){if(this.attributes.start<0&&(this.attributes.start=0),this.attributes.genome){var e=this.attributes.genome.get_chrom_len(this.attributes.chrom);this.attributes.end>e&&(this.attributes.end=e-1)}return this},contains:function(t){return this.compute_overlap(t)===T.overlap_results.CONTAINS},overlaps:function(t){return 0===l.intersection([this.compute_overlap(t)],[T.overlap_results.DIF_CHROMS,T.overlap_results.BEFORE,T.overlap_results.AFTER]).length}},{overlap_results:{DIF_CHROMS:1e3,BEFORE:1001,CONTAINS:1002,OVERLAP_START:1003,OVERLAP_END:1004,CONTAINED_BY:1005,AFTER:1006}}),S=n.Collection.extend({model:T}),O=n.Model.extend({defaults:{region:null,note:""},initialize:function(t){this.set("region",new T(t.region))}}),A=n.Collection.extend({model:O}),z=n.Model.extend(w).extend({defaults:{mode:"Auto"},initialize:function(t){this.set("dataset",new c.default.Dataset(t.dataset));var e=[{key:"name",default_value:this.get("dataset").get("name")},{key:"color"},{key:"min_value",label:"Min Value",type:"float",default_value:0},{key:"max_value",label:"Max Value",type:"float",default_value:1}];this.set("config",_.default.ConfigSettingCollection.from_models_and_saved_values(e,t.prefs));var i=this.get("preloaded_data");i=i?i.data:[],this.set("data_manager",new k({dataset:this.get("dataset"),init_data:i}))}},{to_json_keys:["track_type","dataset","prefs","mode","filters","tool_state"],to_json_mappers:{prefs:function(t,e){return 0===l.size(t)&&(t={name:e.get("config").get("name").get("value"),color:e.get("config").get("color").get("value")}),t},dataset:function(t){return{id:t.id,hda_ldda:t.get("hda_ldda")}}}}),P=n.Collection.extend({model:z}),R=n.Model.extend({defaults:{title:"",type:""},urlRoot:Galaxy.root+"api/visualizations",save:function(){return t.ajax({url:this.url(),type:"POST",dataType:"json",data:{vis_json:JSON.stringify(this)}})}}),j=R.extend(w).extend({defaults:l.extend({},R.prototype.defaults,{dbkey:"",drawables:null,bookmarks:null,viewport:null}),initialize:function(t){this.set("drawables",new P(t.tracks));var e=[];this.set("config",_.default.ConfigSettingCollection.from_models_and_saved_values(e,t.prefs)),this.unset("tracks"),this.get("drawables").each(function(t){t.unset("preloaded_data")})},add_tracks:function(t){this.get("drawables").add(t)}},{to_json_keys:["view","viewport","bookmarks"],to_json_mappers:{view:function(t,e){return{obj_type:"View",prefs:{name:e.get("title"),content_visible:!0},drawables:e.get("drawables")}}}}),E=n.Router.extend({initialize:function(t){var e=this;this.view=t.view,this.route(/([\w]+)$/,"change_location"),this.route(/([\w+]+:[\d,]+-[\d,]+)$/,"change_location"),this.view.on("navigate",function(t){e.navigate(t)})},change_location:function(t){this.view.go_to(t)}});e.default={BackboneTrack:z,BrowserBookmark:O,BrowserBookmarkCollection:A,Cache:x,CanvasManager:y,Genome:M,GenomeDataManager:k,GenomeRegion:T,GenomeRegionCollection:S,GenomeVisualization:j,GenomeReferenceDataManager:C,TrackBrowserRouter:E,Visualization:R,select_datasets:b}}).call(e,i(0),i(2))},169:function(t,e,i){"use strict";(function(t,n,a){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=i(73),s=r(o),l=i(168),u=r(l),c=i(17),d=r(c),h=i(5),f=r(h),_=t.View.extend({el:"body",className:"full-content",_panelids:["left","right"],initialize:function(e){var i=this,a=this;this.config=n.defaults(e.config||{},{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:"",hide_panels:!1,hide_masthead:!1}),Galaxy.modal=this.modal=new d.default.View,Galaxy.router=this.router=e.Router&&new e.Router(a,e),this.masthead=new s.default.View(this.config),this.center=new u.default.CenterPanel,Galaxy.display=this.display=function(t){t.title?(f.default.setWindowTitle(t.title),t.allow_title_display=!1):(f.default.setWindowTitle(),t.allow_title_display=!0),t.active_tab&&a.masthead.highlight(t.active_tab),a.center.display(t)},this.$el.attr("scroll","no"),this.$el.html(this._template()),this.$masthead=this.$("#masthead"),this.$center=this.$("#center"),this.$messagebox=this.$("#messagebox"),this.$inactivebox=this.$("#inactivebox"),this.config.hide_masthead?(this.$masthead.remove(),this.$center.css("top",0)):this.$masthead.replaceWith(this.masthead.$el),this.$center.append(this.center.$el),this.$el.append(this.masthead.frame.$el),this.$el.append(this.modal.$el),this.panels={},this.config.hide_panels||n.each(this._panelids,function(t){var n=t.charAt(0).toUpperCase()+t.slice(1),r=e[n];if(r){var o=new r(a,e),s=a.$("#"+t);a[o.toString()]=o,a.panels[t]=new u.default.SidePanel({id:t,el:s,view:o}),i.config.hide_masthead&&s.css("top",0)}}),this.render(),this.router&&t.history.start({root:Galaxy.root,pushState:!0})},render:function(){return a(".select2-hidden-accessible").remove(),this.config.hide_masthead||(this.masthead.render(),this.renderMessageBox(),this.renderInactivityBox()),this.renderPanels(),this._checkCommunicationServerOnline(),this},renderMessageBox:function(){if(this.config.message_box_visible){var t=this.config.message_box_content||"",e=this.config.message_box_class||"info";this.$el.addClass("has-message-box"),this.$messagebox.attr("class","panel-"+e+"-message").html(t).toggle(!!t).show()}else this.$el.removeClass("has-message-box"),this.$messagebox.hide();return this},renderInactivityBox:function(){if(this.config.show_inactivity_warning){var t=this.config.inactivity_box_content||"",e=a("").attr("href",Galaxy.root+"user/resend_verification").text("Resend verification");this.$el.addClass("has-inactivity-box"),this.$inactivebox.html(t+" ").append(e).toggle(!!t).show()}else this.$el.removeClass("has-inactivity-box"),this.$inactivebox.hide();return this},renderPanels:function(){var t=this;return n.each(this._panelids,function(e){var i=t.panels[e];i?i.render():(t.$center.css(e,0),t.$("#"+e).hide())}),this},_template:function(){return['
\n
\n
\n
\n
\n
\n
\n \n
'].join("")},toString:function(){return"PageLayoutView"},_checkCommunicationServerOnline:function(){var t=window.Galaxy.config.communication_server_host,e=window.Galaxy.config.communication_server_port,i=window.Galaxy.user.attributes.preferences,n=a("#show-chat-online");i&&-1!=["1","true"].indexOf(i.communication_server)?a.ajax({url:t+":"+e}).success(function(t){null!==window.Galaxy.user.id&&"hidden"===n.css("visibility")&&n.css("visibility","visible")}).error(function(t){n.css("visibility","hidden")}):n.css("visibility","hidden")}});e.default={View:_}}).call(e,i(2),i(1),i(0))},18:function(t,e,i){"use strict";(function(t,i){function n(t){t+="";for(var e=/(\d+)(\d{3})/;e.test(t);)t=t.replace(e,"$1,$2");return t}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){return"promise"in t},r=t.Model.extend({defaults:{ajax_settings:{},interval:1e3,success_fn:function(t){return!0}},go:function(){var t=i.Deferred(),e=this,n=e.get("ajax_settings"),a=e.get("success_fn"),r=e.get("interval");return function e(){i.ajax(n).success(function(i){a(i)?t.resolve(i):setTimeout(e,r)})}(),t}}),o=function(t){t||(t="#ffffff"),"string"==typeof t&&(t=[t]);for(var e=0;e>16,a=(65280&i)>>8,r=255&i,c=f(n,a,r),_=!0,e=0;e>16,l=(65280&o)>>8,u=255&o,d=f(s,l,u),h=function(t,e,i,n,a,r){return Math.max(t,n)-Math.min(t,n)+(Math.max(e,a)-Math.min(e,a))+(Math.max(i,r)-Math.min(i,r))}(n,a,r,s,l,u),Math.abs(c-d)<40||h<200){_=!1;break}p++}while(!_&&p<=10);return"#"+(16777216+i).toString(16).substr(1,6)};e.default={commatize:n,is_deferred:a,ServerStateDeferred:r,get_random_color:o}}).call(e,i(2),i(0))},19:function(t,e,i){"use strict";var n=i(0),a=function(t){return t&&t.__esModule?t:{default:t}}(n),r=a.default;r.fn.make_text_editable=function(t){var e="num_cols"in t?t.num_cols:30,i="num_rows"in t?t.num_rows:4,n="use_textarea"in t&&t.use_textarea,a="on_finish"in t?t.on_finish:null,o="help_text"in t?t.help_text:null,s=r(this);return s.addClass("editable-text").click(function(o){if(!(r(this).children(":input").length>0)){s.removeClass("editable-text");var l,u,c=function(t){s.find(":input").remove(),""!==t?s.text(t):s.html("
"),s.addClass("editable-text"),a&&a(t)},d="cur_text"in t?t.cur_text:s.text();n?(l=r("\n \n
\n
\n \x3c!--\n \n --\x3e\n
\n
\n '}})}).call(t,i(2),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(10),s=n(a),o=i(655),r=n(o),l=i(656),d=n(l),c=i(3),u=n(c),h=e.View.extend({initialize:function(t,i){var n=this;this.userIsAnonymous=Galaxy.user.isAnonymous(),this.allow_user_dataset_purge=i.config.allow_user_dataset_purge,this.root=i.root,this.historyView=new d.default.CurrentHistoryView({className:d.default.CurrentHistoryView.prototype.className+" middle",purgeAllowed:this.allow_user_dataset_purge,linkTarget:"galaxy_main"}),Galaxy.currHistoryPanel=this.historyView,Galaxy.currHistoryPanel.listenToGalaxy(Galaxy),this.buttonRefresh=new s.default.ButtonLink({id:"history-refresh-button",title:(0,u.default)("Refresh history"),cls:"panel-header-button",icon:"fa fa-refresh",onclick:function(){n.historyView.loadCurrentHistory()}}),this.buttonOptions=new s.default.ButtonLink({id:"history-options-button",title:(0,u.default)("History options"),cls:"panel-header-button",target:"galaxy_main",icon:"fa fa-cog",href:this.root+"root/history_options"}),this.buttonViewMulti=new s.default.ButtonLink({id:"history-view-multi-button",title:(0,u.default)("View all histories"),cls:"panel-header-button",icon:"fa fa-columns",href:this.root+"history/view_multiple"}),this.model=new e.Model({cls:"history-right-panel",title:(0,u.default)("History"),buttons:[this.buttonRefresh,this.buttonOptions,this.buttonViewMulti]}),this.setElement(this._template()),this.historyView.setElement(this.$el),this.historyView.connectToQuotaMeter(Galaxy.quotaMeter),this.historyView.loadCurrentHistory(),Galaxy.listenTo(this.historyView,"history-size-change",function(){Galaxy.user.fetch({url:Galaxy.user.urlRoot()+"/"+(Galaxy.user.id||"current")})})},render:function(){this.optionsMenu=(0,r.default)(this.buttonOptions.$el,{anonymous:this.userIsAnonymous,purgeAllowed:this.allow_user_dataset_purge,root:this.root}),this.buttonViewMulti.$el[this.userIsAnonymous?"hide":"show"]()},_template:function(e){return['
'].join("")},toString:function(){return"historyPanel"}});t.default=h}).call(t,i(2))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t,i){return o.clone(_).filter(function(n){return!(e&&!n.anon)&&(!(!t&&n.purge)&&(n.href&&(n.href=i+n.href,n.target=n.target||"galaxy_main"),n.confirm&&(n.func=function(){confirm(n.confirm)&&(galaxy_main.location=n.href)}),!0))})}Object.defineProperty(t,"__esModule",{value:!0});var s=i(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(s),r=i(3),l=n(r),d=i(41),c=n(d),u=i(143),h=n(u),f=i(25),p=n(f),_=[{html:(0,l.default)("History Lists"),header:!0},{html:(0,l.default)("Saved Histories"),href:"histories/list",target:"_top"},{html:(0,l.default)("Histories Shared with Me"),href:"histories/list_shared",target:"_top"},{html:(0,l.default)("Current History"),header:!0,anon:!0},{html:(0,l.default)("Create New"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.createNewHistory()}},{html:(0,l.default)("Copy History"),func:function(){(0,h.default)(Galaxy.currHistoryPanel.model).done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Share or Publish"),href:"history/sharing"},{html:(0,l.default)("Show Structure"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/show_structure")}},{html:(0,l.default)("Extract Workflow"),href:"workflow/build_from_current_history"},{html:(0,l.default)("Delete"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,l.default)("Really delete the current history?"))&&Galaxy.currHistoryPanel.model._delete().done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Delete Permanently"),purge:!0,anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,l.default)("Really delete the current history permanently? This cannot be undone."))&&Galaxy.currHistoryPanel.model.purge().done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Dataset Actions"),header:!0,anon:!0},{html:(0,l.default)("Copy Datasets"),href:"dataset/copy_datasets"},{html:(0,l.default)("Dataset Security"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/permissions?id="+Galaxy.currHistoryPanel.model.id)}},{html:(0,l.default)("Resume Paused Jobs"),href:"history/resume_paused_jobs?current=True",anon:!0},{html:(0,l.default)("Collapse Expanded Datasets"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.collapseAll()}},{html:(0,l.default)("Unhide Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,l.default)("Really unhide all hidden datasets?"))&&e.post(Galaxy.root+"history/adjust_hidden",{user_action:"unhide"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Delete Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,l.default)("Really delete all hidden datasets?"))&&e.post(Galaxy.root+"history/adjust_hidden",{user_action:"delete"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Purge Deleted Datasets"),confirm:(0,l.default)("Really delete all deleted datasets permanently? This cannot be undone."),href:"history/purge_deleted_datasets",purge:!0,anon:!0},{html:(0,l.default)("Downloads"),header:!0},{html:(0,l.default)("Export Tool Citations"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/citations?id="+Galaxy.currHistoryPanel.model.id)}},{html:(0,l.default)("Export History to File"),href:"history/export_archive?preview=True",anon:!0},{html:(0,l.default)("Other Actions"),header:!0},{html:(0,l.default)("Import from File"),href:"histories/import",target:"_top"}];p.default.load({type:"history-menu",async:!1,callback:function(t){var i=[];t.each(function(e){var t=e.toJSON();t.activate&&i.push({html:(0,l.default)(t.config.title),anon:!0})}),i.length>0&&(i.unshift({html:(0,l.default)("Webhooks"),header:!0}),e.merge(_,i))}});var m=function(e,t){t=t||{};var i=void 0===t.anonymous||t.anonymous,n=t.purgeAllowed||!1,s=a(i,n,Galaxy.root);return new c.default(e,s)};t.default=m}).call(t,i(0))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(144),r=(s(o),i(176)),l=s(r),d=i(6),c=s(d),u=i(3),h=s(u),f=c.default.SessionStorageModel.extend({defaults:{tagsEditorShown:!1,annotationEditorShown:!1,scrollPosition:0},toString:function(){return"HistoryViewPrefs("+JSON.stringify(this.toJSON())+")"}});f.storageKey=function(){return"history-panel"};var p=l.default.HistoryViewEdit,_=p.extend({className:p.prototype.className+" current-history-panel",HDCAViewClass:p.prototype.HDCAViewClass.extend({foldoutStyle:"drilldown"}),emptyMsg:[(0,h.default)("This history is empty"),". ",(0,h.default)("You can "),'',(0,h.default)("load your own data"),"",(0,h.default)(" or "),'',(0,h.default)("get data from an external source"),""].join(""),initialize:function(t){t=t||{},this.preferences=new f(e.extend({id:f.storageKey()},e.pick(t,e.keys(f.prototype.defaults)))),p.prototype.initialize.call(this,t),this.panelStack=[],this.currentContentId=t.currentContentId||null},_setUpListeners:function(){p.prototype._setUpListeners.call(this);var e=this;this.on("new-model",function(){e.preferences.set("scrollPosition",0)})},loadCurrentHistory:function(){return this.loadHistory(null,{url:Galaxy.root+"history/current_history_json"})},switchToHistory:function(e,t){return Galaxy.user.isAnonymous()?(this.trigger("error",(0,h.default)("You must be logged in to switch histories"),(0,h.default)("Anonymous user")),n.when()):this.loadHistory(e,{url:Galaxy.root+"history/set_as_current?id="+e})},createNewHistory:function(e){return Galaxy.user.isAnonymous()?(this.trigger("error",(0,h.default)("You must be logged in to create histories"),(0,h.default)("Anonymous user")),n.when()):this.loadHistory(null,{url:Galaxy.root+"history/create_new_current"})},setModel:function(e,t,i){return p.prototype.setModel.call(this,e,t,i),this.model&&this.model.id&&(this.log("checking for updates"),this.model.checkForUpdates()),this},_setUpModelListeners:function(){return p.prototype._setUpModelListeners.call(this),this.listenTo(this.model,{"change:nice_size change:size":function(){this.trigger("history-size-change",this,this.model,arguments)},"change:id":function(){this.once("loading-done",function(){this.model.checkForUpdates()})}})},_setUpCollectionListeners:function(){p.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,"state:ready",function(e,t,i){e.get("visible")||this.collection.storage.includeHidden()||this.removeItemView(e)})},_setUpBehaviors:function(t){t=t||this.$el;var i=this;return p.prototype._setUpBehaviors.call(i,t),this._debouncedScrollCaptureHandler||(this._debouncedScrollCaptureHandler=e.debounce(function(){i.$el.is(":visible")&&i.preferences.set("scrollPosition",n(this).scrollTop())},40)),i.$scrollContainer(t).off("scroll",this._debouncedScrollCaptureHandler).on("scroll",this._debouncedScrollCaptureHandler),i},_buildNewRender:function(){if(!this.model)return n();var e=p.prototype._buildNewRender.call(this);return e.find(".search").prependTo(e.find("> .controls")),this._renderQuotaMessage(e),e},_renderQuotaMessage:function(e){return e=e||this.$el,n(this.templates.quotaMsg({},this)).prependTo(e.find(".messages"))},_renderTags:function(e){var t=this;p.prototype._renderTags.call(t,e),t.preferences.get("tagsEditorShown")&&t.tagsEditor.toggle(!0),t.listenTo(t.tagsEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("tagsEditorShown",e.hidden)})},_renderAnnotation:function(e){var t=this;p.prototype._renderAnnotation.call(t,e),t.preferences.get("annotationEditorShown")&&t.annotationEditor.toggle(!0),t.listenTo(t.annotationEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("annotationEditorShown",e.hidden)})},_swapNewRender:function(t){p.prototype._swapNewRender.call(this,t);var i=this;return e.delay(function(){var e=i.preferences.get("scrollPosition");e&&i.scrollTo(e,0)},10),this},_attachItems:function(e){p.prototype._attachItems.call(this,e);var t=this;return t.currentContentId&&t._setCurrentContentById(t.currentContentId),this},addItemView:function(e,t,i){var n=p.prototype.addItemView.call(this,e,t,i);return n&&this.panelStack.length?this._collapseDrilldownPanel():n},_setUpItemViewListeners:function(e){var t=this;return p.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{"expanded:drilldown":function(e,t){this._expandDrilldownPanel(t)},"collapsed:drilldown":function(e,t){this._collapseDrilldownPanel(t)}})},setCurrentContent:function(e){this.$(".history-content.current-content").removeClass("current-content"),e?(e.$el.addClass("current-content"),this.currentContentId=e.model.id):this.currentContentId=null},_setCurrentContentById:function(e){var t=this.viewFromModelId(e)||null;this.setCurrentContent(t)},_expandDrilldownPanel:function(e){this.panelStack.push(e),this.$controls().add(this.$list()).hide(),e.parentName=this.model.get("name"),e.delegateEvents().render().$el.appendTo(this.$el)},_collapseDrilldownPanel:function(e){this.panelStack.pop(),this.$controls().add(this.$list()).show()},events:e.extend(e.clone(p.prototype.events),{"click .uploader-link":function(e){Galaxy.upload.show(e)},"click .get-data-link":function(e){var t=n(".toolMenuContainer");t.parent().scrollTop(0),t.find('span:contains("Get Data")').click()}}),listenToGalaxy:function(t){this.listenTo(t,{"center-frame:load":function(t){var i=t.fullpath,n=null,a={display:/datasets\/([a-f0-9]+)\/display/,edit:/datasets\/([a-f0-9]+)\/edit/,report_error:/dataset\/errors\?id=([a-f0-9]+)/,rerun:/tool_runner\/rerun\?id=([a-f0-9]+)/,show_params:/datasets\/([a-f0-9]+)\/show_params/};e.find(a,function(t,a){return n=e.result(i.match(t),1)}),this._setCurrentContentById(n?"dataset-"+n:null)},"center-panel:load":function(e){this._setCurrentContentById()}})},connectToQuotaMeter:function(e){return e?(this.listenTo(e,"quota:over",this.showQuotaMessage),this.listenTo(e,"quota:under",this.hideQuotaMessage),this.on("rendered rendered:initial",function(){e&&e.isOverQuota()&&this.showQuotaMessage()}),this):this},clearMessages:function(t){var i=e.isUndefined(t)?this.$messages().children('[class$="message"]'):n(t.currentTarget);return i=i.not(".quota-message"),i.fadeOut(this.fxSpeed,function(){n(this).remove()}),this},showQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")&&e.slideDown(this.fxSpeed)},hideQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")||e.slideUp(this.fxSpeed)},unhideHidden:function(){var e=this;return confirm((0,h.default)("Really unhide all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{visible:!0}).done(function(){e.model.contents.includeHidden||e.renderItems()}):a.when()},deleteHidden:function(){var e=this;return confirm((0,h.default)("Really delete all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{deleted:!0,visible:!0}):a.when()},toString:function(){return"CurrentHistoryView("+(this.model?this.model.get("name"):"")+")"}});_.prototype.templates=function(){var t=c.default.wrapTemplate(['
',(0,h.default)("You are over your disk quota"),". ",(0,h.default)("Tool execution is on hold until your disk usage drops below your allocated quota"),".","
"],"history");return e.extend(e.clone(p.prototype.templates),{quotaMsg:t})}(),t.default={CurrentHistoryView:_}}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(26),d=(s(l),i(10)),c=s(d),u=i(32),h=s(u),f=e.Model.extend({initialize:function(e){e=e||{},e.user_id=e.user_id||Galaxy.user.id,this.set({user_id:e.user_id,information:{title:(0,r.default)("Manage information"),description:"Edit your email, addresses and custom parameters or change your username.",url:"api/users/"+e.user_id+"/information/inputs",icon:"fa-user",redirect:"user"},password:{title:(0,r.default)("Change password"),description:(0,r.default)("Allows you to change your login credentials."),icon:"fa-unlock-alt",url:"api/users/"+e.user_id+"/password/inputs",submit_title:"Save password",redirect:"user"},communication:{title:(0,r.default)("Change communication settings"),description:(0,r.default)("Enable or disable the communication feature to chat with other users."),url:"api/users/"+e.user_id+"/communication/inputs",icon:"fa-comments-o",redirect:"user"},permissions:{title:(0,r.default)("Set dataset permissions for new histories"),description:"Grant others default access to newly created histories. Changes made here will only affect histories created after these settings have been stored.",url:"api/users/"+e.user_id+"/permissions/inputs",icon:"fa-users",submit_title:"Save permissions",redirect:"user"},api_key:{title:(0,r.default)("Manage API key"),description:(0,r.default)("Access your current API key or create a new one."),url:"api/users/"+e.user_id+"/api_key/inputs",icon:"fa-key",submit_title:"Create a new key",submit_icon:"fa-check"},toolbox_filters:{title:(0,r.default)("Manage Toolbox filters"),description:(0,r.default)("Customize your Toolbox by displaying or omitting sets of Tools."),url:"api/users/"+e.user_id+"/toolbox_filters/inputs",icon:"fa-filter",submit_title:"Save filters",redirect:"user"},openids:{title:(0,r.default)("Manage OpenIDs"),description:(0,r.default)("Associate OpenIDs with your account."),icon:"fa-openid",onclick:function(){window.location.href=Galaxy.root+"openids/list"}},custom_builds:{title:(0,r.default)("Manage custom builds"),description:(0,r.default)("Add or remove custom builds using history datasets."),icon:"fa-cubes",onclick:function(){window.location.href=Galaxy.root+"custom_builds"}},logout:{title:(0,r.default)("Sign out"),description:(0,r.default)("Click here to sign out of all sessions."),icon:"fa-sign-out",onclick:function(){Galaxy.modal.show({title:(0,r.default)("Sign out"),body:"Do you want to continue and sign out of all active sessions?",buttons:{Cancel:function(){Galaxy.modal.hide()},"Sign out":function(){window.location.href=Galaxy.root+"user/logout?session_csrf_token="+Galaxy.session_csrf_token}}})}}})}}),p=e.View.extend({title:(0,r.default)("User Preferences"),active_tab:"user",initialize:function(){this.model=new f,this.setElement("
"),this.render()},render:function(){var e=this,t=Galaxy.config;n.getJSON(Galaxy.root+"api/users/"+Galaxy.user.id,function(i){e.$preferences=n("
").addClass("ui-panel").append(n("

").append("User preferences")).append(n("

").append("You are logged in as "+a.escape(i.email)+".")).append(e.$table=n("").addClass("ui-panel-table"));var s=h.default.get("message"),o=h.default.get("status");s&&o&&e.$preferences.prepend(new c.default.Message({message:s,status:o}).$el),t.use_remote_user||(e._addLink("information"),e._addLink("password")),t.enable_communication_server&&e._addLink("communication"),e._addLink("custom_builds"),e._addLink("permissions"),e._addLink("api_key"),t.has_user_tool_filters&&e._addLink("toolbox_filters"),t.enable_openid&&!t.use_remote_user&&e._addLink("openids"),Galaxy.session_csrf_token&&e._addLink("logout"),e.$preferences.append(e._templateFooter(i)),e.$el.empty().append(e.$preferences)})},_addLink:function(e){var t=this.model.get(e),i=n(this._templateLink(t)),a=i.find("a");t.onclick?a.on("click",function(){t.onclick()}):a.attr("href",Galaxy.root+"user/"+e),this.$table.append(i)},_templateLink:function(e){return'"},_templateFooter:function(e){return''}});t.default={View:p,Model:f}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),o=a(s),r=i(5),l=(a(r),i(10)),d=a(l),c=i(26),u=a(c),h=i(659),f=a(h),p=e.Collection.extend({comparator:function(e,t){return e=e.get("name"),t=t.get("name"),e>t?1:e").append(n("

").text("Current Custom Builds")).append(this.table.$el).append(this.$installed=n("
").append(n("

").text("System Installed Builds").addClass("ui-margin-top")).append(this.installed_builds.$el)).append(n("

").text("Add a Custom Build").addClass("ui-margin-top")).append(n("").addClass("ui-column").append(n("
").addClass("ui-column-left").append(this.message.$el).append(this.$form=n("
").addClass("ui-margin-top"))).append(this.$help=n("
").addClass("ui-column-right")))),this.listenTo(this.collection,"add remove reset",function(){i._renderTable()}),this.listenTo(this.model,"change",function(){i._renderForm()}),this.collection.fetch(),this.model.fetch()},render:function(){this._renderTable(),this._renderForm()},_renderTable:function(){var e=this;this.table.delAll(),this.collection.sort(),this.collection.each(function(t){e.table.add(t.get("name")),e.table.add(t.id),e.table.add(void 0!==t.get("count")?t.get("count"):"Processing..."),e.table.add(new d.default.ButtonIcon({icon:"fa-trash-o",cls:"ui-button-icon-plain",tooltip:(0,o.default)("Delete custom build."),onclick:function(){t.destroy()}}).$el),e.table.append(t.id)})},_renderForm:function(){var e=this,t=new u.default({inputs:[{type:"text",name:"name",label:"Name",help:"Specify a build name e.g. Hamster."},{type:"text",name:"id",label:"Key",help:"Specify a build key e.g. hamster_v1."},{name:"len",type:"conditional",test_param:{name:"type",label:"Definition",help:(0,o.default)("Provide the data source."),type:"select",value:"fasta",data:[{value:"fasta",label:"FASTA-file from history"},{value:"file",label:"Len-file from disk"},{value:"text",label:"Len-file by copy/paste"}]},cases:[{value:"fasta",inputs:[{type:"select",name:"value",label:"FASTA-file",data:this.model.get("fasta_hdas")}]},{value:"file",inputs:[{type:"upload",name:"value",label:"Len-file",data:this.model.get("len_hdas")}]},{value:"text",inputs:[{type:"text",area:!0,name:"value",label:"Edit/Paste"}]}]}],buttons:{save:new d.default.Button({icon:"fa-save",tooltip:(0,o.default)("Create new Build"),title:(0,o.default)("Save"),cls:"btn btn-primary ui-clear-float",onclick:function(){var i=t.data.create();i.id&&i.name?e.collection.create(i,{wait:!0,success:function(t){t.get("message")?e.message.update({message:t.get("message"),status:"warning"}):e.message.update({message:"Successfully added a new custom build.",status:"success"})},error:function(t,i){var n=i&&i.responseJSON&&i.responseJSON.err_msg;e.message.update({message:n||"Failed to create custom build.",status:"danger"})}}):e.message.update({message:"All inputs are required.",status:"danger"})}})},onchange:function(){var i=t.data.match("len|type");if(i){var n=t.field_list[i];e._renderHelp(n.value())}}});this.$form.empty().append(t.$el);var i=this.model.get("installed_builds");i&&i.length?(this.$installed.show(),this.installed_builds.update(this.model.get("installed_builds"))):this.$installed.hide(),this._renderHelp("fasta")},_renderHelp:function(e){this.$help.empty().addClass("alert alert-info").html("fasta"==e?this._templateFasta():this._templateLen())},_templateLen:function(){return"

Length Format

The length format is two-column, separated by whitespace, of the form:

chrom/contig   length of chrom/contig

For example, the first few entries of mm9.len are as follows:

chr1    197195432\nchr2    181748087\nchr3    159599783\nchr4    155630120\nchr5    152537259

Trackster uses this information to populate the select box for chrom/contig, andto set the maximum basepair of the track browser. You may either upload a .len fileof this format (Len File option), or directly enter the information into the box (Len Entry option).

"},_templateFasta:function(){return"

FASTA format

This is a multi-fasta file from your current history that provides the genomesequences for each chromosome/contig in your build.

Here is a snippet from an example multi-fasta file:

>chr1\nATTATATATAAGACCACAGAGAGAATATTTTGCCCGG...\n\n>chr2\nGGCGGCCGCGGCGATATAGAACTACTCATTATATATA...\n\n...

"}});t.default={View:_}}).call(t,i(2),i(0))},function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0});var a=i(5),s=function(e){return e&&e.__esModule?e:{default:e}}(a),o=e.View.extend({initialize:function(e){this.options=s.default.merge(e,{content:"No content available.",onchange:null,ondblclick:null,onconfirm:null,cls:"ui-table",selectable:!0,cls_tr:""}),this.setElement(this._template()),this.$thead=this.$("thead"),this.$tbody=this.$("tbody"),this.$tmessage=this.$("tmessage"),this.row=this._row(),this.row_count=0},events:{click:"_onclick",dblclick:"_ondblclick"},addHeader:function(e){this.row.append(n("

")},add:function(e,t,i){var a=n("')},_onclick:function(e){var t=this.value(),i=n(e.target).closest("tr").attr("id");""!=i&&i&&t!=i&&(this.options.onconfirm?this.options.onconfirm(i):this.value(i))},_ondblclick:function(e){var t=this.value();t&&this.options.ondblclick&&this.options.ondblclick(t)},_refresh:function(){0==this.row_count?this.$tmessage.show():this.$tmessage.hide()},_template:function(){return'
'+e.title+'
'+e.description+"
").append(e))},appendHeader:function(){this.$thead.append(this.row),this.row=n("
");t&&a.css("width",t),i&&a.css("text-align",i),this.row.append(a.append(e))},append:function(e,t){this._commit(e,t,!1)},prepend:function(e,t){this._commit(e,t,!0)},get:function(e){return this.$("#"+e)},del:function(e){var t=this.$tbody.find("#"+e);t.length>0&&(t.remove(),this.row_count--,this._refresh())},delAll:function(){this.$tbody.empty(),this.row_count=0,this._refresh()},value:function(e){if(this.options.selectable){this.before=this.$tbody.find(".current").attr("id"),void 0!==e&&(this.$tbody.find("tr").removeClass("current"),e&&this.$tbody.find("#"+e).addClass("current"));var t=this.$tbody.find(".current").attr("id");return void 0===t?null:(t!=this.before&&this.options.onchange&&this.options.onchange(e),t)}},size:function(){return this.$tbody.find("tr").length},_commit:function(e,t,i){this.del(e),this.row.attr("id",e),i?this.$tbody.prepend(this.row):this.$tbody.append(this.row),t&&(this.row.hide(),this.row.fadeIn()),this.row=this._row(),this.row_count++,this._refresh()},_row:function(){return n('
'+this.options.content+"

"}});t.default={View:o}}).call(t,i(2),i(0))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(24),r=s(o),l=i(34),d=s(l),c=e.View.extend({initialize:function(t){var i=this;d.default.markViewAsLoading(this),this.model=new e.Model(t),this.item=this.model.get("item"),this.title=this.model.get("plural"),t&&t.active_tab&&(this.active_tab=t.active_tab),n.ajax({url:Galaxy.root+this.item+"/"+this.model.get("action_id")+"?"+n.param(Galaxy.params),success:function(e){i.model.set(e),i.render()}})},render:function(){var e=new r.default(this.model.attributes);this.$el.empty().append(e.$el),this.$el.append(this._templateShared())},_templateShared:function(){var e=this,t=n("

"+this.model.get("plural")+" shared with you by others

"),i=this.model.attributes;if(i.shared_by_others&&i.shared_by_others.length>0){var s=n('
TitleOwner
');a.each(i.shared_by_others,function(t,i){var n=Galaxy.root+e.item+"/display_by_username_and_slug?username="+t.username+"&slug="+t.slug;s.append('

'+a.escape(t.title)+""+a.escape(t.username)+"
\n
\n \n '+c.escape(this.model.get("name"))+'\n \n \n '+this._templateActions()+'\n
\n
\n
\n
\n
\n '+(this.model.get("owner")===Galaxy.user.attributes.username?"You":this.model.get("owner"))+"\n "+this.model.get("number_of_steps")+""+(this.model.get("published")?"Yes":"No")+""+i+"

Drop workflow files here to import

NameTagsOwner# of StepsPublishedShow in tools panel
'},_templateHeader:function(){return'

'+(0,v.default)("Your workflows")+"

"}});t.default={View:x}}).call(t,i(0))},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=i(6),a=function(e){return e&&e.__esModule?e:{default:e}}(n),s=e.Model.extend(a.default.LoggableMixin).extend({_logNamespace:"workflow",urlRoot:Galaxy.root+"api/workflows",toJSON:function(){return{workflow:this.attributes}}}),o=e.Collection.extend({model:s,url:Galaxy.root+"api/workflows"});t.default={WorkflowItem:s,WorkflowCollection:o}}).call(t,i(2))},function(e,t,i){"use strict";function n(e){i(664)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(398),s=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);var r=i(666),l=i(23),d=n,c=Object(l.a)(s.a,r.a,r.b,!1,d,null,null);t.default=c.exports},function(e,t,i){var n=i(665);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("8aa17c54",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,".ui-message{display:block}",""])},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-portlet-limited"},[e._m(0),e._v(" "),i("div",{staticClass:"portlet-content"},[e.errormessage?i("div",{staticClass:"ui-message alert alert-danger"},[e._v("\n "+e._s(e.errormessage)+"\n ")]):e._e(),e._v(" "),i("div",{staticClass:"portlet-body"},[i("form",{ref:"form"},[e._m(1),e._v(" "),e._m(2)])]),e._v(" "),i("div",{staticClass:"portlet-buttons"},[i("input",{staticClass:"btn btn-primary",attrs:{type:"button",value:"Import Workflow"},on:{click:e.submit}})]),e._v(" "),i("hr"),e._v(" "),i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Import a Workflow from myExperiment")]),e._v(" "),i("a",{attrs:{href:e.myexperiment_target_url}},[e._v("Visit myExperiment")]),e._v(" "),i("div",{staticClass:"ui-form-info"},[e._v("Click the link above to visit myExperiment and search for Galaxy workflows.")])])])])},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"portlet-header"},[i("div",{staticClass:"portlet-title"},[i("i",{staticClass:"portlet-title-icon fa fa-upload"}),e._v(" "),i("span",{staticClass:"portlet-title-text"},[i("b",[e._v("Import Workflow")])])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived Workflow URL")]),e._v(" "),i("input",{staticClass:"ui-input",attrs:{type:"text",name:"archive_source"}}),e._v(" "),i("div",{staticClass:"ui-form-info"},[e._v("If the workflow is accessible via a URL, enter the URL above and click Import.")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived Workflow file")]),e._v(" "),i("input",{attrs:{type:"file",name:"archive_file"}}),e._v(" "),i("div",{staticClass:"ui-form-info"},[e._v("If the workflow is in a file on your computer, choose it and then click Import.")])])}]},function(e,t,i){"use strict";function n(e){i(668)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(399),s=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);var r=i(670),l=i(23),d=n,c=Object(l.a)(s.a,r.a,r.b,!1,d,null,null);t.default=c.exports},function(e,t,i){var n=i(669);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("7f0534ae",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,".ui-show{display:block}",""])},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-portlet-limited"},[e._m(0),e._v(" "),i("div",{staticClass:"portlet-content"},[e.errormessage?i("div",{staticClass:"ui-message ui-show alert alert-danger"},[e._v("\n "+e._s(e.errormessage)+"\n ")]):e._e(),e._v(" "),i("div",{staticClass:"portlet-body"},[i("form",{ref:"form"},[e._m(1),e._v(" "),e._m(2)])]),e._v(" "),i("div",{staticClass:"portlet-buttons"},[i("input",{staticClass:"btn btn-primary",attrs:{type:"button",value:"Import History"},on:{click:e.submit}})])])])},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"portlet-header"},[i("div",{staticClass:"portlet-title"},[i("i",{staticClass:"portlet-title-icon fa fa-upload"}),e._v(" "),i("span",{staticClass:"portlet-title-text"},[i("b",[e._v("Import a History from an Archive")])])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived History URL")]),e._v(" "),i("input",{staticClass:"ui-input",attrs:{type:"text",name:"archive_source"}})])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived History file")]),e._v(" "),i("input",{attrs:{type:"file",name:"archive_file"}})])}]},function(e,t,i){"use strict";function n(e){i(672)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(400),s=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);var r=i(677),l=i(23),d=n,c=Object(l.a)(s.a,r.a,r.b,!1,d,null,null);t.default=c.exports},function(e,t,i){var n=i(673);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("4ac6e7a4",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,"#history-view-controls{flex:0 0 44px;background-color:#fff;border-bottom:1px solid #ddd;width:100%;padding:8px}.history-panel>.controls .title{font-size:120%}.history-panel>.controls .title input{font-size:100%}a.btn{text-decoration:none}",""])},function(e,t,i){var n=i(675);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("25eda0e2",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,'.bold{font-weight:700}.light{font-weight:lighter;color:grey}.right-aligned{text-align:right}.clickable{cursor:pointer}.workflow{border:1px solid gray;margin-bottom:1%}.workflow>.header{background:#d3d3d3;padding:5px 10px}.workflow>.light{color:gray}.workflow>.body{border-top:1px solid gray}.workflow>.body>.toolForm{border:0;margin:0}div.toolForm{border-width:1px;border-radius:0;margin-bottom:1%}.toolForm>.header{background-color:#ebd9b2;padding:5px 10px}.workflow div.toolForm:not(:first-child) .header{border-top:1px solid #d6b161}div.toolFormTitle{padding:0 0 4px;margin:0 0 4px;border:0;background-color:transparent;border-bottom:1px solid #d6b161}.toolForm em,.toolFormTitle>.light{color:#90743a}.job-inputs{margin:0 6px;text-align:left}.job-inputs td:first-child{text-align:right;font-weight:lighter;color:#90743a}.job-inputs td:first-child:after{content:":"}.job-inputs td:nth-child(2){padding-left:4px}.job-inputs-show{float:right}.copied-from{border:1px solid #d3d3d3;border-width:1px 1px 0;margin-bottom:1%}.copied-from .header{border-bottom:1px solid #d3d3d3;padding:5px}.copied-from .header .bold,.copied-from .header a{color:#888}.dataset.hda{min-height:37px;border-width:0 0 1px}.toolFormBody>.dataset.hda:last-child{border-bottom-width:0}.dataset.hda:first-child{border-top:1px solid #d6b161}.dataset.hda .dataset-title-bar{padding-top:8px;padding-left:10px}',""])},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e._l(e.errorMessages,function(t){return i("div",[i("div",{staticClass:"alert alert-danger",attrs:{role:"alert"}},[e._v("\n "+e._s(t)+"\n ")])])}),e._v(" "),i("div",{domProps:{innerHTML:e._s(e.historyTemplate)}})],2)},a=[]},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"structured-history-view"}},[i("div",{staticClass:"clear",attrs:{id:"history-view-controls"}},[i("div",{staticClass:"float-left"},[0==e.historyHistory.purged?i("span",[0==e.historyData.user_is_owner?i("span",[i("button",{staticClass:"btn btn-secondary",attrs:{id:"import"}},[e._v("Import and start using history")])]):e._e(),e._v(" "),e.historyData.user_is_owner&&0==e.historyData.history_is_current?i("span",[i("button",{staticClass:"btn btn-secondary",attrs:{id:"switch-history"},on:{click:e.switchHistory}},[e._v("Switch to this history")])]):e._e(),e._v(" "),i("button",{staticClass:"btn btn-secondary",attrs:{id:"show-structure"},on:{click:e.showStructure}},[e._v("Show structure")])]):e._e()]),e._v(" "),e._m(0)]),e._v(" "),e._l(e.errorMessages,function(t){return i("div",[i("div",{staticClass:"alert alert-danger",attrs:{role:"alert"}},[e._v("\n "+e._s(t)+"\n ")])])}),e._v(" "),i("div",{staticClass:"history-panel unified-panel-body",staticStyle:{overflow:"auto"},attrs:{id:"history-"+e.historyHistory.id}})],2)},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"float-right"},[i("button",{staticClass:"btn btn-secondary",attrs:{id:"toggle-deleted"}},[e._v("Include deleted")]),e._v(" "),i("button",{staticClass:"btn btn-secondary",attrs:{id:"toggle-hidden"}},[e._v("Include hidden")])])}]},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),s=n(a),o=i(86),r=n(o),l=i(5),d=n(l),c=i(24),u=n(c),h=i(144),f=n(h),p=i(143),_=n(p),m=i(34),g=n(m),v=i(9),w=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(v),y=u.default.extend({initialize:function(e){this.ajaxQueue=new r.default.AjaxQueue,u.default.prototype.initialize.call(this,e)},init_grid_elements:function(){var t=this.ajaxQueue;t.stop(),u.default.prototype.init_grid_elements.call(this),e.makeArray(this.$el.find(".delayed-value-datasets_by_state").map(function(t,i){return function(){var t=e(i).data("id"),n=Galaxy.root+"api/histories/"+t+"?keys=nice_size,contents_active,contents_states",a={};return a.url=n,a.type="GET",a.success=function(i){for(var n=i.contents_states,a="",s=["ok","running","queued","new","error"],o=0;o'+l+" ")}var d=i.contents_active,c=d.deleted;c&&(a+='
'+c+"
");var u=d.hidden;u&&(a+='
'+u+"
"),e(".delayed-value-datasets_by_state[data-id='"+t+"']").html(a),e(".delayed-value-disk_size[data-id='"+t+"']").html(i.nice_size)},e.ajax(a)}})).forEach(function(e){return t.add(e)}),t.start()},_showCopyDialog:function(e){var t=new f.default.History({id:e});t.fetch().fail(function(){alert("History could not be fetched. Please contact an administrator")}).done(function(){(0,_.default)(t,{}).done(function(){window.parent&&window.parent.Galaxy&&window.parent.Galaxy.currHistoryPanel&&window.parent.Galaxy.currHistoryPanel.loadCurrentHistory(),window.location.reload(!0)})})},add_operation:function(e,t,i){var n=this;"Copy"==t.label&&(t.onclick=function(e){n._showCopyDialog(e)}),u.default.prototype.add_operation.call(this,e,t,i)}}),b=w.View.extend({title:(0,s.default)("Histories"),initialize:function(t){var i=this;g.default.markViewAsLoading(this),"list_published"==t.action_id?this.active_tab="shared":"list"==t.action_id&&(this.active_tab="user"),this.model=new w.Model,d.default.get({url:Galaxy.root+"history/"+t.action_id+"?"+e.param(Galaxy.params),success:function(e){i.model.set(e),i.render()}})},render:function(){var e=new y(this.model.attributes);this.$el.empty().append(e.$el)}});t.default={View:b}}).call(t,i(0))},function(e,t,i){"use strict";function n(e){i(680)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(403),s=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);var r=i(682),l=i(23),d=n,c=Object(l.a)(s.a,r.a,r.b,!1,d,null,null);t.default=c.exports},function(e,t,i){var n=i(681);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("67f12bb6",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,".ui-show{display:block;margin-top:0}.ui-bold{font-weight:700;margin-bottom:5px}.ui-float-left{float:left;margin-top:10px}",""])},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-thumbnails"},[e.error?i("div",{staticClass:"ui-message ui-show alert alert-danger"},[e._v("\n "+e._s(e.error)+"\n ")]):i("div",{staticClass:"ui-thumbnails-grid"},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"search-query parent-width",attrs:{name:"query",placeholder:"search visualizations",autocomplete:"off",type:"text"},domProps:{value:e.search},on:{input:function(t){t.target.composing||(e.search=t.target.value)}}}),e._v(" "),e._l(e.plugins,function(t){return i("div",[e.match(t)?i("table",[i("tr",{staticClass:"ui-thumbnails-item",on:{click:function(i){e.select(t)}}},[i("td",[t.logo?i("img",{staticClass:"ui-thumbnails-image",attrs:{src:t.logo}}):i("div",{staticClass:"ui-thumbnails-icon fa fa-eye"})]),e._v(" "),i("td",[i("div",{staticClass:"ui-thumbnails-description-title ui-form-info"},[e._v("\n "+e._s(t.html)+"\n ")]),e._v(" "),i("div",{staticClass:"ui-thumbnails-description-text ui-form-info"},[e._v("\n "+e._s(t.description)+"\n ")])])]),e._v(" "),e.fixed?e._e():i("tr",[i("td"),e._v(" "),t.name==e.name?i("td",[e.hdas&&e.hdas.length>0?i("div",[i("div",{staticClass:"ui-form-info ui-bold"},[e._v("Select a dataset to visualize:")]),e._v(" "),i("div",{staticClass:"ui-select"},[i("select",{directives:[{name:"model",rawName:"v-model",value:e.selected,expression:"selected"}],staticClass:"select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selected=t.target.multiple?i:i[0]}}},e._l(e.hdas,function(t){return i("option",{domProps:{value:t.id}},[e._v(e._s(t.name))])})),e._v(" "),i("div",{staticClass:"icon-dropdown fa fa-caret-down"})]),e._v(" "),i("button",{staticClass:"ui-button-default ui-float-left btn btn-primary",attrs:{type:"button"},on:{click:function(i){e.create(t)}}},[i("i",{staticClass:"icon fa fa-check ui-margin-right"}),e._v(" "),i("span",{staticClass:"title"},[e._v("Create Visualization")])])]):i("div",{staticClass:"ui-message ui-show alert alert-danger"},[e._v("\n There is no suitable dataset in your current history which can be visualized with this plugin.\n ")])]):e._e()])]):e._e()])})],2)])},a=[]},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(5),d=s(l),c=i(10),u=s(c),h=i(26),f=s(h),p=e.View.extend({initialize:function(){this.setElement("
"),this.model=new e.Model({dataset_id:Galaxy.params.dataset_id}),this.active_tab="user",this.render()},render:function(){var e=this,t=Galaxy.root+"api/datasets/"+this.model.get("dataset_id");d.default.get({url:t,success:function(t){var i=Galaxy.root+"api/jobs/"+t.creating_job+"?full=True";d.default.get({url:i,success:function(i){e.render_error_page(t,i)},error:function(t){var i={status:"error",message:"Error occured while loading the job.",persistent:!0,cls:"errormessage"};e.display_message(i,e.$(".response-message"))}})},error:function(t){var i={status:"error",message:"Error occured while loading the dataset.",persistent:!0,cls:"errormessage"};e.display_message(i,e.$(".response-message"))}})},render_error_page:function(e,t){this.$el.empty().append("\n "+this._templateHeader()+"\n

Dataset Error

\n

An error occured while running the tool "+t.tool_id+'.

\n

Tool execution generated the following messages:

\n
'+n.escape(t.stderr)+"
\n

Report This Error

\n

\n Usually the local Galaxy administrators regularly review errors that occur on the server\n However, if you would like to provide additional information (such as what you were trying\n to do when the error occurred) and a contact e-mail address, we will be better able to\n investigate your problem and get back to you.\n

"),this.$el.append(this._getBugFormTemplate(e,t))},display_message:function(e,t,i,n){n?i?t.append(new u.default.UnescapedMessage(e).$el):t.empty().html(new u.default.UnescapedMessage(e).$el):i?t.append(new u.default.Message(e).$el):t.empty().html(new u.default.Message(e).$el)},_templateHeader:function(){return'
'},_getBugFormTemplate:function(e,t){var i=this,n=[{help:(0,r.default)("Your email address"),options:[],type:"text",name:"email",label:"Your email",value:Galaxy.user.get("email")},{help:(0,r.default)("Any additional comments you can provide regarding what you were doing at the time of the bug."),options:[],type:"text",area:!0,name:"message",label:"Message"}],a=new f.default({title:(0,r.default)("Error Report"),inputs:n,buttons:{save:new u.default.Button({icon:"fa-bug",title:(0,r.default)("Report"),cls:"ui-button btn btn-primary",floating:"clear",onclick:function(){var n=a.data.create(),s=Galaxy.root+"api/jobs/"+t.id+"/error";n.dataset_id=e.id,i.submit(n,s)}})}});return a.$el},submit:function(e,t){var i=this;a.ajax({type:"POST",url:t,data:e,success:function(e){i.$el.empty().append(i._templateHeader()),e.messages.forEach(function(e){i.display_message({status:e[1],message:e[0],persistent:!0},i.$(".response-message"),!0,!0)})},error:function(e){var t={status:"error",message:"Error occured while saving. Please fill all the required fields and try again.",persistent:!0,cls:"errormessage"};i.display_message(t,i.$(".response-message"))}})}});t.default={View:p}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(5),d=(s(l),i(80)),c=s(d),u=i(10),h=s(u),f=i(26),p=s(f),_=e.View.extend({initialize:function(){this.setElement("
"),this.model=new e.Model({dataset_id:Galaxy.params.dataset_id}),this.message=new h.default.Message({persistent:!0}),this.tabs=this._createTabs(),this.active_tab="user",this.$el.append(n("

").append("Edit dataset attributes")).append(this.message.$el).append("

").append(this.tabs.$el).hide(),this.render()},render:function(){var e=this;n.ajax({url:Galaxy.root+"dataset/get_edit?dataset_id="+e.model.get("dataset_id"),success:function(t){!e.initial_message&&e.message.update(t),e.initial_message=!0,a.each(e.forms,function(e,i){e.model.set("inputs",t[i+"_inputs"]),e.model.set("hide_operations",t[i+"_disable"]),e.render()}),e.$el.show()},error:function(t){var i=t.responseJSON&&t.responseJSON.err_msg;e.message.update({status:"danger",message:i||"Error occured while loading the dataset."})}})},_submit:function(e,t){var i=this,a=t.data.create();a.dataset_id=this.model.get("dataset_id"),a.operation=e,n.ajax({type:"PUT",url:Galaxy.root+"dataset/set_edit",data:a,success:function(e){i.message.update(e),i.render(),i._reloadHistory()},error:function(e){var t=e.responseJSON&&e.responseJSON.err_msg;i.message.update({status:"danger",message:t||"Error occured while editing the dataset attributes."})}})},_createTabs:function(){this.forms={attribute:this._getAttribute(),conversion:this._getConversion(),datatype:this._getDatatype(),permission:this._getPermission()};var e=new c.default.View;return e.add({id:"attribute",title:(0,r.default)("Attributes"),icon:"fa fa-bars",tooltip:(0,r.default)("Edit dataset attributes"),$el:this.forms.attribute.$el}),e.add({id:"convert",title:(0,r.default)("Convert"),icon:"fa-gear",tooltip:(0,r.default)("Convert to new format"),$el:this.forms.conversion.$el}),e.add({id:"datatype",title:(0,r.default)("Datatypes"),icon:"fa-database",tooltip:(0,r.default)("Change data type"),$el:this.forms.datatype.$el}),e.add({id:"permissions",title:(0,r.default)("Permissions"),icon:"fa-user",tooltip:(0,r.default)("Permissions"),$el:this.forms.permission.$el}),e},_getAttribute:function(){var e=this,t=new p.default({title:(0,r.default)("Edit attributes"),operations:{submit_attributes:new h.default.ButtonIcon({tooltip:(0,r.default)("Save attributes of the dataset."),icon:"fa-floppy-o",title:(0,r.default)("Save"),onclick:function(){e._submit("attributes",t)}}),submit_autodetect:new h.default.ButtonIcon({tooltip:"This will inspect the dataset and attempt to correct the values of fields if they are not accurate.",icon:"fa-undo",title:"Auto-detect",onclick:function(){e._submit("autodetect",t)}})}});return t},_getConversion:function(){var e=this,t=new p.default({title:(0,r.default)("Convert to new format"),operations:{submit_conversion:new h.default.ButtonIcon({tooltip:(0,r.default)("Convert the datatype to a new format."),title:(0,r.default)("Convert datatype"),icon:"fa-exchange",onclick:function(){e._submit("conversion",t)}})}});return t},_getDatatype:function(){var e=this,t=new p.default({title:(0,r.default)("Change datatype"),operations:{submit_datatype:new h.default.ButtonIcon({tooltip:(0,r.default)("Change the datatype to a new type."),title:(0,r.default)("Change datatype"),icon:"fa-exchange",onclick:function(){e._submit("datatype",t)}})}});return t},_getPermission:function(){var e=this,t=new p.default({title:(0,r.default)("Manage dataset permissions"),operations:{submit_permission:new h.default.ButtonIcon({tooltip:(0,r.default)("Save permissions."),title:(0,r.default)("Save permissions"),icon:"fa-floppy-o ",onclick:function(){e._submit("permission",t)}})}});return t},_reloadHistory:function(){window.Galaxy&&window.Galaxy.currHistoryPanel.loadCurrentHistory()}});t.default={View:_}}).call(t,i(2),i(0),i(1))}],[642]); \ No newline at end of file +webpackJsonp([0],[,,,,,,,,,,,function(e,t,i){"use strict";function n(e,t){return function(i){if(e.hasOwnProperty(i))return e[i];if(!t)throw new Error("I do not know how to modify the following string: "+i+". Change your TeX file or submit a feature request at https://github.com/digitalheir/tex-to-unicode/issues.");return i+t}}Object.defineProperty(t,"__esModule",{value:!0}),t.lookupOrAppend=n},,function(e,t,i){"use strict";function n(e){return"("+e+")"}Object.defineProperty(t,"__esModule",{value:!0}),t.simpleSuffix=function(e){return function(t){return t+e}},t.isSingleTerm=/^.$|^[0-9]+$/,t.addParenthesis=n},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(31),d=s(l),c=e.Model.extend({}),u=e.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this.get("metadata")||this._set_metadata(),this.on("change",this._set_metadata,this)},_set_metadata:function(){var e=new c;n.each(n.keys(this.attributes),function(t){if(0===t.indexOf("metadata_")){var i=t.split("metadata_")[1];e.set(i,this.attributes[t]),delete this.attributes[t]}},this),this.set("metadata",e,{silent:!0})},get_metadata:function(e){return this.attributes.metadata.get(e)},urlRoot:Galaxy.root+"api/datasets"}),h=u.extend({defaults:n.extend({},u.prototype.defaults,{chunk_url:null,first_data_chunk:null,offset:0,at_eof:!1}),initialize:function(e){u.prototype.initialize.call(this),this.attributes.first_data_chunk&&(this.attributes.offset=this.attributes.first_data_chunk.offset),this.attributes.chunk_url=Galaxy.root+"dataset/display?dataset_id="+this.id,this.attributes.url_viz=Galaxy.root+"visualization"},get_next_chunk:function(){if(this.attributes.at_eof)return null;var e=this,t=a.Deferred();return a.getJSON(this.attributes.chunk_url,{offset:e.attributes.offset}).success(function(i){var n;""!==i.ck_data?(n=i,e.attributes.offset=i.offset):(e.attributes.at_eof=!0,n=null),t.resolve(n)}),t}}),f=e.Collection.extend({model:u}),p=e.View.extend({initialize:function(e){this.row_count=0,this.loading_chunk=!1,new g({model:e.model,$el:this.$el})},expand_to_container:function(){this.$el.height()").attr("id","loading_indicator"),this.$el.append(this.loading_indicator);var e=a("").attr({id:"content_table",cellpadding:0});this.$el.append(e);var t=this.model.get_metadata("column_names"),i=a("").appendTo(e),n=a("").appendTo(i);if(t)n.append("");else for(var s=1;s<=this.model.get_metadata("columns");s++)n.append("");var o=this,r=this.model.get("first_data_chunk");r?this._renderChunk(r):a.when(o.model.get_next_chunk()).then(function(e){o._renderChunk(e)}),this.scroll_elt.scroll(function(){o.attempt_to_fetch()})},scrolled_to_bottom:function(){return!1},_renderCell:function(e,t,i){var n=a("")}),t.append(s)}else t.append("No "+this.model.get("plural").toLowerCase()+" have been shared with you.");return t}});t.default={View:c}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0});var s=i(20),o=a(s),r=i(9),l=a(r),d=i(1),c=a(d),u=i(68),h=n(u),f=i(662),p=n(f),_=i(32),m=n(_),g=i(3),v=n(g),w=i(34),y=n(w),b=l.View.extend({tagName:"tr",initialize:function(){c.bindAll(this,"render","_rowTemplate","renderTagEditor","_templateActions","removeWorkflow","copyWorkflow"),o.options.timeOut=1500},events:{"click #show-in-tool-panel":"showInToolPanel","click #delete-workflow":"removeWorkflow","click #rename-workflow":"renameWorkflow","click #copy-workflow":"copyWorkflow"},render:function(){return e(this.el).html(this._rowTemplate()),this},showInToolPanel:function(){this.model.save({show_in_tool_panel:!this.model.get("show_in_tool_panel")},{success:function(){window.location=Galaxy.root+"workflows/list"}})},removeWorkflow:function(){var e=this.model.get("name");window.confirm("Are you sure you want to delete workflow '"+e+"'?")&&(this.model.destroy({success:function(){o.success("Successfully deleted workflow '"+e+"'")}}),this.remove())},renameWorkflow:function(){var e=this.model.get("name"),t=window.prompt("Enter a new Name for workflow '"+e+"'",e);t&&(this.model.save({name:t},{success:function(){o.success("Successfully renamed workflow '"+e+"' to '"+t+"'")}}),this.render())},copyWorkflow:function(){var t=this,i=this.model.get("name");e.getJSON(this.model.urlRoot+"/"+this.model.id+"/download",function(e){var n="Copy of "+i,a=t.model.get("owner");a!=Galaxy.user.attributes.username&&(n+=" shared by user "+a),e.name=n,t.collection.create(e,{at:0,wait:!0,success:function(){o.success("Successfully copied workflow '"+i+"' to '"+n+"'")},error:function(e,t,i){o.error(i.errorThrown)}})}).error(function(e,t,i){o.error(e.responseJSON.err_msg)})},_rowTemplate:function(){var e=this.model.get("show_in_tool_panel"),t=this.model.id,i='';return'\n \n \n \n \n \n "},renderTagEditor:function(){var t=new h.default.TagsEditor({model:this.model,el:e.find("."+this.model.id+".tags-display"),workflow_mode:!0});t.toggle(!0),t.render()},_templateActions:function(){return this.model.get("owner")===Galaxy.user.attributes.username?'':''}}),x=l.View.extend({title:(0,v.default)("Workflows"),active_tab:"workflow",initialize:function(){y.default.markViewAsLoading(this),c.bindAll(this,"adjustActiondropdown"),this.collection=new p.default.WorkflowCollection,this.collection.fetch().done(this.render()),this.collection.bind("add",this.appendItem),this.collection.on("sync",this.render,this)},events:{dragleave:"unhighlightDropZone",drop:"drop",dragover:function(t){e(".hidden_description_layer").addClass("dragover"),e(".menubutton").addClass("background-none"),t.preventDefault()}},unhighlightDropZone:function(){e(".hidden_description_layer").removeClass("dragover"),e(".menubutton").removeClass("background-none")},drop:function(e){this.unhighlightDropZone(),e.preventDefault();for(var t,i=e.dataTransfer.files,n=0;t=i[n];n++)this.readWorkflowFiles(t)},readWorkflowFiles:function(e){var t=this,i=new FileReader;i.onload=function(n){var a=void 0;try{a=JSON.parse(i.result)}catch(t){o.error("Could not read file '"+e.name+"'. Verify it is a valid Galaxy workflow"),a=null}a&&t.collection.create(a,{at:0,wait:!0,success:function(){o.success("Successfully imported workflow '"+a.name+"'")},error:function(e,t,i){o.error(i.errorThrown)}})},i.readAsText(e,"utf-8")},_showArgErrors:c.once(function(){var e=m.default.get("message");"error"===m.default.get("status")?o.error(c.escape(e||"Unknown Error, please report this to an administrator.")):e&&o.info(c.escape(e))}),render:function(){var e=this,t=this._templateHeader(),i=this._templateActionButtons(),n=this._templateWorkflowTable();this.$el.html(t+i+n),c.each(this.collection.models,function(t){e.appendItem(t),e.confirmDelete(t)});return this.searchWorkflow(this.$(".search-wf"),this.$(".workflow-search tr"),3),this.adjustActiondropdown(),this._showArgErrors(),this},appendItem:function(t){var i=new b({model:t,collection:this.collection});e(".workflow-search").append(i.render().el),i.renderTagEditor()},confirmDelete:function(e){this.$(".link-confirm-shared-"+e.id).click(function(){return window.confirm("Are you sure you want to remove the shared workflow '"+e.attributes.name+"'?")})},searchWorkflow:function(t,i,n){t.on("keyup",function(){var t=e(this).val();if(t.length>=n){var a=new RegExp(t,"i");i.hide(),i.filter(function(){return a.test(e(this).text())}).show()}else i.show()})},adjustActiondropdown:function(){e(this.el).on("show.bs.dropdown",function(){e(this.el).css("overflow","inherit")}),e(this.el).on("hide.bs.dropdown",function(){e(this.el).css("overflow","auto")})},_templateNoWorkflow:function(){return'
You have no workflows.
'},_templateActionButtons:function(){return'
'},_templateWorkflowTable:function(){return'
"+t.join("")+""+s+"").text(e),s=this.model.get_metadata("column_types");return void 0!==i?n.attr("colspan",i).addClass("stringalign"):s&&t"),s=this.model.get_metadata("columns");return this.row_count%2!=0&&i.addClass("dark_row"),t.length===s?n.each(t,function(e,t){i.append(this._renderCell(e,t))},this):t.length>s?(n.each(t.slice(0,s-1),function(e,t){i.append(this._renderCell(e,t))},this),i.append(this._renderCell(t.slice(s-1).join("\t"),s-1))):1===t.length?i.append(this._renderCell(e,0,s)):(n.each(t,function(e,t){i.append(this._renderCell(e,t))},this),n.each(n.range(s-t.length),function(){i.append(a(""))})),this.row_count++,i},_renderChunk:function(e){var t=this.$el.find("table");n.each(e.ck_data.split("\n"),function(e,i){""!==e&&t.append(this._renderRow(e))},this)}}),_=p.extend({initialize:function(e){p.prototype.initialize.call(this,e);var t=n.find(this.$el.parents(),function(e){return"auto"===a(e).css("overflow")});t||(t=window),this.scroll_elt=a(t)},scrolled_to_bottom:function(){return this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0}}),m=p.extend({initialize:function(e){p.prototype.initialize.call(this,e),this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:e.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}}),g=e.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,file_ext:null,initialize:function(e){var t=parent.Galaxy;if(t&&t.modal&&(this.modal=t.modal),t&&t.frame&&(this.frame=t.frame),this.modal&&this.frame){var i=e.model,n=i.get("metadata");if(i.get("file_ext")){if(this.file_ext=i.get("file_ext"),"bed"==this.file_ext){if(!(n.get("chromCol")&&n.get("startCol")&&n.get("endCol")))return void console.log("TabularButtonTrackster : Bed-file metadata incomplete.");this.col.chrom=n.get("chromCol")-1,this.col.start=n.get("startCol")-1,this.col.end=n.get("endCol")-1}if("vcf"==this.file_ext){var a=function(e,t){for(var i=0;i").append(n.$el)}),s.add({id:"libraries",title:(0,o.default)("Libraries"),$el:e("
").append(a.$el)}),Galaxy.modal.show({title:(0,o.default)("Select datasets for new tracks"),body:s.$el,closing_events:!0,buttons:{Cancel:function(){Galaxy.modal.hide()},Add:function(){var t=[];s.$("input.grid-row-select-checkbox[name=id]:checked").each(function(){window.console.log(e(this).val()),t[t.length]=e.ajax({url:Galaxy.root+"api/datasets/"+e(this).val(),dataType:"json",data:{data_type:"track_config",hda_ldda:"histories"==s.current()?"hda":"ldda"}})}),e.when.apply(e,t).then(function(){var t=arguments[0]instanceof Array?e.map(arguments,function(e){return e[0]}):[arguments[0]];i(t)}),Galaxy.modal.hide()}}})},b=function(e){this.default_font=void 0!==e?e:"9px Monaco, Lucida Console, monospace",this.dummy_canvas=this.new_canvas(),this.dummy_context=this.dummy_canvas.getContext("2d"),this.dummy_context.font=this.default_font,this.char_width_px=this.dummy_context.measureText("A").width,this.patterns={},this.load_pattern("right_strand","/visualization/strand_right.png"),this.load_pattern("left_strand","/visualization/strand_left.png"),this.load_pattern("right_strand_inv","/visualization/strand_right_inv.png"),this.load_pattern("left_strand_inv","/visualization/strand_left_inv.png")};l.extend(b.prototype,{load_pattern:function(e,t){var i=this.patterns,n=this.dummy_context,a=new Image;a.src=Galaxy.root+"static/images"+t,a.onload=function(){i[e]=n.createPattern(a,"repeat")}},get_pattern:function(e){return this.patterns[e]},new_canvas:function(){var t=e("")[0];return t.manager=this,t}});var x=n.Model.extend({defaults:{num_elements:20,obj_cache:null,key_ary:null},initialize:function(e){this.clear()},get_elt:function(e){var t=this.attributes.obj_cache,i=this.attributes.key_ary,n=e.toString(),a=l.indexOf(i,function(e){return e.toString()===n});return-1!==a&&(t[n].stale?(i.splice(a,1),delete t[n]):this.move_key_to_end(e,a)),t[n]},set_elt:function(e,t){var i=this.attributes.obj_cache,n=this.attributes.key_ary,a=e.toString(),s=this.attributes.num_elements;if(!i[a]){if(n.length>=s){delete i[n.shift().toString()]}n.push(e)}return i[a]=t,t},move_key_to_end:function(e,t){this.attributes.key_ary.splice(t,1),this.attributes.key_ary.push(e)},clear:function(){this.attributes.obj_cache={},this.attributes.key_ary=[]},size:function(){return this.attributes.key_ary.length},most_recently_added:function(){return 0===this.size()?null:this.attributes.key_ary[this.attributes.key_ary.length-1]}}),k=x.extend({defaults:l.extend({},x.prototype.defaults,{dataset:null,genome:null,init_data:null,min_region_size:200,filters_manager:null,data_type:"data",data_mode_compatible:function(e,t){return!0},can_subset:function(e){return!1}}),initialize:function(e){x.prototype.initialize.call(this);var t=this.get("init_data");t&&this.add_data(t)},add_data:function(e){this.get("num_elements")u.get("start")?e.set("end",e.get("start")+this.attributes.min_region_size):e.set("start",e.get("end")-this.attributes.min_region_size),e.set("genome",this.attributes.genome),e.trim()}return this.load_data(e,t,i,n)},set_data:function(e,t){this.set_elt(e,t)},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(t,i,n,a,s){var o=this._mark_stale(t);if(!o||!this.get("data_mode_compatible")(o,i))return void console.log("ERROR: problem with getting more data: current data is not compatible");var r=t.get("start");s===this.DEEP_DATA_REQ?e.extend(a,{start_val:o.data.length+1}):s===this.BROAD_DATA_REQ&&(r=(o.max_high?o.max_high:o.data[o.data.length-1][2])+1);var l=t.copy().set("start",r),d=this,c=this.load_data(l,i,n,a),u=e.Deferred();return this.set_data(t,u),e.when(c).then(function(e){e.data&&(e.data=o.data.concat(e.data),e.max_low&&(e.max_low=o.max_low),e.message&&(e.message=e.message.replace(/[0-9]+/,e.data.length))),d.set_data(t,e),u.resolve(e)}),u},can_get_more_detailed_data:function(e){var t=this.get_elt(e);return"bigwig"===t.dataset_type&&t.data.length<8e3},get_more_detailed_data:function(e,t,i,n,a){var s=this._mark_stale(e);return s?(a||(a={}),"bigwig"===s.dataset_type&&(a.num_samples=1e3*n),this.load_data(e,t,i,a)):void console.log("ERROR getting more detailed data: no current data")},_mark_stale:function(e){var t=this.get_elt(e);return t||console.log("ERROR: no data to mark as stale: ",this.get("dataset"),e.toString()),t.stale=!0,t},get_genome_wide_data:function(t){var i=this,n=!0,a=l.map(t.get("chroms_info").chrom_info,function(e){var t=i.get_elt(new T({chrom:e.chrom,start:0,end:e.len}));return t||(n=!1),t});if(n)return a;var s=e.Deferred();return e.getJSON(this.get("dataset").url(),{data_type:"genome_data"},function(e){i.add_data(e.data),s.resolve(e.data)}),s},subset_entry:function(e,t){var i={bigwig:function(e,t){return l.filter(e,function(e){return e[0]>=t.get("start")&&e[0]<=t.get("end")})},refseq:function(t,i){var n=i.get("start")-e.region.get("start");return e.data.slice(n,n+i.length())}},n=e.data;return!e.region.same(t)&&e.dataset_type in i&&(n=i[e.dataset_type](e.data,t)),{region:t,data:n,dataset_type:e.dataset_type}}}),C=k.extend({initialize:function(e){var t=new n.Model;t.urlRoot=e.data_url,this.set("dataset",t)},load_data:function(e,t,i,n){return e.length()<=1e5?k.prototype.load_data.call(this,e,t,i,n):{data:null,region:e}}}),S=n.Model.extend({defaults:{name:null,key:null,chroms_info:null},initialize:function(e){this.id=e.dbkey},get_chroms_info:function(){return this.attributes.chroms_info.chrom_info},get_chrom_region:function(e){var t=l.find(this.get_chroms_info(),function(t){return t.chrom===e});return new T({chrom:t.chrom,end:t.len})},get_chrom_len:function(e){return l.find(this.get_chroms_info(),function(t){return t.chrom===e}).len}}),T=n.Model.extend({defaults:{chrom:null,start:0,end:0,str_val:null,genome:null},same:function(e){return this.attributes.chrom===e.get("chrom")&&this.attributes.start===e.get("start")&&this.attributes.end===e.get("end")},initialize:function(e){if(e.from_str){var t=e.from_str.split(":"),i=t[0],n=t[1].split("-");this.set({chrom:i,start:parseInt(n[0],10),end:parseInt(n[1],10)})}this.attributes.str_val=this.get("chrom")+":"+this.get("start")+"-"+this.get("end"),this.on("change",function(){this.attributes.str_val=this.get("chrom")+":"+this.get("start")+"-"+this.get("end")},this)},copy:function(){return new T({chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")})},length:function(){return this.get("end")-this.get("start")},toString:function(){return this.attributes.str_val},toJSON:function(){return{chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")}},compute_overlap:function(e){var t=this.get("chrom"),i=e.get("chrom"),n=this.get("start"),a=e.get("start"),s=this.get("end"),o=e.get("end");return t&&i&&t!==i?T.overlap_results.DIF_CHROMS:na?n>o?T.overlap_results.AFTER:s<=o?T.overlap_results.CONTAINED_BY:T.overlap_results.OVERLAP_END:s>=o?T.overlap_results.CONTAINS:T.overlap_results.CONTAINED_BY},trim:function(e){if(this.attributes.start<0&&(this.attributes.start=0),this.attributes.genome){var t=this.attributes.genome.get_chrom_len(this.attributes.chrom);this.attributes.end>t&&(this.attributes.end=t-1)}return this},contains:function(e){return this.compute_overlap(e)===T.overlap_results.CONTAINS},overlaps:function(e){return 0===l.intersection([this.compute_overlap(e)],[T.overlap_results.DIF_CHROMS,T.overlap_results.BEFORE,T.overlap_results.AFTER]).length}},{overlap_results:{DIF_CHROMS:1e3,BEFORE:1001,CONTAINS:1002,OVERLAP_START:1003,OVERLAP_END:1004,CONTAINED_BY:1005,AFTER:1006}}),M=n.Collection.extend({model:T}),$=n.Model.extend({defaults:{region:null,note:""},initialize:function(e){this.set("region",new T(e.region))}}),P=n.Collection.extend({model:$}),O=n.Model.extend(w).extend({defaults:{mode:"Auto"},initialize:function(e){this.set("dataset",new c.default.Dataset(e.dataset));var t=[{key:"name",default_value:this.get("dataset").get("name")},{key:"color"},{key:"min_value",label:"Min Value",type:"float",default_value:0},{key:"max_value",label:"Max Value",type:"float",default_value:1}];this.set("config",p.default.ConfigSettingCollection.from_models_and_saved_values(t,e.prefs));var i=this.get("preloaded_data");i=i?i.data:[],this.set("data_manager",new k({dataset:this.get("dataset"),init_data:i}))}},{to_json_keys:["track_type","dataset","prefs","mode","filters","tool_state"],to_json_mappers:{prefs:function(e,t){return 0===l.size(e)&&(e={name:t.get("config").get("name").get("value"),color:t.get("config").get("color").get("value")}),e},dataset:function(e){return{id:e.id,hda_ldda:e.get("hda_ldda")}}}}),E=n.Collection.extend({model:O}),A=n.Model.extend({defaults:{title:"",type:""},urlRoot:Galaxy.root+"api/visualizations",save:function(){return e.ajax({url:this.url(),type:"POST",dataType:"json",data:{vis_json:JSON.stringify(this)}})}}),D=A.extend(w).extend({defaults:l.extend({},A.prototype.defaults,{dbkey:"",drawables:null,bookmarks:null,viewport:null}),initialize:function(e){this.set("drawables",new E(e.tracks));var t=[];this.set("config",p.default.ConfigSettingCollection.from_models_and_saved_values(t,e.prefs)),this.unset("tracks"),this.get("drawables").each(function(e){e.unset("preloaded_data")})},add_tracks:function(e){this.get("drawables").add(e)}},{to_json_keys:["view","viewport","bookmarks"],to_json_mappers:{view:function(e,t){return{obj_type:"View",prefs:{name:t.get("title"),content_visible:!0},drawables:t.get("drawables")}}}}),z=n.Router.extend({initialize:function(e){var t=this;this.view=e.view,this.route(/([\w]+)$/,"change_location"),this.route(/([\w+]+:[\d,]+-[\d,]+)$/,"change_location"),this.view.on("navigate",function(e){t.navigate(e)})},change_location:function(e){this.view.go_to(e)}});t.default={BackboneTrack:O,BrowserBookmark:$,BrowserBookmarkCollection:P,Cache:x,CanvasManager:b,Genome:S,GenomeDataManager:k,GenomeRegion:T,GenomeRegionCollection:M,GenomeVisualization:D,GenomeReferenceDataManager:C,TrackBrowserRouter:z,Visualization:A,select_datasets:y}}).call(t,i(0),i(2))},,,function(e,t,i){"use strict";(function(e,i){function n(e){e+="";for(var t=/(\d+)(\d{3})/;t.test(e);)e=e.replace(t,"$1,$2");return e}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){return"promise"in e},s=e.Model.extend({defaults:{ajax_settings:{},interval:1e3,success_fn:function(e){return!0}},go:function(){var e=i.Deferred(),t=this,n=t.get("ajax_settings"),a=t.get("success_fn"),s=t.get("interval");return function t(){i.ajax(n).success(function(i){a(i)?e.resolve(i):setTimeout(t,s)})}(),e}}),o=function(e){e||(e="#ffffff"),"string"==typeof e&&(e=[e]);for(var t=0;t>16,a=(65280&i)>>8,s=255&i,c=f(n,a,s),p=!0,t=0;t>16,l=(65280&o)>>8,d=255&o,u=f(r,l,d),h=function(e,t,i,n,a,s){return Math.max(e,n)-Math.min(e,n)+(Math.max(t,a)-Math.min(t,a))+(Math.max(i,s)-Math.min(i,s))}(n,a,s,r,l,d),Math.abs(c-u)<40||h<200){p=!1;break}_++}while(!p&&_<=10);return"#"+(16777216+i).toString(16).substr(1,6)};t.default={commatize:n,is_deferred:a,ServerStateDeferred:s,get_random_color:o}}).call(t,i(2),i(0))},function(e,t,i){"use strict";var n=i(0),a=function(e){return e&&e.__esModule?e:{default:e}}(n),s=a.default;s.fn.make_text_editable=function(e){var t="num_cols"in e?e.num_cols:30,i="num_rows"in e?e.num_rows:4,n="use_textarea"in e&&e.use_textarea,a="on_finish"in e?e.on_finish:null,o="help_text"in e?e.help_text:null,r=s(this);return r.addClass("editable-text").click(function(o){if(!(s(this).children(":input").length>0)){r.removeClass("editable-text");var l,d,c=function(e){r.find(":input").remove(),""!==e?r.text(e):r.html("
"),r.addClass("editable-text"),a&&a(e)},u="cur_text"in e?e.cur_text:r.text();n?(l=s("\n \n
\n
\n \x3c!--\n \n --\x3e\n
\n
\n '}})}).call(t,i(2),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(10),s=n(a),o=i(655),r=n(o),l=i(656),d=n(l),c=i(3),u=n(c),h=e.View.extend({initialize:function(t,i){var n=this;this.userIsAnonymous=Galaxy.user.isAnonymous(),this.allow_user_dataset_purge=i.config.allow_user_dataset_purge,this.root=i.root,this.historyView=new d.default.CurrentHistoryView({className:d.default.CurrentHistoryView.prototype.className+" middle",purgeAllowed:this.allow_user_dataset_purge,linkTarget:"galaxy_main"}),Galaxy.currHistoryPanel=this.historyView,Galaxy.currHistoryPanel.listenToGalaxy(Galaxy),this.buttonRefresh=new s.default.ButtonLink({id:"history-refresh-button",title:(0,u.default)("Refresh history"),cls:"panel-header-button",icon:"fa fa-refresh",onclick:function(){n.historyView.loadCurrentHistory()}}),this.buttonOptions=new s.default.ButtonLink({id:"history-options-button",title:(0,u.default)("History options"),cls:"panel-header-button",target:"galaxy_main",icon:"fa fa-cog",href:this.root+"root/history_options"}),this.buttonViewMulti=new s.default.ButtonLink({id:"history-view-multi-button",title:(0,u.default)("View all histories"),cls:"panel-header-button",icon:"fa fa-columns",href:this.root+"history/view_multiple"}),this.model=new e.Model({cls:"history-right-panel",title:(0,u.default)("History"),buttons:[this.buttonRefresh,this.buttonOptions,this.buttonViewMulti]}),this.setElement(this._template()),this.historyView.setElement(this.$el),this.historyView.connectToQuotaMeter(Galaxy.quotaMeter),this.historyView.loadCurrentHistory(),Galaxy.listenTo(this.historyView,"history-size-change",function(){Galaxy.user.fetch({url:Galaxy.user.urlRoot()+"/"+(Galaxy.user.id||"current")})})},render:function(){this.optionsMenu=(0,r.default)(this.buttonOptions.$el,{anonymous:this.userIsAnonymous,purgeAllowed:this.allow_user_dataset_purge,root:this.root}),this.buttonViewMulti.$el[this.userIsAnonymous?"hide":"show"]()},_template:function(e){return['
'].join("")},toString:function(){return"historyPanel"}});t.default=h}).call(t,i(2))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t,i){return o.clone(_).filter(function(n){return!(e&&!n.anon)&&(!(!t&&n.purge)&&(n.href&&(n.href=i+n.href,n.target=n.target||"galaxy_main"),n.confirm&&(n.func=function(){confirm(n.confirm)&&(galaxy_main.location=n.href)}),!0))})}Object.defineProperty(t,"__esModule",{value:!0});var s=i(1),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(s),r=i(3),l=n(r),d=i(41),c=n(d),u=i(143),h=n(u),f=i(25),p=n(f),_=[{html:(0,l.default)("History Lists"),header:!0},{html:(0,l.default)("Saved Histories"),href:"histories/list",target:"_top"},{html:(0,l.default)("Histories Shared with Me"),href:"histories/list_shared",target:"_top"},{html:(0,l.default)("Current History"),header:!0,anon:!0},{html:(0,l.default)("Create New"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.createNewHistory()}},{html:(0,l.default)("Copy History"),func:function(){(0,h.default)(Galaxy.currHistoryPanel.model).done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Share or Publish"),href:"history/sharing"},{html:(0,l.default)("Show Structure"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/show_structure")}},{html:(0,l.default)("Extract Workflow"),href:"workflow/build_from_current_history"},{html:(0,l.default)("Delete"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,l.default)("Really delete the current history?"))&&Galaxy.currHistoryPanel.model._delete().done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Delete Permanently"),purge:!0,anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,l.default)("Really delete the current history permanently? This cannot be undone."))&&Galaxy.currHistoryPanel.model.purge().done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Dataset Actions"),header:!0,anon:!0},{html:(0,l.default)("Copy Datasets"),href:"dataset/copy_datasets"},{html:(0,l.default)("Dataset Security"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/permissions?id="+Galaxy.currHistoryPanel.model.id)}},{html:(0,l.default)("Resume Paused Jobs"),href:"history/resume_paused_jobs?current=True",anon:!0},{html:(0,l.default)("Collapse Expanded Datasets"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.collapseAll()}},{html:(0,l.default)("Unhide Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,l.default)("Really unhide all hidden datasets?"))&&e.post(Galaxy.root+"history/adjust_hidden",{user_action:"unhide"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Delete Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,l.default)("Really delete all hidden datasets?"))&&e.post(Galaxy.root+"history/adjust_hidden",{user_action:"delete"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,l.default)("Purge Deleted Datasets"),confirm:(0,l.default)("Really delete all deleted datasets permanently? This cannot be undone."),href:"history/purge_deleted_datasets",purge:!0,anon:!0},{html:(0,l.default)("Downloads"),header:!0},{html:(0,l.default)("Export Tool Citations"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/citations?id="+Galaxy.currHistoryPanel.model.id)}},{html:(0,l.default)("Export History to File"),href:"history/export_archive?preview=True",anon:!0},{html:(0,l.default)("Other Actions"),header:!0},{html:(0,l.default)("Import from File"),href:"histories/import",target:"_top"}];p.default.load({type:"history-menu",async:!1,callback:function(t){var i=[];t.each(function(e){var t=e.toJSON();t.activate&&i.push({html:(0,l.default)(t.config.title),anon:!0})}),i.length>0&&(i.unshift({html:(0,l.default)("Webhooks"),header:!0}),e.merge(_,i))}});var m=function(e,t){t=t||{};var i=void 0===t.anonymous||t.anonymous,n=t.purgeAllowed||!1,s=a(i,n,Galaxy.root);return new c.default(e,s)};t.default=m}).call(t,i(0))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(144),r=(s(o),i(176)),l=s(r),d=i(6),c=s(d),u=i(3),h=s(u),f=c.default.SessionStorageModel.extend({defaults:{tagsEditorShown:!1,annotationEditorShown:!1,scrollPosition:0},toString:function(){return"HistoryViewPrefs("+JSON.stringify(this.toJSON())+")"}});f.storageKey=function(){return"history-panel"};var p=l.default.HistoryViewEdit,_=p.extend({className:p.prototype.className+" current-history-panel",HDCAViewClass:p.prototype.HDCAViewClass.extend({foldoutStyle:"drilldown"}),emptyMsg:[(0,h.default)("This history is empty"),". ",(0,h.default)("You can "),'',(0,h.default)("load your own data"),"",(0,h.default)(" or "),'',(0,h.default)("get data from an external source"),""].join(""),initialize:function(t){t=t||{},this.preferences=new f(e.extend({id:f.storageKey()},e.pick(t,e.keys(f.prototype.defaults)))),p.prototype.initialize.call(this,t),this.panelStack=[],this.currentContentId=t.currentContentId||null},_setUpListeners:function(){p.prototype._setUpListeners.call(this);var e=this;this.on("new-model",function(){e.preferences.set("scrollPosition",0)})},loadCurrentHistory:function(){return this.loadHistory(null,{url:Galaxy.root+"history/current_history_json"})},switchToHistory:function(e,t){return Galaxy.user.isAnonymous()?(this.trigger("error",(0,h.default)("You must be logged in to switch histories"),(0,h.default)("Anonymous user")),n.when()):this.loadHistory(e,{url:Galaxy.root+"history/set_as_current?id="+e})},createNewHistory:function(e){return Galaxy.user.isAnonymous()?(this.trigger("error",(0,h.default)("You must be logged in to create histories"),(0,h.default)("Anonymous user")),n.when()):this.loadHistory(null,{url:Galaxy.root+"history/create_new_current"})},setModel:function(e,t,i){return p.prototype.setModel.call(this,e,t,i),this.model&&this.model.id&&(this.log("checking for updates"),this.model.checkForUpdates()),this},_setUpModelListeners:function(){return p.prototype._setUpModelListeners.call(this),this.listenTo(this.model,{"change:nice_size change:size":function(){this.trigger("history-size-change",this,this.model,arguments)},"change:id":function(){this.once("loading-done",function(){this.model.checkForUpdates()})}})},_setUpCollectionListeners:function(){p.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,"state:ready",function(e,t,i){e.get("visible")||this.collection.storage.includeHidden()||this.removeItemView(e)})},_setUpBehaviors:function(t){t=t||this.$el;var i=this;return p.prototype._setUpBehaviors.call(i,t),this._debouncedScrollCaptureHandler||(this._debouncedScrollCaptureHandler=e.debounce(function(){i.$el.is(":visible")&&i.preferences.set("scrollPosition",n(this).scrollTop())},40)),i.$scrollContainer(t).off("scroll",this._debouncedScrollCaptureHandler).on("scroll",this._debouncedScrollCaptureHandler),i},_buildNewRender:function(){if(!this.model)return n();var e=p.prototype._buildNewRender.call(this);return e.find(".search").prependTo(e.find("> .controls")),this._renderQuotaMessage(e),e},_renderQuotaMessage:function(e){return e=e||this.$el,n(this.templates.quotaMsg({},this)).prependTo(e.find(".messages"))},_renderTags:function(e){var t=this;p.prototype._renderTags.call(t,e),t.preferences.get("tagsEditorShown")&&t.tagsEditor.toggle(!0),t.listenTo(t.tagsEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("tagsEditorShown",e.hidden)})},_renderAnnotation:function(e){var t=this;p.prototype._renderAnnotation.call(t,e),t.preferences.get("annotationEditorShown")&&t.annotationEditor.toggle(!0),t.listenTo(t.annotationEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("annotationEditorShown",e.hidden)})},_swapNewRender:function(t){p.prototype._swapNewRender.call(this,t);var i=this;return e.delay(function(){var e=i.preferences.get("scrollPosition");e&&i.scrollTo(e,0)},10),this},_attachItems:function(e){p.prototype._attachItems.call(this,e);var t=this;return t.currentContentId&&t._setCurrentContentById(t.currentContentId),this},addItemView:function(e,t,i){var n=p.prototype.addItemView.call(this,e,t,i);return n&&this.panelStack.length?this._collapseDrilldownPanel():n},_setUpItemViewListeners:function(e){var t=this;return p.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{"expanded:drilldown":function(e,t){this._expandDrilldownPanel(t)},"collapsed:drilldown":function(e,t){this._collapseDrilldownPanel(t)}})},setCurrentContent:function(e){this.$(".history-content.current-content").removeClass("current-content"),e?(e.$el.addClass("current-content"),this.currentContentId=e.model.id):this.currentContentId=null},_setCurrentContentById:function(e){var t=this.viewFromModelId(e)||null;this.setCurrentContent(t)},_expandDrilldownPanel:function(e){this.panelStack.push(e),this.$controls().add(this.$list()).hide(),e.parentName=this.model.get("name"),e.delegateEvents().render().$el.appendTo(this.$el)},_collapseDrilldownPanel:function(e){this.panelStack.pop(),this.$controls().add(this.$list()).show()},events:e.extend(e.clone(p.prototype.events),{"click .uploader-link":function(e){Galaxy.upload.show(e)},"click .get-data-link":function(e){var t=n(".toolMenuContainer");t.parent().scrollTop(0),t.find('span:contains("Get Data")').click()}}),listenToGalaxy:function(t){this.listenTo(t,{"center-frame:load":function(t){var i=t.fullpath,n=null,a={display:/datasets\/([a-f0-9]+)\/display/,edit:/datasets\/([a-f0-9]+)\/edit/,report_error:/dataset\/errors\?id=([a-f0-9]+)/,rerun:/tool_runner\/rerun\?id=([a-f0-9]+)/,show_params:/datasets\/([a-f0-9]+)\/show_params/};e.find(a,function(t,a){return n=e.result(i.match(t),1)}),this._setCurrentContentById(n?"dataset-"+n:null)},"center-panel:load":function(e){this._setCurrentContentById()}})},connectToQuotaMeter:function(e){return e?(this.listenTo(e,"quota:over",this.showQuotaMessage),this.listenTo(e,"quota:under",this.hideQuotaMessage),this.on("rendered rendered:initial",function(){e&&e.isOverQuota()&&this.showQuotaMessage()}),this):this},clearMessages:function(t){var i=e.isUndefined(t)?this.$messages().children('[class$="message"]'):n(t.currentTarget);return i=i.not(".quota-message"),i.fadeOut(this.fxSpeed,function(){n(this).remove()}),this},showQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")&&e.slideDown(this.fxSpeed)},hideQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")||e.slideUp(this.fxSpeed)},unhideHidden:function(){var e=this;return confirm((0,h.default)("Really unhide all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{visible:!0}).done(function(){e.model.contents.includeHidden||e.renderItems()}):a.when()},deleteHidden:function(){var e=this;return confirm((0,h.default)("Really delete all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{deleted:!0,visible:!0}):a.when()},toString:function(){return"CurrentHistoryView("+(this.model?this.model.get("name"):"")+")"}});_.prototype.templates=function(){var t=c.default.wrapTemplate(['
',(0,h.default)("You are over your disk quota"),". ",(0,h.default)("Tool execution is on hold until your disk usage drops below your allocated quota"),".","
"],"history");return e.extend(e.clone(p.prototype.templates),{quotaMsg:t})}(),t.default={CurrentHistoryView:_}}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(26),d=(s(l),i(10)),c=s(d),u=i(32),h=s(u),f=e.Model.extend({initialize:function(e){e=e||{},e.user_id=e.user_id||Galaxy.user.id,this.set({user_id:e.user_id,information:{title:(0,r.default)("Manage information"),description:"Edit your email, addresses and custom parameters or change your username.",url:"api/users/"+e.user_id+"/information/inputs",icon:"fa-user",redirect:"user"},password:{title:(0,r.default)("Change password"),description:(0,r.default)("Allows you to change your login credentials."),icon:"fa-unlock-alt",url:"api/users/"+e.user_id+"/password/inputs",submit_title:"Save password",redirect:"user"},communication:{title:(0,r.default)("Change communication settings"),description:(0,r.default)("Enable or disable the communication feature to chat with other users."),url:"api/users/"+e.user_id+"/communication/inputs",icon:"fa-comments-o",redirect:"user"},permissions:{title:(0,r.default)("Set dataset permissions for new histories"),description:"Grant others default access to newly created histories. Changes made here will only affect histories created after these settings have been stored.",url:"api/users/"+e.user_id+"/permissions/inputs",icon:"fa-users",submit_title:"Save permissions",redirect:"user"},api_key:{title:(0,r.default)("Manage API key"),description:(0,r.default)("Access your current API key or create a new one."),url:"api/users/"+e.user_id+"/api_key/inputs",icon:"fa-key",submit_title:"Create a new key",submit_icon:"fa-check"},toolbox_filters:{title:(0,r.default)("Manage Toolbox filters"),description:(0,r.default)("Customize your Toolbox by displaying or omitting sets of Tools."),url:"api/users/"+e.user_id+"/toolbox_filters/inputs",icon:"fa-filter",submit_title:"Save filters",redirect:"user"},openids:{title:(0,r.default)("Manage OpenIDs"),description:(0,r.default)("Associate OpenIDs with your account."),icon:"fa-openid",onclick:function(){window.location.href=Galaxy.root+"openids/list"}},custom_builds:{title:(0,r.default)("Manage custom builds"),description:(0,r.default)("Add or remove custom builds using history datasets."),icon:"fa-cubes",onclick:function(){window.location.href=Galaxy.root+"custom_builds"}},logout:{title:(0,r.default)("Sign out"),description:(0,r.default)("Click here to sign out of all sessions."),icon:"fa-sign-out",onclick:function(){Galaxy.modal.show({title:(0,r.default)("Sign out"),body:"Do you want to continue and sign out of all active sessions?",buttons:{Cancel:function(){Galaxy.modal.hide()},"Sign out":function(){window.location.href=Galaxy.root+"user/logout?session_csrf_token="+Galaxy.session_csrf_token}}})}}})}}),p=e.View.extend({title:(0,r.default)("User Preferences"),active_tab:"user",initialize:function(){this.model=new f,this.setElement("
"),this.render()},render:function(){var e=this,t=Galaxy.config;n.getJSON(Galaxy.root+"api/users/"+Galaxy.user.id,function(i){e.$preferences=n("
").addClass("ui-panel").append(n("

").append("User preferences")).append(n("

").append("You are logged in as "+a.escape(i.email)+".")).append(e.$table=n("").addClass("ui-panel-table"));var s=h.default.get("message"),o=h.default.get("status");s&&o&&e.$preferences.prepend(new c.default.Message({message:s,status:o}).$el),t.use_remote_user||(e._addLink("information"),e._addLink("password")),t.enable_communication_server&&e._addLink("communication"),e._addLink("custom_builds"),e._addLink("permissions"),e._addLink("api_key"),t.has_user_tool_filters&&e._addLink("toolbox_filters"),t.enable_openid&&!t.use_remote_user&&e._addLink("openids"),Galaxy.session_csrf_token&&e._addLink("logout"),e.$preferences.append(e._templateFooter(i)),e.$el.empty().append(e.$preferences)})},_addLink:function(e){var t=this.model.get(e),i=n(this._templateLink(t)),a=i.find("a");t.onclick?a.on("click",function(){t.onclick()}):a.attr("href",Galaxy.root+"user/"+e),this.$table.append(i)},_templateLink:function(e){return'"},_templateFooter:function(e){return''}});t.default={View:p,Model:f}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),o=a(s),r=i(5),l=(a(r),i(10)),d=a(l),c=i(26),u=a(c),h=i(659),f=a(h),p=e.Collection.extend({comparator:function(e,t){return e=e.get("name"),t=t.get("name"),e>t?1:e").append(n("

").text("Current Custom Builds")).append(this.table.$el).append(this.$installed=n("
").append(n("

").text("System Installed Builds").addClass("ui-margin-top")).append(this.installed_builds.$el)).append(n("

").text("Add a Custom Build").addClass("ui-margin-top")).append(n("").addClass("ui-column").append(n("
").addClass("ui-column-left").append(this.message.$el).append(this.$form=n("
").addClass("ui-margin-top"))).append(this.$help=n("
").addClass("ui-column-right")))),this.listenTo(this.collection,"add remove reset",function(){i._renderTable()}),this.listenTo(this.model,"change",function(){i._renderForm()}),this.collection.fetch(),this.model.fetch()},render:function(){this._renderTable(),this._renderForm()},_renderTable:function(){var e=this;this.table.delAll(),this.collection.sort(),this.collection.each(function(t){e.table.add(t.get("name")),e.table.add(t.id),e.table.add(void 0!==t.get("count")?t.get("count"):"Processing..."),e.table.add(new d.default.ButtonIcon({icon:"fa-trash-o",cls:"ui-button-icon-plain",tooltip:(0,o.default)("Delete custom build."),onclick:function(){t.destroy()}}).$el),e.table.append(t.id)})},_renderForm:function(){var e=this,t=new u.default({inputs:[{type:"text",name:"name",label:"Name",help:"Specify a build name e.g. Hamster."},{type:"text",name:"id",label:"Key",help:"Specify a build key e.g. hamster_v1."},{name:"len",type:"conditional",test_param:{name:"type",label:"Definition",help:(0,o.default)("Provide the data source."),type:"select",value:"fasta",data:[{value:"fasta",label:"FASTA-file from history"},{value:"file",label:"Len-file from disk"},{value:"text",label:"Len-file by copy/paste"}]},cases:[{value:"fasta",inputs:[{type:"select",name:"value",label:"FASTA-file",data:this.model.get("fasta_hdas")}]},{value:"file",inputs:[{type:"upload",name:"value",label:"Len-file",data:this.model.get("len_hdas")}]},{value:"text",inputs:[{type:"text",area:!0,name:"value",label:"Edit/Paste"}]}]}],buttons:{save:new d.default.Button({icon:"fa-save",tooltip:(0,o.default)("Create new Build"),title:(0,o.default)("Save"),cls:"btn btn-primary ui-clear-float",onclick:function(){var i=t.data.create();i.id&&i.name?e.collection.create(i,{wait:!0,success:function(t){t.get("message")?e.message.update({message:t.get("message"),status:"warning"}):e.message.update({message:"Successfully added a new custom build.",status:"success"})},error:function(t,i){var n=i&&i.responseJSON&&i.responseJSON.err_msg;e.message.update({message:n||"Failed to create custom build.",status:"danger"})}}):e.message.update({message:"All inputs are required.",status:"danger"})}})},onchange:function(){var i=t.data.match("len|type");if(i){var n=t.field_list[i];e._renderHelp(n.value())}}});this.$form.empty().append(t.$el);var i=this.model.get("installed_builds");i&&i.length?(this.$installed.show(),this.installed_builds.update(this.model.get("installed_builds"))):this.$installed.hide(),this._renderHelp("fasta")},_renderHelp:function(e){this.$help.empty().addClass("alert alert-info").html("fasta"==e?this._templateFasta():this._templateLen())},_templateLen:function(){return"

Length Format

The length format is two-column, separated by whitespace, of the form:

chrom/contig   length of chrom/contig

For example, the first few entries of mm9.len are as follows:

chr1    197195432\nchr2    181748087\nchr3    159599783\nchr4    155630120\nchr5    152537259

Trackster uses this information to populate the select box for chrom/contig, andto set the maximum basepair of the track browser. You may either upload a .len fileof this format (Len File option), or directly enter the information into the box (Len Entry option).

"},_templateFasta:function(){return"

FASTA format

This is a multi-fasta file from your current history that provides the genomesequences for each chromosome/contig in your build.

Here is a snippet from an example multi-fasta file:

>chr1\nATTATATATAAGACCACAGAGAGAATATTTTGCCCGG...\n\n>chr2\nGGCGGCCGCGGCGATATAGAACTACTCATTATATATA...\n\n...

"}});t.default={View:_}}).call(t,i(2),i(0))},function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0});var a=i(5),s=function(e){return e&&e.__esModule?e:{default:e}}(a),o=e.View.extend({initialize:function(e){this.options=s.default.merge(e,{content:"No content available.",onchange:null,ondblclick:null,onconfirm:null,cls:"ui-table",selectable:!0,cls_tr:""}),this.setElement(this._template()),this.$thead=this.$("thead"),this.$tbody=this.$("tbody"),this.$tmessage=this.$("tmessage"),this.row=this._row(),this.row_count=0},events:{click:"_onclick",dblclick:"_ondblclick"},addHeader:function(e){this.row.append(n("

")},add:function(e,t,i){var a=n("')},_onclick:function(e){var t=this.value(),i=n(e.target).closest("tr").attr("id");""!=i&&i&&t!=i&&(this.options.onconfirm?this.options.onconfirm(i):this.value(i))},_ondblclick:function(e){var t=this.value();t&&this.options.ondblclick&&this.options.ondblclick(t)},_refresh:function(){0==this.row_count?this.$tmessage.show():this.$tmessage.hide()},_template:function(){return'
'+e.title+'
'+e.description+"
").append(e))},appendHeader:function(){this.$thead.append(this.row),this.row=n("
");t&&a.css("width",t),i&&a.css("text-align",i),this.row.append(a.append(e))},append:function(e,t){this._commit(e,t,!1)},prepend:function(e,t){this._commit(e,t,!0)},get:function(e){return this.$("#"+e)},del:function(e){var t=this.$tbody.find("#"+e);t.length>0&&(t.remove(),this.row_count--,this._refresh())},delAll:function(){this.$tbody.empty(),this.row_count=0,this._refresh()},value:function(e){if(this.options.selectable){this.before=this.$tbody.find(".current").attr("id"),void 0!==e&&(this.$tbody.find("tr").removeClass("current"),e&&this.$tbody.find("#"+e).addClass("current"));var t=this.$tbody.find(".current").attr("id");return void 0===t?null:(t!=this.before&&this.options.onchange&&this.options.onchange(e),t)}},size:function(){return this.$tbody.find("tr").length},_commit:function(e,t,i){this.del(e),this.row.attr("id",e),i?this.$tbody.prepend(this.row):this.$tbody.append(this.row),t&&(this.row.hide(),this.row.fadeIn()),this.row=this._row(),this.row_count++,this._refresh()},_row:function(){return n('
'+this.options.content+"

"}});t.default={View:o}}).call(t,i(2),i(0))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(24),r=s(o),l=i(34),d=s(l),c=e.View.extend({initialize:function(t){var i=this;d.default.markViewAsLoading(this),this.model=new e.Model(t),this.item=this.model.get("item"),this.title=this.model.get("plural"),t&&t.active_tab&&(this.active_tab=t.active_tab),n.ajax({url:Galaxy.root+this.item+"/"+this.model.get("action_id")+"?"+n.param(Galaxy.params),success:function(e){i.model.set(e),i.render()}})},render:function(){var e=new r.default(this.model.attributes);this.$el.empty().append(e.$el),this.$el.append(this._templateShared())},_templateShared:function(){var e=this,t=n("

"+this.model.get("plural")+" shared with you by others

"),i=this.model.attributes;if(i.shared_by_others&&i.shared_by_others.length>0){var s=n('
TitleOwner
');a.each(i.shared_by_others,function(t,i){var n=Galaxy.root+e.item+"/display_by_username_and_slug?username="+t.username+"&slug="+t.slug;s.append('

'+a.escape(t.title)+""+a.escape(t.username)+"
\n
\n \n '+c.escape(this.model.get("name"))+'\n \n \n '+this._templateActions()+'\n
\n
\n
\n
\n
\n '+(this.model.get("owner")===Galaxy.user.attributes.username?"You":this.model.get("owner"))+"\n "+this.model.get("number_of_steps")+""+(this.model.get("published")?"Yes":"No")+""+i+"

Drop workflow files here to import

NameTagsOwner# of StepsPublishedShow in tools panel

'},_templateHeader:function(){return'

'+(0,v.default)("Your workflows")+"

"}});t.default={View:x}}).call(t,i(0))},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=i(6),a=function(e){return e&&e.__esModule?e:{default:e}}(n),s=e.Model.extend(a.default.LoggableMixin).extend({_logNamespace:"workflow",urlRoot:Galaxy.root+"api/workflows",toJSON:function(){return{workflow:this.attributes}}}),o=e.Collection.extend({model:s,url:Galaxy.root+"api/workflows"});t.default={WorkflowItem:s,WorkflowCollection:o}}).call(t,i(2))},function(e,t,i){"use strict";function n(e){i(664)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(398),s=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);var r=i(666),l=i(23),d=n,c=Object(l.a)(s.a,r.a,r.b,!1,d,null,null);t.default=c.exports},function(e,t,i){var n=i(665);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("8aa17c54",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,".ui-message{display:block}",""])},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-portlet-limited"},[e._m(0),e._v(" "),i("div",{staticClass:"portlet-content"},[e.errormessage?i("div",{staticClass:"ui-message alert alert-danger"},[e._v("\n "+e._s(e.errormessage)+"\n ")]):e._e(),e._v(" "),i("div",{staticClass:"portlet-body"},[i("form",{ref:"form"},[e._m(1),e._v(" "),e._m(2)])]),e._v(" "),i("div",{staticClass:"portlet-buttons"},[i("input",{staticClass:"btn btn-primary",attrs:{type:"button",value:"Import Workflow"},on:{click:e.submit}})]),e._v(" "),i("hr"),e._v(" "),i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Import a Workflow from myExperiment")]),e._v(" "),i("a",{attrs:{href:e.myexperiment_target_url}},[e._v("Visit myExperiment")]),e._v(" "),i("div",{staticClass:"ui-form-info"},[e._v("Click the link above to visit myExperiment and search for Galaxy workflows.")])])])])},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"portlet-header"},[i("div",{staticClass:"portlet-title"},[i("i",{staticClass:"portlet-title-icon fa fa-upload"}),e._v(" "),i("span",{staticClass:"portlet-title-text"},[i("b",[e._v("Import Workflow")])])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived Workflow URL")]),e._v(" "),i("input",{staticClass:"ui-input",attrs:{type:"text",name:"archive_source"}}),e._v(" "),i("div",{staticClass:"ui-form-info"},[e._v("If the workflow is accessible via a URL, enter the URL above and click Import.")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived Workflow file")]),e._v(" "),i("input",{attrs:{type:"file",name:"archive_file"}}),e._v(" "),i("div",{staticClass:"ui-form-info"},[e._v("If the workflow is in a file on your computer, choose it and then click Import.")])])}]},function(e,t,i){"use strict";function n(e){i(668)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(399),s=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);var r=i(670),l=i(23),d=n,c=Object(l.a)(s.a,r.a,r.b,!1,d,null,null);t.default=c.exports},function(e,t,i){var n=i(669);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("7f0534ae",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,".ui-show{display:block}",""])},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-portlet-limited"},[e._m(0),e._v(" "),i("div",{staticClass:"portlet-content"},[e.errormessage?i("div",{staticClass:"ui-message ui-show alert alert-danger"},[e._v("\n "+e._s(e.errormessage)+"\n ")]):e._e(),e._v(" "),i("div",{staticClass:"portlet-body"},[i("form",{ref:"form"},[e._m(1),e._v(" "),e._m(2)])]),e._v(" "),i("div",{staticClass:"portlet-buttons"},[i("input",{staticClass:"btn btn-primary",attrs:{type:"button",value:"Import History"},on:{click:e.submit}})])])])},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"portlet-header"},[i("div",{staticClass:"portlet-title"},[i("i",{staticClass:"portlet-title-icon fa fa-upload"}),e._v(" "),i("span",{staticClass:"portlet-title-text"},[i("b",[e._v("Import a History from an Archive")])])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived History URL")]),e._v(" "),i("input",{staticClass:"ui-input",attrs:{type:"text",name:"archive_source"}})])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived History file")]),e._v(" "),i("input",{attrs:{type:"file",name:"archive_file"}})])}]},function(e,t,i){"use strict";function n(e){i(672)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(400),s=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);var r=i(677),l=i(23),d=n,c=Object(l.a)(s.a,r.a,r.b,!1,d,null,null);t.default=c.exports},function(e,t,i){var n=i(673);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("4ac6e7a4",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,"#history-view-controls{flex:0 0 44px;background-color:#fff;border-bottom:1px solid #ddd;width:100%;padding:8px}.history-panel>.controls .title{font-size:120%}.history-panel>.controls .title input{font-size:100%}a.btn{text-decoration:none}",""])},function(e,t,i){var n=i(675);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("25eda0e2",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,'.bold{font-weight:700}.light{font-weight:lighter;color:grey}.right-aligned{text-align:right}.clickable{cursor:pointer}.workflow{border:1px solid gray;margin-bottom:1%}.workflow>.header{background:#d3d3d3;padding:5px 10px}.workflow>.light{color:gray}.workflow>.body{border-top:1px solid gray}.workflow>.body>.toolForm{border:0;margin:0}div.toolForm{border-width:1px;border-radius:0;margin-bottom:1%}.toolForm>.header{background-color:#ebd9b2;padding:5px 10px}.workflow div.toolForm:not(:first-child) .header{border-top:1px solid #d6b161}div.toolFormTitle{padding:0 0 4px;margin:0 0 4px;border:0;background-color:transparent;border-bottom:1px solid #d6b161}.toolForm em,.toolFormTitle>.light{color:#90743a}.job-inputs{margin:0 6px;text-align:left}.job-inputs td:first-child{text-align:right;font-weight:lighter;color:#90743a}.job-inputs td:first-child:after{content:":"}.job-inputs td:nth-child(2){padding-left:4px}.job-inputs-show{float:right}.copied-from{border:1px solid #d3d3d3;border-width:1px 1px 0;margin-bottom:1%}.copied-from .header{border-bottom:1px solid #d3d3d3;padding:5px}.copied-from .header .bold,.copied-from .header a{color:#888}.dataset.hda{min-height:37px;border-width:0 0 1px}.toolFormBody>.dataset.hda:last-child{border-bottom-width:0}.dataset.hda:first-child{border-top:1px solid #d6b161}.dataset.hda .dataset-title-bar{padding-top:8px;padding-left:10px}',""])},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e._l(e.errorMessages,function(t){return i("div",[i("div",{staticClass:"alert alert-danger",attrs:{role:"alert"}},[e._v("\n "+e._s(t)+"\n ")])])}),e._v(" "),i("div",{domProps:{innerHTML:e._s(e.historyTemplate)}})],2)},a=[]},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"structured-history-view"}},[i("div",{staticClass:"clear",attrs:{id:"history-view-controls"}},[i("div",{staticClass:"float-left"},[0==e.historyHistory.purged?i("span",[0==e.historyData.user_is_owner?i("span",[i("button",{staticClass:"btn btn-secondary",attrs:{id:"import"}},[e._v("Import and start using history")])]):e._e(),e._v(" "),e.historyData.user_is_owner&&0==e.historyData.history_is_current?i("span",[i("button",{staticClass:"btn btn-secondary",attrs:{id:"switch-history"},on:{click:e.switchHistory}},[e._v("Switch to this history")])]):e._e(),e._v(" "),i("button",{staticClass:"btn btn-secondary",attrs:{id:"show-structure"},on:{click:e.showStructure}},[e._v("Show structure")])]):e._e()]),e._v(" "),e._m(0)]),e._v(" "),e._l(e.errorMessages,function(t){return i("div",[i("div",{staticClass:"alert alert-danger",attrs:{role:"alert"}},[e._v("\n "+e._s(t)+"\n ")])])}),e._v(" "),i("div",{staticClass:"history-panel unified-panel-body",staticStyle:{overflow:"auto"},attrs:{id:"history-"+e.historyHistory.id}})],2)},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"float-right"},[i("button",{staticClass:"btn btn-secondary",attrs:{id:"toggle-deleted"}},[e._v("Include deleted")]),e._v(" "),i("button",{staticClass:"btn btn-secondary",attrs:{id:"toggle-hidden"}},[e._v("Include hidden")])])}]},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),s=n(a),o=i(86),r=n(o),l=i(5),d=n(l),c=i(24),u=n(c),h=i(144),f=n(h),p=i(143),_=n(p),m=i(34),g=n(m),v=i(9),w=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(v),y=u.default.extend({initialize:function(e){this.ajaxQueue=new r.default.AjaxQueue,u.default.prototype.initialize.call(this,e)},init_grid_elements:function(){var t=this.ajaxQueue;t.stop(),u.default.prototype.init_grid_elements.call(this),e.makeArray(this.$el.find(".delayed-value-datasets_by_state").map(function(t,i){return function(){var t=e(i).data("id"),n=Galaxy.root+"api/histories/"+t+"?keys=nice_size,contents_active,contents_states",a={};return a.url=n,a.type="GET",a.success=function(i){for(var n=i.contents_states,a="",s=["ok","running","queued","new","error"],o=0;o'+l+"
")}var d=i.contents_active,c=d.deleted;c&&(a+='
'+c+"
");var u=d.hidden;u&&(a+='
'+u+"
"),e(".delayed-value-datasets_by_state[data-id='"+t+"']").html(a),e(".delayed-value-disk_size[data-id='"+t+"']").html(i.nice_size)},e.ajax(a)}})).forEach(function(e){return t.add(e)}),t.start()},_showCopyDialog:function(e){var t=new f.default.History({id:e});t.fetch().fail(function(){alert("History could not be fetched. Please contact an administrator")}).done(function(){(0,_.default)(t,{}).done(function(){window.parent&&window.parent.Galaxy&&window.parent.Galaxy.currHistoryPanel&&window.parent.Galaxy.currHistoryPanel.loadCurrentHistory(),window.location.reload(!0)})})},add_operation:function(e,t,i){var n=this;"Copy"==t.label&&(t.onclick=function(e){n._showCopyDialog(e)}),u.default.prototype.add_operation.call(this,e,t,i)}}),b=w.View.extend({title:(0,s.default)("Histories"),initialize:function(t){var i=this;g.default.markViewAsLoading(this),"list_published"==t.action_id?this.active_tab="shared":"list"==t.action_id&&(this.active_tab="user"),this.model=new w.Model,d.default.get({url:Galaxy.root+"history/"+t.action_id+"?"+e.param(Galaxy.params),success:function(e){i.model.set(e),i.render()}})},render:function(){var e=new y(this.model.attributes);this.$el.empty().append(e.$el)}});t.default={View:b}}).call(t,i(0))},function(e,t,i){"use strict";function n(e){i(680)}Object.defineProperty(t,"__esModule",{value:!0});var a=i(403),s=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);var r=i(682),l=i(23),d=n,c=Object(l.a)(s.a,r.a,r.b,!1,d,null,null);t.default=c.exports},function(e,t,i){var n=i(681);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var a=i(38).default;a("67f12bb6",n,!0,{})},function(e,t,i){t=e.exports=i(27)(void 0),t.push([e.i,".ui-show{display:block;margin-top:0}.ui-bold{font-weight:700;margin-bottom:5px}.ui-float-left{float:left;margin-top:10px}",""])},function(e,t,i){"use strict";i.d(t,"a",function(){return n}),i.d(t,"b",function(){return a});var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-thumbnails"},[e.error?i("div",{staticClass:"ui-message ui-show alert alert-danger"},[e._v("\n "+e._s(e.error)+"\n ")]):i("div",{staticClass:"ui-thumbnails-grid"},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"search-query parent-width",attrs:{name:"query",placeholder:"search visualizations",autocomplete:"off",type:"text"},domProps:{value:e.search},on:{input:function(t){t.target.composing||(e.search=t.target.value)}}}),e._v(" "),e._l(e.plugins,function(t){return i("div",[e.match(t)?i("table",[i("tr",{staticClass:"ui-thumbnails-item",on:{click:function(i){e.select(t)}}},[i("td",[t.logo?i("img",{staticClass:"ui-thumbnails-image",attrs:{src:t.logo}}):i("div",{staticClass:"ui-thumbnails-icon fa fa-eye"})]),e._v(" "),i("td",[i("div",{staticClass:"ui-thumbnails-description-title ui-form-info"},[e._v("\n "+e._s(t.html)+"\n ")]),e._v(" "),i("div",{staticClass:"ui-thumbnails-description-text ui-form-info"},[e._v("\n "+e._s(t.description)+"\n ")])])]),e._v(" "),e.fixed?e._e():i("tr",[i("td"),e._v(" "),t.name==e.name?i("td",[e.hdas&&e.hdas.length>0?i("div",[i("div",{staticClass:"ui-form-info ui-bold"},[e._v("Select a dataset to visualize:")]),e._v(" "),i("div",{staticClass:"ui-select"},[i("select",{directives:[{name:"model",rawName:"v-model",value:e.selected,expression:"selected"}],staticClass:"select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selected=t.target.multiple?i:i[0]}}},e._l(e.hdas,function(t){return i("option",{domProps:{value:t.id}},[e._v(e._s(t.name))])})),e._v(" "),i("div",{staticClass:"icon-dropdown fa fa-caret-down"})]),e._v(" "),i("button",{staticClass:"ui-button-default ui-float-left btn btn-primary",attrs:{type:"button"},on:{click:function(i){e.create(t)}}},[i("i",{staticClass:"icon fa fa-check ui-margin-right"}),e._v(" "),i("span",{staticClass:"title"},[e._v("Create Visualization")])])]):i("div",{staticClass:"ui-message ui-show alert alert-danger"},[e._v("\n There is no suitable dataset in your current history which can be visualized with this plugin.\n ")])]):e._e()])]):e._e()])})],2)])},a=[]},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(5),d=s(l),c=i(10),u=s(c),h=i(26),f=s(h),p=e.View.extend({initialize:function(){this.setElement("
"),this.model=new e.Model({dataset_id:Galaxy.params.dataset_id}),this.active_tab="user",this.render()},render:function(){var e=this,t=Galaxy.root+"api/datasets/"+this.model.get("dataset_id");d.default.get({url:t,success:function(t){var i=Galaxy.root+"api/jobs/"+t.creating_job+"?full=True";d.default.get({url:i,success:function(i){e.render_error_page(t,i)},error:function(t){var i={status:"error",message:"Error occured while loading the job.",persistent:!0,cls:"errormessage"};e.display_message(i,e.$(".response-message"))}})},error:function(t){var i={status:"error",message:"Error occured while loading the dataset.",persistent:!0,cls:"errormessage"};e.display_message(i,e.$(".response-message"))}})},render_error_page:function(e,t){this.$el.empty().append("\n "+this._templateHeader()+"\n

Dataset Error

\n

An error occured while running the tool "+t.tool_id+'.

\n

Tool execution generated the following messages:

\n
'+n.escape(t.stderr)+"
\n

Report This Error

\n

\n Usually the local Galaxy administrators regularly review errors that occur on the server\n However, if you would like to provide additional information (such as what you were trying\n to do when the error occurred) and a contact e-mail address, we will be better able to\n investigate your problem and get back to you.\n

"),this.$el.append(this._getBugFormTemplate(e,t))},display_message:function(e,t,i,n){n?i?t.append(new u.default.UnescapedMessage(e).$el):t.empty().html(new u.default.UnescapedMessage(e).$el):i?t.append(new u.default.Message(e).$el):t.empty().html(new u.default.Message(e).$el)},_templateHeader:function(){return'
'},_getBugFormTemplate:function(e,t){var i=this,n=[{help:(0,r.default)("Your email address"),options:[],type:"text",name:"email",label:"Your email",value:Galaxy.user.get("email")},{help:(0,r.default)("Any additional comments you can provide regarding what you were doing at the time of the bug."),options:[],type:"text",area:!0,name:"message",label:"Message"}],a=new f.default({title:(0,r.default)("Error Report"),inputs:n,buttons:{save:new u.default.Button({icon:"fa-bug",title:(0,r.default)("Report"),cls:"ui-button btn btn-primary",floating:"clear",onclick:function(){var n=a.data.create(),s=Galaxy.root+"api/jobs/"+t.id+"/error";n.dataset_id=e.id,i.submit(n,s)}})}});return a.$el},submit:function(e,t){var i=this;a.ajax({type:"POST",url:t,data:e,success:function(e){i.$el.empty().append(i._templateHeader()),e.messages.forEach(function(e){i.display_message({status:e[1],message:e[0],persistent:!0},i.$(".response-message"),!0,!0)})},error:function(e){var t={status:"error",message:"Error occured while saving. Please fill all the required fields and try again.",persistent:!0,cls:"errormessage"};i.display_message(t,i.$(".response-message"))}})}});t.default={View:p}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,a){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),r=s(o),l=i(5),d=(s(l),i(80)),c=s(d),u=i(10),h=s(u),f=i(26),p=s(f),_=e.View.extend({initialize:function(){this.setElement("
"),this.model=new e.Model({dataset_id:Galaxy.params.dataset_id}),this.message=new h.default.Message({persistent:!0}),this.tabs=this._createTabs(),this.active_tab="user",this.$el.append(n("

").append("Edit dataset attributes")).append(this.message.$el).append("

").append(this.tabs.$el).hide(),this.render()},render:function(){var e=this;n.ajax({url:Galaxy.root+"dataset/get_edit?dataset_id="+e.model.get("dataset_id"),success:function(t){!e.initial_message&&e.message.update(t),e.initial_message=!0,a.each(e.forms,function(e,i){e.model.set("inputs",t[i+"_inputs"]),e.model.set("hide_operations",t[i+"_disable"]),e.render()}),e.$el.show()},error:function(t){var i=t.responseJSON&&t.responseJSON.err_msg;e.message.update({status:"danger",message:i||"Error occured while loading the dataset."})}})},_submit:function(e,t){var i=this,a=t.data.create();a.dataset_id=this.model.get("dataset_id"),a.operation=e,n.ajax({type:"PUT",url:Galaxy.root+"dataset/set_edit",data:a,success:function(e){i.message.update(e),i.render(),i._reloadHistory()},error:function(e){var t=e.responseJSON&&e.responseJSON.err_msg;i.message.update({status:"danger",message:t||"Error occured while editing the dataset attributes."})}})},_createTabs:function(){this.forms={attribute:this._getAttribute(),conversion:this._getConversion(),datatype:this._getDatatype(),permission:this._getPermission()};var e=new c.default.View;return e.add({id:"attribute",title:(0,r.default)("Attributes"),icon:"fa fa-bars",tooltip:(0,r.default)("Edit dataset attributes"),$el:this.forms.attribute.$el}),e.add({id:"convert",title:(0,r.default)("Convert"),icon:"fa-gear",tooltip:(0,r.default)("Convert to new format"),$el:this.forms.conversion.$el}),e.add({id:"datatype",title:(0,r.default)("Datatypes"),icon:"fa-database",tooltip:(0,r.default)("Change data type"),$el:this.forms.datatype.$el}),e.add({id:"permissions",title:(0,r.default)("Permissions"),icon:"fa-user",tooltip:(0,r.default)("Permissions"),$el:this.forms.permission.$el}),e},_getAttribute:function(){var e=this,t=new p.default({title:(0,r.default)("Edit attributes"),operations:{submit_attributes:new h.default.ButtonIcon({tooltip:(0,r.default)("Save attributes of the dataset."),icon:"fa-floppy-o",title:(0,r.default)("Save"),onclick:function(){e._submit("attributes",t)}}),submit_autodetect:new h.default.ButtonIcon({tooltip:"This will inspect the dataset and attempt to correct the values of fields if they are not accurate.",icon:"fa-undo",title:"Auto-detect",onclick:function(){e._submit("autodetect",t)}})}});return t},_getConversion:function(){var e=this,t=new p.default({title:(0,r.default)("Convert to new format"),operations:{submit_conversion:new h.default.ButtonIcon({tooltip:(0,r.default)("Convert the datatype to a new format."),title:(0,r.default)("Convert datatype"),icon:"fa-exchange",onclick:function(){e._submit("conversion",t)}})}});return t},_getDatatype:function(){var e=this,t=new p.default({title:(0,r.default)("Change datatype"),operations:{submit_datatype:new h.default.ButtonIcon({tooltip:(0,r.default)("Change the datatype to a new type."),title:(0,r.default)("Change datatype"),icon:"fa-exchange",onclick:function(){e._submit("datatype",t)}})}});return t},_getPermission:function(){var e=this,t=new p.default({title:(0,r.default)("Manage dataset permissions"),operations:{submit_permission:new h.default.ButtonIcon({tooltip:(0,r.default)("Save permissions."),title:(0,r.default)("Save permissions"),icon:"fa-floppy-o ",onclick:function(){e._submit("permission",t)}})}});return t},_reloadHistory:function(){window.Galaxy&&window.Galaxy.currHistoryPanel.loadCurrentHistory()}});t.default={View:_}}).call(t,i(2),i(0),i(1))}],[642]); +//# sourceMappingURL=analysis.bundled.js.map \ No newline at end of file diff --git a/static/scripts/bundled/chart.bundled.js b/static/scripts/bundled/chart.bundled.js index f2695ac2eb5..67c9b1dc967 100644 --- a/static/scripts/bundled/chart.bundled.js +++ b/static/scripts/bundled/chart.bundled.js @@ -1 +1,2 @@ -webpackJsonp([4],{224:function(t,n,e){var r,i;!function(){function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function u(t,n){return tn?1:t>=n?0:NaN}function l(t){return null===t?NaN:+t}function s(t){return!isNaN(t)}function c(t){return{left:function(n,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=n.length);r>>1;t(n[a],e)<0?r=a+1:i=a}return r},right:function(n,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=n.length);r>>1;t(n[a],e)>0?i=a:r=a+1}return r}}}function f(t){return t.length}function h(t){for(var n=1;t*n%1;)n*=10;return n}function d(t,n){for(var e in n)Object.defineProperty(t.prototype,e,{value:n[e],enumerable:!1})}function p(){this._=Object.create(null)}function g(t){return(t+="")===ko||t[0]===So?So+t:t}function v(t){return(t+="")[0]===So?t.slice(1):t}function y(t){return g(t)in this._}function m(t){return(t=g(t))in this._&&delete this._[t]}function x(){var t=[];for(var n in this._)t.push(v(n));return t}function M(){var t=0;for(var n in this._)++t;return t}function _(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function w(t){return t}function k(t,n,e){return function(){var r=e.apply(n,arguments);return r===n?t:r}}function S(t,n){if(n in t)return n;n=n.charAt(0).toUpperCase()+n.slice(1);for(var e=0,r=No.length;e=n&&(n=i+1);!(o=u[n])&&++n0&&(t=t.slice(0,u));var s=Do.get(t);return s&&(t=s,l=Q),u?n?i:r:n?N:a}function K(t,n){return function(e){var r=ho.event;ho.event=e,n[0]=this.__data__;try{t.apply(this,n)}finally{ho.event=r}}}function Q(t,n){var e=K(t,n);return function(t){var n=this,r=t.relatedTarget;r&&(r===n||8&r.compareDocumentPosition(n))||e.call(n,t)}}function tt(t){var n=".dragsuppress-"+ ++$o,e="click"+n,r=ho.select(o(t)).on("touchmove"+n,z).on("dragstart"+n,z).on("selectstart"+n,z);if(null==Ro&&(Ro=!("onselectstart"in t)&&S(t.style,"userSelect")),Ro){var i=a(t).style,u=i[Ro];i[Ro]="none"}return function(t){if(r.on(n,null),Ro&&(i[Ro]=u),t){var a=function(){r.on(e,null)};r.on(e,function(){z(),a()},!0),setTimeout(a,0)}}}function nt(t,n){n.changedTouches&&(n=n.changedTouches[0]);var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(Oo<0){var i=o(t);if(i.scrollX||i.scrollY){e=ho.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=e[0][0].getScreenCTM();Oo=!(a.f||a.e),e.remove()}}return Oo?(r.x=n.pageX,r.y=n.pageY):(r.x=n.clientX,r.y=n.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var u=t.getBoundingClientRect();return[n.clientX-u.left-t.clientLeft,n.clientY-u.top-t.clientTop]}function et(){return ho.event.changedTouches[0].identifier}function rt(t){return t>0?1:t<0?-1:0}function it(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])}function at(t){return t>1?0:t<-1?Fo:Math.acos(t)}function ot(t){return t>1?Yo:t<-1?-Yo:Math.asin(t)}function ut(t){return((t=Math.exp(t))-1/t)/2}function lt(t){return((t=Math.exp(t))+1/t)/2}function st(t){return((t=Math.exp(2*t))-1)/(t+1)}function ct(t){return(t=Math.sin(t/2))*t}function ft(){}function ht(t,n,e){return this instanceof ht?(this.h=+t,this.s=+n,void(this.l=+e)):arguments.length<2?t instanceof ht?new ht(t.h,t.s,t.l):Nt(""+t,Et,ht):new ht(t,n,e)}function dt(t,n,e){function r(t){return t>360?t-=360:t<0&&(t+=360),t<60?a+(o-a)*t/60:t<180?o:t<240?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*r(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,n=isNaN(n)?0:n<0?0:n>1?1:n,e=e<0?0:e>1?1:e,o=e<=.5?e*(1+n):e+n-e*n,a=2*e-o,new bt(i(t+120),i(t),i(t-120))}function pt(t,n,e){return this instanceof pt?(this.h=+t,this.c=+n,void(this.l=+e)):arguments.length<2?t instanceof pt?new pt(t.h,t.c,t.l):t instanceof vt?mt(t.l,t.a,t.b):mt((t=Ct((t=ho.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new pt(t,n,e)}function gt(t,n,e){return isNaN(t)&&(t=0),isNaN(n)&&(n=0),new vt(e,Math.cos(t*=Go)*n,Math.sin(t)*n)}function vt(t,n,e){return this instanceof vt?(this.l=+t,this.a=+n,void(this.b=+e)):arguments.length<2?t instanceof vt?new vt(t.l,t.a,t.b):t instanceof pt?gt(t.h,t.c,t.l):Ct((t=bt(t)).r,t.g,t.b):new vt(t,n,e)}function yt(t,n,e){var r=(t+16)/116,i=r+n/500,a=r-e/200;return i=xt(i)*nu,r=xt(r)*eu,a=xt(a)*ru,new bt(_t(3.2404542*i-1.5371385*r-.4985314*a),_t(-.969266*i+1.8760108*r+.041556*a),_t(.0556434*i-.2040259*r+1.0572252*a))}function mt(t,n,e){return t>0?new pt(Math.atan2(e,n)*Zo,Math.sqrt(n*n+e*e),t):new pt(NaN,NaN,t)}function xt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function _t(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,n,e){return this instanceof bt?(this.r=~~t,this.g=~~n,void(this.b=~~e)):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):Nt(""+t,bt,dt):new bt(t,n,e)}function wt(t){return new bt(t>>16,t>>8&255,255&t)}function kt(t){return wt(t)+""}function St(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Nt(t,n,e){var r,i,a,o=0,u=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return n(At(i[0]),At(i[1]),At(i[2]))}return(a=ou.get(t))?n(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,u=240&a,u|=u>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,u=(65280&a)>>8,l=255&a)),n(o,u,l))}function Et(t,n,e){var r,i,a=Math.min(t/=255,n/=255,e/=255),o=Math.max(t,n,e),u=o-a,l=(o+a)/2;return u?(i=l<.5?u/(o+a):u/(2-o-a),r=t==o?(n-e)/u+(n0&&l<1?0:r),new ht(r,i,l)}function Ct(t,n,e){t=zt(t),n=zt(n),e=zt(e);var r=Mt((.4124564*t+.3575761*n+.1804375*e)/nu),i=Mt((.2126729*t+.7151522*n+.072175*e)/eu);return vt(116*i-16,500*(r-i),200*(i-Mt((.0193339*t+.119192*n+.9503041*e)/ru)))}function zt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function At(t){var n=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*n):n}function Tt(t){return"function"==typeof t?t:function(){return t}}function Lt(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),qt(n,e,t,r)}}function qt(t,n,e,r){function i(){var t,n=l.status;if(!n&&jt(l)||n>=200&&n<300||304===n){try{t=e.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=ho.dispatch("beforesend","progress","load","error"),u={},l=new XMLHttpRequest,s=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var n=ho.event;ho.event=t;try{o.progress.call(a,l)}finally{ho.event=n}},a.header=function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?u[t]:(null==n?delete u[t]:u[t]=n+"",a)},a.mimeType=function(t){return arguments.length?(n=null==t?null:t+"",a):n},a.responseType=function(t){return arguments.length?(s=t,a):s},a.response=function(t){return e=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(go(arguments)))}}),a.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,t,!0),null==n||"accept"in u||(u.accept=n+",*/*"),l.setRequestHeader)for(var c in u)l.setRequestHeader(c,u[c]);return null!=n&&l.overrideMimeType&&l.overrideMimeType(n),null!=s&&(l.responseType=s),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==r?null:r),a},a.abort=function(){return l.abort(),a},ho.rebind(a,o,"on"),null==r?a:a.get(Pt(r))}function Pt(t){return 1===t.length?function(n,e){t(null==n?e:null)}:t}function jt(t){var n=t.responseType;return n&&"text"!==n?t.response:t.responseText}function Dt(t,n,e){var r=arguments.length;r<2&&(n=0),r<3&&(e=Date.now());var i=e+n,a={c:t,t:i,n:null};return lu?lu.n=a:uu=a,lu=a,su||(cu=clearTimeout(cu),su=1,fu(Rt)),a}function Rt(){var t=$t(),n=Ot()-t;n>24?(isFinite(n)&&(clearTimeout(cu),cu=setTimeout(Rt,n)),su=0):(su=1,fu(Rt))}function $t(){for(var t=Date.now(),n=uu;n;)t>=n.t&&n.c(t-n.t)&&(n.c=null),n=n.n;return t}function Ot(){for(var t,n=uu,e=1/0;n;)n.c?(n.t8?function(t){return t/e}:function(t){return t*e},symbol:t}}function Ft(t){var n=t.decimal,e=t.thousands,r=t.grouping,i=t.currency,a=r&&e?function(t,n){for(var i=t.length,a=[],o=0,u=r[0],l=0;i>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),a.push(t.substring(i-=u,i+u)),!((l+=u+1)>n));)u=r[o=(o+1)%r.length];return a.reverse().join(e)}:w;return function(t){var e=du.exec(t),r=e[1]||" ",o=e[2]||">",u=e[3]||"-",l=e[4]||"",s=e[5],c=+e[6],f=e[7],h=e[8],d=e[9],p=1,g="",v="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(s||"0"===r&&"="===o)&&(s=r="0",o="="),d){case"n":f=!0,d="g";break;case"%":p=100,v="%",d="f";break;case"p":p=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+d.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(g=i[0],v=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=pu.get(d)||Ht;var x=s&&f;return function(t){var e=v;if(y&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===u?"":u;if(p<0){var l=ho.formatPrefix(t,h);t=l.scale(t),e=l.symbol+v}else t*=p;t=d(t,h);var M,_,b=t.lastIndexOf(".");if(b<0){var w=m?t.lastIndexOf("e"):-1;w<0?(M=t,_=""):(M=t.substring(0,w),_=t.substring(w))}else M=t.substring(0,b),_=n+t.substring(b+1);!s&&f&&(M=a(M,1/0));var k=g.length+M.length+_.length+(x?0:i.length),S=k"===o?S+i+t:"^"===o?S.substring(0,k>>=1)+i+t+S.substring(k):i+(x?t:S+t))+e}}}function Ht(t){return t+""}function Vt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Yt(t,n,e){function r(n){var e=t(n),r=a(e,1);return n-e1)for(;o=s)return-1;if(37===(i=n.charCodeAt(u++))){if(o=n.charAt(u++),!(a=z[o in mu?n.charAt(u++):o])||(r=a(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(t,n,e){b.lastIndex=0;var r=b.exec(n.slice(e));return r?(t.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(t,n,e){M.lastIndex=0;var r=M.exec(n.slice(e));return r?(t.w=_.get(r[0].toLowerCase()),e+r[0].length):-1}function a(t,n,e){N.lastIndex=0;var r=N.exec(n.slice(e));return r?(t.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(t,n,e){k.lastIndex=0;var r=k.exec(n.slice(e));return r?(t.m=S.get(r[0].toLowerCase()),e+r[0].length):-1}function u(t,n,r){return e(t,C.c.toString(),n,r)}function l(t,n,r){return e(t,C.x.toString(),n,r)}function s(t,n,r){return e(t,C.X.toString(),n,r)}function c(t,n,e){var r=x.get(n.slice(e,e+=2).toLowerCase());return null==r?-1:(t.p=r,e)}var f=t.dateTime,h=t.date,d=t.time,p=t.periods,g=t.days,v=t.shortDays,y=t.months,m=t.shortMonths;n.utc=function(t){function e(t){try{vu=Vt;var n=new vu;return n._=t,r(n)}finally{vu=Date}}var r=n(t);return e.parse=function(t){try{vu=Vt;var n=r.parse(t);return n&&n._}finally{vu=Date}},e.toString=r.toString,e},n.multi=n.utc.multi=pn;var x=ho.map(),M=Xt(g),_=Jt(g),b=Xt(v),w=Jt(v),k=Xt(y),S=Jt(y),N=Xt(m),E=Jt(m);p.forEach(function(t,n){x.set(t.toLowerCase(),n)});var C={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return m[t.getMonth()]},B:function(t){return y[t.getMonth()]},c:n(f),d:function(t,n){return Bt(t.getDate(),n,2)},e:function(t,n){return Bt(t.getDate(),n,2)},H:function(t,n){return Bt(t.getHours(),n,2)},I:function(t,n){return Bt(t.getHours()%12||12,n,2)},j:function(t,n){return Bt(1+gu.dayOfYear(t),n,3)},L:function(t,n){return Bt(t.getMilliseconds(),n,3)},m:function(t,n){return Bt(t.getMonth()+1,n,2)},M:function(t,n){return Bt(t.getMinutes(),n,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,n){return Bt(t.getSeconds(),n,2)},U:function(t,n){return Bt(gu.sundayOfYear(t),n,2)},w:function(t){return t.getDay()},W:function(t,n){return Bt(gu.mondayOfYear(t),n,2)},x:n(h),X:n(d),y:function(t,n){return Bt(t.getFullYear()%100,n,2)},Y:function(t,n){return Bt(t.getFullYear()%1e4,n,4)},Z:hn,"%":function(){return"%"}},z={a:r,A:i,b:a,B:o,c:u,d:on,e:on,H:ln,I:ln,j:un,L:fn,m:an,M:sn,p:c,S:cn,U:Kt,w:Wt,W:Qt,x:l,X:s,y:nn,Y:tn,Z:en,"%":dn};return n}function Bt(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3)}function an(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function on(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function un(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+3));return r?(t.j=+r[0],e+r[0].length):-1}function ln(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function sn(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function cn(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function fn(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function hn(t){var n=t.getTimezoneOffset(),e=n>0?"-":"+",r=wo(n)/60|0,i=wo(n)%60;return e+Bt(r,"0",2)+Bt(i,"0",2)}function dn(t,n,e){Mu.lastIndex=0;var r=Mu.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function pn(t){for(var n=t.length,e=-1;++e=0?1:-1,u=o*e,l=Math.cos(n),s=Math.sin(n),c=a*s,f=i*l+c*Math.cos(u),h=c*o*Math.sin(u);Nu.add(Math.atan2(h,f)),r=t,i=l,a=s}var n,e,r,i,a;Eu.point=function(o,u){Eu.point=t,r=(n=o)*Go,i=Math.cos(u=(e=u)*Go/2+Fo/4),a=Math.sin(u)},Eu.lineEnd=function(){t(n,e)}}function _n(t){var n=t[0],e=t[1],r=Math.cos(e);return[r*Math.cos(n),r*Math.sin(n),Math.sin(e)]}function bn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function wn(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function kn(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Sn(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Nn(t){var n=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function En(t){return[Math.atan2(t[1],t[0]),ot(t[2])]}function Cn(t,n){return wo(t[0]-n[0])=0;--u)i.point((f=c[u])[0],f[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Rn(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&n&&e.push(e.pop().concat(e.shift())),d.push(e.filter(In))}var d,p,g,v=n(a),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:s,polygonStart:function(){m.point=c,m.lineStart=f,m.lineEnd=h,d=[],p=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=s,d=ho.merge(d);var t=Gn(y,p);d.length?(_||(a.polygonStart(),_=!0),Dn(d,Fn,t,e,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),e(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),e(null,null,1,a),a.lineEnd(),a.polygonEnd()}},x=Un(),M=n(x),_=!1;return m}}function In(t){return t.length>1}function Un(){var t,n=[];return{lineStart:function(){n.push(t=[])},point:function(n,e){t.push([n,e])},lineEnd:N,buffer:function(){var e=n;return n=[],t=null,e},rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))}}}function Fn(t,n){return((t=t.x)[0]<0?t[1]-Yo-Io:Yo-t[1])-((n=n.x)[0]<0?n[1]-Yo-Io:Yo-n[1])}function Hn(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(a,o){var u=a>0?Fo:-Fo,l=wo(a-e);wo(l-Fo)0?Yo:-Yo),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(a,r),n=0):i!==u&&l>=Fo&&(wo(e-i)Io?Math.atan((Math.sin(n)*(a=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(n))*Math.sin(t))/(i*a*o)):(n+r)/2}function Yn(t,n,e,r){var i;if(null==t)i=e*Yo,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(wo(t[0]-n[0])>Io){var a=t[0]=0?1:-1,w=b*_,k=w>Fo,S=p*x;if(Nu.add(Math.atan2(S*b*Math.sin(w),g*M+S*Math.cos(w))),a+=k?_+b*Ho:_,k^h>=e^y>=e){var N=wn(_n(f),_n(t));Nn(N);var E=wn(i,N);Nn(E);var C=(k^_>=0?-1:1)*ot(E[2]);(r>C||r===C&&(N[0]||N[1]))&&(o+=k^_>=0?1:-1)}if(!v++)break;h=y,p=x,g=M,f=t}}return(a<-Io||aa}function e(t){var e,a,l,s,c;return{lineStart:function(){s=l=!1,c=1},point:function(f,h){var d,p=[f,h],g=n(f,h),v=o?g?0:i(f,h):g?i(f+(f<0?Fo:-Fo),h):0;if(!e&&(s=l=g)&&t.lineStart(),g!==l&&(d=r(e,p),(Cn(e,d)||Cn(p,d))&&(p[0]+=Io,p[1]+=Io,g=n(p[0],p[1]))),g!==l)c=0,g?(t.lineStart(),d=r(p,e),t.point(d[0],d[1])):(d=r(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(u&&e&&o^g){var y;v&a||!(y=r(p,e,!0))||(c=0,o?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&Cn(e,p)||t.point(p[0],p[1]),e=p,l=g,a=v},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(s&&l)<<1}}}function r(t,n,e){var r=_n(t),i=_n(n),o=[1,0,0],u=wn(r,i),l=bn(u,u),s=u[0],c=l-s*s;if(!c)return!e&&t;var f=a*l/c,h=-a*s/c,d=wn(o,u),p=Sn(o,f);kn(p,Sn(u,h));var g=d,v=bn(p,g),y=bn(g,g),m=v*v-y*(bn(p,p)-1);if(!(m<0)){var x=Math.sqrt(m),M=Sn(g,(-v-x)/y);if(kn(M,p),M=En(M),!e)return M;var _,b=t[0],w=n[0],k=t[1],S=n[1];w0^M[1]<(wo(M[0]-b)Fo^(b<=M[0]&&M[0]<=w)){var z=Sn(g,(-v+x)/y);return kn(z,p),[M,En(z)]}}}function i(n,e){var r=o?t:Fo-t,i=0;return n<-r?i|=1:n>r&&(i|=2),e<-r?i|=4:e>r&&(i|=8),i}var a=Math.cos(t),o=a>0,u=wo(a)>Io;return On(n,e,Me(t,6*Go),o?[0,-t]:[-Fo,t-Fo])}function Bn(t,n,e,r){return function(i){var a,o=i.a,u=i.b,l=o.x,s=o.y,c=u.x,f=u.y,h=0,d=1,p=c-l,g=f-s;if(a=t-l,p||!(a>0)){if(a/=p,p<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=e-l,p||!(a<0)){if(a/=p,p<0){if(a>d)return;a>h&&(h=a)}else if(p>0){if(a0)){if(a/=g,g<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=r-s,g||!(a<0)){if(a/=g,g<0){if(a>d)return;a>h&&(h=a)}else if(g>0){if(a0&&(i.a={x:l+h*p,y:s+h*g}),d<1&&(i.b={x:l+d*p,y:s+d*g}),i}}}}}}function Xn(t,n,e,r){function i(r,i){return wo(r[0]-t)0?0:3:wo(r[0]-e)0?2:1:wo(r[1]-n)0?1:0:i>0?3:2}function a(t,n){return o(t.x,n.x)}function o(t,n){var e=i(t,1),r=i(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(u){function l(t){for(var n=0,e=v.length,r=t[1],i=0;ir&&it(s,a,t)>0&&++n:a[1]<=r&&it(s,a,t)<0&&--n,s=a;return 0!==n}function s(a,u,l,s){var c=0,f=0;if(null==a||(c=i(a,l))!==(f=i(u,l))||o(a,u)<0^l>0)do{s.point(0===c||3===c?t:e,c>1?r:n)}while((c=(c+l+4)%4)!==f);else s.point(u[0],u[1])}function c(i,a){return t<=i&&i<=e&&n<=a&&a<=r}function f(t,n){c(t,n)&&u.point(t,n)}function h(){z.point=p,v&&v.push(y=[]),k=!0,w=!1,_=b=NaN}function d(){g&&(p(m,x),M&&w&&E.rejoin(),g.push(E.buffer())),z.point=f,w&&u.lineEnd()}function p(t,n){t=Math.max(-Uu,Math.min(Uu,t)),n=Math.max(-Uu,Math.min(Uu,n));var e=c(t,n);if(v&&y.push([t,n]),k)m=t,x=n,M=e,k=!1,e&&(u.lineStart(),u.point(t,n));else if(e&&w)u.point(t,n);else{var r={a:{x:_,y:b},b:{x:t,y:n}};C(r)?(w||(u.lineStart(),u.point(r.a.x,r.a.y)),u.point(r.b.x,r.b.y),e||u.lineEnd(),S=!1):e&&(u.lineStart(),u.point(t,n),S=!1)}_=t,b=n,w=e}var g,v,y,m,x,M,_,b,w,k,S,N=u,E=Un(),C=Bn(t,n,e,r),z={point:f,lineStart:h,lineEnd:d,polygonStart:function(){u=E,g=[],v=[],S=!0},polygonEnd:function(){u=N,g=ho.merge(g);var n=l([t,r]),e=S&&n,i=g.length;(e||i)&&(u.polygonStart(),e&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),i&&Dn(g,a,n,s,u),u.polygonEnd()),g=v=y=null}};return z}}function Jn(t){var n=0,e=Fo/3,r=he(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*Fo/180,e=t[1]*Fo/180):[n/Fo*180,e/Fo*180]},i}function Wn(t,n){function e(t,n){var e=Math.sqrt(a-2*i*Math.sin(n))/i;return[e*Math.sin(t*=i),o-e*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(n))/2,a=1+r*(2*i-r),o=Math.sqrt(a)/i;return e.invert=function(t,n){var e=o-n;return[Math.atan2(t,e)/i,ot((a-(t*t+e*e)*i*i)/(2*i))]},e}function Kn(){function t(t,n){Hu+=i*t-r*n,r=t,i=n}var n,e,r,i;Bu.point=function(a,o){Bu.point=t,n=r=a,e=i=o},Bu.lineEnd=function(){t(n,e)}}function Qn(t,n){tGu&&(Gu=t),nZu&&(Zu=n)}function te(){function t(t,n){o.push("M",t,",",n,a)}function n(t,n){o.push("M",t,",",n),u.point=e}function e(t,n){o.push("L",t,",",n)}function r(){u.point=t}function i(){o.push("Z")}var a=ne(4.5),o=[],u={point:t,lineStart:function(){u.point=n},lineEnd:r,polygonStart:function(){u.lineEnd=i},polygonEnd:function(){u.lineEnd=r,u.point=t},pointRadius:function(t){return a=ne(t),u},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return u}function ne(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ee(t,n){Au+=t,Tu+=n,++Lu}function re(){function t(t,r){var i=t-n,a=r-e,o=Math.sqrt(i*i+a*a);qu+=o*(n+t)/2,Pu+=o*(e+r)/2,ju+=o,ee(n=t,e=r)}var n,e;Ju.point=function(r,i){Ju.point=t,ee(n=r,e=i)}}function ie(){Ju.point=ee}function ae(){function t(t,n){var e=t-r,a=n-i,o=Math.sqrt(e*e+a*a);qu+=o*(r+t)/2,Pu+=o*(i+n)/2,ju+=o,o=i*t-r*n,Du+=o*(r+t),Ru+=o*(i+n),$u+=3*o,ee(r=t,i=n)}var n,e,r,i;Ju.point=function(a,o){Ju.point=t,ee(n=r=a,e=i=o)},Ju.lineEnd=function(){t(n,e)}}function oe(t){function n(n,e){t.moveTo(n+o,e),t.arc(n,e,o,0,Ho)}function e(n,e){t.moveTo(n,e),u.point=r}function r(n,e){t.lineTo(n,e)}function i(){u.point=n}function a(){t.closePath()}var o=4.5,u={point:n,lineStart:function(){u.point=e},lineEnd:i,polygonStart:function(){u.lineEnd=a},polygonEnd:function(){u.lineEnd=i,u.point=n},pointRadius:function(t){return o=t,u},result:N};return u}function ue(t){function n(t){return(u?r:e)(t)}function e(n){return ce(n,function(e,r){e=t(e,r),n.point(e[0],e[1])})}function r(n){function e(e,r){e=t(e,r),n.point(e[0],e[1])}function r(){x=NaN,k.point=a,n.lineStart()}function a(e,r){var a=_n([e,r]),o=t(e,r);i(x,M,m,_,b,w,x=o[0],M=o[1],m=e,_=a[0],b=a[1],w=a[2],u,n),n.point(x,M)}function o(){k.point=e,n.lineEnd()}function l(){r(),k.point=s,k.lineEnd=c}function s(t,n){a(f=t,h=n),d=x,p=M,g=_,v=b,y=w,k.point=a}function c(){i(x,M,m,_,b,w,d,p,f,g,v,y,u,n),k.lineEnd=o,o()}var f,h,d,p,g,v,y,m,x,M,_,b,w,k={point:e,lineStart:r,lineEnd:o,polygonStart:function(){n.polygonStart(),k.lineStart=l},polygonEnd:function(){n.polygonEnd(),k.lineStart=r}};return k}function i(n,e,r,u,l,s,c,f,h,d,p,g,v,y){var m=c-n,x=f-e,M=m*m+x*x;if(M>4*a&&v--){var _=u+d,b=l+p,w=s+g,k=Math.sqrt(_*_+b*b+w*w),S=Math.asin(w/=k),N=wo(wo(w)-1)a||wo((m*A+x*T)/M-.5)>.3||u*d+l*p+s*g0&&16,n):Math.sqrt(a)},n}function le(t){var n=ue(function(n,e){return t([n*Zo,e*Zo])});return function(t){return de(n(t))}}function se(t){this.stream=t}function ce(t,n){return{point:n,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function fe(t){return he(function(){return t})()}function he(t){function n(t){return t=u(t[0]*Go,t[1]*Go),[t[0]*h+l,s-t[1]*h]}function e(t){return(t=u.invert((t[0]-l)/h,(s-t[1])/h))&&[t[0]*Zo,t[1]*Zo]}function r(){u=Pn(o=ve(y,m,x),a);var t=a(g,v);return l=d-t[0]*h,s=p+t[1]*h,i()}function i(){return c&&(c.valid=!1,c=null),n}var a,o,u,l,s,c,f=ue(function(t,n){return t=a(t,n),[t[0]*h+l,s-t[1]*h]}),h=150,d=480,p=250,g=0,v=0,y=0,m=0,x=0,M=Iu,_=w,b=null,k=null;return n.stream=function(t){return c&&(c.valid=!1),c=de(M(o,f(_(t)))),c.valid=!0,c},n.clipAngle=function(t){return arguments.length?(M=null==t?(b=t,Iu):Zn((b=+t)*Go),i()):b},n.clipExtent=function(t){return arguments.length?(k=t,_=t?Xn(t[0][0],t[0][1],t[1][0],t[1][1]):w,i()):k},n.scale=function(t){return arguments.length?(h=+t,r()):h},n.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],r()):[d,p]},n.center=function(t){return arguments.length?(g=t[0]%360*Go,v=t[1]%360*Go,r()):[g*Zo,v*Zo]},n.rotate=function(t){return arguments.length?(y=t[0]%360*Go,m=t[1]%360*Go,x=t.length>2?t[2]%360*Go:0,r()):[y*Zo,m*Zo,x*Zo]},ho.rebind(n,f,"precision"),function(){return a=t.apply(this,arguments),n.invert=a.invert&&e,r()}}function de(t){return ce(t,function(n,e){t.point(n*Go,e*Go)})}function pe(t,n){return[t,n]}function ge(t,n){return[t>Fo?t-Ho:t<-Fo?t+Ho:t,n]}function ve(t,n,e){return t?n||e?Pn(me(t),xe(n,e)):me(t):n||e?xe(n,e):ge}function ye(t){return function(n,e){return n+=t,[n>Fo?n-Ho:n<-Fo?n+Ho:n,e]}}function me(t){var n=ye(t);return n.invert=ye(-t),n}function xe(t,n){function e(t,n){var e=Math.cos(n),u=Math.cos(t)*e,l=Math.sin(t)*e,s=Math.sin(n),c=s*r+u*i;return[Math.atan2(l*a-c*o,u*r-s*i),ot(c*a+l*o)]}var r=Math.cos(t),i=Math.sin(t),a=Math.cos(n),o=Math.sin(n);return e.invert=function(t,n){var e=Math.cos(n),u=Math.cos(t)*e,l=Math.sin(t)*e,s=Math.sin(n),c=s*a-l*o;return[Math.atan2(l*a+s*o,u*r+c*i),ot(c*r-u*i)]},e}function Me(t,n){var e=Math.cos(t),r=Math.sin(t);return function(i,a,o,u){var l=o*n;null!=i?(i=_e(e,i),a=_e(e,a),(o>0?ia)&&(i+=o*Ho)):(i=t+o*Ho,a=t-.5*l);for(var s,c=i;o>0?c>a:c0?n<-Yo+Io&&(n=-Yo+Io):n>Yo-Io&&(n=Yo-Io);var e=o/Math.pow(i(n),a);return[e*Math.sin(a*t),o-e*Math.cos(a*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Fo/4+t/2)},a=t===n?Math.sin(t):Math.log(r/Math.cos(n))/Math.log(i(n)/i(t)),o=r*Math.pow(i(t),a)/a;return a?(e.invert=function(t,n){var e=o-n,r=rt(a)*Math.sqrt(t*t+e*e);return[Math.atan2(t,e)/a,2*Math.atan(Math.pow(o/r,1/a))-Yo]},e):Te}function Ae(t,n){function e(t,n){var e=a-n;return[e*Math.sin(i*t),a-e*Math.cos(i*t)]}var r=Math.cos(t),i=t===n?Math.sin(t):(r-Math.cos(n))/(n-t),a=r/i+t;return wo(i)1&&it(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function Re(t,n){return t[0]-n[0]||t[1]-n[1]}function $e(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function Oe(t,n,e,r){var i=t[0],a=e[0],o=n[0]-i,u=r[0]-a,l=t[1],s=e[1],c=n[1]-l,f=r[1]-s,h=(u*(l-s)-f*(i-a))/(f*o-u*c);return[i+h*o,l+h*c]}function Ie(t){var n=t[0],e=t[t.length-1];return!(n[0]-e[0]||n[1]-e[1])}function Ue(){lr(this),this.edge=this.site=this.circle=null}function Fe(t){var n=cl.pop()||new Ue;return n.site=t,n}function He(t){Qe(t),ul.remove(t),cl.push(t),lr(t)}function Ve(t){var n=t.circle,e=n.x,r=n.cy,i={x:e,y:r},a=t.P,o=t.N,u=[t];He(t);for(var l=a;l.circle&&wo(e-l.circle.x)Io)u=u.L;else{if(!((i=a-Ze(u,o))>Io)){r>-Io?(n=u.P,e=u):i>-Io?(n=u,e=u.N):n=e=u;break}if(!u.R){n=u;break}u=u.R}var l=Fe(t);if(ul.insert(n,l),n||e){if(n===e)return Qe(n),e=Fe(n.site),ul.insert(l,e),l.edge=e.edge=rr(n.site,l.site),Ke(n),void Ke(e);if(!e)return void(l.edge=rr(n.site,l.site));Qe(n),Qe(e);var s=n.site,c=s.x,f=s.y,h=t.x-c,d=t.y-f,p=e.site,g=p.x-c,v=p.y-f,y=2*(h*v-d*g),m=h*h+d*d,x=g*g+v*v,M={x:(v*m-d*x)/y+c,y:(h*x-g*m)/y+f};ar(e.edge,s,p,M),l.edge=rr(s,t,null,M),e.edge=rr(t,p,null,M),Ke(n),Ke(e)}}function Ge(t,n){var e=t.site,r=e.x,i=e.y,a=i-n;if(!a)return r;var o=t.P;if(!o)return-1/0;e=o.site;var u=e.x,l=e.y,s=l-n;if(!s)return u;var c=u-r,f=1/a-1/s,h=c/s;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*s)-l+s/2+i-a/2)))/f+r:(r+u)/2}function Ze(t,n){var e=t.N;if(e)return Ge(e,n);var r=t.site;return r.y===n?r.x:1/0}function Be(t){this.site=t,this.edges=[]}function Xe(t){for(var n,e,r,i,a,o,u,l,s,c,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],g=ol,v=g.length;v--;)if((a=g[v])&&a.prepare())for(u=a.edges,l=u.length,o=0;oIo||wo(i-e)>Io)&&(u.splice(o,0,new or(ir(a.site,c,wo(r-f)Io?{x:f,y:wo(n-f)Io?{x:wo(e-p)Io?{x:h,y:wo(n-h)Io?{x:wo(e-d)=-Uo)){var d=l*l+s*s,p=c*c+f*f,g=(f*d-s*p)/h,v=(l*p-c*d)/h,f=v+u,y=fl.pop()||new We;y.arc=t,y.site=i,y.x=g+o,y.y=f+Math.sqrt(g*g+v*v),y.cy=f,t.circle=y;for(var m=null,x=sl._;x;)if(y.y=u)return;if(h>p){if(a){if(a.y>=s)return}else a={x:v,y:l};e={x:v,y:s}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=s)return}else a={x:(l-i)/r,y:l};e={x:(s-i)/r,y:s}}else{if(a){if(a.y=u)return}else a={x:o,y:r*o+i};e={x:u,y:r*u+i}}else{if(a){if(a.xa||f>o||h=M,w=e>=_,k=w<<1|b,S=k+4;ka&&(i=n.slice(a,i),u[o]?u[o]+=i:u[++o]=i),(e=e[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,l.push({i:o,x:br(e,r)})),a=pl.lastIndex;return a=0&&!(e=ho.interpolators[r](t,n)););return e}function Sr(t,n){var e,r=[],i=[],a=t.length,o=n.length,u=Math.min(t.length,n.length);for(e=0;e=1?1:t(n)}}function Er(t){return function(n){return 1-t(1-n)}}function Cr(t){return function(n){return.5*(n<.5?t(2*n):2-t(2-2*n))}}function zr(t){return t*t}function Ar(t){return t*t*t}function Tr(t){if(t<=0)return 0;if(t>=1)return 1;var n=t*t,e=n*t;return 4*(t<.5?e:3*(t-n)+e-.75)}function Lr(t){return function(n){return Math.pow(n,t)}}function qr(t){return 1-Math.cos(t*Yo)}function Pr(t){return Math.pow(2,10*(t-1))}function jr(t){return 1-Math.sqrt(1-t*t)}function Dr(t,n){var e;return arguments.length<2&&(n=.45),arguments.length?e=n/Ho*Math.asin(1/t):(t=1,e=n/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-e)*Ho/n)}}function Rr(t){return t||(t=1.70158),function(n){return n*n*((t+1)*n-t)}}function $r(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Or(t,n){t=ho.hcl(t),n=ho.hcl(n);var e=t.h,r=t.c,i=t.l,a=n.h-e,o=n.c-r,u=n.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?n.c:r),isNaN(a)?(a=0,e=isNaN(e)?n.h:e):a>180?a-=360:a<-180&&(a+=360),function(t){return gt(e+a*t,r+o*t,i+u*t)+""}}function Ir(t,n){t=ho.hsl(t),n=ho.hsl(n);var e=t.h,r=t.s,i=t.l,a=n.h-e,o=n.s-r,u=n.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?n.s:r),isNaN(a)?(a=0,e=isNaN(e)?n.h:e):a>180?a-=360:a<-180&&(a+=360),function(t){return dt(e+a*t,r+o*t,i+u*t)+""}}function Ur(t,n){t=ho.lab(t),n=ho.lab(n);var e=t.l,r=t.a,i=t.b,a=n.l-e,o=n.a-r,u=n.b-i;return function(t){return yt(e+a*t,r+o*t,i+u*t)+""}}function Fr(t,n){return n-=t,function(e){return Math.round(t+n*e)}}function Hr(t){var n=[t.a,t.b],e=[t.c,t.d],r=Yr(n),i=Vr(n,e),a=Yr(Gr(e,n,-i))||0;n[0]*e[1]180?n+=360:n-t>180&&(t+=360),r.push({i:e.push(Zr(e)+"rotate(",null,")")-2,x:br(t,n)})):n&&e.push(Zr(e)+"rotate("+n+")")}function Jr(t,n,e,r){t!==n?r.push({i:e.push(Zr(e)+"skewX(",null,")")-2,x:br(t,n)}):n&&e.push(Zr(e)+"skewX("+n+")")}function Wr(t,n,e,r){if(t[0]!==n[0]||t[1]!==n[1]){var i=e.push(Zr(e)+"scale(",null,",",null,")");r.push({i:i-4,x:br(t[0],n[0])},{i:i-2,x:br(t[1],n[1])})}else 1===n[0]&&1===n[1]||e.push(Zr(e)+"scale("+n+")")}function Kr(t,n){var e=[],r=[];return t=ho.transform(t),n=ho.transform(n),Br(t.translate,n.translate,e,r),Xr(t.rotate,n.rotate,e,r),Jr(t.skew,n.skew,e,r),Wr(t.scale,n.scale,e,r),t=n=null,function(t){for(var n,i=-1,a=r.length;++i=0;)e.push(i[r])}function fi(t,n){for(var e=[t],r=[];null!=(t=e.pop());)if(r.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++oi&&(r=e,i=n);return r}function bi(t){return t.reduce(wi,0)}function wi(t,n){return t+n[1]}function ki(t,n){return Si(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function Si(t,n){for(var e=-1,r=+t[0],i=(t[1]-r)/n,a=[];++e<=n;)a[e]=i*e+r;return a}function Ni(t){return[ho.min(t),ho.max(t)]}function Ei(t,n){return t.value-n.value}function Ci(t,n){var e=t._pack_next;t._pack_next=n,n._pack_prev=t,n._pack_next=e,e._pack_prev=n}function zi(t,n){t._pack_next=n,n._pack_prev=t}function Ai(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return.999*i*i>e*e+r*r}function Ti(t){function n(t){c=Math.min(t.x-t.r,c),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((e=t.children)&&(s=e.length)){var e,r,i,a,o,u,l,s,c=1/0,f=-1/0,h=1/0,d=-1/0;if(e.forEach(Li),r=e[0],r.x=-r.r,r.y=0,n(r),s>1&&(i=e[1],i.x=i.r,i.y=0,n(i),s>2))for(a=e[2],ji(r,i,a),n(a),Ci(r,a),r._pack_prev=a,Ci(a,i),i=r._pack_next,o=3;o=0;)n=i[a],n.z+=e,n.m+=e,e+=n.s+(r+=n.c)}function Ui(t,n,e){return t.a.parent===n.parent?t.a:e}function Fi(t){return 1+ho.max(t,function(t){return t.y})}function Hi(t){return t.reduce(function(t,n){return t+n.x},0)/t.length}function Vi(t){var n=t.children;return n&&n.length?Vi(n[0]):t}function Yi(t){var n,e=t.children;return e&&(n=e.length)?Yi(e[n-1]):t}function Gi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Zi(t,n){var e=t.x+n[3],r=t.y+n[0],i=t.dx-n[1]-n[3],a=t.dy-n[0]-n[2];return i<0&&(e+=i/2,i=0),a<0&&(r+=a/2,a=0),{x:e,y:r,dx:i,dy:a}}function Bi(t){var n=t[0],e=t[t.length-1];return n2?Qi:Ji,l=r?ti:Qr;return o=i(t,n,l,e),u=i(n,t,l,kr),a}function a(t){return o(t)}var o,u;return a.invert=function(t){return u(t)},a.domain=function(n){return arguments.length?(t=n.map(Number),i()):t},a.range=function(t){return arguments.length?(n=t,i()):n},a.rangeRound=function(t){return a.range(t).interpolate(Fr)},a.clamp=function(t){return arguments.length?(r=t,i()):r},a.interpolate=function(t){return arguments.length?(e=t,i()):e},a.ticks=function(n){return ia(t,n)},a.tickFormat=function(n,e){return aa(t,n,e)},a.nice=function(n){return ea(t,n),i()},a.copy=function(){return ta(t,n,e,r)},i()}function na(t,n){return ho.rebind(t,n,"range","rangeRound","interpolate","clamp")}function ea(t,n){return Wi(t,Ki(ra(t,n)[2])),Wi(t,Ki(ra(t,n)[2])),t}function ra(t,n){null==n&&(n=10);var e=Bi(t),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/n)/Math.LN10)),a=n/r*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function ia(t,n){return ho.range.apply(ho,ra(t,n))}function aa(t,n,e){var r=ra(t,n);if(e){var i=du.exec(e);if(i.shift(),"s"===i[8]){var a=ho.formatPrefix(Math.max(wo(r[0]),wo(r[1])));return i[7]||(i[7]="."+oa(a.scale(r[2]))),i[8]="f",e=ho.format(i.join("")),function(t){return e(a.scale(t))+a.symbol}}i[7]||(i[7]="."+ua(i[8],r)),e=i.join("")}else e=",."+oa(r[2])+"f";return ho.format(e)}function oa(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ua(t,n){var e=oa(n[2]);return t in Nl?Math.abs(e-oa(Math.max(wo(n[0]),wo(n[1]))))+ +("e"!==t):e-2*("%"===t)}function la(t,n,e,r){function i(t){return(e?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function a(t){return e?Math.pow(n,t):-Math.pow(n,-t)}function o(n){return t(i(n))}return o.invert=function(n){return a(t.invert(n))},o.domain=function(n){return arguments.length?(e=n[0]>=0,t.domain((r=n.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(n=+e,t.domain(r.map(i)),o):n},o.nice=function(){var n=Wi(r.map(i),e?Math:Cl);return t.domain(n),r=n.map(a),o},o.ticks=function(){var t=Bi(r),o=[],u=t[0],l=t[1],s=Math.floor(i(u)),c=Math.ceil(i(l)),f=n%1?2:n;if(isFinite(c-s)){if(e){for(;s0;h--)o.push(a(s)*h);for(s=0;o[s]l;c--);o=o.slice(s,c)}return o},o.tickFormat=function(t,e){if(!arguments.length)return El;arguments.length<2?e=El:"function"!=typeof e&&(e=ho.format(e));var r=Math.max(1,n*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*n0?i[e-1]:t[0],e0?0:1}function wa(t,n,e,r,i){var a=t[0]-n[0],o=t[1]-n[1],u=(i?r:-r)/Math.sqrt(a*a+o*o),l=u*o,s=-u*a,c=t[0]+l,f=t[1]+s,h=n[0]+l,d=n[1]+s,p=(c+h)/2,g=(f+d)/2,v=h-c,y=d-f,m=v*v+y*y,x=e-r,M=c*d-h*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*m-M*M)),b=(M*y-v*_)/m,w=(-M*v-y*_)/m,k=(M*y+v*_)/m,S=(-M*v+y*_)/m,N=b-p,E=w-g,C=k-p,z=S-g;return N*N+E*E>C*C+z*z&&(b=k,w=S),[[b-l,w-s],[b*e/x,w*e/x]]}function ka(t){function n(n){function o(){s.push("M",a(t(c),u))}for(var l,s=[],c=[],f=-1,h=n.length,d=Tt(e),p=Tt(r);++f1?t.join("L"):t+"Z"}function Na(t){return t.join("L")+"Z"}function Ea(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n1&&i.push("H",r[0]),i.join("")}function Ca(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n1){u=n[1],a=t[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-u[0])+","+(a[1]-u[1])+","+a[0]+","+a[1];for(var s=2;s9&&(i=3*n/Math.sqrt(i),o[u]=i*e,o[u+1]=i*r));for(u=-1;++u<=l;)i=(t[Math.min(l,u+1)][0]-t[Math.max(0,u-1)][0])/(6*(1+o[u]*o[u])),a.push([i||0,o[u]*i||0]);return a}function Va(t){return t.length<3?Sa(t):t[0]+qa(t,Ha(t))}function Ya(t){for(var n,e,r,i=-1,a=t.length;++i0;)h[--u].call(t,o);if(a>=1)return g.event&&g.event.end.call(t,t.__data__,n),--d.count?delete d[r]:delete t[e],1}var l,s,c,f,h,d=t[e]||(t[e]={active:0,count:0}),g=d[r];g||(l=i.time,s=Dt(a,0,l),g=d[r]={tween:new p,time:l,timer:s,delay:i.delay,duration:i.duration,ease:i.ease,index:n},i=null,++d.count)}function ao(t,n,e){t.attr("transform",function(t){var r=n(t);return"translate("+(isFinite(r)?r:e(t))+",0)"})}function oo(t,n,e){t.attr("transform",function(t){var r=n(t);return"translate(0,"+(isFinite(r)?r:e(t))+")"})}function uo(t){return t.toISOString()}function lo(t,n,e){function r(n){return t(n)}function i(t,e){var r=t[1]-t[0],i=r/e,a=ho.bisect(Ql,i);return a==Ql.length?[n.year,ra(t.map(function(t){return t/31536e6}),e)[2]]:a?n[i/Ql[a-1]1?{floor:function(n){for(;e(n=t.floor(n));)n=so(n-1);return n},ceil:function(n){for(;e(n=t.ceil(n));)n=so(+n+1);return n}}:t))},r.ticks=function(t,n){var e=Bi(r.domain()),a=null==t?i(e,10):"number"==typeof t?i(e,t):!t.range&&[{range:t},n];return a&&(t=a[0],n=a[1]),t.range(e[0],so(+e[1]+1),n<1?1:n)},r.tickFormat=function(){return e},r.copy=function(){return lo(t.copy(),n,e)},na(r,t)}function so(t){return new Date(t)}function co(t){return JSON.parse(t.responseText)}function fo(t){var n=vo.createRange();return n.selectNode(vo.body),n.createContextualFragment(t.responseText)}var ho={version:"3.5.17"},po=[].slice,go=function(t){return po.call(t)},vo=this.document;if(vo)try{go(vo.documentElement.childNodes)[0].nodeType}catch(t){go=function(t){for(var n=t.length,e=new Array(n);n--;)e[n]=t[n];return e}}if(Date.now||(Date.now=function(){return+new Date}),vo)try{vo.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var yo=this.Element.prototype,mo=yo.setAttribute,xo=yo.setAttributeNS,Mo=this.CSSStyleDeclaration.prototype,_o=Mo.setProperty;yo.setAttribute=function(t,n){mo.call(this,t,n+"")},yo.setAttributeNS=function(t,n,e){xo.call(this,t,n,e+"")},Mo.setProperty=function(t,n,e){_o.call(this,t,n+"",e)}}ho.ascending=u,ho.descending=function(t,n){return nt?1:n>=t?0:NaN},ho.min=function(t,n){var e,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},ho.max=function(t,n){var e,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},ho.extent=function(t,n){var e,r,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=r){e=i=r;break}for(;++ar&&(e=r),i=r){e=i=r;break}for(;++ar&&(e=r),i1)return o/(c-1)},ho.deviation=function(){var t=ho.variance.apply(this,arguments);return t?Math.sqrt(t):t};var bo=c(u);ho.bisectLeft=bo.left,ho.bisect=ho.bisectRight=bo.right,ho.bisector=function(t){return c(1===t.length?function(n,e){return u(t(n),e)}:t)},ho.shuffle=function(t,n,e){(a=arguments.length)<3&&(e=t.length,a<2&&(n=0));for(var r,i,a=e-n;a;)i=Math.random()*a--|0,r=t[a+n],t[a+n]=t[i+n],t[i+n]=r;return t},ho.permute=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},ho.pairs=function(t){for(var n=0,e=t.length-1,r=t[0],i=new Array(e<0?0:e);n=0;)for(r=t[i],n=r.length;--n>=0;)e[--o]=r[n];return e};var wo=Math.abs;ho.range=function(t,n,e){if(arguments.length<3&&(e=1,arguments.length<2&&(n=t,t=0)),(n-t)/e==1/0)throw new Error("infinite range");var r,i=[],a=h(wo(e)),o=-1;if(t*=a,n*=a,e*=a,e<0)for(;(r=t+e*++o)>n;)i.push(r/a);else for(;(r=t+e*++o)=a.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,s,c,f,h=-1,d=o.length,g=a[u++],v=new p;++h=a.length)return t;var r=[],i=o[e++];return t.forEach(function(t,i){r.push({key:t,values:n(i,e)})}),i?r.sort(function(t,n){return i(t.key,n.key)}):r}var e,r,i={},a=[],o=[];return i.map=function(n,e){return t(e,n,0)},i.entries=function(e){return n(t(ho.map,e,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return e=t,i},i.rollup=function(t){return r=t,i},i},ho.set=function(t){var n=new b;if(t)for(var e=0,r=t.length;e=0&&(r=t.slice(e+1),t=t.slice(0,e)),t)return arguments.length<2?this[t].on(r):this[t].on(r,n);if(2===arguments.length){if(null==n)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},ho.event=null,ho.requote=function(t){return t.replace(Eo,"\\$&")};var Eo=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Co={}.__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]},zo=function(t,n){return n.querySelector(t)},Ao=function(t,n){return n.querySelectorAll(t)},To=function(t,n){var e=t.matches||t[S(t,"matchesSelector")];return(To=function(t,n){return e.call(t,n)})(t,n)};"function"==typeof Sizzle&&(zo=function(t,n){return Sizzle(t,n)[0]||null},Ao=Sizzle,To=Sizzle.matchesSelector),ho.selection=function(){return ho.select(vo.documentElement)};var Lo=ho.selection.prototype=[];Lo.select=function(t){var n,e,r,i,a=[];t=q(t);for(var o=-1,u=this.length;++o=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Po.hasOwnProperty(e)?{space:Po[e],local:t}:t}},Lo.attr=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node();return t=ho.ns.qualify(t),t.local?e.getAttributeNS(t.space,t.local):e.getAttribute(t)}for(n in t)this.each(j(n,t[n]));return this}return this.each(j(t,n))},Lo.classed=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node(),r=(t=$(t)).length,i=-1;if(n=e.classList){for(;++i=0;)(e=r[i])&&(a&&a!==e.nextSibling&&a.parentNode.insertBefore(e,a),a=e);return this},Lo.sort=function(t){t=Z.apply(this,arguments);for(var n=-1,e=this.length;++n0&&(n=n.transition().duration(E)),n.call(t.event)}function u(){_&&_.domain(M.range().map(function(t){return(t-k.x)/k.k}).map(M.invert)),w&&w.domain(b.range().map(function(t){return(t-k.y)/k.k}).map(b.invert))}function l(t){C++||t({type:"zoomstart"})}function s(t){u(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--C||(t({type:"zoomend"}),v=null)}function f(){function t(){u=1,i(ho.mouse(r),h),s(a)}function e(){f.on(L,null).on(q,null),d(u),c(a)}var r=this,a=j.of(r,arguments),u=0,f=ho.select(o(r)).on(L,t).on(q,e),h=n(ho.mouse(r)),d=tt(r);Hl.call(r),l(a)}function h(){function t(){var t=ho.touches(p);return d=k.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=n(t))}),t}function e(){var n=ho.event.target;ho.select(n).on(M,o).on(_,u),b.push(n);for(var e=ho.event.changedTouches,r=0,i=e.length;r1){var c=l[0],f=l[1],h=c[0]-f[0],d=c[1]-f[1];y=h*h+d*d}}function o(){var t,n,e,a,o=ho.touches(p);Hl.call(p);for(var u=0,l=o.length;u=s)return o;if(i)return i=!1,a;var n=c;if(34===t.charCodeAt(n)){for(var e=n;e++=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pu=ho.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,n){return t.toPrecision(n)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},r:function(t,n){return(t=ho.round(t,It(t,n))).toFixed(Math.max(0,Math.min(20,It(t*(1+1e-15),n))))}}),gu=ho.time={},vu=Date;Vt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){yu.setUTCDate.apply(this._,arguments)},setDay:function(){yu.setUTCDay.apply(this._,arguments)},setFullYear:function(){yu.setUTCFullYear.apply(this._,arguments)},setHours:function(){yu.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){yu.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){yu.setUTCMinutes.apply(this._,arguments)},setMonth:function(){yu.setUTCMonth.apply(this._,arguments)},setSeconds:function(){yu.setUTCSeconds.apply(this._,arguments)},setTime:function(){yu.setTime.apply(this._,arguments)}};var yu=Date.prototype;gu.year=Yt(function(t){return t=gu.day(t),t.setMonth(0,1),t},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),gu.years=gu.year.range,gu.years.utc=gu.year.utc.range,gu.day=Yt(function(t){var n=new vu(2e3,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n},function(t,n){t.setDate(t.getDate()+n)},function(t){return t.getDate()-1}),gu.days=gu.day.range,gu.days.utc=gu.day.utc.range,gu.dayOfYear=function(t){var n=gu.year(t);return Math.floor((t-n-6e4*(t.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,n){n=7-n;var e=gu[t]=Yt(function(t){return(t=gu.day(t)).setDate(t.getDate()-(t.getDay()+n)%7),t},function(t,n){t.setDate(t.getDate()+7*Math.floor(n))},function(t){var e=gu.year(t).getDay();return Math.floor((gu.dayOfYear(t)+(e+n)%7)/7)-(e!==n)});gu[t+"s"]=e.range,gu[t+"s"].utc=e.utc.range,gu[t+"OfYear"]=function(t){var e=gu.year(t).getDay();return Math.floor((gu.dayOfYear(t)+(e+n)%7)/7)}}),gu.week=gu.sunday,gu.weeks=gu.sunday.range,gu.weeks.utc=gu.sunday.utc.range,gu.weekOfYear=gu.sundayOfYear;var mu={"-":"",_:" ",0:"0"},xu=/^\s*\d+/,Mu=/^%/;ho.locale=function(t){return{numberFormat:Ft(t),timeFormat:Zt(t)}};var _u=ho.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ho.format=_u.numberFormat,ho.geo={},gn.prototype={s:0,t:0,add:function(t){vn(t,this.t,bu),vn(bu.s,this.s,this),this.s?this.t+=bu.t:this.s=bu.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var bu=new gn;ho.geo.stream=function(t,n){t&&wu.hasOwnProperty(t.type)?wu[t.type](t,n):yn(t,n)};var wu={Feature:function(t,n){yn(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++rd&&(d=n)}function n(n,e){var r=_n([n*Go,e*Go]);if(y){var i=wn(y,r),a=[i[1],-i[0],0],o=wn(a,i);Nn(o),o=En(o);var l=n-p,s=l>0?1:-1,g=o[0]*Zo*s,v=wo(l)>180;if(v^(s*pd&&(d=m)}else if(g=(g+360)%360-180,v^(s*pd&&(d=e);v?nu(c,h)&&(h=n):u(n,h)>u(c,h)&&(c=n):h>=c?(nh&&(h=n)):n>p?u(c,n)>u(c,h)&&(h=n):u(n,h)>u(c,h)&&(c=n)}else t(n,e);y=r,p=n}function e(){_.point=n}function r(){M[0]=c,M[1]=h,_.point=t,y=null}function i(t,e){if(y){var r=t-p;m+=wo(r)>180?r+(r>0?360:-360):r}else g=t,v=e;Eu.point(t,e),n(t,e)}function a(){Eu.lineStart()}function o(){i(g,v),Eu.lineEnd(),wo(m)>Io&&(c=-(h=180)),M[0]=c,M[1]=h,y=null}function u(t,n){return(n-=t)<0?n+360:n}function l(t,n){return t[0]-n[0]}function s(t,n){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:tIo?d=90:m<-Io&&(f=-90),M[0]=c,M[1]=h}};return function(t){d=h=-(c=f=1/0),x=[],ho.geo.stream(t,_);var n=x.length;if(n){x.sort(l);for(var e,r=1,i=x[0],a=[i];ru(i[0],i[1])&&(i[1]=e[1]),u(e[0],i[1])>u(i[0],i[1])&&(i[0]=e[0])):a.push(i=e);for(var o,e,p=-1/0,n=a.length-1,r=0,i=a[n];r<=n;i=e,++r)e=a[r],(o=u(i[1],e[0]))>p&&(p=o,c=e[0],h=i[1])}return x=M=null,c===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,f],[h,d]]}}(),ho.geo.centroid=function(t){Cu=zu=Au=Tu=Lu=qu=Pu=ju=Du=Ru=$u=0,ho.geo.stream(t,Ou);var n=Du,e=Ru,r=$u,i=n*n+e*e+r*r;return i=.12&&i<.234&&r>=-.425&&r<-.214?o:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},t.stream=function(t){var n=a.stream(t),e=o.stream(t),r=u.stream(t);return{point:function(t,i){n.point(t,i),e.point(t,i),r.point(t,i)},sphere:function(){n.sphere(),e.sphere(),r.sphere()},lineStart:function(){n.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){n.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){n.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){n.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},t.precision=function(n){return arguments.length?(a.precision(n),o.precision(n),u.precision(n),t):a.precision()},t.scale=function(n){return arguments.length?(a.scale(n),o.scale(.35*n),u.scale(n),t.translate(a.translate())):a.scale()},t.translate=function(n){if(!arguments.length)return a.translate();var s=a.scale(),c=+n[0],f=+n[1];return e=a.translate(n).clipExtent([[c-.455*s,f-.238*s],[c+.455*s,f+.238*s]]).stream(l).point,r=o.translate([c-.307*s,f+.201*s]).clipExtent([[c-.425*s+Io,f+.12*s+Io],[c-.214*s-Io,f+.234*s-Io]]).stream(l).point,i=u.translate([c-.205*s,f+.212*s]).clipExtent([[c-.214*s+Io,f+.166*s+Io],[c-.115*s-Io,f+.234*s-Io]]).stream(l).point,t},t.scale(1070)};var Fu,Hu,Vu,Yu,Gu,Zu,Bu={point:N,lineStart:N,lineEnd:N,polygonStart:function(){Hu=0,Bu.lineStart=Kn},polygonEnd:function(){Bu.lineStart=Bu.lineEnd=Bu.point=N,Fu+=wo(Hu/2)}},Xu={point:Qn,lineStart:N,lineEnd:N,polygonStart:N,polygonEnd:N},Ju={point:ee,lineStart:re,lineEnd:ie,polygonStart:function(){Ju.lineStart=ae},polygonEnd:function(){Ju.point=ee,Ju.lineStart=re,Ju.lineEnd=ie}};ho.geo.path=function(){function t(t){return t&&("function"==typeof u&&a.pointRadius(+u.apply(this,arguments)),o&&o.valid||(o=i(a)),ho.geo.stream(t,o)),a.result()}function n(){return o=null,t}var e,r,i,a,o,u=4.5;return t.area=function(t){return Fu=0,ho.geo.stream(t,i(Bu)),Fu},t.centroid=function(t){return Au=Tu=Lu=qu=Pu=ju=Du=Ru=$u=0,ho.geo.stream(t,i(Ju)),$u?[Du/$u,Ru/$u]:ju?[qu/ju,Pu/ju]:Lu?[Au/Lu,Tu/Lu]:[NaN,NaN]},t.bounds=function(t){return Gu=Zu=-(Vu=Yu=1/0),ho.geo.stream(t,i(Xu)),[[Vu,Yu],[Gu,Zu]]},t.projection=function(t){return arguments.length?(i=(e=t)?t.stream||le(t):w,n()):e},t.context=function(t){return arguments.length?(a=null==(r=t)?new te:new oe(t),"function"!=typeof u&&a.pointRadius(u),n()):r},t.pointRadius=function(n){return arguments.length?(u="function"==typeof n?n:(a.pointRadius(+n),+n),t):u},t.projection(ho.geo.albersUsa()).context(null)},ho.geo.transform=function(t){return{stream:function(n){var e=new se(n);for(var r in t)e[r]=t[r];return e}}},se.prototype={point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ho.geo.projection=fe,ho.geo.projectionMutator=he,(ho.geo.equirectangular=function(){return fe(pe)}).raw=pe.invert=pe,ho.geo.rotation=function(t){function n(n){return n=t(n[0]*Go,n[1]*Go),n[0]*=Zo,n[1]*=Zo,n}return t=ve(t[0]%360*Go,t[1]*Go,t.length>2?t[2]*Go:0),n.invert=function(n){return n=t.invert(n[0]*Go,n[1]*Go),n[0]*=Zo,n[1]*=Zo,n},n},ge.invert=pe,ho.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,n=ve(-t[0]*Go,-t[1]*Go,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Zo,t[1]*=Zo}}),{type:"Polygon",coordinates:[i]}}var n,e,r=[0,0],i=6;return t.origin=function(n){return arguments.length?(r=n,t):r},t.angle=function(r){return arguments.length?(e=Me((n=+r)*Go,i*Go),t):n},t.precision=function(r){return arguments.length?(e=Me(n*Go,(i=+r)*Go),t):i},t.angle(90)},ho.geo.distance=function(t,n){var e,r=(n[0]-t[0])*Go,i=t[1]*Go,a=n[1]*Go,o=Math.sin(r),u=Math.cos(r),l=Math.sin(i),s=Math.cos(i),c=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((e=f*o)*e+(e=s*c-l*f*u)*e),l*c+s*f*u)},ho.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return ho.range(Math.ceil(a/v)*v,i,v).map(h).concat(ho.range(Math.ceil(s/y)*y,l,y).map(d)).concat(ho.range(Math.ceil(r/p)*p,e,p).filter(function(t){return wo(t%v)>Io}).map(c)).concat(ho.range(Math.ceil(u/g)*g,o,g).filter(function(t){return wo(t%y)>Io}).map(f))}var e,r,i,a,o,u,l,s,c,f,h,d,p=10,g=p,v=90,y=360,m=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(s).reverse().slice(1))]}},t.extent=function(n){return arguments.length?t.majorExtent(n).minorExtent(n):t.minorExtent()},t.majorExtent=function(n){return arguments.length?(a=+n[0][0],i=+n[1][0],s=+n[0][1],l=+n[1][1],a>i&&(n=a,a=i,i=n),s>l&&(n=s,s=l,l=n),t.precision(m)):[[a,s],[i,l]]},t.minorExtent=function(n){return arguments.length?(r=+n[0][0],e=+n[1][0],u=+n[0][1],o=+n[1][1],r>e&&(n=r,r=e,e=n),u>o&&(n=u,u=o,o=n),t.precision(m)):[[r,u],[e,o]]},t.step=function(n){return arguments.length?t.majorStep(n).minorStep(n):t.minorStep()},t.majorStep=function(n){return arguments.length?(v=+n[0],y=+n[1],t):[v,y]},t.minorStep=function(n){return arguments.length?(p=+n[0],g=+n[1],t):[p,g]},t.precision=function(n){return arguments.length?(m=+n,c=be(u,o,90),f=we(r,e,m),h=be(s,l,90),d=we(a,i,m),t):m},t.majorExtent([[-180,-90+Io],[180,90-Io]]).minorExtent([[-180,-80-Io],[180,80+Io]])},ho.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[n||r.apply(this,arguments),e||i.apply(this,arguments)]}}var n,e,r=ke,i=Se;return t.distance=function(){return ho.geo.distance(n||r.apply(this,arguments),e||i.apply(this,arguments))},t.source=function(e){return arguments.length?(r=e,n="function"==typeof e?null:e,t):r},t.target=function(n){return arguments.length?(i=n,e="function"==typeof n?null:n,t):i},t.precision=function(){return arguments.length?t:0},t},ho.geo.interpolate=function(t,n){return Ne(t[0]*Go,t[1]*Go,n[0]*Go,n[1]*Go)},ho.geo.length=function(t){return Wu=0,ho.geo.stream(t,Ku),Wu};var Wu,Ku={sphere:N,point:N,lineStart:Ee,lineEnd:N,polygonStart:N,polygonEnd:N},Qu=Ce(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ho.geo.azimuthalEqualArea=function(){return fe(Qu)}).raw=Qu;var tl=Ce(function(t){var n=Math.acos(t);return n&&n/Math.sin(n)},w);(ho.geo.azimuthalEquidistant=function(){return fe(tl)}).raw=tl,(ho.geo.conicConformal=function(){return Jn(ze)}).raw=ze,(ho.geo.conicEquidistant=function(){return Jn(Ae)}).raw=Ae;var nl=Ce(function(t){return 1/t},Math.atan);(ho.geo.gnomonic=function(){return fe(nl)}).raw=nl,Te.invert=function(t,n){return[t,2*Math.atan(Math.exp(n))-Yo]},(ho.geo.mercator=function(){return Le(Te)}).raw=Te;var el=Ce(function(){return 1},Math.asin);(ho.geo.orthographic=function(){return fe(el)}).raw=el;var rl=Ce(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ho.geo.stereographic=function(){return fe(rl)}).raw=rl,qe.invert=function(t,n){return[-n,2*Math.atan(Math.exp(t))-Yo]},(ho.geo.transverseMercator=function(){var t=Le(qe),n=t.center,e=t.rotate;return t.center=function(t){return t?n([-t[1],t[0]]):(t=n(),[t[1],-t[0]])},t.rotate=function(t){return t?e([t[0],t[1],t.length>2?t[2]+90:90]):(t=e(),[t[0],t[1],t[2]-90])},e([0,0,90])}).raw=qe,ho.geom={},ho.geom.hull=function(t){function n(t){if(t.length<3)return[];var n,i=Tt(e),a=Tt(r),o=t.length,u=[],l=[];for(n=0;n=0;--n)d.push(t[u[s[n]][2]]);for(n=+f;n=r&&s.x<=a&&s.y>=i&&s.y<=o?[[r,o],[a,o],[a,i],[r,i]]:[]).point=t[u]}),n}function e(t){return t.map(function(t,n){return{x:Math.round(a(t,n)/Io)*Io,y:Math.round(o(t,n)/Io)*Io,i:n}})}var r=Pe,i=je,a=r,o=i,u=hl;return t?n(t):(n.links=function(t){return hr(e(t)).edges.filter(function(t){return t.l&&t.r}).map(function(n){return{source:t[n.l.i],target:t[n.r.i]}})},n.triangles=function(t){var n=[];return hr(e(t)).cells.forEach(function(e,r){for(var i,a=e.site,o=e.edges.sort(Je),u=-1,l=o.length,s=o[l-1].edge,c=s.l===a?s.r:s.l;++u=s,h=r>=c,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=yr()),f?i=s:u=s,h?o=c:l=c,a(t,n,e,r,i,o,u,l)}var c,f,h,d,p,g,v,y,m,x=Tt(u),M=Tt(l);if(null!=n)g=n,v=e,y=r,m=i;else if(y=m=-(g=v=1/0),f=[],h=[],p=t.length,o)for(d=0;dy&&(y=c.x),c.y>m&&(m=c.y),f.push(c.x),h.push(c.y);else for(d=0;dy&&(y=_),b>m&&(m=b),f.push(_),h.push(b)}var w=y-g,k=m-v;w>k?m=v+w:y=g+k;var S=yr();if(S.add=function(t){a(S,t,+x(t,++d),+M(t,d),g,v,y,m)},S.visit=function(t){mr(t,S,g,v,y,m)},S.find=function(t){return xr(S,t[0],t[1],g,v,y,m)},d=-1,null==n){for(;++d=0?t.slice(0,n):t,r=n>=0?t.slice(n+1):"in";return e=vl.get(e)||gl,r=yl.get(r)||w,Nr(r(e.apply(null,po.call(arguments,1))))},ho.interpolateHcl=Or,ho.interpolateHsl=Ir,ho.interpolateLab=Ur,ho.interpolateRound=Fr,ho.transform=function(t){var n=vo.createElementNS(ho.ns.prefix.svg,"g");return(ho.transform=function(t){if(null!=t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate()}return new Hr(e?e.matrix:ml)})(t)},Hr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ml={a:1,b:0,c:0,d:1,e:0,f:0};ho.interpolateTransform=Kr,ho.layout={},ho.layout.bundle=function(){return function(t){for(var n=[],e=-1,r=t.length;++e0?i=t:(e.c=null,e.t=NaN,e=null,s.end({type:"end",alpha:i=0})):t>0&&(s.start({type:"start",alpha:i=t}),e=Dt(l.tick)),l):i},l.start=function(){function t(t,r){if(!e){for(e=new Array(i),l=0;l=0;)o.push(c=s[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=s}else r&&(a.value=+r.call(t,a,a.depth)||0),delete a.children;return fi(i,function(t){var e,i;n&&(e=t.children)&&e.sort(n),r&&(i=t.parent)&&(i.value+=t.value)}),u}var n=pi,e=hi,r=di;return t.sort=function(e){return arguments.length?(n=e,t):n},t.children=function(n){return arguments.length?(e=n,t):e},t.value=function(n){return arguments.length?(r=n,t):r},t.revalue=function(n){return r&&(ci(n,function(t){t.children&&(t.value=0)}),fi(n,function(n){var e;n.children||(n.value=+r.call(t,n,n.depth)||0),(e=n.parent)&&(e.value+=n.value)})),n},t},ho.layout.partition=function(){function t(n,e,r,i){var a=n.children;if(n.x=e,n.y=n.depth*i,n.dx=r,n.dy=i,a&&(o=a.length)){var o,u,l,s=-1;for(r=n.value?r/n.value:0;++su&&(u=r),o.push(r)}for(e=0;e0)for(a=-1;++a=c[0]&&u<=c[1]&&(o=l[ho.bisect(f,u,1,d)-1],o.y+=p,o.push(t[a]));return l}var n=!0,e=Number,r=Ni,i=ki;return t.value=function(n){return arguments.length?(e=n,t):e},t.range=function(n){return arguments.length?(r=Tt(n),t):r},t.bins=function(n){return arguments.length?(i="number"==typeof n?function(t){return Si(t,n)}:Tt(n),t):i},t.frequency=function(e){return arguments.length?(n=!!e,t):n},t},ho.layout.pack=function(){function t(t,a){var o=e.call(this,t,a),u=o[0],l=i[0],s=i[1],c=null==n?Math.sqrt:"function"==typeof n?n:function(){return n};if(u.x=u.y=0,fi(u,function(t){t.r=+c(t.value)}),fi(u,Ti),r){var f=r*(n?1:Math.max(2*u.r/l,2*u.r/s))/2;fi(u,function(t){t.r+=f}),fi(u,Ti),fi(u,function(t){t.r-=f})}return Pi(u,l/2,s/2,n?1:1/Math.max(2*u.r/l,2*u.r/s)),o}var n,e=ho.layout.hierarchy().sort(Ei),r=0,i=[1,1];return t.size=function(n){return arguments.length?(i=n,t):i},t.radius=function(e){return arguments.length?(n=null==e||"function"==typeof e?e:+e,t):n},t.padding=function(n){return arguments.length?(r=+n,t):r},si(t,e)},ho.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),f=c[0],h=n(f);if(fi(h,e),h.parent.m=-h.z,ci(h,r),s)ci(f,a);else{var d=f,p=f,g=f;ci(f,function(t){t.xp.x&&(p=t),t.depth>g.depth&&(g=t)});var v=u(d,p)/2-d.x,y=l[0]/(p.x+u(p,d)/2+v),m=l[1]/(g.depth||1);ci(f,function(t){t.x=(t.x+v)*y,t.y=t.depth*m})}return c}function n(t){for(var n,e={A:null,children:[t]},r=[e];null!=(n=r.pop());)for(var i,a=n.children,o=0,u=a.length;o0&&(Oi(Ui(o,t,e),t,r),s+=r,c+=r),f+=o.m,s+=i.m,h+=l.m,c+=a.m;o&&!$i(a)&&(a.t=o,a.m+=f-c),i&&!Ri(l)&&(l.t=i,l.m+=s-h,e=t)}return e}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=ho.layout.hierarchy().sort(null).value(null),u=Di,l=[1,1],s=null;return t.separation=function(n){return arguments.length?(u=n,t):u},t.size=function(n){return arguments.length?(s=null==(l=n)?a:null,t):s?null:l},t.nodeSize=function(n){return arguments.length?(s=null==(l=n)?null:a,t):s?l:null},si(t,o)},ho.layout.cluster=function(){function t(t,a){var o,u=n.call(this,t,a),l=u[0],s=0;fi(l,function(t){var n=t.children;n&&n.length?(t.x=Hi(n),t.y=Fi(n)):(t.x=o?s+=e(t,o):0,t.y=0,o=t)});var c=Vi(l),f=Yi(l),h=c.x-e(c,f)/2,d=f.x+e(f,c)/2;return fi(l,i?function(t){t.x=(t.x-l.x)*r[0],t.y=(l.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(d-h)*r[0],t.y=(1-(l.y?t.y/l.y:1))*r[1]}),u}var n=ho.layout.hierarchy().sort(null).value(null),e=Di,r=[1,1],i=!1;return t.separation=function(n){return arguments.length?(e=n,t):e},t.size=function(n){return arguments.length?(i=null==(r=n),t):i?null:r},t.nodeSize=function(n){return arguments.length?(i=null!=(r=n),t):i?r:null},si(t,n)},ho.layout.treemap=function(){function t(t,n){for(var e,r,i=-1,a=t.length;++i0;)c.push(o=h[l-1]),c.area+=o.area,"squarify"!==d||(u=r(c,g))<=p?(h.pop(),p=u):(c.area-=c.pop().area,i(c,g,s,!1),g=Math.min(s.dx,s.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,g,s,!0),c.length=c.area=0),a.forEach(n)}}function e(n){var r=n.children;if(r&&r.length){var a,o=f(n),u=r.slice(),l=[];for(t(u,o.dx*o.dy/n.value),l.area=0;a=u.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!u.length),l.length=l.area=0);r.forEach(e)}}function r(t,n){for(var e,r=t.area,i=0,a=1/0,o=-1,u=t.length;++oi&&(i=e));return r*=r,n*=n,r?Math.max(n*i*p/r,r/(n*a*p)):1/0}function i(t,n,e,r){var i,a=-1,o=t.length,u=e.x,s=e.y,c=n?l(t.area/n):0;if(n==e.dx){for((r||c>e.dy)&&(c=e.dy);++ae.dx)&&(c=e.dx);++a1);return t+n*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=ho.random.normal.apply(ho,arguments);return function(){return Math.exp(t())}},bates:function(t){var n=ho.random.irwinHall(t);return function(){return n()/t}},irwinHall:function(t){return function(){for(var n=0,e=0;ef?0:1;if(s=Vo)return n(s,d)+(t?n(t,1-d):"")+"Z";var p,g,v,y,m,x,M,_,b,w,k,S,N=0,E=0,C=[];if((y=(+l.apply(this,arguments)||0)/2)&&(v=a===ql?Math.sqrt(t*t+s*s):+a.apply(this,arguments),d||(E*=-1),s&&(E=ot(v/s*Math.sin(y))),t&&(N=ot(v/t*Math.sin(y)))),s){m=s*Math.cos(c+E),x=s*Math.sin(c+E),M=s*Math.cos(f-E),_=s*Math.sin(f-E);var z=Math.abs(f-c-2*E)<=Fo?0:1;if(E&&ba(m,x,M,_)===d^z){var A=(c+f)/2;m=s*Math.cos(A),x=s*Math.sin(A),M=_=null}}else m=x=0;if(t){b=t*Math.cos(f-N),w=t*Math.sin(f-N),k=t*Math.cos(c+N),S=t*Math.sin(c+N);var T=Math.abs(c-f+2*N)<=Fo?0:1;if(N&&ba(b,w,k,S)===1-d^T){var L=(c+f)/2;b=t*Math.cos(L),w=t*Math.sin(L),k=S=null}}else b=w=0;if(h>Io&&(p=Math.min(Math.abs(s-t)/2,+i.apply(this,arguments)))>.001){g=tFo)+",1 "+n}function i(t,n,e,r){return"Q 0,0 "+r}var a=ke,o=Se,u=Za,l=xa,s=Ma;return t.radius=function(n){return arguments.length?(u=Tt(n),t):u},t.source=function(n){return arguments.length?(a=Tt(n),t):a},t.target=function(n){return arguments.length?(o=Tt(n),t):o},t.startAngle=function(n){return arguments.length?(l=Tt(n),t):l},t.endAngle=function(n){return arguments.length?(s=Tt(n),t):s},t},ho.svg.diagonal=function(){function t(t,i){var a=n.call(this,t,i),o=e.call(this,t,i),u=(a.y+o.y)/2,l=[a,{x:a.x,y:u},{x:o.x,y:u},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var n=ke,e=Se,r=Ba;return t.source=function(e){return arguments.length?(n=Tt(e),t):n},t.target=function(n){return arguments.length?(e=Tt(n),t):e},t.projection=function(n){return arguments.length?(r=n,t):r},t},ho.svg.diagonal.radial=function(){var t=ho.svg.diagonal(),n=Ba,e=t.projection;return t.projection=function(t){return arguments.length?e(Xa(n=t)):n},t},ho.svg.symbol=function(){function t(t,r){return($l.get(n.call(this,t,r))||Ka)(e.call(this,t,r))}var n=Wa,e=Ja;return t.type=function(e){return arguments.length?(n=Tt(e),t):n},t.size=function(n){return arguments.length?(e=Tt(n),t):e},t};var $l=ho.map({circle:Ka,cross:function(t){var n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t){var n=Math.sqrt(t/(2*Il)),e=n*Il;return"M0,"+-n+"L"+e+",0 0,"+n+" "+-e+",0Z"},square:function(t){var n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t){var n=Math.sqrt(t/Ol),e=n*Ol/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/Ol),e=n*Ol/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});ho.svg.symbolTypes=$l.keys();var Ol=Math.sqrt(3),Il=Math.tan(30*Go);Lo.transition=function(t){for(var n,e,r=Ul||++Yl,i=ro(t),a=[],o=Fl||{time:Date.now(),ease:Tr,delay:0,duration:250},u=-1,l=this.length;++urect,.s>rect").attr("width",f[1]-f[0])}function r(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==ho.event.keyCode&&(C||(x=null,T[0]-=f[1],T[1]-=h[1],C=2),z())}function g(){32==ho.event.keyCode&&2==C&&(T[0]+=f[1],T[1]+=h[1],C=0,z())}function v(){var t=ho.mouse(_),i=!1;M&&(t[0]+=M[0],t[1]+=M[1]),C||(ho.event.altKey?(x||(x=[(f[0]+f[1])/2,(h[0]+h[1])/2]),T[0]=f[+(t[0]").addClass("charts-client").append(t("

").addClass("charts-buttons")).append(t("
").addClass("charts-center")).append(t("
").addClass("charts-right"))),this.$center=this.$(".charts-center"),this.$right=this.$(".charts-right"),this.$buttons=this.$(".charts-buttons"),this.chart=new f.default({},n),this.chart.plugin=n.visualization_plugin,this.chart.plugin.specs=this.chart.plugin.specs||{},this.chart_load=n.chart_load,this.message=new s.default.Message,this.deferred=new a.default,this.viewer=new g.default(this),this.editor=new d.default(this),this.menu=new y.default(this),this.$center.append(this.viewer.$el),this.$right.append(this.message.$el).append(this.editor.$el),this.$buttons.append(this.menu.$el),t.ajax({url:Galaxy.root+"api/datasets/"+n.dataset_id}).done(function(t){e.dataset=t,e.chart.load(),e.chart.trigger("redraw")}).fail(function(t){var n=t.responseJSON&&t.responseJSON.err_msg;e.errormessage=n||"Import failed for unkown reason."})}})}).call(n,e(0))},703:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(9),i=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(r),a=e(5),o=function(t){return t&&t.__esModule?t:{default:t}}(a),u=e(704);n.default=i.Model.extend({defaults:{title:"",type:"",date:null,state:"",state_info:"",modified:!0,dataset_id:"",dataset_id_job:null},initialize:function(t,n){this.groups=new i.Collection,this.settings=new i.Model,this.visualization_id=n.visualization_id,this.visualization_name=n.visualization_name,this.dataset_id=n.dataset_id,this.chart_dict=n.chart_dict,console.debug("model::initialize() - Initialized with configuration:"),console.debug(n)},reset:function(){this.clear().set({title:"New Chart",dataset_id:this.dataset_id}),this.settings.clear(),this.groups.reset(),this.groups.add({id:o.default.uid()})},state:function(t,n){this.set({state:t,state_info:n}),this.trigger("set:state"),console.debug("model::state() - "+n+" ("+t+")")},serialize:function(){var t={attributes:this.attributes,settings:this.settings.attributes,groups:[]};return this.groups.each(function(n){t.groups.push(n.attributes)}),t},save:function(t){var n=this;t=t||{},this.chart_dict=this.serialize(),new u.Visualization({id:this.visualization_id||void 0,type:this.visualization_name,title:this.get("title")||"",config:{dataset_id:this.dataset_id,chart_dict:this.chart_dict}}).save().then(function(e){e&&e.id?(n.visualization_id=e.id,t.success&&t.success(),console.debug("model::save() - Received visualization id: "+e.id)):(t.error&&t.error(),console.debug("model::save() - Unrecognized response. Saving may have failed."))}).fail(function(n){t.error&&t.error(),console.debug("model::save() - Saving failed.")}),console.debug("model::save() - Saving with configuration.")},load:function(t){var n=t||this.chart_dict;return n&&(console.debug("model::load() - Attempting to load with configuration:"),console.debug(n)),this.reset(),n&&n.attributes?(this.set(n.attributes),this.state("ok","Loading saved visualization..."),this.settings.set(n.settings),this.groups.reset(),this.groups.add(n.groups),this.set("modified",!1),this.trigger("load"),console.debug("model::load() - Loading chart model "+n.attributes.type+"."),!0):(this.set("modified",!0),this.trigger("load"),console.debug("model::load() - Visualization attributes unavailable."),!1)}})},704:function(t,n,e){"use strict";function r(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}Object.defineProperty(n,"__esModule",{value:!0}),n.VisualizationCollection=n.Visualization=void 0;var i=e(9),a=r(i),o=e(1),u=r(o),l=n.Visualization=a.Model.extend({defaults:{config:{}},urlRoot:function(){return Galaxy.root+"api/visualizations"},initialize:function(t){u.isObject(t.config)&&u.isObject(this.defaults.config)&&u.defaults(t.config,this.defaults.config),this._setUpListeners()},_setUpListeners:function(){},set:function(t,n){if("config"===t){var e=this.get("config");u.isObject(e)&&(n=u.extend(u.clone(e),n))}return a.Model.prototype.set.call(this,t,n),this},toString:function(){var t=this.get("id")||"";return this.get("title")&&(t+=":"+this.get("title")),"Visualization("+t+")"}});n.VisualizationCollection=a.Collection.extend({model:l,url:function(){return Galaxy.root+"api/visualizations"},initialize:function(t,n){n=n||{}},set:function(t,n){var e=this;t=u.map(t,function(t){var n=e.get(t.id);if(!n)return t;var r=n.toJSON();return u.extend(r,t),r}),a.Collection.prototype.set.call(this,t,n)},toString:function(){return["VisualizationCollection(",[this.historyId,this.length].join(),")"].join("")}})},705:function(t,n,e){"use strict";(function(t,r){function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var a=e(10),o=i(a),u=e(5),l=(i(u),e(80)),s=i(l),c=e(706),f=i(c),h=e(707),d=i(h),p=e(708),g=i(p);n.default=t.View.extend({initialize:function(t,n){var e=this;this.app=t,this.chart=this.app.chart,this.description=new g.default(this.app),this.title=new o.default.Input({onchange:function(){e.chart.set("title",e.title.value())}}),this.tabs=new s.default.View({}),this.tabs.add({id:"settings",icon:"fa fa-gear",tooltip:"Change settings.",$el:r("
").append(new o.default.Label({title:"Provide a title:"}).$el).append(this.title.$el).append(r("
").addClass("ui-form-info ui-margin-bottom").html("This title will appear in the list of 'Saved Visualizations'.")).append(new d.default(this.app).$el)}),this.chart.plugin.groups&&this.tabs.add({id:"groups",icon:"fa-database",tooltip:"Select data.",$el:new f.default(this.app).$el}),this.setElement("
"),this.$el.append(this.description.$el),this.$el.append(this.tabs.$el),this.listenTo(this.chart,"load",function(){e.title.value(e.chart.get("title"))})}})}).call(n,e(2),e(0))},706:function(t,n,e){"use strict";(function(t,r,i){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var o=e(5),u=a(o),l=e(10),s=(a(l),e(26)),c=a(s),f=e(233),h=a(f),d=e(188),p=a(d),g=t.View.extend({initialize:function(t,n){var e=this;this.deferred=t.deferred,this.chart=t.chart,this.group=n.group,this.setElement(r("
")),this.listenTo(this.chart,"change:dataset_id",function(){e.render()}),this.render()},render:function(){var t=this,n=u.default.clone(this.chart.plugin.groups)||[],e=this.chart.get("dataset_id");e&&(this.chart.state("wait","Loading metadata..."),this.deferred.execute(function(r){u.default.get({url:Galaxy.root+"api/datasets/"+e,cache:!0,success:function(e){var i={};p.default.visitInputs(n,function(n,r){if("data_column"==n.type){i[r]=u.default.clone(n);var a=[];n.is_auto&&a.push({label:"Column: Row Number",value:"auto"}),n.is_zero&&a.push({label:"Column: None",value:"zero"});var o=e.metadata_column_types;for(var l in o)(-1!=["int","float"].indexOf(o[l])&&n.is_numeric||n.is_label)&&a.push({label:"Column: "+(parseInt(l)+1),value:l});n.data=a}var s=t.group.get(r);void 0===s||n.hidden||(n.value=s)}),n.push({name:"__data_columns",type:"hidden",hidden:!0,value:i}),t.chart.state("ok","Metadata initialized..."),t.form=new c.default({inputs:n,cls:"ui-portlet-plain",onchange:function(){t.group.set(t.form.data.create()),t.chart.set("modified",!0),t.chart.trigger("redraw")}}),t.group.set(t.form.data.create()),t.$el.empty().append(t.form.$el),r.resolve(),t.chart.trigger("redraw")}})}))}});n.default=t.View.extend({initialize:function(t){var n=this;this.app=t,this.chart=t.chart,this.repeat=new h.default.View({title:"Data series",title_new:"Data series",min:1,onnew:function(){n.chart.groups.add({id:u.default.uid()})}}),this.setElement(r("
").append(this.repeat.$el)),this.listenTo(this.chart.groups,"remove",function(t){n.repeat.del(t.id),n.chart.trigger("redraw")}),this.listenTo(this.chart.groups,"reset",function(){n.repeat.delAll()}),this.listenTo(this.chart.groups,"add",function(t){n.repeat.add({id:t.id,cls:"ui-portlet-panel",$el:new g(n.app,{group:t}).$el,ondel:function(){n.chart.groups.remove(t)}})})},render:function(){i.size(this.chart.plugin.groups)>0?this.repeat.$el.show():this.repeat.$el.hide()}})}).call(n,e(2),e(0),e(1))},707:function(t,n,e){"use strict";(function(t,r){function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var a=e(5),o=i(a),u=e(26),l=i(u),s=e(188),c=i(s);n.default=t.View.extend({initialize:function(t,n){var e=this;this.chart=t.chart,this.setElement("
"),this.listenTo(this.chart,"load",function(){e.render()})},render:function(){var t=this,n=o.default.clone(this.chart.plugin.settings)||[],e=this.chart.plugin.specs.use_panels;"optional"==e?n.push({name:"__use_panels",type:"boolean",label:"Use multi-panels",help:"Would you like to separate your data into individual panels?"}):this.chart.settings.set("__use_panels","yes"==e?"true":"false"),this.$el.empty().addClass("ui-margin-bottom"),r.size(n)>0&&(c.default.visitInputs(n,function(n,e){var r=t.chart.settings.get(e);void 0===r||n.hidden||(n.value=r)}),this.form=new l.default({inputs:n,cls:"ui-portlet-plain",onchange:function(){t.chart.settings.set(t.form.data.create()),t.chart.trigger("redraw")}}),this.chart.settings.set(this.form.data.create()),this.$el.append(this.form.$el))}})}).call(n,e(2),e(1))},708:function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0});var r=e(5),i=function(t){return t&&t.__esModule?t:{default:t}}(r);n.default=t.View.extend({initialize:function(t){this.plugin=t.chart.plugin,this.setElement(this._template()),this.$title=this.$(".charts-description-title"),this.$image=this.$(".charts-description-image"),this.$text=this.$(".charts-description-text"),this.render()},render:function(){this.plugin.logo?(this.$image.attr("src",Galaxy.root+this.plugin.logo),this.$title.html(this.plugin.html||"Unavailable"),this.$text.html(i.default.linkify(this.plugin.description||"")),this.$el.show()):this.$el.hide()},_template:function(){return'
\n \n \n \n \n \n
\n \n \n
\n
\n
\n
'}})}).call(n,e(2))},709:function(t,n,e){"use strict";(function(t,r){Object.defineProperty(n,"__esModule",{value:!0});var i=e(5),a=function(t){return t&&t.__esModule?t:{default:t}}(i);n.default=t.View.extend({initialize:function(t,n){var e=this;this.app=t,this.chart=this.app.chart,this.options=n,this.setElement(r("
").addClass("charts-viewer").append(r("
").addClass("info").append(r("").addClass("icon")).append(r("").addClass("text")))),this.$info=this.$(".info"),this.$icon=this.$(".icon"),this.$text=this.$(".text"),this._fullscreen(this.$el,20),this._createContainer("div"),this.chart.on("redraw",function(t){e.chart.get("modified")&&e.chart.plugin.specs.confirm&&!t?e.chart.state("info","Please confirm the settings before rendering the results."):e.app.deferred.execute(function(t){console.debug("viewer:redraw() - Redrawing..."),e._draw(t,e.chart)})}),this.chart.on("set:state",function(){var t=e.$(".charts-viewer-container"),n=e.$info,r=e.$icon,i=e.$text;switch(r.removeClass(),n.show(),i.html(e.chart.get("state_info")),e.chart.get("state")){case"ok":n.hide(),t.show();break;case"failed":r.addClass("icon fa fa-warning"),t.hide();break;case"info":r.addClass("icon fa fa-info"),t.hide();break;default:r.addClass("icon fa fa-spinner fa-spin"),t.show()}})},_fullscreen:function(t,n){t.css("height",r(window).height()-n),r(window).resize(function(){t.css("height",r(window).height()-n)})},_createContainer:function(t,n){t=t||"div",n=n||1,this.$(".charts-viewer-container").remove(),this.targets=[];for(var e=0;e").addClass("charts-viewer-container").width(parseInt(100/n)+"%").append(r("<"+t+" class='charts-viewer-canvas' />").attr("id",i));this.$el.append(o),this.targets.push(i)}},_draw:function(t,n){var e="true"==n.settings.get("__use_panels")?n.groups.length:1;this._createContainer(n.plugin.specs.tag,e),n.set("date",a.default.time()),n.state("wait","Please wait..."),this.app.chart_load({process:t,chart:n,dataset:this.app.dataset,targets:this.targets})}})}).call(n,e(2),e(0))},710:function(t,n,e){"use strict";(function(t){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var i=e(10),a=r(i),o=e(711),u=r(o),l=e(5);r(l);n.default=t.View.extend({initialize:function(n){var e=this;this.app=n,this.model=new t.Model({visible:!0}),this.execute_button=new a.default.ButtonIcon({icon:"fa-check-square",tooltip:"Confirm",onclick:function(){n.chart.trigger("redraw",!0)}}),this.export_button=new a.default.ButtonMenu({icon:"fa-camera",tooltip:"Export"}),this.export_button.addMenu({key:"png",title:"Save as PNG",icon:"fa-file",onclick:function(){e._wait(n.chart,function(){u.default.createPNG({$el:n.viewer.$el,title:n.chart.get("title"),error:function(t){n.message.update({message:t,status:"danger"})}})})}}),this.export_button.addMenu({key:"svg",title:"Save as SVG",icon:"fa-file-text-o",onclick:function(){e._wait(n.chart,function(){u.default.createSVG({$el:n.viewer.$el,title:n.chart.get("title"),error:function(t){n.message.update({message:t,status:"danger"})}})})}}),this.export_button.addMenu({key:"pdf",title:"Save as PDF",icon:"fa-file-o",onclick:function(){n.modal.show({title:"Send visualization data for PDF creation",body:"Galaxy does not provide integrated PDF export scripts. You may click 'Continue' to create the PDF by using a 3rd party service (https://export.highcharts.com).",buttons:{Cancel:function(){n.modal.hide()},Continue:function(){n.modal.hide(),e._wait(n.chart,function(){u.default.createPDF({$el:n.viewer.$el,title:n.chart.get("title"),error:function(t){n.message.update({message:t,status:"danger"})}})})}}})}}),this.left_button=new a.default.ButtonIcon({icon:"fa-angle-double-left",tooltip:"Show",onclick:function(){e.model.set("visible",!0),window.dispatchEvent(new Event("resize"))}}),this.right_button=new a.default.ButtonIcon({icon:"fa-angle-double-right",tooltip:"Hide",onclick:function(){e.model.set("visible",!1),window.dispatchEvent(new Event("resize"))}}),this.save_button=new a.default.ButtonIcon({icon:"fa-save",tooltip:"Save",onclick:function(){n.chart.get("title")?(n.message.update({message:"Saving '"+n.chart.get("title")+"'. It will appear in the list of 'Saved Visualizations'.",status:"success"}),n.chart.save({error:function(){n.message.update({message:"Could not save visualization.",status:"danger"})}})):n.message.update({message:"Please provide a name.",status:"danger"})}}),this.buttons=[this.left_button,this.right_button,this.execute_button,this.export_button,this.save_button],this.setElement("
");var r=!0,i=!1,o=void 0;try{for(var l,s=this.buttons[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var c=l.value;this.$el.append(c.$el)}}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}this.listenTo(this.model,"change",function(){return e.render()}),this.render()},render:function(){var t=this.model.get("visible");this.app.$el[t?"removeClass":"addClass"]("charts-fullscreen"),this.execute_button.model.set("visible",t&&!!this.app.chart.plugin.specs.confirm),this.save_button.model.set("visible",t),this.export_button.model.set("visible",t),this.right_button.model.set("visible",t),this.left_button.model.set("visible",!t);var n=this.app.chart.plugin.specs.exports||[];this.export_button.collection.each(function(t){t.set("visible",-1!==n.indexOf(t.get("key")))})},_wait:function(t,n){this.app.deferred.ready()?n():this.app.message.update({message:"Your visualization is currently being processed. Please wait and try again."})}})}).call(n,e(2))},711:function(t,n,e){"use strict";(function(t){function e(t){t.$el.find("svg").length>0?i(t):r(t.$el.find(".charts-viewer-canvas"))}function r(n){try{if(0!==n.width()&&0!==n.height()){var e=function n(e,a,o){var u=e.prop("tagName").toLowerCase(),l=e.position(),s=a+l.left+parseInt(e.css("marginLeft"),10)+parseInt(e.css("borderLeftWidth"),10)+parseInt(e.css("paddingLeft"),10),c=o+l.top+parseInt(e.css("marginTop"),10)+parseInt(e.css("borderTopWidth"),10)+parseInt(e.css("paddingTop"),10);r.width;"div"==u||"span"==u?e.children().each(function(){n(t(this),s,c)}):"canvas"==u&&i.drawImage(e[0],s,c)},r=document.createElement("canvas");r.width=n.outerWidth(!0),r.height=n.outerHeight(!0);var i=r.getContext("2d");i.save(),i.fillStyle="rgb(255,255,255)",i.fillRect(0,0,r.width,r.height),i.restore(),i.translate(0,0),i.textAlign="left",i.textBaseline="top",n.children().each(function(){e(t(this),0,0)});var a=r.toDataURL("image/png");a&&(window.location.href=a.replace("image/png","image/octet-stream"))}}catch(t){console.debug("FAILED - screenshot::_canvas2png() - "+t),options.error&&options.error("Please reduce your visualization to a single panel and try again.")}}function i(n){var e=u(n),r=document.createElement("canvas"),i=r.getContext("2d"),a=new Image,o=t('
').append(t(r));t("body").append(o),r.width=5*e.width,r.height=5*e.height,a.src="data:image/svg+xml;base64,"+btoa(e.string),a.onload=function(){i.drawImage(a,0,0,r.width,r.height),window.location.href=r.toDataURL("image/png").replace("image/png","image/octet-stream"),o.remove()}}function a(t){window.location.href="data:none/none;base64,"+btoa(u(t).string)}function o(n){var e=u(n),r={filename:"visualization",type:"application/pdf",height:e.height,width:e.width,scale:2,svg:e.string},i=t("body"),a=i.find("#viewer-form");0===a.length&&(a=t("
",{id:"viewer-form",method:"post",action:"http://export.highcharts.com/",display:"none"}),i.append(a)),a.empty();for(var o in r){var l=t("",{type:"hidden",name:o,value:r[o]});a.append(l)}try{a.submit()}catch(t){console.log(t)}}function u(n){var e=n.$el.find("svg");if(0==e.length&&n.error)return void n.error("No SVG found. This visualization type does not support SVG/PDF export.");var r=(n.$el,e.length),i=parseInt(e.first().css("height")),a=parseInt(e.first().css("width")),o=new XMLSerializer,u=t("").attr({version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:a*r,height:i}),s=0;return e.each(function(){var n=t(this).clone();l(n);var e=t('').attr("xmlns","http://www.w3.org/2000/svg");e.append(n.find("g").first()),u.append(e),s+=a}),{string:o.serializeToString(u[0]),height:i,width:a}}function l(t){for(var n in document.styleSheets){var e=document.styleSheets[n],r=e.cssRules;if(r)for(var i=0,a=r.length;in?1:t>=n?0:NaN}function l(t){return null===t?NaN:+t}function s(t){return!isNaN(t)}function c(t){return{left:function(n,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=n.length);r>>1;t(n[a],e)<0?r=a+1:i=a}return r},right:function(n,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=n.length);r>>1;t(n[a],e)>0?i=a:r=a+1}return r}}}function f(t){return t.length}function h(t){for(var n=1;t*n%1;)n*=10;return n}function d(t,n){for(var e in n)Object.defineProperty(t.prototype,e,{value:n[e],enumerable:!1})}function p(){this._=Object.create(null)}function g(t){return(t+="")===ko||t[0]===So?So+t:t}function v(t){return(t+="")[0]===So?t.slice(1):t}function y(t){return g(t)in this._}function m(t){return(t=g(t))in this._&&delete this._[t]}function x(){var t=[];for(var n in this._)t.push(v(n));return t}function M(){var t=0;for(var n in this._)++t;return t}function _(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function w(t){return t}function k(t,n,e){return function(){var r=e.apply(n,arguments);return r===n?t:r}}function S(t,n){if(n in t)return n;n=n.charAt(0).toUpperCase()+n.slice(1);for(var e=0,r=No.length;e=n&&(n=i+1);!(o=u[n])&&++n0&&(t=t.slice(0,u));var s=Do.get(t);return s&&(t=s,l=Q),u?n?i:r:n?N:a}function K(t,n){return function(e){var r=ho.event;ho.event=e,n[0]=this.__data__;try{t.apply(this,n)}finally{ho.event=r}}}function Q(t,n){var e=K(t,n);return function(t){var n=this,r=t.relatedTarget;r&&(r===n||8&r.compareDocumentPosition(n))||e.call(n,t)}}function tt(t){var n=".dragsuppress-"+ ++$o,e="click"+n,r=ho.select(o(t)).on("touchmove"+n,z).on("dragstart"+n,z).on("selectstart"+n,z);if(null==Ro&&(Ro=!("onselectstart"in t)&&S(t.style,"userSelect")),Ro){var i=a(t).style,u=i[Ro];i[Ro]="none"}return function(t){if(r.on(n,null),Ro&&(i[Ro]=u),t){var a=function(){r.on(e,null)};r.on(e,function(){z(),a()},!0),setTimeout(a,0)}}}function nt(t,n){n.changedTouches&&(n=n.changedTouches[0]);var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(Oo<0){var i=o(t);if(i.scrollX||i.scrollY){e=ho.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=e[0][0].getScreenCTM();Oo=!(a.f||a.e),e.remove()}}return Oo?(r.x=n.pageX,r.y=n.pageY):(r.x=n.clientX,r.y=n.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var u=t.getBoundingClientRect();return[n.clientX-u.left-t.clientLeft,n.clientY-u.top-t.clientTop]}function et(){return ho.event.changedTouches[0].identifier}function rt(t){return t>0?1:t<0?-1:0}function it(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])}function at(t){return t>1?0:t<-1?Fo:Math.acos(t)}function ot(t){return t>1?Yo:t<-1?-Yo:Math.asin(t)}function ut(t){return((t=Math.exp(t))-1/t)/2}function lt(t){return((t=Math.exp(t))+1/t)/2}function st(t){return((t=Math.exp(2*t))-1)/(t+1)}function ct(t){return(t=Math.sin(t/2))*t}function ft(){}function ht(t,n,e){return this instanceof ht?(this.h=+t,this.s=+n,void(this.l=+e)):arguments.length<2?t instanceof ht?new ht(t.h,t.s,t.l):Nt(""+t,Et,ht):new ht(t,n,e)}function dt(t,n,e){function r(t){return t>360?t-=360:t<0&&(t+=360),t<60?a+(o-a)*t/60:t<180?o:t<240?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*r(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,n=isNaN(n)?0:n<0?0:n>1?1:n,e=e<0?0:e>1?1:e,o=e<=.5?e*(1+n):e+n-e*n,a=2*e-o,new bt(i(t+120),i(t),i(t-120))}function pt(t,n,e){return this instanceof pt?(this.h=+t,this.c=+n,void(this.l=+e)):arguments.length<2?t instanceof pt?new pt(t.h,t.c,t.l):t instanceof vt?mt(t.l,t.a,t.b):mt((t=Ct((t=ho.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new pt(t,n,e)}function gt(t,n,e){return isNaN(t)&&(t=0),isNaN(n)&&(n=0),new vt(e,Math.cos(t*=Go)*n,Math.sin(t)*n)}function vt(t,n,e){return this instanceof vt?(this.l=+t,this.a=+n,void(this.b=+e)):arguments.length<2?t instanceof vt?new vt(t.l,t.a,t.b):t instanceof pt?gt(t.h,t.c,t.l):Ct((t=bt(t)).r,t.g,t.b):new vt(t,n,e)}function yt(t,n,e){var r=(t+16)/116,i=r+n/500,a=r-e/200;return i=xt(i)*nu,r=xt(r)*eu,a=xt(a)*ru,new bt(_t(3.2404542*i-1.5371385*r-.4985314*a),_t(-.969266*i+1.8760108*r+.041556*a),_t(.0556434*i-.2040259*r+1.0572252*a))}function mt(t,n,e){return t>0?new pt(Math.atan2(e,n)*Zo,Math.sqrt(n*n+e*e),t):new pt(NaN,NaN,t)}function xt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function Mt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function _t(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,n,e){return this instanceof bt?(this.r=~~t,this.g=~~n,void(this.b=~~e)):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):Nt(""+t,bt,dt):new bt(t,n,e)}function wt(t){return new bt(t>>16,t>>8&255,255&t)}function kt(t){return wt(t)+""}function St(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Nt(t,n,e){var r,i,a,o=0,u=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return n(At(i[0]),At(i[1]),At(i[2]))}return(a=ou.get(t))?n(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,u=240&a,u|=u>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,u=(65280&a)>>8,l=255&a)),n(o,u,l))}function Et(t,n,e){var r,i,a=Math.min(t/=255,n/=255,e/=255),o=Math.max(t,n,e),u=o-a,l=(o+a)/2;return u?(i=l<.5?u/(o+a):u/(2-o-a),r=t==o?(n-e)/u+(n0&&l<1?0:r),new ht(r,i,l)}function Ct(t,n,e){t=zt(t),n=zt(n),e=zt(e);var r=Mt((.4124564*t+.3575761*n+.1804375*e)/nu),i=Mt((.2126729*t+.7151522*n+.072175*e)/eu);return vt(116*i-16,500*(r-i),200*(i-Mt((.0193339*t+.119192*n+.9503041*e)/ru)))}function zt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function At(t){var n=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*n):n}function Tt(t){return"function"==typeof t?t:function(){return t}}function Lt(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),qt(n,e,t,r)}}function qt(t,n,e,r){function i(){var t,n=l.status;if(!n&&jt(l)||n>=200&&n<300||304===n){try{t=e.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=ho.dispatch("beforesend","progress","load","error"),u={},l=new XMLHttpRequest,s=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var n=ho.event;ho.event=t;try{o.progress.call(a,l)}finally{ho.event=n}},a.header=function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?u[t]:(null==n?delete u[t]:u[t]=n+"",a)},a.mimeType=function(t){return arguments.length?(n=null==t?null:t+"",a):n},a.responseType=function(t){return arguments.length?(s=t,a):s},a.response=function(t){return e=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(go(arguments)))}}),a.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,t,!0),null==n||"accept"in u||(u.accept=n+",*/*"),l.setRequestHeader)for(var c in u)l.setRequestHeader(c,u[c]);return null!=n&&l.overrideMimeType&&l.overrideMimeType(n),null!=s&&(l.responseType=s),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==r?null:r),a},a.abort=function(){return l.abort(),a},ho.rebind(a,o,"on"),null==r?a:a.get(Pt(r))}function Pt(t){return 1===t.length?function(n,e){t(null==n?e:null)}:t}function jt(t){var n=t.responseType;return n&&"text"!==n?t.response:t.responseText}function Dt(t,n,e){var r=arguments.length;r<2&&(n=0),r<3&&(e=Date.now());var i=e+n,a={c:t,t:i,n:null};return lu?lu.n=a:uu=a,lu=a,su||(cu=clearTimeout(cu),su=1,fu(Rt)),a}function Rt(){var t=$t(),n=Ot()-t;n>24?(isFinite(n)&&(clearTimeout(cu),cu=setTimeout(Rt,n)),su=0):(su=1,fu(Rt))}function $t(){for(var t=Date.now(),n=uu;n;)t>=n.t&&n.c(t-n.t)&&(n.c=null),n=n.n;return t}function Ot(){for(var t,n=uu,e=1/0;n;)n.c?(n.t8?function(t){return t/e}:function(t){return t*e},symbol:t}}function Ft(t){var n=t.decimal,e=t.thousands,r=t.grouping,i=t.currency,a=r&&e?function(t,n){for(var i=t.length,a=[],o=0,u=r[0],l=0;i>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),a.push(t.substring(i-=u,i+u)),!((l+=u+1)>n));)u=r[o=(o+1)%r.length];return a.reverse().join(e)}:w;return function(t){var e=du.exec(t),r=e[1]||" ",o=e[2]||">",u=e[3]||"-",l=e[4]||"",s=e[5],c=+e[6],f=e[7],h=e[8],d=e[9],p=1,g="",v="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(s||"0"===r&&"="===o)&&(s=r="0",o="="),d){case"n":f=!0,d="g";break;case"%":p=100,v="%",d="f";break;case"p":p=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+d.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(g=i[0],v=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=pu.get(d)||Ht;var x=s&&f;return function(t){var e=v;if(y&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===u?"":u;if(p<0){var l=ho.formatPrefix(t,h);t=l.scale(t),e=l.symbol+v}else t*=p;t=d(t,h);var M,_,b=t.lastIndexOf(".");if(b<0){var w=m?t.lastIndexOf("e"):-1;w<0?(M=t,_=""):(M=t.substring(0,w),_=t.substring(w))}else M=t.substring(0,b),_=n+t.substring(b+1);!s&&f&&(M=a(M,1/0));var k=g.length+M.length+_.length+(x?0:i.length),S=k"===o?S+i+t:"^"===o?S.substring(0,k>>=1)+i+t+S.substring(k):i+(x?t:S+t))+e}}}function Ht(t){return t+""}function Vt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Yt(t,n,e){function r(n){var e=t(n),r=a(e,1);return n-e1)for(;o=s)return-1;if(37===(i=n.charCodeAt(u++))){if(o=n.charAt(u++),!(a=z[o in mu?n.charAt(u++):o])||(r=a(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(t,n,e){b.lastIndex=0;var r=b.exec(n.slice(e));return r?(t.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(t,n,e){M.lastIndex=0;var r=M.exec(n.slice(e));return r?(t.w=_.get(r[0].toLowerCase()),e+r[0].length):-1}function a(t,n,e){N.lastIndex=0;var r=N.exec(n.slice(e));return r?(t.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(t,n,e){k.lastIndex=0;var r=k.exec(n.slice(e));return r?(t.m=S.get(r[0].toLowerCase()),e+r[0].length):-1}function u(t,n,r){return e(t,C.c.toString(),n,r)}function l(t,n,r){return e(t,C.x.toString(),n,r)}function s(t,n,r){return e(t,C.X.toString(),n,r)}function c(t,n,e){var r=x.get(n.slice(e,e+=2).toLowerCase());return null==r?-1:(t.p=r,e)}var f=t.dateTime,h=t.date,d=t.time,p=t.periods,g=t.days,v=t.shortDays,y=t.months,m=t.shortMonths;n.utc=function(t){function e(t){try{vu=Vt;var n=new vu;return n._=t,r(n)}finally{vu=Date}}var r=n(t);return e.parse=function(t){try{vu=Vt;var n=r.parse(t);return n&&n._}finally{vu=Date}},e.toString=r.toString,e},n.multi=n.utc.multi=pn;var x=ho.map(),M=Xt(g),_=Jt(g),b=Xt(v),w=Jt(v),k=Xt(y),S=Jt(y),N=Xt(m),E=Jt(m);p.forEach(function(t,n){x.set(t.toLowerCase(),n)});var C={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return m[t.getMonth()]},B:function(t){return y[t.getMonth()]},c:n(f),d:function(t,n){return Bt(t.getDate(),n,2)},e:function(t,n){return Bt(t.getDate(),n,2)},H:function(t,n){return Bt(t.getHours(),n,2)},I:function(t,n){return Bt(t.getHours()%12||12,n,2)},j:function(t,n){return Bt(1+gu.dayOfYear(t),n,3)},L:function(t,n){return Bt(t.getMilliseconds(),n,3)},m:function(t,n){return Bt(t.getMonth()+1,n,2)},M:function(t,n){return Bt(t.getMinutes(),n,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,n){return Bt(t.getSeconds(),n,2)},U:function(t,n){return Bt(gu.sundayOfYear(t),n,2)},w:function(t){return t.getDay()},W:function(t,n){return Bt(gu.mondayOfYear(t),n,2)},x:n(h),X:n(d),y:function(t,n){return Bt(t.getFullYear()%100,n,2)},Y:function(t,n){return Bt(t.getFullYear()%1e4,n,4)},Z:hn,"%":function(){return"%"}},z={a:r,A:i,b:a,B:o,c:u,d:on,e:on,H:ln,I:ln,j:un,L:fn,m:an,M:sn,p:c,S:cn,U:Kt,w:Wt,W:Qt,x:l,X:s,y:nn,Y:tn,Z:en,"%":dn};return n}function Bt(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3)}function an(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function on(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function un(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+3));return r?(t.j=+r[0],e+r[0].length):-1}function ln(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function sn(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function cn(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function fn(t,n,e){xu.lastIndex=0;var r=xu.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function hn(t){var n=t.getTimezoneOffset(),e=n>0?"-":"+",r=wo(n)/60|0,i=wo(n)%60;return e+Bt(r,"0",2)+Bt(i,"0",2)}function dn(t,n,e){Mu.lastIndex=0;var r=Mu.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function pn(t){for(var n=t.length,e=-1;++e=0?1:-1,u=o*e,l=Math.cos(n),s=Math.sin(n),c=a*s,f=i*l+c*Math.cos(u),h=c*o*Math.sin(u);Nu.add(Math.atan2(h,f)),r=t,i=l,a=s}var n,e,r,i,a;Eu.point=function(o,u){Eu.point=t,r=(n=o)*Go,i=Math.cos(u=(e=u)*Go/2+Fo/4),a=Math.sin(u)},Eu.lineEnd=function(){t(n,e)}}function _n(t){var n=t[0],e=t[1],r=Math.cos(e);return[r*Math.cos(n),r*Math.sin(n),Math.sin(e)]}function bn(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function wn(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function kn(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Sn(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Nn(t){var n=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function En(t){return[Math.atan2(t[1],t[0]),ot(t[2])]}function Cn(t,n){return wo(t[0]-n[0])=0;--u)i.point((f=c[u])[0],f[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Rn(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&n&&e.push(e.pop().concat(e.shift())),d.push(e.filter(In))}var d,p,g,v=n(a),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:s,polygonStart:function(){m.point=c,m.lineStart=f,m.lineEnd=h,d=[],p=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=s,d=ho.merge(d);var t=Gn(y,p);d.length?(_||(a.polygonStart(),_=!0),Dn(d,Fn,t,e,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),e(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),e(null,null,1,a),a.lineEnd(),a.polygonEnd()}},x=Un(),M=n(x),_=!1;return m}}function In(t){return t.length>1}function Un(){var t,n=[];return{lineStart:function(){n.push(t=[])},point:function(n,e){t.push([n,e])},lineEnd:N,buffer:function(){var e=n;return n=[],t=null,e},rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))}}}function Fn(t,n){return((t=t.x)[0]<0?t[1]-Yo-Io:Yo-t[1])-((n=n.x)[0]<0?n[1]-Yo-Io:Yo-n[1])}function Hn(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(a,o){var u=a>0?Fo:-Fo,l=wo(a-e);wo(l-Fo)0?Yo:-Yo),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(a,r),n=0):i!==u&&l>=Fo&&(wo(e-i)Io?Math.atan((Math.sin(n)*(a=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(n))*Math.sin(t))/(i*a*o)):(n+r)/2}function Yn(t,n,e,r){var i;if(null==t)i=e*Yo,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(wo(t[0]-n[0])>Io){var a=t[0]=0?1:-1,w=b*_,k=w>Fo,S=p*x;if(Nu.add(Math.atan2(S*b*Math.sin(w),g*M+S*Math.cos(w))),a+=k?_+b*Ho:_,k^h>=e^y>=e){var N=wn(_n(f),_n(t));Nn(N);var E=wn(i,N);Nn(E);var C=(k^_>=0?-1:1)*ot(E[2]);(r>C||r===C&&(N[0]||N[1]))&&(o+=k^_>=0?1:-1)}if(!v++)break;h=y,p=x,g=M,f=t}}return(a<-Io||aa}function e(t){var e,a,l,s,c;return{lineStart:function(){s=l=!1,c=1},point:function(f,h){var d,p=[f,h],g=n(f,h),v=o?g?0:i(f,h):g?i(f+(f<0?Fo:-Fo),h):0;if(!e&&(s=l=g)&&t.lineStart(),g!==l&&(d=r(e,p),(Cn(e,d)||Cn(p,d))&&(p[0]+=Io,p[1]+=Io,g=n(p[0],p[1]))),g!==l)c=0,g?(t.lineStart(),d=r(p,e),t.point(d[0],d[1])):(d=r(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(u&&e&&o^g){var y;v&a||!(y=r(p,e,!0))||(c=0,o?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&Cn(e,p)||t.point(p[0],p[1]),e=p,l=g,a=v},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(s&&l)<<1}}}function r(t,n,e){var r=_n(t),i=_n(n),o=[1,0,0],u=wn(r,i),l=bn(u,u),s=u[0],c=l-s*s;if(!c)return!e&&t;var f=a*l/c,h=-a*s/c,d=wn(o,u),p=Sn(o,f);kn(p,Sn(u,h));var g=d,v=bn(p,g),y=bn(g,g),m=v*v-y*(bn(p,p)-1);if(!(m<0)){var x=Math.sqrt(m),M=Sn(g,(-v-x)/y);if(kn(M,p),M=En(M),!e)return M;var _,b=t[0],w=n[0],k=t[1],S=n[1];w0^M[1]<(wo(M[0]-b)Fo^(b<=M[0]&&M[0]<=w)){var z=Sn(g,(-v+x)/y);return kn(z,p),[M,En(z)]}}}function i(n,e){var r=o?t:Fo-t,i=0;return n<-r?i|=1:n>r&&(i|=2),e<-r?i|=4:e>r&&(i|=8),i}var a=Math.cos(t),o=a>0,u=wo(a)>Io;return On(n,e,Me(t,6*Go),o?[0,-t]:[-Fo,t-Fo])}function Bn(t,n,e,r){return function(i){var a,o=i.a,u=i.b,l=o.x,s=o.y,c=u.x,f=u.y,h=0,d=1,p=c-l,g=f-s;if(a=t-l,p||!(a>0)){if(a/=p,p<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=e-l,p||!(a<0)){if(a/=p,p<0){if(a>d)return;a>h&&(h=a)}else if(p>0){if(a0)){if(a/=g,g<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=r-s,g||!(a<0)){if(a/=g,g<0){if(a>d)return;a>h&&(h=a)}else if(g>0){if(a0&&(i.a={x:l+h*p,y:s+h*g}),d<1&&(i.b={x:l+d*p,y:s+d*g}),i}}}}}}function Xn(t,n,e,r){function i(r,i){return wo(r[0]-t)0?0:3:wo(r[0]-e)0?2:1:wo(r[1]-n)0?1:0:i>0?3:2}function a(t,n){return o(t.x,n.x)}function o(t,n){var e=i(t,1),r=i(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(u){function l(t){for(var n=0,e=v.length,r=t[1],i=0;ir&&it(s,a,t)>0&&++n:a[1]<=r&&it(s,a,t)<0&&--n,s=a;return 0!==n}function s(a,u,l,s){var c=0,f=0;if(null==a||(c=i(a,l))!==(f=i(u,l))||o(a,u)<0^l>0)do{s.point(0===c||3===c?t:e,c>1?r:n)}while((c=(c+l+4)%4)!==f);else s.point(u[0],u[1])}function c(i,a){return t<=i&&i<=e&&n<=a&&a<=r}function f(t,n){c(t,n)&&u.point(t,n)}function h(){z.point=p,v&&v.push(y=[]),k=!0,w=!1,_=b=NaN}function d(){g&&(p(m,x),M&&w&&E.rejoin(),g.push(E.buffer())),z.point=f,w&&u.lineEnd()}function p(t,n){t=Math.max(-Uu,Math.min(Uu,t)),n=Math.max(-Uu,Math.min(Uu,n));var e=c(t,n);if(v&&y.push([t,n]),k)m=t,x=n,M=e,k=!1,e&&(u.lineStart(),u.point(t,n));else if(e&&w)u.point(t,n);else{var r={a:{x:_,y:b},b:{x:t,y:n}};C(r)?(w||(u.lineStart(),u.point(r.a.x,r.a.y)),u.point(r.b.x,r.b.y),e||u.lineEnd(),S=!1):e&&(u.lineStart(),u.point(t,n),S=!1)}_=t,b=n,w=e}var g,v,y,m,x,M,_,b,w,k,S,N=u,E=Un(),C=Bn(t,n,e,r),z={point:f,lineStart:h,lineEnd:d,polygonStart:function(){u=E,g=[],v=[],S=!0},polygonEnd:function(){u=N,g=ho.merge(g);var n=l([t,r]),e=S&&n,i=g.length;(e||i)&&(u.polygonStart(),e&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),i&&Dn(g,a,n,s,u),u.polygonEnd()),g=v=y=null}};return z}}function Jn(t){var n=0,e=Fo/3,r=he(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*Fo/180,e=t[1]*Fo/180):[n/Fo*180,e/Fo*180]},i}function Wn(t,n){function e(t,n){var e=Math.sqrt(a-2*i*Math.sin(n))/i;return[e*Math.sin(t*=i),o-e*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(n))/2,a=1+r*(2*i-r),o=Math.sqrt(a)/i;return e.invert=function(t,n){var e=o-n;return[Math.atan2(t,e)/i,ot((a-(t*t+e*e)*i*i)/(2*i))]},e}function Kn(){function t(t,n){Hu+=i*t-r*n,r=t,i=n}var n,e,r,i;Bu.point=function(a,o){Bu.point=t,n=r=a,e=i=o},Bu.lineEnd=function(){t(n,e)}}function Qn(t,n){tGu&&(Gu=t),nZu&&(Zu=n)}function te(){function t(t,n){o.push("M",t,",",n,a)}function n(t,n){o.push("M",t,",",n),u.point=e}function e(t,n){o.push("L",t,",",n)}function r(){u.point=t}function i(){o.push("Z")}var a=ne(4.5),o=[],u={point:t,lineStart:function(){u.point=n},lineEnd:r,polygonStart:function(){u.lineEnd=i},polygonEnd:function(){u.lineEnd=r,u.point=t},pointRadius:function(t){return a=ne(t),u},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return u}function ne(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ee(t,n){Au+=t,Tu+=n,++Lu}function re(){function t(t,r){var i=t-n,a=r-e,o=Math.sqrt(i*i+a*a);qu+=o*(n+t)/2,Pu+=o*(e+r)/2,ju+=o,ee(n=t,e=r)}var n,e;Ju.point=function(r,i){Ju.point=t,ee(n=r,e=i)}}function ie(){Ju.point=ee}function ae(){function t(t,n){var e=t-r,a=n-i,o=Math.sqrt(e*e+a*a);qu+=o*(r+t)/2,Pu+=o*(i+n)/2,ju+=o,o=i*t-r*n,Du+=o*(r+t),Ru+=o*(i+n),$u+=3*o,ee(r=t,i=n)}var n,e,r,i;Ju.point=function(a,o){Ju.point=t,ee(n=r=a,e=i=o)},Ju.lineEnd=function(){t(n,e)}}function oe(t){function n(n,e){t.moveTo(n+o,e),t.arc(n,e,o,0,Ho)}function e(n,e){t.moveTo(n,e),u.point=r}function r(n,e){t.lineTo(n,e)}function i(){u.point=n}function a(){t.closePath()}var o=4.5,u={point:n,lineStart:function(){u.point=e},lineEnd:i,polygonStart:function(){u.lineEnd=a},polygonEnd:function(){u.lineEnd=i,u.point=n},pointRadius:function(t){return o=t,u},result:N};return u}function ue(t){function n(t){return(u?r:e)(t)}function e(n){return ce(n,function(e,r){e=t(e,r),n.point(e[0],e[1])})}function r(n){function e(e,r){e=t(e,r),n.point(e[0],e[1])}function r(){x=NaN,k.point=a,n.lineStart()}function a(e,r){var a=_n([e,r]),o=t(e,r);i(x,M,m,_,b,w,x=o[0],M=o[1],m=e,_=a[0],b=a[1],w=a[2],u,n),n.point(x,M)}function o(){k.point=e,n.lineEnd()}function l(){r(),k.point=s,k.lineEnd=c}function s(t,n){a(f=t,h=n),d=x,p=M,g=_,v=b,y=w,k.point=a}function c(){i(x,M,m,_,b,w,d,p,f,g,v,y,u,n),k.lineEnd=o,o()}var f,h,d,p,g,v,y,m,x,M,_,b,w,k={point:e,lineStart:r,lineEnd:o,polygonStart:function(){n.polygonStart(),k.lineStart=l},polygonEnd:function(){n.polygonEnd(),k.lineStart=r}};return k}function i(n,e,r,u,l,s,c,f,h,d,p,g,v,y){var m=c-n,x=f-e,M=m*m+x*x;if(M>4*a&&v--){var _=u+d,b=l+p,w=s+g,k=Math.sqrt(_*_+b*b+w*w),S=Math.asin(w/=k),N=wo(wo(w)-1)a||wo((m*A+x*T)/M-.5)>.3||u*d+l*p+s*g0&&16,n):Math.sqrt(a)},n}function le(t){var n=ue(function(n,e){return t([n*Zo,e*Zo])});return function(t){return de(n(t))}}function se(t){this.stream=t}function ce(t,n){return{point:n,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function fe(t){return he(function(){return t})()}function he(t){function n(t){return t=u(t[0]*Go,t[1]*Go),[t[0]*h+l,s-t[1]*h]}function e(t){return(t=u.invert((t[0]-l)/h,(s-t[1])/h))&&[t[0]*Zo,t[1]*Zo]}function r(){u=Pn(o=ve(y,m,x),a);var t=a(g,v);return l=d-t[0]*h,s=p+t[1]*h,i()}function i(){return c&&(c.valid=!1,c=null),n}var a,o,u,l,s,c,f=ue(function(t,n){return t=a(t,n),[t[0]*h+l,s-t[1]*h]}),h=150,d=480,p=250,g=0,v=0,y=0,m=0,x=0,M=Iu,_=w,b=null,k=null;return n.stream=function(t){return c&&(c.valid=!1),c=de(M(o,f(_(t)))),c.valid=!0,c},n.clipAngle=function(t){return arguments.length?(M=null==t?(b=t,Iu):Zn((b=+t)*Go),i()):b},n.clipExtent=function(t){return arguments.length?(k=t,_=t?Xn(t[0][0],t[0][1],t[1][0],t[1][1]):w,i()):k},n.scale=function(t){return arguments.length?(h=+t,r()):h},n.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],r()):[d,p]},n.center=function(t){return arguments.length?(g=t[0]%360*Go,v=t[1]%360*Go,r()):[g*Zo,v*Zo]},n.rotate=function(t){return arguments.length?(y=t[0]%360*Go,m=t[1]%360*Go,x=t.length>2?t[2]%360*Go:0,r()):[y*Zo,m*Zo,x*Zo]},ho.rebind(n,f,"precision"),function(){return a=t.apply(this,arguments),n.invert=a.invert&&e,r()}}function de(t){return ce(t,function(n,e){t.point(n*Go,e*Go)})}function pe(t,n){return[t,n]}function ge(t,n){return[t>Fo?t-Ho:t<-Fo?t+Ho:t,n]}function ve(t,n,e){return t?n||e?Pn(me(t),xe(n,e)):me(t):n||e?xe(n,e):ge}function ye(t){return function(n,e){return n+=t,[n>Fo?n-Ho:n<-Fo?n+Ho:n,e]}}function me(t){var n=ye(t);return n.invert=ye(-t),n}function xe(t,n){function e(t,n){var e=Math.cos(n),u=Math.cos(t)*e,l=Math.sin(t)*e,s=Math.sin(n),c=s*r+u*i;return[Math.atan2(l*a-c*o,u*r-s*i),ot(c*a+l*o)]}var r=Math.cos(t),i=Math.sin(t),a=Math.cos(n),o=Math.sin(n);return e.invert=function(t,n){var e=Math.cos(n),u=Math.cos(t)*e,l=Math.sin(t)*e,s=Math.sin(n),c=s*a-l*o;return[Math.atan2(l*a+s*o,u*r+c*i),ot(c*r-u*i)]},e}function Me(t,n){var e=Math.cos(t),r=Math.sin(t);return function(i,a,o,u){var l=o*n;null!=i?(i=_e(e,i),a=_e(e,a),(o>0?ia)&&(i+=o*Ho)):(i=t+o*Ho,a=t-.5*l);for(var s,c=i;o>0?c>a:c0?n<-Yo+Io&&(n=-Yo+Io):n>Yo-Io&&(n=Yo-Io);var e=o/Math.pow(i(n),a);return[e*Math.sin(a*t),o-e*Math.cos(a*t)]}var r=Math.cos(t),i=function(t){return Math.tan(Fo/4+t/2)},a=t===n?Math.sin(t):Math.log(r/Math.cos(n))/Math.log(i(n)/i(t)),o=r*Math.pow(i(t),a)/a;return a?(e.invert=function(t,n){var e=o-n,r=rt(a)*Math.sqrt(t*t+e*e);return[Math.atan2(t,e)/a,2*Math.atan(Math.pow(o/r,1/a))-Yo]},e):Te}function Ae(t,n){function e(t,n){var e=a-n;return[e*Math.sin(i*t),a-e*Math.cos(i*t)]}var r=Math.cos(t),i=t===n?Math.sin(t):(r-Math.cos(n))/(n-t),a=r/i+t;return wo(i)1&&it(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function Re(t,n){return t[0]-n[0]||t[1]-n[1]}function $e(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function Oe(t,n,e,r){var i=t[0],a=e[0],o=n[0]-i,u=r[0]-a,l=t[1],s=e[1],c=n[1]-l,f=r[1]-s,h=(u*(l-s)-f*(i-a))/(f*o-u*c);return[i+h*o,l+h*c]}function Ie(t){var n=t[0],e=t[t.length-1];return!(n[0]-e[0]||n[1]-e[1])}function Ue(){lr(this),this.edge=this.site=this.circle=null}function Fe(t){var n=cl.pop()||new Ue;return n.site=t,n}function He(t){Qe(t),ul.remove(t),cl.push(t),lr(t)}function Ve(t){var n=t.circle,e=n.x,r=n.cy,i={x:e,y:r},a=t.P,o=t.N,u=[t];He(t);for(var l=a;l.circle&&wo(e-l.circle.x)Io)u=u.L;else{if(!((i=a-Ze(u,o))>Io)){r>-Io?(n=u.P,e=u):i>-Io?(n=u,e=u.N):n=e=u;break}if(!u.R){n=u;break}u=u.R}var l=Fe(t);if(ul.insert(n,l),n||e){if(n===e)return Qe(n),e=Fe(n.site),ul.insert(l,e),l.edge=e.edge=rr(n.site,l.site),Ke(n),void Ke(e);if(!e)return void(l.edge=rr(n.site,l.site));Qe(n),Qe(e);var s=n.site,c=s.x,f=s.y,h=t.x-c,d=t.y-f,p=e.site,g=p.x-c,v=p.y-f,y=2*(h*v-d*g),m=h*h+d*d,x=g*g+v*v,M={x:(v*m-d*x)/y+c,y:(h*x-g*m)/y+f};ar(e.edge,s,p,M),l.edge=rr(s,t,null,M),e.edge=rr(t,p,null,M),Ke(n),Ke(e)}}function Ge(t,n){var e=t.site,r=e.x,i=e.y,a=i-n;if(!a)return r;var o=t.P;if(!o)return-1/0;e=o.site;var u=e.x,l=e.y,s=l-n;if(!s)return u;var c=u-r,f=1/a-1/s,h=c/s;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*s)-l+s/2+i-a/2)))/f+r:(r+u)/2}function Ze(t,n){var e=t.N;if(e)return Ge(e,n);var r=t.site;return r.y===n?r.x:1/0}function Be(t){this.site=t,this.edges=[]}function Xe(t){for(var n,e,r,i,a,o,u,l,s,c,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],g=ol,v=g.length;v--;)if((a=g[v])&&a.prepare())for(u=a.edges,l=u.length,o=0;oIo||wo(i-e)>Io)&&(u.splice(o,0,new or(ir(a.site,c,wo(r-f)Io?{x:f,y:wo(n-f)Io?{x:wo(e-p)Io?{x:h,y:wo(n-h)Io?{x:wo(e-d)=-Uo)){var d=l*l+s*s,p=c*c+f*f,g=(f*d-s*p)/h,v=(l*p-c*d)/h,f=v+u,y=fl.pop()||new We;y.arc=t,y.site=i,y.x=g+o,y.y=f+Math.sqrt(g*g+v*v),y.cy=f,t.circle=y;for(var m=null,x=sl._;x;)if(y.y=u)return;if(h>p){if(a){if(a.y>=s)return}else a={x:v,y:l};e={x:v,y:s}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=s)return}else a={x:(l-i)/r,y:l};e={x:(s-i)/r,y:s}}else{if(a){if(a.y=u)return}else a={x:o,y:r*o+i};e={x:u,y:r*u+i}}else{if(a){if(a.xa||f>o||h=M,w=e>=_,k=w<<1|b,S=k+4;ka&&(i=n.slice(a,i),u[o]?u[o]+=i:u[++o]=i),(e=e[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,l.push({i:o,x:br(e,r)})),a=pl.lastIndex;return a=0&&!(e=ho.interpolators[r](t,n)););return e}function Sr(t,n){var e,r=[],i=[],a=t.length,o=n.length,u=Math.min(t.length,n.length);for(e=0;e=1?1:t(n)}}function Er(t){return function(n){return 1-t(1-n)}}function Cr(t){return function(n){return.5*(n<.5?t(2*n):2-t(2-2*n))}}function zr(t){return t*t}function Ar(t){return t*t*t}function Tr(t){if(t<=0)return 0;if(t>=1)return 1;var n=t*t,e=n*t;return 4*(t<.5?e:3*(t-n)+e-.75)}function Lr(t){return function(n){return Math.pow(n,t)}}function qr(t){return 1-Math.cos(t*Yo)}function Pr(t){return Math.pow(2,10*(t-1))}function jr(t){return 1-Math.sqrt(1-t*t)}function Dr(t,n){var e;return arguments.length<2&&(n=.45),arguments.length?e=n/Ho*Math.asin(1/t):(t=1,e=n/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-e)*Ho/n)}}function Rr(t){return t||(t=1.70158),function(n){return n*n*((t+1)*n-t)}}function $r(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Or(t,n){t=ho.hcl(t),n=ho.hcl(n);var e=t.h,r=t.c,i=t.l,a=n.h-e,o=n.c-r,u=n.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?n.c:r),isNaN(a)?(a=0,e=isNaN(e)?n.h:e):a>180?a-=360:a<-180&&(a+=360),function(t){return gt(e+a*t,r+o*t,i+u*t)+""}}function Ir(t,n){t=ho.hsl(t),n=ho.hsl(n);var e=t.h,r=t.s,i=t.l,a=n.h-e,o=n.s-r,u=n.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?n.s:r),isNaN(a)?(a=0,e=isNaN(e)?n.h:e):a>180?a-=360:a<-180&&(a+=360),function(t){return dt(e+a*t,r+o*t,i+u*t)+""}}function Ur(t,n){t=ho.lab(t),n=ho.lab(n);var e=t.l,r=t.a,i=t.b,a=n.l-e,o=n.a-r,u=n.b-i;return function(t){return yt(e+a*t,r+o*t,i+u*t)+""}}function Fr(t,n){return n-=t,function(e){return Math.round(t+n*e)}}function Hr(t){var n=[t.a,t.b],e=[t.c,t.d],r=Yr(n),i=Vr(n,e),a=Yr(Gr(e,n,-i))||0;n[0]*e[1]180?n+=360:n-t>180&&(t+=360),r.push({i:e.push(Zr(e)+"rotate(",null,")")-2,x:br(t,n)})):n&&e.push(Zr(e)+"rotate("+n+")")}function Jr(t,n,e,r){t!==n?r.push({i:e.push(Zr(e)+"skewX(",null,")")-2,x:br(t,n)}):n&&e.push(Zr(e)+"skewX("+n+")")}function Wr(t,n,e,r){if(t[0]!==n[0]||t[1]!==n[1]){var i=e.push(Zr(e)+"scale(",null,",",null,")");r.push({i:i-4,x:br(t[0],n[0])},{i:i-2,x:br(t[1],n[1])})}else 1===n[0]&&1===n[1]||e.push(Zr(e)+"scale("+n+")")}function Kr(t,n){var e=[],r=[];return t=ho.transform(t),n=ho.transform(n),Br(t.translate,n.translate,e,r),Xr(t.rotate,n.rotate,e,r),Jr(t.skew,n.skew,e,r),Wr(t.scale,n.scale,e,r),t=n=null,function(t){for(var n,i=-1,a=r.length;++i=0;)e.push(i[r])}function fi(t,n){for(var e=[t],r=[];null!=(t=e.pop());)if(r.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++oi&&(r=e,i=n);return r}function bi(t){return t.reduce(wi,0)}function wi(t,n){return t+n[1]}function ki(t,n){return Si(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function Si(t,n){for(var e=-1,r=+t[0],i=(t[1]-r)/n,a=[];++e<=n;)a[e]=i*e+r;return a}function Ni(t){return[ho.min(t),ho.max(t)]}function Ei(t,n){return t.value-n.value}function Ci(t,n){var e=t._pack_next;t._pack_next=n,n._pack_prev=t,n._pack_next=e,e._pack_prev=n}function zi(t,n){t._pack_next=n,n._pack_prev=t}function Ai(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return.999*i*i>e*e+r*r}function Ti(t){function n(t){c=Math.min(t.x-t.r,c),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((e=t.children)&&(s=e.length)){var e,r,i,a,o,u,l,s,c=1/0,f=-1/0,h=1/0,d=-1/0;if(e.forEach(Li),r=e[0],r.x=-r.r,r.y=0,n(r),s>1&&(i=e[1],i.x=i.r,i.y=0,n(i),s>2))for(a=e[2],ji(r,i,a),n(a),Ci(r,a),r._pack_prev=a,Ci(a,i),i=r._pack_next,o=3;o=0;)n=i[a],n.z+=e,n.m+=e,e+=n.s+(r+=n.c)}function Ui(t,n,e){return t.a.parent===n.parent?t.a:e}function Fi(t){return 1+ho.max(t,function(t){return t.y})}function Hi(t){return t.reduce(function(t,n){return t+n.x},0)/t.length}function Vi(t){var n=t.children;return n&&n.length?Vi(n[0]):t}function Yi(t){var n,e=t.children;return e&&(n=e.length)?Yi(e[n-1]):t}function Gi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Zi(t,n){var e=t.x+n[3],r=t.y+n[0],i=t.dx-n[1]-n[3],a=t.dy-n[0]-n[2];return i<0&&(e+=i/2,i=0),a<0&&(r+=a/2,a=0),{x:e,y:r,dx:i,dy:a}}function Bi(t){var n=t[0],e=t[t.length-1];return n2?Qi:Ji,l=r?ti:Qr;return o=i(t,n,l,e),u=i(n,t,l,kr),a}function a(t){return o(t)}var o,u;return a.invert=function(t){return u(t)},a.domain=function(n){return arguments.length?(t=n.map(Number),i()):t},a.range=function(t){return arguments.length?(n=t,i()):n},a.rangeRound=function(t){return a.range(t).interpolate(Fr)},a.clamp=function(t){return arguments.length?(r=t,i()):r},a.interpolate=function(t){return arguments.length?(e=t,i()):e},a.ticks=function(n){return ia(t,n)},a.tickFormat=function(n,e){return aa(t,n,e)},a.nice=function(n){return ea(t,n),i()},a.copy=function(){return ta(t,n,e,r)},i()}function na(t,n){return ho.rebind(t,n,"range","rangeRound","interpolate","clamp")}function ea(t,n){return Wi(t,Ki(ra(t,n)[2])),Wi(t,Ki(ra(t,n)[2])),t}function ra(t,n){null==n&&(n=10);var e=Bi(t),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/n)/Math.LN10)),a=n/r*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function ia(t,n){return ho.range.apply(ho,ra(t,n))}function aa(t,n,e){var r=ra(t,n);if(e){var i=du.exec(e);if(i.shift(),"s"===i[8]){var a=ho.formatPrefix(Math.max(wo(r[0]),wo(r[1])));return i[7]||(i[7]="."+oa(a.scale(r[2]))),i[8]="f",e=ho.format(i.join("")),function(t){return e(a.scale(t))+a.symbol}}i[7]||(i[7]="."+ua(i[8],r)),e=i.join("")}else e=",."+oa(r[2])+"f";return ho.format(e)}function oa(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ua(t,n){var e=oa(n[2]);return t in Nl?Math.abs(e-oa(Math.max(wo(n[0]),wo(n[1]))))+ +("e"!==t):e-2*("%"===t)}function la(t,n,e,r){function i(t){return(e?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function a(t){return e?Math.pow(n,t):-Math.pow(n,-t)}function o(n){return t(i(n))}return o.invert=function(n){return a(t.invert(n))},o.domain=function(n){return arguments.length?(e=n[0]>=0,t.domain((r=n.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(n=+e,t.domain(r.map(i)),o):n},o.nice=function(){var n=Wi(r.map(i),e?Math:Cl);return t.domain(n),r=n.map(a),o},o.ticks=function(){var t=Bi(r),o=[],u=t[0],l=t[1],s=Math.floor(i(u)),c=Math.ceil(i(l)),f=n%1?2:n;if(isFinite(c-s)){if(e){for(;s0;h--)o.push(a(s)*h);for(s=0;o[s]l;c--);o=o.slice(s,c)}return o},o.tickFormat=function(t,e){if(!arguments.length)return El;arguments.length<2?e=El:"function"!=typeof e&&(e=ho.format(e));var r=Math.max(1,n*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*n0?i[e-1]:t[0],e0?0:1}function wa(t,n,e,r,i){var a=t[0]-n[0],o=t[1]-n[1],u=(i?r:-r)/Math.sqrt(a*a+o*o),l=u*o,s=-u*a,c=t[0]+l,f=t[1]+s,h=n[0]+l,d=n[1]+s,p=(c+h)/2,g=(f+d)/2,v=h-c,y=d-f,m=v*v+y*y,x=e-r,M=c*d-h*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*m-M*M)),b=(M*y-v*_)/m,w=(-M*v-y*_)/m,k=(M*y+v*_)/m,S=(-M*v+y*_)/m,N=b-p,E=w-g,C=k-p,z=S-g;return N*N+E*E>C*C+z*z&&(b=k,w=S),[[b-l,w-s],[b*e/x,w*e/x]]}function ka(t){function n(n){function o(){s.push("M",a(t(c),u))}for(var l,s=[],c=[],f=-1,h=n.length,d=Tt(e),p=Tt(r);++f1?t.join("L"):t+"Z"}function Na(t){return t.join("L")+"Z"}function Ea(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n1&&i.push("H",r[0]),i.join("")}function Ca(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n1){u=n[1],a=t[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-u[0])+","+(a[1]-u[1])+","+a[0]+","+a[1];for(var s=2;s9&&(i=3*n/Math.sqrt(i),o[u]=i*e,o[u+1]=i*r));for(u=-1;++u<=l;)i=(t[Math.min(l,u+1)][0]-t[Math.max(0,u-1)][0])/(6*(1+o[u]*o[u])),a.push([i||0,o[u]*i||0]);return a}function Va(t){return t.length<3?Sa(t):t[0]+qa(t,Ha(t))}function Ya(t){for(var n,e,r,i=-1,a=t.length;++i0;)h[--u].call(t,o);if(a>=1)return g.event&&g.event.end.call(t,t.__data__,n),--d.count?delete d[r]:delete t[e],1}var l,s,c,f,h,d=t[e]||(t[e]={active:0,count:0}),g=d[r];g||(l=i.time,s=Dt(a,0,l),g=d[r]={tween:new p,time:l,timer:s,delay:i.delay,duration:i.duration,ease:i.ease,index:n},i=null,++d.count)}function ao(t,n,e){t.attr("transform",function(t){var r=n(t);return"translate("+(isFinite(r)?r:e(t))+",0)"})}function oo(t,n,e){t.attr("transform",function(t){var r=n(t);return"translate(0,"+(isFinite(r)?r:e(t))+")"})}function uo(t){return t.toISOString()}function lo(t,n,e){function r(n){return t(n)}function i(t,e){var r=t[1]-t[0],i=r/e,a=ho.bisect(Ql,i);return a==Ql.length?[n.year,ra(t.map(function(t){return t/31536e6}),e)[2]]:a?n[i/Ql[a-1]1?{floor:function(n){for(;e(n=t.floor(n));)n=so(n-1);return n},ceil:function(n){for(;e(n=t.ceil(n));)n=so(+n+1);return n}}:t))},r.ticks=function(t,n){var e=Bi(r.domain()),a=null==t?i(e,10):"number"==typeof t?i(e,t):!t.range&&[{range:t},n];return a&&(t=a[0],n=a[1]),t.range(e[0],so(+e[1]+1),n<1?1:n)},r.tickFormat=function(){return e},r.copy=function(){return lo(t.copy(),n,e)},na(r,t)}function so(t){return new Date(t)}function co(t){return JSON.parse(t.responseText)}function fo(t){var n=vo.createRange();return n.selectNode(vo.body),n.createContextualFragment(t.responseText)}var ho={version:"3.5.17"},po=[].slice,go=function(t){return po.call(t)},vo=this.document;if(vo)try{go(vo.documentElement.childNodes)[0].nodeType}catch(t){go=function(t){for(var n=t.length,e=new Array(n);n--;)e[n]=t[n];return e}}if(Date.now||(Date.now=function(){return+new Date}),vo)try{vo.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var yo=this.Element.prototype,mo=yo.setAttribute,xo=yo.setAttributeNS,Mo=this.CSSStyleDeclaration.prototype,_o=Mo.setProperty;yo.setAttribute=function(t,n){mo.call(this,t,n+"")},yo.setAttributeNS=function(t,n,e){xo.call(this,t,n,e+"")},Mo.setProperty=function(t,n,e){_o.call(this,t,n+"",e)}}ho.ascending=u,ho.descending=function(t,n){return nt?1:n>=t?0:NaN},ho.min=function(t,n){var e,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},ho.max=function(t,n){var e,r,i=-1,a=t.length;if(1===arguments.length){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},ho.extent=function(t,n){var e,r,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=r){e=i=r;break}for(;++ar&&(e=r),i=r){e=i=r;break}for(;++ar&&(e=r),i1)return o/(c-1)},ho.deviation=function(){var t=ho.variance.apply(this,arguments);return t?Math.sqrt(t):t};var bo=c(u);ho.bisectLeft=bo.left,ho.bisect=ho.bisectRight=bo.right,ho.bisector=function(t){return c(1===t.length?function(n,e){return u(t(n),e)}:t)},ho.shuffle=function(t,n,e){(a=arguments.length)<3&&(e=t.length,a<2&&(n=0));for(var r,i,a=e-n;a;)i=Math.random()*a--|0,r=t[a+n],t[a+n]=t[i+n],t[i+n]=r;return t},ho.permute=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},ho.pairs=function(t){for(var n=0,e=t.length-1,r=t[0],i=new Array(e<0?0:e);n=0;)for(r=t[i],n=r.length;--n>=0;)e[--o]=r[n];return e};var wo=Math.abs;ho.range=function(t,n,e){if(arguments.length<3&&(e=1,arguments.length<2&&(n=t,t=0)),(n-t)/e==1/0)throw new Error("infinite range");var r,i=[],a=h(wo(e)),o=-1;if(t*=a,n*=a,e*=a,e<0)for(;(r=t+e*++o)>n;)i.push(r/a);else for(;(r=t+e*++o)=a.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,s,c,f,h=-1,d=o.length,g=a[u++],v=new p;++h=a.length)return t;var r=[],i=o[e++];return t.forEach(function(t,i){r.push({key:t,values:n(i,e)})}),i?r.sort(function(t,n){return i(t.key,n.key)}):r}var e,r,i={},a=[],o=[];return i.map=function(n,e){return t(e,n,0)},i.entries=function(e){return n(t(ho.map,e,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return e=t,i},i.rollup=function(t){return r=t,i},i},ho.set=function(t){var n=new b;if(t)for(var e=0,r=t.length;e=0&&(r=t.slice(e+1),t=t.slice(0,e)),t)return arguments.length<2?this[t].on(r):this[t].on(r,n);if(2===arguments.length){if(null==n)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},ho.event=null,ho.requote=function(t){return t.replace(Eo,"\\$&")};var Eo=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Co={}.__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]},zo=function(t,n){return n.querySelector(t)},Ao=function(t,n){return n.querySelectorAll(t)},To=function(t,n){var e=t.matches||t[S(t,"matchesSelector")];return(To=function(t,n){return e.call(t,n)})(t,n)};"function"==typeof Sizzle&&(zo=function(t,n){return Sizzle(t,n)[0]||null},Ao=Sizzle,To=Sizzle.matchesSelector),ho.selection=function(){return ho.select(vo.documentElement)};var Lo=ho.selection.prototype=[];Lo.select=function(t){var n,e,r,i,a=[];t=q(t);for(var o=-1,u=this.length;++o=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Po.hasOwnProperty(e)?{space:Po[e],local:t}:t}},Lo.attr=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node();return t=ho.ns.qualify(t),t.local?e.getAttributeNS(t.space,t.local):e.getAttribute(t)}for(n in t)this.each(j(n,t[n]));return this}return this.each(j(t,n))},Lo.classed=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node(),r=(t=$(t)).length,i=-1;if(n=e.classList){for(;++i=0;)(e=r[i])&&(a&&a!==e.nextSibling&&a.parentNode.insertBefore(e,a),a=e);return this},Lo.sort=function(t){t=Z.apply(this,arguments);for(var n=-1,e=this.length;++n0&&(n=n.transition().duration(E)),n.call(t.event)}function u(){_&&_.domain(M.range().map(function(t){return(t-k.x)/k.k}).map(M.invert)),w&&w.domain(b.range().map(function(t){return(t-k.y)/k.k}).map(b.invert))}function l(t){C++||t({type:"zoomstart"})}function s(t){u(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--C||(t({type:"zoomend"}),v=null)}function f(){function t(){u=1,i(ho.mouse(r),h),s(a)}function e(){f.on(L,null).on(q,null),d(u),c(a)}var r=this,a=j.of(r,arguments),u=0,f=ho.select(o(r)).on(L,t).on(q,e),h=n(ho.mouse(r)),d=tt(r);Hl.call(r),l(a)}function h(){function t(){var t=ho.touches(p);return d=k.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=n(t))}),t}function e(){var n=ho.event.target;ho.select(n).on(M,o).on(_,u),b.push(n);for(var e=ho.event.changedTouches,r=0,i=e.length;r1){var c=l[0],f=l[1],h=c[0]-f[0],d=c[1]-f[1];y=h*h+d*d}}function o(){var t,n,e,a,o=ho.touches(p);Hl.call(p);for(var u=0,l=o.length;u=s)return o;if(i)return i=!1,a;var n=c;if(34===t.charCodeAt(n)){for(var e=n;e++=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pu=ho.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,n){return t.toPrecision(n)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},r:function(t,n){return(t=ho.round(t,It(t,n))).toFixed(Math.max(0,Math.min(20,It(t*(1+1e-15),n))))}}),gu=ho.time={},vu=Date;Vt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){yu.setUTCDate.apply(this._,arguments)},setDay:function(){yu.setUTCDay.apply(this._,arguments)},setFullYear:function(){yu.setUTCFullYear.apply(this._,arguments)},setHours:function(){yu.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){yu.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){yu.setUTCMinutes.apply(this._,arguments)},setMonth:function(){yu.setUTCMonth.apply(this._,arguments)},setSeconds:function(){yu.setUTCSeconds.apply(this._,arguments)},setTime:function(){yu.setTime.apply(this._,arguments)}};var yu=Date.prototype;gu.year=Yt(function(t){return t=gu.day(t),t.setMonth(0,1),t},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),gu.years=gu.year.range,gu.years.utc=gu.year.utc.range,gu.day=Yt(function(t){var n=new vu(2e3,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n},function(t,n){t.setDate(t.getDate()+n)},function(t){return t.getDate()-1}),gu.days=gu.day.range,gu.days.utc=gu.day.utc.range,gu.dayOfYear=function(t){var n=gu.year(t);return Math.floor((t-n-6e4*(t.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,n){n=7-n;var e=gu[t]=Yt(function(t){return(t=gu.day(t)).setDate(t.getDate()-(t.getDay()+n)%7),t},function(t,n){t.setDate(t.getDate()+7*Math.floor(n))},function(t){var e=gu.year(t).getDay();return Math.floor((gu.dayOfYear(t)+(e+n)%7)/7)-(e!==n)});gu[t+"s"]=e.range,gu[t+"s"].utc=e.utc.range,gu[t+"OfYear"]=function(t){var e=gu.year(t).getDay();return Math.floor((gu.dayOfYear(t)+(e+n)%7)/7)}}),gu.week=gu.sunday,gu.weeks=gu.sunday.range,gu.weeks.utc=gu.sunday.utc.range,gu.weekOfYear=gu.sundayOfYear;var mu={"-":"",_:" ",0:"0"},xu=/^\s*\d+/,Mu=/^%/;ho.locale=function(t){return{numberFormat:Ft(t),timeFormat:Zt(t)}};var _u=ho.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ho.format=_u.numberFormat,ho.geo={},gn.prototype={s:0,t:0,add:function(t){vn(t,this.t,bu),vn(bu.s,this.s,this),this.s?this.t+=bu.t:this.s=bu.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var bu=new gn;ho.geo.stream=function(t,n){t&&wu.hasOwnProperty(t.type)?wu[t.type](t,n):yn(t,n)};var wu={Feature:function(t,n){yn(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++rd&&(d=n)}function n(n,e){var r=_n([n*Go,e*Go]);if(y){var i=wn(y,r),a=[i[1],-i[0],0],o=wn(a,i);Nn(o),o=En(o);var l=n-p,s=l>0?1:-1,g=o[0]*Zo*s,v=wo(l)>180;if(v^(s*pd&&(d=m)}else if(g=(g+360)%360-180,v^(s*pd&&(d=e);v?nu(c,h)&&(h=n):u(n,h)>u(c,h)&&(c=n):h>=c?(nh&&(h=n)):n>p?u(c,n)>u(c,h)&&(h=n):u(n,h)>u(c,h)&&(c=n)}else t(n,e);y=r,p=n}function e(){_.point=n}function r(){M[0]=c,M[1]=h,_.point=t,y=null}function i(t,e){if(y){var r=t-p;m+=wo(r)>180?r+(r>0?360:-360):r}else g=t,v=e;Eu.point(t,e),n(t,e)}function a(){Eu.lineStart()}function o(){i(g,v),Eu.lineEnd(),wo(m)>Io&&(c=-(h=180)),M[0]=c,M[1]=h,y=null}function u(t,n){return(n-=t)<0?n+360:n}function l(t,n){return t[0]-n[0]}function s(t,n){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:tIo?d=90:m<-Io&&(f=-90),M[0]=c,M[1]=h}};return function(t){d=h=-(c=f=1/0),x=[],ho.geo.stream(t,_);var n=x.length;if(n){x.sort(l);for(var e,r=1,i=x[0],a=[i];ru(i[0],i[1])&&(i[1]=e[1]),u(e[0],i[1])>u(i[0],i[1])&&(i[0]=e[0])):a.push(i=e);for(var o,e,p=-1/0,n=a.length-1,r=0,i=a[n];r<=n;i=e,++r)e=a[r],(o=u(i[1],e[0]))>p&&(p=o,c=e[0],h=i[1])}return x=M=null,c===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,f],[h,d]]}}(),ho.geo.centroid=function(t){Cu=zu=Au=Tu=Lu=qu=Pu=ju=Du=Ru=$u=0,ho.geo.stream(t,Ou);var n=Du,e=Ru,r=$u,i=n*n+e*e+r*r;return i=.12&&i<.234&&r>=-.425&&r<-.214?o:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},t.stream=function(t){var n=a.stream(t),e=o.stream(t),r=u.stream(t);return{point:function(t,i){n.point(t,i),e.point(t,i),r.point(t,i)},sphere:function(){n.sphere(),e.sphere(),r.sphere()},lineStart:function(){n.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){n.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){n.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){n.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},t.precision=function(n){return arguments.length?(a.precision(n),o.precision(n),u.precision(n),t):a.precision()},t.scale=function(n){return arguments.length?(a.scale(n),o.scale(.35*n),u.scale(n),t.translate(a.translate())):a.scale()},t.translate=function(n){if(!arguments.length)return a.translate();var s=a.scale(),c=+n[0],f=+n[1];return e=a.translate(n).clipExtent([[c-.455*s,f-.238*s],[c+.455*s,f+.238*s]]).stream(l).point,r=o.translate([c-.307*s,f+.201*s]).clipExtent([[c-.425*s+Io,f+.12*s+Io],[c-.214*s-Io,f+.234*s-Io]]).stream(l).point,i=u.translate([c-.205*s,f+.212*s]).clipExtent([[c-.214*s+Io,f+.166*s+Io],[c-.115*s-Io,f+.234*s-Io]]).stream(l).point,t},t.scale(1070)};var Fu,Hu,Vu,Yu,Gu,Zu,Bu={point:N,lineStart:N,lineEnd:N,polygonStart:function(){Hu=0,Bu.lineStart=Kn},polygonEnd:function(){Bu.lineStart=Bu.lineEnd=Bu.point=N,Fu+=wo(Hu/2)}},Xu={point:Qn,lineStart:N,lineEnd:N,polygonStart:N,polygonEnd:N},Ju={point:ee,lineStart:re,lineEnd:ie,polygonStart:function(){Ju.lineStart=ae},polygonEnd:function(){Ju.point=ee,Ju.lineStart=re,Ju.lineEnd=ie}};ho.geo.path=function(){function t(t){return t&&("function"==typeof u&&a.pointRadius(+u.apply(this,arguments)),o&&o.valid||(o=i(a)),ho.geo.stream(t,o)),a.result()}function n(){return o=null,t}var e,r,i,a,o,u=4.5;return t.area=function(t){return Fu=0,ho.geo.stream(t,i(Bu)),Fu},t.centroid=function(t){return Au=Tu=Lu=qu=Pu=ju=Du=Ru=$u=0,ho.geo.stream(t,i(Ju)),$u?[Du/$u,Ru/$u]:ju?[qu/ju,Pu/ju]:Lu?[Au/Lu,Tu/Lu]:[NaN,NaN]},t.bounds=function(t){return Gu=Zu=-(Vu=Yu=1/0),ho.geo.stream(t,i(Xu)),[[Vu,Yu],[Gu,Zu]]},t.projection=function(t){return arguments.length?(i=(e=t)?t.stream||le(t):w,n()):e},t.context=function(t){return arguments.length?(a=null==(r=t)?new te:new oe(t),"function"!=typeof u&&a.pointRadius(u),n()):r},t.pointRadius=function(n){return arguments.length?(u="function"==typeof n?n:(a.pointRadius(+n),+n),t):u},t.projection(ho.geo.albersUsa()).context(null)},ho.geo.transform=function(t){return{stream:function(n){var e=new se(n);for(var r in t)e[r]=t[r];return e}}},se.prototype={point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ho.geo.projection=fe,ho.geo.projectionMutator=he,(ho.geo.equirectangular=function(){return fe(pe)}).raw=pe.invert=pe,ho.geo.rotation=function(t){function n(n){return n=t(n[0]*Go,n[1]*Go),n[0]*=Zo,n[1]*=Zo,n}return t=ve(t[0]%360*Go,t[1]*Go,t.length>2?t[2]*Go:0),n.invert=function(n){return n=t.invert(n[0]*Go,n[1]*Go),n[0]*=Zo,n[1]*=Zo,n},n},ge.invert=pe,ho.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,n=ve(-t[0]*Go,-t[1]*Go,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Zo,t[1]*=Zo}}),{type:"Polygon",coordinates:[i]}}var n,e,r=[0,0],i=6;return t.origin=function(n){return arguments.length?(r=n,t):r},t.angle=function(r){return arguments.length?(e=Me((n=+r)*Go,i*Go),t):n},t.precision=function(r){return arguments.length?(e=Me(n*Go,(i=+r)*Go),t):i},t.angle(90)},ho.geo.distance=function(t,n){var e,r=(n[0]-t[0])*Go,i=t[1]*Go,a=n[1]*Go,o=Math.sin(r),u=Math.cos(r),l=Math.sin(i),s=Math.cos(i),c=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((e=f*o)*e+(e=s*c-l*f*u)*e),l*c+s*f*u)},ho.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return ho.range(Math.ceil(a/v)*v,i,v).map(h).concat(ho.range(Math.ceil(s/y)*y,l,y).map(d)).concat(ho.range(Math.ceil(r/p)*p,e,p).filter(function(t){return wo(t%v)>Io}).map(c)).concat(ho.range(Math.ceil(u/g)*g,o,g).filter(function(t){return wo(t%y)>Io}).map(f))}var e,r,i,a,o,u,l,s,c,f,h,d,p=10,g=p,v=90,y=360,m=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(s).reverse().slice(1))]}},t.extent=function(n){return arguments.length?t.majorExtent(n).minorExtent(n):t.minorExtent()},t.majorExtent=function(n){return arguments.length?(a=+n[0][0],i=+n[1][0],s=+n[0][1],l=+n[1][1],a>i&&(n=a,a=i,i=n),s>l&&(n=s,s=l,l=n),t.precision(m)):[[a,s],[i,l]]},t.minorExtent=function(n){return arguments.length?(r=+n[0][0],e=+n[1][0],u=+n[0][1],o=+n[1][1],r>e&&(n=r,r=e,e=n),u>o&&(n=u,u=o,o=n),t.precision(m)):[[r,u],[e,o]]},t.step=function(n){return arguments.length?t.majorStep(n).minorStep(n):t.minorStep()},t.majorStep=function(n){return arguments.length?(v=+n[0],y=+n[1],t):[v,y]},t.minorStep=function(n){return arguments.length?(p=+n[0],g=+n[1],t):[p,g]},t.precision=function(n){return arguments.length?(m=+n,c=be(u,o,90),f=we(r,e,m),h=be(s,l,90),d=we(a,i,m),t):m},t.majorExtent([[-180,-90+Io],[180,90-Io]]).minorExtent([[-180,-80-Io],[180,80+Io]])},ho.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[n||r.apply(this,arguments),e||i.apply(this,arguments)]}}var n,e,r=ke,i=Se;return t.distance=function(){return ho.geo.distance(n||r.apply(this,arguments),e||i.apply(this,arguments))},t.source=function(e){return arguments.length?(r=e,n="function"==typeof e?null:e,t):r},t.target=function(n){return arguments.length?(i=n,e="function"==typeof n?null:n,t):i},t.precision=function(){return arguments.length?t:0},t},ho.geo.interpolate=function(t,n){return Ne(t[0]*Go,t[1]*Go,n[0]*Go,n[1]*Go)},ho.geo.length=function(t){return Wu=0,ho.geo.stream(t,Ku),Wu};var Wu,Ku={sphere:N,point:N,lineStart:Ee,lineEnd:N,polygonStart:N,polygonEnd:N},Qu=Ce(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ho.geo.azimuthalEqualArea=function(){return fe(Qu)}).raw=Qu;var tl=Ce(function(t){var n=Math.acos(t);return n&&n/Math.sin(n)},w);(ho.geo.azimuthalEquidistant=function(){return fe(tl)}).raw=tl,(ho.geo.conicConformal=function(){return Jn(ze)}).raw=ze,(ho.geo.conicEquidistant=function(){return Jn(Ae)}).raw=Ae;var nl=Ce(function(t){return 1/t},Math.atan);(ho.geo.gnomonic=function(){return fe(nl)}).raw=nl,Te.invert=function(t,n){return[t,2*Math.atan(Math.exp(n))-Yo]},(ho.geo.mercator=function(){return Le(Te)}).raw=Te;var el=Ce(function(){return 1},Math.asin);(ho.geo.orthographic=function(){return fe(el)}).raw=el;var rl=Ce(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ho.geo.stereographic=function(){return fe(rl)}).raw=rl,qe.invert=function(t,n){return[-n,2*Math.atan(Math.exp(t))-Yo]},(ho.geo.transverseMercator=function(){var t=Le(qe),n=t.center,e=t.rotate;return t.center=function(t){return t?n([-t[1],t[0]]):(t=n(),[t[1],-t[0]])},t.rotate=function(t){return t?e([t[0],t[1],t.length>2?t[2]+90:90]):(t=e(),[t[0],t[1],t[2]-90])},e([0,0,90])}).raw=qe,ho.geom={},ho.geom.hull=function(t){function n(t){if(t.length<3)return[];var n,i=Tt(e),a=Tt(r),o=t.length,u=[],l=[];for(n=0;n=0;--n)d.push(t[u[s[n]][2]]);for(n=+f;n=r&&s.x<=a&&s.y>=i&&s.y<=o?[[r,o],[a,o],[a,i],[r,i]]:[]).point=t[u]}),n}function e(t){return t.map(function(t,n){return{x:Math.round(a(t,n)/Io)*Io,y:Math.round(o(t,n)/Io)*Io,i:n}})}var r=Pe,i=je,a=r,o=i,u=hl;return t?n(t):(n.links=function(t){return hr(e(t)).edges.filter(function(t){return t.l&&t.r}).map(function(n){return{source:t[n.l.i],target:t[n.r.i]}})},n.triangles=function(t){var n=[];return hr(e(t)).cells.forEach(function(e,r){for(var i,a=e.site,o=e.edges.sort(Je),u=-1,l=o.length,s=o[l-1].edge,c=s.l===a?s.r:s.l;++u=s,h=r>=c,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=yr()),f?i=s:u=s,h?o=c:l=c,a(t,n,e,r,i,o,u,l)}var c,f,h,d,p,g,v,y,m,x=Tt(u),M=Tt(l);if(null!=n)g=n,v=e,y=r,m=i;else if(y=m=-(g=v=1/0),f=[],h=[],p=t.length,o)for(d=0;dy&&(y=c.x),c.y>m&&(m=c.y),f.push(c.x),h.push(c.y);else for(d=0;dy&&(y=_),b>m&&(m=b),f.push(_),h.push(b)}var w=y-g,k=m-v;w>k?m=v+w:y=g+k;var S=yr();if(S.add=function(t){a(S,t,+x(t,++d),+M(t,d),g,v,y,m)},S.visit=function(t){mr(t,S,g,v,y,m)},S.find=function(t){return xr(S,t[0],t[1],g,v,y,m)},d=-1,null==n){for(;++d=0?t.slice(0,n):t,r=n>=0?t.slice(n+1):"in";return e=vl.get(e)||gl,r=yl.get(r)||w,Nr(r(e.apply(null,po.call(arguments,1))))},ho.interpolateHcl=Or,ho.interpolateHsl=Ir,ho.interpolateLab=Ur,ho.interpolateRound=Fr,ho.transform=function(t){var n=vo.createElementNS(ho.ns.prefix.svg,"g");return(ho.transform=function(t){if(null!=t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate()}return new Hr(e?e.matrix:ml)})(t)},Hr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ml={a:1,b:0,c:0,d:1,e:0,f:0};ho.interpolateTransform=Kr,ho.layout={},ho.layout.bundle=function(){return function(t){for(var n=[],e=-1,r=t.length;++e0?i=t:(e.c=null,e.t=NaN,e=null,s.end({type:"end",alpha:i=0})):t>0&&(s.start({type:"start",alpha:i=t}),e=Dt(l.tick)),l):i},l.start=function(){function t(t,r){if(!e){for(e=new Array(i),l=0;l=0;)o.push(c=s[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=s}else r&&(a.value=+r.call(t,a,a.depth)||0),delete a.children;return fi(i,function(t){var e,i;n&&(e=t.children)&&e.sort(n),r&&(i=t.parent)&&(i.value+=t.value)}),u}var n=pi,e=hi,r=di;return t.sort=function(e){return arguments.length?(n=e,t):n},t.children=function(n){return arguments.length?(e=n,t):e},t.value=function(n){return arguments.length?(r=n,t):r},t.revalue=function(n){return r&&(ci(n,function(t){t.children&&(t.value=0)}),fi(n,function(n){var e;n.children||(n.value=+r.call(t,n,n.depth)||0),(e=n.parent)&&(e.value+=n.value)})),n},t},ho.layout.partition=function(){function t(n,e,r,i){var a=n.children;if(n.x=e,n.y=n.depth*i,n.dx=r,n.dy=i,a&&(o=a.length)){var o,u,l,s=-1;for(r=n.value?r/n.value:0;++su&&(u=r),o.push(r)}for(e=0;e0)for(a=-1;++a=c[0]&&u<=c[1]&&(o=l[ho.bisect(f,u,1,d)-1],o.y+=p,o.push(t[a]));return l}var n=!0,e=Number,r=Ni,i=ki;return t.value=function(n){return arguments.length?(e=n,t):e},t.range=function(n){return arguments.length?(r=Tt(n),t):r},t.bins=function(n){return arguments.length?(i="number"==typeof n?function(t){return Si(t,n)}:Tt(n),t):i},t.frequency=function(e){return arguments.length?(n=!!e,t):n},t},ho.layout.pack=function(){function t(t,a){var o=e.call(this,t,a),u=o[0],l=i[0],s=i[1],c=null==n?Math.sqrt:"function"==typeof n?n:function(){return n};if(u.x=u.y=0,fi(u,function(t){t.r=+c(t.value)}),fi(u,Ti),r){var f=r*(n?1:Math.max(2*u.r/l,2*u.r/s))/2;fi(u,function(t){t.r+=f}),fi(u,Ti),fi(u,function(t){t.r-=f})}return Pi(u,l/2,s/2,n?1:1/Math.max(2*u.r/l,2*u.r/s)),o}var n,e=ho.layout.hierarchy().sort(Ei),r=0,i=[1,1];return t.size=function(n){return arguments.length?(i=n,t):i},t.radius=function(e){return arguments.length?(n=null==e||"function"==typeof e?e:+e,t):n},t.padding=function(n){return arguments.length?(r=+n,t):r},si(t,e)},ho.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),f=c[0],h=n(f);if(fi(h,e),h.parent.m=-h.z,ci(h,r),s)ci(f,a);else{var d=f,p=f,g=f;ci(f,function(t){t.xp.x&&(p=t),t.depth>g.depth&&(g=t)});var v=u(d,p)/2-d.x,y=l[0]/(p.x+u(p,d)/2+v),m=l[1]/(g.depth||1);ci(f,function(t){t.x=(t.x+v)*y,t.y=t.depth*m})}return c}function n(t){for(var n,e={A:null,children:[t]},r=[e];null!=(n=r.pop());)for(var i,a=n.children,o=0,u=a.length;o0&&(Oi(Ui(o,t,e),t,r),s+=r,c+=r),f+=o.m,s+=i.m,h+=l.m,c+=a.m;o&&!$i(a)&&(a.t=o,a.m+=f-c),i&&!Ri(l)&&(l.t=i,l.m+=s-h,e=t)}return e}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=ho.layout.hierarchy().sort(null).value(null),u=Di,l=[1,1],s=null;return t.separation=function(n){return arguments.length?(u=n,t):u},t.size=function(n){return arguments.length?(s=null==(l=n)?a:null,t):s?null:l},t.nodeSize=function(n){return arguments.length?(s=null==(l=n)?null:a,t):s?l:null},si(t,o)},ho.layout.cluster=function(){function t(t,a){var o,u=n.call(this,t,a),l=u[0],s=0;fi(l,function(t){var n=t.children;n&&n.length?(t.x=Hi(n),t.y=Fi(n)):(t.x=o?s+=e(t,o):0,t.y=0,o=t)});var c=Vi(l),f=Yi(l),h=c.x-e(c,f)/2,d=f.x+e(f,c)/2;return fi(l,i?function(t){t.x=(t.x-l.x)*r[0],t.y=(l.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(d-h)*r[0],t.y=(1-(l.y?t.y/l.y:1))*r[1]}),u}var n=ho.layout.hierarchy().sort(null).value(null),e=Di,r=[1,1],i=!1;return t.separation=function(n){return arguments.length?(e=n,t):e},t.size=function(n){return arguments.length?(i=null==(r=n),t):i?null:r},t.nodeSize=function(n){return arguments.length?(i=null!=(r=n),t):i?r:null},si(t,n)},ho.layout.treemap=function(){function t(t,n){for(var e,r,i=-1,a=t.length;++i0;)c.push(o=h[l-1]),c.area+=o.area,"squarify"!==d||(u=r(c,g))<=p?(h.pop(),p=u):(c.area-=c.pop().area,i(c,g,s,!1),g=Math.min(s.dx,s.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,g,s,!0),c.length=c.area=0),a.forEach(n)}}function e(n){var r=n.children;if(r&&r.length){var a,o=f(n),u=r.slice(),l=[];for(t(u,o.dx*o.dy/n.value),l.area=0;a=u.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!u.length),l.length=l.area=0);r.forEach(e)}}function r(t,n){for(var e,r=t.area,i=0,a=1/0,o=-1,u=t.length;++oi&&(i=e));return r*=r,n*=n,r?Math.max(n*i*p/r,r/(n*a*p)):1/0}function i(t,n,e,r){var i,a=-1,o=t.length,u=e.x,s=e.y,c=n?l(t.area/n):0;if(n==e.dx){for((r||c>e.dy)&&(c=e.dy);++ae.dx)&&(c=e.dx);++a1);return t+n*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=ho.random.normal.apply(ho,arguments);return function(){return Math.exp(t())}},bates:function(t){var n=ho.random.irwinHall(t);return function(){return n()/t}},irwinHall:function(t){return function(){for(var n=0,e=0;ef?0:1;if(s=Vo)return n(s,d)+(t?n(t,1-d):"")+"Z";var p,g,v,y,m,x,M,_,b,w,k,S,N=0,E=0,C=[];if((y=(+l.apply(this,arguments)||0)/2)&&(v=a===ql?Math.sqrt(t*t+s*s):+a.apply(this,arguments),d||(E*=-1),s&&(E=ot(v/s*Math.sin(y))),t&&(N=ot(v/t*Math.sin(y)))),s){m=s*Math.cos(c+E),x=s*Math.sin(c+E),M=s*Math.cos(f-E),_=s*Math.sin(f-E);var z=Math.abs(f-c-2*E)<=Fo?0:1;if(E&&ba(m,x,M,_)===d^z){var A=(c+f)/2;m=s*Math.cos(A),x=s*Math.sin(A),M=_=null}}else m=x=0;if(t){b=t*Math.cos(f-N),w=t*Math.sin(f-N),k=t*Math.cos(c+N),S=t*Math.sin(c+N);var T=Math.abs(c-f+2*N)<=Fo?0:1;if(N&&ba(b,w,k,S)===1-d^T){var L=(c+f)/2;b=t*Math.cos(L),w=t*Math.sin(L),k=S=null}}else b=w=0;if(h>Io&&(p=Math.min(Math.abs(s-t)/2,+i.apply(this,arguments)))>.001){g=tFo)+",1 "+n}function i(t,n,e,r){return"Q 0,0 "+r}var a=ke,o=Se,u=Za,l=xa,s=Ma;return t.radius=function(n){return arguments.length?(u=Tt(n),t):u},t.source=function(n){return arguments.length?(a=Tt(n),t):a},t.target=function(n){return arguments.length?(o=Tt(n),t):o},t.startAngle=function(n){return arguments.length?(l=Tt(n),t):l},t.endAngle=function(n){return arguments.length?(s=Tt(n),t):s},t},ho.svg.diagonal=function(){function t(t,i){var a=n.call(this,t,i),o=e.call(this,t,i),u=(a.y+o.y)/2,l=[a,{x:a.x,y:u},{x:o.x,y:u},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var n=ke,e=Se,r=Ba;return t.source=function(e){return arguments.length?(n=Tt(e),t):n},t.target=function(n){return arguments.length?(e=Tt(n),t):e},t.projection=function(n){return arguments.length?(r=n,t):r},t},ho.svg.diagonal.radial=function(){var t=ho.svg.diagonal(),n=Ba,e=t.projection;return t.projection=function(t){return arguments.length?e(Xa(n=t)):n},t},ho.svg.symbol=function(){function t(t,r){return($l.get(n.call(this,t,r))||Ka)(e.call(this,t,r))}var n=Wa,e=Ja;return t.type=function(e){return arguments.length?(n=Tt(e),t):n},t.size=function(n){return arguments.length?(e=Tt(n),t):e},t};var $l=ho.map({circle:Ka,cross:function(t){var n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t){var n=Math.sqrt(t/(2*Il)),e=n*Il;return"M0,"+-n+"L"+e+",0 0,"+n+" "+-e+",0Z"},square:function(t){var n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t){var n=Math.sqrt(t/Ol),e=n*Ol/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/Ol),e=n*Ol/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});ho.svg.symbolTypes=$l.keys();var Ol=Math.sqrt(3),Il=Math.tan(30*Go);Lo.transition=function(t){for(var n,e,r=Ul||++Yl,i=ro(t),a=[],o=Fl||{time:Date.now(),ease:Tr,delay:0,duration:250},u=-1,l=this.length;++urect,.s>rect").attr("width",f[1]-f[0])}function r(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==ho.event.keyCode&&(C||(x=null,T[0]-=f[1],T[1]-=h[1],C=2),z())}function g(){32==ho.event.keyCode&&2==C&&(T[0]+=f[1],T[1]+=h[1],C=0,z())}function v(){var t=ho.mouse(_),i=!1;M&&(t[0]+=M[0],t[1]+=M[1]),C||(ho.event.altKey?(x||(x=[(f[0]+f[1])/2,(h[0]+h[1])/2]),T[0]=f[+(t[0]").addClass("charts-client").append(t("
").addClass("charts-buttons")).append(t("
").addClass("charts-center")).append(t("
").addClass("charts-right"))),this.$center=this.$(".charts-center"),this.$right=this.$(".charts-right"),this.$buttons=this.$(".charts-buttons"),this.chart=new f.default({},n),this.chart.plugin=n.visualization_plugin,this.chart.plugin.specs=this.chart.plugin.specs||{},this.chart_load=n.chart_load,this.message=new s.default.Message,this.deferred=new a.default,this.viewer=new g.default(this),this.editor=new d.default(this),this.menu=new y.default(this),this.$center.append(this.viewer.$el),this.$right.append(this.message.$el).append(this.editor.$el),this.$buttons.append(this.menu.$el),t.ajax({url:Galaxy.root+"api/datasets/"+n.dataset_id}).done(function(t){e.dataset=t,e.chart.load(),e.chart.trigger("redraw")}).fail(function(t){var n=t.responseJSON&&t.responseJSON.err_msg;e.errormessage=n||"Import failed for unkown reason."})}})}).call(n,e(0))},703:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e(9),i=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}(r),a=e(5),o=function(t){return t&&t.__esModule?t:{default:t}}(a),u=e(704);n.default=i.Model.extend({defaults:{title:"",type:"",date:null,state:"",state_info:"",modified:!0,dataset_id:"",dataset_id_job:null},initialize:function(t,n){this.groups=new i.Collection,this.settings=new i.Model,this.visualization_id=n.visualization_id,this.visualization_name=n.visualization_name,this.dataset_id=n.dataset_id,this.chart_dict=n.chart_dict,console.debug("model::initialize() - Initialized with configuration:"),console.debug(n)},reset:function(){this.clear().set({title:"New Chart",dataset_id:this.dataset_id}),this.settings.clear(),this.groups.reset(),this.groups.add({id:o.default.uid()})},state:function(t,n){this.set({state:t,state_info:n}),this.trigger("set:state"),console.debug("model::state() - "+n+" ("+t+")")},serialize:function(){var t={attributes:this.attributes,settings:this.settings.attributes,groups:[]};return this.groups.each(function(n){t.groups.push(n.attributes)}),t},save:function(t){var n=this;t=t||{},this.chart_dict=this.serialize(),new u.Visualization({id:this.visualization_id||void 0,type:this.visualization_name,title:this.get("title")||"",config:{dataset_id:this.dataset_id,chart_dict:this.chart_dict}}).save().then(function(e){e&&e.id?(n.visualization_id=e.id,t.success&&t.success(),console.debug("model::save() - Received visualization id: "+e.id)):(t.error&&t.error(),console.debug("model::save() - Unrecognized response. Saving may have failed."))}).fail(function(n){t.error&&t.error(),console.debug("model::save() - Saving failed.")}),console.debug("model::save() - Saving with configuration.")},load:function(t){var n=t||this.chart_dict;return n&&(console.debug("model::load() - Attempting to load with configuration:"),console.debug(n)),this.reset(),n&&n.attributes?(this.set(n.attributes),this.state("ok","Loading saved visualization..."),this.settings.set(n.settings),this.groups.reset(),this.groups.add(n.groups),this.set("modified",!1),this.trigger("load"),console.debug("model::load() - Loading chart model "+n.attributes.type+"."),!0):(this.set("modified",!0),this.trigger("load"),console.debug("model::load() - Visualization attributes unavailable."),!1)}})},704:function(t,n,e){"use strict";function r(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}Object.defineProperty(n,"__esModule",{value:!0}),n.VisualizationCollection=n.Visualization=void 0;var i=e(9),a=r(i),o=e(1),u=r(o),l=n.Visualization=a.Model.extend({defaults:{config:{}},urlRoot:function(){return Galaxy.root+"api/visualizations"},initialize:function(t){u.isObject(t.config)&&u.isObject(this.defaults.config)&&u.defaults(t.config,this.defaults.config),this._setUpListeners()},_setUpListeners:function(){},set:function(t,n){if("config"===t){var e=this.get("config");u.isObject(e)&&(n=u.extend(u.clone(e),n))}return a.Model.prototype.set.call(this,t,n),this},toString:function(){var t=this.get("id")||"";return this.get("title")&&(t+=":"+this.get("title")),"Visualization("+t+")"}});n.VisualizationCollection=a.Collection.extend({model:l,url:function(){return Galaxy.root+"api/visualizations"},initialize:function(t,n){n=n||{}},set:function(t,n){var e=this;t=u.map(t,function(t){var n=e.get(t.id);if(!n)return t;var r=n.toJSON();return u.extend(r,t),r}),a.Collection.prototype.set.call(this,t,n)},toString:function(){return["VisualizationCollection(",[this.historyId,this.length].join(),")"].join("")}})},705:function(t,n,e){"use strict";(function(t,r){function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var a=e(10),o=i(a),u=e(5),l=(i(u),e(80)),s=i(l),c=e(706),f=i(c),h=e(707),d=i(h),p=e(708),g=i(p);n.default=t.View.extend({initialize:function(t,n){var e=this;this.app=t,this.chart=this.app.chart,this.description=new g.default(this.app),this.title=new o.default.Input({onchange:function(){e.chart.set("title",e.title.value())}}),this.tabs=new s.default.View({}),this.tabs.add({id:"settings",icon:"fa fa-gear",tooltip:"Change settings.",$el:r("
").append(new o.default.Label({title:"Provide a title:"}).$el).append(this.title.$el).append(r("
").addClass("ui-form-info ui-margin-bottom").html("This title will appear in the list of 'Saved Visualizations'.")).append(new d.default(this.app).$el)}),this.chart.plugin.groups&&this.tabs.add({id:"groups",icon:"fa-database",tooltip:"Select data.",$el:new f.default(this.app).$el}),this.setElement("
"),this.$el.append(this.description.$el),this.$el.append(this.tabs.$el),this.listenTo(this.chart,"load",function(){e.title.value(e.chart.get("title"))})}})}).call(n,e(2),e(0))},706:function(t,n,e){"use strict";(function(t,r,i){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var o=e(5),u=a(o),l=e(10),s=(a(l),e(26)),c=a(s),f=e(233),h=a(f),d=e(188),p=a(d),g=t.View.extend({initialize:function(t,n){var e=this;this.deferred=t.deferred,this.chart=t.chart,this.group=n.group,this.setElement(r("
")),this.listenTo(this.chart,"change:dataset_id",function(){e.render()}),this.render()},render:function(){var t=this,n=u.default.clone(this.chart.plugin.groups)||[],e=this.chart.get("dataset_id");e&&(this.chart.state("wait","Loading metadata..."),this.deferred.execute(function(r){u.default.get({url:Galaxy.root+"api/datasets/"+e,cache:!0,success:function(e){var i={};p.default.visitInputs(n,function(n,r){if("data_column"==n.type){i[r]=u.default.clone(n);var a=[];n.is_auto&&a.push({label:"Column: Row Number",value:"auto"}),n.is_zero&&a.push({label:"Column: None",value:"zero"});var o=e.metadata_column_types;for(var l in o)(-1!=["int","float"].indexOf(o[l])&&n.is_numeric||n.is_label)&&a.push({label:"Column: "+(parseInt(l)+1),value:l});n.data=a}var s=t.group.get(r);void 0===s||n.hidden||(n.value=s)}),n.push({name:"__data_columns",type:"hidden",hidden:!0,value:i}),t.chart.state("ok","Metadata initialized..."),t.form=new c.default({inputs:n,cls:"ui-portlet-plain",onchange:function(){t.group.set(t.form.data.create()),t.chart.set("modified",!0),t.chart.trigger("redraw")}}),t.group.set(t.form.data.create()),t.$el.empty().append(t.form.$el),r.resolve(),t.chart.trigger("redraw")}})}))}});n.default=t.View.extend({initialize:function(t){var n=this;this.app=t,this.chart=t.chart,this.repeat=new h.default.View({title:"Data series",title_new:"Data series",min:1,onnew:function(){n.chart.groups.add({id:u.default.uid()})}}),this.setElement(r("
").append(this.repeat.$el)),this.listenTo(this.chart.groups,"remove",function(t){n.repeat.del(t.id),n.chart.trigger("redraw")}),this.listenTo(this.chart.groups,"reset",function(){n.repeat.delAll()}),this.listenTo(this.chart.groups,"add",function(t){n.repeat.add({id:t.id,cls:"ui-portlet-panel",$el:new g(n.app,{group:t}).$el,ondel:function(){n.chart.groups.remove(t)}})})},render:function(){i.size(this.chart.plugin.groups)>0?this.repeat.$el.show():this.repeat.$el.hide()}})}).call(n,e(2),e(0),e(1))},707:function(t,n,e){"use strict";(function(t,r){function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var a=e(5),o=i(a),u=e(26),l=i(u),s=e(188),c=i(s);n.default=t.View.extend({initialize:function(t,n){var e=this;this.chart=t.chart,this.setElement("
"),this.listenTo(this.chart,"load",function(){e.render()})},render:function(){var t=this,n=o.default.clone(this.chart.plugin.settings)||[],e=this.chart.plugin.specs.use_panels;"optional"==e?n.push({name:"__use_panels",type:"boolean",label:"Use multi-panels",help:"Would you like to separate your data into individual panels?"}):this.chart.settings.set("__use_panels","yes"==e?"true":"false"),this.$el.empty().addClass("ui-margin-bottom"),r.size(n)>0&&(c.default.visitInputs(n,function(n,e){var r=t.chart.settings.get(e);void 0===r||n.hidden||(n.value=r)}),this.form=new l.default({inputs:n,cls:"ui-portlet-plain",onchange:function(){t.chart.settings.set(t.form.data.create()),t.chart.trigger("redraw")}}),this.chart.settings.set(this.form.data.create()),this.$el.append(this.form.$el))}})}).call(n,e(2),e(1))},708:function(t,n,e){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0});var r=e(5),i=function(t){return t&&t.__esModule?t:{default:t}}(r);n.default=t.View.extend({initialize:function(t){this.plugin=t.chart.plugin,this.setElement(this._template()),this.$title=this.$(".charts-description-title"),this.$image=this.$(".charts-description-image"),this.$text=this.$(".charts-description-text"),this.render()},render:function(){this.plugin.logo?(this.$image.attr("src",Galaxy.root+this.plugin.logo),this.$title.html(this.plugin.html||"Unavailable"),this.$text.html(i.default.linkify(this.plugin.description||"")),this.$el.show()):this.$el.hide()},_template:function(){return'
\n \n \n \n \n \n
\n \n \n
\n
\n
\n
'}})}).call(n,e(2))},709:function(t,n,e){"use strict";(function(t,r){Object.defineProperty(n,"__esModule",{value:!0});var i=e(5),a=function(t){return t&&t.__esModule?t:{default:t}}(i);n.default=t.View.extend({initialize:function(t,n){var e=this;this.app=t,this.chart=this.app.chart,this.options=n,this.setElement(r("
").addClass("charts-viewer").append(r("
").addClass("info").append(r("").addClass("icon")).append(r("").addClass("text")))),this.$info=this.$(".info"),this.$icon=this.$(".icon"),this.$text=this.$(".text"),this._fullscreen(this.$el,20),this._createContainer("div"),this.chart.on("redraw",function(t){e.chart.get("modified")&&e.chart.plugin.specs.confirm&&!t?e.chart.state("info","Please confirm the settings before rendering the results."):e.app.deferred.execute(function(t){console.debug("viewer:redraw() - Redrawing..."),e._draw(t,e.chart)})}),this.chart.on("set:state",function(){var t=e.$(".charts-viewer-container"),n=e.$info,r=e.$icon,i=e.$text;switch(r.removeClass(),n.show(),i.html(e.chart.get("state_info")),e.chart.get("state")){case"ok":n.hide(),t.show();break;case"failed":r.addClass("icon fa fa-warning"),t.hide();break;case"info":r.addClass("icon fa fa-info"),t.hide();break;default:r.addClass("icon fa fa-spinner fa-spin"),t.show()}})},_fullscreen:function(t,n){t.css("height",r(window).height()-n),r(window).resize(function(){t.css("height",r(window).height()-n)})},_createContainer:function(t,n){t=t||"div",n=n||1,this.$(".charts-viewer-container").remove(),this.targets=[];for(var e=0;e").addClass("charts-viewer-container").width(parseInt(100/n)+"%").append(r("<"+t+" class='charts-viewer-canvas' />").attr("id",i));this.$el.append(o),this.targets.push(i)}},_draw:function(t,n){var e="true"==n.settings.get("__use_panels")?n.groups.length:1;this._createContainer(n.plugin.specs.tag,e),n.set("date",a.default.time()),n.state("wait","Please wait..."),this.app.chart_load({process:t,chart:n,dataset:this.app.dataset,targets:this.targets})}})}).call(n,e(2),e(0))},710:function(t,n,e){"use strict";(function(t){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var i=e(10),a=r(i),o=e(711),u=r(o),l=e(5);r(l);n.default=t.View.extend({initialize:function(n){var e=this;this.app=n,this.model=new t.Model({visible:!0}),this.execute_button=new a.default.ButtonIcon({icon:"fa-check-square",tooltip:"Confirm",onclick:function(){n.chart.trigger("redraw",!0)}}),this.export_button=new a.default.ButtonMenu({icon:"fa-camera",tooltip:"Export"}),this.export_button.addMenu({key:"png",title:"Save as PNG",icon:"fa-file",onclick:function(){e._wait(n.chart,function(){u.default.createPNG({$el:n.viewer.$el,title:n.chart.get("title"),error:function(t){n.message.update({message:t,status:"danger"})}})})}}),this.export_button.addMenu({key:"svg",title:"Save as SVG",icon:"fa-file-text-o",onclick:function(){e._wait(n.chart,function(){u.default.createSVG({$el:n.viewer.$el,title:n.chart.get("title"),error:function(t){n.message.update({message:t,status:"danger"})}})})}}),this.export_button.addMenu({key:"pdf",title:"Save as PDF",icon:"fa-file-o",onclick:function(){n.modal.show({title:"Send visualization data for PDF creation",body:"Galaxy does not provide integrated PDF export scripts. You may click 'Continue' to create the PDF by using a 3rd party service (https://export.highcharts.com).",buttons:{Cancel:function(){n.modal.hide()},Continue:function(){n.modal.hide(),e._wait(n.chart,function(){u.default.createPDF({$el:n.viewer.$el,title:n.chart.get("title"),error:function(t){n.message.update({message:t,status:"danger"})}})})}}})}}),this.left_button=new a.default.ButtonIcon({icon:"fa-angle-double-left",tooltip:"Show",onclick:function(){e.model.set("visible",!0),window.dispatchEvent(new Event("resize"))}}),this.right_button=new a.default.ButtonIcon({icon:"fa-angle-double-right",tooltip:"Hide",onclick:function(){e.model.set("visible",!1),window.dispatchEvent(new Event("resize"))}}),this.save_button=new a.default.ButtonIcon({icon:"fa-save",tooltip:"Save",onclick:function(){n.chart.get("title")?(n.message.update({message:"Saving '"+n.chart.get("title")+"'. It will appear in the list of 'Saved Visualizations'.",status:"success"}),n.chart.save({error:function(){n.message.update({message:"Could not save visualization.",status:"danger"})}})):n.message.update({message:"Please provide a name.",status:"danger"})}}),this.buttons=[this.left_button,this.right_button,this.execute_button,this.export_button,this.save_button],this.setElement("
");var r=!0,i=!1,o=void 0;try{for(var l,s=this.buttons[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var c=l.value;this.$el.append(c.$el)}}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}this.listenTo(this.model,"change",function(){return e.render()}),this.render()},render:function(){var t=this.model.get("visible");this.app.$el[t?"removeClass":"addClass"]("charts-fullscreen"),this.execute_button.model.set("visible",t&&!!this.app.chart.plugin.specs.confirm),this.save_button.model.set("visible",t),this.export_button.model.set("visible",t),this.right_button.model.set("visible",t),this.left_button.model.set("visible",!t);var n=this.app.chart.plugin.specs.exports||[];this.export_button.collection.each(function(t){t.set("visible",-1!==n.indexOf(t.get("key")))})},_wait:function(t,n){this.app.deferred.ready()?n():this.app.message.update({message:"Your visualization is currently being processed. Please wait and try again."})}})}).call(n,e(2))},711:function(t,n,e){"use strict";(function(t){function e(t){t.$el.find("svg").length>0?i(t):r(t.$el.find(".charts-viewer-canvas"))}function r(n){try{if(0!==n.width()&&0!==n.height()){var e=function n(e,a,o){var u=e.prop("tagName").toLowerCase(),l=e.position(),s=a+l.left+parseInt(e.css("marginLeft"),10)+parseInt(e.css("borderLeftWidth"),10)+parseInt(e.css("paddingLeft"),10),c=o+l.top+parseInt(e.css("marginTop"),10)+parseInt(e.css("borderTopWidth"),10)+parseInt(e.css("paddingTop"),10);r.width;"div"==u||"span"==u?e.children().each(function(){n(t(this),s,c)}):"canvas"==u&&i.drawImage(e[0],s,c)},r=document.createElement("canvas");r.width=n.outerWidth(!0),r.height=n.outerHeight(!0);var i=r.getContext("2d");i.save(),i.fillStyle="rgb(255,255,255)",i.fillRect(0,0,r.width,r.height),i.restore(),i.translate(0,0),i.textAlign="left",i.textBaseline="top",n.children().each(function(){e(t(this),0,0)});var a=r.toDataURL("image/png");a&&(window.location.href=a.replace("image/png","image/octet-stream"))}}catch(t){console.debug("FAILED - screenshot::_canvas2png() - "+t),options.error&&options.error("Please reduce your visualization to a single panel and try again.")}}function i(n){var e=u(n),r=document.createElement("canvas"),i=r.getContext("2d"),a=new Image,o=t('
').append(t(r));t("body").append(o),r.width=5*e.width,r.height=5*e.height,a.src="data:image/svg+xml;base64,"+btoa(e.string),a.onload=function(){i.drawImage(a,0,0,r.width,r.height),window.location.href=r.toDataURL("image/png").replace("image/png","image/octet-stream"),o.remove()}}function a(t){window.location.href="data:none/none;base64,"+btoa(u(t).string)}function o(n){var e=u(n),r={filename:"visualization",type:"application/pdf",height:e.height,width:e.width,scale:2,svg:e.string},i=t("body"),a=i.find("#viewer-form");0===a.length&&(a=t("",{id:"viewer-form",method:"post",action:"http://export.highcharts.com/",display:"none"}),i.append(a)),a.empty();for(var o in r){var l=t("",{type:"hidden",name:o,value:r[o]});a.append(l)}try{a.submit()}catch(t){console.log(t)}}function u(n){var e=n.$el.find("svg");if(0==e.length&&n.error)return void n.error("No SVG found. This visualization type does not support SVG/PDF export.");var r=(n.$el,e.length),i=parseInt(e.first().css("height")),a=parseInt(e.first().css("width")),o=new XMLSerializer,u=t("").attr({version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:a*r,height:i}),s=0;return e.each(function(){var n=t(this).clone();l(n);var e=t('').attr("xmlns","http://www.w3.org/2000/svg");e.append(n.find("g").first()),u.append(e),s+=a}),{string:o.serializeToString(u[0]),height:i,width:a}}function l(t){for(var n in document.styleSheets){var e=document.styleSheets[n],r=e.cssRules;if(r)for(var i=0,a=r.length;i",{css:{position:"absolute",top:"-200px",left:i?"0px":"-1000px", // the check will work anyway, as when moving the node will be loaded first and checked again if(v === 'i' && !ins.is_loaded(p)) { } */ -f=!0,p=0,_=o.data.nodes.length;p<_;p++)if(g=o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",m=u,"move_node"===g&&"a"===M&&o.data.origin&&o.data.origin===w&&d===w.get_parent(o.data.nodes[p])&&(v=w.get_node(d),m>t.inArray(o.data.nodes[p],v.children)&&(m-=1)),!(f=f&&(w&&w.settings&&w.settings.dnd&&!1===w.settings.dnd.check_while_dragging||w.check(g,o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[p]):o.data.nodes[p],d,m,{dnd:!0,ref:w.get_node(x.parent()),pos:M,is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin})))){w&&w.last_error&&(n=w.last_error());break}if(f)return"i"===M&&x.parent().is(".jstree-closed")&&w.settings.dnd.open_timeout&&(i=setTimeout(function(t,e){return function(){t.open_node(e)}}(w,x),w.settings.dnd.open_timeout)),e={ins:w,par:d,pos:"i"!==M||"last"!==y||0!==u||w.is_loaded(b)?u:"last"},r.css({left:s+"px",top:l+"px"}).show(),o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),n={},h=!0,!1}),!0===h))return}else{for(f=!0,p=0,_=o.data.nodes.length;p<_&&(f=f&&w.check(o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[p]):o.data.nodes[p],"#","last",{dnd:!0,ref:w.get_node("#"),pos:"i",is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin}));p++);if(f)return e={ins:w,par:"#",pos:"last"},r.hide(),void o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok")}e=!1,o.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),r.hide()}}).bind("dnd_scroll.vakata",function(t,n){n&&n.data&&n.data.jstree&&(r.hide(),e=!1,n.helper.find(".jstree-icon:eq(0)").removeClass("jstree-ok").addClass("jstree-er"))}).bind("dnd_stop.vakata",function(a,o){if(i&&clearTimeout(i),o&&o.data&&o.data.jstree){r.hide();var s,l,c=[];if(e){for(s=0,l=o.data.nodes.length;s
").html(r).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),t(document).bind("mousemove touchmove",t.vakata.dnd.drag),t(document).bind("mouseup touchend",t.vakata.dnd.stop),!1},drag:function(n){if("touchmove"===n.type&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n.target=document.elementFromPoint(n.originalEvent.changedTouches[0].pageX-window.pageXOffset,n.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_down){if(!e.is_drag){if(!(Math.abs(n.pageX-e.init_x)>(e.is_touch?t.vakata.dnd.settings.threshold_touch:t.vakata.dnd.settings.threshold)||Math.abs(n.pageY-e.init_y)>(e.is_touch?t.vakata.dnd.settings.threshold_touch:t.vakata.dnd.settings.threshold)))return;e.helper&&(e.helper.appendTo("body"),e.helper_w=e.helper.outerWidth()),e.is_drag=!0,t.vakata.dnd._trigger("start",n)}var i=!1,r=!1,a=!1,o=!1,s=!1,l=!1,c=!1,d=!1,u=!1,h=!1;return e.scroll_t=0,e.scroll_l=0,e.scroll_e=!1,t(t(n.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(t(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var i=t(this),r=i.offset();if(this.scrollHeight>this.offsetHeight&&(r.top+i.height()-n.pageYthis.offsetWidth&&(r.left+i.width()-n.pageXo&&n.pageY-co&&o-(n.pageY-c)l&&n.pageX-dl&&l-(n.pageX-d)a&&(u=a-50),s&&h+e.helper_w>s&&(h=s-(e.helper_w+2)),e.helper.css({left:h+"px",top:u+"px"})),t.vakata.dnd._trigger("move",n),!1}},stop:function(n){if("touchend"===n.type&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n.target=document.elementFromPoint(n.originalEvent.changedTouches[0].pageX-window.pageXOffset,n.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_drag)t.vakata.dnd._trigger("stop",n);else if("touchend"===n.type&&n.target===e.target){var i=setTimeout(function(){t(n.target).click()},100);t(n.target).one("click",function(){i&&clearTimeout(i)})}return t.vakata.dnd._clean(),!1}}}(t),t.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},t.jstree.plugins.search=function(e,n){this.bind=function(){n.bind.call(this),this._data.search.str="",this._data.search.dom=t(),this._data.search.res=[],this._data.search.opn=[],this.element.on("before_open.jstree",t.proxy(function(e,n){var i,r,a=this._data.search.res,o=[],s=t();if(a&&a.length&&(this._data.search.dom=t(this.element[0].querySelectorAll("#"+t.map(a,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(t.jstree.idregex,"\\$&"):e.replace(t.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this.settings.search.show_only_matches&&this._data.search.res.length)){for(i=0,r=a.length;i32&&(n.fuzzy=!1),n.fuzzy&&(i=1<=p;l--)if(m=r[e.charAt(l-1)],g[l]=0===o?(g[l+1]<<1|1)&m:(g[l+1]<<1|1)&m|(f[l+1]|f[l])<<1|1|f[l+1],g[l]&i&&(x=a(o,l-1))<=y){if(y=x,b=l-1,k.push(b),!(b>s))break;p=Math.max(1,2*s-b)}if(a(o+1,s)>y)break;f=g}return{isMatch:b>=0,score:x}},!0===e?{search:o}:o(e)}}(t),t.jstree.defaults.sort=function(t,e){return this.get_text(t)>this.get_text(e)?1:-1},t.jstree.plugins.sort=function(e,n){this.bind=function(){n.bind.call(this),this.element.on("model.jstree",t.proxy(function(t,e){this.sort(e.parent,!0)},this)).on("rename_node.jstree create_node.jstree",t.proxy(function(t,e){this.sort(e.parent||e.node.parent,!1),this.redraw_node(e.parent||e.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",t.proxy(function(t,e){this.sort(e.parent,!1),this.redraw_node(e.parent,!0)},this))},this.sort=function(e,n){var i,r;if((e=this.get_node(e))&&e.children&&e.children.length&&(e.children.sort(t.proxy(this.settings.sort,this)),n))for(i=0,r=e.children_d.length;ie.ttl)&&(e&&e.state&&(e=e.state),e&&t.isFunction(this.settings.state.filter)&&(e=this.settings.state.filter.call(this,e)),!!e&&(this.element.one("set_state.jstree",function(n,i){i.instance.trigger("restore_state",{state:t.extend(!0,{},e)})}),this.set_state(e),!0))},this.clear_state=function(){return t.vakata.storage.del(this.settings.state.key)}},function(t,e){t.vakata.storage={set:function(t,e){return window.localStorage.setItem(t,e)},get:function(t){return window.localStorage.getItem(t)},del:function(t){return window.localStorage.removeItem(t)}}}(t),t.jstree.defaults.types={"#":{},default:{}},t.jstree.plugins.types=function(n,i){this.init=function(t,n){var r,a;if(n&&n.types&&n.types.default)for(r in n.types)if("default"!==r&&"#"!==r&&n.types.hasOwnProperty(r))for(a in n.types.default)n.types.default.hasOwnProperty(a)&&n.types[r][a]===e&&(n.types[r][a]=n.types.default[a]);i.init.call(this,t,n),this._model.data["#"].type="#"},this.refresh=function(t,e){i.refresh.call(this,t,e),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",t.proxy(function(t,n){var i,r,a=this._model.data,o=n.nodes,s=this.settings.types,l="default";for(i=0,r=o.length;i .jstree-ocl",t.proxy(function(e){e.stopImmediatePropagation();var n=t.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});t(e.currentTarget).closest(".jstree-node").children(".jstree-anchor:eq(0)").trigger(n).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",t.proxy(function(t){return t.stopImmediatePropagation(),this.hover_node(t.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",t.proxy(function(t){this.dehover_node(t.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),n.teardown.call(this)},this.redraw_node=function(e,i,r){if(e=n.redraw_node.call(this,e,i,r)){var a=p.cloneNode(!0);-1!==t.inArray(e.id,this._data.core.selected)&&(a.className+=" jstree-wholerow-clicked"),e.insertBefore(a,e.childNodes[0])}return e}}}})},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=t.Model.extend({urlRoot:Galaxy.root+"api/groups"}),i=t.Collection.extend({url:Galaxy.root+"api/groups",model:n});e.default={Group:n,Groups:i}}).call(e,n(2))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t){Galaxy.user||(Galaxy.user=new L.default.User(t.user_json)),Galaxy.masthead||(Galaxy.masthead=new E.default.View(t),Galaxy.modal=new I.default.View,(0,h.default)("#masthead").replaceWith(Galaxy.masthead.render().$el))}function a(t){new A.default.GalaxyApp(t)}function o(t){new v.default.GalaxyApp(t)}function s(t){new b.default.GalaxyApp(t)}function l(t){new g.default(t)}function c(t){new S.default.GalaxyApp(t)}function d(t){var e=new W.default.HistoryCollection([],{includeDeleted:t.includingDeleted,order:t.order,limitOnFirstFetch:t.limit,limitPerFetch:t.limit,currentHistoryId:t.current_history_id}),n=new q.default.MultiPanelColumns({el:(0,h.default)("#center").get(0),histories:e});e.fetchFirst({silent:!0}).done(function(){n.createColumns(),n.render(0)})}Object.defineProperty(e,"__esModule",{value:!0}),e.bundleEntries=void 0,e.mastheadEntry=r,e.adminToolshedEntry=a,e.tracksterEntry=o,e.circsterEntry=s,e.workflowEntry=l,e.libraryEntry=c,e.multiHistoryEntry=d;var u=n(0),h=i(u);n(193);var f=n(70),p=i(f),_=n(716),g=i(_),m=n(61),v=i(m),y=n(725),b=i(y),w=n(726),x=i(w),k=n(727),M=i(k),C=n(728),S=i(C),T=n(738),A=i(T),j=n(73),E=i(j),O=n(60),L=i(O),N=n(17),I=i(N),P=n(746),D=i(P),R=n(14),z=i(R),$=n(144),W=i($),G=n(748),V=i(G),H=n(57),F=i(H),Y=n(754),q=i(Y),U=n(157),B=i(U),X=n(755),J=i(X),Q=n(143),K=i(Q),Z=n(179),tt=i(Z),et=n(145),nt=i(et),it=n(71),rt=i(it),at=n(756),ot=i(at),st=n(759),lt=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(st),ct=n(760),dt=i(ct);window.Galaxy&&void 0===window.Galaxy.debug&&(0,rt.default)(window.Galaxy,"GalaxyApp");var ut=e.bundleEntries={library:c,masthead:r,workflow:l,trackster:o,circster:s,adminToolshed:a,pages:D.default,phyloviz:x.default.PhylovizView,createTabularDatasetChunkedView:z.default.createTabularDatasetChunkedView,multiHistory:d,history:B.default.historyEntry,History:W.default.History,HistoryContents:F.default.HistoryContents,SweepsterVisualization:M.default.SweepsterVisualization,SweepsterVisualizationView:M.default.SweepsterVisualizationView,HistoryCopyDialog:K.default,HistoryViewAnnotated:J.default,Trackster:v.default,StructureView:V.default,HDAListItemEdit:tt.default,HDAModel:nt.default,GalaxyApp:p.default,LegacyGridView:ot.default,run_stats:lt,ToolshedGroups:dt.default};window.bundleEntries=ut},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}function o(e){var n=t("#galaxy_tools").contents();if(0===n.length&&(n=t(document),t(this).removeClass("search_active"),n.find(".toolTitle").removeClass("search_match"),n.find(".toolSectionBody").hide(),n.find(".toolTitle").show(),n.find(".toolPanelLabel").show(),n.find(".toolSectionWrapper").each(function(){"recently_used_wrapper"!==t(this).attr("id")?t(this).show():t(this).hasClass("user_pref_visible")&&t(this).show()}),n.find("#search-no-results").hide(),n.find("#search-spinner").hide(),e)){n.find("#tool-search-query").val("search tools")}}function s(e,n){var i=y.default[n];if(i){var r=t(' ').addClass(i);e.before(r)}}Object.defineProperty(e,"__esModule",{value:!0});var l=n(3),c=a(l),d=n(5),u=a(d),h=n(717),f=a(h),p=n(718),_=a(p),g=n(719),m=a(g),v=n(216),y=a(v),b=n(724),w=a(b),x=n(10),k=a(x),M=n(229),C=a(M),S=n(20);!function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t}(S);n(19),window.workflow_globals=window.workflow_globals||{},e.default=i.View.extend({initialize:function(e){function n(){var e=t('
');window.show_modal("Save As a New Workflow",e,{OK:function(){var e=t("#workflow_rename").val().length>0?t("#workflow_rename").val():"SavedAs_"+l.workflow.name,n=t("#wf_annotation").val().length>0?t("#wf_annotation").val():"";t.ajax({url:l.urls.workflow_save_as,type:"POST",data:{workflow_name:e,workflow_annotation:n,workflow_data:function(){return JSON.stringify(l.workflow.to_simple())}}}).done(function(t){window.onbeforeunload=void 0,window.location=Galaxy.root+"workflow/editor?id="+t,hide_modal()}).fail(function(){hide_modal(),alert("Saving this workflow failed. Please contact this site's administrator.")})},Cancel:hide_modal})}function i(){l.workflow.layout(),l.workflow.fit_canvas_to_nodes(),l.scroll_to_nodes(),l.canvas_manager.draw_overview()}function a(){t.jStorage.set("overview-off",!1),t("#overview-border").css("right","0px"),t("#close-viewport").css("background-position","0px 0px")}function s(){t.jStorage.set("overview-off",!0),t("#overview-border").css("right","20000px"),t("#close-viewport").css("background-position","12px 0px")}var l=window.workflow_globals.app=this;this.options=e,this.urls=e&&e.urls||{};var c=function(){if(l.workflow.check_changes_in_active_form(),workflow&&l.workflow.has_changes){var t=function(){window.onbeforeunload=void 0,window.document.location=l.urls.workflow_index};window.show_modal("Close workflow editor","There are unsaved changes to your workflow which will be lost.",{Cancel:hide_modal,"Save Changes":function(){d(null,t)}},{"Don't Save":t})}else window.document.location=l.urls.workflow_index},d=function(e,n){if(show_message("Saving workflow","progress"),l.workflow.check_changes_in_active_form(),!l.workflow.has_changes)return hide_modal(),void(n&&n());l.workflow.rectify_workflow_outputs(),u.default.request({url:Galaxy.root+"api/workflows/"+l.options.id,type:"PUT",data:{workflow:l.workflow.to_simple()},success:function(e){var i=t("
").text(e.message);if(e.errors){i.addClass("warningmark");var r=t("
    ");t.each(e.errors,function(e,n){t("
  • ").text(n).appendTo(r)}),i.append(r)}else i.addClass("donemark");l.workflow.name=e.name,l.workflow.has_changes=!1,l.workflow.stored=!0,l.showWorkflowParameters(),e.errors?window.show_modal("Saving workflow",i,{Ok:hide_modal}):(n&&n(),hide_modal())},error:function(t){window.show_modal("Saving workflow failed.",t.err_msg,{Ok:hide_modal})}})};t("#tool-search-query").click(function(){t(this).focus(),t(this).select()}).keyup(function(){if(t(this).css("font-style","normal"),this.value.length<3)o(!1);else if(this.value!=this.lastValue){t(this).addClass("search_active");var e=this.value;this.timer&&clearTimeout(this.timer),t("#search-spinner").show(),this.timer=setTimeout(function(){t.get(l.urls.tool_search,{q:e},function(e){if(t("#search-no-results").hide(),t(".toolSectionWrapper").hide(),t(".toolSectionWrapper").find(".toolTitle").hide(),0!=e.length){var n=t.map(e,function(t,e){return"link-"+t});t(n).each(function(e,n){t("[id='"+n+"']").parent().addClass("search_match"),t("[id='"+n+"']").parent().show().parent().parent().show().parent().show()}),t(".toolPanelLabel").each(function(){for(var e=t(this),n=e.next(),i=!0;0!==n.length&&n.hasClass("toolTitle");){if(n.is(":visible")){i=!1;break}n=n.next()}i&&e.hide()})}else t("#search-no-results").show();t("#search-spinner").hide()},"json")},400)}this.lastValue=this.value}),this.canvas_manager=window.workflow_globals.canvas_manager=new _.default(this,t("#canvas-viewport"),t("#overview")),this.reset(),this.datatypes=JSON.parse(t.ajax({url:Galaxy.root+"api/datatypes",async:!1}).responseText),this.datatypes_mapping=JSON.parse(t.ajax({url:Galaxy.root+"api/datatypes/mapping",async:!1}).responseText),this.ext_to_type=this.datatypes_mapping.ext_to_class_name,this.type_to_type=this.datatypes_mapping.class_to_classes,this._workflowLoadAjax(l.options.id,{success:function(t){l.reset(),l.workflow.from_simple(t,!0),l.workflow.has_changes=!1,l.workflow.fit_canvas_to_nodes(),l.scroll_to_nodes(),l.canvas_manager.draw_overview();var e="";r.each(t.steps,function(n,i){var a="";n.errors&&(a+="
  • "+n.errors+"
  • "),r.each(t.upgrade_messages[i],function(t){a+="
  • "+t+"
  • "}),a&&(e+="
  • Step "+(parseInt(i,10)+1)+": "+l.workflow.nodes[i].name+"
      "+a+"
  • ")}),e?window.show_modal("Issues loading this workflow","Please review the following issues, possibly resulting from tool upgrades or changes.

      "+e+"

    ",{Continue:hide_modal}):hide_modal(),l.showWorkflowParameters()},beforeSubmit:function(t){show_message("Loading workflow","progress")}}),window.make_popupmenu&&make_popupmenu(t("#workflow-options-button"),{Save:d,"Save As":n,Run:function(){window.location=Galaxy.root+"workflows/run?id="+l.options.id},"Edit Attributes":function(){l.workflow.clear_active_node()},"Auto Re-layout":i,Close:c});var h=t.jStorage.get("overview-size");void 0!==h&&t("#overview-border").css({width:h,height:h}),t.jStorage.get("overview-off")?s():a(),t("#overview-border").bind("dragend",function(e,n){var i=t(this).offsetParent(),r=i.offset(),a=Math.max(i.width()-(n.offsetX-r.left),i.height()-(n.offsetY-r.top));t.jStorage.set("overview-size",a+"px")}),t("#close-viewport").click(function(){"0px"===t("#overview-border").css("right")?s():a()}),window.onbeforeunload=function(){if(workflow&&l.workflow.has_changes)return"There are unsaved changes to your workflow which will be lost."},this.options.workflows.length>0&&t("#left").find(".toolMenu").append(this._buildToolPanelWorkflows()),t("div.toolSectionBody").hide(),t("div.toolSectionTitle > span").wrap("");var f=null;t("div.toolSectionTitle").each(function(){var e=t(this).next("div.toolSectionBody");t(this).click(function(){e.is(":hidden")?(f&&f.slideUp("fast"),f=e,e.slideDown("fast")):(e.slideUp("fast"),f=null)})}),(0,C.default)("workflow-name","workflow-name",l.urls.rename_async,"new_name"),t("#workflow-tag").click(function(){return t(".tag-area").click(),!1}),(0,C.default)("workflow-annotation","workflow-annotation",l.urls.annotate_async,"new_annotation",25,!0,4)},_buildToolPanelWorkflows:function(){var e=this,n=t('
    ');return r.each(this.options.workflows,function(i){if(i.id!==e.options.id){var r=new k.default.ButtonIcon({icon:"fa fa-copy",cls:"ui-button-icon-plain",tooltip:(0,c.default)("Copy and insert individual steps"),onclick:function(){i.step_count<2?e.copy_into_workflow(i.id,i.name):Galaxy.modal.show({title:(0,c.default)("Warning"),body:"This will copy "+i.step_count+" new steps into your workflow.",buttons:{Cancel:function(){Galaxy.modal.hide()},Copy:function(){Galaxy.modal.hide(),e.copy_into_workflow(i.id,i.name)}}})}}),a=t("").attr("href","#").html(i.name).on("click",function(){e.add_node_for_subworkflow(i.latest_id,i.name)});n.find(".toolSectionBg").append(t("
    ").addClass("toolTitle").append(a).append(r.$el))}}),n},copy_into_workflow:function(e){var n=this;this._workflowLoadAjax(e,{success:function(e){n.workflow.from_simple(e,!1);var i="";t.each(e.upgrade_messages,function(e,r){i+="
  • Step "+(parseInt(e,10)+1)+": "+n.workflow.nodes[e].name+"
      ",t.each(r,function(t,e){i+="
    • "+e+"
    • "}),i+="
  • "}),i?window.show_modal("Subworkflow embedded with changes","Problems were encountered loading this workflow (possibly a result of tool upgrades). Please review the following parameters and then save.
      "+i+"
    ",{Continue:hide_modal}):hide_modal()},beforeSubmit:function(t){show_message("Importing workflow","progress")}})},reset:function(){this.workflow&&this.workflow.remove_all(),this.workflow=window.workflow_globals.workflow=new f.default(this,t("#canvas-container"))},scroll_to_nodes:function(){var e,n,i=t("#canvas-viewport"),r=t("#canvas-container");n=r.width()"+n+"";return e+=""},showWorkflowParameters:function(){var e=/\$\{.+?\}/g,n=[],i=t("#workflow-parameters-container"),r=t("#workflow-parameters-box"),a="",o=[];t.each(this.workflow.nodes,function(i,r){r.config_form&&r.config_form.inputs&&u.default.deepeach(r.config_form.inputs,function(t){if("string"==typeof t.value){var n=t.value.match(e);n&&(o=o.concat(n))}}),r.post_job_actions&&t.each(r.post_job_actions,function(n,i){i.action_arguments&&t.each(i.action_arguments,function(t,n){var i=n.match(e);i&&(o=o.concat(i))})}),o&&t.each(o,function(e,i){-1===t.inArray(i,n)&&n.push(i)})}),n&&0!==n.length?(t.each(n,function(t,e){a+="
    "+e.substring(2,e.length-1)+"
    "}),i.html(a),r.show()):(i.html(a),r.hide())},showAttributes:function(){t(".right-content").hide(),t("#edit-attributes").show()},showForm:function(e,n){var i="right-content",r=i+"-"+n.id,a=t("#"+i);if(e&&0==a.find("#"+r).length){var o=t('
    ');if(e.node=n,e.workflow=this.workflow,e.datatypes=this.datatypes,e.icon=y.default[n.type],e.cls="ui-portlet-narrow",n){var s="tool"==n.type?"Tool":"Default";o.append(new w.default[s](e).form.$el),a.append(o)}else Galaxy.emit.debug("workflow-view::initialize()","Node not found in workflow.")}t("."+i).hide(),a.find("#"+r).show(),a.show(),a.scrollTop()},isSubType:function(t,e){return t=this.ext_to_type[t],e=this.ext_to_type[e],this.type_to_type[t]&&e in this.type_to_type[t]},prebuildNode:function(e,n,i){var r=this,a=t("
    "),o=t("
    "+n+"
    ");s(o.find(".nodeTitle"),e),a.append(o),a.css("left",t(window).scrollLeft()+20),a.css("top",t(window).scrollTop()+20),a.append(t("
    "));var l=new m.default(this,{element:a});l.type=e,l.content_id=i;var c="
    loading tool info...
    ";a.find(".toolFormBody").append(c);var d=t("
    ");"subworkflow"!==e&&d.append(t("
    ").addClass("fa-icon-button fa fa-files-o node-clone").click(function(t){l.clone()})),d.append(t("
    ").addClass("fa-icon-button fa fa-times node-destroy").click(function(t){l.destroy()})),a.appendTo("#canvas-container");var u=t("#canvas-container").position(),h=t("#canvas-container").parent(),f=a.width(),p=a.height();return a.css({left:-u.left+h.width()/2-f/2,top:-u.top+h.height()/2-p/2}),d.prependTo(a.find(".toolFormTitle")),f+=d.width()+10,a.css("width",f),a.bind("dragstart",function(){r.workflow.activate_node(l)}).bind("dragend",function(){r.workflow.node_changed(this),r.workflow.fit_canvas_to_nodes(),r.canvas_manager.draw_overview()}).bind("dragclickonly",function(){r.workflow.activate_node(l)}).bind("drag",function(e,n){var i=t(this).offsetParent().offset(),r=n.offsetX-i.left,a=n.offsetY-i.top;t(this).css({left:r,top:a}),t(this).find(".terminal").each(function(){this.terminal.redraw()})}),l}})}).call(e,n(0),n(2),n(1))},function(t,e,n){"use strict";(function(t){function i(t,e){this.app=t,this.canvas_container=e,this.id_counter=0,this.nodes={},this.name=null,this.has_changes=!1,this.active_form_has_changes=!1,this.workflowOutputLabels={}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(410),a=function(t){return t&&t.__esModule?t:{default:t}}(r),o=n(20),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(o);t.extend(i.prototype,{canLabelOutputWith:function(t){return!t||!(t in this.workflowOutputLabels)},registerOutputLabel:function(t){t&&(this.workflowOutputLabels[t]=!0)},unregisterOutputLabel:function(t){t&&delete this.workflowOutputLabels[t]},updateOutputLabel:function(t,e){t&&this.unregisterOutputLabel(t),this.canLabelOutputWith(e)||s.warning("Workflow contains duplicate workflow output labels "+e+". This must be fixed before it can be saved."),e&&this.registerOutputLabel(e)},attemptUpdateOutputLabel:function(t,e,n){return!!this.canLabelOutputWith(n)&&(t.labelWorkflowOutput(e,n),t.nodeView.redrawWorkflowOutputs(),!0)},create_node:function(t,e,n){var i=this.app.prebuildNode(t,e,n);return this.add_node(i),this.fit_canvas_to_nodes(),this.app.canvas_manager.draw_overview(),this.activate_node(i),i},add_node:function(t){t.id=this.id_counter,t.element.attr("id","wf-node-step-"+t.id),t.element.attr("node-label",t.label),this.id_counter++,this.nodes[t.id]=t,this.has_changes=!0,t.workflow=this},remove_node:function(t){this.active_node==t&&this.clear_active_node(),delete this.nodes[t.id],this.has_changes=!0},remove_all:function(){var e=this;t.each(this.nodes,function(t,n){n.destroy(),e.remove_node(n)})},rectify_workflow_outputs:function(){var e=!1,n=!1;if(t.each(this.nodes,function(i,r){r.workflow_outputs&&r.workflow_outputs.length>0&&(e=!0),t.each(r.post_job_actions,function(t,e){"HideDatasetAction"===e.action_type&&(n=!0)})}),!1!==e||!1!==n){var i=this;t.each(this.nodes,function(n,r){if("tool"===r.type){var a=!1;null===r.post_job_actions&&(r.post_job_actions={},a=!0);var o=[];t.each(r.post_job_actions,function(t,e){"HideDatasetAction"==e.action_type&&o.push(t)}),o.length>0&&t.each(o,function(t,e){a=!0,delete r.post_job_actions[e]}),e&&t.each(r.output_terminals,function(t,e){if(!0==!r.isWorkflowOutput(e.name)){a=!0;var n={action_type:"HideDatasetAction",output_name:e.name,action_arguments:{}};r.post_job_actions["HideDatasetAction"+e.name]=null,r.post_job_actions["HideDatasetAction"+e.name]=n}}),i.active_node==r&&!0===a&&i.reload_active_node()}})}},to_simple:function(){var e={};return t.each(this.nodes,function(n,i){var r={};t.each(i.input_terminals,function(e,n){r[n.name]=null;var i=[];t.each(n.connectors,function(t,e){if(e.handle1){var a={id:e.handle1.node.id,output_name:e.handle1.name},o=n.attributes.input.input_subworkflow_step_id;void 0!==o&&(a.input_subworkflow_step_id=o),i[t]=a,r[n.name]=i}})});var a={};i.post_job_actions&&t.each(i.post_job_actions,function(t,e){var n={action_type:e.action_type,output_name:e.output_name,action_arguments:e.action_arguments};a[e.action_type+e.output_name]=null,a[e.action_type+e.output_name]=n}),i.workflow_outputs||(i.workflow_outputs=[]);var o={id:i.id,type:i.type,content_id:i.content_id,tool_version:i.config_form.version,tool_state:i.tool_state,errors:i.errors,input_connections:r,position:t(i.element).position(),annotation:i.annotation,post_job_actions:i.post_job_actions,uuid:i.uuid,label:i.label,workflow_outputs:i.workflow_outputs};e[i.id]=o}),{steps:e}},from_simple:function(e,n){var i=void 0===n||n,r=this,o=0;i?r.name=e.name:o=Object.keys(r.nodes).length;var s=o,l=!1;t.each(e.steps,function(e,n){var a=r.app.prebuildNode(n.type,n.name,n.content_id);i||(n.uuid=null,t.each(n.workflow_outputs,function(t,e){e.uuid=null})),a.init_field_data(n),n.position&&a.element.css({top:n.position.top,left:n.position.left}),a.id=parseInt(n.id)+o,a.element.attr("id","wf-node-step-"+a.id),a.element.attr("node-label",n.label),r.nodes[a.id]=a,s=Math.max(s,parseInt(e)+o),l||(a.workflow_outputs.length>0?l=!0:t.each(a.post_job_actions||[],function(t,e){"HideDatasetAction"===e.action_type&&(l=!0)}))}),r.id_counter=s+1,t.each(e.steps,function(e,n){var i=r.nodes[parseInt(e)+o];t.each(n.input_connections,function(e,n){n&&(t.isArray(n)||(n=[n]),t.each(n,function(t,n){var s=r.nodes[parseInt(n.id)+o],l=new a.default;l.connect(s.output_terminals[n.output_name],i.input_terminals[e]),l.redraw()}))}),l&&t.each(i.output_terminals,function(e,n){if(void 0===i.post_job_actions["HideDatasetAction"+n.name]){i.addWorkflowOutput(n.name);t(i.element).find(".callout."+n.name).find("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small.png"),r.has_changes=!0}})})},check_changes_in_active_form:function(){this.active_form_has_changes&&(this.has_changes=!0,t("#right-content").find("form").submit(),this.active_form_has_changes=!1)},reload_active_node:function(){if(this.active_node){var t=this.active_node;this.clear_active_node(),this.activate_node(t)}},clear_active_node:function(){this.active_node&&(this.active_node.make_inactive(),this.active_node=null),document.activeElement.blur(),this.app.showAttributes()},activate_node:function(t){this.active_node!=t&&(this.check_changes_in_active_form(),this.clear_active_node(),this.app.showForm(t.config_form,t),t.make_active(),this.active_node=t)},node_changed:function(t,e){this.has_changes=!0,this.active_node==t&&e&&(this.check_changes_in_active_form(),this.app.showForm(t.config_form,t)),this.app.showWorkflowParameters()},layout:function(){this.check_changes_in_active_form(),this.has_changes=!0;var e={},n={};t.each(this.nodes,function(t,i){void 0===e[t]&&(e[t]=0),void 0===n[t]&&(n[t]=[])}),t.each(this.nodes,function(i,r){t.each(r.input_terminals,function(i,a){t.each(a.connectors,function(t,i){var a=i.handle1.node;e[r.id]+=1,n[a.id].push(r.id)})})});for(var i=[];;){var r=[];for(var a in e)0===e[a]&&r.push(a);if(0===r.length)break;i.push(r);for(var o in r){var s=r[o];delete e[s];for(var l in n[s])e[n[s][l]]-=1}}if(!e.length){var c=this.nodes,d=80;t.each(i,function(e,n){n.sort(function(e,n){return t(c[e].element).position().top-t(c[n].element).position().top});var i=0,r=30;t.each(n,function(e,n){var a=c[n],o=t(a.element);t(o).css({top:r,left:d}),i=Math.max(i,t(o).width()),r+=t(o).height()+30}),d+=i+80}),t.each(c,function(t,e){e.redraw()})}},bounds_for_all_nodes:function(){var e,n=1/0,i=-1/0,r=1/0,a=-1/0;return t.each(this.nodes,function(o,s){var l=t(s.element);e=l.position(),n=Math.min(n,e.left),i=Math.max(i,e.left+l.width()),r=Math.min(r,e.top),a=Math.max(a,e.top+l.width())}),{xmin:n,xmax:i,ymin:r,ymax:a}},fit_canvas_to_nodes:function(){function e(t,e){return Math.ceil(t/e)*e}function n(t,e){if(t3*e){return-(t-(Math.ceil(t%e/e)+1)*e)}return 0}var i=this.bounds_for_all_nodes(),r=this.canvas_container.position(),a=this.canvas_container.parent(),o=n(i.xmin,100),s=n(i.ymin,100);o=Math.max(o,r.left),s=Math.max(s,r.top);var l=r.left-o,c=r.top-s,d=e(i.xmax+100,100)+o,u=e(i.ymax+100,100)+s;d=Math.max(d,-l+a.width()),u=Math.max(u,-c+a.height()),this.canvas_container.css({left:l,top:c,width:d,height:u}),this.canvas_container.children().each(function(){var e=t(this).position();t(this).css("left",e.left+o),t(this).css("top",e.top+s)})}}),e.default=i}).call(e,n(0))},function(t,e,n){"use strict";(function(t){function n(t,e,n){this.app=t,this.cv=e,this.cc=this.cv.find("#canvas-container"),this.overview=n,this.oc=n.find("#overview-canvas"),this.ov=n.find("#overview-viewport"),this.init_drag(),this.init_copy_paste()}function i(t){this.panel=t}Object.defineProperty(e,"__esModule",{value:!0}),t.extend(n.prototype,{init_drag:function(){var e=this,n=function(t,n){t=Math.min(t,e.cv.width()/2),t=Math.max(t,-e.cc.width()+e.cv.width()/2),n=Math.min(n,e.cv.height()/2),n=Math.max(n,-e.cc.height()+e.cv.height()/2),e.cc.css({left:t,top:n}),e.cv.css({"background-position-x":t,"background-position-y":n}),e.update_viewport_overlay()};this.cc.each(function(){this.scroll_panel=new i(this)});var r,a;this.cv.bind("click",function(){document.activeElement.blur()}).bind("dragstart",function(){var n=t(this).offset(),i=e.cc.position();a=i.top-n.top,r=i.left-n.left}).bind("drag",function(t,e){n(e.offsetX+r,e.offsetY+a)}).bind("dragend",function(){e.app.workflow.fit_canvas_to_nodes(),e.draw_overview()}),this.overview.click(function(t){if(e.overview.hasClass("blockaclick"))e.overview.removeClass("blockaclick");else{var i=e.cc.width(),r=e.cc.height(),a=e.oc.width(),o=e.oc.height(),s=t.pageX-e.oc.offset().left-e.ov.width()/2,l=t.pageY-e.oc.offset().top-e.ov.height()/2;n(-s/a*i,-l/o*r),e.app.workflow.fit_canvas_to_nodes(),e.draw_overview()}}),this.ov.bind("drag",function(t,i){var r=e.cc.width(),a=e.cc.height(),o=e.oc.width(),s=e.oc.height(),l=i.offsetX-e.overview.offset().left,c=i.offsetY-e.overview.offset().top;n(-l/o*r,-c/s*a)}).bind("dragend",function(){e.overview.addClass("blockaclick"),e.app.workflow.fit_canvas_to_nodes(),e.draw_overview()}),t("#overview-border").bind("drag",function(n,i){var r=t(this).offsetParent(),a=r.offset(),o=Math.max(r.width()-(i.offsetX-a.left),r.height()-(i.offsetY-a.top));t(this).css({width:o,height:o}),e.draw_overview()}),t("#overview-border div").bind("drag",function(){})},init_copy_paste:function(){var t=this;document.addEventListener("copy",function(e){""===window.getSelection().toString()&&(t.app.workflow.active_node&&"subworkflow"!==t.app.workflow.active_node.type&&e.clipboardData.setData("application/json",JSON.stringify({nodeId:t.app.workflow.active_node.id})),e.preventDefault())}),document.addEventListener("paste",function(e){if(document.activeElement&&"textarea"!==document.activeElement.type&&"text"!==document.activeElement.type){var n;try{n=JSON.parse(e.clipboardData.getData("application/json")).nodeId}catch(t){}n&&t.app.workflow.nodes.hasOwnProperty(n)&&t.app.workflow.nodes[n].clone(),e.preventDefault()}})},update_viewport_overlay:function(){var t=this.cc,e=this.cv,n=this.oc,i=this.ov,r=t.width(),a=t.height(),o=n.width(),s=n.height(),l=t.position();i.css({left:-l.left/r*o,top:-l.top/a*s,width:e.width()/r*o-2,height:e.height()/a*s-2})},draw_overview:function(){var e,n,i,r,a=t("#overview-canvas"),o=a.parent().parent().width(),s=a.get(0).getContext("2d"),l=t("#canvas-container").width(),c=t("#canvas-container").height(),d=this.cv.width(),u=this.cv.height();l0&&(s.fillStyle="#E8A92D",s.strokeStyle="#E8A92D"),s.fillRect(d,u,h,f),s.strokeRect(d,u,h,f)}),this.update_viewport_overlay()}}),t.extend(i.prototype,{test:function(e,n){var i=this;clearTimeout(this.timeout);var r=e.pageX,a=e.pageY,o=t(this.panel),s=o.position(),l=o.width(),c=o.height(),d=o.parent(),u=d.width(),h=d.height(),f=d.offset(),p=f.left,_=f.top,g=p+d.width(),m=_+d.height(),v=-(l-u/2),y=-(c-h/2),b=u/2,w=h/2,x=!1,k=0;r-5g?s.left>v&&(k=Math.min(23,s.left-v),o.css("left",s.left-k),x=!0):a-5<_?s.topm&&s.top>y&&(k=Math.min(23,s.top-v),o.css("top",s.top-k+"px"),x=!0),x&&(n(),this.timeout=setTimeout(function(){i.test(e,n)},50))},stop:function(){clearTimeout(this.timeout)}}),e.default=n}).call(e,n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(5),s=a(o),l=n(720),c=a(l),d=t.Model.extend({initialize:function(t,e){this.app=t,this.element=e.element,this.input_terminals={},this.output_terminals={},this.errors={},this.workflow_outputs=[]},getWorkflowOutput:function(t){return i.findWhere(this.workflow_outputs,{output_name:t})},isWorkflowOutput:function(t){return void 0!==this.getWorkflowOutput(t)},removeWorkflowOutput:function(t){for(;this.isWorkflowOutput(t);){var e=this.getWorkflowOutput(t);this.workflow_outputs.splice(i.indexOf(this.workflow_outputs,e),1)}},addWorkflowOutput:function(t,e){if(!this.isWorkflowOutput(t)){var n={output_name:t};return e&&(n.label=e),this.workflow_outputs.push(n),!0}return!1},labelWorkflowOutput:function(t,e){var n=!1,i=null;if(this.isWorkflowOutput(t)){var r=this.getWorkflowOutput(t);i=r.label,r.label=e,n=i!=e}else n=this.addWorkflowOutput(t,e);return n&&(this.app.workflow.updateOutputLabel(i,e),this.markChanged(),this.nodeView.redrawWorkflowOutputs()),n},connectedOutputTerminals:function(){return this._connectedTerminals(this.output_terminals)},_connectedTerminals:function(t){var e=[];return r.each(t,function(t,n){n.connectors.length>0&&e.push(n)}),e},hasConnectedOutputTerminals:function(){var t=this.output_terminals;for(var e in t)if(t[e].connectors.length>0)return!0;return!1},connectedMappedInputTerminals:function(){return this._connectedMappedTerminals(this.input_terminals)},hasConnectedMappedInputTerminals:function(){var t=this.input_terminals;for(var e in t){var n=t[e];if(n.connectors.length>0&&n.isMappedOver())return!0}return!1},_connectedMappedTerminals:function(t){var e=[];return r.each(t,function(t,n){n.mapOver().isCollection&&n.connectors.length>0&&e.push(n)}),e},mappedInputTerminals:function(){return this._mappedTerminals(this.input_terminals)},_mappedTerminals:function(t){var e=[];return r.each(t,function(t,n){n.mapOver().isCollection&&e.push(n)}),e},hasMappedOverInputTerminals:function(){var t=!1;return i.each(this.input_terminals,function(e){e.mapOver().isCollection&&(t=!0)}),t},redraw:function(){r.each(this.input_terminals,function(t,e){e.redraw()}),r.each(this.output_terminals,function(t,e){e.redraw()})},clone:function(){var t=this,e={name:this.name,label:this.label,annotation:this.annotation,post_job_actions:this.post_job_actions},n=this.app.workflow.create_node(this.type,this.name,this.content_id);s.default.request({type:"POST",url:Galaxy.root+"api/workflows/build_module",data:{type:this.type,tool_id:this.content_id,tool_state:this.tool_state},success:function(i){var r=Object.assign({},i,e);n.init_field_data(r),n.update_field_data(r),t.app.workflow.activate_node(n)}})},destroy:function(){r.each(this.input_terminals,function(t,e){e.destroy()}),r.each(this.output_terminals,function(t,e){e.destroy()}),this.app.workflow.remove_node(this),r(this.element).remove()},make_active:function(){r(this.element).addClass("toolForm-active")},make_inactive:function(){var t=this.element.get(0);!function(e){e.removeChild(t),e.appendChild(t)}(t.parentNode),r(t).removeClass("toolForm-active")},set_tool_version:function(){"tool"===this.type&&this.config_form&&(this.tool_version=this.config_form.version,this.content_id=this.config_form.id)},init_field_data:function(t){t.type&&(this.type=t.type),this.name=t.name,this.config_form=t.config_form,this.set_tool_version(),this.tool_state=t.tool_state,this.errors=t.errors,this.tooltip=t.tooltip?t.tooltip:"",this.annotation=t.annotation,this.post_job_actions=t.post_job_actions?t.post_job_actions:{},this.label=t.label,this.uuid=t.uuid,this.workflow_outputs=t.workflow_outputs?t.workflow_outputs:[];var e=this,n=new c.default({el:this.element[0],node:e});e.nodeView=n,r.each(t.data_inputs,function(t,e){n.addDataInput(e)}),t.data_inputs.length>0&&t.data_outputs.length>0&&n.addRule(),r.each(t.data_outputs,function(t,e){n.addDataOutput(e)}),n.render(),this.app.workflow.node_changed(this,!0)},update_field_data:function(t){var e=this,n=e.nodeView,a=[];if(r.each(n.outputViews,function(e,n){var r=n.output.name,o=t.data_outputs,s=!1;i.each(o,function(t){t.name==r&&(s=!0)}),!1===s&&a.push(r)}),i.each(a,function(t){i.each(n.outputViews[t].terminalElement.terminal.connectors,function(t){t&&t.destroy()}),n.outputViews[t].remove(),delete n.outputViews[t],delete e.output_terminals[t]}),r.each(e.workflow_outputs,function(t,n){n&&!e.output_terminals[n.output_name]&&e.workflow_outputs.splice(t,1)}),r.each(t.data_outputs,function(t,i){n.outputViews[i.name]?(e.output_terminals[i.name].datatypes=i.extensions,e.output_terminals[i.name].destroyInvalidConnections()):n.addDataOutput(i)}),this.tool_state=t.tool_state,this.config_form=t.config_form,this.set_tool_version(),this.errors=t.errors,this.annotation=t.annotation,this.label=t.label,"post_job_actions"in t){var o=t.post_job_actions;this.post_job_actions=o||{}}e.nodeView.renderToolErrors();var s=n.$("div.inputs"),l=n.newInputsDiv(),c={};i.each(t.data_inputs,function(t){var n=e.nodeView.addDataInput(t,l);c[t.name]=n}),i.each(i.difference(i.values(n.terminalViews),i.values(c)),function(t){t.el.terminal.destroy()}),n.terminalViews=c,e.nodeView.render(),1==t.data_outputs.length&&"collection_type"in t.data_outputs[0]&&n.updateDataOutput(t.data_outputs[0]),s.replaceWith(l),"workflow_outputs"in t&&(this.workflow_outputs=t.workflow_outputs?t.workflow_outputs:[]),this.markChanged(),this.redraw()},error:function(t){var e=r(this.element).find(".toolFormBody");e.find("div").remove();var n="
    "+t+"
    ";this.config_form=n,e.html(n),this.app.workflow.node_changed(this)},markChanged:function(){this.app.workflow.node_changed(this)}});e.default=d}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(a),s=n(721),l=r(s),c=n(723),d=r(c);e.default=t.View.extend({initialize:function(t){this.node=t.node,this.output_width=Math.max(150,this.$el.width()),this.tool_body=this.$el.find(".toolFormBody"),this.tool_body.find("div").remove(),this.newInputsDiv().appendTo(this.tool_body),this.terminalViews={},this.outputViews={}},render:function(){this.renderToolLabel(),this.renderToolErrors(),this.$el.css("width",Math.min(250,Math.max(this.$el.width(),this.output_width)))},renderToolLabel:function(){this.$(".nodeTitle").text(this.node.label||this.node.name),this.$el.attr("node-label",this.node.label)},renderToolErrors:function(){this.node.errors?this.$el.addClass("tool-node-error"):this.$el.removeClass("tool-node-error")},newInputsDiv:function(){return i("
    ").addClass("inputs")},updateMaxWidth:function(t){this.output_width=Math.max(this.output_width,t)},addRule:function(){this.tool_body.append(i("
    ").addClass("rule"))},addDataInput:function(t,e){var n=!0;e||(e=this.$(".inputs"),n=!1);var i=this.terminalViews[t.name],r="dataset_collection"==t.input_type?l.default.InputCollectionTerminalView:l.default.InputTerminalView;if(!i||i instanceof r||(i.el.terminal.destroy(),i=null),i){var a=i.el.terminal;a.update(t),a.destroyInvalidConnections()}else i=new r({node:this.node,input:t});this.terminalViews[t.name]=i;var o=i.el,s=new d.default.DataInputView({terminalElement:o,input:t,nodeView:this,skipResize:n}),c=s.$el;return e.append(c.prepend(i.terminalElements())),i},addDataOutput:function(t){var e=t.collection?l.default.OutputCollectionTerminalView:l.default.OutputTerminalView,n=new e({node:this.node,output:t}),i=new d.default.DataOutputView({output:t,terminalElement:n.el,nodeView:this});this.outputViews[t.name]=i,this.tool_body.append(i.$el.append(n.terminalElements()))},redrawWorkflowOutputs:function(){o.each(this.outputViews,function(t){t.redrawWorkflowOutput()})},updateDataOutput:function(t){this.node.output_terminals[t.name].update(t)}})}).call(e,n(2),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(722),s=a(o),l=n(410),c=a(l);window.workflow_globals=window.workflow_globals||{};var d=t.View.extend({tagName:"div",className:"fa-icon-button fa fa-folder-o",initialize:function(t){this.$el.tooltip({delay:500,title:"Run tool in parallel over collection"}),this.model.bind("change",i.bind(this.render,this))},render:function(){this.model.mapOver.isCollection?this.$el.show():this.$el.hide()}}),u=d.extend({events:{click:"onClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave"},onMouseEnter:function(t){var e=this.model;!e.terminal.connected()&&e.mapOver.isCollection&&this.$el.css("color","red")},onMouseLeave:function(t){this.$el.css("color","black")},onClick:function(t){var e=this.model;!e.terminal.connected()&&e.mapOver.isCollection&&e.terminal.resetMapping()}}),h=t.View.extend({setupMappingView:function(t){var e=new this.terminalMappingClass({terminal:t}),n=new this.terminalMappingViewClass({model:e});n.render(),t.terminalMappingView=n,this.terminalMappingView=n},terminalElements:function(){return this.terminalMappingView?[this.terminalMappingView.el,this.el]:[this.el]}}),f=h.extend({className:"terminal input-terminal",initialize:function(t){var e=t.node,n=t.input,i=n.name,r="node-"+e.cid+"-input-"+i,a=this.terminalForInput(n);a.multiple||this.setupMappingView(a),this.el.terminal=a,this.$el.attr("input-name",i),this.$el.attr("id",r),this.id=r,a.node=e,a.name=i,e.input_terminals[i]=a},events:{dropinit:"onDropInit",dropstart:"onDropStart",dropend:"onDropEnd",drop:"onDrop",hover:"onHover"},onDropInit:function(t,e){var n=this.el.terminal;return r(e.drag).hasClass("output-terminal")&&n.canAccept(e.drag.terminal)},onDropStart:function(t,e){e.proxy.terminal&&(e.proxy.terminal.connectors[0].inner_color="#BBFFBB")},onDropEnd:function(t,e){e.proxy.terminal&&(e.proxy.terminal.connectors[0].inner_color="#FFFFFF")},onDrop:function(t,e){var n=this.el.terminal;new c.default(e.drag.terminal,n).redraw()},onHover:function(){var t=this.el,e=t.terminal;if(e.connectors.length>0){var n=r("
    ").css({display:"none"}).appendTo("body").append(r("
    ").append(r("
    ").addClass("fa-icon-button fa fa-times").click(function(){r.each(e.connectors,function(t,e){e&&e.destroy()}),n.remove()}))).bind("mouseleave",function(){r(this).remove()});n.css({top:r(t).offset().top-2,left:r(t).offset().left-n.width(),"padding-right":r(t).width()}).show()}}}),p=f.extend({terminalMappingClass:s.default.TerminalMapping,terminalMappingViewClass:u,terminalForInput:function(t){return new s.default.InputTerminal({element:this.el,input:t})}}),_=f.extend({terminalMappingClass:s.default.TerminalMapping,terminalMappingViewClass:u,terminalForInput:function(t){return new s.default.InputCollectionTerminal({element:this.el,input:t})}}),g=h.extend({className:"terminal output-terminal",initialize:function(t){var e=t.node,n=t.output,i=n.name,r="node-"+e.cid+"-output-"+i,a=this.terminalForOutput(n);this.setupMappingView(a),this.el.terminal=a,this.$el.attr("output-name",i),this.$el.attr("id",r),a.node=e,a.name=i,e.output_terminals[i]=a},events:{drag:"onDrag",dragstart:"onDragStart",dragend:"onDragEnd"},onDrag:function(t,e){var n=function(){var t=r(e.proxy).offsetParent().offset(),n=e.offsetX-t.left,i=e.offsetY-t.top;r(e.proxy).css({left:n,top:i}),e.proxy.terminal.redraw(),window.workflow_globals.canvas_manager.update_viewport_overlay()};n(),r("#canvas-container").get(0).scroll_panel.test(t,n)},onDragStart:function(t,e){r(e.available).addClass("input-terminal-active"),window.workflow_globals.workflow.check_changes_in_active_form();var n=r('
    ').appendTo("#canvas-container").get(0);n.terminal=new s.default.OutputTerminal({element:n});var i=new c.default;return i.dragging=!0,i.connect(this.el.terminal,n.terminal),n},onDragEnd:function(t,e){var n=e.proxy.terminal.connectors[0];n&&n.destroy(),r(e.proxy).remove(),r(e.available).removeClass("input-terminal-active"),r("#canvas-container").get(0).scroll_panel.stop()}}),m=g.extend({terminalMappingClass:s.default.TerminalMapping,terminalMappingViewClass:d,terminalForOutput:function(t){var e=t.extensions;return new s.default.OutputTerminal({element:this.el,datatypes:e})}}),v=g.extend({terminalMappingClass:s.default.TerminalMapping,terminalMappingViewClass:d,terminalForOutput:function(t){var e=t.collection_type,n=t.collection_type_source;return new s.default.OutputCollectionTerminal({element:this.el,collection_type:e,collection_type_source:n,datatypes:t.extensions})}});e.default={InputTerminalView:p,OutputTerminalView:m,InputCollectionTerminalView:_,OutputCollectionTerminalView:v}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){this.collectionType=t,this.isCollection=!0,this.rank=t.split(":").length}Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(o);window.workflow_globals=window.workflow_globals||{};var l={isCollection:!1,canMatch:function(){return!1},canMapOver:function(){return!1},toString:function(){return"NullCollectionType[]"},append:function(t){return t},equal:function(t){return t===this}},c={isCollection:!0,canMatch:function(t){return l!==t},canMapOver:function(){return!1},toString:function(){return"AnyCollectionType[]"},append:function(){return c},equal:function(t){return t===this}};t.extend(a.prototype,{append:function(t){return t===l?this:t===c?t:new a(this.collectionType+":"+t.collectionType)},canMatch:function(t){return t!==l&&(t===c||t.collectionType==this.collectionType)},canMapOver:function(t){if(t===l)return!1;if(t===c)return!1;if(this.rank<=t.rank)return!1;var e=t.collectionType;return this._endsWith(this.collectionType,e)},effectiveMapOver:function(t){var e=t.collectionType;return new a(this.collectionType.substring(0,this.collectionType.length-e.length-1))},equal:function(t){return t.collectionType==this.collectionType},toString:function(){return"CollectionType["+this.collectionType+"]"},_endsWith:function(t,e){return-1!==t.indexOf(e,t.length-e.length)}});var d=i.Model.extend({initialize:function(t){this.mapOver=t.mapOver||l,this.terminal=t.terminal,this.terminal.terminalMapping=this},disableMapOver:function(){this.setMapOver(l)},setMapOver:function(t){this.mapOver=t,this.trigger("change")}}),u=i.Model.extend({initialize:function(t){this.element=t.element,this.connectors=[]},connect:function(t){this.connectors.push(t),this.node&&this.node.markChanged()},disconnect:function(e){this.connectors.splice(t.inArray(e,this.connectors),1),this.node&&(this.node.markChanged(),this.resetMappingIfNeeded())},redraw:function(){t.each(this.connectors,function(t,e){e.redraw()})},destroy:function(){t.each(this.connectors.slice(),function(t,e){e.destroy()})},destroyInvalidConnections:function(){r.each(this.connectors,function(t){t&&t.destroyIfInvalid()})},setMapOver:function(t){this.multiple||this.mapOver().equal(t)||(this.terminalMapping.setMapOver(t),r.each(this.node.output_terminals,function(e){e.setMapOver(t)}))},mapOver:function(){return this.terminalMapping?this.terminalMapping.mapOver:l},isMappedOver:function(){return this.terminalMapping&&this.terminalMapping.mapOver.isCollection},resetMapping:function(){this.terminalMapping.disableMapOver()},resetMappingIfNeeded:function(){}}),h=u.extend({initialize:function(t){u.prototype.initialize.call(this,t),this.datatypes=t.datatypes},resetMappingIfNeeded:function(){this.node.hasConnectedOutputTerminals()||this.node.hasConnectedMappedInputTerminals()||r.each(this.node.mappedInputTerminals(),function(t){t.resetMappingIfNeeded()}),!this.node.hasMappedOverInputTerminals()&&this.resetMapping()},resetMapping:function(){this.terminalMapping.disableMapOver(),r.each(this.connectors,function(t){var e=t.handle2;e&&(e.resetMappingIfNeeded(),t.destroyIfInvalid())})}}),f=u.extend({initialize:function(t){u.prototype.initialize.call(this,t),this.update(t.input)},canAccept:function(t){return!this._inputFilled()&&this.attachable(t)},resetMappingIfNeeded:function(){this.mapOver().isCollection&&((this.node.hasConnectedMappedInputTerminals()||!this.node.hasConnectedOutputTerminals())&&this.resetMapping())},resetMapping:function(){this.terminalMapping.disableMapOver(),this.node.hasMappedOverInputTerminals()||r.each(this.node.output_terminals,function(t){t.resetMapping()})},connected:function(){return 0!==this.connectors.length},_inputFilled:function(){return!!this.connected()&&(!this.multiple||!!this._collectionAttached())},_collectionAttached:function(){if(this.connected()){var t=this.connectors[0].handle1;return!!t&&!!(t.isCollection||t.isMappedOver()||t.datatypes.indexOf("input_collection")>0)}return!1},_mappingConstraints:function(){if(!this.node)return[];var t=this.mapOver();if(t.isCollection)return[t];var e=[];return this.node.hasConnectedOutputTerminals()?e.push(r.first(r.values(this.node.output_terminals)).mapOver()):r.each(this.node.connectedMappedInputTerminals(),function(t){e.push(t.mapOver())}),e},_producesAcceptableDatatype:function(t){for(var e in this.datatypes){var n=this.datatypes[e];if("input"==n)return!0;var i=[];if(i=i.concat(t.datatypes),t.node.post_job_actions)for(var r in t.node.post_job_actions){var a=t.node.post_job_actions[r];"ChangeDatatypeAction"!=a.action_type||""!==a.output_name&&a.output_name!=t.name||!a.action_arguments||i.push(a.action_arguments.newtype)}for(var o in i){var s=i[o];if("input"==s||"_sniff_"==s||"input_collection"==s||window.workflow_globals.app.isSubType(i[o],n))return!0}}return!1},_otherCollectionType:function(t){var e=l;t.isCollection&&(e=t.collectionType);var n=t.mapOver();return n.isCollection&&(e=n.append(e)),e}}),p=f.extend({update:function(t){this.datatypes=t.extensions,this.multiple=t.multiple,this.collection=!1},connect:function(t){f.prototype.connect.call(this,t);var e=t.handle1;if(e){var n=this._otherCollectionType(e);n.isCollection&&this.setMapOver(n)}},attachable:function(t){var e=this._otherCollectionType(t),n=this.mapOver();if(e.isCollection){if(this.multiple)return!(this.connected()&&!this._collectionAttached())&&(1==e.rank&&this._producesAcceptableDatatype(t));if(n.isCollection&&n.canMatch(e))return this._producesAcceptableDatatype(t);return!!this._mappingConstraints().every(r.bind(e.canMatch,e))&&this._producesAcceptableDatatype(t)}return!n.isCollection&&this._producesAcceptableDatatype(t)}}),_=f.extend({update:function(t){this.multiple=!1,this.collection=!0,this.datatypes=t.extensions;var e=[];t.collection_types?r.each(t.collection_types,function(t){e.push(new a(t))}):e.push(c),this.collectionTypes=e},connect:function(t){f.prototype.connect.call(this,t);var e=t.handle1;if(e){var n=this._effectiveMapOver(e);this.setMapOver(n)}},_effectiveMapOver:function(t){var e=this.collectionTypes,n=this._otherCollectionType(t);if(!r.some(e,function(t){return t.canMatch(n)}))for(var i in e){var a=e[i];if(n.canMapOver(a)){var o=n.effectiveMapOver(a);if(o!=l)return o}}return l},_effectiveCollectionTypes:function(){var t=this.mapOver();return r.map(this.collectionTypes,function(e){return t.append(e)})},attachable:function(t){var e=this._otherCollectionType(t);if(e.isCollection){var n=this._effectiveCollectionTypes(),i=this.mapOver();if(r.some(n,function(t){return t.canMatch(e)}))return this._producesAcceptableDatatype(t);if(i.isCollection)return!1;if(r.some(this.collectionTypes,function(t){return e.canMapOver(t)})){var a=this._effectiveMapOver(t);if(!a.isCollection)return!1;if(this._mappingConstraints().every(a.canMatch))return this._producesAcceptableDatatype(t)}}return!1}}),g=u.extend({initialize:function(t){if(u.prototype.initialize.call(this,t),this.datatypes=t.datatypes,t.collection_type)this.collectionType=new a(t.collection_type);else{t.collection_type_source||console.log("Warning: No collection type or collection type source defined."),this.collectionType=c}this.isCollection=!0},update:function(t){var e;if(t.collection_type)e=new a(t.collection_type);else{t.collection_type_source||console.log("Warning: No collection type or collection type source defined."),e=c}e.collectionType!=this.collectionType.collectionType&&r.each(this.connectors,function(t){s.warning("Destroying a connection because collection type has changed."),t.destroy()}),this.collectionType=e}});e.default={InputTerminal:p,OutputTerminal:h,InputCollectionTerminal:_,OutputCollectionTerminal:g,TerminalMapping:d,CollectionTypeDescription:a,NULL_COLLECTION_TYPE_DESCRIPTION:l,ANY_COLLECTION_TYPE_DESCRIPTION:c}}).call(e,n(0),n(2),n(1))},function(t,e,n){"use strict";(function(t,n){Object.defineProperty(e,"__esModule",{value:!0}),window.workflow_globals=window.workflow_globals||{};var i=t.View.extend({className:"form-row dataRow input-data-row",initialize:function(t){this.input=t.input,this.nodeView=t.nodeView,this.terminalElement=t.terminalElement,this.$el.attr("name",this.input.name).html(this.input.label),t.skipResize||(this.$el.css({position:"absolute",left:-1e3,top:-1e3,display:"none"}),n("body").append(this.el),this.nodeView.updateMaxWidth(this.$el.outerWidth()),this.$el.css({position:"",left:"",top:"",display:""}),this.$el.remove())}}),r=t.View.extend({className:"form-row dataRow",initialize:function(t){this.output=t.output,this.terminalElement=t.terminalElement,this.nodeView=t.nodeView;var e=this.output,i=e.name,r=this.nodeView.node;if(e.extensions.indexOf("input")>=0||e.extensions.indexOf("input_collection")>=0||(i=i+" ("+e.extensions.join(", ")+")"),this.$el.html(i),this.calloutView=null,["tool","subworkflow"].indexOf(r.type)>=0){var o=new a({label:i,output:e,node:r});this.calloutView=o,this.$el.append(o.el),this.$el.hover(function(){o.hoverImage()},function(){o.resetImage()})}this.$el.css({position:"absolute",left:-1e3,top:-1e3,display:"none"}),n("body").append(this.el),this.nodeView.updateMaxWidth(this.$el.outerWidth()+17),this.$el.css({position:"",left:"",top:"",display:""}).detach()},redrawWorkflowOutput:function(){this.calloutView&&this.calloutView.resetImage()}}),a=t.View.extend({tagName:"div",initialize:function(t){this.label=t.label,this.node=t.node,this.output=t.output;var e=this,i=this.node;this.$el.attr("class","callout "+this.label).css({display:"none"}).append(n("
    ").append(n("").attr("src",Galaxy.root+"static/images/fugue/asterisk-small-outline.png").click(function(){var t=e.output.name;i.isWorkflowOutput(t)?(i.removeWorkflowOutput(t),e.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small-outline.png")):(i.addWorkflowOutput(t),e.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small.png")),window.workflow_globals.workflow.has_changes=!0,window.workflow_globals.canvas_manager.draw_overview()}))).tooltip({delay:500,title:"Mark dataset as a workflow output. All unmarked datasets will be hidden."}),this.$el.css({top:"50%",margin:"-8px 0px 0px 0px",right:8}),this.$el.show(),this.resetImage()},resetImage:function(){this.node.isWorkflowOutput(this.output.name)?this.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small.png"):this.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small-outline.png")},hoverImage:function(){this.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small-yellow.png")}});e.default={DataInputView:i,DataOutputView:r}}).call(e,n(2),n(0))},function(t,e,n){"use strict";(function(t,i){function r(t){return t&&t.__esModule?t:{default:t}}function a(t){var e=t.model.attributes,n=e.workflow,i=e.node;e.inputs.unshift({type:"text",name:"__annotation",label:"Annotation",fixed:!0,value:i.annotation,area:!0,help:"Add an annotation or notes to this step. Annotations are available when a workflow is viewed."}),e.inputs.unshift({type:"text",name:"__label",label:"Label",value:i.label,help:(0,d.default)("Add a step label."),fixed:!0,onchange:function(e){var r=!1;for(var a in n.nodes){var o=n.nodes[a];if(o.label&&o.label==e&&o.id!=i.id){r=!0;break}}var s=t.data.match("__label");t.element_list[s].model.set("error_text",r&&"Duplicate label. Please fix this before saving the workflow."),t.trigger("change")}})}function o(t,e,n,i){var r=i.node.post_job_actions;e=e||[],e.push(t);for(var a in t.inputs){var s=t.inputs[a];if(s.action){if(s.name="pja__"+n+"__"+s.action,s.pja_arg&&(s.name+="__"+s.pja_arg),s.payload)for(var l in s.payload)s.payload[s.name+"__"+l]=s.payload[l],delete s.payload[l];var c=r[s.action+n];if(c){for(var d in e)e[d].expanded=!0;s.pja_arg?s.value=c.action_arguments&&c.action_arguments[s.pja_arg]||s.value:s.value="true"}}s.inputs&&o(s,e.slice(0),n,i)}}function s(t,e){var n=[],i=[],r=e.datatypes,a=e.node,s=e.workflow;for(var l in r)n.push({0:r[l],1:r[l]});for(l in a.input_terminals)i.push(a.input_terminals[l].name);n.sort(function(t,e){return t.label>e.label?1:t.labelhere
    for more information. Valid inputs are: '+i.join(", ")+"."},{action:"ChangeDatatypeAction",pja_arg:"newtype",label:"Change datatype",type:"select",ignore:"__empty__",value:"__empty__",options:n,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",pja_arg:"tags",label:"Add Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{action:"RemoveTagDatasetAction",pja_arg:"tags",label:"Remove Tags",type:"text",value:"",ignore:"",help:"This action will remove tags for the dataset."},{title:(0,d.default)("Assign columns"),type:"section",flat:!0,inputs:[{action:"ColumnSetAction",pja_arg:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]};return o(u,[],t,e),u}function l(t){var e=t.model.attributes,n=e.inputs,i=e.node,r=i.post_job_actions,a=i.output_terminals&&Object.keys(i.output_terminals)[0];if(a){n.push({name:"pja__"+a+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(r["EmailAction"+a])),ignore:"false",help:(0,d.default)("An email notification will be sent when the job has completed."),payload:{host:window.location.host}}),n.push({name:"pja__"+a+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(r["DeleteIntermediatesAction"+a])),ignore:"false",help:"Upon completion of this step, delete non-starred outputs from completed workflow steps if they are no longer required as inputs."});for(var o in i.output_terminals)n.push(s(o,e))}}Object.defineProperty(e,"__esModule",{value:!0});var c=n(3),d=r(c),u=n(5),h=r(u),f=n(26),p=r(f),_=n(55),g=r(_),m=t.View.extend({initialize:function(t){var e=this,n=t.node;this.form=new p.default(h.default.merge(t,{onchange:function(){h.default.request({type:"POST",url:Galaxy.root+"api/workflows/build_module",data:{id:n.id,type:n.type,content_id:n.content_id,inputs:e.form.data.create()},success:function(t){n.update_field_data(t)}})}})),a(this.form),this.form.render()}}),v=t.View.extend({initialize:function(t){var e=this,n=t.node;this.form=new g.default(h.default.merge(t,{text_enable:"Set in Advance",text_disable:"Set at Runtime",narrow:!0,initial_errors:!0,cls:"ui-portlet-narrow",initialmodel:function(t,n){e._customize(n),t.resolve()},buildmodel:function(t,e){e.model.get("postchange")(t,e)},postchange:function(t,r){var a=r.model.attributes,o={tool_id:a.id,tool_version:a.version,type:"tool",inputs:i.extend(!0,{},r.data.create())};Galaxy.emit.debug("tool-form-workflow::postchange()","Sending current state.",o),h.default.request({type:"POST",url:Galaxy.root+"api/workflows/build_module",data:o,success:function(i){r.model.set(i.config_form),e._customize(r),r.update(i.config_form),r.errors(i.config_form),n.update_field_data(i),Galaxy.emit.debug("tool-form-workflow::postchange()","Received new model.",i),t.resolve()},error:function(e){Galaxy.emit.debug("tool-form-workflow::postchange()","Refresh request failed.",e),t.reject()}})}}))},_customize:function(t){var e=t.model.attributes;h.default.deepeach(e.inputs,function(t){t.type&&(-1!=["data","data_collection"].indexOf(t.type)?(t.type="hidden",t.info="Data input '"+t.name+"' ("+h.default.textify(t.extensions)+")",t.value={__class__:"RuntimeValue"}):t.fixed||(t.collapsible_value={__class__:"RuntimeValue"},t.is_workflow=t.options&&0===t.options.length||-1!=["integer","float"].indexOf(t.type)))}),h.default.deepeach(e.inputs,function(t){"conditional"===t.type&&(t.test_param.collapsible_value=void 0)}),l(t),a(t)}});e.default={Default:m,Tool:v}}).call(e,n(2),n(0))},function(t,e,n){"use strict";(function(t,i){function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(1),c=r(l),d=n(224),u=r(d),h=n(15),f=a(h),p=n(5),_=a(p),g=n(33),m=a(g),v=n(31),y=a(v);n(150);var b=t.Model.extend({is_visible:function(t,e){var n=t.getBoundingClientRect(),r=i("svg")[0].getBoundingClientRect();return!(n.right<0||n.left>r.right||n.bottom<0||n.top>r.bottom)}}),w={drawTicks:function(t,e,n,i,r){var a=t.append("g").selectAll("g").data(e).enter().append("g").selectAll("g").data(n).enter().append("g").attr("class","tick").attr("transform",function(t){return"rotate("+(180*t.angle/Math.PI-90)+")translate("+t.radius+",0)"}),o=[],s=[],l=function(t){return t.angle>Math.PI?"end":null};return r?(o=[0,0,0,-4],s=[4,0,"",".35em"],l=null):(o=[1,0,4,0],s=[0,4,".35em",""]),a.append("line").attr("x1",o[0]).attr("y1",o[1]).attr("x2",o[2]).attr("y1",o[3]).style("stroke","#000"),a.append("text").attr("x",s[0]).attr("y",s[1]).attr("dx",s[2]).attr("dy",s[3]).attr("text-anchor",l).attr("transform",i).text(function(t){return t.label})},formatNum:function(t,e){if(void 0===e&&(e=2),null===t)return null;var n=null;if(Math.abs(t)<1)n=t.toPrecision(e);else{var i=Math.round(t.toPrecision(e));t=Math.abs(t),t<1e3?n=i:t<1e6?n=Math.round((i/1e3).toPrecision(3)).toFixed(0)+"K":t<1e9&&(n=Math.round((i/1e6).toPrecision(3)).toFixed(0)+"M")}return n}},x=t.Model.extend({}),k=t.View.extend({className:"circster",initialize:function(t){this.genome=t.genome,this.label_arc_height=50,this.scale=1,this.circular_views=null,this.chords_views=null,this.model.get("drawables").on("add",this.add_track,this),this.model.get("drawables").on("remove",this.remove_track,this);var e=this.model.get("config");e.get("arc_dataset_height").on("change:value",this.update_track_bounds,this),e.get("track_gap").on("change:value",this.update_track_bounds,this)},get_circular_tracks:function(){return this.model.get("drawables").filter(function(t){return"DiagonalHeatmapTrack"!==t.get("track_type")})},get_chord_tracks:function(){return this.model.get("drawables").filter(function(t){return"DiagonalHeatmapTrack"===t.get("track_type")})},get_tracks_bounds:function(){var t=this.get_circular_tracks(),e=this.model.get("config").get_value("arc_dataset_height"),n=this.model.get("config").get_value("track_gap"),i=Math.min(this.$el.width(),this.$el.height())-20,r=i/2-t.length*(e+n)+n-this.label_arc_height,a=u.range(r,i/2,e+n);return c.map(a,function(t){return[t,t+e]})},render:function(){var t=this,e=t.$el.width(),n=t.$el.height(),i=this.get_circular_tracks(),r=this.get_chord_tracks(),a=t.model.get("config").get_value("total_gap"),o=this.get_tracks_bounds(),s=u.select(t.$el[0]).append("svg").attr("width",e).attr("height",n).attr("pointer-events","all").append("svg:g").call(u.behavior.zoom().on("zoom",function(){var e=d.event.scale;s.attr("transform","translate("+d.event.translate+") scale("+e+")"),t.scale!==e&&(t.zoom_drag_timeout&&clearTimeout(t.zoom_drag_timeout),t.zoom_drag_timeout=setTimeout(function(){},400))})).attr("transform","translate("+e/2+","+n/2+")").append("svg:g").attr("class","tracks");this.circular_views=i.map(function(e,n){var i=new T({el:s.append("g")[0],track:e,radius_bounds:o[n],genome:t.genome,total_gap:a});return i.render(),i}),this.chords_views=r.map(function(e){var n=new A({el:s.append("g")[0],track:e,radius_bounds:o[0],genome:t.genome,total_gap:a});return n.render(),n});var l=this.circular_views[this.circular_views.length-1].radius_bounds[1],c=[l,l+this.label_arc_height];this.label_track_view=new C({el:s.append("g")[0],track:new x,radius_bounds:c,genome:t.genome,total_gap:a}),this.label_track_view.render()},add_track:function(t){var e=this.model.get("config").get_value("total_gap");if("DiagonalHeatmapTrack"===t.get("track_type")){var n=this.circular_views[0].radius_bounds,i=new A({el:u.select("g.tracks").append("g")[0],track:t,radius_bounds:n,genome:this.genome,total_gap:e});i.render(),this.chords_views.push(i)}else{var r=this.get_tracks_bounds();c.each(this.circular_views,function(t,e){t.update_radius_bounds(r[e])}),c.each(this.chords_views,function(t){t.update_radius_bounds(r[0])});var a=this.circular_views.length,o=new T({el:u.select("g.tracks").append("g")[0],track:t,radius_bounds:r[a],genome:this.genome,total_gap:e});o.render(),this.circular_views.push(o)}},remove_track:function(t,e,n){var i=this.circular_views[n.index];this.circular_views.splice(n.index,1),i.$el.remove();var r=this.get_tracks_bounds();c.each(this.circular_views,function(t,e){t.update_radius_bounds(r[e])})},update_track_bounds:function(){var t=this.get_tracks_bounds();c.each(this.circular_views,function(e,n){e.update_radius_bounds(t[n])}),c.each(this.chords_views,function(e){e.update_radius_bounds(t[0])})}}),M=t.View.extend({tagName:"g",initialize:function(t){this.bg_stroke="#ddd",this.loading_bg_fill="#ffc",this.bg_fill="#ddd",this.total_gap=t.total_gap,this.track=t.track,this.radius_bounds=t.radius_bounds,this.genome=t.genome,this.chroms_layout=this._chroms_layout(),this.data_bounds=[],this.scale=1,this.parent_elt=u.select(this.$el[0])},get_fill_color:function(){var t=this.track.get("config").get_value("block_color");return t||(t=this.track.get("config").get_value("color")),t},render:function(){var t=this.parent_elt,e=this.chroms_layout,n=u.svg.arc().innerRadius(this.radius_bounds[0]).outerRadius(this.radius_bounds[1]),r=t.selectAll("g").data(e).enter().append("svg:g"),a=r.append("path").attr("d",n).attr("class","chrom-background").style("stroke",this.bg_stroke).style("fill",this.loading_bg_fill);a.append("title").text(function(t){return t.data.chrom});var o=this,s=o.track.get("data_manager"),l=!s||s.data_is_ready();i.when(l).then(function(){i.when(o._render_data(t)).then(function(){a.style("fill",o.bg_fill),o.render_labels()})})},render_labels:function(){},update_radius_bounds:function(t){this.radius_bounds=t;var e=u.svg.arc().innerRadius(this.radius_bounds[0]).outerRadius(this.radius_bounds[1]);this.parent_elt.selectAll("g>path.chrom-background").transition().duration(1e3).attr("d",e),this._transition_chrom_data(),this._transition_labels()},update_scale:function(t){var e=this.scale;if(this.scale=t,!(t<=e)){var n=this,r=new b;return this.parent_elt.selectAll("path.chrom-data").filter(function(t,e){return r.is_visible(this)}).each(function(e,r){var a,o=u.select(this),s=o.attr("chrom"),l=n.genome.get_chrom_region(s),d=n.track.get("data_manager");d.can_get_more_detailed_data(l)&&(a=n.track.get("data_manager").get_more_detailed_data(l,"Coverage",0,t),i.when(a).then(function(t){o.remove(),n._update_data_bounds();var e=c.find(n.chroms_layout,function(t){return t.data.chrom===s}),i=n.get_fill_color();n._render_chrom_data(n.parent_elt,e,t).style("stroke",i).style("fill",i)}))}),n}},_transition_chrom_data:function(){var t=this.track,e=this.chroms_layout,n=this.parent_elt.selectAll("g>path.chrom-data");if(n[0].length>0){var r=this;i.when(t.get("data_manager").get_genome_wide_data(this.genome)).then(function(i){var a=c.reject(c.map(i,function(t,n){var i=null,a=r._get_path_function(e[n],t);return a&&(i=a(t.data)),i}),function(t){return null===t}),o=t.get("config").get_value("color");n.each(function(t,e){u.select(this).transition().duration(1e3).style("stroke",o).style("fill",o).attr("d",a[e])})})}},_transition_labels:function(){},_update_data_bounds:function(t){this.data_bounds=t||this.get_data_bounds(this.track.get("data_manager").get_genome_wide_data(this.genome)),this._transition_chrom_data()},_render_data:function(t){var e=this,n=this.chroms_layout,r=this.track,a=i.Deferred();return i.when(r.get("data_manager").get_genome_wide_data(this.genome)).then(function(i){e.data_bounds=e.get_data_bounds(i),r.get("config").set_value("min_value",e.data_bounds[0],{silent:!0}),r.get("config").set_value("max_value",e.data_bounds[1],{silent:!0});var o=c.zip(n,i);c.each(o,function(n){var i=n[0],r=n[1];return e._render_chrom_data(t,i,r)});var s=e.get_fill_color();e.parent_elt.selectAll("path.chrom-data").style("stroke",s).style("fill",s),a.resolve(t)}),a},_render_chrom_data:function(t,e,n){},_get_path_function:function(t,e){},_chroms_layout:function(){var t=this.genome.get_chroms_info(),e=u.layout.pie().value(function(t){return t.len}).sort(null),n=e(t),i=2*Math.PI*this.total_gap/t.length;return c.map(n,function(t,e){var n=t.endAngle-i;return t.endAngle=n>t.startAngle?n:t.startAngle,t})}}),C=M.extend({initialize:function(t){M.prototype.initialize.call(this,t),this.innerRadius=this.radius_bounds[0],this.radius_bounds[0]=this.radius_bounds[1],this.bg_stroke="#fff",this.bg_fill="#fff",this.min_arc_len=.05},_render_data:function(t){var e=this,n=t.selectAll("g");n.selectAll("path").attr("id",function(t){return"label-"+t.data.chrom}),n.append("svg:text").filter(function(t){return t.endAngle-t.startAngle>e.min_arc_len}).attr("text-anchor","middle").append("svg:textPath").attr("class","chrom-label").attr("xlink:href",function(t){return"#label-"+t.data.chrom}).attr("startOffset","25%").text(function(t){return t.data.chrom});var i=function(t){var n=(t.endAngle-t.startAngle)/t.value,i=u.range(0,t.value,25e6).map(function(i,r){return{radius:e.innerRadius,angle:i*n+t.startAngle,label:0===r?0:r%3?null:e.formatNum(i)}});return i.length<4&&(i[i.length-1].label=e.formatNum(Math.round((i[i.length-1].angle-t.startAngle)/n))),i},r=function(t){return t.angle>Math.PI?"rotate(180)translate(-16)":null},a=c.filter(this.chroms_layout,function(t){return t.endAngle-t.startAngle>e.min_arc_len});this.drawTicks(this.parent_elt,a,i,r)}});c.extend(C.prototype,w);var S=M.extend({initialize:function(t){M.prototype.initialize.call(this,t);var e=this.track.get("config");e.get("min_value").on("change:value",this._update_min_max,this),e.get("max_value").on("change:value",this._update_min_max,this),e.get("color").on("change:value",this._transition_chrom_data,this)},_update_min_max:function(){var t=this.track.get("config"),e=[t.get_value("min_value"),t.get_value("max_value")];this._update_data_bounds(e),this.parent_elt.selectAll(".min_max").text(function(t,n){return e[n]})},_quantile:function(t,e){return t.sort(u.ascending),u.quantile(t,e)},_render_chrom_data:function(t,e,n){var i=this._get_path_function(e,n);return i?t.datum(n.data).append("path").attr("class","chrom-data").attr("chrom",e.data.chrom).attr("d",i):null},_get_path_function:function(t,e){if("string"==typeof e||!e.data||0===e.data.length)return null;var n=u.scale.linear().domain(this.data_bounds).range(this.radius_bounds).clamp(!0),i=u.scale.linear().domain([0,e.data.length]).range([t.startAngle,t.endAngle]),r=u.svg.line.radial().interpolate("linear").radius(function(t){return n(t[1])}).angle(function(t,e){return i(e)});return u.svg.area.radial().interpolate(r.interpolate()).innerRadius(n(0)).outerRadius(r.radius()).angle(r.angle())},render_labels:function(){var t=this,e=function(){return"rotate(90)"},n=this.drawTicks(this.parent_elt,[this.chroms_layout[0]],this._data_bounds_ticks_fn(),e,!0).classed("min_max",!0);c.each(n,function(e){i(e).click(function(){new m.default.ConfigSettingCollectionView({collection:t.track.get("config")}).render_in_modal("Configure Track")})})},_transition_labels:function(){if(0!==this.data_bounds.length){var t=this,e=c.filter(this.chroms_layout,function(t){return t.endAngle-t.startAngle>.08}),n=c.filter(e,function(t,e){return e%3==0}),i=c.flatten(c.map(n,function(e){return t._data_bounds_ticks_fn()(e)}));this.parent_elt.selectAll("g.tick").data(i).transition().attr("transform",function(t){return"rotate("+(180*t.angle/Math.PI-90)+")translate("+t.radius+",0)"})}},_data_bounds_ticks_fn:function(){var t=this;return function(e){return[{radius:t.radius_bounds[0],angle:e.startAngle,label:t.formatNum(t.data_bounds[0])},{radius:t.radius_bounds[1],angle:e.startAngle,label:t.formatNum(t.data_bounds[1])}]}},get_data_bounds:function(t){}});c.extend(S.prototype,w);var T=S.extend({get_data_bounds:function(t){var e=c.flatten(c.map(t,function(t){return t?c.map(t.data,function(t){return parseInt(t[1],10)||0}):0}));return[c.min(e),this._quantile(e,.98)||c.max(e)]}}),A=M.extend({render:function(){var t=this;i.when(t.track.get("data_manager").data_is_ready()).then(function(){i.when(t.track.get("data_manager").get_genome_wide_data(t.genome)).then(function(e){var n=[],i=t.genome.get_chroms_info();c.each(e,function(e,r){var a=i[r].chrom,o=c.map(e.data,function(e){var n=t._get_region_angle(a,e[1]),i=t._get_region_angle(e[3],e[4]);return{source:{startAngle:n,endAngle:n+.01},target:{startAngle:i,endAngle:i+.01}}});n=n.concat(o)}),t.parent_elt.append("g").attr("class","chord").selectAll("path").data(n).enter().append("path").style("fill",t.get_fill_color()).attr("d",u.svg.chord().radius(t.radius_bounds[0])).style("opacity",1)})})},update_radius_bounds:function(t){this.radius_bounds=t,this.parent_elt.selectAll("path").transition().attr("d",u.svg.chord().radius(this.radius_bounds[0]))},_get_region_angle:function(t,e){var n=c.find(this.chroms_layout,function(e){return e.data.chrom===t});return n.endAngle-(n.endAngle-n.startAngle)*(n.data.len-e)/n.data.len}}),j=t.View.extend({initialize:function(){_.default.cssLoadFile("static/style/circster.css");var t=new f.default.Genome(window.galaxy_config.app.genome),e=new f.default.GenomeVisualization(window.galaxy_config.app.viz_config);e.get("config").add([{key:"arc_dataset_height",label:"Arc Dataset Height",type:"int",value:25,view:"circster"},{key:"track_gap",label:"Gap Between Tracks",type:"int",value:5,view:"circster"},{key:"total_gap",label:"Gap [0-1]",type:"float",value:.4,view:"circster",hidden:!0}]),new k({el:i("#center .unified-panel-body"),genome:t,model:e}).render(),i("#center .unified-panel-header-inner").append(window.galaxy_config.app.viz_config.title+" "+window.galaxy_config.app.viz_config.dbkey);var n=y.default.create_icon_buttons_menu([{icon_class:"plus-button",title:(0,s.default)("Add tracks"),on_click:function(){f.default.select_datasets({dbkey:e.get("dbkey")},function(t){e.add_tracks(t)})}},{icon_class:"gear",title:(0,s.default)("Settings"),on_click:function(){new m.default.ConfigSettingCollectionView({collection:e.get("config")}).render_in_modal("Configure Visualization")}},{icon_class:"disk--arrow",title:(0,s.default)("Save"),on_click:function(){Galaxy.modal.show({title:(0,s.default)("Saving..."),body:"progress"}),i.ajax({url:Galaxy.root+"visualization/save",type:"POST",dataType:"json",data:{id:e.get("vis_id"),title:e.get("title"),dbkey:e.get("dbkey"),type:"trackster",vis_json:JSON.stringify(e)}}).success(function(t){Galaxy.modal.hide(),e.set("vis_id",t.vis_id)}).error(function(){Galaxy.modal.show({title:(0,s.default)("Could Not Save"),body:"Could not save visualization. Please try again later.",buttons:{Cancel:function(){Galaxy.modal.hide()}}})})}},{icon_class:"cross-circle",title:(0,s.default)("Close"),on_click:function(){window.top.location=Galaxy.root+"visualizations/list"}}],{tooltip_config:{placement:"bottom"}});n.$el.attr("style","float: right"),i("#center .unified-panel-header-inner").append(n.$el),i(".menu-button").tooltip({placement:"bottom"})}});e.default={GalaxyApp:j}}).call(e,n(2),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}function o(){function t(e,n,i,r){var a=e.children,d=0,u=e.dist||l;return u=u>1?1:u,e.dist=u,e.y0=null!==r?r.y0+u*o:c,a?(a.forEach(function(r){r.parent=e,d+=t(r,n,i,e)}),e.x0=d/a.length):(e.x0=s*i,s+=1),e.x=e.x0,e.y=e.y0,e.x0}var e=this,n=d.layout.hierarchy().sort(null).value(null),i=360,r="Linear",a=18,o=200,s=0,l=.5,c=50;return e.leafHeight=function(t){return void 0===t?a:(a=t,e)},e.layoutMode=function(t){return void 0===t?r:(r=t,e)},e.layoutAngle=function(t){return void 0===t?i:isNaN(t)||t<0||t>360?e:(i=t,e)},e.separation=function(t){return void 0===t?o:(o=t,e)},e.links=function(t){return d.layout.tree().links(t)},e.nodes=function(o,l){"[object Array]"===toString.call(o)&&(o=o[0]);var c=n.call(e,o,l),d=[],u=0,h=0;return window._d=o,window._nodes=c,c.forEach(function(t){u=t.depth>u?t.depth:u,d.push(t)}),d.forEach(function(t){t.children||(h+=1,t.depth=u)}),a="Circular"===r?i/h:a,s=0,t(d[0],u,a,null),d},e}Object.defineProperty(e,"__esModule",{value:!0});var s=n(3),l=a(s),c=n(192),d=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(c),u=n(15),h=a(u),f=n(14),p=a(f),_=n(31),g=a(_),m=t.View.extend({className:"UserMenuBase",isAcceptableValue:function(t,e,n){var i=t.val(),r=t.attr("displayLabel")||t.attr("id").replace("phyloViz","");return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}(i)?i>n?(alert(r+" is too large."),!1):!(i":"")+"Dist: "+t.dist+"
    Annotation1: "+e+(t.bootstrap?"
    Confidence level: "+Math.round(100*t.bootstrap):""):""}).tooltip({placement:"top",trigger:"hover"})}}),b=y.extend({initialize:function(t){var e=this;e.margins=t.margins,e.layoutMode="Linear",e.stdInit(t),e.layout(),e.updateAndRender(e.model.root)},layout:function(){var t=this;t.tree=(new o).layoutMode("Linear"),t.diagonal=d.svg.diagonal().projection(function(t){return[t.y,t.x]})},renderNodes:function(t){var e=this,n=e.model.get("fontSize")+"px";e.tree.separation(e.model.get("separation")).leafHeight(e.model.get("leafHeight"));var i=e.tree.separation(e.model.get("separation")).nodes(e.model.root),r=e.vis.selectAll("g.node").data(i,function(t){return t.name+t.id||(t.id=++e.i)});e.nodes=i,e.duration=500;var a=r.enter().append("svg:g").attr("class","node").on("dblclick",function(){d.event.stopPropagation()}).on("click",function(t){if(d.event.altKey)e.selectNode(t);else{if(t.children&&0===t.children.length)return;e.model.toggle(t),e.updateAndRender(t)}});"[object Array]"===toString.call(t)&&(t=t[0]),a.attr("transform",function(e){return"translate("+t.y0+","+t.x0+")"}),a.append("svg:circle").attr("r",1e-6).style("fill",function(t){return t._children?"lightsteelblue":"#fff"}),a.append("svg:text").attr("class","nodeLabel").attr("x",function(t){return t.children||t._children?-10:10}).attr("dy",".35em").attr("text-anchor",function(t){return t.children||t._children?"end":"start"}).style("fill-opacity",1e-6);var o=r.transition().duration(500);o.attr("transform",function(t){return"translate("+t.y+","+t.x+")"}),o.select("circle").attr("r",e.defaults.nodeRadius).style("fill",function(t){return t._children?"lightsteelblue":"#fff"}),o.select("text").style("fill-opacity",1).style("font-size",n).text(function(t){return t.name&&""!==t.name?t.name:t.bootstrap?Math.round(100*t.bootstrap):""});var s=r.exit().transition().duration(500).remove();s.select("circle").attr("r",1e-6),s.select("text").style("fill-opacity",1e-6),i.forEach(function(t){t.x0=t.x,t.y0=t.y})}}),w=t.View.extend({className:"phyloviz",initialize:function(t){var e=this;e.MIN_SCALE=.05,e.MAX_SCALE=5,e.MAX_DISPLACEMENT=500,e.margins=[10,60,10,80],e.width=r("#PhyloViz").width(),e.height=r("#PhyloViz").height(),e.radius=e.width,e.data=t.data,r(window).resize(function(){e.width=r("#PhyloViz").width(),e.height=r("#PhyloViz").height(),e.render()}),e.phyloTree=new v(t.config),e.phyloTree.root=e.data,e.zoomFunc=d.behavior.zoom().scaleExtent([e.MIN_SCALE,e.MAX_SCALE]),e.zoomFunc.translate(e.phyloTree.get("translate")),e.zoomFunc.scale(e.phyloTree.get("scaleFactor")),e.navMenu=new x(e),e.settingsMenu=new k({phyloTree:e.phyloTree}),e.nodeSelectionView=new M({phyloTree:e.phyloTree}),e.search=new C,setTimeout(function(){e.zoomAndPan()},1e3)},render:function(){var t=this;r("#PhyloViz").empty(),t.mainSVG=d.select("#PhyloViz").append("svg:svg").attr("width",t.width).attr("height",t.height).attr("pointer-events","all").call(t.zoomFunc.on("zoom",function(){t.zoomAndPan()})),t.boundingRect=t.mainSVG.append("svg:rect").attr("class","boundingRect").attr("width",t.width).attr("height",t.height).attr("stroke","black").attr("fill","white"),t.vis=t.mainSVG.append("svg:g").attr("class","vis"),t.layoutOptions={model:t.phyloTree,width:t.width,height:t.height,vis:t.vis,margins:t.margins},r("#title").text("Phylogenetic Tree from "+t.phyloTree.get("title")+":");new b(t.layoutOptions)},zoomAndPan:function(t){var e,n;void 0!==t&&(e=t.zoom,n=t.translate);var i=this,r=i.zoomFunc.scale(),a=i.zoomFunc.translate(),o="",s="";switch(e){case"reset":r=1,a=[0,0];break;case"+":r*=1.1;break;case"-":r*=.9;break;default:"number"==typeof e?r=e:null!==d.event&&(r=d.event.scale)}if(!(ri.MAX_SCALE)){if(i.zoomFunc.scale(r),o="translate("+i.margins[3]+","+i.margins[0]+") scale("+r+")",null!==d.event)s="translate("+d.event.translate+")";else{if(void 0!==n){var l=n.split(",")[0],c=n.split(",")[1];isNaN(l)||isNaN(c)||(a=[a[0]+parseFloat(l),a[1]+parseFloat(c)])}i.zoomFunc.translate(a),s="translate("+a+")"}i.phyloTree.set("scaleFactor",r),i.phyloTree.set("translate",a),i.vis.attr("transform",s+o)}},reloadViz:function(){var t=this,e=r("#phylovizNexSelector :selected").val();r.getJSON(t.phyloTree.get("dataset").url(),{tree_index:e,data_type:"raw_data"},function(e){t.data=e.data,t.config=e,t.render()})}}),x=t.View.extend({initialize:function(t){var e=this;e.phylovizView=t,r("#panelHeaderRightBtns").empty(),r("#phyloVizNavBtns").empty(),r("#phylovizNexSelector").off(),e.initNavBtns(),e.initRightHeaderBtns(),r("#phylovizNexSelector").off().on("change",function(){e.phylovizView.reloadViz()})},initRightHeaderBtns:function(){var t=this,e=g.default.create_icon_buttons_menu([{icon_class:"gear",title:(0,l.default)("PhyloViz Settings"),on_click:function(){r("#SettingsMenu").show(),t.settingsMenu.updateUI()}},{icon_class:"disk",title:(0,l.default)("Save visualization"),on_click:function(){var e=r("#phylovizNexSelector option:selected").text();e&&t.phylovizView.phyloTree.set("title",e),t.phylovizView.phyloTree.save()}},{icon_class:"chevron-expand",title:"Search / Edit Nodes",on_click:function(){r("#nodeSelectionView").show()}},{icon_class:"information",title:(0,l.default)("Phyloviz Help"),on_click:function(){window.open("https://galaxyproject.org/learn/visualization/phylogenetic-tree/")}}],{tooltip_config:{placement:"bottom"}});r("#panelHeaderRightBtns").append(e.$el)},initNavBtns:function(){var t=this,e=g.default.create_icon_buttons_menu([{icon_class:"zoom-in",title:(0,l.default)("Zoom in"),on_click:function(){t.phylovizView.zoomAndPan({zoom:"+"})}},{icon_class:"zoom-out",title:(0,l.default)("Zoom out"),on_click:function(){t.phylovizView.zoomAndPan({zoom:"-"})}},{icon_class:"arrow-circle",title:"Reset Zoom/Pan",on_click:function(){t.phylovizView.zoomAndPan({zoom:"reset"})}}],{tooltip_config:{placement:"bottom"}});r("#phyloVizNavBtns").append(e.$el)}}),k=m.extend({className:"Settings",initialize:function(t){var e=this;e.phyloTree=t.phyloTree,e.el=r("#SettingsMenu"),e.inputs={separation:r("#phyloVizTreeSeparation"),leafHeight:r("#phyloVizTreeLeafHeight"),fontSize:r("#phyloVizTreeFontSize")},r("#settingsCloseBtn").off().on("click",function(){e.el.hide()}),r("#phylovizResetSettingsBtn").off().on("click",function(){e.resetToDefaults()}),r("#phylovizApplySettingsBtn").off().on("click",function(){e.apply()})},apply:function(){var t=this;t.isAcceptableValue(t.inputs.separation,50,2500)&&t.isAcceptableValue(t.inputs.leafHeight,5,30)&&t.isAcceptableValue(t.inputs.fontSize,5,20)&&r.each(t.inputs,function(e,n){t.phyloTree.set(e,n.val())})},updateUI:function(){var t=this;r.each(t.inputs,function(e,n){n.val(t.phyloTree.get(e))})},resetToDefaults:function(){r(".tooltip").remove();var t=this;r.each(t.phyloTree.defaults,function(e,n){t.phyloTree.set(e,n)}),t.updateUI()},render:function(){}}),M=m.extend({className:"Settings",initialize:function(t){var e=this;e.el=r("#nodeSelectionView"),e.phyloTree=t.phyloTree,e.UI={enableEdit:r("#phylovizEditNodesCheck"),saveChanges:r("#phylovizNodeSaveChanges"),cancelChanges:r("#phylovizNodeCancelChanges"),name:r("#phyloVizSelectedNodeName"),dist:r("#phyloVizSelectedNodeDist"),annotation:r("#phyloVizSelectedNodeAnnotation")},e.valuesOfConcern={name:null,dist:null,annotation:null},r("#nodeSelCloseBtn").off().on("click",function(){e.el.hide()}),e.UI.saveChanges.off().on("click",function(){e.updateNodes()}),e.UI.cancelChanges.off().on("click",function(){e.cancelChanges()}),function(t){t.fn.enable=function(e){return t(this).each(function(){e?t(this).removeAttr("disabled"):t(this).attr("disabled","disabled")})}}(i),e.UI.enableEdit.off().on("click",function(){e.toggleUI()})},toggleUI:function(){var t=this,e=t.UI.enableEdit.is(":checked");e||t.cancelChanges(),r.each(t.valuesOfConcern,function(n,i){t.UI[n].enable(e)}),e?(t.UI.saveChanges.show(),t.UI.cancelChanges.show()):(t.UI.saveChanges.hide(),t.UI.cancelChanges.hide())},cancelChanges:function(){var t=this,e=t.phyloTree.get("selectedNode");e&&r.each(t.valuesOfConcern,function(n,i){t.UI[n].val(e[n])})},updateNodes:function(){var t=this,e=t.phyloTree.get("selectedNode");if(e){if(!t.isAcceptableValue(t.UI.dist,0,1)||t.hasIllegalJsonCharacters(t.UI.name)||t.hasIllegalJsonCharacters(t.UI.annotation))return;r.each(t.valuesOfConcern,function(n,i){e[n]=t.UI[n].val()}),t.phyloTree.set("nodeAttrChangedTime",new Date)}else alert("No node selected")}}),C=m.extend({initialize:function(){var t=this;r("#phyloVizSearchBtn").on("click",function(){var e=r("#phyloVizSearchTerm"),n=r("#phyloVizSearchCondition").val().split("-"),i=n[0],a=n[1];t.hasIllegalJsonCharacters(e),"dist"===i&&t.isAcceptableValue(e,0,1),t.searchTree(i,a,e.val())})},searchTree:function(t,e,n){d.selectAll("g.node").classed("searchHighlight",function(i){var r=i[t];if(void 0!==r&&null!==r)if("dist"===t)switch(e){case"greaterEqual":return r>=+n;case"lesserEqual":return r<=+n;default:return}else if("name"===t||"annotation"===t)return-1!==r.toLowerCase().indexOf(n.toLowerCase())})}});e.default={PhylovizView:w}}).call(e,n(2),n(0),n(0))},function(t,e,n){"use strict";(function(t,i){function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(1),c=r(l),d=n(192),u=r(d),h=n(18),f=(a(h),n(15)),p=a(f),_=n(62),g=a(_),m=n(54),v=a(m),y=n(14),b=a(y),w=n(33),x=a(w),k=n(31),M=a(k),C=t.Model.extend({defaults:{inputs:null,values:null}}),S=t.Model.extend({defaults:{tool:null,tree_data:null},initialize:function(t){var e=this;this.get("tool").get("inputs").each(function(t){t.on("change:min change:max change:num_samples",function(t){t.get("in_ptree")&&e.set_tree_data()},e),t.on("change:in_ptree",function(t){t.get("in_ptree")?e.add_param(t):e.remove_param(t),e.set_tree_data()},e)}),t.config&&c.each(t.config,function(t){var n=e.get("tool").get("inputs").find(function(e){return e.get("name")===t.name});e.add_param(n),n.set(t)})},add_param:function(t){t.get("ptree_index")||(t.set("in_ptree",!0),t.set("ptree_index",this.get_tree_params().length))},remove_param:function(t){t.set("in_ptree",!1),t.set("ptree_index",null),c(this.get_tree_params()).each(function(t,e){t.set("ptree_index",e+1)})},set_tree_data:function(){var t=c.map(this.get_tree_params(),function(t){return{param:t,samples:t.get_samples()}}),e=0;this.set("tree_data",{name:"Root",id:e++,children:0!==t.length?function t(n,i){var r=n[i],a=r.param,o=(a.get("label"),r.samples);return n.length-1===i?c.map(o,function(t){return{id:e++,name:t,param:a,value:t}}):c.map(o,function(r){return{id:e++,name:r,param:a,value:r,children:t(n,i+1)}})}(t,0):null})},get_tree_params:function(){return c(this.get("tool").get("inputs").where({in_ptree:!0})).sortBy(function(t){return t.get("ptree_index")})},get_num_leaves:function(){return this.get_tree_params().reduce(function(t,e){return t*e.get_samples().length},1)},get_node_settings:function(t){var e=this.get("tool").get_inputs_dict(),n=t.parent;if(n)for(;0!==n.depth;)e[n.param.get("name")]=n.value,n=n.parent;var i=this,r=function t(e,n){return e.param&&(n[e.param.get("name")]=e.value),e.children?c.flatten(c.map(e.children,function(e){return t(e,c.clone(n))})):new C({inputs:i.get("tool").get("inputs"),values:n})}(t,e);return c.isArray(r)||(r=[r]),r},get_connected_nodes:function(t){for(var e=[],n=t.parent;n;)e.push(n),n=n.parent;return c.flatten([e,function t(e){return e.children?c.flatten([e,c.map(e.children,function(e){return t(e)})]):e}(t)])},get_leaf:function(t){for(var e=this.get("tree_data");e.children;)e=function(e){return c.find(e,function(e){return t[e.param.get("name")]===e.value})}(e.children);return e},toJSON:function(){return this.get_tree_params().map(function(t){return{name:t.get("name"),min:t.get("min"),max:t.get("max"),num_samples:t.get("num_samples")}})}}),T=t.Model.extend({defaults:{track:null,mode:"Pack",settings:null,regions:null},initialize:function(t){if(this.set("regions",t.regions),t.track){var e=c.extend({data_url:Galaxy.root+"dummy1",converted_datasets_state_url:Galaxy.root+"dummy2"},t.track);this.set("track",g.default.object_from_template(e,{},null))}},same_settings:function(t){var e=this.get("settings"),n=t.get("settings");for(var i in e)if(!n[i]||e[i]!==n[i])return!1;return!0},toJSON:function(){return{track:this.get("track").to_dict(),settings:this.get("settings"),regions:this.get("regions")}}}),A=t.Collection.extend({model:T}),j=p.default.Visualization.extend({defaults:c.extend({},p.default.Visualization.prototype.defaults,{dataset:null,tool:null,parameter_tree:null,regions:null,tracks:null,default_mode:"Pack"}),initialize:function(t){this.set("dataset",new b.default.Dataset(t.dataset)),this.set("tool",new v.default.Tool(t.tool)),this.set("regions",new p.default.GenomeRegionCollection(t.regions)),this.set("tracks",new A(t.tracks));var e=this.get("tool");this.set("tool_with_samplable_inputs",e),e.remove_inputs(["data","hidden_data","conditional","text"]),this.set("parameter_tree",new S({tool:e,config:t.tree_config}))},add_track:function(t){this.get("tracks").add(t)},toJSON:function(){return{id:this.get("id"),title:"Parameter exploration for dataset '"+this.get("dataset").get("name")+"'",type:"sweepster",dataset_id:this.get("dataset").id,tool_id:this.get("tool").id,regions:this.get("regions").toJSON(),tree_config:this.get("parameter_tree").toJSON(),tracks:this.get("tracks").toJSON()}}}),E=t.View.extend({tagName:"tr",TILE_LEN:250,initialize:function(t){this.canvas_manager=t.canvas_manager,this.render(),this.model.on("change:track change:mode",this.draw_tiles,this)},render:function(){var t=this.model.get("settings"),e=t.get("values"),n=i("").addClass("settings").appendTo(this.$el),r=i("
    ").addClass("track-info").hide().appendTo(n);r.append(i("
    ").css("font-weight","bold").text("Track Settings")),t.get("inputs").each(function(t){r.append(t.get("label")+": "+e[t.get("name")]+"
    ")});var a=this,o=(i("','\'" href="#library/<%- library.get("id") %>/permissions">','','','','" class="fa fa-ban fa-lg">','',"",""].join(""))}});e.default={LibraryRowView:s}}).call(e,n(2),n(0),n(1))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(20),c=a(l),d=n(59),u=a(d),h=t.View.extend({el:"#center",defaults:{search_term:""},events:{"click #create_new_library_btn":"createLibraryFromModal","click #include_deleted_chk":"includeDeletedChecked","click #exclude_restricted_chk":"excludeRestrictedChecked","click .page_size_prompt":"showPageSizePrompt","keyup .library-search-input":"searchLibraries"},initialize:function(t){this.options=i.defaults(this.options||{},t,this.defaults),this.render()},render:function(){var t=this.templateToolBar(),e=!1,n=!0;Galaxy.user&&(e=Galaxy.user.isAdmin(),n=Galaxy.user.isAnonymous()),this.$el.html(t({admin_user:e,anon_user:n})),e&&(this.$el.find("#include_deleted_chk")[0].checked=Galaxy.libraries.preferences.get("with_deleted"),this.$el.find("#exclude_restricted_chk")[0].checked=Galaxy.libraries.preferences.get("without_restricted"))},renderPaginator:function(t){this.options=i.extend(this.options,t);var e=this.templatePaginator();this.$el.find(".library-paginator").html(e({show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_libraries_count:this.options.total_libraries_count,libraries_shown:this.options.libraries_shown,library_page_size:Galaxy.libraries.preferences.get("library_page_size")}))},createLibraryFromModal:function(t){t.preventDefault(),t.stopPropagation();var e=this;this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,s.default)("Create New Library"),body:this.templateNewLibraryInModal(),buttons:{Create:function(){e.createNewLibrary()},Close:function(){e.modal.hide()}}})},createNewLibrary:function(){var t=this.serializeNewLibrary();if(this.validateNewLibrary(t)){var e=new u.default.Library,n=this;e.save(t,{success:function(t){Galaxy.libraries.libraryListView.collection.add(t),n.modal.hide(),n.clearLibraryModal(),Galaxy.libraries.libraryListView.render(),c.default.success("Library created.")},error:function(t,e){void 0!==e.responseJSON?c.default.error(e.responseJSON.err_msg):c.default.error("An error occured.")}})}else c.default.error("Library's name is missing.");return!1},showPageSizePrompt:function(t){t.preventDefault();var e=prompt("How many libraries per page do you want to see?",Galaxy.libraries.preferences.get("library_page_size"));null!=e&&e==parseInt(e)&&(Galaxy.libraries.preferences.set({library_page_size:parseInt(e)}),Galaxy.libraries.libraryListView.render({show_page:1}))},clearLibraryModal:function(){r("input[name='Name']").val(""),r("input[name='Description']").val(""),r("input[name='Synopsis']").val("")},serializeNewLibrary:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val(),synopsis:r("input[name='Synopsis']").val()}},validateNewLibrary:function(t){return""!==t.name},includeDeletedChecked:function(t){t.target.checked?(Galaxy.libraries.preferences.set({with_deleted:!0}),Galaxy.libraries.libraryListView.fetchDeleted()):(Galaxy.libraries.preferences.set({with_deleted:!1}),Galaxy.libraries.libraryListView.render())},excludeRestrictedChecked:function(t){t.target.checked?Galaxy.libraries.preferences.set({without_restricted:!0}):Galaxy.libraries.preferences.set({without_restricted:!1}),Galaxy.libraries.libraryListView.render()},searchLibraries:function(t){var e=r(".library-search-input").val();this.options.search_term=e,Galaxy.libraries.libraryListView.searchLibraries(e)},templateToolBar:function(){return i.template(['
    ','
    ','DATA LIBRARIES','
    ','
    ','',"<% if(admin_user === true) { %>",'
    ','','',"
    ",'
    ','','',"
    ",'',"<% } %>","
    ",'','',"","
    ",'
    ',"
    "].join(""))},templatePaginator:function(){return i.template(['",'',' <%- libraries_shown %> libraries shown (change)',"",''," <%- total_libraries_count %> total",""].join(""))},templateNewLibraryInModal:function(){return i.template(['
    ',"
    ",'','','',"
    ","
    "].join(""))}});e.default={LibraryToolbarView:h}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r,a){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var s=n(3),l=o(s),c=n(5),d=o(c),u=n(20),h=o(u),f=n(59),p=o(f),_=n(39),g=o(_),m=n(85),v=o(m),y=n(190),b=o(y),w=n(191),x=o(w),k=n(153),M=o(k);n(412);var C=t.View.extend({el:"#center",events:{"click .toolbtn-create-folder":"createFolderFromModal","click .toolbtn-bulk-import":"importToHistoryModal","click .include-deleted-datasets-chk":"checkIncludeDeleted","click .toolbtn-bulk-delete":"deleteSelectedItems","click .toolbtn-show-locinfo":"showLocInfo","click .page-size-prompt":"showPageSizePrompt","click .toolbtn-collection-import":"showCollectionSelect"},defaults:{can_add_library_item:!1,contains_file_or_folder:!1,chain_call_control:{total_number:0,failed_number:0},disabled_jstree_element:"folders"},modal:null,jstree:null,histories:null,select_genome:null,select_extension:null,list_extensions:[],auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."},list_genomes:[],initialize:function(t){this.options=i.defaults(t||{},this.defaults),this.fetchExtAndGenomes(),this.render()},render:function(t){this.options=i.extend(this.options,t);var e=this.templateToolBar(),n={id:this.options.id,is_admin:!1,is_anonym:!0,multiple_add_dataset_options:!1};Galaxy.user&&(n.is_admin=Galaxy.user.isAdmin(),n.is_anonym=Galaxy.user.isAnonymous(),null===Galaxy.config.user_library_import_dir&&!1===Galaxy.config.allow_library_path_paste&&null===Galaxy.config.library_import_dir||(n.multiple_add_dataset_options=!0)),this.$el.html(e(n))},renderPaginator:function(t){this.options=i.extend(this.options,t);var e=this.templatePaginator();r("body").find(".folder-paginator").html(e({id:this.options.id,show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_items_count:this.options.total_items_count,items_shown:this.options.items_shown,folder_page_size:Galaxy.libraries.preferences.get("folder_page_size")}))},configureElements:function(t){this.options=i.extend(this.options,t),!0===this.options.can_add_library_item?r(".add-library-items").show():r(".add-library-items").hide(),!0===this.options.contains_file_or_folder&&Galaxy.user?Galaxy.user.isAnonymous()?(r(".dataset-manipulation").show(),r(".logged-dataset-manipulation").hide()):(r(".logged-dataset-manipulation").show(),r(".dataset-manipulation").show()):(r(".logged-dataset-manipulation").hide(),r(".dataset-manipulation").hide()),this.$el.find('[data-toggle="tooltip"]').tooltip({trigger:"hover"})},createFolderFromModal:function(t){var e=this;t.preventDefault(),t.stopPropagation();var n=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,l.default)("Create New Folder"),body:n(),buttons:{Create:function(){e.createNewFolderEvent()},Close:function(){Galaxy.modal.hide()}}})},createNewFolderEvent:function(){var e=this.serializeNewFolder();if(this.validateNewFolder(e)){var n,i=new p.default.FolderAsModel,r=t.history.fragment.split("/");n=r.indexOf("page")>-1?r[r.length-3]:r[r.length-1],i.url=i.urlRoot+n,i.save(e,{success:function(t){Galaxy.modal.hide(),h.default.success("Folder created."),t.set({type:"folder"}),Galaxy.libraries.folderListView.collection.add(t)},error:function(t,e){Galaxy.modal.hide(),void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")}})}else h.default.error("Folder's name is missing.");return!1},serializeNewFolder:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val()}},validateNewFolder:function(t){return""!==t.name},importToHistoryModal:function(t){var e=this;t.preventDefault();var n=this.findCheckedRows(),i=this.templateImportIntoHistoryModal();if(0===n.length)h.default.info("You must select some datasets first.");else{this.fetchUserHistories().done(function(){e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:(0,l.default)("Import into History"),body:i({histories:e.histories.models}),buttons:{Import:function(){e.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})}).fail(function(t,e){void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")})}},fetchUserHistories:function(){return this.histories=new p.default.GalaxyHistories,this.histories.fetch()},importAllIntoHistory:function(){var t=this;this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val();if(""!==e)this.createNewHistory(e).done(function(e){t.processImportToHistory(e.id,e.name)}).fail(function(t,e,n){h.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var n=r("select[name=import_to_history] option:selected").val(),i=r("select[name=import_to_history] option:selected").text();this.processImportToHistory(n,i),this.modal.enableButton("Import")}},createNewHistory:function(t){return r.post(Galaxy.root+"api/histories",{name:t})},processImportToHistory:function(t,e){for(var n=this.findCheckedItems(),i=[],r=n.dataset_ids.length-1;r>=0;r--){var o=n.dataset_ids[r],s=new p.default.HistoryItem;s.url=s.urlRoot+t+"/contents",s.content=o,s.source="library",i.push(s)}for(var l=n.folder_ids.length-1;l>=0;l--){var c=n.folder_ids[l],s=new p.default.HistoryItem;s.url=s.urlRoot+t+"/contents",s.content=c,s.source="library_folder",i.push(s)}this.initChainCallControl({length:i.length,action:"to_history",history_name:e}),a.getJSON(Galaxy.root+"history/set_as_current?id="+t),this.chainCallImportingIntoHistory(i,e)},updateProgress:function(){this.progress+=this.progressStep,r(".progress-bar-import").width(Math.round(this.progress)+"%");var t=Math.round(this.progress)+"% Complete";r(".completion_span").text(t)},download:function(t){var e=this.findCheckedItems(),n=Galaxy.root+"api/libraries/datasets/download/"+t,i={ld_ids:e.dataset_ids,folder_ids:e.folder_ids};this.processDownload(n,i,"get")},processDownload:function(t,e,n){if(t&&e){e="string"==typeof e?e:r.param(e);var i="";r.each(e.split("&"),function(){var t=this.split("=");i+=''}),r('
    '+i+"
    ").appendTo("body").submit().remove(),h.default.info("Your download will begin soon.")}else h.default.error("An error occurred.")},addFilesFromHistoryModal:function(){var t=this;this.histories=new p.default.GalaxyHistories,this.histories.fetch().done(function(){t.modal=Galaxy.modal;var e=t.templateAddFilesFromHistory();t.modal.show({closing_events:!0,title:(0,l.default)("Adding datasets from your history"),body:e({histories:t.histories.models}),buttons:{Add:function(){t.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+t.id,{trigger:!0})}}),t.fetchAndDisplayHistoryContents(t.histories.models[0].id),r("#dataset_add_bulk").change(function(e){t.fetchAndDisplayHistoryContents(e.target.value)})}).fail(function(t,e){void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")})},importFilesFromPathModal:function(){var t=this;this.modal=Galaxy.modal;var e=this.templateImportPathModal();this.modal.show({closing_events:!0,title:(0,l.default)("Please enter paths to import"),body:e({}),buttons:{Import:function(){t.importFromPathsClicked(t)},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+t.id,{trigger:!0})}}),this.renderSelectBoxes()},fetchExtAndGenomes:function(){var t=this;d.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(e){t.list_extensions=[];for(var n in e)t.list_extensions.push({id:e[n].extension,text:e[n].extension,description:e[n].description,description_url:e[n].description_url});t.list_extensions.sort(function(t,e){return t.id>e.id?1:t.ide.id?1:t.id=0;d--){var u=l[d].trim();0!==u.length&&c.push(u)}this.initChainCallControl({length:c.length,action:"adding_datasets"}),this.chainCallImportingFolders({paths:c,preserve_dirs:t,link_data:e,space_to_tab:n,to_posix_lines:i,source:"admin_path",file_type:o,tag_using_filenames:a,dbkey:s})}else h.default.info("Please enter a path relative to Galaxy root.")},initChainCallControl:function(t){var e;switch(t.action){case"adding_datasets":e=this.templateAddingDatasetsProgressBar(),this.modal.$el.find(".modal-body").html(e({folder_name:this.options.folder_name}));break;case"deleting_datasets":e=this.templateDeletingItemsProgressBar(),this.modal.$el.find(".modal-body").html(e());break;case"to_history":e=this.templateImportIntoHistoryProgressBar(),this.modal.$el.find(".modal-body").html(e({history_name:t.history_name}));break;default:Galaxy.emit.error("Wrong action specified.","datalibs")}this.progress=0,this.progressStep=100/t.length,this.options.chain_call_control.total_number=t.length,this.options.chain_call_control.failed_number=0},importFromJstreePath:function(t,e){var n=r("#jstree_browser").jstree().get_selected(!0),a=i.filter(n,function(t){return 0==t.state.disabled}),o=this.modal.$el.find(".preserve-checkbox").is(":checked"),s=this.modal.$el.find(".link-checkbox").is(":checked"),l=this.modal.$el.find(".spacetab-checkbox").is(":checked"),c=this.modal.$el.find(".posix-checkbox").is(":checked"),d=this.select_extension.value(),u=this.select_genome.value(),f=this.modal.$el.find(".tag-files").is(":checked"),p=a[0].type,_=[];if(a.length<1)h.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var g=a.length-1;g>=0;g--)void 0!==a[g].li_attr.full_path&&_.push(a[g].li_attr.full_path);if(this.initChainCallControl({length:_.length,action:"adding_datasets"}),"folder"===p){var m=e.source+"_folder";this.chainCallImportingFolders({paths:_,preserve_dirs:o,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,file_type:d,dbkey:u,tag_using_filenames:f})}else if("file"===p){var m=e.source+"_file";this.chainCallImportingUserdirFiles({paths:_,file_type:d,dbkey:u,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,tag_using_filenames:f})}}},fetchAndDisplayHistoryContents:function(t){var e=this;new p.default.HistoryContents({id:t}).fetch({success:function(n){var i=e.templateHistoryContents();e.histories.get(t).set({contents:n}),e.modal.$el.find(".library_selected_history_content").html(i({history_contents:n.models.reverse()})),e.modal.$el.find(".history-import-select-all").bind("click",function(){r(".library_selected_history_content [type=checkbox]").prop("checked",!0)}),e.modal.$el.find(".history-import-unselect-all").bind("click",function(){r(".library_selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(t,e){void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var t=this.modal.$el.find(".library_selected_history_content").find(":checked"),e=[],n=[],i=[];if(t.length<1)h.default.info("You must select some datasets first.");else{this.modal.disableButton("Add"),t.each(function(){var t=r(this).closest("li").data("id");if(t){var i=r(this).closest("li").data("name");e.push(t),n.push(i)}});for(var a=e.length-1;a>=0;a--){var o=e[a],s=new p.default.Item;s.url=Galaxy.root+"api/folders/"+this.options.id+"/contents","collection"===n[a]?s.set({from_hdca_id:o}):s.set({from_hda_id:o}),i.push(s)}this.initChainCallControl({length:i.length,action:"adding_datasets"}),this.chainCallAddingHdas(i)}},chainCallImportingIntoHistory:function(t,e){var n=this,i=t.pop();if(void 0===i)return 0===this.options.chain_call_control.failed_number?h.default.success("Selected datasets imported into history. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}}):this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number?h.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;s--){var c=new p.default.Item({id:t[s]});o.push(c)}for(var d=e.length-1;d>=0;d--){var u=new p.default.FolderAsModel({id:e[d]});o.push(u)}this.options.chain_call_control.total_number=a,this.chainCallDeletingItems(o)}},showLocInfo:function(){var t=this,e=null;null!==Galaxy.libraries.libraryListView?(e=Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id),this.showLocInfoModal(e)):(e=new p.default.Library({id:this.options.parent_library_id}),e.fetch({success:function(){t.showLocInfoModal(e)},error:function(t,e){void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")}}))},showLocInfoModal:function(t){var e=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,l.default)("Location Details"),body:e({library:t,options:this.options}),buttons:{Close:function(){Galaxy.modal.hide()}}})},showImportModal:function(t){switch(t.source){case"history":this.addFilesFromHistoryModal();break;case"importdir":this.importFilesFromGalaxyFolderModal({source:"importdir"});break;case"path":this.importFilesFromPathModal();break;case"userdir":this.importFilesFromGalaxyFolderModal({source:"userdir"});break;default:Galaxy.libraries.library_router.back(),h.default.error("Invalid import source.")}},showPageSizePrompt:function(t){t.preventDefault();var e=prompt("How many items per page do you want to see?",Galaxy.libraries.preferences.get("folder_page_size"));null!=e&&e==parseInt(e)&&(Galaxy.libraries.preferences.set({folder_page_size:parseInt(e)}),Galaxy.libraries.folderListView.render({id:this.options.id,show_page:1}))},findCheckedRows:function(){return r("#folder_list_body").find(":checked")},findCheckedItems:function(){var t=[],e=[];return this.findCheckedRows().each(function(){var n=r(this).closest("tr").data("id");"F"==n.substring(0,1)?t.push(n):e.push(n)}),{folder_ids:t,dataset_ids:e}},showCollectionSelect:function(t){var e=this;t.preventDefault();var n=this.findCheckedItems(),i=this.templateCollectionSelectModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create History Collection from Datasets",body:i({selected_datasets:n.dataset_ids.length}),buttons:{Continue:function(){e.showColectionBuilder(n.dataset_ids)},Close:function(){Galaxy.modal.hide()}}}),this.prepareCollectionTypeSelect(),this.prepareHistoryTypeSelect()},prepareCollectionTypeSelect:function(){var t=this;this.collectionType="list",this.select_collection_type=new g.default.View({css:"library-collection-type-select",container:this.modal.$el.find(".library-collection-type-select"),data:[{id:"list",text:"List"},{id:"paired",text:"Paired"},{id:"list:paired",text:"List of Pairs"},{id:"rules",text:"From Rules"}],value:"list",onchange:function(e){t.updateCollectionType(e)}})},prepareHistoryTypeSelect:function(){var t=this;this.fetchUserHistories().done(function(){for(var e=[],n=t.histories.length-1;n>=0;n--)e.unshift({id:t.histories.models[n].id,text:t.histories.models[n].get("name")});t.select_collection_history=new g.default.View({css:"library-collection-history-select",container:t.modal.$el.find(".library-collection-history-select"),data:e,value:e[0].id})})},updateCollectionType:function(t){this.collectionType=t},showColectionBuilder:function(e){var n=this,i=[],r=this.modal.$('input[type="radio"]:checked').val();if("selection"===r)for(var a=e.length-1;a>=0;a--){var o={},s=Galaxy.libraries.folderListView.folder_container.get("folder").get(e[a]);o.id=e[a],o.name=s.get("name"),o.deleted=s.get("deleted"),o.state=s.get("state"),i.push(o)}else"folder"===r&&(i=new t.Collection(Galaxy.libraries.folderListView.folder_container.get("folder").where({type:"file"})).toJSON());var l=this.modal.$("input[name=history_name]").val();if(""!==l)this.createNewHistory(l).done(function(t){h.default.success("History created"),n.collectionImport(i,t.id,t.name)}).fail(function(t,e,n){h.default.error("An error occurred.")});else{var c=this.select_collection_history.value(),d=this.select_collection_history.text();this.collectionImport(i,c,d)}},collectionImport:function(t,e,n){var i=this,r="Creating Collection in "+n,a=void 0,o=void 0;if("list"===this.collectionType)a=v.default.ListCollectionCreator,o=function(t,n,r){return t=t.map(function(t){return{id:t.id,name:t.name,src:"ldda"}}),i.createHDCA(t,i.collectionType,n,r,e)},v.default.collectionCreatorModal(t,{creationFn:o,title:r,defaultHideSourceItems:!0},a);else if("paired"===this.collectionType)a=b.default.PairCollectionCreator,o=function(t,n,r){return t=[{name:"forward",src:"ldda",id:t[0].id},{name:"reverse",src:"ldda",id:t[1].id}],i.createHDCA(t,i.collectionType,n,r,e)},v.default.collectionCreatorModal(t,{creationFn:o,title:r,defaultHideSourceItems:!0},a);else if("list:paired"===this.collectionType){var s=t.map(function(t){return{id:t.id,name:t.name,src:"ldda"}});x.default.pairedCollectionCreatorModal(s,{historyId:e,title:r,defaultHideSourceItems:!0})}else if("rules"===this.collectionType){var l=function(t,n,r,a){return i.createHDCA(t,n,r,a,e)};v.default.ruleBasedCollectionCreatorModal(t,"library_datasets","collections",{creationFn:l,defaultHideSourceItems:!0})}},createHDCA:function(t,e,n,i,r,a){return new M.default.HistoryDatasetCollection({history_content_type:"dataset_collection",collection_type:e,history_id:r,name:n,hide_source_items:i||!1,element_identifiers:t}).save(a)},templateToolBar:function(){return i.template(['
    ','
    ','DATA LIBRARIES',"
    ",'
    ','",'","<% if(multiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'",'",'",'','","",'','','","","","
    ","
    ","
    ",'
    ','
    ',"
    "].join(""))},templateLocInfoInModal:function(){return i.template(["
    ",'',"",'',"","","","","",'',"",'<% if(library.get("description") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("synopsis") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("create_time_pretty") !== "") { %>',"","",'',"","<% } %>","","",'',"","","
    library
    name<%- library.get("name") %>
    description<%- library.get("description") %>
    synopsis<%- library.get("synopsis") %>
    created"><%- library.get("create_time_pretty") %>
    id<%- library.get("id") %>
    ",'',"",'',"","","","","","","",'<% if(options.folder_description !== "") { %>',"","","","","<% } %>","","","","","","
    folder
    name<%- options.folder_name %>
    description<%- options.folder_description %>
    id<%- options.id %>
    ","
    "].join(""))},templateNewFolderInModal:function(){return i.template(['
    ',"
    ",'','',"
    ","
    "].join(""))},templateImportIntoHistoryModal:function(){return i.template(["
    ",'
    ',"Select history: ",'","
    ",'
    ',"or create new: ",'',"
    ","
    "].join(""))},templateImportIntoHistoryProgressBar:function(){return i.template(['
    ',"Importing selected items to history <%= _.escape(history_name) %>","
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateAddingDatasetsProgressBar:function(){return i.template(['
    ',"Adding selected datasets to library folder <%= _.escape(folder_name) %>","
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateDeletingItemsProgressBar:function(){return i.template(['
    ',"
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateBrowserModal:function(){return i.template(['
    ','
    ','",'","
    ",'
    All files you select will be imported into the current folder ignoring their folder structure.
    ','','
    ','",'",'",'","
    ",'",'","
    ",'
    ',"
    ","
    ","

    You can set extension type and genome for all imported datasets at once:

    ","
    ",'Type: ','Genome: ',"
    ","
    ","
    ",'","
    ","
    "].join(""))},templateImportPathModal:function(){return i.template(['
    ','
    All files within the given folders and their subfolders will be imported into the current folder.
    ','
    ','",'","
    ",'",'","
    ",'',"
    ","

    You can set extension type and genome for all imported datasets at once:

    ","
    ",'Type: ','Genome: ',"
    ","
    ",'","
    ","
    "].join(""))},templateAddFilesFromHistory:function(){return i.template(['
    ',"
    ","1. Select history: ",'","
    ","
    ",'
    ',"
    ","
    "].join(""))},templateHistoryContents:function(){return i.template(["

    2. Choose the datasets to import:

    ","
    ",'",'","
    ","
    ","
      ","<% _.each(history_contents, function(history_item) { %>",'<% if (history_item.get("deleted") != true ) { %>','<% var item_name = history_item.get("name") %>','<% if (history_item.get("type") === "collection") { %>','<% var collection_type = history_item.get("collection_type") %>','<% if (collection_type === "list") { %>','
    • " data-name="<%= _.escape(history_item.get("type")) %>">',"
    • ","<% } else { %>",'
    • ','','<%= _.escape(history_item.get("hid")) %>: ','<%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> (Dataset Collection of type <%= _.escape(collection_type) %> not supported.)',"","
    • ","<% } %>",'<% } else if (history_item.get("visible") === true && history_item.get("state") === "ok") { %>','
    • " data-name="<%= _.escape(history_item.get("type")) %>">','","
    • ","<% } %>","<% } %>","<% }); %>","
    "].join(""))},templatePaginator:function(){return i.template(['",'',' <%- items_shown %> items shown (change)',"",''," <%- total_items_count %> total",""].join(""))},templateCollectionSelectModal:function(){return i.template(["
    ",'
    ',"

    Which datasets?

    ",'
    ','",'","
    ","
    ",'
    ',"

    Collection type

    ",'',"
    Which type to choose?
    ","
      ","
    • ","List: Generic collection which groups any number of datasets into a set; similar to file system folder.","
    • ","
    • ","Paired: Simple collection containing exactly two sequence datasets; one reverse and the other forward.","
    • ","
    • ","List of Pairs: Advanced collection containing any number of Pairs; imagine as Pair-type collections inside of a List-type collection.","
    • ","
    • ","From Rules: Use Galaxy's rule builder to describe collections. This is more of an advanced feature that allows building any number of collections or any type.","
    • ","
    ","
    ",'
    ',"

    Select history

    ",''," or create new: ",'',"
    ","
    "].join(""))}});e.default={FolderToolbarView:C}}).call(e,n(2),n(1),n(0),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),s=a(o),l=n(59),c=a(l),d=n(39),u=a(d),h=t.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(t){this.options=i.extend(this.options,t),this.options.id&&this.fetchLibrary()},fetchLibrary:function(t){this.options=i.extend(this.options,t),this.model=new c.default.Library({id:this.options.id});var e=this;this.model.fetch({success:function(){e.options.show_permissions&&e.showPermissions()},error:function(t,e){void 0!==e.responseJSON?s.default.error(e.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(t){this.options=i.extend(this.options,t),r(".tooltip").remove(),void 0!==this.options.fetched_permissions&&(0===this.options.fetched_permissions.access_library_role_list.length?this.model.set({is_unrestricted:!0}):this.model.set({is_unrestricted:!1}));var e=!1;Galaxy.user&&(e=Galaxy.user.isAdmin());var n=this.templateLibraryPermissions();this.$el.html(n({library:this.model,is_admin:e}));var a=this;r.get(Galaxy.root+"api/libraries/"+a.id+"/permissions?scope=current").done(function(t){a.prepareSelectBoxes({fetched_permissions:t})}).fail(function(){s.default.error("An error occurred while attempting to fetch library permissions.")}),r('#center [data-toggle="tooltip"]').tooltip({trigger:"hover"}),r("#center").css("overflow","auto")},_serializeRoles:function(t){for(var e=[],n=0;n=0;n--)e.push(t[n].id);return e},savePermissions:function(t){var e=this,n=this._extractIds(this.accessSelectObject.$el.select2("data")),i=this._extractIds(this.addSelectObject.$el.select2("data")),a=this._extractIds(this.manageSelectObject.$el.select2("data")),o=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/libraries/"+e.id+"/permissions?action=set_permissions",{"access_ids[]":n,"add_ids[]":i,"manage_ids[]":a,"modify_ids[]":o}).done(function(t){e.showPermissions({fetched_permissions:t}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set library permissions.")})},templateLibraryPermissions:function(){return i.template(['
    ',"","

    ",'Library: <%= _.escape(library.get("name")) %>',"

    ",'
    ',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any library on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
    ",'
    ',"

    Library permissions

    ","

    Roles that can access the library

    ",'
    ','
    ',"User with any of these roles can access this library. If there are no access roles set on the library it is considered unrestricted.","
    ","

    Roles that can manage permissions on this library

    ",'
    ','
    ',"User with any of these roles can manage permissions on this library (includes giving access).","
    ","

    Roles that can add items to this library

    ",'
    ','
    ',"User with any of these roles can add items to this library (folders and datasets).","
    ","

    Roles that can modify this library

    ",'
    ','
    ',"User with any of these roles can modify this library (name, synopsis, etc.).","
    ",'","
    ","
    "].join(""))}});e.default={LibraryView:h}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),s=a(o),l=n(59),c=a(l),d=n(39),u=a(d),h=t.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(t){this.options=i.extend(this.options,t),this.options.id&&this.fetchFolder()},fetchFolder:function(t){this.options=i.extend(this.options,t),this.model=new c.default.FolderAsModel({id:this.options.id});var e=this;this.model.fetch({success:function(){e.options.show_permissions&&e.showPermissions()},error:function(t,e){void 0!==e.responseJSON?s.default.error(e.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(t){this.options=i.extend(this.options,t),r(".tooltip").remove();var e=!1;Galaxy.user&&(e=Galaxy.user.isAdmin());var n=this.templateFolderPermissions();this.$el.html(n({folder:this.model,is_admin:e}));var a=this;r.get(Galaxy.root+"api/folders/"+a.id+"/permissions?scope=current").done(function(t){a.prepareSelectBoxes({fetched_permissions:t})}).fail(function(){s.default.error("An error occurred while attempting to fetch folder permissions.")}),r('#center [data-toggle="tooltip"]').tooltip({trigger:"hover"}),r("#center").css("overflow","auto")},_serializeRoles:function(t){for(var e=[],n=0;n=0;n--)e.push(t[n].id);return e},savePermissions:function(t){var e=this,n=this._extractIds(this.addSelectObject.$el.select2("data")),i=this._extractIds(this.manageSelectObject.$el.select2("data")),a=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/folders/"+e.id+"/permissions?action=set_permissions",{"add_ids[]":n,"manage_ids[]":i,"modify_ids[]":a}).done(function(t){e.showPermissions({fetched_permissions:t}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set folder permissions.")})},templateFolderPermissions:function(){return i.template(['
    ',"","

    ",'Folder: <%= _.escape(folder.get("name")) %>',"

    ",'
    ',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any folder on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
    ",'
    ',"

    Folder permissions

    ","

    ","Roles that can manage permissions on this folder","

    ",'
    ','
    ',"User with any of these roles can manage permissions on this folder.","
    ","

    ","Roles that can add items to this folder","

    ",'
    ','
    ',"User with any of these roles can add items to this folder (folders and datasets).","
    ","

    ","Roles that can modify this folder","

    ",'
    ','
    ',"User with any of these roles can modify this folder (name, etc.).","
    ",'","
    ","
    "].join(""))}});e.default={FolderView:h}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t){function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(739),a=i(r),o=n(740),s=i(o),l=n(741),c=i(l),d=n(742),u=i(d),h=n(743),f=i(h),p=n(744),_=i(p),g=n(745),m=i(g),v=t.Router.extend({initialize:function(){this.routesHit=0,t.history.on("route",function(){this.routesHit++},this),this.bind("route",this.trackPageview)},routes:{"":"toolsheds",sheds:"toolsheds",queue:"queue",workflows:"workflows","status/r/:repositories":"status",status:"status","categories/s/:tool_shed":"categories","category/s/:tool_shed/c/:cateory_id":"repositories","repository/s/:tool_shed/r/:repository_id":"repository"},back:function(){this.routesHit>1?window.history.back():this.navigate("#",{trigger:!0,replace:!0})}}),y=t.View.extend({app_config:{known_views:["toolsheds","queue","status","categories","repositories","repoository"]},initialize:function(){Galaxy.admintoolshedapp=this,this.admin_toolshed_router=new v,this.admin_toolshed_router.on("route:queue",function(){Galaxy.admintoolshedapp.adminRepoQueueView?Galaxy.admintoolshedapp.adminRepoQueueView.reDraw():Galaxy.admintoolshedapp.adminRepoQueueView=new f.default.RepoQueueView}),this.admin_toolshed_router.on("route:toolsheds",function(){Galaxy.admintoolshedapp.adminShedListView?Galaxy.admintoolshedapp.adminShedListView.reDraw():Galaxy.admintoolshedapp.adminShedListView=new a.default.ShedListView}),this.admin_toolshed_router.on("route:categories",function(t){Galaxy.admintoolshedapp.adminShedCategoriesView?Galaxy.admintoolshedapp.adminShedCategoriesView.reDraw({tool_shed:t.replace(/\//g,"%2f")}):Galaxy.admintoolshedapp.adminShedCategoriesView=new s.default.CategoryView({tool_shed:t.replace(/\//g,"%2f")})}),this.admin_toolshed_router.on("route:repositories",function(t,e){Galaxy.admintoolshedapp.adminShedCategoryView?Galaxy.admintoolshedapp.adminShedCategoryView.reDraw({tool_shed:t.replace(/\//g,"%2f"),category_id:e}):Galaxy.admintoolshedapp.adminShedCategoryView=new c.default.Category({tool_shed:t.replace(/\//g,"%2f"),category_id:e})}),this.admin_toolshed_router.on("route:repository",function(t,e){Galaxy.admintoolshedapp.adminRepositoryView?Galaxy.admintoolshedapp.adminRepositoryView.reDraw({tool_shed:t.replace(/\//g,"%2f"),repository_id:e}):Galaxy.admintoolshedapp.adminRepositoryView=new u.default.RepoDetails({tool_shed:t.replace(/\//g,"%2f"),repository_id:e})}),this.admin_toolshed_router.on("route:status",function(t){Galaxy.admintoolshedapp.adminRepoStatusView?Galaxy.admintoolshedapp.adminRepoStatusView.reDraw({repositories:t.split("|")}):Galaxy.admintoolshedapp.adminRepoStatusView=new _.default.RepoStatus({repositories:t.split("|")})}),this.admin_toolshed_router.on("route:workflows",function(){Galaxy.admintoolshedapp.adminWorkflowsView?Galaxy.admintoolshedapp.adminWorkflowsView.reDraw():Galaxy.admintoolshedapp.adminWorkflowsView=new m.default.Workflows}),t.history.start({pushState:!1})}});e.default={GalaxyApp:y}}).call(e,n(2))},function(t,e,n){"use strict";(function(t,i){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),o=r(a),s=n(147),l=r(s),c=n(148),d=r(c),u=t.View.extend({defaults:{tool_sheds:[{url:"https://toolshed.g2.bx.psu.edu/",name:"Galaxy Main Tool Shed"}]},initialize:function(t){this.options=i.defaults(this.options||{},this.defaults),this.model=new l.default.ShedsCollection,this.listenTo(this.model,"sync",this.render),this.model.fetch()},el:"#center",render:function(t){this.options=i.defaults(this.options||{},t,this.defaults);var e=this.templateToolshedList;this.$el.html(e({title:(0,o.default)("Configured Galaxy Tool Sheds"),tool_sheds:this.model.models,queue:d.default.queueLength()}))},reDraw:function(t){this.$el.empty(),this.render(t)},templateToolshedList:i.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','
    ','',"<% _.each(tool_sheds, function(shed) { %>",'',"","","<% }); %>","
    ",'","
    ","
    ",'
    ',"
    "].join(""))});e.default={ShedListView:u}}).call(e,n(2),n(1))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(147),s=a(o),l=n(148),c=a(l);n(69);var d=t.View.extend({el:"#center",defaults:{tool_shed:"https://toolshed.g2.bx.psu.edu/"},initialize:function(t){var e=t.tool_shed.replace(/\//g,"%2f");this.options=i.defaults(this.options||t,this.defaults),this.model=new s.default.Categories,this.listenTo(this.model,"sync",this.render),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.model.tool_shed=e,this.model.fetch()},render:function(t){this.options=i.extend(this.options,t),this.options.categories=this.model.models,this.options.queue=c.default.queueLength();var e=this.templateCategoryList;this.$el.html(e(this.options)),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var e=this;r("#search_box").autocomplete({source:function(t,n){var i=e.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:t.term,tool_shed_url:i};r.post(a,o,function(t){console.log(t);var e=c.default.shedParser(t);n(e)})},minLength:3,select:function(n,i){var r=i.item.value,a=(Galaxy.root,e.model.tool_shed,"repository/s/"+e.model.tool_shed+"/r/"+r);t.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(t){this.$el.empty(),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.initialize(t)},templateCategoryList:i.template(['",'
    ','
    Categories in <%= tool_shed.replace(/%2f/g, "/") %>
    ','',"
    ",'
    ','",'
    ','','',"","","","","","","<% _.each(categories, function(category) { %>","","",'','',"","<% }); %>","
    NameDescriptionRepositories
    ",'"><%= category.get("name") %>',"<%= category.get("description") %><%= category.get("repositories") %>
    ","
    ","
    "].join(""))});e.default={CategoryView:d}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(147),s=a(o),l=n(148),c=a(l);n(69);var d=t.View.extend({el:"#center",initialize:function(t){this.model=new s.default.CategoryCollection,this.listenTo(this.model,"sync",this.render);var e=t.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+e+"&category_id="+t.category_id,this.model.tool_shed=e,this.model.category=t.category_id,this.model.fetch()},render:function(t){this.options=i.extend(this.options,t);var e=this.templateCategoryContents;this.$el.html(e({category:this.model.models[0],tool_shed:this.model.tool_shed,queue:c.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var e=this;r("#search_box").autocomplete({source:function(t,n){var i=e.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:t.term,tool_shed_url:i};r.post(a,o,function(t){var e=c.default.shedParser(t);n(e)})},minLength:3,select:function(n,i){var r=i.item.value,a="repository/s/"+e.model.tool_shed+"/r/"+r;t.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(t){this.$el.empty(),this.initialize(t)},templateCategoryContents:i.template(['",'
    ','
    Repositories in <%= category.get("name") %>
    ','',"
    ",'
    ','",'
    ','','',"",'','',"",'',"","",'<% _.each(category.get("repositories"), function(repository) { %>',"","","","","","","<% }); %>","
    OwnerNameSynopsisType
    <%= repository.owner %>",'","<%= repository.description %><%= repository.type %>
    ","
    ","
    "].join(""))});e.default={Category:d}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(147),s=a(o),l=n(412),c=(a(l),n(5)),d=a(c),u=n(17),h=a(u),f=n(26),p=a(f),_=n(148),g=a(_),m=t.View.extend({el:"#center",initialize:function(t){this.options=i.defaults(this.options||{},this.defaults),this.model=new s.default.RepositoryCollection,this.listenTo(this.model,"sync",this.render);var e=t.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+e+"&repository_id="+t.repository_id,this.model.tool_shed_url=t.tool_shed.replace(/%2f/g,"/"),this.model.tool_shed=e,this.model.category=t.repository_id,this.model.fetch()},render:function(t){var e=this.templateRepoDetails,n=this.model.models[0];this.options={repository:n.get("repository"),tool_shed:this.model.tool_shed,queue:g.default.queueLength()};var a=Object.keys(this.options.repository.metadata).sort(function(t,e){return parseInt(t.split(":")[0]-e.split(":")[0])}),o={},s=this.options.repository.metadata;a.forEach(function(t){o[t]=s[t]}),this.options.repository.metadata=o,this.options.current_changeset=this.options.current_changeset||a[a.length-1],this.options.current_metadata=this.options.repository.metadata[this.options.current_changeset],this.options.current_metadata.tool_shed_url=this.model.tool_shed_url,this.options.tools=this.options.current_metadata.tools,this.options.repository_dependencies_template=this.templateRepoDependencies,this.options.repository_dependency_template=this.templateRepoDependency,this.options.tps_template_global_select=this.templateGlobalSectionSelect,this.options.tps_template_tool_select=this.templateToolSectionSelect,this.options.tps_select_options=this.templatePanelSelectOptions,this.options.tool_dependencies=n.get("tool_dependencies"),this.options.shed_tool_conf=this.templateShedToolConf({shed_tool_confs:n.get("shed_conf")}),this.options.panel_section_dict=n.get("panel_section_dict"),this.options.api_url=Galaxy.root+"api/tool_shed_repositories/install?async=True",this.options=i.extend(this.options,t),this.$el.html(e(this.options)),this.checkInstalled(this.options.current_metadata),this.bindEvents(),r("#center").css("overflow","auto")},bindEvents:function(){var t=this;r("#changeset").on("change",function(){t.options.current_changeset=r("#changeset").find("option:selected").text(),t.options.current_metadata=t.options.repository.metadata[t.options.current_changeset],t.checkInstalled(t.options.current_metadata),t.reDraw(t.options)}),r("#tool_panel_section_select").on("change",function(){t.tpsSelection()}),r("#install_repository").on("click",function(e){r("#repository_installation");e.preventDefault();var n={};n.repositories=JSON.stringify([[r("#install_repository").attr("data-tsrid"),r("#changeset").find("option:selected").val()]]),n.tool_shed_repository_ids=JSON.stringify([r("#install_repository").attr("data-tsrid")]),n.tool_shed_url=t.model.tool_shed_url,n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val();t.panelSelect(n);n.tool_panel_section=JSON.stringify(t.panelSelect(n)),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.changeset=r("#changeset").find("option:selected").val();var i=r("#repository_installation").attr("action");t.prepareInstall(n,i)}),r("#queue_install").on("click",function(e){t.options.current_changeset=r("#changeset").find("option:selected").text(),t.options.current_metadata=t.options.repository.metadata[t.options.current_changeset];var n=(t.options.current_changeset,{});i.each(Object.keys(t.options.current_metadata),function(e){n[e]||(n[e]=t.options.current_metadata[e])}),n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val(),n.tool_panel_section=JSON.stringify(t.panelSelect({})),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.tool_shed_url=t.model.tool_shed_url,"/"==n.tool_shed_url.substr(-1)&&(n.tool_shed_url=n.tool_shed_url.substr(0,n.tool_shed_url.length-1)),g.default.addToQueue(n),t.checkInstalled(n)}),r(".tool_panel_section_picker").on("change",function(){r(this).find("option:selected").val()==r("#tool_panel_section_select").find("option:selected").val()?r(this).attr("default","active"):r(this).removeAttr("default")}),r(function(){r("#repository_dependencies").jstree()}),r(".tool_form").on("click",function(){var e=r(this).attr("data-guid"),n=(r(this).attr("data-clean"),r(this).attr("data-name")),i=r(this).attr("data-desc"),a=t.model.tool_shed_url,o=r("#repository_details").attr("data-tsrid"),s=r("#changeset").find("option:selected").val(),l=Galaxy.root+"api/tool_shed/tool_json",c={guid:e,tool_shed_url:a,tsr_id:o,changeset:s};r.get(l,c,function(t){t.cls="ui-portlet-plain";var e=new p.default(t);d.default.deepeach(t.inputs,function(t){t.type&&-1!=["data","data_collection"].indexOf(t.type)&&(t.type="hidden",t.info="Data input '"+t.name+"' ("+d.default.textify(t.extensions)+")")});var r=new h.default.View,a=""+n+" "+i;r.show({closing_events:!0,title:a,body:e.$el,buttons:{Close:function(){r.hide()}}})})})},checkInstalled:function(t){var e=this,n={name:t.name,owner:t.owner},i=!1;e.repoQueued(t);r.get(Galaxy.root+"api/tool_shed_repositories",n,function(n){for(var a=0;a','
    Repository information for <%= repository.name %> from <%= repository.owner %>
    ','',"
    ",'
    ','
    ','','','
    ','
    Changeset
    ','
    ','",'','','
    Please select a revision and review the settings below before installing.
    ',"
    ","
    ","<%= shed_tool_conf %>","<% if (current_metadata.has_repository_dependencies) { %>",'
    Repository dependencies for <%= current_changeset %>
    ','
    ','

    ','','',"

    ","<% current_metadata.repository_dependency_template = repository_dependency_template; %>",'
    ','","<%= repository_dependencies_template(current_metadata) %>","
    ","
    ","<% } %>","<% if (current_metadata.includes_tool_dependencies) { %>",'
    Tool dependencies
    ','
    ','

    ','','',"

    ",'

    ','','',"

    ",'
    ','",'',"",'','',"","","","",'',"<% _.each(tool_dependencies[current_changeset], function(dependency) { %>",'','","","","","<% }); %>","","
    NameVersionType
    ',"<%= dependency.name %><%= dependency.version %><%= dependency.type %>
    ","
    ","
    ","<% } %>","<% if (current_metadata.includes_tools_for_display_in_tool_panel) { %>",'
    Tools – click the name to preview the tool and use the pop-up menu to inspect all metadata
    ','
    ','
    ','',"",'','',"","","","",'',"<% _.each(current_metadata.tools, function(tool) { %>",'','","",'','","","<% }); %>","","
    NameDescriptionVersion<%= tps_template_global_select({tps: panel_section_dict, tps_select_options: tps_select_options}) %>
    ','","<%= tool.description %><%= tool.version %>',"<%= tps_template_tool_select({tool: tool, tps: panel_section_dict, tps_select_options: tps_select_options}) %>","
    ","
    ","
    ","<% } %>","
    ","
    "].join("")),templateRepoDependencies:i.template(['
    Repository Dependencies
    ','
    ',"
      ","
    • Repository installation requires the following","<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","<% } %>","
    • ","
    ","
    "].join("")),templateRepoDependency:i.template(['
  • ',"Repository <%= repository.name %> revision <%= changeset_revision %> owned by <%= repository.owner %>","<% if (has_repository_dependencies) { %>",'
      ',"<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","
    ","<% } %>","
  • "].join("")),templateShedToolConf:i.template(['
    Shed tool configuration file:
    ','
    ','
    ','",'
    Select the file whose tool_path setting you want used for installing repositories.
    ',"
    ","
    "].join("")),templateToolDependency:i.template(["<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% if (dependency.includes_tool_dependencies) { %>","<% dependency.tool_dependency_template = tool_dependency_template %>","<%= tool_dependency_template(dependency) %>","<% } %>","<% }); %>","<% } %>"].join("")),templateGlobalSectionCreate:i.template(['
    ','
    ','','','
    ',"Add a new tool panel section to contain the installed tools (optional).","
    ","
    ","
    "].join("")),templateGlobalSectionSelect:i.template(['
    ','
    Tool Panel Section
    ','
    ','
    ','",'','
    ',"Select an existing tool panel section to contain the installed tools (optional).","
    ","
    ","
    ","
    "].join("")),templateToolSectionCreate:i.template(['
    ','','',"
    "].join("")),templateToolSectionSelect:i.template(['
    ','",'','
    ',"
    "].join("")),templatePanelSelectOptions:i.template(["<% _.each(sections, function(section) { %>",'',"<% }); %>"].join(""))});e.default={RepoDetails:m}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(147),c=a(l),d=n(148),u=a(d),h=t.View.extend({el:"#center",defaults:[{}],initialize:function(t){var e=this;this.model=new c.default.RepoQueue,this.listenTo(this.model,"sync",this.render),this.model.fetch(),e.render()},render:function(t){var e=this,n=e.templateRepoQueue,r=e.model.models;e.$el.html(n({title:(0,s.default)("Repository Installation Queue"),repositories:r,queue:u.default.queueLength()})),i("#center").css("overflow","auto"),e.bindEvents()},bindEvents:function(){var e=this;i(".install_one").on("click",function(){var t=e.loadFromQueue(i(this).attr("data-repokey"));e.installFromQueue(t,i(this).attr("data-repokey"))}),i(".remove_one").on("click",function(){var t=i(this).attr("data-repokey"),e=JSON.parse(localStorage.repositories);if(e.hasOwnProperty(t)){var n=e[t].repository.id;delete e[t],i("#queued_repository_"+n).remove()}localStorage.repositories=JSON.stringify(e)}),i("#clear_queue").on("click",function(){localStorage.repositories="{}"}),i("#from_workflow").on("click",function(){t.history.navigate("workflows",{trigger:!0,replace:!0})})},installFromQueue:function(e,n){var r=Object();r.install_tool_dependencies=e.install_tool_dependencies,r.install_repository_dependencies=e.install_repository_dependencies,r.install_resolver_dependencies=e.install_resolver_dependencies,r.tool_panel_section=e.tool_panel_section,r.shed_tool_conf=e.shed_tool_conf,r.repositories=JSON.stringify([[e.repository.id,e.changeset_revision]]),r.tool_shed_repository_ids=JSON.stringify([e.repository.id]),r.tool_shed_url=n.split("|")[0],r.changeset=e.changeset_revision;var a=Galaxy.root+"api/tool_shed_repositories/install?async=True";if(i("#queued_repository_"+e.repository.id).remove(),localStorage.repositories){void 0===n&&(n=u.default.queueKey(e));var o=JSON.parse(localStorage.repositories);o.hasOwnProperty(n)&&(delete o[n],localStorage.repositories=JSON.stringify(o))}i.post(a,r,function(e){var n=JSON.parse(e),r=n.repositories,a="status/r/"+r.join("|");i.post(Galaxy.root+"admin_toolshed/install_repositories",n,function(t){console.log("Initializing repository installation succeeded")}),t.history.navigate(a,{trigger:!0,replace:!0})})},loadFromQueue:function(t){var e=JSON.parse(localStorage.repositories);if(e.hasOwnProperty(t))return e[t]},reDraw:function(t){this.$el.empty(),this.initialize(t),this.model.fetch(),this.render(t)},templateRepoQueue:r.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','','',"",'','','','','','',"","","","<% _.each(repositories, function(repository) { %>",'">','','','','','",'","","<% }); %>","","
    NameOwnerRevisionToolShedInstall
    <%= repository.get("repository").name %><%= repository.get("repository").owner %><%= repository.get("changeset_revision") %><%= repository.get("tool_shed_url") %>','" type="submit" id="install_repository_<%= repository.get("id") %>" name="install_repository" value="Install now" />',"','" type="submit" id="unqueue_repository_<%= repository.get("id") %>" name="unqueue_repository" value="Remove from queue" />',"
    ",'',"
    "].join(""))});e.default={RepoQueueView:h}}).call(e,n(2),n(0),n(1))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(147),c=a(l),d=n(148),u=a(d),h=t.View.extend({el:"#center",initialize:function(t){this.options=i.defaults(this.options||[{}],t,this.defaults),this.model=new c.default.RepoStatus,this.listenTo(this.model,"sync",this.render),this.model.url+="?repositories="+this.options.repositories.join("|"),this.model.fetch(),this.timer=setInterval(function(t){var e=["installed","error"],n=!0;i.some(t.model.models,function(t){repo_id=t.get("id");var i=t.get("status").toLowerCase();if(-1===e.indexOf(i))return n=!1,!0}),n?clearInterval(t.timer):t.model.fetch()},2e3,this)},close:function(){clearInterval(this.timer)},render:function(t){this.options=i.extend(this.options,t);var e=this.templateRepoStatus;this.$el.html(e({title:(0,s.default)("Repository Status"),repositories:this.model.models,queue:u.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){},reDraw:function(t){this.$el.empty(),this.initialize(t)},templateRepoStatus:i.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','',"","",'',"<% _.each(repositories, function(repository) { %>","","","","","","","","<% }); %>","",'',"
    NameDescriptionOwnerRevisionInstallation Status
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    "].join(""))});e.default={RepoStatus:h}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(147),c=a(l),d=n(148),u=a(d),h=t.View.extend({el:"#center",defaults:[{}],initialize:function(t){var e=this;this.model=new c.default.WorkflowTools,this.listenTo(this.model,"sync",this.render),this.model.fetch(),e.render()},render:function(t){var e=this,n=e.templateWorkflows,r=e.model.models;e.$el.html(n({title:(0,s.default)("Workflows Missing Tools"),workflows:r,queue:u.default.queueLength()})),i("#center").css("overflow","auto"),e.bindEvents()},bindEvents:function(){var e,n=this;i(".show_wf_repo").on("click",function(){var n=i(this).attr("data-toolids"),r=i(this).attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){e=n.repository.id;var i="repository/s/"+r.replace(/:/g,"%3a").replace(/\//g,"%2f")+"/r/"+n.repository.id;t.history.navigate(i,{trigger:!0,replace:!0})})}),i(".queue_wf_repo").on("click",function(){var t=i(this),n=t.attr("data-toolids"),r=t.attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){e=n.repository.id,o={tool_shed_url:r,repository_id:e},i.get(a,o,function(e){var n=Object.keys(e.repository.metadata),i=n[0],a=e.repository.metadata[i];a.tool_shed_url=r,u.default.addToQueue(a),t.remove()})})}),i("#from_workflow").on("click",n.loadWorkflows)},reDraw:function(t){this.$el.empty(),this.initialize(t)},templateWorkflows:r.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','','',"","","","<% _.each(workflows, function(workflow) { %>","",'",'",'','','','","","<% }); %>","",""].join(""))});e.default={Workflows:h}}).call(e,n(2),n(0),n(1))},function(t,e,n){"use strict";(function(t){function i(t){return t&&t.__esModule?t:{default:t}}function r(t){var e,n,i,r;switch(t){case h.ITEM_HISTORY:e="History",n="Histories",i="history",r="History";break;case h.ITEM_DATASET:e="Dataset",n="Datasets",i="dataset",r="HistoryDatasetAssociation";break;case h.ITEM_WORKFLOW:e="Workflow",n="Workflows",i="workflow",r="StoredWorkflow";break;case h.ITEM_PAGE:e="Page",n="Pages",i="page",r="Page";break;case h.ITEM_VISUALIZATION:e="Visualization",n="Visualizations",i="visualization",r="Visualization"}var a="list_"+n.toLowerCase()+"_for_selection";return{singular:e,plural:n,controller:i,iclass:r,list_ajax_url:list_objects_url.replace("LIST_ACTION",a)}}function a(e,n,i){var r=set_accessible_url.replace("ITEM_CONTROLLER",e);t.ajax({type:"POST",url:r,data:{id:n,accessible:"True"},error:function(){alert("Making "+i+" accessible failed")}})}function o(){t(document).ajaxError(function(t,e){var n=e.responseText||e.statusText||"Could not connect to server";return show_modal("Server error",n,{"Ignore error":hide_modal}),!1}),t("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"
    WorkflowsTool IDsShedNameOwnerActions
    ','
      ','<% _.each(workflow.get("workflows"), function(name) { %>','
    • <%= name %>
    • ',"<% }); %>","
    ","
    ','
      ','<% _.each(workflow.get("tools"), function(tool) { %>','
    • <%= tool %>
    • ',"<% }); %>","
    ","
    <%= workflow.get("shed") %><%= workflow.get("repository") %><%= workflow.get("owner") %>','
      ','
    • ','" data-owner="<%= workflow.get("owner") %>" data-repo="<%= workflow.get("repository") %>" data-toolids="<%= workflow.get("tools").join(",") %>" value="Show Repository" />
    • ',"
    ","
    "+u.TOOLS+"
    "+u.IFRAME+u.STATUS+"
    ",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:(0,l.default)("Superscript"),css:"wym_tools_superscript"},{name:"Subscript",title:(0,l.default)("Subscript"),css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"}]});var e=t.wymeditors(0),n=function(n){show_modal("Saving page","progress"),t.ajax({url:save_url,type:"POST",data:{id:page_id,content:e.xhtml(),annotations:JSON.stringify(new Object),_:"true"},success:function(){n()}})};t("#save-button").click(function(){n(function(){hide_modal()})}),t("#close-button").click(function(){window.document.location=page_list_url});var i=t("");t(".wym_area_top").append(i);var r={};t.each(e._options.containersItems,function(t,n){var i=n.name;r[n.title.replace("_"," ")]=function(){e.container(i)}}),make_popupmenu(i,r);var a=t("").addClass("galaxy-page-editor-button");t(".wym_area_top").append(a),make_popupmenu(a,{"Insert History Link":function(){e.dialog(h.DIALOG_HISTORY_LINK)},"Insert Dataset Link":function(){e.dialog(h.DIALOG_DATASET_LINK)},"Insert Workflow Link":function(){e.dialog(h.DIALOG_WORKFLOW_LINK)},"Insert Page Link":function(){e.dialog(h.DIALOG_PAGE_LINK)},"Insert Visualization Link":function(){e.dialog(h.DIALOG_VISUALIZATION_LINK)}});var o=t("").addClass("galaxy-page-editor-button");t(".wym_area_top").append(o),make_popupmenu(o,{"Embed History":function(){e.dialog(h.DIALOG_EMBED_HISTORY)},"Embed Dataset":function(){e.dialog(h.DIALOG_EMBED_DATASET)},"Embed Workflow":function(){e.dialog(h.DIALOG_EMBED_WORKFLOW)},"Embed Visualization":function(){e.dialog(h.DIALOG_EMBED_VISUALIZATION)}})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var s=n(3),l=i(s);n(149),n(226),n(747),n(225);var c=n(24),d=i(c),u=window.WYMeditor,h={ITEM_HISTORY:"item_history",ITEM_DATASET:"item_dataset",ITEM_WORKFLOW:"item_workflow",ITEM_PAGE:"item_page",ITEM_VISUALIZATION:"item_visualization",DIALOG_HISTORY_LINK:"link_history",DIALOG_DATASET_LINK:"link_dataset",DIALOG_WORKFLOW_LINK:"link_workflow",DIALOG_PAGE_LINK:"link_page",DIALOG_VISUALIZATION_LINK:"link_visualization",DIALOG_EMBED_HISTORY:"embed_history",DIALOG_EMBED_DATASET:"embed_dataset",DIALOG_EMBED_WORKFLOW:"embed_workflow",DIALOG_EMBED_PAGE:"embed_page",DIALOG_EMBED_VISUALIZATION:"embed_visualization"};u.editor.prototype.dialog=function(e,n,i){function o(){t("#set_link_id").click(function(){t("#link_attribute_label").text("ID/Name");var e=t(".wym_href");e.addClass("wym_id").removeClass("wym_href"),c&&e.val(t(c).attr("id")),t(this).remove()})}var s=this,l=s.uniqueStamp(),c=s.selected();if(e==u.DIALOG_LINK){c&&(t(s._options.hrefSelector).val(t(c).attr(u.HREF)),t(s._options.srcSelector).val(t(c).attr(u.SRC)),t(s._options.titleSelector).val(t(c).attr(u.TITLE)),t(s._options.altSelector).val(t(c).attr(u.ALT)));var f,p;c&&(f=t(c).attr("href"),void 0==f&&(f=""),void 0==(p=t(c).attr("title"))&&(p="")),show_modal("Create Link","

    ",{"Make link":function(){var e=t(s._options.hrefSelector).val()||"",n=t(".wym_id").val()||"",i=t(s._options.titleSelector).val()||"";if(e||n){s._exec(u.CREATE_LINK,l);var r=t("a[href="+l+"]",s._doc.body);r.attr(u.HREF,e).attr(u.TITLE,i).attr("id",n),0===r.text().indexOf("wym-")&&r.text(i)}hide_modal()},Cancel:function(){hide_modal()}},{},o)}if(e==u.DIALOG_IMAGE)return s._selected_image&&(t(s._options.dialogImageSelector+" "+s._options.srcSelector).val(t(s._selected_image).attr(u.SRC)),t(s._options.dialogImageSelector+" "+s._options.titleSelector).val(t(s._selected_image).attr(u.TITLE)),t(s._options.dialogImageSelector+" "+s._options.altSelector).val(t(s._selected_image).attr(u.ALT))),void show_modal("Image","



    ",{Insert:function(){var e=t(s._options.srcSelector).val();e.length>0&&(s._exec(u.INSERT_IMAGE,l),t("img[src$="+l+"]",s._doc.body).attr(u.SRC,e).attr(u.TITLE,t(s._options.titleSelector).val()).attr(u.ALT,t(s._options.altSelector).val())),hide_modal()},Cancel:function(){hide_modal()}});if(e==u.DIALOG_TABLE&&show_modal("Table","


    ",{Insert:function(){var e=t(s._options.rowsSelector).val(),n=t(s._options.colsSelector).val();if(e>0&&n>0){var i=s._doc.createElement(u.TABLE),r=null,a=t(s._options.captionSelector).val();i.createCaption().innerHTML=a;for(var o=0;o").append(g.$el).append(t("
    ").append('').append("Make the selected "+_.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Insert:function(){var e=!1;null!=t("#make-importable:checked").val()&&(e=!0);new Array;g.$("input[name=id]:checked").each(function(){var n=t(this).val();e&&a(_.controller,n,_.singular);var i=get_name_and_link_url+n,r=i.replace("ITEM_CONTROLLER",_.controller);t.getJSON(r,function(e){s._exec(u.CREATE_LINK,l);var i=t("a[href="+l+"]",s._doc.body).text();""==i||i==l?s.insert(""+_.singular+" '"+e.name+"'"):t("a[href="+l+"]",s._doc.body).attr(u.HREF,e.link).attr(u.TITLE,_.singular+n)})}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})}if(e==h.DIALOG_EMBED_HISTORY||e==h.DIALOG_EMBED_DATASET||e==h.DIALOG_EMBED_WORKFLOW||e==h.DIALOG_EMBED_PAGE||e==h.DIALOG_EMBED_VISUALIZATION){var _;switch(e){case h.DIALOG_EMBED_HISTORY:_=r(h.ITEM_HISTORY);break;case h.DIALOG_EMBED_DATASET:_=r(h.ITEM_DATASET);break;case h.DIALOG_EMBED_WORKFLOW:_=r(h.ITEM_WORKFLOW);break;case h.DIALOG_EMBED_PAGE:_=r(h.ITEM_PAGE);break;case h.DIALOG_EMBED_VISUALIZATION:_=r(h.ITEM_VISUALIZATION)}var g=new d.default({url_base:_.list_ajax_url,embedded:!0});Galaxy.modal.show({title:"Insert Link to "+_.singular,body:t("
    ").append(g.$el).append(t("
    ").append('').append("Make the selected "+_.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Embed:function(){var e=!1;null!=t("#make-importable:checked").val()&&(e=!0),g.$("input[name=id]:checked").each(function(){var n=t(this).val(),i=t("label[for='"+n+"']:first").text();e&&a(_.controller,n,_.singular);var r=_.iclass+"-"+n,o=["
    ","

    ","Embedded Galaxy ",_.singular," '",i,"'","

    ","

    ","[Do not edit this block; Galaxy will fill it in with the annotated ",_.singular.toLowerCase()," when it is displayed.]","

    ","
    "].join("");s.insert(o)}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})}}}).call(e,n(0))},function(module,exports,__webpack_require__){(function(jQuery,$){if(!WYMeditor)var WYMeditor={};!function(){if(window.console&&console.firebug)WYMeditor.console=window.console;else{var t=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];WYMeditor.console={};for(var e=0;e
    "+WYMeditor.TOOLS+"
    "+WYMeditor.CONTAINERS+WYMeditor.CLASSES+"
    "+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"
    "+WYMeditor.LOGO+"
    ",logoHtml:"WYMeditor",iframeHtml:"
    ",editorStyles:[],toolsHtml:"

    {Tools}

      "+WYMeditor.TOOLS_ITEMS+"
    ",toolsItemHtml:"
  • "+WYMeditor.TOOL_TITLE+"
  • ",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},{name:"Paste",title:"Paste_From_Word",css:"wym_tools_paste"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"},{name:"Preview",title:"Preview",css:"wym_tools_preview"}],containersHtml:"

    {Containers}

      "+WYMeditor.CONTAINERS_ITEMS+"
    ",containersItemHtml:"
  • "+WYMeditor.CONTAINER_TITLE+"
  • ",containersItems:[{name:"P",title:"Paragraph",css:"wym_containers_p"},{name:"H1",title:"Heading_1",css:"wym_containers_h1"},{name:"H2",title:"Heading_2",css:"wym_containers_h2"},{name:"H3",title:"Heading_3",css:"wym_containers_h3"},{name:"H4",title:"Heading_4",css:"wym_containers_h4"},{name:"H5",title:"Heading_5",css:"wym_containers_h5"},{name:"H6",title:"Heading_6",css:"wym_containers_h6"},{name:"PRE",title:"Preformatted",css:"wym_containers_pre"},{name:"BLOCKQUOTE",title:"Blockquote",css:"wym_containers_blockquote"},{name:"TH",title:"Table_Header",css:"wym_containers_th"}],classesHtml:"

    {Classes}

      "+WYMeditor.CLASSES_ITEMS+"
    ",classesItemHtml:"
  • "+WYMeditor.CLASS_TITLE+"
  • ",classesItems:[],statusHtml:"

    {Status}

    ",htmlHtml:"

    {Source_Code}

    ",boxSelector:".wym_box",toolsSelector:".wym_tools",toolsListSelector:" ul",containersSelector:".wym_containers",classesSelector:".wym_classes",htmlSelector:".wym_html",iframeSelector:".wym_iframe iframe",iframeBodySelector:".wym_iframe",statusSelector:".wym_status",toolSelector:".wym_tools a",containerSelector:".wym_containers a",classSelector:".wym_classes a",htmlValSelector:".wym_html_val",hrefSelector:".wym_href",srcSelector:".wym_src",titleSelector:".wym_title",altSelector:".wym_alt",textSelector:".wym_text",rowsSelector:".wym_rows",colsSelector:".wym_cols",captionSelector:".wym_caption",summarySelector:".wym_summary",submitSelector:".wym_submit",cancelSelector:".wym_cancel",previewSelector:"",dialogTypeSelector:".wym_dialog_type",dialogLinkSelector:".wym_dialog_link",dialogImageSelector:".wym_dialog_image",dialogTableSelector:".wym_dialog_table",dialogPasteSelector:".wym_dialog_paste",dialogPreviewSelector:".wym_dialog_preview",updateSelector:".wymupdate",updateEvent:"click",dialogFeatures:"menubar=no,titlebar=no,toolbar=no,resizable=no,width=560,height=300,top=0,left=0",dialogFeaturesPreview:"menubar=no,titlebar=no,toolbar=no,resizable=no,scrollbars=yes,width=560,height=300,top=0,left=0",dialogHtml:""+WYMeditor.DIALOG_TITLE+"