From e3b63e16d08fe08556bc690eaf5eec3e00b8aaae Mon Sep 17 00:00:00 2001 From: vjalili Date: Wed, 11 Apr 2018 12:09:13 -0700 Subject: [PATCH 001/352] Add migration script for cloudauthz table. --- .../versions/0142_add_cloudauthz_tables.py | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 lib/galaxy/model/migrate/versions/0142_add_cloudauthz_tables.py diff --git a/lib/galaxy/model/migrate/versions/0142_add_cloudauthz_tables.py b/lib/galaxy/model/migrate/versions/0142_add_cloudauthz_tables.py new file mode 100644 index 00000000000..904850f3af0 --- /dev/null +++ b/lib/galaxy/model/migrate/versions/0142_add_cloudauthz_tables.py @@ -0,0 +1,44 @@ +""" +Migration script to add a new tables for CloudAuthz (tokens required to access cloud-based resources). +""" +from __future__ import print_function + +import logging + +from sqlalchemy import Column, DateTime, ForeignKey, Integer, MetaData, String, Table + +from galaxy.model.custom_types import JSONType + +log = logging.getLogger(__name__) +metadata = MetaData() + +cloudauthz = Table( + "cloudauthz", metadata, + Column('id', Integer, primary_key=True), + Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True), + Column('provider', String(255)), + Column('config', JSONType), + Column('tokens', JSONType), + Column('last_update', DateTime), + Column('last_activity', DateTime)) + + +def upgrade(migrate_engine): + print(__doc__) + metadata.bind = migrate_engine + metadata.reflect() + + try: + cloudauthz.create() + except Exception as e: + log.exception("Failed to create cloudauthz table: {}".format(str(e))) + + +def downgrade(migrate_engine): + metadata.bind = migrate_engine + metadata.reflect() + + try: + cloudauthz.drop() + except Exception as e: + log.exception("Failed to drop cloudauthz table: {}".format(str(e))) From c25e69253f105b9f20ed1b114e5bfdeecad60310 Mon Sep 17 00:00:00 2001 From: vjalili Date: Wed, 11 Apr 2018 15:15:58 -0700 Subject: [PATCH 002/352] Add CloudAuthz class to model. --- lib/galaxy/model/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index daae3897dc4..a85a586cc3e 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -4687,6 +4687,16 @@ class UserAuthnzToken(UserMixin): return instance +class CloudAuthz(object): + def __init__(self, user, provider, config): + self.user = user + self.provider = provider + self.config = config + self.tokens = None + self.last_update = datetime.now() + self.last_activity = datetime.now() + + class Page(Dictifiable): dict_element_visible_keys = ['id', 'title', 'latest_revision_id', 'slug', 'published', 'importable', 'deleted'] From dd9e8a5e6258ab14c7481691c3b5e6ef54c00836 Mon Sep 17 00:00:00 2001 From: vjalili Date: Wed, 11 Apr 2018 15:16:42 -0700 Subject: [PATCH 003/352] Add CloudAuthz to mapping. --- lib/galaxy/model/mapping.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/galaxy/model/mapping.py b/lib/galaxy/model/mapping.py index a46a0af3d6a..6f82ab225af 100644 --- a/lib/galaxy/model/mapping.py +++ b/lib/galaxy/model/mapping.py @@ -133,6 +133,16 @@ model.UserAuthnzToken.table = Table( Column('lifetime', Integer), Column('assoc_type', VARCHAR(64))) +model.CloudAuthz.table = Table( + "cloudauthz", metadata, + Column('id', Integer, primary_key=True), + Column('user_id', Integer, ForeignKey("galaxy_user.id"), index=True), + Column('provider', String(255)), + Column('config', JSONType), + Column('tokens', JSONType), + Column('last_update', DateTime), + Column('last_activity', DateTime)) + model.PasswordResetToken.table = Table( "password_reset_token", metadata, Column("token", String(32), primary_key=True, unique=True, index=True), @@ -1477,6 +1487,12 @@ mapper(model.UserAuthnzToken, model.UserAuthnzToken.table, properties=dict( backref='social_auth') )) +mapper(model.CloudAuthz, model.CloudAuthz.table, properties=dict( + user=relation(model.User, + primaryjoin=(model.CloudAuthz.table.c.user_id == model.User.table.c.id), + backref='cloudauthz') +)) + mapper(model.ValidationError, model.ValidationError.table) simple_mapping(model.HistoryDatasetAssociation, From 14288a2b150d49e46577c2e8238e93d927548202 Mon Sep 17 00:00:00 2001 From: vjalili Date: Mon, 16 Apr 2018 13:55:51 -0700 Subject: [PATCH 004/352] Add authn_id and user_id to cloudauthz. --- lib/galaxy/model/__init__.py | 5 +++-- lib/galaxy/model/mapping.py | 6 +++++- .../model/migrate/versions/0142_add_cloudauthz_tables.py | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index a85a586cc3e..fb6e176d234 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -4688,10 +4688,11 @@ class UserAuthnzToken(UserMixin): class CloudAuthz(object): - def __init__(self, user, provider, config): - self.user = user + def __init__(self, user_id, provider, config, authn_id): + self.user_id = user_id self.provider = provider self.config = config + self.authn_id = authn_id self.tokens = None self.last_update = datetime.now() self.last_activity = datetime.now() diff --git a/lib/galaxy/model/mapping.py b/lib/galaxy/model/mapping.py index 6f82ab225af..8550cc30022 100644 --- a/lib/galaxy/model/mapping.py +++ b/lib/galaxy/model/mapping.py @@ -139,6 +139,7 @@ model.CloudAuthz.table = Table( Column('user_id', Integer, ForeignKey("galaxy_user.id"), index=True), Column('provider', String(255)), Column('config', JSONType), + Column('authn_id', Integer, ForeignKey("oidc_user_authnz_tokens.id"), index=True), Column('tokens', JSONType), Column('last_update', DateTime), Column('last_activity', DateTime)) @@ -1490,7 +1491,10 @@ mapper(model.UserAuthnzToken, model.UserAuthnzToken.table, properties=dict( mapper(model.CloudAuthz, model.CloudAuthz.table, properties=dict( user=relation(model.User, primaryjoin=(model.CloudAuthz.table.c.user_id == model.User.table.c.id), - backref='cloudauthz') + backref='cloudauthz'), + authn=relation(model.UserAuthnzToken, + primaryjoin=(model.CloudAuthz.table.c.authn_id == model.UserAuthnzToken.table.c.id), + backref='cloudauthz') )) mapper(model.ValidationError, model.ValidationError.table) diff --git a/lib/galaxy/model/migrate/versions/0142_add_cloudauthz_tables.py b/lib/galaxy/model/migrate/versions/0142_add_cloudauthz_tables.py index 904850f3af0..7f47e083cb7 100644 --- a/lib/galaxy/model/migrate/versions/0142_add_cloudauthz_tables.py +++ b/lib/galaxy/model/migrate/versions/0142_add_cloudauthz_tables.py @@ -18,6 +18,7 @@ cloudauthz = Table( Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True), Column('provider', String(255)), Column('config', JSONType), + Column('authn_id', Integer, ForeignKey("oidc_user_authnz_tokens.id"), index=True), Column('tokens', JSONType), Column('last_update', DateTime), Column('last_activity', DateTime)) From 7f5a59d1347af33285b7e6df5955cedf9d456221 Mon Sep 17 00:00:00 2001 From: vjalili Date: Mon, 16 Apr 2018 14:00:07 -0700 Subject: [PATCH 005/352] Add cloudauthz api and manger, and define a route for API calls. --- lib/galaxy/managers/cloudauthzs.py | 20 ++++++ lib/galaxy/webapps/galaxy/api/cloudauthz.py | 80 +++++++++++++++++++++ lib/galaxy/webapps/galaxy/buildapp.py | 3 + 3 files changed, 103 insertions(+) create mode 100644 lib/galaxy/managers/cloudauthzs.py create mode 100644 lib/galaxy/webapps/galaxy/api/cloudauthz.py diff --git a/lib/galaxy/managers/cloudauthzs.py b/lib/galaxy/managers/cloudauthzs.py new file mode 100644 index 00000000000..8be08f56a0c --- /dev/null +++ b/lib/galaxy/managers/cloudauthzs.py @@ -0,0 +1,20 @@ +""" +Manager and serializer for cloud authorizations (cloudauthzs). +""" + +import logging + +from galaxy import model +from galaxy.managers import sharable +from galaxy.managers import deletable + +og = logging.getLogger(__name__) + + +class CloudAuthzManager(sharable.SharableModelManager): + + model_class = model.CloudAuthz + foreign_key_name = 'cloudauthz' + + def __init__(self, app, *args, **kwargs): + super(CloudAuthzManager, self).__init__(app, *args, **kwargs) diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py new file mode 100644 index 00000000000..002c3a0c866 --- /dev/null +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -0,0 +1,80 @@ +""" +API operations on defining cloud authorizations. +""" + +import logging + +from galaxy import web +from galaxy.managers import cloudauthzs +from galaxy.web.base.controller import BaseAPIController + +log = logging.getLogger(__name__) + + +class CloudAuthzController(BaseAPIController): + """ + RESTfull controller for defining cloud authorizations. + """ + + def __init__(self, app): + super(CloudAuthzController, self).__init__(app) + self.cloudauthzs_manager = cloudauthzs.CloudAuthzManager(app) + + @web.expose_api + def index(self, trans, **kwargs): + """ + + :param trans: + :param kwargs: + :return: + """ + pass + + @web.expose_api + def create(self, trans, payload, **kwargs): + """ + + :param trans: + :param payload: + :param kwargs: + :return: + """ + if not isinstance(payload, dict): + trans.response.status = 400 + return {'status': '400', + 'message': 'Invalid payload data type. The payload is expected to be a dictionary, ' + 'but received data of type `{}`.'.format(str(type(payload)))} + + missing_arguments = [] + provider = payload.get('provider', None) + if provider is None: + missing_arguments.append('provider') + + config = payload.get('config', None) + if config is None: + missing_arguments.append('config') + + authn_id = payload.get('authn_id', None) + if authn_id is None: + missing_arguments.append('authn_id') + + if len(missing_arguments) > 0: + trans.response.status = 400 + return {'status': '400', + 'message': 'The following required arguments are missing in the payload: {}'.format(missing_arguments)} + + try: + new_cloudauthz = self.cloudauthzs_manager.create( + user_id=trans.user.id, + provider=provider, + config=config, + authn_id=authn_id + ) + + log.debug('Created a new cloudauthz record for the user id `{}` '.format(str(trans.user.id))) + trans.response.status = '200' + return None + + except Exception as e: + log.exception('An unexpected error has occurred while responding to the create request of the cloudauthz API. ' + str(e)) + trans.response.status = '500 Internal Server Error' diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index a14865185b7..7e24afcd56d 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -268,6 +268,9 @@ def populate_api_routes(webapp, app): webapp.mapper.resource('group', 'groups', path_prefix='/api') webapp.mapper.resource_with_deleted('quota', 'quotas', path_prefix='/api') + webapp.mapper.connect('/api/cloud/authz/create', action='create', controller='cloudauthz') + webapp.mapper.resource('cloudauthz', 'cloudauthz', path_prefix='/api') + webapp.mapper.connect('get_custom_builds_metadata', '/api/histories/{id}/custom_builds_metadata', controller='histories', From c6af14ba28e1f36fef4008b57595e90e1282e5cd Mon Sep 17 00:00:00 2001 From: vjalili Date: Mon, 16 Apr 2018 14:46:25 -0700 Subject: [PATCH 006/352] Add CloudAuthz summary view serializer. --- lib/galaxy/managers/cloudauthzs.py | 43 +++++++++++++++++++++ lib/galaxy/webapps/galaxy/api/cloudauthz.py | 4 +- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/managers/cloudauthzs.py b/lib/galaxy/managers/cloudauthzs.py index 8be08f56a0c..70556e98043 100644 --- a/lib/galaxy/managers/cloudauthzs.py +++ b/lib/galaxy/managers/cloudauthzs.py @@ -5,6 +5,7 @@ Manager and serializer for cloud authorizations (cloudauthzs). import logging from galaxy import model +from galaxy.managers import base from galaxy.managers import sharable from galaxy.managers import deletable @@ -18,3 +19,45 @@ class CloudAuthzManager(sharable.SharableModelManager): def __init__(self, app, *args, **kwargs): super(CloudAuthzManager, self).__init__(app, *args, **kwargs) + + +class CloudAuthzsSerializer(base.ModelSerializer, deletable.PurgableSerializerMixin): # sharable.SharableModelSerializer, deletable.PurgableSerializerMixin): + """ + Interface/service object for serializing cloud authorizations (cloudauthzs) into dictionaries. + """ + model_manager_class = CloudAuthzManager + + def __init__(self, app, **kwargs): + super(CloudAuthzsSerializer, self).__init__(app, **kwargs) + self.cloudauthzs_manager = self.manager + + self.default_view = 'summary' + self.add_view('summary', [ + 'id', + 'model_class', + 'user_id', + 'provider', + 'config', + 'authn_id', + 'last_update', + 'last_activity' + ]) + + def add_serializers(self): + super(CloudAuthzsSerializer, self).add_serializers() + deletable.PurgableSerializerMixin.add_serializers(self) + + # Arguments of the following lambda functions: + # i : an instance of galaxy.model.CloudAuthz. + # k : serialized dictionary key (e.g., 'model_class', 'provider'). + # **c: a dictionary containing 'trans' and 'user' objects. + self.serializers.update({ + 'id' : lambda i, k, **c: self.app.security.encode_id(i.id), + 'model_class' : lambda *a, **c: 'CloudAuthz', + 'user_id' : lambda i, k, **c: self.app.security.encode_id(i.user_id), + 'provider' : lambda i, k, **c: str(i.provider), + 'config' : lambda i, k, **c: str(i.config), + 'authn_id' : lambda i, k, **c: self.app.security.encode_id(i.authn_id), + 'last_update' : lambda i, k, **c: str(i.last_update), + 'last_activity': lambda i, k, **c: str(i.last_activity) + }) diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py index 002c3a0c866..4f72ecd0ad5 100644 --- a/lib/galaxy/webapps/galaxy/api/cloudauthz.py +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -70,10 +70,10 @@ class CloudAuthzController(BaseAPIController): config=config, authn_id=authn_id ) - + view = self.cloudauthzs_serializer.serialize_to_view(new_cloudauthz, trans=trans, **self._parse_serialization_params(kwargs, 'summary')) log.debug('Created a new cloudauthz record for the user id `{}` '.format(str(trans.user.id))) trans.response.status = '200' - return None + return view except Exception as e: log.exception('An unexpected error has occurred while responding to the create request of the cloudauthz API. ' + str(e)) From ee255be84748748bfd01e6862fed0c2970f55ac2 Mon Sep 17 00:00:00 2001 From: vjalili Date: Mon, 16 Apr 2018 14:47:03 -0700 Subject: [PATCH 007/352] Fix a bug in CloudAuthz summary view serializer. --- lib/galaxy/webapps/galaxy/api/cloudauthz.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py index 4f72ecd0ad5..2af84e1dbdc 100644 --- a/lib/galaxy/webapps/galaxy/api/cloudauthz.py +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -19,6 +19,7 @@ class CloudAuthzController(BaseAPIController): def __init__(self, app): super(CloudAuthzController, self).__init__(app) self.cloudauthzs_manager = cloudauthzs.CloudAuthzManager(app) + self.cloudauthzs_serializer = cloudauthzs.CloudAuthzsSerializer(app) @web.expose_api def index(self, trans, **kwargs): From 5bf003011a5efc8eb9d02d61170e23bbd1481c81 Mon Sep 17 00:00:00 2001 From: vjalili Date: Mon, 16 Apr 2018 15:27:12 -0700 Subject: [PATCH 008/352] Update CloudAuthz index; return all the cloudauthz records for a user. --- lib/galaxy/webapps/galaxy/api/cloudauthz.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py index 2af84e1dbdc..93751de4b1b 100644 --- a/lib/galaxy/webapps/galaxy/api/cloudauthz.py +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -29,7 +29,11 @@ class CloudAuthzController(BaseAPIController): :param kwargs: :return: """ - pass + rtv = [] + for cloudauthz in trans.user.cloudauthz: + rtv.append(self.cloudauthzs_serializer.serialize_to_view( + cloudauthz, user=trans.user, trans=trans, **self._parse_serialization_params(kwargs, 'summary'))) + return rtv @web.expose_api def create(self, trans, payload, **kwargs): From 6f043824978bccdc208929c84ac7ca83f00ca9f5 Mon Sep 17 00:00:00 2001 From: vjalili Date: Mon, 16 Apr 2018 15:34:12 -0700 Subject: [PATCH 009/352] Change router for cloudauthz index. --- lib/galaxy/webapps/galaxy/buildapp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index 7e24afcd56d..74eff9e6327 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -268,8 +268,8 @@ def populate_api_routes(webapp, app): webapp.mapper.resource('group', 'groups', path_prefix='/api') webapp.mapper.resource_with_deleted('quota', 'quotas', path_prefix='/api') + webapp.mapper.connect('/api/cloud/authz/', action='index', controller='cloudauthz') webapp.mapper.connect('/api/cloud/authz/create', action='create', controller='cloudauthz') - webapp.mapper.resource('cloudauthz', 'cloudauthz', path_prefix='/api') webapp.mapper.connect('get_custom_builds_metadata', '/api/histories/{id}/custom_builds_metadata', From 8a980b1f7f7e2aa3b16ce66e1852be14e2d784c1 Mon Sep 17 00:00:00 2001 From: vjalili Date: Mon, 16 Apr 2018 16:06:40 -0700 Subject: [PATCH 010/352] Refactoring *thzs -> *thz; remove (s). --- lib/galaxy/webapps/galaxy/api/cloudauthz.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py index 93751de4b1b..24c4651ed51 100644 --- a/lib/galaxy/webapps/galaxy/api/cloudauthz.py +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -18,8 +18,8 @@ class CloudAuthzController(BaseAPIController): def __init__(self, app): super(CloudAuthzController, self).__init__(app) - self.cloudauthzs_manager = cloudauthzs.CloudAuthzManager(app) - self.cloudauthzs_serializer = cloudauthzs.CloudAuthzsSerializer(app) + self.cloudauthz_manager = cloudauthzs.CloudAuthzManager(app) + self.cloudauthz_serializer = cloudauthzs.CloudAuthzsSerializer(app) @web.expose_api def index(self, trans, **kwargs): @@ -31,7 +31,7 @@ class CloudAuthzController(BaseAPIController): """ rtv = [] for cloudauthz in trans.user.cloudauthz: - rtv.append(self.cloudauthzs_serializer.serialize_to_view( + rtv.append(self.cloudauthz_serializer.serialize_to_view( cloudauthz, user=trans.user, trans=trans, **self._parse_serialization_params(kwargs, 'summary'))) return rtv @@ -69,13 +69,13 @@ class CloudAuthzController(BaseAPIController): 'message': 'The following required arguments are missing in the payload: {}'.format(missing_arguments)} try: - new_cloudauthz = self.cloudauthzs_manager.create( + new_cloudauthz = self.cloudauthz_manager.create( user_id=trans.user.id, provider=provider, config=config, authn_id=authn_id ) - view = self.cloudauthzs_serializer.serialize_to_view(new_cloudauthz, trans=trans, **self._parse_serialization_params(kwargs, 'summary')) + view = self.cloudauthz_serializer.serialize_to_view(new_cloudauthz, trans=trans, **self._parse_serialization_params(kwargs, 'summary')) log.debug('Created a new cloudauthz record for the user id `{}` '.format(str(trans.user.id))) trans.response.status = '200' return view From 7760c98953524e6e5355f7ca678759dd7f2977d9 Mon Sep 17 00:00:00 2001 From: vjalili Date: Tue, 17 Apr 2018 09:39:50 -0700 Subject: [PATCH 011/352] Assess cloudauthz config type in API before passing it to its manager. --- lib/galaxy/webapps/galaxy/api/cloudauthz.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py index 24c4651ed51..48d0ea8be9b 100644 --- a/lib/galaxy/webapps/galaxy/api/cloudauthz.py +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -68,6 +68,10 @@ class CloudAuthzController(BaseAPIController): return {'status': '400', 'message': 'The following required arguments are missing in the payload: {}'.format(missing_arguments)} + if not isinstance(config, dict): + return {'status': '400', + 'message': 'Invalid type for the required `config` variable; expect `dict` but received `{}`.'.format(type(config))} + try: new_cloudauthz = self.cloudauthz_manager.create( user_id=trans.user.id, From 193b73f26ecb661a4fb180a64806a0c7f0c6a2ba Mon Sep 17 00:00:00 2001 From: vjalili Date: Tue, 17 Apr 2018 10:09:04 -0700 Subject: [PATCH 012/352] Fix a wrong order of imports. --- lib/galaxy/managers/cloudauthzs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/managers/cloudauthzs.py b/lib/galaxy/managers/cloudauthzs.py index 70556e98043..3767c5adbf4 100644 --- a/lib/galaxy/managers/cloudauthzs.py +++ b/lib/galaxy/managers/cloudauthzs.py @@ -6,8 +6,8 @@ import logging from galaxy import model from galaxy.managers import base -from galaxy.managers import sharable from galaxy.managers import deletable +from galaxy.managers import sharable og = logging.getLogger(__name__) From 0585f73384221cc024a62ecb1857f53670ced091 Mon Sep 17 00:00:00 2001 From: vjalili Date: Tue, 17 Apr 2018 10:56:59 -0700 Subject: [PATCH 013/352] Update cloudauthz API documentation. --- lib/galaxy/managers/cloudauthzs.py | 2 +- lib/galaxy/webapps/galaxy/api/cloudauthz.py | 42 +++++++++++++++++---- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/managers/cloudauthzs.py b/lib/galaxy/managers/cloudauthzs.py index 3767c5adbf4..86a4dd90534 100644 --- a/lib/galaxy/managers/cloudauthzs.py +++ b/lib/galaxy/managers/cloudauthzs.py @@ -21,7 +21,7 @@ class CloudAuthzManager(sharable.SharableModelManager): super(CloudAuthzManager, self).__init__(app, *args, **kwargs) -class CloudAuthzsSerializer(base.ModelSerializer, deletable.PurgableSerializerMixin): # sharable.SharableModelSerializer, deletable.PurgableSerializerMixin): +class CloudAuthzsSerializer(base.ModelSerializer, deletable.PurgableSerializerMixin): """ Interface/service object for serializing cloud authorizations (cloudauthzs) into dictionaries. """ diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py index 48d0ea8be9b..5cfab023782 100644 --- a/lib/galaxy/webapps/galaxy/api/cloudauthz.py +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -1,5 +1,11 @@ """ API operations on defining cloud authorizations. + +Through means of cloud authorization a user is able to grant a Galaxy server a secure access to his/her +cloud-based resources without sharing his/her long-lasting credentials. + +User provides a provider-specific configuration, which Galaxy users to request temporary credentials +from the provider to access the user's resources. """ import logging @@ -24,10 +30,16 @@ class CloudAuthzController(BaseAPIController): @web.expose_api def index(self, trans, **kwargs): """ + * GET /api/cloud/authz + Lists all the cloud authorizations user has defined. - :param trans: - :param kwargs: - :return: + :type trans: galaxy.web.framework.webapp.GalaxyWebTransaction + :param trans: Galaxy web transaction + + :param kwargs: empty dict + + :rtype: list of dict + :return: a list of cloud authorizations (each represented in key-value pair format) defined for the user. """ rtv = [] for cloudauthz in trans.user.cloudauthz: @@ -38,11 +50,27 @@ class CloudAuthzController(BaseAPIController): @web.expose_api def create(self, trans, payload, **kwargs): """ + * POST /api/cloud/authz/create + Request to store the payload as a cloudauthz (cloud authorization) configuration for a user. - :param trans: - :param payload: - :param kwargs: - :return: + :type trans: galaxy.web.framework.webapp.GalaxyWebTransaction + :param trans: Galaxy web transaction + + :type payload: dict + :param payload: A dictionary structure containing the following keys: + * provider: the cloud-based resource provider to which this configuration belongs to. + * config: a dictionary containing all the configuration required to request temporary credentials + from the provider. + * authn_id: the (encoded) ID of a third-party authentication of a user. To have this ID, user must + have logged-in to this Galaxy server using third-party identity (e.g., Google), or has + associated his/her Galaxy account with a third-party OIDC-based identity. See this page: + https://galaxyproject.org/admin/authentication/ + :param kwargs: empty dict + + :rtype: dict + :return: a dictionary with the following kvp: + * status: HTTP response code + * message: A message complementary to the response code. """ if not isinstance(payload, dict): trans.response.status = 400 From 384a165aab2d579ee4c2dceba61f21c42c8c2dc4 Mon Sep 17 00:00:00 2001 From: Bjoern Gruening Date: Thu, 19 Apr 2018 12:35:25 +0200 Subject: [PATCH 014/352] Allow schema to validate --- lib/galaxy/webapps/galaxy/config_schema.yml | 99 ++++++++++----------- 1 file changed, 48 insertions(+), 51 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/config_schema.yml b/lib/galaxy/webapps/galaxy/config_schema.yml index edb3fd1720f..5bc7b1de92e 100644 --- a/lib/galaxy/webapps/galaxy/config_schema.yml +++ b/lib/galaxy/webapps/galaxy/config_schema.yml @@ -45,7 +45,7 @@ mapping: cookie_path: type: str - default: null + default: '' required: false desc: | If proxy-prefix is enabled and you're running more than one Galaxy instance @@ -109,7 +109,7 @@ mapping: database_template: type: str - default: null + default: '' required: false desc: | If auto-creating a postgres database on startup - it can be based on an existing @@ -332,7 +332,7 @@ mapping: watch_tools: type: str - default: false + default: 'false' required: false desc: | Set to True to enable monitoring of tools and tool directories @@ -359,7 +359,7 @@ mapping: containers_resolvers_config_file: type: str - default: null + default: '' required: false desc: | Container resolvers configuration (beta). Setup a file describing container @@ -455,7 +455,7 @@ mapping: watch_tool_data_dir: type: str - default: false + default: 'false' required: false desc: | Set to True to enable monitoring of the tool_data and shed_tool_data_path @@ -607,7 +607,7 @@ mapping: Number of checks to execute if check_job_script_integrity is enabled. check_job_script_integrity_sleep: - type: str + type: float default: .25 required: false desc: | @@ -674,7 +674,7 @@ mapping: smtp_server: type: str - default: null + default: '' required: false desc: | Galaxy sends mail for various things: subscribing users to the mailing list @@ -685,7 +685,7 @@ mapping: smtp_username: type: str - default: null + default: '' required: false desc: | If your SMTP server requires a username and password, you can provide them @@ -694,7 +694,7 @@ mapping: smtp_password: type: str - default: null + default: '' required: false desc: | If your SMTP server requires a username and password, you can provide them @@ -719,7 +719,7 @@ mapping: error_email_to: type: str - default: null + default: '' required: false desc: | Datasets in an error state include a link to report the error. Those reports @@ -729,7 +729,7 @@ mapping: email_from: type: str - default: null + default: '' required: false desc: | Email address to use in the 'From' field when sending emails for @@ -813,7 +813,7 @@ mapping: ga_code: type: str - default: null + default: '' required: false desc: | You can enter tracking code here to track visitor's behavior @@ -865,7 +865,7 @@ mapping: message_box_content: type: str - default: null + default: '' required: false desc: | Show a message box under the masthead. @@ -879,7 +879,7 @@ mapping: brand: type: str - default: null + default: '' required: false desc: | Append "/{brand}" to the "Galaxy" text in the masthead. @@ -955,21 +955,21 @@ mapping: biostar_url: type: str - default: null + default: '' required: false desc: | Enable integration with a custom Biostar instance. biostar_key_name: type: str - default: null + default: '' required: false desc: | Enable integration with a custom Biostar instance. biostar_key: type: str - default: null + default: '' required: false desc: | Enable integration with a custom Biostar instance. @@ -1026,7 +1026,7 @@ mapping: terms_url: type: str - default: null + default: '' required: false desc: | The URL linked by the "Terms and Conditions" link in the "Help" menu, as well @@ -1140,7 +1140,7 @@ mapping: nginx_x_accel_redirect_base: type: str - default: null + default: '' required: false desc: | The same download handling can be done by nginx using X-Accel-Redirect. This @@ -1172,7 +1172,7 @@ mapping: nginx_upload_store: type: str - default: null + default: '' required: false desc: | nginx can also handle file uploads (user-to-Galaxy) via nginx_upload_module. @@ -1182,7 +1182,7 @@ mapping: nginx_upload_path: type: str - default: null + default: '' required: false desc: | This value overrides the action set on the file upload form, e.g. the web @@ -1191,7 +1191,7 @@ mapping: nginx_upload_job_files_store: type: str - default: null + default: '' required: false desc: | Galaxy can also use nginx_upload_module to receive files staged out upon job @@ -1201,7 +1201,7 @@ mapping: nginx_upload_job_files_path: type: str - default: null + default: '' required: false desc: | Galaxy can also use nginx_upload_module to receive files staged out upon job @@ -1307,7 +1307,7 @@ mapping: dynamic_proxy_golang_api_key: type: str - default: null + default: '' required: false desc: | The golang proxy uses a RESTful HTTP API for communication with Galaxy @@ -1332,15 +1332,6 @@ mapping: https://docs.python.org/2/library/logging.html#logging-levels A custom debug level of "TRACE" is available for even more verbosity. - logging: - type: map - default: galaxy.config.LOGGING_CONFIG_DEFAULT - desc: | - Controls where and how the server logs messages. If unset, the default is to log all messages to standard - output at the level defined by the `log_level` configuration option. Configuration is described in the - documentation at: - https://docs.galaxyproject.org/en/master/admin/config_logging.html - database_engine_option_echo: type: bool default: false @@ -1427,7 +1418,7 @@ mapping: allowed_origin_hostnames: type: str - default: null + default: '' required: false desc: | Return a Access-Control-Allow-Origin response header that matches the Origin @@ -1524,7 +1515,7 @@ mapping: sentry_dsn: type: str - default: null + default: '' required: false desc: | Log to Sentry @@ -1605,7 +1596,7 @@ mapping: library_import_dir: type: str - default: null + default: '' required: false desc: | Add an option to the library upload form which allows administrators to @@ -1613,7 +1604,7 @@ mapping: user_library_import_dir: type: str - default: null + default: '' required: false desc: | Add an option to the library upload form which allows authorized @@ -1632,7 +1623,7 @@ mapping: user_library_import_symlink_whitelist: type: str - default: null + default: '' required: false desc: | For security reasons, users may not import any files that actually lie @@ -1686,7 +1677,7 @@ mapping: tool_name_boost: type: float - default: 9 + default: 9.0 required: false desc: | Boosts are used to customize this instance's toolbox search. @@ -1696,7 +1687,7 @@ mapping: tool_section_boost: type: float - default: 3 + default: 3.0 required: false desc: | Boosts are used to customize this instance's toolbox search. @@ -1706,7 +1697,7 @@ mapping: tool_description_boost: type: float - default: 2 + default: 2.0 required: false desc: | Boosts are used to customize this instance's toolbox search. @@ -1716,7 +1707,7 @@ mapping: tool_label_boost: type: float - default: 1 + default: 1.0 required: false desc: | Boosts are used to customize this instance's toolbox search. @@ -1726,7 +1717,7 @@ mapping: tool_stub_boost: type: float - default: 5 + default: 5.0 required: false desc: | Boosts are used to customize this instance's toolbox search. @@ -1800,7 +1791,7 @@ mapping: remote_user_maildomain: type: str - default: null + default: '' required: false desc: | If use_remote_user is enabled and your external authentication @@ -1832,7 +1823,7 @@ mapping: remote_user_logout_href: type: str - default: null + default: '' required: false desc: | If use_remote_user is enabled, you can set this to a URL that will log your @@ -1859,7 +1850,7 @@ mapping: admin_users: type: str - default: null + default: '' required: false desc: | Administrative users - set this to a comma-separated list of valid Galaxy @@ -2065,7 +2056,7 @@ mapping: invocation to schedule indefinitely. The default corresponds to 1 month. maximum_workflow_jobs_per_scheduling_iteration: - type: str + type: int default: -1 required: false desc: | @@ -2117,7 +2108,7 @@ mapping: api_allow_run_as: type: str - default: null + default: '' required: false desc: | Optional list of email addresses of API users who can make calls on behalf of @@ -2163,7 +2154,7 @@ mapping: ftp_upload_dir: type: str - default: null + default: '' required: false desc: | Enable Galaxy's "Upload via FTP" interface. You'll need to install and @@ -2174,7 +2165,7 @@ mapping: ftp_upload_site: type: str - default: null + default: '' required: false desc: | This should be the hostname of your FTP server, which will be provided to @@ -2454,7 +2445,7 @@ mapping: environment_setup_file: type: str - default: null + default: '' required: false desc: | File to source to set up the environment when running jobs. By default, the @@ -2587,3 +2578,9 @@ mapping: desc: | persistent_communication_rooms is a comma-separated list of rooms that should be always available. + use_pbkdf2: + type: bool + default: false + required: false + desc: | + asdf From afa31d8b0978010e91724e86e2b08e9ffe698796 Mon Sep 17 00:00:00 2001 From: vjalili Date: Mon, 23 Apr 2018 15:47:06 -0700 Subject: [PATCH 015/352] Update exception handling in cloudauthz to leverage Galaxy.exceptions. --- lib/galaxy/webapps/galaxy/api/cloudauthz.py | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py index 5cfab023782..19ddaac9a23 100644 --- a/lib/galaxy/webapps/galaxy/api/cloudauthz.py +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -11,6 +11,12 @@ from the provider to access the user's resources. import logging from galaxy import web +from galaxy.exceptions import ( + ActionInputError, + InternalServerError, + RequestParameterInvalidException, + RequestParameterMissingException +) from galaxy.managers import cloudauthzs from galaxy.web.base.controller import BaseAPIController @@ -73,10 +79,8 @@ class CloudAuthzController(BaseAPIController): * message: A message complementary to the response code. """ if not isinstance(payload, dict): - trans.response.status = 400 - return {'status': '400', - 'message': 'Invalid payload data type. The payload is expected to be a dictionary, ' - 'but received data of type `{}`.'.format(str(type(payload)))} + raise ActionInputError('Invalid payload data type. The payload is expected to be a dictionary, but ' + 'received data of type `{}`.'.format(str(type(payload)))) missing_arguments = [] provider = payload.get('provider', None) @@ -92,13 +96,12 @@ class CloudAuthzController(BaseAPIController): missing_arguments.append('authn_id') if len(missing_arguments) > 0: - trans.response.status = 400 - return {'status': '400', - 'message': 'The following required arguments are missing in the payload: {}'.format(missing_arguments)} + raise RequestParameterMissingException('The following required arguments are missing in the payload: ' + '{}'.format(missing_arguments)) if not isinstance(config, dict): - return {'status': '400', - 'message': 'Invalid type for the required `config` variable; expect `dict` but received `{}`.'.format(type(config))} + raise RequestParameterInvalidException('Invalid type for the required `config` variable; expect `dict` ' + 'but received `{}`.'.format(type(config))) try: new_cloudauthz = self.cloudauthz_manager.create( @@ -113,5 +116,6 @@ class CloudAuthzController(BaseAPIController): return view except Exception as e: - log.exception('An unexpected error has occurred while responding to the create request of the cloudauthz API. ' + str(e)) - trans.response.status = '500 Internal Server Error' + msg = 'An unexpected error has occurred while responding to the create request of the cloudauthz API.' + str(e) + log.exception(msg) + raise InternalServerError(msg) From bff2f9f9f72988ffec9b9f92b935f48e39b79423 Mon Sep 17 00:00:00 2001 From: vjalili Date: Fri, 27 Apr 2018 10:30:32 -0700 Subject: [PATCH 016/352] Decode and assert `authn_id` in cloudauthz API. --- lib/galaxy/webapps/galaxy/api/cloudauthz.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py index 19ddaac9a23..2c6d5a37c26 100644 --- a/lib/galaxy/webapps/galaxy/api/cloudauthz.py +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -14,6 +14,7 @@ from galaxy import web from galaxy.exceptions import ( ActionInputError, InternalServerError, + MalformedId, RequestParameterInvalidException, RequestParameterMissingException ) @@ -102,6 +103,10 @@ class CloudAuthzController(BaseAPIController): if not isinstance(config, dict): raise RequestParameterInvalidException('Invalid type for the required `config` variable; expect `dict` ' 'but received `{}`.'.format(type(config))) + try: + authn_id = self.decode_id(authn_id) + except Exception: + raise MalformedId('Invalid `authn_id`!') try: new_cloudauthz = self.cloudauthz_manager.create( From 4a944cebe9bf94579cd06eb3a4f5d4a46004f2ab Mon Sep 17 00:00:00 2001 From: vjalili Date: Fri, 27 Apr 2018 18:47:59 -0700 Subject: [PATCH 017/352] Check if an `authn_id` exist & if user it belongs to the logged-in user. --- lib/galaxy/managers/cloudauthzs.py | 10 ++++++++++ lib/galaxy/webapps/galaxy/api/cloudauthz.py | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/lib/galaxy/managers/cloudauthzs.py b/lib/galaxy/managers/cloudauthzs.py index 86a4dd90534..fee86a4af47 100644 --- a/lib/galaxy/managers/cloudauthzs.py +++ b/lib/galaxy/managers/cloudauthzs.py @@ -4,6 +4,7 @@ Manager and serializer for cloud authorizations (cloudauthzs). import logging +from galaxy import exceptions from galaxy import model from galaxy.managers import base from galaxy.managers import deletable @@ -20,6 +21,15 @@ class CloudAuthzManager(sharable.SharableModelManager): def __init__(self, app, *args, **kwargs): super(CloudAuthzManager, self).__init__(app, *args, **kwargs) + def can_user_assume_authn(self, trans, authn_id): + qres = trans.sa_session.query(model.UserAuthnzToken).get(authn_id) + if qres is None: + raise exceptions.ObjectNotFound + if qres.user_id != trans.user.id: + og.critical('The user with ID:`{}` requested creation of a cloudauthz record and associating it with ' + 'the authnz record ID:`{}`, which belongs to another user.'.format(trans.user.id, authn_id)) + raise exceptions.ItemAccessibilityException + class CloudAuthzsSerializer(base.ModelSerializer, deletable.PurgableSerializerMixin): """ diff --git a/lib/galaxy/webapps/galaxy/api/cloudauthz.py b/lib/galaxy/webapps/galaxy/api/cloudauthz.py index 2c6d5a37c26..d1addcaa250 100644 --- a/lib/galaxy/webapps/galaxy/api/cloudauthz.py +++ b/lib/galaxy/webapps/galaxy/api/cloudauthz.py @@ -14,7 +14,9 @@ from galaxy import web from galaxy.exceptions import ( ActionInputError, InternalServerError, + ItemAccessibilityException, MalformedId, + ObjectNotFound, RequestParameterInvalidException, RequestParameterMissingException ) @@ -108,6 +110,13 @@ class CloudAuthzController(BaseAPIController): except Exception: raise MalformedId('Invalid `authn_id`!') + try: + self.cloudauthz_manager.can_user_assume_authn(trans, authn_id) + except ObjectNotFound: + raise ObjectNotFound('Authentication record with the given `authn_id` not found.') + except ItemAccessibilityException: + raise ItemAccessibilityException('The specified authentication with ID:`{}` belongs to another user.'.format(authn_id)) + try: new_cloudauthz = self.cloudauthz_manager.create( user_id=trans.user.id, From 0b95898ccf68b8497dff9f322b44abc5668dfce6 Mon Sep 17 00:00:00 2001 From: E Rasche Date: Tue, 1 May 2018 17:24:43 +0200 Subject: [PATCH 018/352] Document pbkdf2 --- lib/galaxy/webapps/galaxy/config_schema.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/config_schema.yml b/lib/galaxy/webapps/galaxy/config_schema.yml index 5bc7b1de92e..c51609e60e1 100644 --- a/lib/galaxy/webapps/galaxy/config_schema.yml +++ b/lib/galaxy/webapps/galaxy/config_schema.yml @@ -2580,7 +2580,9 @@ mapping: use_pbkdf2: type: bool - default: false + default: true required: false desc: | - asdf + Allow disabling pbkdf2 hashing of passwords for legacy situations. + This should normally be left enabled unless there is a specific + reason to disable it. From 827e082bc521cfb287fc5572cdf386c6dc415d7e Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sat, 30 Jun 2018 12:15:27 -0400 Subject: [PATCH 019/352] Initial work on updating styles --- client/galaxy/style/scss/base.scss | 53 +- .../scss/galaxy_bootstrap/variables.scss | 19 +- .../galaxy/style/scss/galaxy_variables.scss | 23 +- client/galaxy/style/scss/theme/blue.scss | 4 +- .../style/source_material/error_icon.svg | 1 + .../style/source_material/galaxy_icons.svg | 304 ++------ .../style/source_material/info_icon.svg | 1 + .../galaxy/style/source_material/ok_icon.svg | 1 + .../style/source_material/wait_icon.svg | 1 + .../style/source_material/warn_icon.svg | 1 + static/style/blue/base.css | 686 +++++++++--------- static/style/blue/library.css | 3 - 12 files changed, 472 insertions(+), 625 deletions(-) create mode 100644 client/galaxy/style/source_material/error_icon.svg create mode 100644 client/galaxy/style/source_material/info_icon.svg create mode 100644 client/galaxy/style/source_material/ok_icon.svg create mode 100644 client/galaxy/style/source_material/wait_icon.svg create mode 100644 client/galaxy/style/source_material/warn_icon.svg diff --git a/client/galaxy/style/scss/base.scss b/client/galaxy/style/scss/base.scss index ae4afcc4b4a..a2e94d28ad5 100644 --- a/client/galaxy/style/scss/base.scss +++ b/client/galaxy/style/scss/base.scss @@ -159,13 +159,13 @@ body { } #left { left: 0px; - width: 250px; + width: $panel-width; z-index: 200; - border-right: solid $layout-border-color 1px; + border-right: $layout-border; } #center { - left: 250 + $border-default-color_padding; - right: 250 + $border-default-color_padding; + left: $panel-width; + right: $panel-width; overflow: hidden; z-index: 1; .center-container { @@ -189,10 +189,16 @@ body { } #right { - width: 250px; + width: $panel-width; right: 0px; z-index: 200; - border-left: solid $layout-border-color 1px; + border-left: $layout-border; +} + +#left, #right, .unified-panel { + background: $panel-bg-color; + display: flex; + flex-direction: column; } #left, #right, .unified-panel { @@ -207,7 +213,7 @@ body { z-index: 1000; text-shadow: rgba(255, 255, 255, 0.8) 0 1px 0; background: $panel-header-bg-color; - border-bottom: solid $layout-border-color 1px; + border-bottom: $layout-border; margin: 0; padding: 0; padding-right: 10px; @@ -256,15 +262,18 @@ body { } } +.unified-panel-controls { + padding: 0px 10px; +} + .unified-panel-footer { @extend .unselectable; - position: absolute; - bottom: 0; + position: relative; height: $panel_footer_height; line-height: $panel_footer_height; width: 100%; z-index: 1000; // Above #dd-helper - border-top: solid $layout-border-color 1px; + border-top: $layout-border; background: $navbar-default-bg; color: #555; @@ -317,14 +326,14 @@ body { line-height: $panel_footer_height; width: $panel_footer_height - 5; background: none; - border-right: solid $layout-border-color 1px; - border-top: solid $layout-border-color 1px; + border-right: $layout-border; + border-top: $layout-border; background: $navbar-default-bg; &.right { left: inherit; right: 0; border-right: none; - border-left: solid $border-default-color 1px; + border-left: $layout_border; &.right:before { content: "\f054"; } @@ -376,11 +385,11 @@ div.unified-panel-body-background { height: $panel-message-height; line-height: $panel-message-height; padding: 0px; - padding-left: 26px; + padding-left: 2.5rem; background-color: $state-danger-bg; background-image: url(error_small.png); background-repeat: no-repeat; - background-position: 6px 50%; + background-position: .5rem 50%; } .panel-warning-message { @@ -394,8 +403,12 @@ div.unified-panel-body-background { } .panel-info-message { - background-image: url(info_small.png); + background-image: url(info_icon.svg); + background-size: 1.5rem; background-color: $state-info-bg; + svg:path { + fill: black; + } } // Masthead @@ -1619,7 +1632,8 @@ div.toolSectionDetailsInner { } div.toolSectionTitle { - font-weight: bold; + font-weight: 500; + font-size: 1rem; } div.toolPanelLabel { @@ -1633,10 +1647,9 @@ div.toolPanelLabel { div.toolTitle { padding-top: 5px; padding-bottom: 5px; - margin-left: 16px; + margin-left: 10px; margin-right: 10px; - display: list-item; - list-style: square outside; + display: block; .labels { float: right; margin-left: 2px; diff --git a/client/galaxy/style/scss/galaxy_bootstrap/variables.scss b/client/galaxy/style/scss/galaxy_bootstrap/variables.scss index cd5c66c79ca..7375249ea51 100644 --- a/client/galaxy/style/scss/galaxy_bootstrap/variables.scss +++ b/client/galaxy/style/scss/galaxy_bootstrap/variables.scss @@ -65,10 +65,10 @@ $galaxy-bs3-info: #3189a3; // Lightening and saturating gets to alert backgrounds that are *very close* // to the Boostrap 3 Galaxy styles. $brand-primary: $galaxy-bs3-primary; -$brand-success: saturate(lighten($galaxy-bs3-success, 5%), 30%); -$brand-info: saturate(lighten($galaxy-bs3-info, 10%), 30%); -$brand-warning: saturate(lighten($galaxy-bs3-warning, 10%), 30%); -$brand-danger: saturate(lighten($galaxy-bs3-danger, 10%), 30%); +$brand-success: #66CC66; // saturate(lighten($galaxy-bs3-success, 5%), 30%); +$brand-info: #2077B3; // saturate(lighten($galaxy-bs3-info, 10%), 30%); +$brand-warning: #FE7F02; // saturate(lighten($galaxy-bs3-warning, 10%), 30%); +$brand-danger: #E31A1E; // These variables don't actually determine the colors in Bootstrap 4, instead // they use a map called $theme-colors, so here we override that @@ -93,7 +93,7 @@ $theme-color-interval: 5% !default; // Alerts and states -$alert-bg-level: -13 !default; +$alert-bg-level: -12 !default; $alert-border-level: -6 !default; $alert-color-level: 8 !default; @@ -119,19 +119,18 @@ $state-success-border: theme-color-level("success", $alert-border-level); // Body text and link colors $body-bg: $white; -$text-color: $gray-dark; +$text-color: $gray-900; -$link-color: #303030; +$link-color: $black; $link-hover-color: darken($link-color, 15%); // Fonts and sizes -$font-family-sans-serif: "Lucida Grande", verdana, arial, helvetica, sans-serif; //JT "Helvetica Neue", Helvetica, Arial, sans-serif; -//$font-family-serif: Georgia, "Times New Roman", Times, serif; +$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; $font-family-monospace: Monaco, Menlo, Consolas, "Courier New", monospace; $font-family-base: $font-family-sans-serif; -$font-size-base: 0.75rem; // default 1rem +$font-size-base: 0.8rem; // default 1rem $h1-font-size: $font-size-base * 2; // default 2.5 $h2-font-size: $font-size-base * 1.75; // default 2 diff --git a/client/galaxy/style/scss/galaxy_variables.scss b/client/galaxy/style/scss/galaxy_variables.scss index 1994893762f..816ced18420 100644 --- a/client/galaxy/style/scss/galaxy_variables.scss +++ b/client/galaxy/style/scss/galaxy_variables.scss @@ -1,31 +1,36 @@ // Additional variables that are not used by bootstrap but are used // in Galaxy stylesheets -$base-bg: $white; -$base-text-color: $black; +$base-bg: $body-bg; +$base-text-color: $text-color; // Masthead -$masthead-height: 2.5rem; +$masthead-height: 3rem; // Side panels -$panel-bg-color: #dfe5f9; +$panel-bg-color: $gray-100; // #dfe5f9; $panel-text-color: $gray-900; $side-panel-bg: $panel-bg-color; -$panel-header-bg-color: $gray-lighter; +$panel-header-bg-color: $gray-100; $panel-header-text-color: #555; -$panel-message-height: 2rem; //1.875rem; +$panel-message-height: 2.5rem; //1.875rem; + +// Initial width of left and right panels +$panel-width: 16rem; $layout_top_padding: 0px; $border-default-color_padding: 0px; -$panel_header_height: 2rem; +$panel_header_height: 2.5rem; $panel_footer_height: 25px; -$layout-border-color: $gray-900; // darken($border-default-color, 15%); +$layout-border-color: $gray-900; +// $layout-border: solid $layout-border-color 1px; +$layout-border: none; // Forms @@ -47,7 +52,7 @@ $state-running-border: #aaaa66; $state-running-bg: #ffffcc; $navbar-height: 36px; // 2.062500rem; -$navbar-default-bg: $gray-lighter; // JT #f8f8f8; +$navbar-default-bg: $gray-100; // JT #f8f8f8; $navbar-default-border: darken($navbar-default-bg, $border-darken-percent); @import "theme/blue.scss"; diff --git a/client/galaxy/style/scss/theme/blue.scss b/client/galaxy/style/scss/theme/blue.scss index fa72970b2ce..db7778b32c3 100644 --- a/client/galaxy/style/scss/theme/blue.scss +++ b/client/galaxy/style/scss/theme/blue.scss @@ -1,7 +1,5 @@ // Override colors to closely resemble the style as of Fall 2013 -$layout-border-color: #999; - $form-heading-bg: #ebd9b2; $form-border: darken($form-heading-bg, 20%); @@ -11,7 +9,7 @@ $table-border-color: darken($table-heading-bg, 20%); $input-border: #aaa; a { - text-decoration: underline; + // text-decoration: underline; } // Label is used in places it probably shouldn't be (grid cells), replace with data- attributes and remove this. diff --git a/client/galaxy/style/source_material/error_icon.svg b/client/galaxy/style/source_material/error_icon.svg new file mode 100644 index 00000000000..73dc055734e --- /dev/null +++ b/client/galaxy/style/source_material/error_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/galaxy/style/source_material/galaxy_icons.svg b/client/galaxy/style/source_material/galaxy_icons.svg index 6a34999b592..9d72166e39d 100644 --- a/client/galaxy/style/source_material/galaxy_icons.svg +++ b/client/galaxy/style/source_material/galaxy_icons.svg @@ -1,20 +1,20 @@ + + inkscape:window-width="1438" + inkscape:window-height="821" + inkscape:window-x="74" + inkscape:window-y="109" + inkscape:grid-points="true" + inkscape:window-maximized="0"> image/svg+xml + - - - - - - - - - - - - - - - - - - + id="g3381"> + OkIcon - - - - - - - - - - - - - - - - - + style="fill:#04cd00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 180.92773,40.517578 A 138.9825,138.9825 0 0 0 41.945312,179.5 138.9825,138.9825 0 0 0 180.92773,318.48242 138.9825,138.9825 0 0 0 319.91016,179.5 138.9825,138.9825 0 0 0 180.92773,40.517578 Z m 50.31446,53.767578 34.20117,20.742184 -91.50977,150.90039 -71.81445,-52.83789 23.70313,-32.21875 36.58593,26.91797 68.83399,-113.503904 z" + id="path1307" + inkscape:connector-curvature="0" /> + + + + + + + + + + + + diff --git a/client/galaxy/style/source_material/info_icon.svg b/client/galaxy/style/source_material/info_icon.svg new file mode 100644 index 00000000000..4fe47696bb1 --- /dev/null +++ b/client/galaxy/style/source_material/info_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/galaxy/style/source_material/ok_icon.svg b/client/galaxy/style/source_material/ok_icon.svg new file mode 100644 index 00000000000..387dbe4b874 --- /dev/null +++ b/client/galaxy/style/source_material/ok_icon.svg @@ -0,0 +1 @@ +OkIcon \ No newline at end of file diff --git a/client/galaxy/style/source_material/wait_icon.svg b/client/galaxy/style/source_material/wait_icon.svg new file mode 100644 index 00000000000..2b6fae584da --- /dev/null +++ b/client/galaxy/style/source_material/wait_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/galaxy/style/source_material/warn_icon.svg b/client/galaxy/style/source_material/warn_icon.svg new file mode 100644 index 00000000000..b3f01b19670 --- /dev/null +++ b/client/galaxy/style/source_material/warn_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/style/blue/base.css b/static/style/blue/base.css index dc924ec33d2..d415e95b8fa 100644 --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -21,10 +21,10 @@ --gray-dark: #343a40; --primary: #25537b; --secondary: #dee2e6; - --success: #21ba21; - --info: #1cbceb; - --warning: #f69713; - --danger: #ef5f5b; + --success: #66CC66; + --info: #2077B3; + --warning: #FE7F02; + --danger: #E31A1E; --light: #f8f9fa; --dark: #343a40; --breakpoint-xs: 0; @@ -32,7 +32,7 @@ --breakpoint-md: 768px; --breakpoint-lg: 992px; --breakpoint-xl: 1200px; - --font-family-sans-serif: "Lucida Grande", verdana, arial, helvetica, sans-serif; + --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; --font-family-monospace: Monaco, Menlo, Consolas, "Courier New", monospace; } *, @@ -56,8 +56,8 @@ article, aside, figcaption, figure, footer, header, hgroup, main, nav, section { body { margin: 0; - font-family: "Lucida Grande", verdana, arial, helvetica, sans-serif; - font-size: 0.75rem; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 0.8rem; font-weight: 400; line-height: 1.5; color: #212529; @@ -138,12 +138,12 @@ sup { top: -.5em; } a { - color: #303030; + color: #000; text-decoration: none; background-color: transparent; -webkit-text-decoration-skip: objects; } a:hover { - color: #0a0a0a; + color: black; text-decoration: underline; } a:not([href]):not([tabindex]) { @@ -306,25 +306,25 @@ h1, h2, h3, .upload-view-default .upload-box .upload-helper, .upload-view-compos color: inherit; } h1, .h1 { - font-size: 1.5rem; } + font-size: 1.6rem; } h2, .h2 { - font-size: 1.3125rem; } + font-size: 1.4rem; } h3, .upload-view-default .upload-box .upload-helper, .upload-view-composite .upload-box .upload-helper, .ui-form-composite .ui-form-header, .h3 { - font-size: 1.125rem; } + font-size: 1.2rem; } h4, .h4 { - font-size: 0.9375rem; } + font-size: 1rem; } h5, .h5 { - font-size: 0.75rem; } + font-size: 0.8rem; } h6, .h6 { - font-size: 0.6375rem; } + font-size: 0.68rem; } .lead { - font-size: 0.9375rem; + font-size: 1rem; font-weight: 300; } .display-1 { @@ -382,7 +382,7 @@ mark, .blockquote { margin-bottom: 1rem; - font-size: 0.9375rem; } + font-size: 1rem; } .blockquote-footer { display: block; @@ -1101,46 +1101,46 @@ pre { .table-success, .table-success > th, .table-success > td { - background-color: #85d985; } + background-color: #abe3ab; } .table-hover .table-success:hover { - background-color: #72d372; } + background-color: #98dd98; } .table-hover .table-success:hover > td, .table-hover .table-success:hover > th { - background-color: #72d372; } + background-color: #98dd98; } .table-info, .table-info > th, .table-info > td { - background-color: #82daf4; } + background-color: #84b4d5; } .table-hover .table-info:hover { - background-color: #6bd3f2; } + background-color: #71a8cf; } .table-hover .table-info:hover > td, .table-hover .table-info:hover > th { - background-color: #6bd3f2; } + background-color: #71a8cf; } .table-warning, .table-warning > th, .table-warning > td { - background-color: #fac67d; } + background-color: #feb974; } .table-hover .table-warning:hover { - background-color: #f9bb64; } + background-color: #feac5b; } .table-hover .table-warning:hover > td, .table-hover .table-warning:hover > th { - background-color: #f9bb64; } + background-color: #feac5b; } .table-danger, .table-danger > th, .table-danger > td { - background-color: #f6a7a5; } + background-color: #f08183; } .table-hover .table-danger:hover { - background-color: #f4908e; } + background-color: #ed6a6d; } .table-hover .table-danger:hover > td, .table-hover .table-danger:hover > th { - background-color: #f4908e; } + background-color: #ed6a6d; } .table-light, .table-light > th, @@ -1252,7 +1252,7 @@ pre { display: block; width: 100%; padding: 0.375rem 0.75rem; - font-size: 0.75rem; + font-size: 0.8rem; line-height: 1.5; color: #495057; background-color: #fff; @@ -1280,7 +1280,7 @@ pre { opacity: 1; } select.form-control:not([size]):not([multiple]) { - height: calc(1.875rem + 2px); } + height: calc(1.95rem + 2px); } select.form-control:focus::-ms-value { color: #495057; @@ -1301,13 +1301,13 @@ select.form-control:focus::-ms-value { .col-form-label-lg { padding-top: calc(0.5rem + 1px); padding-bottom: calc(0.5rem + 1px); - font-size: 0.9375rem; + font-size: 1rem; line-height: 1.5; } .col-form-label-sm { padding-top: calc(0.25rem + 1px); padding-bottom: calc(0.25rem + 1px); - font-size: 0.65625rem; + font-size: 0.7rem; line-height: 1.5; } .form-control-plaintext { @@ -1369,7 +1369,7 @@ button, .input-group-sm > .input-group-append > .action-button, .input-group-sm > .input-group-append > .menubutton { padding: 0.25rem 0.5rem; - font-size: 0.65625rem; + font-size: 0.7rem; line-height: 1.5; border-radius: 0.2rem; } @@ -1382,7 +1382,7 @@ select.form-control-sm:not([size]):not([multiple]), .input-group-sm > select.for .input-group-sm > .input-group-append > select.btn:not([size]):not([multiple]), .input-group-sm > .input-group-append > select.action-button:not([size]):not([multiple]), .input-group-sm > .input-group-append > select.menubutton:not([size]):not([multiple]) { - height: calc(1.48438rem + 2px); } + height: calc(1.55rem + 2px); } .form-control-lg, .input-group-lg > .form-control, .input-group-lg > .input-group-prepend > .input-group-text, @@ -1400,7 +1400,7 @@ button, .input-group-lg > .input-group-append > .action-button, .input-group-lg > .input-group-append > .menubutton { padding: 0.5rem 1rem; - font-size: 0.9375rem; + font-size: 1rem; line-height: 1.5; border-radius: 0.3rem; } @@ -1413,7 +1413,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for .input-group-lg > .input-group-append > select.btn:not([size]):not([multiple]), .input-group-lg > .input-group-append > select.action-button:not([size]):not([multiple]), .input-group-lg > .input-group-append > select.menubutton:not([size]):not([multiple]) { - height: calc(2.40625rem + 2px); } + height: calc(2.5rem + 2px); } .form-group { margin-bottom: 1rem; } @@ -1463,7 +1463,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for width: 100%; margin-top: 0.25rem; font-size: 80%; - color: #21ba21; } + color: #66CC66; } .valid-tooltip { position: absolute; @@ -1476,18 +1476,18 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for font-size: .875rem; line-height: 1; color: #fff; - background-color: rgba(33, 186, 33, 0.8); + background-color: rgba(102, 204, 102, 0.8); border-radius: .2rem; } .was-validated .form-control:valid, .form-control.is-valid, .was-validated .custom-select:valid, .custom-select.is-valid { - border-color: #21ba21; } + border-color: #66CC66; } .was-validated .form-control:valid:focus, .form-control.is-valid:focus, .was-validated .custom-select:valid:focus, .custom-select.is-valid:focus { - border-color: #21ba21; - box-shadow: 0 0 0 0.2rem rgba(33, 186, 33, 0.25); } + border-color: #66CC66; + box-shadow: 0 0 0 0.2rem rgba(102, 204, 102, 0.25); } .was-validated .form-control:valid ~ .valid-feedback, .was-validated .form-control:valid ~ .valid-tooltip, .form-control.is-valid ~ .valid-feedback, .form-control.is-valid ~ .valid-tooltip, .was-validated @@ -1504,7 +1504,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: block; } .was-validated .form-check-input:valid ~ .form-check-label, .form-check-input.is-valid ~ .form-check-label { - color: #21ba21; } + color: #66CC66; } .was-validated .form-check-input:valid ~ .valid-feedback, .was-validated .form-check-input:valid ~ .valid-tooltip, .form-check-input.is-valid ~ .valid-feedback, @@ -1512,9 +1512,9 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: block; } .was-validated .custom-control-input:valid ~ .custom-control-label, .custom-control-input.is-valid ~ .custom-control-label { - color: #21ba21; } + color: #66CC66; } .was-validated .custom-control-input:valid ~ .custom-control-label::before, .custom-control-input.is-valid ~ .custom-control-label::before { - background-color: #74e674; } + background-color: #c6ecc6; } .was-validated .custom-control-input:valid ~ .valid-feedback, .was-validated .custom-control-input:valid ~ .valid-tooltip, .custom-control-input.is-valid ~ .valid-feedback, @@ -1522,13 +1522,13 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: block; } .was-validated .custom-control-input:valid:checked ~ .custom-control-label::before, .custom-control-input.is-valid:checked ~ .custom-control-label::before { - background-color: #33db33; } + background-color: #8cd98c; } .was-validated .custom-control-input:valid:focus ~ .custom-control-label::before, .custom-control-input.is-valid:focus ~ .custom-control-label::before { - box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(33, 186, 33, 0.25); } + box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(102, 204, 102, 0.25); } .was-validated .custom-file-input:valid ~ .custom-file-label, .custom-file-input.is-valid ~ .custom-file-label { - border-color: #21ba21; } + border-color: #66CC66; } .was-validated .custom-file-input:valid ~ .custom-file-label::before, .custom-file-input.is-valid ~ .custom-file-label::before { border-color: inherit; } @@ -1538,14 +1538,14 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: block; } .was-validated .custom-file-input:valid:focus ~ .custom-file-label, .custom-file-input.is-valid:focus ~ .custom-file-label { - box-shadow: 0 0 0 0.2rem rgba(33, 186, 33, 0.25); } + box-shadow: 0 0 0 0.2rem rgba(102, 204, 102, 0.25); } .invalid-feedback { display: none; width: 100%; margin-top: 0.25rem; font-size: 80%; - color: #ef5f5b; } + color: #E31A1E; } .invalid-tooltip { position: absolute; @@ -1558,18 +1558,18 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for font-size: .875rem; line-height: 1; color: #fff; - background-color: rgba(239, 95, 91, 0.8); + background-color: rgba(227, 26, 30, 0.8); border-radius: .2rem; } .was-validated .form-control:invalid, .form-control.is-invalid, .was-validated .custom-select:invalid, .custom-select.is-invalid { - border-color: #ef5f5b; } + border-color: #E31A1E; } .was-validated .form-control:invalid:focus, .form-control.is-invalid:focus, .was-validated .custom-select:invalid:focus, .custom-select.is-invalid:focus { - border-color: #ef5f5b; - box-shadow: 0 0 0 0.2rem rgba(239, 95, 91, 0.25); } + border-color: #E31A1E; + box-shadow: 0 0 0 0.2rem rgba(227, 26, 30, 0.25); } .was-validated .form-control:invalid ~ .invalid-feedback, .was-validated .form-control:invalid ~ .invalid-tooltip, .form-control.is-invalid ~ .invalid-feedback, .form-control.is-invalid ~ .invalid-tooltip, .was-validated @@ -1586,7 +1586,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: block; } .was-validated .form-check-input:invalid ~ .form-check-label, .form-check-input.is-invalid ~ .form-check-label { - color: #ef5f5b; } + color: #E31A1E; } .was-validated .form-check-input:invalid ~ .invalid-feedback, .was-validated .form-check-input:invalid ~ .invalid-tooltip, .form-check-input.is-invalid ~ .invalid-feedback, @@ -1594,9 +1594,9 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: block; } .was-validated .custom-control-input:invalid ~ .custom-control-label, .custom-control-input.is-invalid ~ .custom-control-label { - color: #ef5f5b; } + color: #E31A1E; } .was-validated .custom-control-input:invalid ~ .custom-control-label::before, .custom-control-input.is-invalid ~ .custom-control-label::before { - background-color: #fad0cf; } + background-color: #f28b8d; } .was-validated .custom-control-input:invalid ~ .invalid-feedback, .was-validated .custom-control-input:invalid ~ .invalid-tooltip, .custom-control-input.is-invalid ~ .invalid-feedback, @@ -1604,13 +1604,13 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: block; } .was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before, .custom-control-input.is-invalid:checked ~ .custom-control-label::before { - background-color: #f48c89; } + background-color: #ea4649; } .was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before, .custom-control-input.is-invalid:focus ~ .custom-control-label::before { - box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(239, 95, 91, 0.25); } + box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(227, 26, 30, 0.25); } .was-validated .custom-file-input:invalid ~ .custom-file-label, .custom-file-input.is-invalid ~ .custom-file-label { - border-color: #ef5f5b; } + border-color: #E31A1E; } .was-validated .custom-file-input:invalid ~ .custom-file-label::before, .custom-file-input.is-invalid ~ .custom-file-label::before { border-color: inherit; } @@ -1620,7 +1620,7 @@ select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.for display: block; } .was-validated .custom-file-input:invalid:focus ~ .custom-file-label, .custom-file-input.is-invalid:focus ~ .custom-file-label { - box-shadow: 0 0 0 0.2rem rgba(239, 95, 91, 0.25); } + box-shadow: 0 0 0 0.2rem rgba(227, 26, 30, 0.25); } .form-inline { display: flex; @@ -1676,7 +1676,7 @@ button, .action-button, .menubutton { user-select: none; border: 1px solid transparent; padding: 0.375rem 0.75rem; - font-size: 0.75rem; + font-size: 0.8rem; line-height: 1.5; border-radius: 0.25rem; transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } @@ -1781,96 +1781,96 @@ button, .action-button, .btn-default, .menubutton { box-shadow: 0 0 0 0.2rem rgba(222, 226, 230, 0.5); } .btn-success { - color: #fff; - background-color: #21ba21; - border-color: #21ba21; } + color: #212529; + background-color: #66CC66; + border-color: #66CC66; } .btn-success:hover { color: #fff; - background-color: #1b991b; - border-color: #198e19; } + background-color: #49c249; + border-color: #40bf40; } .btn-success:focus, .btn-success.focus { - box-shadow: 0 0 0 0.2rem rgba(33, 186, 33, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(102, 204, 102, 0.5); } .btn-success.disabled, .btn-success:disabled { - color: #fff; - background-color: #21ba21; - border-color: #21ba21; } + color: #212529; + background-color: #66CC66; + border-color: #66CC66; } .btn-success:not(:disabled):not(.disabled):active, .btn-success:not(:disabled):not(.disabled).active, .show > .btn-success.dropdown-toggle { color: #fff; - background-color: #198e19; - border-color: #178317; } + background-color: #40bf40; + border-color: #3db63d; } .btn-success:not(:disabled):not(.disabled):active:focus, .btn-success:not(:disabled):not(.disabled).active:focus, .show > .btn-success.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(33, 186, 33, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(102, 204, 102, 0.5); } .btn-info { color: #fff; - background-color: #1cbceb; - border-color: #1cbceb; } + background-color: #2077B3; + border-color: #2077B3; } .btn-info:hover { color: #fff; - background-color: #12a4cf; - border-color: #119ac3; } + background-color: #1a6193; + border-color: #185a88; } .btn-info:focus, .btn-info.focus { - box-shadow: 0 0 0 0.2rem rgba(28, 188, 235, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(32, 119, 179, 0.5); } .btn-info.disabled, .btn-info:disabled { color: #fff; - background-color: #1cbceb; - border-color: #1cbceb; } + background-color: #2077B3; + border-color: #2077B3; } .btn-info:not(:disabled):not(.disabled):active, .btn-info:not(:disabled):not(.disabled).active, .show > .btn-info.dropdown-toggle { color: #fff; - background-color: #119ac3; - border-color: #1091b7; } + background-color: #185a88; + border-color: #16537d; } .btn-info:not(:disabled):not(.disabled):active:focus, .btn-info:not(:disabled):not(.disabled).active:focus, .show > .btn-info.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(28, 188, 235, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(32, 119, 179, 0.5); } .btn-warning { color: #212529; - background-color: #f69713; - border-color: #f69713; } + background-color: #FE7F02; + border-color: #FE7F02; } .btn-warning:hover { color: #fff; - background-color: #da8308; - border-color: #ce7b08; } + background-color: #d96c01; + border-color: #cc6601; } .btn-warning:focus, .btn-warning.focus { - box-shadow: 0 0 0 0.2rem rgba(246, 151, 19, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(254, 127, 2, 0.5); } .btn-warning.disabled, .btn-warning:disabled { color: #212529; - background-color: #f69713; - border-color: #f69713; } + background-color: #FE7F02; + border-color: #FE7F02; } .btn-warning:not(:disabled):not(.disabled):active, .btn-warning:not(:disabled):not(.disabled).active, .show > .btn-warning.dropdown-toggle { color: #fff; - background-color: #ce7b08; - border-color: #c27407; } + background-color: #cc6601; + border-color: #bf5f01; } .btn-warning:not(:disabled):not(.disabled):active:focus, .btn-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-warning.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(246, 151, 19, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(254, 127, 2, 0.5); } .btn-danger { color: #fff; - background-color: #ef5f5b; - border-color: #ef5f5b; } + background-color: #E31A1E; + border-color: #E31A1E; } .btn-danger:hover { color: #fff; - background-color: #ec3c38; - border-color: #eb312c; } + background-color: #c11619; + border-color: #b51518; } .btn-danger:focus, .btn-danger.focus { - box-shadow: 0 0 0 0.2rem rgba(239, 95, 91, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(227, 26, 30, 0.5); } .btn-danger.disabled, .btn-danger:disabled { color: #fff; - background-color: #ef5f5b; - border-color: #ef5f5b; } + background-color: #E31A1E; + border-color: #E31A1E; } .btn-danger:not(:disabled):not(.disabled):active, .btn-danger:not(:disabled):not(.disabled).active, .show > .btn-danger.dropdown-toggle { color: #fff; - background-color: #eb312c; - border-color: #ea2621; } + background-color: #b51518; + border-color: #aa1316; } .btn-danger:not(:disabled):not(.disabled):active:focus, .btn-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-danger.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(239, 95, 91, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(227, 26, 30, 0.5); } .btn-light { color: #212529; @@ -1965,96 +1965,96 @@ button, .action-button, .btn-default, .menubutton { box-shadow: 0 0 0 0.2rem rgba(222, 226, 230, 0.5); } .btn-outline-success { - color: #21ba21; + color: #66CC66; background-color: transparent; background-image: none; - border-color: #21ba21; } + border-color: #66CC66; } .btn-outline-success:hover { - color: #fff; - background-color: #21ba21; - border-color: #21ba21; } + color: #212529; + background-color: #66CC66; + border-color: #66CC66; } .btn-outline-success:focus, .btn-outline-success.focus { - box-shadow: 0 0 0 0.2rem rgba(33, 186, 33, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(102, 204, 102, 0.5); } .btn-outline-success.disabled, .btn-outline-success:disabled { - color: #21ba21; + color: #66CC66; background-color: transparent; } .btn-outline-success:not(:disabled):not(.disabled):active, .btn-outline-success:not(:disabled):not(.disabled).active, .show > .btn-outline-success.dropdown-toggle { - color: #fff; - background-color: #21ba21; - border-color: #21ba21; } + color: #212529; + background-color: #66CC66; + border-color: #66CC66; } .btn-outline-success:not(:disabled):not(.disabled):active:focus, .btn-outline-success:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-success.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(33, 186, 33, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(102, 204, 102, 0.5); } .btn-outline-info { - color: #1cbceb; + color: #2077B3; background-color: transparent; background-image: none; - border-color: #1cbceb; } + border-color: #2077B3; } .btn-outline-info:hover { color: #fff; - background-color: #1cbceb; - border-color: #1cbceb; } + background-color: #2077B3; + border-color: #2077B3; } .btn-outline-info:focus, .btn-outline-info.focus { - box-shadow: 0 0 0 0.2rem rgba(28, 188, 235, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(32, 119, 179, 0.5); } .btn-outline-info.disabled, .btn-outline-info:disabled { - color: #1cbceb; + color: #2077B3; background-color: transparent; } .btn-outline-info:not(:disabled):not(.disabled):active, .btn-outline-info:not(:disabled):not(.disabled).active, .show > .btn-outline-info.dropdown-toggle { color: #fff; - background-color: #1cbceb; - border-color: #1cbceb; } + background-color: #2077B3; + border-color: #2077B3; } .btn-outline-info:not(:disabled):not(.disabled):active:focus, .btn-outline-info:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-info.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(28, 188, 235, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(32, 119, 179, 0.5); } .btn-outline-warning { - color: #f69713; + color: #FE7F02; background-color: transparent; background-image: none; - border-color: #f69713; } + border-color: #FE7F02; } .btn-outline-warning:hover { color: #212529; - background-color: #f69713; - border-color: #f69713; } + background-color: #FE7F02; + border-color: #FE7F02; } .btn-outline-warning:focus, .btn-outline-warning.focus { - box-shadow: 0 0 0 0.2rem rgba(246, 151, 19, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(254, 127, 2, 0.5); } .btn-outline-warning.disabled, .btn-outline-warning:disabled { - color: #f69713; + color: #FE7F02; background-color: transparent; } .btn-outline-warning:not(:disabled):not(.disabled):active, .btn-outline-warning:not(:disabled):not(.disabled).active, .show > .btn-outline-warning.dropdown-toggle { color: #212529; - background-color: #f69713; - border-color: #f69713; } + background-color: #FE7F02; + border-color: #FE7F02; } .btn-outline-warning:not(:disabled):not(.disabled):active:focus, .btn-outline-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-warning.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(246, 151, 19, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(254, 127, 2, 0.5); } .btn-outline-danger { - color: #ef5f5b; + color: #E31A1E; background-color: transparent; background-image: none; - border-color: #ef5f5b; } + border-color: #E31A1E; } .btn-outline-danger:hover { color: #fff; - background-color: #ef5f5b; - border-color: #ef5f5b; } + background-color: #E31A1E; + border-color: #E31A1E; } .btn-outline-danger:focus, .btn-outline-danger.focus { - box-shadow: 0 0 0 0.2rem rgba(239, 95, 91, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(227, 26, 30, 0.5); } .btn-outline-danger.disabled, .btn-outline-danger:disabled { - color: #ef5f5b; + color: #E31A1E; background-color: transparent; } .btn-outline-danger:not(:disabled):not(.disabled):active, .btn-outline-danger:not(:disabled):not(.disabled).active, .show > .btn-outline-danger.dropdown-toggle { color: #fff; - background-color: #ef5f5b; - border-color: #ef5f5b; } + background-color: #E31A1E; + border-color: #E31A1E; } .btn-outline-danger:not(:disabled):not(.disabled):active:focus, .btn-outline-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-danger.dropdown-toggle:focus { - box-shadow: 0 0 0 0.2rem rgba(239, 95, 91, 0.5); } + box-shadow: 0 0 0 0.2rem rgba(227, 26, 30, 0.5); } .btn-outline-light { color: #f8f9fa; @@ -2104,10 +2104,10 @@ button, .action-button, .btn-default, .menubutton { .btn-link { font-weight: 400; - color: #303030; + color: #000; background-color: transparent; } .btn-link:hover { - color: #0a0a0a; + color: black; text-decoration: underline; background-color: transparent; border-color: transparent; } @@ -2122,7 +2122,7 @@ button, .action-button, .btn-default, .menubutton { .btn-lg, .btn-group-lg > .btn, .btn-group-lg > input[type="submit"], .btn-group-lg > button, .btn-group-lg > .action-button, .btn-group-lg > .menubutton { padding: 0.5rem 1rem; - font-size: 0.9375rem; + font-size: 1rem; line-height: 1.5; border-radius: 0.3rem; } @@ -2131,7 +2131,7 @@ button, .btn-group-sm > .action-button, .btn-group-sm > .menubutton, .btn-xs, .m button, .multi-panel-history .control-column .action-button, .multi-panel-history .control-column .menubutton, .multi-panel-history .history-column .panel-controls .btn, .multi-panel-history .history-column .panel-controls input[type="submit"], .multi-panel-history .history-column .panel-controls button, .multi-panel-history .history-column .panel-controls .action-button, .multi-panel-history .history-column .panel-controls .menubutton { padding: 0.25rem 0.5rem; - font-size: 0.65625rem; + font-size: 0.7rem; line-height: 1.5; border-radius: 0.2rem; } @@ -2197,7 +2197,7 @@ input[type="button"].btn-block { min-width: 10rem; padding: 0.5rem 0; margin: 0.125rem 0 0; - font-size: 0.75rem; + font-size: 0.8rem; color: #212529; text-align: left; list-style: none; @@ -2331,7 +2331,7 @@ input[type="button"].btn-block { display: block; padding: 0.5rem 1.5rem; margin-bottom: 0; - font-size: 0.65625rem; + font-size: 0.7rem; color: #868e96; white-space: nowrap; } @@ -2750,7 +2750,7 @@ button, align-items: center; padding: 0.375rem 0.75rem; margin-bottom: 0; - font-size: 0.75rem; + font-size: 0.8rem; font-weight: 400; line-height: 1.5; color: #495057; @@ -2892,7 +2892,7 @@ button:not(:first-child), .custom-select { display: inline-block; width: 100%; - height: calc(1.875rem + 2px); + height: calc(1.95rem + 2px); padding: 0.375rem 1.75rem 0.375rem 0.75rem; line-height: 1.5; color: #495057; @@ -2920,13 +2920,13 @@ button:not(:first-child), opacity: 0; } .custom-select-sm { - height: calc(1.48438rem + 2px); + height: calc(1.55rem + 2px); padding-top: 0.375rem; padding-bottom: 0.375rem; font-size: 75%; } .custom-select-lg { - height: calc(2.40625rem + 2px); + height: calc(2.5rem + 2px); padding-top: 0.375rem; padding-bottom: 0.375rem; font-size: 125%; } @@ -2935,14 +2935,14 @@ button:not(:first-child), position: relative; display: inline-block; width: 100%; - height: calc(1.875rem + 2px); + height: calc(1.95rem + 2px); margin-bottom: 0; } .custom-file-input { position: relative; z-index: 2; width: 100%; - height: calc(1.875rem + 2px); + height: calc(1.95rem + 2px); margin: 0; opacity: 0; } .custom-file-input:focus ~ .custom-file-label { @@ -2959,7 +2959,7 @@ button:not(:first-child), right: 0; left: 0; z-index: 1; - height: calc(1.875rem + 2px); + height: calc(1.95rem + 2px); padding: 0.375rem 0.75rem; line-height: 1.5; color: #495057; @@ -2973,7 +2973,7 @@ button:not(:first-child), bottom: 0; z-index: 3; display: block; - height: 1.875rem; + height: 1.95rem; padding: 0.375rem 0.75rem; line-height: 1.5; color: #495057; @@ -3138,10 +3138,10 @@ button:not(:first-child), .navbar-brand { display: inline-block; - padding-top: 0.35938rem; - padding-bottom: 0.35938rem; + padding-top: 0.35rem; + padding-bottom: 0.35rem; margin-right: 1rem; - font-size: 0.9375rem; + font-size: 1rem; line-height: inherit; white-space: nowrap; } .navbar-brand:hover, .navbar-brand:focus { @@ -3172,7 +3172,7 @@ button:not(:first-child), .navbar-toggler { padding: 0.25rem 0.75rem; - font-size: 0.9375rem; + font-size: 1rem; line-height: 1; background-color: transparent; border: 1px solid transparent; @@ -3606,12 +3606,12 @@ button:not(:first-child), padding: 0.5rem 0.75rem; margin-left: -1px; line-height: 1.25; - color: #303030; + color: #000; background-color: #fff; border: 1px solid #dee2e6; } .page-link:hover { z-index: 2; - color: #0a0a0a; + color: black; text-decoration: none; background-color: #e9ecef; border-color: #dee2e6; } @@ -3646,7 +3646,7 @@ button:not(:first-child), .pagination-lg .page-link { padding: 0.75rem 1.5rem; - font-size: 0.9375rem; + font-size: 1rem; line-height: 1.5; } .pagination-lg .page-item:first-child .page-link { @@ -3659,7 +3659,7 @@ button:not(:first-child), .pagination-sm .page-link { padding: 0.25rem 0.5rem; - font-size: 0.65625rem; + font-size: 0.7rem; line-height: 1.5; } .pagination-sm .page-item:first-child .page-link { @@ -3710,36 +3710,36 @@ button .badge, .action-button .badge, .menubutton .badge { background-color: #c1c9d0; } .badge-success { - color: #fff; - background-color: #21ba21; } + color: #212529; + background-color: #66CC66; } .badge-success[href]:hover, .badge-success[href]:focus { - color: #fff; + color: #212529; text-decoration: none; - background-color: #198e19; } + background-color: #40bf40; } .badge-info, .badge-new { color: #fff; - background-color: #1cbceb; } + background-color: #2077B3; } .badge-info[href]:hover, [href].badge-new:hover, .badge-info[href]:focus, [href].badge-new:focus { color: #fff; text-decoration: none; - background-color: #119ac3; } + background-color: #185a88; } .badge-warning, .badge-beta { color: #212529; - background-color: #f69713; } + background-color: #FE7F02; } .badge-warning[href]:hover, [href].badge-beta:hover, .badge-warning[href]:focus, [href].badge-beta:focus { color: #212529; text-decoration: none; - background-color: #ce7b08; } + background-color: #cc6601; } .badge-danger { color: #fff; - background-color: #ef5f5b; } + background-color: #E31A1E; } .badge-danger[href]:hover, .badge-danger[href]:focus { color: #fff; text-decoration: none; - background-color: #eb312c; } + background-color: #b51518; } .badge-light { color: #212529; @@ -3798,7 +3798,7 @@ button .badge, .action-button .badge, .menubutton .badge { font-weight: 700; } .alert-dismissible { - padding-right: 3.625rem; } + padding-right: 3.7rem; } .alert-dismissible .close { position: absolute; top: 0; @@ -3808,7 +3808,7 @@ button .badge, .action-button .badge, .menubutton .badge { .alert-primary { color: #16324a; - background-color: #b3c3d1; + background-color: #a8baca; border-color: #6687a3; } .alert-primary hr { border-top-color: #5a7a96; } @@ -3817,7 +3817,7 @@ button .badge, .action-button .badge, .menubutton .badge { .alert-secondary { color: #85888a; - background-color: #f3f5f6; + background-color: #f2f3f5; border-color: #e8ebee; } .alert-secondary hr { border-top-color: #d9dee3; } @@ -3826,64 +3826,64 @@ button .badge, .action-button .badge, .menubutton .badge { .alert-success, .donemessagelarge, .donemessage, .donemessagesmall { - color: #146f14; - background-color: #b1e7b1; - border-color: #64ce64; } + color: #3d7a3d; + background-color: #c2ebc2; + border-color: #94db94; } .alert-success hr, .donemessagelarge hr, .donemessage hr, .donemessagesmall hr { - border-top-color: #51c851; } + border-top-color: #81d581; } .alert-success .alert-link, .donemessagelarge .alert-link, .donemessage .alert-link, .donemessagesmall .alert-link { - color: #0c440c; } + color: #2c582c; } .alert-info, .infomessagelarge, .infomessage, .infomessagesmall, .ui-form-help .note { - color: #11718d; - background-color: #b0e7f8; - border-color: #60d0f1; } + color: #13476b; + background-color: #a6c9e1; + border-color: #63a0ca; } .alert-info hr, .infomessagelarge hr, .infomessage hr, .infomessagesmall hr, .ui-form-help .note hr { - border-top-color: #49c9ef; } + border-top-color: #5094c4; } .alert-info .alert-link, .infomessagelarge .alert-link, .infomessage .alert-link, .infomessagesmall .alert-link, .ui-form-help .note .alert-link { - color: #0c4d5f; } + color: #0b2a40; } .alert-warning, .warningmessagelarge, .warningmessage, .warningmessagesmall, .ui-form-help .warning { - color: #945b0b; - background-color: #fcdbac; - border-color: #f9b65a; } + color: #984c01; + background-color: #ffcc9a; + border-color: #fea54e; } .alert-warning hr, .warningmessagelarge hr, .warningmessage hr, .warningmessagesmall hr, .ui-form-help .warning hr { - border-top-color: #f8ab41; } + border-top-color: #fe9835; } .alert-warning .alert-link, .warningmessagelarge .alert-link, .warningmessage .alert-link, .warningmessagesmall .alert-link, .ui-form-help .warning .alert-link { - color: #653e07; } + color: #653301; } .alert-danger, .errormessagelarge, .error-modal .modal-content, .errormessage, .errormessagesmall, .ui-form-help .error { - color: #8f3937; - background-color: #f9c7c6; - border-color: #f48f8c; } + color: #881012; + background-color: #f4a3a5; + border-color: #eb5f62; } .alert-danger hr, .errormessagelarge hr, .error-modal .modal-content hr, .errormessage hr, .errormessagesmall hr, .ui-form-help .error hr { - border-top-color: #f27875; } + border-top-color: #e8484c; } .alert-danger .alert-link, .errormessagelarge .alert-link, .error-modal .modal-content .alert-link, .errormessage .alert-link, .errormessagesmall .alert-link, .ui-form-help .error .alert-link { - color: #6a2a29; } + color: #5a0b0c; } .alert-light { color: #959596; - background-color: #fdfdfd; + background-color: #fcfdfd; border-color: #fafbfc; } .alert-light hr { border-top-color: #eaeef2; } @@ -3892,7 +3892,7 @@ button .badge, .action-button .badge, .menubutton .badge { .alert-dark { color: #1f2326; - background-color: #b8babc; + background-color: #aeb0b3; border-color: #717579; } .alert-dark hr { border-top-color: #65686c; } @@ -3909,7 +3909,7 @@ button .badge, .action-button .badge, .menubutton .badge { display: flex; height: 1rem; overflow: hidden; - font-size: 0.5625rem; + font-size: 0.6rem; background-color: #e9ecef; border-radius: 0.25rem; } @@ -4018,48 +4018,48 @@ button .badge, .action-button .badge, .menubutton .badge { border-color: #9b9ea1; } .list-group-item-success { - color: #178217; - background-color: #85d985; } + color: #478f47; + background-color: #abe3ab; } .list-group-item-success.list-group-item-action:hover, .list-group-item-success.list-group-item-action:focus { - color: #178217; - background-color: #72d372; } + color: #478f47; + background-color: #98dd98; } .list-group-item-success.list-group-item-action.active { color: #fff; - background-color: #178217; - border-color: #178217; } + background-color: #478f47; + border-color: #478f47; } .list-group-item-info { - color: #1483a4; - background-color: #82daf4; } + color: #16537d; + background-color: #84b4d5; } .list-group-item-info.list-group-item-action:hover, .list-group-item-info.list-group-item-action:focus { - color: #1483a4; - background-color: #6bd3f2; } + color: #16537d; + background-color: #71a8cf; } .list-group-item-info.list-group-item-action.active { color: #fff; - background-color: #1483a4; - border-color: #1483a4; } + background-color: #16537d; + border-color: #16537d; } .list-group-item-warning { - color: #ac6a0d; - background-color: #fac67d; } + color: #b25901; + background-color: #feb974; } .list-group-item-warning.list-group-item-action:hover, .list-group-item-warning.list-group-item-action:focus { - color: #ac6a0d; - background-color: #f9bb64; } + color: #b25901; + background-color: #feac5b; } .list-group-item-warning.list-group-item-action.active { color: #fff; - background-color: #ac6a0d; - border-color: #ac6a0d; } + background-color: #b25901; + border-color: #b25901; } .list-group-item-danger { - color: #a74240; - background-color: #f6a7a5; } + color: #9f1215; + background-color: #f08183; } .list-group-item-danger.list-group-item-action:hover, .list-group-item-danger.list-group-item-action:focus { - color: #a74240; - background-color: #f4908e; } + color: #9f1215; + background-color: #ed6a6d; } .list-group-item-danger.list-group-item-action.active { color: #fff; - background-color: #a74240; - border-color: #a74240; } + background-color: #9f1215; + border-color: #9f1215; } .list-group-item-light { color: #aeaeaf; @@ -4085,7 +4085,7 @@ button .badge, .action-button .badge, .menubutton .badge { .close { float: right; - font-size: 1.125rem; + font-size: 1.2rem; font-weight: 700; line-height: 1; color: #000; @@ -4222,7 +4222,7 @@ button.close { z-index: 1070; display: block; margin: 0; - font-family: "Lucida Grande", verdana, arial, helvetica, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-style: normal; font-weight: 400; line-height: 1.5; @@ -4236,7 +4236,7 @@ button.close { word-spacing: normal; white-space: normal; line-break: auto; - font-size: 0.65625rem; + font-size: 0.7rem; word-wrap: break-word; opacity: 0; } .tooltip.show { @@ -4307,7 +4307,7 @@ button.close { z-index: 1060; display: block; max-width: 276px; - font-family: "Lucida Grande", verdana, arial, helvetica, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-style: normal; font-weight: 400; line-height: 1.5; @@ -4321,7 +4321,7 @@ button.close { word-spacing: normal; white-space: normal; line-break: auto; - font-size: 0.65625rem; + font-size: 0.7rem; word-wrap: break-word; background-color: #fff; background-clip: padding-box; @@ -4414,7 +4414,7 @@ button.close { .popover-header { padding: 0.5rem 0.75rem; margin-bottom: 0; - font-size: 0.75rem; + font-size: 0.8rem; color: inherit; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; @@ -4636,36 +4636,36 @@ button.bg-secondary:focus { background-color: #c1c9d0 !important; } .bg-success { - background-color: #21ba21 !important; } + background-color: #66CC66 !important; } a.bg-success:hover, a.bg-success:focus, button.bg-success:hover, button.bg-success:focus { - background-color: #198e19 !important; } + background-color: #40bf40 !important; } .bg-info { - background-color: #1cbceb !important; } + background-color: #2077B3 !important; } a.bg-info:hover, a.bg-info:focus, button.bg-info:hover, button.bg-info:focus { - background-color: #119ac3 !important; } + background-color: #185a88 !important; } .bg-warning { - background-color: #f69713 !important; } + background-color: #FE7F02 !important; } a.bg-warning:hover, a.bg-warning:focus, button.bg-warning:hover, button.bg-warning:focus { - background-color: #ce7b08 !important; } + background-color: #cc6601 !important; } .bg-danger { - background-color: #ef5f5b !important; } + background-color: #E31A1E !important; } a.bg-danger:hover, a.bg-danger:focus, button.bg-danger:hover, button.bg-danger:focus { - background-color: #eb312c !important; } + background-color: #b51518 !important; } .bg-light { background-color: #f8f9fa !important; } @@ -4726,16 +4726,16 @@ button.bg-dark:focus { border-color: #dee2e6 !important; } .border-success { - border-color: #21ba21 !important; } + border-color: #66CC66 !important; } .border-info { - border-color: #1cbceb !important; } + border-color: #2077B3 !important; } .border-warning { - border-color: #f69713 !important; } + border-color: #FE7F02 !important; } .border-danger { - border-color: #ef5f5b !important; } + border-color: #E31A1E !important; } .border-light { border-color: #f8f9fa !important; } @@ -6536,28 +6536,28 @@ a.text-secondary:hover, a.text-secondary:focus { color: #c1c9d0 !important; } .text-success { - color: #21ba21 !important; } + color: #66CC66 !important; } a.text-success:hover, a.text-success:focus { - color: #198e19 !important; } + color: #40bf40 !important; } .text-info { - color: #1cbceb !important; } + color: #2077B3 !important; } a.text-info:hover, a.text-info:focus { - color: #119ac3 !important; } + color: #185a88 !important; } .text-warning { - color: #f69713 !important; } + color: #FE7F02 !important; } a.text-warning:hover, a.text-warning:focus { - color: #ce7b08 !important; } + color: #cc6601 !important; } .text-danger { - color: #ef5f5b !important; } + color: #E31A1E !important; } a.text-danger:hover, a.text-danger:focus { - color: #eb312c !important; } + color: #b51518 !important; } .text-light, .quota-meter-text { color: #f8f9fa !important; } @@ -9077,9 +9077,6 @@ pre.code { color: white; padding: 1em; } -a { - text-decoration: underline; } - label { font-weight: normal; } @@ -9977,7 +9974,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { left: 32px; right: 32px; font-size: 12px; - font-family: "Lucida Grande", verdana, arial, helvetica, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; text-align: center; } .galaxy-frame .frame .f-not-allowed { cursor: not-allowed; } @@ -10016,9 +10013,9 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { font-size: 0.75rem; background-color: #f5f5f5; } .upload-button .progress-bar-danger { - background: #f9c7c6; } + background: #f4a3a5; } .upload-button .progress-bar-success { - background: #b1e7b1; } + background: #c2ebc2; } .upload-button .progress-bar-info { background: #ffffcc; } .upload-button .progress-bar-notransition { @@ -10046,7 +10043,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { height: 310px; text-align: center; overflow: scroll; - font-size: 0.75rem; + font-size: 0.8rem; line-height: 1.33; -moz-border-radius: 0.3125rem; border-radius: 0.3125rem; @@ -10073,12 +10070,12 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { .upload-view-default .upload-box .upload-row .upload-title, .upload-view-composite .upload-box .upload-row .upload-title { width: 130px; word-wrap: break-word; - font-size: 0.65625rem; + font-size: 0.7rem; float: left; } .upload-view-default .upload-box .upload-row .upload-title-extended, .upload-view-composite .upload-box .upload-row .upload-title-extended { width: 380px; word-wrap: break-word; - font-size: 0.65625rem; + font-size: 0.7rem; float: left; } .upload-view-default .upload-box .upload-row .upload-size, .upload-view-composite .upload-box .upload-row .upload-size { width: 60px; @@ -10086,11 +10083,11 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { .upload-view-default .upload-box .upload-row .upload-extension, .upload-view-composite .upload-box .upload-row .upload-extension { width: 100px; min-width: 100px; - font-size: 0.65625rem; } + font-size: 0.7rem; } .upload-view-default .upload-box .upload-row .upload-genome, .upload-view-composite .upload-box .upload-row .upload-genome { width: 150px; min-width: 150px; - font-size: 0.65625rem; } + font-size: 0.7rem; } .upload-view-default .upload-box .upload-row .upload-mode, .upload-view-composite .upload-box .upload-row .upload-mode { font-size: 1.2em; width: 1.2em; @@ -10103,7 +10100,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { position: absolute; display: none; } .upload-view-default .upload-box .upload-row .upload-text-column .upload-text .upload-text-content, .upload-view-composite .upload-box .upload-row .upload-text-column .upload-text .upload-text-content { - font-size: 0.65625rem; + font-size: 0.7rem; width: 100%; height: 80px; resize: none; @@ -10112,10 +10109,10 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { white-space: pre; overflow: auto; } .upload-view-default .upload-box .upload-row .upload-text-column .upload-text .upload-text-info, .upload-view-composite .upload-box .upload-row .upload-text-column .upload-text .upload-text-info { - font-size: 0.65625rem; } + font-size: 0.7rem; } .upload-view-default .upload-box .upload-row .upload-info, .upload-view-composite .upload-box .upload-row .upload-info { width: 130px; - font-size: 0.65625rem; + font-size: 0.7rem; line-height: 1.2em; } .upload-view-default .upload-box .upload-row .upload-info .progress, .upload-view-composite .upload-box .upload-row .upload-info .progress { top: 1px; @@ -10302,7 +10299,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { .ui-error { -moz-border-radius: 0.1875rem; border-radius: 0.1875rem; - background: #f9c7c6; + background: #f4a3a5; padding: 5px; } .ui-label { @@ -10365,7 +10362,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { margin: 0px; margin-top: 2px; } .ui-button-default .progress .progress-bar { - background: #3cc33c; } + background: #4fc54f; } .ui-button-icon { height: auto !important; @@ -10407,8 +10404,8 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { float: right; } .ui-side-panel { - color: #000; - background: #dfe5f9; + color: #212529; + background: #f8f9fa; padding: 10px; min-height: 100%; } .ui-side-panel .ui-side-section-title { @@ -10718,10 +10715,10 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { .ui-portlet-panel, .ui-portlet-section { margin-top: 5px; - border-left: solid 3px #dfe5f9; } + border-left: solid 3px #f8f9fa; } .ui-portlet-panel .portlet-header, .ui-portlet-section .portlet-header { - background: #dfe5f9; - border-bottom: solid #b4c2f1 1px; } + background: #f8f9fa; + border-bottom: solid #dae0e5 1px; } .ui-portlet-section .portlet-highlight { text-decoration: underline; } @@ -10837,9 +10834,9 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { .ui-input, .ui-form-element .ui-form-preview, .ui-form-element-disabled .ui-form-preview, .ui-input-basic, .ui-select select, .ui-select .select2-container .select2-choice, .ui-textarea, .ui-options .ui-options-list, .ui-form-slider .ui-form-slider-text, .ui-select .select2-container-multi .select2-choices { width: 100%; display: block; - height: calc(1.875rem + 2px); + height: calc(1.95rem + 2px); padding: 0.25rem 5px !important; - font-size: 0.75rem; + font-size: 0.8rem; line-height: 1.5; color: #495057; border: 1px solid #aaa; @@ -11020,7 +11017,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { margin-right: 5px; } .ui-gs-select-file .ui-gs-browse-field { - height: calc(1.875rem + 2px); + height: calc(1.95rem + 2px); line-height: 1.5; } .ui-select { @@ -11077,12 +11074,12 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { padding: 2px; } .ui-dragover-danger { - border: 2px solid #f9c7c6; - background: #fef4f4 !important; } + border: 2px solid #f4a3a5; + background: #f9d1d2 !important; } .ui-dragover-success { - border: 2px solid #b1e7b1; - background: #d8f3d8 !important; } + border: 2px solid #c2ebc2; + background: #e8f8e8 !important; } .ui-limitloader { padding: 10px; @@ -11122,9 +11119,6 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close { .select2-drop.select2-drop-above.select2-drop-active .select2-search { padding-top: 0px; } -a { - text-decoration: underline; } - label { font-weight: normal; } @@ -12397,7 +12391,7 @@ button.toast-close-button { font-size: 1.2em; line-height: 1.2em; } .charts-client .charts-buttons .ui-button-icon .fa-check-square { - color: #146f14; } + color: #3d7a3d; } .charts-client .charts-center { float: left; @@ -12500,7 +12494,7 @@ button.toast-close-button { body { background: #fff; - color: #000; + color: #212529; margin: 10px; } body.full-content { overflow: hidden; @@ -12537,7 +12531,7 @@ body { #messagebox { width: 100%; - height: 2rem !important; + height: 2.5rem !important; overflow: hidden; border-bottom: solid #999 1px; font-size: 90%; @@ -12545,7 +12539,7 @@ body { #inactivebox { width: 100%; - height: 2rem !important; + height: 2.5rem !important; overflow: hidden; border-bottom: solid #999 1px; font-size: 90%; @@ -12562,13 +12556,13 @@ body { #left { left: 0px; - width: 250px; + width: 16rem; z-index: 200; - border-right: solid #999 1px; } + border-right: none; } #center { - left: 250px; - right: 250px; + left: 16rem; + right: 16rem; overflow: hidden; z-index: 1; } #center .center-container { @@ -12588,22 +12582,27 @@ body { height: 100%; } #right { - width: 250px; + width: 16rem; right: 0px; z-index: 200; - border-left: solid #999 1px; } + border-left: none; } #left, #right, .unified-panel { - background: #dfe5f9; + background: #f8f9fa; + display: flex; + flex-direction: column; } + +#left, #right, .unified-panel { + background: #f8f9fa; display: flex; flex-direction: column; } .unified-panel-header { - height: 2rem; + height: 2.5rem; z-index: 1000; text-shadow: rgba(255, 255, 255, 0.8) 0 1px 0; - background: #e9ecef; - border-bottom: solid #999 1px; + background: #f8f9fa; + border-bottom: none; margin: 0; padding: 0; padding-right: 10px; @@ -12639,15 +12638,17 @@ body { padding-right: 1.75em; background: url(../images/dropdownarrow.png) no-repeat right 7px; } +.unified-panel-controls { + padding: 0px 10px; } + .unified-panel-footer, .panel-collapse { - position: absolute; - bottom: 0; + position: relative; height: 25px; line-height: 25px; width: 100%; z-index: 1000; - border-top: solid #999 1px; - background: #e9ecef; + border-top: none; + background: #f8f9fa; color: #555; } .unified-panel-footer a, .panel-collapse a { color: #555; } @@ -12682,9 +12683,9 @@ body { line-height: 25px; width: 20px; background: none; - border-right: solid #999 1px; - border-top: solid #999 1px; - background: #e9ecef; } + border-right: none; + border-top: none; + background: #f8f9fa; } .panel-collapse:before { content: "\f053"; } .panel-collapse.hidden:before { @@ -12693,7 +12694,7 @@ body { left: inherit; right: 0; border-right: none; - border-left: solid #bfbfbf 1px; } + border-left: none; } .panel-collapse.right.right:before { content: "\f054"; } .panel-collapse.right.right.hidden:before { @@ -12708,7 +12709,7 @@ div.unified-panel-body { flex: 1; } div.unified-panel-body-background { - background: none repeat scroll 0 0 #dfe5f9; } + background: none repeat scroll 0 0 #f8f9fa; } #left > div.unified-panel-body, #right > div.unified-panel-body { @@ -12730,32 +12731,35 @@ div.unified-panel-body-background { .panel-warning-message, .panel-done-message, .panel-info-message { - height: 2rem; - line-height: 2rem; + height: 2.5rem; + line-height: 2.5rem; padding: 0px; - padding-left: 26px; - background-color: #f9c7c6; + padding-left: 2.5rem; + background-color: #f4a3a5; background-image: url(error_small.png); background-repeat: no-repeat; - background-position: 6px 50%; } + background-position: .5rem 50%; } .panel-warning-message { background-image: url(warn_small.png); - background-color: #fcdbac; } + background-color: #ffcc9a; } .panel-done-message { background-image: url(ok_small.png); - background-color: #b1e7b1; } + background-color: #c2ebc2; } .panel-info-message { - background-image: url(info_small.png); - background-color: #b0e7f8; } + background-image: url(info_icon.svg); + background-size: 1.5rem; + background-color: #a6c9e1; } + .panel-info-message svg:path { + fill: black; } #masthead { padding: 0; margin-bottom: 0px; background-color: #2c3143; - height: 2.5rem; } + height: 3rem; } #masthead .navbar-nav { min-height: 100%; } #masthead .navbar-nav > li { @@ -12819,10 +12823,10 @@ div.unified-panel-body-background { background-color: #25537b; } .quota-meter-bar-warn { - background-color: #f69713; } + background-color: #FE7F02; } .quota-meter-bar-error { - background-color: #ef5f5b; } + background-color: #E31A1E; } .quota-meter-text { position: absolute; @@ -12913,7 +12917,7 @@ div.toolHelpBody { -moz-border-radius: 1px; border-radius: 1px; } .toolForm.toolFormInCanvas .toolFormTitle { - font-size: 0.75rem; + font-size: 0.8rem; line-height: 1.5; } div.form, @@ -12945,7 +12949,7 @@ div.repeat-group-item { margin-bottom: 10px; } div.form-row-error { - background: #f9c7c6; } + background: #f4a3a5; } div.form-row label { font-weight: bold; @@ -12990,7 +12994,7 @@ div.form-row-error-message { select { padding: 2px; - font-size: 0.75rem; + font-size: 0.8rem; line-height: 1.5; } select, @@ -13010,7 +13014,7 @@ textarea { textarea, input[type="text"], input[type="password"] { - font-size: 0.75rem; + font-size: 0.8rem; line-height: 1.5; border: 1px solid #aaa; padding: 3px; } @@ -13018,7 +13022,7 @@ input[type="password"] { .search-query { display: inline-block; padding: 4px; - font-size: 0.75rem; + font-size: 0.8rem; line-height: 1.5; color: #495057; border: 1px solid #aaa; @@ -13368,7 +13372,7 @@ ul.manage-table-actions li { .state-progress .running { background: #ffffcc; } .state-progress .ok { - background: #b1e7b1; } + background: #c2ebc2; } .state-progress .note { margin-left: 1em; position: absolute; } @@ -13378,8 +13382,8 @@ ul.manage-table-actions li { background: #e9ecef; } .state-color-upload { - border-color: #60d0f1; - background: #b0e7f8; } + border-color: #63a0ca; + background: #a6c9e1; } .state-color-waiting { border-color: #bfbfbf; @@ -13394,12 +13398,12 @@ ul.manage-table-actions li { background: #ffffcc; } .state-color-ok { - border-color: #64ce64; - background: #b1e7b1; } + border-color: #94db94; + background: #c2ebc2; } .state-color-error { - border-color: #f48f8c; - background: #f9c7c6; } + border-color: #eb5f62; + background: #f4a3a5; } .state-color-deleted { border-color: #737373; @@ -13676,7 +13680,7 @@ div.permissionContainer { .list-item .info-section, .dataset .details .summary .info, .dataset .details .summary .job-error-text, .dataset .details .annotation-display .annotation { border-radius: 3px; - border: 1px solid rgba(153, 153, 153, 0.3); + border: 1px solid rgba(33, 37, 41, 0.3); padding: 4px; } .list-item .vertical-spacing, .list-panel .vertical-spacing, .dataset .details .summary .dbkey:after, .dataset .details .summary, .dataset .details .actions:not(:last-child), .dataset .details .annotation-display, .dataset .details .display-applications .display-application:last-child, .dataset .details .dataset-peek, .tags-display { @@ -13986,15 +13990,15 @@ The `sprites` mixin generates identical output to the CSS template content: ""; } .has-job-state-mixin.state-ok, .state-ok.dataset, .state-ok.dataset-collection-element, .state-ok.history-content.dataset-collection, .has-job-state-mixin.state-failed_metadata, .state-failed_metadata.dataset, .state-failed_metadata.dataset-collection-element, .state-failed_metadata.history-content.dataset-collection { - background: #b1e7b1; } + background: #c2ebc2; } .has-job-state-mixin.state-ok .state-icon, .state-ok.dataset .state-icon, .state-ok.dataset-collection-element .state-icon, .state-ok.history-content.dataset-collection .state-icon, .has-job-state-mixin.state-failed_metadata .state-icon, .state-failed_metadata.dataset .state-icon, .state-failed_metadata.dataset-collection-element .state-icon, .state-failed_metadata.history-content.dataset-collection .state-icon { display: none; } .has-job-state-mixin.state-error, .state-error.dataset, .state-error.dataset-collection-element, .state-error.history-content.dataset-collection, .has-job-state-mixin.state-empty, .state-empty.dataset, .state-empty.dataset-collection-element, .state-empty.history-content.dataset-collection { - background: #f9c7c6; } + background: #f4a3a5; } .has-job-state-mixin.state-upload, .state-upload.dataset, .state-upload.dataset-collection-element, .state-upload.history-content.dataset-collection { - background: #b0e7f8; } + background: #a6c9e1; } .has-job-state-mixin.state-queued, .state-queued.dataset, .state-queued.dataset-collection-element, .state-queued.history-content.dataset-collection { background: #e9ecef; } @@ -14194,7 +14198,7 @@ pre.peek { .history-panel > .controls .annotation-display .annotation { background: white; border-radius: 3px; - border: 1px solid rgba(153, 153, 153, 0.5); + border: 1px solid rgba(33, 37, 41, 0.5); padding: 4px; white-space: pre-wrap; overflow: auto; } @@ -14389,7 +14393,7 @@ pre.peek { border-left: 5px solid #4e5777; } #right.history-right-panel { - background-color: #dfe5f9; } + background-color: #f8f9fa; } #right.history-right-panel .unified-panel-header .unified-panel-header-inner .panel-header-buttons .panel-header-button { display: inline-block; height: 22px; @@ -14565,7 +14569,7 @@ pre.peek { width: 100%; border: 1px solid grey; border-radius: 3px 3px 0px 0px; - background-color: #dfe5f9; + background-color: #f8f9fa; overflow: auto; } .multi-panel-history .history-column .history-panel > .controls .subtitle { min-height: 15px; @@ -15080,7 +15084,7 @@ pre.peek { color: grey; } .search-input .search-clear:hover { - color: #303030; + color: #000; cursor: pointer; } .dataset-choice { @@ -15256,7 +15260,7 @@ pre.peek { .toolMenuContainer { color: #212529; - background: #dfe5f9; + background: #f8f9fa; min-height: 100%; padding: 5px 10px; } .toolMenuContainer a { @@ -15276,7 +15280,8 @@ div.toolSectionDetailsInner { margin-right: 5px; } div.toolSectionTitle { - font-weight: bold; } + font-weight: 500; + font-size: 1rem; } div.toolPanelLabel { padding-top: 10px; @@ -15288,10 +15293,9 @@ div.toolPanelLabel { div.toolTitle { padding-top: 5px; padding-bottom: 5px; - margin-left: 16px; + margin-left: 10px; margin-right: 10px; - display: list-item; - list-style: square outside; } + display: block; } div.toolTitle .labels { float: right; margin-left: 2px; } diff --git a/static/style/blue/library.css b/static/style/blue/library.css index 9bf8fa216b4..8c3e662b60a 100644 --- a/static/style/blue/library.css +++ b/static/style/blue/library.css @@ -1,6 +1,3 @@ -a { - text-decoration: underline; } - label { font-weight: normal; } From 546eb18ca1e1a3f22fd162b5bcf674705c173601 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sat, 30 Jun 2018 20:35:23 -0400 Subject: [PATCH 020/352] Improving spacing and forms. --- client/galaxy/style/scss/base.scss | 22 +++++++++------ .../galaxy/style/scss/galaxy_variables.scss | 7 ++++- client/galaxy/style/scss/history.scss | 21 +-------------- client/galaxy/style/scss/list-item.scss | 4 +-- client/galaxy/style/scss/ui.scss | 27 +++++++------------ client/galaxy/style/scss/upload.scss | 2 +- 6 files changed, 34 insertions(+), 49 deletions(-) diff --git a/client/galaxy/style/scss/base.scss b/client/galaxy/style/scss/base.scss index a2e94d28ad5..f3d06962387 100644 --- a/client/galaxy/style/scss/base.scss +++ b/client/galaxy/style/scss/base.scss @@ -177,7 +177,7 @@ body { position: absolute; width: 100%; height: 100%; - padding: 10px; + padding: $margin-h $margin-v; overflow: auto; } .center-frame { @@ -215,9 +215,8 @@ body { background: $panel-header-bg-color; border-bottom: $layout-border; margin: 0; - padding: 0; - padding-right: 10px; - padding-left: 10px; + padding: 0 $margin-v; + font-size: 1rem; font-weight: bold; display: flex; align-items: center; @@ -227,7 +226,7 @@ body { color: $panel-header-text-color; } .fa { - font-size: 1.2em; + // font-size: 1.2em; } .unified-panel-header-inner { @@ -245,6 +244,13 @@ body { text-decoration: none; display: inline-block; cursor: pointer; + width: 1.2rem; + text-align: center; + padding: 0px; + &:not(:last-child) { + margin-right: 2px; + } + // Fade to maroon on hover &:hover { color: maroon; @@ -263,7 +269,7 @@ body { } .unified-panel-controls { - padding: 0px 10px; + padding: 0 $margin-v; } .unified-panel-footer { @@ -787,7 +793,7 @@ button { #tool-search { position: relative; - margin: 10px; + margin: 10px 0; #search-clear-btn { position: absolute; @@ -1612,7 +1618,7 @@ div.permissionContainer { } background: $panel-bg-color; min-height: 100%; - padding: 5px 10px; + padding: $margin-h $margin-v; } div.toolSectionPad { diff --git a/client/galaxy/style/scss/galaxy_variables.scss b/client/galaxy/style/scss/galaxy_variables.scss index 816ced18420..2b872a269ba 100644 --- a/client/galaxy/style/scss/galaxy_variables.scss +++ b/client/galaxy/style/scss/galaxy_variables.scss @@ -20,7 +20,7 @@ $panel-header-text-color: #555; $panel-message-height: 2.5rem; //1.875rem; // Initial width of left and right panels -$panel-width: 16rem; +$panel-width: 18rem; $layout_top_padding: 0px; $border-default-color_padding: 0px; @@ -55,6 +55,11 @@ $navbar-height: 36px; // 2.062500rem; $navbar-default-bg: $gray-100; // JT #f8f8f8; $navbar-default-border: darken($navbar-default-bg, $border-darken-percent); +// Margins +$spacer: 1rem; // Not sure why this is not coming from Bootstrap +$margin-v: $spacer * 1.5; +$margin-h: $spacer; + @import "theme/blue.scss"; // Theme: plain diff --git a/client/galaxy/style/scss/history.scss b/client/galaxy/style/scss/history.scss index f7a975f628f..0c553b570d4 100644 --- a/client/galaxy/style/scss/history.scss +++ b/client/galaxy/style/scss/history.scss @@ -3,7 +3,7 @@ @extend .flex-vertical-container; > .controls { - margin: 8px 8px 1px; + margin: $margin-h $margin-v; padding: 0px; flex: 0 0 auto; @@ -374,25 +374,6 @@ // ---------------------------------------------------------------------------- analyze data page - right panel #right.history-right-panel { - background-color: $panel-bg-color; - .unified-panel-header { - .unified-panel-header-inner { - .panel-header-buttons { - .panel-header-button { - display: inline-block; - height: $icon-btn-size; - width: $icon-btn-size; - text-align: center; - line-height: $icon-btn-size - 3; - font-size: 1.2em; - padding: 0px; - &:not(:last-child) { - margin-right: 2px; - } - } - } - } - } .unified-panel-body { display: -webkit-flex; .middle { diff --git a/client/galaxy/style/scss/list-item.scss b/client/galaxy/style/scss/list-item.scss index a37f9f557b6..e1fb25f6e56 100644 --- a/client/galaxy/style/scss/list-item.scss +++ b/client/galaxy/style/scss/list-item.scss @@ -28,9 +28,9 @@ $vertical-gap: 8px; } $spacing-top: 6px; - $spacing-right: 10px; + $spacing-right: $margin-v; $spacing-bottom: 6px; - $spacing-left: 8px; + $spacing-left: $margin-v; .padded { padding: $spacing-top $spacing-right $spacing-bottom $spacing-left; } diff --git a/client/galaxy/style/scss/ui.scss b/client/galaxy/style/scss/ui.scss index c54245df017..7b9a63425cf 100644 --- a/client/galaxy/style/scss/ui.scss +++ b/client/galaxy/style/scss/ui.scss @@ -28,11 +28,11 @@ } // default margins -$ui-margin-vertical: 5px; -$ui-margin-vertical-large: 10px; -$ui-margin-horizontal: 5px; -$ui-margin-horizontal-small: 4px; -$ui-margin-horizontal-large: 10px; +$ui-margin-vertical: $margin-v * 0.25; +$ui-margin-vertical-large: $margin-v * 0.5; +$ui-margin-horizontal: $margin-h; +$ui-margin-horizontal-small: $margin-h * 0.5; +$ui-margin-horizontal-large: $margin-v * 2; // helpers .ui-clear-float { @@ -532,26 +532,21 @@ $ui-margin-horizontal-large: 10px; // portlets .ui-portlet { - border: solid $form-border 1px; - border-radius: $border-radius-base; + @extend .card; position: relative; clear: both; width: auto; height: auto; .portlet-header { - background: $form-heading-bg; - border-bottom: solid $form-border 1px; - padding: 2px 8px; + @extend .card-header; overflow: visible; width: 100%; .portlet-title { word-wrap: break-word; - display: inline; - vertical-align: middle; - font-weight: bold; .portlet-title-text { + @extend h4; vertical-align: middle; - line-height: 22px; + //line-height: 22px; } .portlet-title-text.no-highlight.collapsible { cursor: pointer; @@ -570,9 +565,7 @@ $ui-margin-horizontal-large: 10px; } } .portlet-content { - height: inherit; - padding-left: 10px; - padding-right: 10px; + @extend .card-body; clear: both; .portlet-body { padding: 0px; diff --git a/client/galaxy/style/scss/upload.scss b/client/galaxy/style/scss/upload.scss index d011c575aed..64ec725628c 100644 --- a/client/galaxy/style/scss/upload.scss +++ b/client/galaxy/style/scss/upload.scss @@ -29,7 +29,7 @@ } .panel-header-button { position: absolute; - width: 31px; + width: 31px !important; text-align: center; font-size: 1.2em; padding: 0px; From 7ddac47efaa9fa8435e4cb4c207bf557429dcd2d Mon Sep 17 00:00:00 2001 From: guerler Date: Wed, 11 Jul 2018 09:46:04 -0400 Subject: [PATCH 021/352] Remove custom margin classes --- .../galaxy/scripts/components/PluginList.vue | 2 +- .../galaxy/scripts/mvc/tool/tool-form-base.js | 2 +- client/galaxy/scripts/mvc/ui/ui-buttons.js | 10 +- client/galaxy/scripts/mvc/ui/ui-list.js | 2 +- client/galaxy/scripts/mvc/ui/ui-misc.js | 2 +- .../scripts/mvc/ui/ui-select-library.js | 2 +- .../scripts/mvc/user/user-custom-builds.js | 6 +- .../mvc/visualization/chart/views/editor.js | 2 +- .../mvc/visualization/chart/views/settings.js | 2 +- client/galaxy/style/scss/ui.scss | 22 - static/style/blue/base.css | 517 +++++++++++++----- 11 files changed, 400 insertions(+), 169 deletions(-) diff --git a/client/galaxy/scripts/components/PluginList.vue b/client/galaxy/scripts/components/PluginList.vue index 15867535ce2..03143bc5ea0 100644 --- a/client/galaxy/scripts/components/PluginList.vue +++ b/client/galaxy/scripts/components/PluginList.vue @@ -33,7 +33,7 @@
diff --git a/client/galaxy/scripts/mvc/tool/tool-form-base.js b/client/galaxy/scripts/mvc/tool/tool-form-base.js index 95c6c27004a..4ee6dfc09c8 100644 --- a/client/galaxy/scripts/mvc/tool/tool-form-base.js +++ b/client/galaxy/scripts/mvc/tool/tool-form-base.js @@ -82,7 +82,7 @@ export default FormBase.extend({ if (!this.model.get("collapsible")) { this.$el.append( $("
") - .addClass("ui-margin-top-large") + .addClass("mt-2") .append(this._footer()) ); } diff --git a/client/galaxy/scripts/mvc/ui/ui-buttons.js b/client/galaxy/scripts/mvc/ui/ui-buttons.js index 3c0fb608d13..92edff4e210 100644 --- a/client/galaxy/scripts/mvc/ui/ui-buttons.js +++ b/client/galaxy/scripts/mvc/ui/ui-buttons.js @@ -53,13 +53,13 @@ var ButtonDefault = Backbone.View.extend({ this.$title.removeClass().addClass("title"); if (options.wait) { this.$el.addClass(options.wait_cls).prop("disabled", true); - this.$icon.addClass("fa-spinner fa-spin ui-margin-right"); + this.$icon.addClass("fa-spinner fa-spin mr-1"); this.$title.html(options.wait_text); } else { this.$el.addClass(options.cls); this.$icon.addClass(options.icon); this.$title.html(options.title); - options.icon && options.title && this.$icon.addClass("ui-margin-right"); + options.icon && options.title && this.$icon.addClass("mr-1"); } }, @@ -173,7 +173,7 @@ var ButtonCheck = Backbone.View.extend({ this.$title.html(options.title); this.$icon .removeClass() - .addClass("icon fa ui-margin-right") + .addClass("icon fa mr-1") .addClass(options.icons[options.value]); }, @@ -239,7 +239,7 @@ var ButtonIcon = ButtonDefault.extend({ .addClass("icon fa") .addClass(options.icon); this.$title.addClass("title").html(options.title); - options.icon && options.title && this.$icon.addClass("ui-margin-right"); + options.icon && options.title && this.$icon.addClass("mr-1"); } }); @@ -304,7 +304,7 @@ var ButtonMenu = ButtonDefault.extend({ .removeClass() .addClass("title") .html(options.title); - options.icon && options.title && this.$icon.addClass("ui-margin-right"); + options.icon && options.title && this.$icon.addClass("mr-1"); this.$menu && this.$menu.remove(); if (this.collection.length > 0) { this.$menu = $("
    ") diff --git a/client/galaxy/scripts/mvc/ui/ui-list.js b/client/galaxy/scripts/mvc/ui/ui-list.js index 012a8020a0c..a8a98cec572 100644 --- a/client/galaxy/scripts/mvc/ui/ui-list.js +++ b/client/galaxy/scripts/mvc/ui/ui-list.js @@ -142,7 +142,7 @@ var View = Backbone.View.extend({ _template: function(options) { return ( '
    ' + - '
    ' + + '
    ' + '' + '' + "
    " + diff --git a/client/galaxy/scripts/mvc/ui/ui-misc.js b/client/galaxy/scripts/mvc/ui/ui-misc.js index 42a08b8a670..138f8092d9c 100644 --- a/client/galaxy/scripts/mvc/ui/ui-misc.js +++ b/client/galaxy/scripts/mvc/ui/ui-misc.js @@ -242,7 +242,7 @@ export var Upload = Backbone.View.extend({ .append( (this.$file = $("") .attr("type", "file") - .addClass("ui-margin-bottom")) + .addClass("mb-1")) ) .append( (this.$text = $("\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)+"")}),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 '+c.escape(this.model.get("name"))+'\n \n \n '+this._templateActions()+'\n
    \n \n \n
    \n
    \n \n \n '+(this.model.get("owner")===Galaxy.user.attributes.username?"You":this.model.get("owner"))+"\n \n "+this.model.get("number_of_steps")+"\n "+(this.model.get("published")?"Yes":"No")+"\n "+i+""},renderTagEditor:function(){var t=new h.default.TagsEditor({model:this.model,el:e.find("."+this.model.id+".tags-display"),workflow_mode:!0});t.toggle(!0),t.render()},_templateActions:function(){return this.model.get("owner")===Galaxy.user.attributes.username?'':''}}),x=l.View.extend({title:(0,v.default)("Workflows"),active_tab:"workflow",initialize:function(){y.default.markViewAsLoading(this),c.bindAll(this,"adjustActiondropdown"),this.collection=new p.default.WorkflowCollection,this.collection.fetch().done(this.render()),this.collection.bind("add",this.appendItem),this.collection.on("sync",this.render,this)},events:{dragleave:"unhighlightDropZone",drop:"drop",dragover:function(t){e(".hidden_description_layer").addClass("dragover"),e(".menubutton").addClass("background-none"),t.preventDefault()}},unhighlightDropZone:function(){e(".hidden_description_layer").removeClass("dragover"),e(".menubutton").removeClass("background-none")},drop:function(e){this.unhighlightDropZone(),e.preventDefault();for(var t,i=e.dataTransfer.files,n=0;t=i[n];n++)this.readWorkflowFiles(t)},readWorkflowFiles:function(e){var t=this,i=new FileReader;i.onload=function(n){var a=void 0;try{a=JSON.parse(i.result)}catch(t){o.error("Could not read file '"+e.name+"'. Verify it is a valid Galaxy workflow"),a=null}a&&t.collection.create(a,{at:0,wait:!0,success:function(){o.success("Successfully imported workflow '"+a.name+"'")},error:function(e,t,i){o.error(i.errorThrown)}})},i.readAsText(e,"utf-8")},_showArgErrors:c.once(function(){var e=m.default.get("message");"error"===m.default.get("status")?o.error(c.escape(e||"Unknown Error, please report this to an administrator.")):e&&o.info(c.escape(e))}),render:function(){var e=this,t=this._templateHeader(),i=this._templateActionButtons(),n=this._templateWorkflowTable();this.$el.html(t+i+n),c.each(this.collection.models,function(t){e.appendItem(t),e.confirmDelete(t)});return this.searchWorkflow(this.$(".search-wf"),this.$(".workflow-search tr"),3),this.adjustActiondropdown(),this._showArgErrors(),this},appendItem:function(t){var i=new b({model:t,collection:this.collection});e(".workflow-search").append(i.render().el),i.renderTagEditor()},confirmDelete:function(e){this.$(".link-confirm-shared-"+e.id).click(function(){return window.confirm("Are you sure you want to remove the shared workflow '"+e.attributes.name+"'?")})},searchWorkflow:function(t,i,n){t.on("keyup",function(){var t=e(this).val();if(t.length>=n){var a=new RegExp(t,"i");i.hide(),i.filter(function(){return a.test(e(this).text())}).show()}else i.show()})},adjustActiondropdown:function(){e(this.el).on("show.bs.dropdown",function(){e(this.el).css("overflow","inherit")}),e(this.el).on("hide.bs.dropdown",function(){e(this.el).css("overflow","auto")})},_templateNoWorkflow:function(){return'
    You have no workflows.
    '},_templateActionButtons:function(){return'
    '},_templateWorkflowTable:function(){return'

    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]); +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(663),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(656),r=n(o),l=i(657),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(660),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(665)}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(667),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(666);"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(669)}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(671),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(670);"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(673)}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(678),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(674);"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(676);"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(681)}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(683),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(682);"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 67c9b1dc967..5aa6bc6ef49 100644 --- a/static/scripts/bundled/chart.bundled.js +++ b/static/scripts/bundled/chart.bundled.js @@ -1,2 +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))},704: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(705);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)}})},705: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("")}})},706: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(707),f=i(c),h=e(708),d=i(h),p=e(709),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))},707: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))},708: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))},709: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))},710: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))},711: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(712),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))},712: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").attr("id","loading_indicator"),this.$el.append(this.loading_indicator);var t=r("").attr({id:"content_table",cellpadding:0});this.$el.append(t);var e=this.model.get_metadata("column_names"),n=r("").appendTo(t),i=r("").appendTo(n);if(e)i.append("");else for(var a=1;a<=this.model.get_metadata("columns");a++)i.append("");var o=this,s=this.model.get("first_data_chunk");s?this._renderChunk(s):r.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,n){var i=r("','',"<% } %>","","","","","",""].join(""))},templateRowFile:function(){return i.template(['','",'","",'','','','',"","",""].join(""))},templateRowDeletedFile:function(){return i.template(['','","",'","","","","","","",""].join(""))},templateRowDeletedFolder:function(){return i.template(['','","",'","","","","","","",""].join(""))}});e.default={FolderRowView:h}}).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(20),o=r(a),s=n(59),l=r(s),c=n(733),d=r(c),u=n(1),h=r(u),f=t.View.extend({el:"#libraries_element",events:{"click .sort-libraries-link":"sort_clicked"},defaults:{page_count:null,show_page:null,all_fetched:!1},initialize:function(t){this.options=h.default.defaults(this.options||{},t,this.defaults);var e=this;this.modal=null,this.collection=new l.default.Libraries,this.collection.url=this.collection.urlRoot+"?deleted=false",this.collection.fetch({success:function(){e.render()},error:function(t,e){void 0!==e.responseJSON?o.default.error(e.responseJSON.err_msg):o.default.error("An error occurred.")}})},render:function(t){this.options=h.default.extend(this.options,t),this.setElement("#libraries_element");var e=this.templateLibraryList(),n=null,r=null,a=function(t){return!0===t.get("public")};if(i(".tooltip").hide(),void 0!==t&&(r=void 0!==t.models?t.models:null),null!==this.collection&&null===r)this.sortLibraries(),n=Galaxy.libraries.preferences.get("with_deleted")?this.collection.models:this.collection.where({deleted:!1}),Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a));else if(null!==r){if(Galaxy.libraries.preferences.get("with_deleted"))n=r;else{var o=function(t){return!1===t.get("deleted")};n=h.default.filter(r,o)}Galaxy.libraries.preferences.get("without_restricted")&&(n=h.default.filter(n,a))}else n=[];(null===this.options.show_page||this.options.show_page<1)&&(this.options.show_page=1),this.options.total_libraries_count=n.length;var s=Galaxy.libraries.preferences.get("library_page_size")*(this.options.show_page-1);this.options.page_count=Math.ceil(this.options.total_libraries_count/Galaxy.libraries.preferences.get("library_page_size")),this.options.total_libraries_count>0&&sthis.options.total_libraries_count+Galaxy.libraries.preferences.get("library_page_size")&&(n=[]),this.$el.html(e({length:1,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options),this.renderRows(n)):(this.$el.html(e({length:0,order:Galaxy.libraries.preferences.get("sort_order"),search_term:Galaxy.libraries.libraryToolbarView.options.search_term})),Galaxy.libraries.libraryToolbarView.renderPaginator(this.options)),i('#center [data-toggle="tooltip"]').tooltip({trigger:"hover"}),i("#center").css("overflow","auto")},fetchDeleted:function(){if(this.options.all_fetched)this.render();else{var t=this;this.collection.url=this.collection.urlRoot+"?deleted=true",this.collection.fetch({remove:!1,success:function(){t.options.all_fetched=!0,t.render()},error:function(t,e){void 0!==e.responseJSON?o.default.error(e.responseJSON.err_msg):o.default.error("An error occurred.")}})}},renderRows:function(t){for(var e=0;e',"<% if(length === 0) { %>","<% if(search_term.length > 0) { %>","
    ","There are no libraries matching your search. Try different keyword.","
    ","<% } else{ %>","
    ","There are no libraries visible to you here. If you expected some to show up please consult the",' library security wikipage',' or visit the Galaxy support site.',"
    ","<% }%>","<% } else{ %>",'
    "+e.join("")+""+a+"").text(t),a=this.model.get_metadata("column_types");return void 0!==n?i.attr("colspan",n).addClass("stringalign"):a&&e"),a=this.model.get_metadata("columns");return this.row_count%2!=0&&n.addClass("dark_row"),e.length===a?i.each(e,function(t,e){n.append(this._renderCell(t,e))},this):e.length>a?(i.each(e.slice(0,a-1),function(t,e){n.append(this._renderCell(t,e))},this),n.append(this._renderCell(e.slice(a-1).join("\t"),a-1))):1===e.length?n.append(this._renderCell(t,0,a)):(i.each(e,function(t,e){n.append(this._renderCell(t,e))},this),i.each(i.range(a-e.length),function(){n.append(r(""))})),this.row_count++,n},_renderChunk:function(t){var e=this.$el.find("table");i.each(t.ck_data.split("\n"),function(t,n){""!==t&&e.append(this._renderRow(t))},this)}}),_=p.extend({initialize:function(t){p.prototype.initialize.call(this,t);var e=i.find(this.$el.parents(),function(t){return"auto"===r(t).css("overflow")});e||(e=window),this.scroll_elt=r(e)},scrolled_to_bottom:function(){return this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0}}),g=p.extend({initialize:function(t){p.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}}),m=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 n=t.model,i=n.get("metadata");if(n.get("file_ext")){if(this.file_ext=n.get("file_ext"),"bed"==this.file_ext){if(!(i.get("chromCol")&&i.get("startCol")&&i.get("endCol")))return void console.log("TabularButtonTrackster : Bed-file metadata incomplete.");this.col.chrom=i.get("chromCol")-1,this.col.start=i.get("startCol")-1,this.col.end=i.get("endCol")-1}if("vcf"==this.file_ext){var r=function(t,e){for(var n=0;n").append(i.$el)}),a.add({id:"libraries",title:(0,o.default)("Libraries"),$el:t("
    ").append(r.$el)}),Galaxy.modal.show({title:(0,o.default)("Select datasets for new tracks"),body:a.$el,closing_events:!0,buttons:{Cancel:function(){Galaxy.modal.hide()},Add:function(){var e=[];a.$("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"==a.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]];n(e)}),Galaxy.modal.hide()}}})},w=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(w.prototype,{load_pattern:function(t,e){var n=this.patterns,i=this.dummy_context,r=new Image;r.src=Galaxy.root+"static/images"+e,r.onload=function(){n[t]=i.createPattern(r,"repeat")}},get_pattern:function(t){return this.patterns[t]},new_canvas:function(){var e=t("")[0];return e.manager=this,e}});var x=i.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,n=this.attributes.key_ary,i=t.toString(),r=l.indexOf(n,function(t){return t.toString()===i});return-1!==r&&(e[i].stale?(n.splice(r,1),delete e[i]):this.move_key_to_end(t,r)),e[i]},set_elt:function(t,e){var n=this.attributes.obj_cache,i=this.attributes.key_ary,r=t.toString(),a=this.attributes.num_elements;if(!n[r]){if(i.length>=a){delete n[i.shift().toString()]}i.push(t)}return n[r]=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")u.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,n,i)},set_data:function(t,e){this.set_elt(t,e)},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(e,n,i,r,a){var o=this._mark_stale(e);if(!o||!this.get("data_mode_compatible")(o,n))return void console.log("ERROR: problem with getting more data: current data is not compatible");var s=e.get("start");a===this.DEEP_DATA_REQ?t.extend(r,{start_val:o.data.length+1}):a===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),c=this,d=this.load_data(l,n,i,r),u=t.Deferred();return this.set_data(e,u),t.when(d).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))),c.set_data(e,t),u.resolve(t)}),u},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,n,i,r){var a=this._mark_stale(t);return a?(r||(r={}),"bigwig"===a.dataset_type&&(r.num_samples=1e3*i),this.load_data(t,e,n,r)):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 n=this,i=!0,r=l.map(e.get("chroms_info").chrom_info,function(t){var e=n.get_elt(new S({chrom:t.chrom,start:0,end:t.len}));return e||(i=!1),e});if(i)return r;var a=t.Deferred();return t.getJSON(this.get("dataset").url(),{data_type:"genome_data"},function(t){n.add_data(t.data),a.resolve(t.data)}),a},subset_entry:function(t,e){var n={bigwig:function(t,e){return l.filter(t,function(t){return t[0]>=e.get("start")&&t[0]<=e.get("end")})},refseq:function(e,n){var i=n.get("start")-t.region.get("start");return t.data.slice(i,i+n.length())}},i=t.data;return!t.region.same(e)&&t.dataset_type in n&&(i=n[t.dataset_type](t.data,e)),{region:e,data:i,dataset_type:t.dataset_type}}}),M=k.extend({initialize:function(t){var e=new i.Model;e.urlRoot=t.data_url,this.set("dataset",e)},load_data:function(t,e,n,i){return t.length()<=1e5?k.prototype.load_data.call(this,t,e,n,i):{data:null,region:t}}}),C=i.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 S({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}}),S=i.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(":"),n=e[0],i=e[1].split("-");this.set({chrom:n,start:parseInt(i[0],10),end:parseInt(i[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 S({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"),n=t.get("chrom"),i=this.get("start"),r=t.get("start"),a=this.get("end"),o=t.get("end");return e&&n&&e!==n?S.overlap_results.DIF_CHROMS:ir?i>o?S.overlap_results.AFTER:a<=o?S.overlap_results.CONTAINED_BY:S.overlap_results.OVERLAP_END:a>=o?S.overlap_results.CONTAINS:S.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)===S.overlap_results.CONTAINS},overlaps:function(t){return 0===l.intersection([this.compute_overlap(t)],[S.overlap_results.DIF_CHROMS,S.overlap_results.BEFORE,S.overlap_results.AFTER]).length}},{overlap_results:{DIF_CHROMS:1e3,BEFORE:1001,CONTAINS:1002,OVERLAP_START:1003,OVERLAP_END:1004,CONTAINED_BY:1005,AFTER:1006}}),T=i.Collection.extend({model:S}),A=i.Model.extend({defaults:{region:null,note:""},initialize:function(t){this.set("region",new S(t.region))}}),j=i.Collection.extend({model:A}),E=i.Model.extend(y).extend({defaults:{mode:"Auto"},initialize:function(t){this.set("dataset",new d.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",p.default.ConfigSettingCollection.from_models_and_saved_values(e,t.prefs));var n=this.get("preloaded_data");n=n?n.data:[],this.set("data_manager",new k({dataset:this.get("dataset"),init_data:n}))}},{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")}}}}),O=i.Collection.extend({model:E}),L=i.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)}})}}),N=L.extend(y).extend({defaults:l.extend({},L.prototype.defaults,{dbkey:"",drawables:null,bookmarks:null,viewport:null}),initialize:function(t){this.set("drawables",new O(t.tracks));var e=[];this.set("config",p.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")}}}}),I=i.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:E,BrowserBookmark:A,BrowserBookmarkCollection:j,Cache:x,CanvasManager:w,Genome:C,GenomeDataManager:k,GenomeRegion:S,GenomeRegionCollection:T,GenomeVisualization:N,GenomeReferenceDataManager:M,TrackBrowserRouter:I,Visualization:L,select_datasets:b}}).call(e,n(0),n(2))},,,function(t,e,n){"use strict";(function(t,n){function i(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 r=function(t){return"promise"in t},a=t.Model.extend({defaults:{ajax_settings:{},interval:1e3,success_fn:function(t){return!0}},go:function(){var t=n.Deferred(),e=this,i=e.get("ajax_settings"),r=e.get("success_fn"),a=e.get("interval");return function e(){n.ajax(i).success(function(n){r(n)?t.resolve(n):setTimeout(e,a)})}(),t}}),o=function(t){t||(t="#ffffff"),"string"==typeof t&&(t=[t]);for(var e=0;e>16,r=(65280&n)>>8,a=255&n,d=f(i,r,a),p=!0,e=0;e>16,l=(65280&o)>>8,c=255&o,u=f(s,l,c),h=function(t,e,n,i,r,a){return Math.max(t,i)-Math.min(t,i)+(Math.max(e,r)-Math.min(e,r))+(Math.max(n,a)-Math.min(n,a))}(i,r,a,s,l,c),Math.abs(d-u)<40||h<200){p=!1;break}_++}while(!p&&_<=10);return"#"+(16777216+n).toString(16).substr(1,6)};e.default={commatize:i,is_deferred:r,ServerStateDeferred:a,get_random_color:o}}).call(e,n(2),n(0))},function(t,e,n){"use strict";var i=n(0),r=function(t){return t&&t.__esModule?t:{default:t}}(i),a=r.default;a.fn.make_text_editable=function(t){var e="num_cols"in t?t.num_cols:30,n="num_rows"in t?t.num_rows:4,i="use_textarea"in t&&t.use_textarea,r="on_finish"in t?t.on_finish:null,o="help_text"in t?t.help_text:null,s=a(this);return s.addClass("editable-text").click(function(o){if(!(a(this).children(":input").length>0)){s.removeClass("editable-text");var l,c,d=function(t){s.find(":input").remove(),""!==t?s.text(t):s.html("
    "),s.addClass("editable-text"),r&&r(t)},u="cur_text"in t?t.cur_text:s.text();i?(l=a("
    folder",'<%= _.escape(content_item.get("update_time")) %>',"","<% if(edit_mode) { %>",'",'","<% } else if (!edit_mode){%>",'",'','","","<% } %>","
    ','',"','',"",'/datasets/<%- content_item.id %>" class="library-dataset">','<%- content_item.get("name") %>',"","<%- content_item.get("message") %><%= _.escape(content_item.get("file_ext")) %><%= _.escape(content_item.get("file_size")) %><%= _.escape(content_item.get("update_time")) %>",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","",'<% if (content_item.get("is_unrestricted")) { %>','',"<% } %>",'<% if (content_item.get("is_private")) { %>','',"<% } %>",'<% if ((content_item.get("is_unrestricted") === false) && (content_item.get("is_private") === false)) { %>','',"<% } %>",'<% if (content_item.get("can_manage")) { %>','/datasets/<%- content_item.id %>/permissions">','","","<% } %>","
    ','',"','<%- content_item.get("name") %>',"",'<%- content_item.get("message") %>',"",'<%= _.escape(content_item.get("file_ext")) %>',"",'<%= _.escape(content_item.get("file_size")) %>',"",'<%= _.escape(content_item.get("update_time")) %>',"",'<% if ( content_item.get("state") !== "ok" ) { %>','<%= _.escape(content_item.get("state")) %>',"<% } %>","",'','","
    ','',"','<%- content_item.get("name") %>',"",'<%- content_item.get("description") %>',"","folder","",'<%= _.escape(content_item.get("update_time")) %>',"",'','","
    ',"",'",'',' ','',"",'',"","
    ','',"name","",'',"descriptionsynopsis
    ","<% }%>","
    "].join(""))}});e.default={LibraryListView:f}}).call(e,n(2),n(0))},function(t,e,n){"use strict";(function(t,i,r){Object.defineProperty(e,"__esModule",{value:!0});var a=n(20),o=function(t){return t&&t.__esModule?t:{default:t}}(a),s=t.View.extend({events:{"click .edit_library_btn":"edit_button_clicked","click .cancel_library_btn":"cancel_library_modification","click .save_library_btn":"save_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library"},edit_mode:!1,element_visibility_config:{upload_library_btn:!1,edit_library_btn:!1,permission_library_btn:!1,save_library_btn:!1,cancel_library_btn:!1,delete_library_btn:!1,undelete_library_btn:!1},initialize:function(t){this.render(t)},render:function(t){void 0===t&&(t=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),console.log(t)),this.prepareButtons(t);var e=this.templateRow();return this.setElement(e({library:t,button_config:this.element_visibility_config,edit_mode:this.edit_mode})),this.$el.show(),this},repaint:function(t){this.$el.find('[data-toggle="tooltip"]').tooltip("dispose");var e=this.$el;this.render(),e.replaceWith(this.$el),this.$el.find('[data-toggle="tooltip"]').tooltip({trigger:"hover"})},prepareButtons:function(t){var e=this.element_visibility_config;!1===this.edit_mode?(e.save_library_btn=!1,e.cancel_library_btn=!1,e.delete_library_btn=!1,!0===t.get("deleted")?(e.undelete_library_btn=!0,e.upload_library_btn=!1,e.edit_library_btn=!1,e.permission_library_btn=!1):!1===t.get("deleted")&&(e.save_library_btn=!1,e.cancel_library_btn=!1,e.undelete_library_btn=!1,!0===t.get("can_user_add")&&(e.upload_library_btn=!0),!0===t.get("can_user_modify")&&(e.edit_library_btn=!0),!0===t.get("can_user_manage")&&(e.permission_library_btn=!0))):!0===this.edit_mode&&(e.upload_library_btn=!1,e.edit_library_btn=!1,e.permission_library_btn=!1,e.save_library_btn=!0,e.cancel_library_btn=!0,e.delete_library_btn=!0,e.undelete_library_btn=!1),this.element_visibility_config=e},edit_button_clicked:function(){this.edit_mode=!0,this.repaint()},cancel_library_modification:function(){this.edit_mode=!1,this.repaint()},save_library_modification:function(){var t=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),e=!1,n=this.$el.find(".input_library_name").val();if(void 0!==n&&n!==t.get("name")){if(!(n.length>2))return void o.default.warning("Library name has to be at least 3 characters long.");t.set("name",n),e=!0}var i=this.$el.find(".input_library_description").val();void 0!==i&&i!==t.get("description")&&(t.set("description",i),e=!0);var r=this.$el.find(".input_library_synopsis").val();if(void 0!==r&&r!==t.get("synopsis")&&(t.set("synopsis",r),e=!0),e){var a=this;t.save(null,{patch:!0,success:function(t){a.edit_mode=!1,a.repaint(t),o.default.success("Changes to library saved.")},error:function(t,e){void 0!==e.responseJSON?o.default.error(e.responseJSON.err_msg):o.default.error("An error occured while attempting to update the library.")}})}else this.edit_mode=!1,this.repaint(t),o.default.info("Nothing has changed.")},delete_library:function(){var t=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),e=this;t.destroy({success:function(t){t.set("deleted",!0),Galaxy.libraries.libraryListView.collection.add(t),e.edit_mode=!1,!1===Galaxy.libraries.preferences.get("with_deleted")?(i(".tooltip").hide(),e.repaint(t),e.$el.remove()):!0===Galaxy.libraries.preferences.get("with_deleted")&&e.repaint(t),o.default.success("Library has been marked deleted.")},error:function(t,e){void 0!==e.responseJSON?o.default.error(e.responseJSON.err_msg):o.default.error("An error occured during deleting the library.")}})},undelete_library:function(){var t=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id")),e=this;t.url=t.urlRoot+t.id+"?undelete=true",t.destroy({success:function(t){t.set("deleted",!1),Galaxy.libraries.libraryListView.collection.add(t),e.edit_mode=!1,e.repaint(t),o.default.success("Library has been undeleted.")},error:function(t,e){void 0!==e.responseJSON?o.default.error(e.responseJSON.err_msg):o.default.error("An error occured while undeleting the library.")}})},templateRow:function(){return r.template(['" style="display:none;" data-id="<%- library.get("id") %>">',"<% if(!edit_mode) { %>",'<% if(library.get("deleted")) { %>','<%- library.get("name") %>',"<% } else { %>",'"><%- library.get("name") %>',"<% } %>",'<% if(library.get("description")) { %>','<% if( (library.get("description")).length> 80 ) { %>','"><%= _.escape(library.get("description")).substring(0, 80) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("description"))%>',"<% } %>","<% } else { %>","","<% } %>",'<% if(library.get("synopsis")) { %>','<% if( (library.get("synopsis")).length> 120 ) { %>','"><%= _.escape(library.get("synopsis")).substring(0, 120) + "..." %>',"<% } else { %>",'<%= _.escape(library.get("synopsis"))%>',"<% } %>","<% } else { %>","","<% } %>","<% } else if(edit_mode){ %>",'','','',"<% } %>",'','<% if( (library.get("public")) && (library.get("deleted") === false) ) { %>',' ',"<% }%>",'','\'" 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").toString();"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),i=n.val(),r=n.closest("td").next("td").find("label").text();e&&a(_.controller,i,_.singular);var o=_.iclass+"-"+i,l=["
    ","

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

    ","

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

    ","
    "].join("");s.insert(l)}),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+" + From b0dff4444085668cc3359b73d9d4d13b6da74cf6 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Thu, 27 Sep 2018 16:01:57 -0400 Subject: [PATCH 261/352] allow making all datasets within history public, when sharing this is a one-off operation so notable behavior is that if you create a new dataset in the shared history, it still won't be public when there are default permissions set on history --- client/galaxy/scripts/components/Sharing.vue | 29 +++++++++++++++++--- lib/galaxy/model/__init__.py | 4 +++ lib/galaxy/web/base/controller.py | 28 +++++++++++++++++++ 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/client/galaxy/scripts/components/Sharing.vue b/client/galaxy/scripts/components/Sharing.vue index 12a638cdf6d..67b2ea22abb 100644 --- a/client/galaxy/scripts/components/Sharing.vue +++ b/client/galaxy/scripts/components/Sharing.vue @@ -53,9 +53,17 @@

    This {{model_class_lc}} is currently restricted so that only you and the users listed below can access it. You can:

    Make {{model_class}} Accessible via Link + + Also make all objects within the {{model_class}} accessible. + +
    Generates a web link that you can share with other people so that they can view and import the {{model_class_lc}}.

    Make {{model_class}} Accessible and Publish + + Also make all objects within the {{model_class}} accessible. + +
    Makes the {{model_class_lc}} accessible via link (see above) and publishes the {{model_class_lc}} to Galaxy's Published {{plural_name}} section, where it is publicly listed and searchable.


    @@ -131,6 +139,9 @@ export default { }, slug_url() { return `${Galaxy.root}${this.model_class_lc}/set_slug_async/?id=${this.id}`; + }, + has_possible_members(){ + return ["history"].indexOf(this.model_class_lc) > -1;; } }, data() { @@ -147,7 +158,8 @@ export default { published: false, users_shared_with: [] }, - share_fields: ["email", { key: "id", label: "" }] + share_fields: ["email", { key: "id", label: "" }], + make_members_public: false, }; }, created: function() { @@ -180,11 +192,15 @@ export default { .catch(error => (this.err_msg = error.response.data.err_msg)); }, setSharing: function(action, user_id) { - axios - .post(`${Galaxy.root}api/${this.plural_name_lc}/${this.id}/sharing`, { + let data = { action: action, user_id: user_id - }) + } + if (this.has_possible_members){ + data.make_members_public = this.make_members_public; + } + axios + .post(`${Galaxy.root}api/${this.plural_name_lc}/${this.id}/sharing`, data) .then(response => { Object.assign(this.item, response.data); }) @@ -233,3 +249,8 @@ export default { } }; + diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 1750c72fef9..7183cbe76b8 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -1532,6 +1532,10 @@ class History(HasTags, Dictifiable, UsesAnnotations, HasName): return new_history + @property + def has_possible_members(self): + return True + @property def activatable_datasets(self): # This needs to be a list diff --git a/lib/galaxy/web/base/controller.py b/lib/galaxy/web/base/controller.py index 14bf58dda18..f604fcba4f7 100644 --- a/lib/galaxy/web/base/controller.py +++ b/lib/galaxy/web/base/controller.py @@ -1399,18 +1399,25 @@ class SharableMixin(object): @web.expose_api def sharing(self, trans, id, payload=None, **kwd): + skipped = False class_name = self.manager.model_class.__name__ item = self.get_object(trans, id, class_name, check_ownership=True, check_accessible=True, deleted=False) if payload and payload.get("action"): action = payload.get("action") if action == "make_accessible_via_link": self._make_item_accessible(trans.sa_session, item) + if item.has_possible_members and payload.get("make_members_public", False): + shared, skipped = self._make_members_public(trans, item) elif action == "make_accessible_and_publish": self._make_item_accessible(trans.sa_session, item) + if item.has_possible_members and payload.get("make_members_public", False): + shared, skipped = self._make_members_public(trans, item) item.published = True elif action == "publish": if item.importable: item.published = True + if item.has_possible_members and payload.get("make_members_public", False): + shared, skipped = self._make_members_public(trans, item) else: raise exceptions.MessageException("%s not importable." % class_name) elif action == "disable_link_access": @@ -1435,8 +1442,29 @@ class SharableMixin(object): item_dict = self.serializer.serialize_to_view(item, user=trans.user, trans=trans, default_view="sharing") item_dict["users_shared_with"] = [{"id": self.app.security.encode_id(a.user.id), "email": a.user.email} for a in item.users_shared_with] + if skipped: + item_dict["skipped"] = True return item_dict + def _make_members_public(self, trans, item): + """ Make the non-purged datasets in history public + Performs pemissions check. + """ + # TODO eventually we should handle more classes than just History + skipped = False + for hda in item.activatable_datasets: + dataset = hda.dataset + if not trans.app.security_agent.dataset_is_public(dataset): + if trans.app.security_agent.can_manage_dataset(trans.user.all_roles(), dataset): + try: + trans.app.security_agent.make_dataset_public(hda.dataset) + except Exception: + log.warning("Unable to make dataset with id: %s public.".format(dataset.id) + skipped = True + else: + skipped = True + return item, skipped + # -- Abstract methods. -- @web.expose From 70e325574cb82be62b1be8090e714ce44441686b Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 27 Sep 2018 22:20:00 +0200 Subject: [PATCH 262/352] Use with statement for all file uploads --- test/api/test_tools_upload.py | 54 +++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/test/api/test_tools_upload.py b/test/api/test_tools_upload.py index e0aaf909604..1e5d22b542e 100644 --- a/test/api/test_tools_upload.py +++ b/test/api/test_tools_upload.py @@ -82,13 +82,15 @@ class ToolsUploadTestCase(api.ApiTestCase): def test_fetch_compressed_with_explicit_type(self): fastqgz_path = TestDataResolver().get_filename("1.fastqsanger.gz") - details = self._upload_and_get_details(open(fastqgz_path, "rb"), api="fetch", ext="fastqsanger.gz") + with open(fastqgz_path, "rb") as fh: + details = self._upload_and_get_details(fh, api="fetch", ext="fastqsanger.gz") assert details["state"] == "ok" assert details["file_ext"] == "fastqsanger.gz" def test_fetch_compressed_default(self): fastqgz_path = TestDataResolver().get_filename("1.fastqsanger.gz") - details = self._upload_and_get_details(open(fastqgz_path, "rb"), api="fetch", assert_ok=False) + with open(fastqgz_path, "rb") as fh: + details = self._upload_and_get_details(fh, api="fetch", assert_ok=False) assert details["state"] == "ok" assert details["file_ext"] == "fastqsanger.gz", details @@ -96,31 +98,35 @@ class ToolsUploadTestCase(api.ApiTestCase): def test_fetch_compressed_auto_decompress_target(self, history_id): # TODO: this should definitely be fixed to allow auto decompression via that API. fastqgz_path = TestDataResolver().get_filename("1.fastqsanger.gz") - details = self._upload_and_get_details(open(fastqgz_path, "rb"), - api="fetch", - history_id=history_id, - assert_ok=False, - auto_decompress=True) + with open(fastqgz_path, "rb") as fh: + details = self._upload_and_get_details(fh, + api="fetch", + history_id=history_id, + assert_ok=False, + auto_decompress=True) assert details["state"] == "ok" assert details["file_ext"] == "fastqsanger.gz", details def test_upload_decompress_off_with_auto_by_default(self): # UNSTABLE_FLAG: This might default to a bed.gz datatype in the future. bedgz_path = TestDataResolver().get_filename("4.bed.gz") - details = self._upload_and_get_details(open(bedgz_path, "rb"), file_type="auto") + with open(bedgz_path, "rb") as fh: + details = self._upload_and_get_details(fh, file_type="auto") assert details["state"] == "ok" assert details["file_ext"] == "bed", details def test_upload_decompresses_if_uncompressed_type_selected(self): fastqgz_path = TestDataResolver().get_filename("1.fastqsanger.gz") - details = self._upload_and_get_details(open(fastqgz_path, "rb"), file_type="fastqsanger") + with open(fastqgz_path, "rb") as fh: + details = self._upload_and_get_details(fh, file_type="fastqsanger") assert details["state"] == "ok" assert details["file_ext"] == "fastqsanger", details assert details["file_size"] == 178, details def test_upload_decompress_off_if_compressed_type_selected(self): fastqgz_path = TestDataResolver().get_filename("1.fastqsanger.gz") - details = self._upload_and_get_details(open(fastqgz_path, "rb"), file_type="fastqsanger.gz") + with open(fastqgz_path, "rb") as fh: + details = self._upload_and_get_details(fh, file_type="fastqsanger.gz") assert details["state"] == "ok" assert details["file_ext"] == "fastqsanger.gz", details assert details["file_size"] == 161, details @@ -128,19 +134,21 @@ class ToolsUploadTestCase(api.ApiTestCase): def test_upload_auto_decompress_off(self): # UNSTABLE_FLAG: This might default to a bed.gz datatype in the future. bedgz_path = TestDataResolver().get_filename("4.bed.gz") - details = self._upload_and_get_details(open(bedgz_path, "rb"), file_type="auto", assert_ok=False, auto_decompress=False) + with open(bedgz_path, "rb") as fh: + details = self._upload_and_get_details(fh, file_type="auto", assert_ok=False, auto_decompress=False) assert details["file_ext"] == "binary", details @uses_test_history(require_new=True) def test_fetch_compressed_with_auto(self, history_id): # UNSTABLE_FLAG: This might default to a bed.gz datatype in the future. # TODO: this should definitely be fixed to allow auto decompression via that API. - fastqgz_path = TestDataResolver().get_filename("4.bed.gz") - details = self._upload_and_get_details(open(fastqgz_path, "rb"), - api="fetch", - history_id=history_id, - auto_decompress=True, - assert_ok=False) + bedgz_path = TestDataResolver().get_filename("4.bed.gz") + with open(bedgz_path, "rb") as fh: + details = self._upload_and_get_details(fh, + api="fetch", + history_id=history_id, + auto_decompress=True, + assert_ok=False) assert details["state"] == "ok" assert details["file_ext"] == "bed" @@ -243,16 +251,18 @@ class ToolsUploadTestCase(api.ApiTestCase): @uses_test_history(require_new=False) def test_fetch_bam_file(self, history_id): bam_path = TestDataResolver().get_filename("1.bam") - details = self._upload_and_get_details(open(bam_path, "rb"), - api="fetch", - history_id=history_id, - assert_ok=False) + with open(bam_path, "rb") as fh: + details = self._upload_and_get_details(fh, + api="fetch", + history_id=history_id, + assert_ok=False) assert details["state"] == "ok" assert details["file_ext"] == "bam", details def test_upload_bam_file(self): bam_path = TestDataResolver().get_filename("1.bam") - details = self._upload_and_get_details(open(bam_path, "rb"), file_type="auto") + with open(bam_path, "rb") as fh: + details = self._upload_and_get_details(fh, file_type="auto") assert details["state"] == "ok" assert details["file_ext"] == "bam", details From e4399021520440a8f58e33dbae161f031f8da9eb Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Thu, 27 Sep 2018 16:50:12 -0400 Subject: [PATCH 263/352] show warning to user if some of the items within were not published --- client/galaxy/scripts/components/Sharing.vue | 12 +++++++++--- lib/galaxy/web/base/controller.py | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/client/galaxy/scripts/components/Sharing.vue b/client/galaxy/scripts/components/Sharing.vue index 67b2ea22abb..8ff0d2cb934 100644 --- a/client/galaxy/scripts/components/Sharing.vue +++ b/client/galaxy/scripts/components/Sharing.vue @@ -1,7 +1,7 @@