From 77c0438bcaef526f599ab8eee405f7cd589d2c0d Mon Sep 17 00:00:00 2001 From: Ammar Ammar <43293485+ammar257ammar@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:08:54 +0100 Subject: [PATCH 01/16] Dynamic examples for view content field help text (#3697) Related to the first part of https://github.com/DIAGNijmegen/rse-roadmap/issues/362 --------- Co-authored-by: Anne Mickan --- app/grandchallenge/algorithms/forms.py | 13 +- app/grandchallenge/algorithms/models.py | 4 + app/grandchallenge/archives/forms.py | 13 +- app/grandchallenge/components/models.py | 8 + app/grandchallenge/evaluation/forms.py | 2 + app/grandchallenge/evaluation/models.py | 6 + app/grandchallenge/hanging_protocols/forms.py | 102 +++++ .../hanging_protocols/models.py | 35 +- app/grandchallenge/reader_studies/forms.py | 18 +- .../hanging_protocols_tests/test_forms.py | 376 +++++++++++++++++- 10 files changed, 529 insertions(+), 48 deletions(-) diff --git a/app/grandchallenge/algorithms/forms.py b/app/grandchallenge/algorithms/forms.py index a61df6de75..ffc9133226 100644 --- a/app/grandchallenge/algorithms/forms.py +++ b/app/grandchallenge/algorithms/forms.py @@ -83,6 +83,7 @@ ) from grandchallenge.evaluation.utils import get from grandchallenge.groups.forms import UserGroupForm +from grandchallenge.hanging_protocols.forms import ViewContentExampleMixin from grandchallenge.hanging_protocols.models import VIEW_CONTENT_SCHEMA from grandchallenge.reader_studies.models import ReaderStudy from grandchallenge.subdomains.utils import reverse, reverse_lazy @@ -241,6 +242,7 @@ class AlgorithmForm( AlgorithmIOValidationMixin, WorkstationUserFilterMixin, SaveFormInitMixin, + ViewContentExampleMixin, ModelForm, ): inputs = ModelMultipleChoiceField( @@ -378,17 +380,6 @@ def __init__(self, *args, **kwargs): MaxValueValidator(settings.ALGORITHMS_MAX_MEMORY_GB), ] - if self.instance: - interface_slugs = ( - (self.instance.inputs.all() | self.instance.outputs.all()) - .distinct() - .values_list("slug", flat=True) - ) - self.fields["view_content"].help_text += ( - " The following interfaces are used in your algorithm: " - f"{oxford_comma(interface_slugs)}." - ) - class UserAlgorithmsForPhaseMixin: def __init__(self, *args, user, phase, **kwargs): diff --git a/app/grandchallenge/algorithms/models.py b/app/grandchallenge/algorithms/models.py index 1e03a57f7a..458d92569a 100644 --- a/app/grandchallenge/algorithms/models.py +++ b/app/grandchallenge/algorithms/models.py @@ -443,6 +443,10 @@ def add_user(self, user): def remove_user(self, user): return user.groups.remove(self.users_group) + @cached_property + def interfaces(self): + return (self.inputs.all() | self.outputs.all()).distinct() + @cached_property def user_statistics(self): return ( diff --git a/app/grandchallenge/archives/forms.py b/app/grandchallenge/archives/forms.py index 7b5437ebcb..59212637a8 100644 --- a/app/grandchallenge/archives/forms.py +++ b/app/grandchallenge/archives/forms.py @@ -38,6 +38,7 @@ MarkdownEditorInlineWidget, ) from grandchallenge.groups.forms import UserGroupForm +from grandchallenge.hanging_protocols.forms import ViewContentExampleMixin from grandchallenge.hanging_protocols.models import VIEW_CONTENT_SCHEMA from grandchallenge.reader_studies.models import ReaderStudy from grandchallenge.subdomains.utils import reverse_lazy @@ -46,6 +47,7 @@ class ArchiveForm( WorkstationUserFilterMixin, SaveFormInitMixin, + ViewContentExampleMixin, ModelForm, ): def __init__(self, *args, **kwargs): @@ -67,17 +69,6 @@ def __init__(self, *args, **kwargs): .filter(has_active_image=True) .distinct() ) - if self.instance: - interface_slugs = ( - self.instance.items.exclude(values__isnull=True) - .values_list("values__interface__slug", flat=True) - .order_by() - .distinct() - ) - self.fields["view_content"].help_text += ( - " The following interfaces are used in your archive: " - f"{', '.join(interface_slugs)}." - ) class Meta: model = Archive diff --git a/app/grandchallenge/components/models.py b/app/grandchallenge/components/models.py index 3d8203f428..41743fa4df 100644 --- a/app/grandchallenge/components/models.py +++ b/app/grandchallenge/components/models.py @@ -2578,6 +2578,14 @@ def values_for_interfaces(self): } return values_for_interfaces + @cached_property + def interfaces(self): + return ComponentInterface.objects.filter( + pk__in=self.civ_sets_related_manager.exclude( + values__isnull=True + ).values_list("values__interface__pk", flat=True) + ).distinct() + class Tarball(UUIDModel): ImportStatusChoices = ImportStatusChoices diff --git a/app/grandchallenge/evaluation/forms.py b/app/grandchallenge/evaluation/forms.py index 29664ffbb5..2c7136e941 100644 --- a/app/grandchallenge/evaluation/forms.py +++ b/app/grandchallenge/evaluation/forms.py @@ -56,6 +56,7 @@ Submission, ) from grandchallenge.evaluation.utils import SubmissionKindChoices +from grandchallenge.hanging_protocols.forms import ViewContentExampleMixin from grandchallenge.hanging_protocols.models import VIEW_CONTENT_SCHEMA from grandchallenge.subdomains.utils import reverse, reverse_lazy from grandchallenge.uploads.models import UserUpload @@ -150,6 +151,7 @@ class PhaseUpdateForm( PhaseTitleMixin, WorkstationUserFilterMixin, SaveFormInitMixin, + ViewContentExampleMixin, forms.ModelForm, ): def __init__(self, *args, **kwargs): diff --git a/app/grandchallenge/evaluation/models.py b/app/grandchallenge/evaluation/models.py index dbbdb2b38f..4b896a6999 100644 --- a/app/grandchallenge/evaluation/models.py +++ b/app/grandchallenge/evaluation/models.py @@ -868,6 +868,12 @@ def set_default_interfaces(self): [ComponentInterface.objects.get(slug="metrics-json-file")] ) + @cached_property + def interfaces(self): + return ( + self.algorithm_inputs.all() | self.algorithm_outputs.all() + ).distinct() + def assign_permissions(self): assign_perm("view_phase", self.challenge.admins_group, self) assign_perm("change_phase", self.challenge.admins_group, self) diff --git a/app/grandchallenge/hanging_protocols/forms.py b/app/grandchallenge/hanging_protocols/forms.py index 96655703c6..157a126e5f 100644 --- a/app/grandchallenge/hanging_protocols/forms.py +++ b/app/grandchallenge/hanging_protocols/forms.py @@ -1,13 +1,26 @@ +import json + from crispy_forms.helper import FormHelper from crispy_forms.layout import ButtonHolder, Div, Layout, Submit from django import forms +from django.core.exceptions import ValidationError +from django.utils.text import format_lazy +from grandchallenge.components.models import ( + InterfaceKind, + InterfaceKindChoices, +) from grandchallenge.core.forms import SaveFormInitMixin +from grandchallenge.core.templatetags.remove_whitespace import oxford_comma +from grandchallenge.core.validators import JSONValidator from grandchallenge.core.widgets import JSONEditorWidget from grandchallenge.hanging_protocols.models import ( HANGING_PROTOCOL_SCHEMA, + VIEW_CONTENT_SCHEMA, HangingProtocol, + ViewportNames, ) +from grandchallenge.subdomains.utils import reverse class HangingProtocolForm(SaveFormInitMixin, forms.ModelForm): @@ -116,3 +129,92 @@ def _validate_slice_plane_indicator(self, *, viewport, viewport_names): error=f"Viewport {viewport['viewport_name']} has a slice_plane_indicator that is the same as the viewport_name.", field="json", ) + + +class ViewContentExampleMixin: + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + if self.instance: + interface_slugs = [ + interface.slug for interface in self.instance.interfaces + ] + + if len(interface_slugs) > 0: + self.fields[ + "view_content" + ].help_text += f"The following interfaces are used in your {self.instance._meta.verbose_name}: {oxford_comma(interface_slugs)}. " + + view_content_example = self.generate_view_content_example() + + if view_content_example: + self.fields[ + "view_content" + ].help_text += f"Example usage: {view_content_example}. " + else: + self.fields[ + "view_content" + ].help_text += "No interfaces of type image, chart, pdf, mp4, thumbnail_jpg or thumbnail_png are used. At least one interface of those types is needed to configure the viewer. " + + self.fields["view_content"].help_text += format_lazy( + 'Refer to the documentation for more information', + reverse("documentation:detail", args=["viewer-content"]), + ) + + def generate_view_content_example(self): + images = [ + interface.slug + for interface in self.instance.interfaces + if interface.kind == InterfaceKindChoices.IMAGE + ] + mandatory_isolation_interfaces = [ + interface.slug + for interface in self.instance.interfaces + if interface.kind + in InterfaceKind.interface_type_mandatory_isolation() + ] + + if not images and not mandatory_isolation_interfaces: + return None + + overlays = [ + interface.slug + for interface in self.instance.interfaces + if interface.kind + not in ( + *InterfaceKind.interface_type_undisplayable(), + *InterfaceKind.interface_type_mandatory_isolation(), + InterfaceKindChoices.IMAGE, + ) + ] + + if images: + overlays_per_image = len(overlays) // len(images) + remaining_overlays = len(overlays) % len(images) + + view_content_example = {} + + for port in ViewportNames.values: + if mandatory_isolation_interfaces: + view_content_example[port] = [ + mandatory_isolation_interfaces.pop(0) + ] + elif images: + view_content_example[port] = [images.pop(0)] + for _ in range(overlays_per_image): + view_content_example[port].append(overlays.pop(0)) + if remaining_overlays > 0: + view_content_example[port].append(overlays.pop(0)) + remaining_overlays -= 1 + + try: + JSONValidator(schema=VIEW_CONTENT_SCHEMA)( + value=view_content_example + ) + self.instance.clean_view_content( + view_content=view_content_example, + hanging_protocol=self.instance.hanging_protocol, + ) + except ValidationError as error: + raise RuntimeError("view_content example is not valid.") from error + + return json.dumps(view_content_example) diff --git a/app/grandchallenge/hanging_protocols/models.py b/app/grandchallenge/hanging_protocols/models.py index 36d810f521..13286887dd 100644 --- a/app/grandchallenge/hanging_protocols/models.py +++ b/app/grandchallenge/hanging_protocols/models.py @@ -306,7 +306,9 @@ class HangingProtocolMixin(models.Model): view_content = models.JSONField( blank=True, default=dict, - validators=[JSONValidator(schema=VIEW_CONTENT_SCHEMA)], + validators=[ + JSONValidator(schema=VIEW_CONTENT_SCHEMA), + ], ) hanging_protocol = models.ForeignKey( "hanging_protocols.HangingProtocol", @@ -326,24 +328,28 @@ class HangingProtocolMixin(models.Model): def clean(self): super().clean() - self.check_consistent_viewports() - self.check_all_interfaces_in_view_content_exist() + self.clean_view_content( + view_content=self.view_content, + hanging_protocol=self.hanging_protocol, + ) - def check_consistent_viewports(self): - if self.view_content and self.hanging_protocol: - if set(self.view_content.keys()) != { - x["viewport_name"] for x in self.hanging_protocol.json + @staticmethod + def check_consistent_viewports(*, view_content, hanging_protocol): + if view_content and hanging_protocol: + if set(view_content.keys()) != { + x["viewport_name"] for x in hanging_protocol.json }: raise ValidationError( "Image ports in view_content do not match " "those in the selected hanging protocol." ) - def check_all_interfaces_in_view_content_exist(self): - if not hasattr(self.view_content, "items"): + @staticmethod + def check_all_interfaces_in_view_content_exist(*, view_content): + if not hasattr(view_content, "items"): raise ValidationError("View content is invalid") - for viewport, slugs in self.view_content.items(): + for viewport, slugs in view_content.items(): viewport_interfaces = ComponentInterface.objects.filter( slug__in=slugs ) @@ -395,5 +401,14 @@ def check_all_interfaces_in_view_content_exist(self): f"{', '.join(i.slug for i in undisplayable_interfaces)}" ) + @staticmethod + def clean_view_content(*, view_content, hanging_protocol): + HangingProtocolMixin.check_consistent_viewports( + view_content=view_content, hanging_protocol=hanging_protocol + ) + HangingProtocolMixin.check_all_interfaces_in_view_content_exist( + view_content=view_content + ) + class Meta: abstract = True diff --git a/app/grandchallenge/reader_studies/forms.py b/app/grandchallenge/reader_studies/forms.py index 49a8f39d14..6d81921ca5 100644 --- a/app/grandchallenge/reader_studies/forms.py +++ b/app/grandchallenge/reader_studies/forms.py @@ -56,6 +56,7 @@ MarkdownEditorInlineWidget, ) from grandchallenge.groups.forms import UserGroupForm +from grandchallenge.hanging_protocols.forms import ViewContentExampleMixin from grandchallenge.hanging_protocols.models import VIEW_CONTENT_SCHEMA from grandchallenge.reader_studies.models import ( ANSWER_TYPE_TO_INTERACTIVE_ALGORITHM_CHOICES, @@ -189,7 +190,9 @@ def clean(self): ) -class ReaderStudyUpdateForm(ReaderStudyCreateForm, ModelForm): +class ReaderStudyUpdateForm( + ReaderStudyCreateForm, ViewContentExampleMixin, ModelForm +): class Meta(ReaderStudyCreateForm.Meta): fields = ( "title", @@ -254,19 +257,6 @@ class Meta(ReaderStudyCreateForm.Meta): ), } - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - interface_slugs = ( - self.instance.display_sets.exclude(values__isnull=True) - .values_list("values__interface__slug", flat=True) - .order_by() - .distinct() - ) - self.fields["view_content"].help_text += ( - " The following interfaces are used in your reader study: " - f"{', '.join(interface_slugs)}." - ) - class ReaderStudyCopyForm(Form): title = CharField(required=True) diff --git a/app/tests/hanging_protocols_tests/test_forms.py b/app/tests/hanging_protocols_tests/test_forms.py index 96976a7939..dae3059b0d 100644 --- a/app/tests/hanging_protocols_tests/test_forms.py +++ b/app/tests/hanging_protocols_tests/test_forms.py @@ -1,14 +1,31 @@ +import json + import pytest from django.forms import ModelForm +from django.utils.text import format_lazy from guardian.shortcuts import assign_perm -from grandchallenge.components.models import InterfaceKindChoices +from grandchallenge.algorithms.forms import AlgorithmForm +from grandchallenge.archives.forms import ArchiveForm +from grandchallenge.components.models import ( + InterfaceKind, + InterfaceKindChoices, +) +from grandchallenge.evaluation.forms import PhaseUpdateForm from grandchallenge.hanging_protocols.forms import HangingProtocolForm from grandchallenge.hanging_protocols.models import HangingProtocol -from tests.components_tests.factories import ComponentInterfaceFactory +from grandchallenge.reader_studies.forms import ReaderStudyUpdateForm +from tests.algorithms_tests.factories import AlgorithmFactory +from tests.archives_tests.factories import ArchiveItemFactory +from tests.components_tests.factories import ( + ComponentInterfaceFactory, + ComponentInterfaceValueFactory, +) +from tests.evaluation_tests.factories import PhaseFactory from tests.factories import UserFactory from tests.hanging_protocols_tests.factories import HangingProtocolFactory from tests.hanging_protocols_tests.test_models import HangingProtocolTestModel +from tests.reader_studies_tests.factories import DisplaySetFactory from tests.utils import get_view_for_user @@ -294,3 +311,358 @@ def test_hanging_protocol_clientside(): } ) assert form.is_valid() + + +def make_ci_list( + *, + number_of_images, + number_of_overlays, + number_of_isolated_interfaces, + number_of_undisplayable_interfaces, +): + ci_list = [] + + for i in range(number_of_isolated_interfaces): + ci = ComponentInterfaceFactory( + kind=InterfaceKindChoices.CHART, + title=f"test-ci-isolated-{i}", + ) + ci_list.append(ci) + + for i in range(number_of_images): + ci = ComponentInterfaceFactory( + kind=InterfaceKindChoices.IMAGE, + title=f"test-ci-image-{i}", + ) + ci_list.append(ci) + + for i in range(number_of_overlays): + ci = ComponentInterfaceFactory( + kind=InterfaceKindChoices.SEGMENTATION, + title=f"test-ci-overlay-{i}", + ) + ci_list.append(ci) + + for i in range(number_of_undisplayable_interfaces): + ci = ComponentInterfaceFactory( + kind=InterfaceKind.InterfaceKindChoices.ZIP, + title=f"test-ci-undisplayable-{i}", + ) + ci_list.append(ci) + + return ci_list + + +@pytest.mark.parametrize( + "number_of_images,number_of_overlays,number_of_isolated_interfaces,number_of_undisplayable_interfaces,expected_help_text", + ( + ( + 0, + 0, + 0, + 0, + ( + "No interfaces of type image, chart, pdf, mp4, thumbnail_jpg or thumbnail_png are used. At least one interface of those types is needed to configure the viewer. " + 'Refer to the documentation for more information' + ), + ), + ( + 0, + 1, + 0, + 1, + ( + "The following interfaces are used in your {}: test-ci-overlay-0 and test-ci-undisplayable-0. " + "No interfaces of type image, chart, pdf, mp4, thumbnail_jpg or thumbnail_png are used. At least one interface of those types is needed to configure the viewer. " + 'Refer to the documentation for more information' + ), + ), + ( + 1, + 1, + 1, + 1, + ( + "The following interfaces are used in your {}: test-ci-isolated-0, test-ci-image-0, test-ci-overlay-0, and test-ci-undisplayable-0. " + 'Example usage: {{"main": ["test-ci-isolated-0"], "secondary": ["test-ci-image-0", "test-ci-overlay-0"]}}. ' + 'Refer to the documentation for more information' + ), + ), + ), +) +@pytest.mark.parametrize( + "object_factory,form_class", + ( + (ArchiveItemFactory, ArchiveForm), + (DisplaySetFactory, ReaderStudyUpdateForm), + ), +) +@pytest.mark.django_db +def test_archive_and_reader_study_forms_view_content_help_text( + number_of_images, + number_of_overlays, + number_of_isolated_interfaces, + number_of_undisplayable_interfaces, + expected_help_text, + object_factory, + form_class, +): + ci_list = make_ci_list( + number_of_images=number_of_images, + number_of_overlays=number_of_overlays, + number_of_isolated_interfaces=number_of_isolated_interfaces, + number_of_undisplayable_interfaces=number_of_undisplayable_interfaces, + ) + civ_list = [ComponentInterfaceValueFactory(interface=ci) for ci in ci_list] + + object = object_factory() + object.values.set(civ_list) + + form = form_class(user=UserFactory(), instance=object.base_object) + + assert form.fields["view_content"].help_text == format_lazy( + expected_help_text, object.base_object._meta.verbose_name + ) + + +@pytest.mark.parametrize( + "number_of_images,number_of_overlays,number_of_isolated_interfaces,number_of_undisplayable_interfaces,expected_help_text", + ( + ( + 0, + 0, + 0, + 0, + ( + "No interfaces of type image, chart, pdf, mp4, thumbnail_jpg or thumbnail_png are used. At least one interface of those types is needed to configure the viewer. " + 'Refer to the documentation for more information' + ), + ), + ( + 0, + 1, + 0, + 1, + ( + "The following interfaces are used in your algorithm: test-ci-overlay-0 and test-ci-undisplayable-0. " + "No interfaces of type image, chart, pdf, mp4, thumbnail_jpg or thumbnail_png are used. At least one interface of those types is needed to configure the viewer. " + 'Refer to the documentation for more information' + ), + ), + ( + 1, + 1, + 1, + 1, + ( + "The following interfaces are used in your algorithm: test-ci-isolated-0, test-ci-image-0, test-ci-overlay-0, and test-ci-undisplayable-0. " + 'Example usage: {"main": ["test-ci-isolated-0"], "secondary": ["test-ci-image-0", "test-ci-overlay-0"]}. ' + 'Refer to the documentation for more information' + ), + ), + ), +) +@pytest.mark.django_db +def test_algorithm_form_view_content_help_text( + number_of_images, + number_of_overlays, + number_of_isolated_interfaces, + number_of_undisplayable_interfaces, + expected_help_text, +): + ci_list = make_ci_list( + number_of_images=number_of_images, + number_of_overlays=number_of_overlays, + number_of_isolated_interfaces=number_of_isolated_interfaces, + number_of_undisplayable_interfaces=number_of_undisplayable_interfaces, + ) + algorithm = AlgorithmFactory() + algorithm.inputs.set(ci_list) + + form = AlgorithmForm(user=UserFactory(), instance=algorithm) + + assert form.fields["view_content"].help_text == expected_help_text + + +@pytest.mark.parametrize( + "number_of_images,number_of_overlays,number_of_isolated_interfaces,number_of_undisplayable_interfaces,expected_help_text", + ( + ( + 0, + 0, + 0, + 0, + ( + "No interfaces of type image, chart, pdf, mp4, thumbnail_jpg or thumbnail_png are used. At least one interface of those types is needed to configure the viewer. " + 'Refer to the documentation for more information' + ), + ), + ( + 0, + 1, + 0, + 1, + ( + "The following interfaces are used in your phase: test-ci-overlay-0 and test-ci-undisplayable-0. " + "No interfaces of type image, chart, pdf, mp4, thumbnail_jpg or thumbnail_png are used. At least one interface of those types is needed to configure the viewer. " + 'Refer to the documentation for more information' + ), + ), + ( + 1, + 1, + 1, + 1, + ( + "The following interfaces are used in your phase: test-ci-isolated-0, test-ci-image-0, test-ci-overlay-0, and test-ci-undisplayable-0. " + 'Example usage: {"main": ["test-ci-isolated-0"], "secondary": ["test-ci-image-0", "test-ci-overlay-0"]}. ' + 'Refer to the documentation for more information' + ), + ), + ), +) +@pytest.mark.django_db +def test_phase_update_form_view_content_help_text( + number_of_images, + number_of_overlays, + number_of_isolated_interfaces, + number_of_undisplayable_interfaces, + expected_help_text, +): + ci_list = make_ci_list( + number_of_images=number_of_images, + number_of_overlays=number_of_overlays, + number_of_isolated_interfaces=number_of_isolated_interfaces, + number_of_undisplayable_interfaces=number_of_undisplayable_interfaces, + ) + phase = PhaseFactory() + phase.algorithm_inputs.set(ci_list) + phase.algorithm_outputs.set([]) + + form = PhaseUpdateForm( + user=UserFactory(), instance=phase, **{"challenge": phase.challenge} + ) + + assert form.fields["view_content"].help_text == expected_help_text + + +@pytest.mark.django_db +@pytest.mark.parametrize( + "number_of_images,number_of_overlays,number_of_isolated_interfaces,expected_example_json", + ( + ( + 0, + 0, + 0, + None, + ), + ( + 1, + 0, + 0, + {"main": ["test-ci-image-0"]}, + ), + ( + 0, + 1, + 0, + None, + ), + ( + 5, + 5, + 0, + { + "main": ["test-ci-image-0", "test-ci-overlay-0"], + "secondary": ["test-ci-image-1", "test-ci-overlay-1"], + "tertiary": ["test-ci-image-2", "test-ci-overlay-2"], + "quaternary": ["test-ci-image-3", "test-ci-overlay-3"], + "quinary": ["test-ci-image-4", "test-ci-overlay-4"], + }, + ), + ( + 6, + 3, + 1, + { + "main": ["test-ci-isolated-0"], + "secondary": ["test-ci-image-0", "test-ci-overlay-0"], + "tertiary": ["test-ci-image-1", "test-ci-overlay-1"], + "quaternary": ["test-ci-image-2", "test-ci-overlay-2"], + "quinary": ["test-ci-image-3"], + "senary": ["test-ci-image-4"], + "septenary": ["test-ci-image-5"], + }, + ), + ( + 3, + 6, + 1, + { + "main": ["test-ci-isolated-0"], + "secondary": [ + "test-ci-image-0", + "test-ci-overlay-0", + "test-ci-overlay-1", + ], + "tertiary": [ + "test-ci-image-1", + "test-ci-overlay-2", + "test-ci-overlay-3", + ], + "quaternary": [ + "test-ci-image-2", + "test-ci-overlay-4", + "test-ci-overlay-5", + ], + }, + ), + ( + 3, + 8, + 1, + { + "main": ["test-ci-isolated-0"], + "secondary": [ + "test-ci-image-0", + "test-ci-overlay-0", + "test-ci-overlay-1", + "test-ci-overlay-2", + ], + "tertiary": [ + "test-ci-image-1", + "test-ci-overlay-3", + "test-ci-overlay-4", + "test-ci-overlay-5", + ], + "quaternary": [ + "test-ci-image-2", + "test-ci-overlay-6", + "test-ci-overlay-7", + ], + }, + ), + ), +) +def test_generate_view_content_example( + number_of_images, + number_of_overlays, + number_of_isolated_interfaces, + expected_example_json, +): + ci_list = make_ci_list( + number_of_images=number_of_images, + number_of_overlays=number_of_overlays, + number_of_isolated_interfaces=number_of_isolated_interfaces, + number_of_undisplayable_interfaces=0, + ) + base_obj = AlgorithmFactory() + base_obj.inputs.set(ci_list) + form = AlgorithmForm(user=UserFactory(), instance=base_obj) + + view_content_example = form.generate_view_content_example() + view_content_example_json = ( + json.loads(view_content_example) if view_content_example else None + ) + + assert view_content_example_json == expected_example_json From b9057409520d7f43efaf9c7178e326d780522c29 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:15:51 +0000 Subject: [PATCH 02/16] Update dependencies (#3718) Automated dependency update, see changes to `poetry.lock`. Co-authored-by: jmsmkn --- poetry.lock | 1067 ++++++++++++++++++++++++++------------------------- 1 file changed, 551 insertions(+), 516 deletions(-) diff --git a/poetry.lock b/poetry.lock index cd02ff9ec2..7dce639ceb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -13,87 +13,87 @@ files = [ [[package]] name = "aiohttp" -version = "3.11.3" +version = "3.11.7" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.9" files = [ - {file = "aiohttp-3.11.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:acb0eb91b7a9ce435728d009388dcbf82d3e394b00596c3eda2402644ce42c33"}, - {file = "aiohttp-3.11.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3cd3d29e2e0b9726629031d73b08027048deaa856cefda343f3db34da9d6fb04"}, - {file = "aiohttp-3.11.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:63df79e626ad76d3170f2cc87727ebe360c4c56c3dd01d80e1c22fbea18b3368"}, - {file = "aiohttp-3.11.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ad9cdb478e835d1809d7a86b16c88fb430d6e8f06940e0616586258ec1c4eed"}, - {file = "aiohttp-3.11.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cc0f81fcd9690371d9c89b6675cd12da6abf8bb841cda5b78379fc72ba95cf55"}, - {file = "aiohttp-3.11.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:18e391196b233b1e9daef38d14dccbfc3a62934fc1a5cbc711fbf0aaaf12afb2"}, - {file = "aiohttp-3.11.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cb3753b764b6122491db64f5c99c0acf481f6ac54a3062f9041e6e9099337fe3"}, - {file = "aiohttp-3.11.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a2fed9db26ff62d0926169c2d9dba5f1029f75559728dd0ae80e7085e16e056"}, - {file = "aiohttp-3.11.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:22678102ad8e27536bb5338daa6a8fef268a27498d45793f66c5a90836278376"}, - {file = "aiohttp-3.11.3-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:ba8bd24b1a08e22baf35e7f1deadee409118cdf086ade14d3a7c0c7cfebc828d"}, - {file = "aiohttp-3.11.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:7d16a132673163bec662f77e056e2d7f5c9472560e4346f6847860eabc2e75b3"}, - {file = "aiohttp-3.11.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:7b6d71c6eed09fb6c893ca40c49487f46fe440f8a5697e9942715d1a28433b19"}, - {file = "aiohttp-3.11.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:44d15ef64678e9318969a707a6d444621988980a60e917cc8a7dab1dd763bd7c"}, - {file = "aiohttp-3.11.3-cp310-cp310-win32.whl", hash = "sha256:fe842fe3504b3d76be4af8ae5865389eae5cd4d0a7afd631e8d73971628ab525"}, - {file = "aiohttp-3.11.3-cp310-cp310-win_amd64.whl", hash = "sha256:158e47fb9bd16c964762c1661be934d5781423ac7b92d57ccba3cdaef9aa7c16"}, - {file = "aiohttp-3.11.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a5b836e843e702db8ebeacc6dd8a5137a578dc23b4367e63dc11231fcefe7088"}, - {file = "aiohttp-3.11.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc53bddadf5fd0a03c6520855cc4e4050ae737f7697d799bac81a0ef8a85f865"}, - {file = "aiohttp-3.11.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:59912e8f1dc74ffe7cdbf84199131cf60b940ecbd1cd672e88090321875b2ea2"}, - {file = "aiohttp-3.11.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:62aaf76d9077397e34a7c25028ad570d05d11c2f5ec9e42262326d22395cda7d"}, - {file = "aiohttp-3.11.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b10b85ae6e6d7d4e57ef1fd1a3fbfa92bc14854f172957ecf12688f965c7efce"}, - {file = "aiohttp-3.11.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9ee52b10fa0ee52ad9741406e18d2d1fce9bc4622566066239d35aaa68323427"}, - {file = "aiohttp-3.11.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0dcb32dc5d83372e1407675879121e2aabeaa6c633283a8837fcdb363bc5d49"}, - {file = "aiohttp-3.11.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:86b3ece9d0c1a2d881b61fa6f4c2b72c5af7e74dbffb73a61fd604be5f51c2e2"}, - {file = "aiohttp-3.11.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e15fd83a3d252039d35849ccb8f9ee6a774124a0ae49934c8deb472a7b95e5a8"}, - {file = "aiohttp-3.11.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8998fd80aa1e10b0da45c1edacdb7e7433d4fe9b28fc0d28d69370d733d13bc5"}, - {file = "aiohttp-3.11.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c3d721538094108db57dde5c3b3af0e157c0a1db6c9f3f55c84f2736f697481c"}, - {file = "aiohttp-3.11.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:95635838422669e3a0220c74fe9678c838e2cb0dae91bcabfdd3557f11dfe16a"}, - {file = "aiohttp-3.11.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8a79e638ff960068b5a891fe67672d94c9a906fa01043db88789349090333983"}, - {file = "aiohttp-3.11.3-cp311-cp311-win32.whl", hash = "sha256:39554727dc67c170ed84ca4d85937c4955a08dba65d887e48f075b0e3fb746f2"}, - {file = "aiohttp-3.11.3-cp311-cp311-win_amd64.whl", hash = "sha256:16225e7bb046880631e58d3e2ecba19c020be8e873d517ee42a1be8a126b70f0"}, - {file = "aiohttp-3.11.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0665d51a9580a7df74a281cb3730526865db299742fce115a2ce3033817f7fca"}, - {file = "aiohttp-3.11.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:8e9735209839fbcf81b0b1bfe16d5bd0d5497a5077c2c601f3a347ad34a1436e"}, - {file = "aiohttp-3.11.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c06fed93bb81f0fe5c2b1a6a131310449e0dfdd0c89ede4b9400e0b5270680e3"}, - {file = "aiohttp-3.11.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9e7bd606a02bcdb8764a3a6d1493131515a146e44f6e8788f1472445b7ff5280"}, - {file = "aiohttp-3.11.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c28332611f7aebd69f0fc183b41b21af2422846ac3dbfa7888ec40962cb8b09"}, - {file = "aiohttp-3.11.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ce5dd859f71f95235d473bf948a416a981cb37c3247f10a6ca7e630e7ea28e37"}, - {file = "aiohttp-3.11.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:969ee33c80399ab6e2627b576073456825234e1384d672dcced9f52e918091b1"}, - {file = "aiohttp-3.11.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:270fbf3a5df1ae5fa1f18d26111c0b4cd8c04d84c79b1fe513139a635b5c5285"}, - {file = "aiohttp-3.11.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:791d4e2328f06a0373db3ed2b4d353c8f2f3ef7521cacf6e66278033ed2fd192"}, - {file = "aiohttp-3.11.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:8eb02a8a783cc56aa1445df1ccffbf187b66fda103ece7a13e19b3ae33e093f7"}, - {file = "aiohttp-3.11.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:728bb2b31652c718b03bf9936b4008af0d26a31b8cc632c57450298dcfb82e08"}, - {file = "aiohttp-3.11.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:10d7b73c974460d198df5cab9f5ebfd40d4b425a52affe05deb9c3ae78664cf5"}, - {file = "aiohttp-3.11.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:cf1f571854b65229b7497de399762a4560894e3f077dd645ab5fdc001eb527ac"}, - {file = "aiohttp-3.11.3-cp312-cp312-win32.whl", hash = "sha256:29828b71745c5562ab73f1513d558e5afca980d83fab42cf87015a50e6076967"}, - {file = "aiohttp-3.11.3-cp312-cp312-win_amd64.whl", hash = "sha256:c1fce3416981cd97a17b0bccebb225c31f82f1e3bbabf04a78547f26c332d619"}, - {file = "aiohttp-3.11.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:610b39400c761767d5da3d9960811f616f623bba34a9f491dc89029d2a49cc82"}, - {file = "aiohttp-3.11.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:231c4f1d5f79482e5641febdcb946742c66398deb63dce384da870e59cc884ba"}, - {file = "aiohttp-3.11.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cd0a1856b23b7598e9cd6ff46a08251165f1253b2c922cf3ce07634a1250afb8"}, - {file = "aiohttp-3.11.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a003c5ac1e11674bfd7b057afb4c04465d601ea99a927c5eeedcb824b6fb95f1"}, - {file = "aiohttp-3.11.3-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:26155e39749dd26cf8795dab6c93ccbe4e58d654a670c520d26bb45786325359"}, - {file = "aiohttp-3.11.3-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4265069ae8d55bf978001402824c18297d1b01aabf4b34931299442249d98113"}, - {file = "aiohttp-3.11.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1255eb1438cb35a65af81762964808c8a513a4e686f93319c97d5f351b4f8dad"}, - {file = "aiohttp-3.11.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1468ff557bb154bd500648042e860cd1cc05192e037dd661fff2ce81aeea3bdc"}, - {file = "aiohttp-3.11.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:634b474fdcb889a42751cb1095686a3c43d4fca34c560aa5d167353adda7288a"}, - {file = "aiohttp-3.11.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7ee89599796e220fd8e391d8688b22b63452b772b5b2baffda0f24e2ab258444"}, - {file = "aiohttp-3.11.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:ec2082ffa6e75b41c760b37901bd84711bcee306a5f2fc9fff9d4d290e9a6047"}, - {file = "aiohttp-3.11.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:6a312f5a7fe17a133e605c2db93bd928aad5d1988a7fba5d16f634ac7f5443a0"}, - {file = "aiohttp-3.11.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4187859ad7be3de2b319eb84d8865623e2dd907eb0cb825f8c9709afb36947b8"}, - {file = "aiohttp-3.11.3-cp313-cp313-win32.whl", hash = "sha256:cac27ab70c62e043208231ef4cd2f241ee7001355e968f7e474c9007c0e92400"}, - {file = "aiohttp-3.11.3-cp313-cp313-win_amd64.whl", hash = "sha256:66ec2a0c2e6c6fc5f50c1309e3f06280008ba6b13473f465a279e37934c7e9b1"}, - {file = "aiohttp-3.11.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:3971b5af634c00c6e1387ac0ed30f713a4abd78aa1b008d0986071011377e042"}, - {file = "aiohttp-3.11.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:aba99bb1f22470e07e2dd29bac108aee1f7278cbcb38f2e67970171feda5c0d2"}, - {file = "aiohttp-3.11.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e22331096df5fa2ce2a6f6bc063c82c867fbe00f465311f7355212e89032145a"}, - {file = "aiohttp-3.11.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:117796a65d59c159642924bf989da00d6c4dc3faf323d86003546f157f14d6e4"}, - {file = "aiohttp-3.11.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2ba1ae2c0aa10b8eb946e343d56e58e021550c4fe093cfee4a4aa1eb1bad6cbb"}, - {file = "aiohttp-3.11.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0f15f42bfcbbfa4b8a0c0685161e4b1f91c7b24ee47f6d2076e0824bcfafa481"}, - {file = "aiohttp-3.11.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c33562307c6e5dfdea5f380c90ba46c555536edc153b99e0fcce6478f51e386c"}, - {file = "aiohttp-3.11.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ed4bbe2f39bc65bd80dc063833877bde77e7032896fd648b799c4dc8489bb3ba"}, - {file = "aiohttp-3.11.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:faae49269ecaf640b1cbc22d896b2540d487564c1b62538a72c54a96573ffb34"}, - {file = "aiohttp-3.11.3-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:30abc2f6c004a07b9ffa8086c3b739eddc41c54e5b3825ad18bf6d38e01a1fe2"}, - {file = "aiohttp-3.11.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:38aaa713e303b0852e110694d7ef0c6162ffa0c4fe1d70729f3c35f9bda8f752"}, - {file = "aiohttp-3.11.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:0c400c7e60f08aa541be32cb1aec82f9c130e326c9fe5a98dda246f67ea64ff5"}, - {file = "aiohttp-3.11.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:91a7dad146005a849a56f4c4448c7ad988b51d08d699ec1605a116cd87073a06"}, - {file = "aiohttp-3.11.3-cp39-cp39-win32.whl", hash = "sha256:3d1b50a83d4f054d4eb7a76f82ecfae3305c6339420cdd2958d9f2cb94581c4d"}, - {file = "aiohttp-3.11.3-cp39-cp39-win_amd64.whl", hash = "sha256:b7816289d4d01b5c6ddccb70d85c3c35cad4d26ae4eeadeee72919da6c7bad99"}, - {file = "aiohttp-3.11.3.tar.gz", hash = "sha256:0fbd111a0f1c254dd2cc54bdf6307e5b04fc3d20f3d36fd53c9bcb25bcebb96e"}, + {file = "aiohttp-3.11.7-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8bedb1f6cb919af3b6353921c71281b1491f948ca64408871465d889b4ee1b66"}, + {file = "aiohttp-3.11.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f5022504adab881e2d801a88b748ea63f2a9d130e0b2c430824682a96f6534be"}, + {file = "aiohttp-3.11.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e22d1721c978a6494adc824e0916f9d187fa57baeda34b55140315fa2f740184"}, + {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e993676c71288618eb07e20622572b1250d8713e7e00ab3aabae28cb70f3640d"}, + {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e13a05db87d3b241c186d0936808d0e4e12decc267c617d54e9c643807e968b6"}, + {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ba8d043fed7ffa117024d7ba66fdea011c0e7602327c6d73cacaea38abe4491"}, + {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dda3ed0a7869d2fa16aa41f9961ade73aa2c2e3b2fcb0a352524e7b744881889"}, + {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43bfd25113c1e98aec6c70e26d5f4331efbf4aa9037ba9ad88f090853bf64d7f"}, + {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3dd3e7e7c9ef3e7214f014f1ae260892286647b3cf7c7f1b644a568fd410f8ca"}, + {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:78c657ece7a73b976905ab9ec8be9ef2df12ed8984c24598a1791c58ce3b4ce4"}, + {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:db70a47987e34494b451a334605bee57a126fe8d290511349e86810b4be53b01"}, + {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:9e67531370a3b07e49b280c1f8c2df67985c790ad2834d1b288a2f13cd341c5f"}, + {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:9202f184cc0582b1db15056f2225ab4c1e3dac4d9ade50dd0613ac3c46352ac2"}, + {file = "aiohttp-3.11.7-cp310-cp310-win32.whl", hash = "sha256:2257bdd5cf54a4039a4337162cd8048f05a724380a2283df34620f55d4e29341"}, + {file = "aiohttp-3.11.7-cp310-cp310-win_amd64.whl", hash = "sha256:b7215bf2b53bc6cb35808149980c2ae80a4ae4e273890ac85459c014d5aa60ac"}, + {file = "aiohttp-3.11.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:cea52d11e02123f125f9055dfe0ccf1c3857225fb879e4a944fae12989e2aef2"}, + {file = "aiohttp-3.11.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3ce18f703b7298e7f7633efd6a90138d99a3f9a656cb52c1201e76cb5d79cf08"}, + {file = "aiohttp-3.11.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:670847ee6aeb3a569cd7cdfbe0c3bec1d44828bbfbe78c5d305f7f804870ef9e"}, + {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4dda726f89bfa5c465ba45b76515135a3ece0088dfa2da49b8bb278f3bdeea12"}, + {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c25b74a811dba37c7ea6a14d99eb9402d89c8d739d50748a75f3cf994cf19c43"}, + {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5522ee72f95661e79db691310290c4618b86dff2d9b90baedf343fd7a08bf79"}, + {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1fbf41a6bbc319a7816ae0f0177c265b62f2a59ad301a0e49b395746eb2a9884"}, + {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:59ee1925b5a5efdf6c4e7be51deee93984d0ac14a6897bd521b498b9916f1544"}, + {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:24054fce8c6d6f33a3e35d1c603ef1b91bbcba73e3f04a22b4f2f27dac59b347"}, + {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:351849aca2c6f814575c1a485c01c17a4240413f960df1bf9f5deb0003c61a53"}, + {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:12724f3a211fa243570e601f65a8831372caf1a149d2f1859f68479f07efec3d"}, + {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:7ea4490360b605804bea8173d2d086b6c379d6bb22ac434de605a9cbce006e7d"}, + {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:e0bf378db07df0a713a1e32381a1b277e62ad106d0dbe17b5479e76ec706d720"}, + {file = "aiohttp-3.11.7-cp311-cp311-win32.whl", hash = "sha256:cd8d62cab363dfe713067027a5adb4907515861f1e4ce63e7be810b83668b847"}, + {file = "aiohttp-3.11.7-cp311-cp311-win_amd64.whl", hash = "sha256:bf0e6cce113596377cadda4e3ac5fb89f095bd492226e46d91b4baef1dd16f60"}, + {file = "aiohttp-3.11.7-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:4bb7493c3e3a36d3012b8564bd0e2783259ddd7ef3a81a74f0dbfa000fce48b7"}, + {file = "aiohttp-3.11.7-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e143b0ef9cb1a2b4f74f56d4fbe50caa7c2bb93390aff52f9398d21d89bc73ea"}, + {file = "aiohttp-3.11.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f7c58a240260822dc07f6ae32a0293dd5bccd618bb2d0f36d51c5dbd526f89c0"}, + {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d20cfe63a1c135d26bde8c1d0ea46fd1200884afbc523466d2f1cf517d1fe33"}, + {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:12e4d45847a174f77b2b9919719203769f220058f642b08504cf8b1cf185dacf"}, + {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cf4efa2d01f697a7dbd0509891a286a4af0d86902fc594e20e3b1712c28c0106"}, + {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ee6a4cdcbf54b8083dc9723cdf5f41f722c00db40ccf9ec2616e27869151129"}, + {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c6095aaf852c34f42e1bd0cf0dc32d1e4b48a90bfb5054abdbb9d64b36acadcb"}, + {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1cf03d27885f8c5ebf3993a220cc84fc66375e1e6e812731f51aab2b2748f4a6"}, + {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:1a17f6a230f81eb53282503823f59d61dff14fb2a93847bf0399dc8e87817307"}, + {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:481f10a1a45c5f4c4a578bbd74cff22eb64460a6549819242a87a80788461fba"}, + {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:db37248535d1ae40735d15bdf26ad43be19e3d93ab3f3dad8507eb0f85bb8124"}, + {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9d18a8b44ec8502a7fde91446cd9c9b95ce7c49f1eacc1fb2358b8907d4369fd"}, + {file = "aiohttp-3.11.7-cp312-cp312-win32.whl", hash = "sha256:3d1c9c15d3999107cbb9b2d76ca6172e6710a12fda22434ee8bd3f432b7b17e8"}, + {file = "aiohttp-3.11.7-cp312-cp312-win_amd64.whl", hash = "sha256:018f1b04883a12e77e7fc161934c0f298865d3a484aea536a6a2ca8d909f0ba0"}, + {file = "aiohttp-3.11.7-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:241a6ca732d2766836d62c58c49ca7a93d08251daef0c1e3c850df1d1ca0cbc4"}, + {file = "aiohttp-3.11.7-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:aa3705a8d14de39898da0fbad920b2a37b7547c3afd2a18b9b81f0223b7d0f68"}, + {file = "aiohttp-3.11.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9acfc7f652b31853eed3b92095b0acf06fd5597eeea42e939bd23a17137679d5"}, + {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcefcf2915a2dbdbce37e2fc1622129a1918abfe3d06721ce9f6cdac9b6d2eaa"}, + {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c1f6490dd1862af5aae6cfcf2a274bffa9a5b32a8f5acb519a7ecf5a99a88866"}, + {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1ac5462582d6561c1c1708853a9faf612ff4e5ea5e679e99be36143d6eabd8e"}, + {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c1a6309005acc4b2bcc577ba3b9169fea52638709ffacbd071f3503264620da"}, + {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f5b973cce96793725ef63eb449adfb74f99c043c718acb76e0d2a447ae369962"}, + {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ce91a24aac80de6be8512fb1c4838a9881aa713f44f4e91dd7bb3b34061b497d"}, + {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:875f7100ce0e74af51d4139495eec4025affa1a605280f23990b6434b81df1bd"}, + {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c171fc35d3174bbf4787381716564042a4cbc008824d8195eede3d9b938e29a8"}, + {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:ee9afa1b0d2293c46954f47f33e150798ad68b78925e3710044e0d67a9487791"}, + {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8360c7cc620abb320e1b8d603c39095101391a82b1d0be05fb2225471c9c5c52"}, + {file = "aiohttp-3.11.7-cp313-cp313-win32.whl", hash = "sha256:7a9318da4b4ada9a67c1dd84d1c0834123081e746bee311a16bb449f363d965e"}, + {file = "aiohttp-3.11.7-cp313-cp313-win_amd64.whl", hash = "sha256:fc6da202068e0a268e298d7cd09b6e9f3997736cd9b060e2750963754552a0a9"}, + {file = "aiohttp-3.11.7-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:17829f37c0d31d89aa6b8b010475a10233774771f9b6dc2cc352ea4f8ce95d9a"}, + {file = "aiohttp-3.11.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d6177077a31b1aecfc3c9070bd2f11419dbb4a70f30f4c65b124714f525c2e48"}, + {file = "aiohttp-3.11.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:badda65ac99555791eed75e234afb94686ed2317670c68bff8a4498acdaee935"}, + {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0de6466b9d742b4ee56fe1b2440706e225eb48c77c63152b1584864a236e7a50"}, + {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04b0cc74d5a882c9dacaeeccc1444f0233212b6f5be8bc90833feef1e1ce14b9"}, + {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c7af3e50e5903d21d7b935aceed901cc2475463bc16ddd5587653548661fdb"}, + {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c63f898f683d1379b9be5afc3dd139e20b30b0b1e0bf69a3fc3681f364cf1629"}, + {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fdadc3f6a32d6eca45f9a900a254757fd7855dfb2d8f8dcf0e88f0fae3ff8eb1"}, + {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d329300fb23e14ed1f8c6d688dfd867d1dcc3b1d7cd49b7f8c5b44e797ce0932"}, + {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:5578cf40440eafcb054cf859964bc120ab52ebe0e0562d2b898126d868749629"}, + {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:7b2f8107a3c329789f3c00b2daad0e35f548d0a55cda6291579136622099a46e"}, + {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:43dd89a6194f6ab02a3fe36b09e42e2df19c211fc2050ce37374d96f39604997"}, + {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:d2fa6fc7cc865d26ff42480ac9b52b8c9b7da30a10a6442a9cdf429de840e949"}, + {file = "aiohttp-3.11.7-cp39-cp39-win32.whl", hash = "sha256:a7d9a606355655617fee25dd7e54d3af50804d002f1fd3118dd6312d26692d70"}, + {file = "aiohttp-3.11.7-cp39-cp39-win_amd64.whl", hash = "sha256:53c921b58fdc6485d6b2603e0132bb01cd59b8f0620ffc0907f525e0ba071687"}, + {file = "aiohttp-3.11.7.tar.gz", hash = "sha256:01a8aca4af3da85cea5c90141d23f4b0eee3cbecfd33b029a45a80f28c66c668"}, ] [package.dependencies] @@ -402,17 +402,17 @@ css = ["tinycss2 (>=1.1.0,<1.5)"] [[package]] name = "boto3" -version = "1.35.64" +version = "1.35.69" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.35.64-py3-none-any.whl", hash = "sha256:cdacf03fc750caa3aa0dbf6158166def9922c9d67b4160999ff8fc350662facc"}, - {file = "boto3-1.35.64.tar.gz", hash = "sha256:bc3fc12b41fa2c91e51ab140f74fb1544408a2b1e00f88a4c2369a66d18ddf20"}, + {file = "boto3-1.35.69-py3-none-any.whl", hash = "sha256:20945912130cca1505f45819cd9b7183a0e376e91a1221a0b1f50c80d35fd7e2"}, + {file = "boto3-1.35.69.tar.gz", hash = "sha256:40db86c7732a310b282f595251995ecafcbd62009a57e47a22683862e570cc7a"}, ] [package.dependencies] -botocore = ">=1.35.64,<1.36.0" +botocore = ">=1.35.69,<1.36.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -421,13 +421,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.35.64" +version = "1.35.69" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.35.64-py3-none-any.whl", hash = "sha256:bbd96bf7f442b1d5e35b36f501076e4a588c83d8d84a1952e9ee1d767e5efb3e"}, - {file = "botocore-1.35.64.tar.gz", hash = "sha256:2f95c83f31c9e38a66995c88810fc638c829790e125032ba00ab081a2cf48cb9"}, + {file = "botocore-1.35.69-py3-none-any.whl", hash = "sha256:cad8d9305f873404eee4b197d84e60a40975d43cbe1ab63abe893420ddfe6e3c"}, + {file = "botocore-1.35.69.tar.gz", hash = "sha256:f9f23dd76fb247d9b0e8d411d2995e6f847fc451c026f1e58e300f815b0b36eb"}, ] [package.dependencies] @@ -455,6 +455,10 @@ files = [ {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a37b8f0391212d29b3a91a799c8e4a2855e0576911cdfb2515487e30e322253d"}, {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e84799f09591700a4154154cab9787452925578841a94321d5ee8fb9a9a328f0"}, {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f66b5337fa213f1da0d9000bc8dc0cb5b896b726eefd9c6046f699b169c41b9e"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5dab0844f2cf82be357a0eb11a9087f70c5430b2c241493fc122bb6f2bb0917c"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e4fe605b917c70283db7dfe5ada75e04561479075761a0b3866c081d035b01c1"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:1e9a65b5736232e7a7f91ff3d02277f11d339bf34099a56cdab6a8b3410a02b2"}, + {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:58d4b711689366d4a03ac7957ab8c28890415e267f9b6589969e74b6e42225ec"}, {file = "Brotli-1.1.0-cp310-cp310-win32.whl", hash = "sha256:be36e3d172dc816333f33520154d708a2657ea63762ec16b62ece02ab5e4daf2"}, {file = "Brotli-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:0c6244521dda65ea562d5a69b9a26120769b7a9fb3db2fe9545935ed6735b128"}, {file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a3daabb76a78f829cafc365531c972016e4aa8d5b4bf60660ad8ecee19df7ccc"}, @@ -467,8 +471,14 @@ files = [ {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:19c116e796420b0cee3da1ccec3b764ed2952ccfcc298b55a10e5610ad7885f9"}, {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:510b5b1bfbe20e1a7b3baf5fed9e9451873559a976c1a78eebaa3b86c57b4265"}, {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1fd8a29719ccce974d523580987b7f8229aeace506952fa9ce1d53a033873c8"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c247dd99d39e0338a604f8c2b3bc7061d5c2e9e2ac7ba9cc1be5a69cb6cd832f"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1b2c248cd517c222d89e74669a4adfa5577e06ab68771a529060cf5a156e9757"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:2a24c50840d89ded6c9a8fdc7b6ed3692ed4e86f1c4a4a938e1e92def92933e0"}, + {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f31859074d57b4639318523d6ffdca586ace54271a73ad23ad021acd807eb14b"}, {file = "Brotli-1.1.0-cp311-cp311-win32.whl", hash = "sha256:39da8adedf6942d76dc3e46653e52df937a3c4d6d18fdc94a7c29d263b1f5b50"}, {file = "Brotli-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:aac0411d20e345dc0920bdec5548e438e999ff68d77564d5e9463a7ca9d3e7b1"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:32d95b80260d79926f5fab3c41701dbb818fde1c9da590e77e571eefd14abe28"}, + {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b760c65308ff1e462f65d69c12e4ae085cff3b332d894637f6273a12a482d09f"}, {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:316cc9b17edf613ac76b1f1f305d2a748f1b976b033b049a6ecdfd5612c70409"}, {file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:caf9ee9a5775f3111642d33b86237b05808dafcd6268faa492250e9b78046eb2"}, {file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70051525001750221daa10907c77830bc889cb6d865cc0b813d9db7fefc21451"}, @@ -479,8 +489,24 @@ files = [ {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4093c631e96fdd49e0377a9c167bfd75b6d0bad2ace734c6eb20b348bc3ea180"}, {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:7e4c4629ddad63006efa0ef968c8e4751c5868ff0b1c5c40f76524e894c50248"}, {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:861bf317735688269936f755fa136a99d1ed526883859f86e41a5d43c61d8966"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:87a3044c3a35055527ac75e419dfa9f4f3667a1e887ee80360589eb8c90aabb9"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c5529b34c1c9d937168297f2c1fde7ebe9ebdd5e121297ff9c043bdb2ae3d6fb"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ca63e1890ede90b2e4454f9a65135a4d387a4585ff8282bb72964fab893f2111"}, + {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e79e6520141d792237c70bcd7a3b122d00f2613769ae0cb61c52e89fd3443839"}, {file = "Brotli-1.1.0-cp312-cp312-win32.whl", hash = "sha256:5f4d5ea15c9382135076d2fb28dde923352fe02951e66935a9efaac8f10e81b0"}, {file = "Brotli-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:906bc3a79de8c4ae5b86d3d75a8b77e44404b0f4261714306e3ad248d8ab0951"}, + {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8bf32b98b75c13ec7cf774164172683d6e7891088f6316e54425fde1efc276d5"}, + {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7bc37c4d6b87fb1017ea28c9508b36bbcb0c3d18b4260fcdf08b200c74a6aee8"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c0ef38c7a7014ffac184db9e04debe495d317cc9c6fb10071f7fefd93100a4f"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91d7cc2a76b5567591d12c01f019dd7afce6ba8cba6571187e21e2fc418ae648"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a93dde851926f4f2678e704fadeb39e16c35d8baebd5252c9fd94ce8ce68c4a0"}, + {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f0db75f47be8b8abc8d9e31bc7aad0547ca26f24a54e6fd10231d623f183d089"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6967ced6730aed543b8673008b5a391c3b1076d834ca438bbd70635c73775368"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7eedaa5d036d9336c95915035fb57422054014ebdeb6f3b42eac809928e40d0c"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d487f5432bf35b60ed625d7e1b448e2dc855422e87469e3f450aa5552b0eb284"}, + {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:832436e59afb93e1836081a20f324cb185836c617659b07b129141a8426973c7"}, + {file = "Brotli-1.1.0-cp313-cp313-win32.whl", hash = "sha256:43395e90523f9c23a3d5bdf004733246fba087f2948f87ab28015f12359ca6a0"}, + {file = "Brotli-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:9011560a466d2eb3f5a6e4929cf4a09be405c64154e12df0dd72713f6500e32b"}, {file = "Brotli-1.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a090ca607cbb6a34b0391776f0cb48062081f5f60ddcce5d11838e67a01928d1"}, {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2de9d02f5bda03d27ede52e8cfe7b865b066fa49258cbab568720aa5be80a47d"}, {file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2333e30a5e00fe0fe55903c8832e08ee9c3b1382aacf4db26664a16528d51b4b"}, @@ -490,6 +516,10 @@ files = [ {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:fd5f17ff8f14003595ab414e45fce13d073e0762394f957182e69035c9f3d7c2"}, {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:069a121ac97412d1fe506da790b3e69f52254b9df4eb665cd42460c837193354"}, {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e93dfc1a1165e385cc8239fab7c036fb2cd8093728cbd85097b284d7b99249a2"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_aarch64.whl", hash = "sha256:aea440a510e14e818e67bfc4027880e2fb500c2ccb20ab21c7a7c8b5b4703d75"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_i686.whl", hash = "sha256:6974f52a02321b36847cd19d1b8e381bf39939c21efd6ee2fc13a28b0d99348c"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_ppc64le.whl", hash = "sha256:a7e53012d2853a07a4a79c00643832161a910674a893d296c9f1259859a289d2"}, + {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:d7702622a8b40c49bffb46e1e3ba2e81268d5c04a34f460978c6b5517a34dd52"}, {file = "Brotli-1.1.0-cp36-cp36m-win32.whl", hash = "sha256:a599669fd7c47233438a56936988a2478685e74854088ef5293802123b5b2460"}, {file = "Brotli-1.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d143fd47fad1db3d7c27a1b1d66162e855b5d50a89666af46e1679c496e8e579"}, {file = "Brotli-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:11d00ed0a83fa22d29bc6b64ef636c4552ebafcef57154b4ddd132f5638fbd1c"}, @@ -501,6 +531,10 @@ files = [ {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:919e32f147ae93a09fe064d77d5ebf4e35502a8df75c29fb05788528e330fe74"}, {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:23032ae55523cc7bccb4f6a0bf368cd25ad9bcdcc1990b64a647e7bbcce9cb5b"}, {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:224e57f6eac61cc449f498cc5f0e1725ba2071a3d4f48d5d9dffba42db196438"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:cb1dac1770878ade83f2ccdf7d25e494f05c9165f5246b46a621cc849341dc01"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:3ee8a80d67a4334482d9712b8e83ca6b1d9bc7e351931252ebef5d8f7335a547"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:5e55da2c8724191e5b557f8e18943b1b4839b8efc3ef60d65985bcf6f587dd38"}, + {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:d342778ef319e1026af243ed0a07c97acf3bad33b9f29e7ae6a1f68fd083e90c"}, {file = "Brotli-1.1.0-cp37-cp37m-win32.whl", hash = "sha256:587ca6d3cef6e4e868102672d3bd9dc9698c309ba56d41c2b9c85bbb903cdb95"}, {file = "Brotli-1.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2954c1c23f81c2eaf0b0717d9380bd348578a94161a65b3a2afc62c86467dd68"}, {file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:efa8b278894b14d6da122a72fefcebc28445f2d3f880ac59d46c90f4c13be9a3"}, @@ -513,6 +547,10 @@ files = [ {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ab4fbee0b2d9098c74f3057b2bc055a8bd92ccf02f65944a241b4349229185a"}, {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:141bd4d93984070e097521ed07e2575b46f817d08f9fa42b16b9b5f27b5ac088"}, {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fce1473f3ccc4187f75b4690cfc922628aed4d3dd013d047f95a9b3919a86596"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d2b35ca2c7f81d173d2fadc2f4f31e88cc5f7a39ae5b6db5513cf3383b0e0ec7"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:af6fa6817889314555aede9a919612b23739395ce767fe7fcbea9a80bf140fe5"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:2feb1d960f760a575dbc5ab3b1c00504b24caaf6986e2dc2b01c09c87866a943"}, + {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4410f84b33374409552ac9b6903507cdb31cd30d2501fc5ca13d18f73548444a"}, {file = "Brotli-1.1.0-cp38-cp38-win32.whl", hash = "sha256:db85ecf4e609a48f4b29055f1e144231b90edc90af7481aa731ba2d059226b1b"}, {file = "Brotli-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3d7954194c36e304e1523f55d7042c59dc53ec20dd4e9ea9d151f1b62b4415c0"}, {file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5fb2ce4b8045c78ebbc7b8f3c15062e435d47e7393cc57c25115cfd49883747a"}, @@ -525,6 +563,10 @@ files = [ {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:949f3b7c29912693cee0afcf09acd6ebc04c57af949d9bf77d6101ebb61e388c"}, {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:89f4988c7203739d48c6f806f1e87a1d96e0806d44f0fba61dba81392c9e474d"}, {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:de6551e370ef19f8de1807d0a9aa2cdfdce2e85ce88b122fe9f6b2b076837e59"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0737ddb3068957cf1b054899b0883830bb1fec522ec76b1098f9b6e0f02d9419"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4f3607b129417e111e30637af1b56f24f7a49e64763253bbc275c75fa887d4b2"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:6c6e0c425f22c1c719c42670d561ad682f7bfeeef918edea971a79ac5252437f"}, + {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:494994f807ba0b92092a163a0a283961369a65f6cbe01e8891132b7a320e61eb"}, {file = "Brotli-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f0d8a7a6b5983c2496e364b969f0e526647a06b075d034f3297dc66f3b360c64"}, {file = "Brotli-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:cdad5b9014d83ca68c25d2e9444e28e967ef16e80f6b436918c700c117a85467"}, {file = "Brotli-1.1.0.tar.gz", hash = "sha256:81de08ac11bcb85841e440c13611c00b67d3bf82698314928d0b676362546724"}, @@ -901,73 +943,73 @@ extras = ["arrow", "cloudpickle", "cryptography", "lz4", "numpy", "ruamel.yaml"] [[package]] name = "coverage" -version = "7.6.7" +version = "7.6.8" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.9" files = [ - {file = "coverage-7.6.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:108bb458827765d538abcbf8288599fee07d2743357bdd9b9dad456c287e121e"}, - {file = "coverage-7.6.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c973b2fe4dc445cb865ab369df7521df9c27bf40715c837a113edaa2aa9faf45"}, - {file = "coverage-7.6.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c6b24007c4bcd0b19fac25763a7cac5035c735ae017e9a349b927cfc88f31c1"}, - {file = "coverage-7.6.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:acbb8af78f8f91b3b51f58f288c0994ba63c646bc1a8a22ad072e4e7e0a49f1c"}, - {file = "coverage-7.6.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad32a981bcdedb8d2ace03b05e4fd8dace8901eec64a532b00b15217d3677dd2"}, - {file = "coverage-7.6.7-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:34d23e28ccb26236718a3a78ba72744212aa383141961dd6825f6595005c8b06"}, - {file = "coverage-7.6.7-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e25bacb53a8c7325e34d45dddd2f2fbae0dbc230d0e2642e264a64e17322a777"}, - {file = "coverage-7.6.7-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:af05bbba896c4472a29408455fe31b3797b4d8648ed0a2ccac03e074a77e2314"}, - {file = "coverage-7.6.7-cp310-cp310-win32.whl", hash = "sha256:796c9b107d11d2d69e1849b2dfe41730134b526a49d3acb98ca02f4985eeff7a"}, - {file = "coverage-7.6.7-cp310-cp310-win_amd64.whl", hash = "sha256:987a8e3da7da4eed10a20491cf790589a8e5e07656b6dc22d3814c4d88faf163"}, - {file = "coverage-7.6.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7e61b0e77ff4dddebb35a0e8bb5a68bf0f8b872407d8d9f0c726b65dfabe2469"}, - {file = "coverage-7.6.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1a5407a75ca4abc20d6252efeb238377a71ce7bda849c26c7a9bece8680a5d99"}, - {file = "coverage-7.6.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df002e59f2d29e889c37abd0b9ee0d0e6e38c24f5f55d71ff0e09e3412a340ec"}, - {file = "coverage-7.6.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:673184b3156cba06154825f25af33baa2671ddae6343f23175764e65a8c4c30b"}, - {file = "coverage-7.6.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e69ad502f1a2243f739f5bd60565d14a278be58be4c137d90799f2c263e7049a"}, - {file = "coverage-7.6.7-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:60dcf7605c50ea72a14490d0756daffef77a5be15ed1b9fea468b1c7bda1bc3b"}, - {file = "coverage-7.6.7-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:9c2eb378bebb2c8f65befcb5147877fc1c9fbc640fc0aad3add759b5df79d55d"}, - {file = "coverage-7.6.7-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3c0317288f032221d35fa4cbc35d9f4923ff0dfd176c79c9b356e8ef8ef2dff4"}, - {file = "coverage-7.6.7-cp311-cp311-win32.whl", hash = "sha256:951aade8297358f3618a6e0660dc74f6b52233c42089d28525749fc8267dccd2"}, - {file = "coverage-7.6.7-cp311-cp311-win_amd64.whl", hash = "sha256:5e444b8e88339a2a67ce07d41faabb1d60d1004820cee5a2c2b54e2d8e429a0f"}, - {file = "coverage-7.6.7-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f07ff574986bc3edb80e2c36391678a271d555f91fd1d332a1e0f4b5ea4b6ea9"}, - {file = "coverage-7.6.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:49ed5ee4109258973630c1f9d099c7e72c5c36605029f3a91fe9982c6076c82b"}, - {file = "coverage-7.6.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3e8796434a8106b3ac025fd15417315d7a58ee3e600ad4dbcfddc3f4b14342c"}, - {file = "coverage-7.6.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3b925300484a3294d1c70f6b2b810d6526f2929de954e5b6be2bf8caa1f12c1"}, - {file = "coverage-7.6.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c42ec2c522e3ddd683dec5cdce8e62817afb648caedad9da725001fa530d354"}, - {file = "coverage-7.6.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0266b62cbea568bd5e93a4da364d05de422110cbed5056d69339bd5af5685433"}, - {file = "coverage-7.6.7-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e5f2a0f161d126ccc7038f1f3029184dbdf8f018230af17ef6fd6a707a5b881f"}, - {file = "coverage-7.6.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c132b5a22821f9b143f87446805e13580b67c670a548b96da945a8f6b4f2efbb"}, - {file = "coverage-7.6.7-cp312-cp312-win32.whl", hash = "sha256:7c07de0d2a110f02af30883cd7dddbe704887617d5c27cf373362667445a4c76"}, - {file = "coverage-7.6.7-cp312-cp312-win_amd64.whl", hash = "sha256:fd49c01e5057a451c30c9b892948976f5d38f2cbd04dc556a82743ba8e27ed8c"}, - {file = "coverage-7.6.7-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:46f21663e358beae6b368429ffadf14ed0a329996248a847a4322fb2e35d64d3"}, - {file = "coverage-7.6.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:40cca284c7c310d622a1677f105e8507441d1bb7c226f41978ba7c86979609ab"}, - {file = "coverage-7.6.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77256ad2345c29fe59ae861aa11cfc74579c88d4e8dbf121cbe46b8e32aec808"}, - {file = "coverage-7.6.7-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:87ea64b9fa52bf395272e54020537990a28078478167ade6c61da7ac04dc14bc"}, - {file = "coverage-7.6.7-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d608a7808793e3615e54e9267519351c3ae204a6d85764d8337bd95993581a8"}, - {file = "coverage-7.6.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdd94501d65adc5c24f8a1a0eda110452ba62b3f4aeaba01e021c1ed9cb8f34a"}, - {file = "coverage-7.6.7-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:82c809a62e953867cf57e0548c2b8464207f5f3a6ff0e1e961683e79b89f2c55"}, - {file = "coverage-7.6.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:bb684694e99d0b791a43e9fc0fa58efc15ec357ac48d25b619f207c41f2fd384"}, - {file = "coverage-7.6.7-cp313-cp313-win32.whl", hash = "sha256:963e4a08cbb0af6623e61492c0ec4c0ec5c5cf74db5f6564f98248d27ee57d30"}, - {file = "coverage-7.6.7-cp313-cp313-win_amd64.whl", hash = "sha256:14045b8bfd5909196a90da145a37f9d335a5d988a83db34e80f41e965fb7cb42"}, - {file = "coverage-7.6.7-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:f2c7a045eef561e9544359a0bf5784b44e55cefc7261a20e730baa9220c83413"}, - {file = "coverage-7.6.7-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:5dd4e4a49d9c72a38d18d641135d2fb0bdf7b726ca60a103836b3d00a1182acd"}, - {file = "coverage-7.6.7-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c95e0fa3d1547cb6f021ab72f5c23402da2358beec0a8e6d19a368bd7b0fb37"}, - {file = "coverage-7.6.7-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f63e21ed474edd23f7501f89b53280014436e383a14b9bd77a648366c81dce7b"}, - {file = "coverage-7.6.7-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ead9b9605c54d15be228687552916c89c9683c215370c4a44f1f217d2adcc34d"}, - {file = "coverage-7.6.7-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:0573f5cbf39114270842d01872952d301027d2d6e2d84013f30966313cadb529"}, - {file = "coverage-7.6.7-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:e2c8e3384c12dfa19fa9a52f23eb091a8fad93b5b81a41b14c17c78e23dd1d8b"}, - {file = "coverage-7.6.7-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:70a56a2ec1869e6e9fa69ef6b76b1a8a7ef709972b9cc473f9ce9d26b5997ce3"}, - {file = "coverage-7.6.7-cp313-cp313t-win32.whl", hash = "sha256:dbba8210f5067398b2c4d96b4e64d8fb943644d5eb70be0d989067c8ca40c0f8"}, - {file = "coverage-7.6.7-cp313-cp313t-win_amd64.whl", hash = "sha256:dfd14bcae0c94004baba5184d1c935ae0d1231b8409eb6c103a5fd75e8ecdc56"}, - {file = "coverage-7.6.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:37a15573f988b67f7348916077c6d8ad43adb75e478d0910957394df397d2874"}, - {file = "coverage-7.6.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b6cce5c76985f81da3769c52203ee94722cd5d5889731cd70d31fee939b74bf0"}, - {file = "coverage-7.6.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ab9763d291a17b527ac6fd11d1a9a9c358280adb320e9c2672a97af346ac2c"}, - {file = "coverage-7.6.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6cf96ceaa275f071f1bea3067f8fd43bec184a25a962c754024c973af871e1b7"}, - {file = "coverage-7.6.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aee9cf6b0134d6f932d219ce253ef0e624f4fa588ee64830fcba193269e4daa3"}, - {file = "coverage-7.6.7-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2bc3e45c16564cc72de09e37413262b9f99167803e5e48c6156bccdfb22c8327"}, - {file = "coverage-7.6.7-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:623e6965dcf4e28a3debaa6fcf4b99ee06d27218f46d43befe4db1c70841551c"}, - {file = "coverage-7.6.7-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:850cfd2d6fc26f8346f422920ac204e1d28814e32e3a58c19c91980fa74d8289"}, - {file = "coverage-7.6.7-cp39-cp39-win32.whl", hash = "sha256:c296263093f099da4f51b3dff1eff5d4959b527d4f2f419e16508c5da9e15e8c"}, - {file = "coverage-7.6.7-cp39-cp39-win_amd64.whl", hash = "sha256:90746521206c88bdb305a4bf3342b1b7316ab80f804d40c536fc7d329301ee13"}, - {file = "coverage-7.6.7-pp39.pp310-none-any.whl", hash = "sha256:0ddcb70b3a3a57581b450571b31cb774f23eb9519c2aaa6176d3a84c9fc57671"}, - {file = "coverage-7.6.7.tar.gz", hash = "sha256:d79d4826e41441c9a118ff045e4bccb9fdbdcb1d02413e7ea6eb5c87b5439d24"}, + {file = "coverage-7.6.8-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b39e6011cd06822eb964d038d5dff5da5d98652b81f5ecd439277b32361a3a50"}, + {file = "coverage-7.6.8-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:63c19702db10ad79151a059d2d6336fe0c470f2e18d0d4d1a57f7f9713875dcf"}, + {file = "coverage-7.6.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3985b9be361d8fb6b2d1adc9924d01dec575a1d7453a14cccd73225cb79243ee"}, + {file = "coverage-7.6.8-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:644ec81edec0f4ad17d51c838a7d01e42811054543b76d4ba2c5d6af741ce2a6"}, + {file = "coverage-7.6.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f188a2402f8359cf0c4b1fe89eea40dc13b52e7b4fd4812450da9fcd210181d"}, + {file = "coverage-7.6.8-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e19122296822deafce89a0c5e8685704c067ae65d45e79718c92df7b3ec3d331"}, + {file = "coverage-7.6.8-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:13618bed0c38acc418896005732e565b317aa9e98d855a0e9f211a7ffc2d6638"}, + {file = "coverage-7.6.8-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:193e3bffca48ad74b8c764fb4492dd875038a2f9925530cb094db92bb5e47bed"}, + {file = "coverage-7.6.8-cp310-cp310-win32.whl", hash = "sha256:3988665ee376abce49613701336544041f2117de7b7fbfe91b93d8ff8b151c8e"}, + {file = "coverage-7.6.8-cp310-cp310-win_amd64.whl", hash = "sha256:f56f49b2553d7dd85fd86e029515a221e5c1f8cb3d9c38b470bc38bde7b8445a"}, + {file = "coverage-7.6.8-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:86cffe9c6dfcfe22e28027069725c7f57f4b868a3f86e81d1c62462764dc46d4"}, + {file = "coverage-7.6.8-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d82ab6816c3277dc962cfcdc85b1efa0e5f50fb2c449432deaf2398a2928ab94"}, + {file = "coverage-7.6.8-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:13690e923a3932e4fad4c0ebfb9cb5988e03d9dcb4c5150b5fcbf58fd8bddfc4"}, + {file = "coverage-7.6.8-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4be32da0c3827ac9132bb488d331cb32e8d9638dd41a0557c5569d57cf22c9c1"}, + {file = "coverage-7.6.8-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44e6c85bbdc809383b509d732b06419fb4544dca29ebe18480379633623baafb"}, + {file = "coverage-7.6.8-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:768939f7c4353c0fac2f7c37897e10b1414b571fd85dd9fc49e6a87e37a2e0d8"}, + {file = "coverage-7.6.8-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e44961e36cb13c495806d4cac67640ac2866cb99044e210895b506c26ee63d3a"}, + {file = "coverage-7.6.8-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3ea8bb1ab9558374c0ab591783808511d135a833c3ca64a18ec927f20c4030f0"}, + {file = "coverage-7.6.8-cp311-cp311-win32.whl", hash = "sha256:629a1ba2115dce8bf75a5cce9f2486ae483cb89c0145795603d6554bdc83e801"}, + {file = "coverage-7.6.8-cp311-cp311-win_amd64.whl", hash = "sha256:fb9fc32399dca861584d96eccd6c980b69bbcd7c228d06fb74fe53e007aa8ef9"}, + {file = "coverage-7.6.8-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e683e6ecc587643f8cde8f5da6768e9d165cd31edf39ee90ed7034f9ca0eefee"}, + {file = "coverage-7.6.8-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1defe91d41ce1bd44b40fabf071e6a01a5aa14de4a31b986aa9dfd1b3e3e414a"}, + {file = "coverage-7.6.8-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7ad66e8e50225ebf4236368cc43c37f59d5e6728f15f6e258c8639fa0dd8e6d"}, + {file = "coverage-7.6.8-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3fe47da3e4fda5f1abb5709c156eca207eacf8007304ce3019eb001e7a7204cb"}, + {file = "coverage-7.6.8-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:202a2d645c5a46b84992f55b0a3affe4f0ba6b4c611abec32ee88358db4bb649"}, + {file = "coverage-7.6.8-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4674f0daa1823c295845b6a740d98a840d7a1c11df00d1fd62614545c1583787"}, + {file = "coverage-7.6.8-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:74610105ebd6f33d7c10f8907afed696e79c59e3043c5f20eaa3a46fddf33b4c"}, + {file = "coverage-7.6.8-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:37cda8712145917105e07aab96388ae76e787270ec04bcb9d5cc786d7cbb8443"}, + {file = "coverage-7.6.8-cp312-cp312-win32.whl", hash = "sha256:9e89d5c8509fbd6c03d0dd1972925b22f50db0792ce06324ba069f10787429ad"}, + {file = "coverage-7.6.8-cp312-cp312-win_amd64.whl", hash = "sha256:379c111d3558272a2cae3d8e57e6b6e6f4fe652905692d54bad5ea0ca37c5ad4"}, + {file = "coverage-7.6.8-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0b0c69f4f724c64dfbfe79f5dfb503b42fe6127b8d479b2677f2b227478db2eb"}, + {file = "coverage-7.6.8-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c15b32a7aca8038ed7644f854bf17b663bc38e1671b5d6f43f9a2b2bd0c46f63"}, + {file = "coverage-7.6.8-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63068a11171e4276f6ece913bde059e77c713b48c3a848814a6537f35afb8365"}, + {file = "coverage-7.6.8-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6f4548c5ead23ad13fb7a2c8ea541357474ec13c2b736feb02e19a3085fac002"}, + {file = "coverage-7.6.8-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b4b4299dd0d2c67caaaf286d58aef5e75b125b95615dda4542561a5a566a1e3"}, + {file = "coverage-7.6.8-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:c9ebfb2507751f7196995142f057d1324afdab56db1d9743aab7f50289abd022"}, + {file = "coverage-7.6.8-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:c1b4474beee02ede1eef86c25ad4600a424fe36cff01a6103cb4533c6bf0169e"}, + {file = "coverage-7.6.8-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:d9fd2547e6decdbf985d579cf3fc78e4c1d662b9b0ff7cc7862baaab71c9cc5b"}, + {file = "coverage-7.6.8-cp313-cp313-win32.whl", hash = "sha256:8aae5aea53cbfe024919715eca696b1a3201886ce83790537d1c3668459c7146"}, + {file = "coverage-7.6.8-cp313-cp313-win_amd64.whl", hash = "sha256:ae270e79f7e169ccfe23284ff5ea2d52a6f401dc01b337efb54b3783e2ce3f28"}, + {file = "coverage-7.6.8-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:de38add67a0af869b0d79c525d3e4588ac1ffa92f39116dbe0ed9753f26eba7d"}, + {file = "coverage-7.6.8-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:b07c25d52b1c16ce5de088046cd2432b30f9ad5e224ff17c8f496d9cb7d1d451"}, + {file = "coverage-7.6.8-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:62a66ff235e4c2e37ed3b6104d8b478d767ff73838d1222132a7a026aa548764"}, + {file = "coverage-7.6.8-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09b9f848b28081e7b975a3626e9081574a7b9196cde26604540582da60235fdf"}, + {file = "coverage-7.6.8-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:093896e530c38c8e9c996901858ac63f3d4171268db2c9c8b373a228f459bbc5"}, + {file = "coverage-7.6.8-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9a7b8ac36fd688c8361cbc7bf1cb5866977ece6e0b17c34aa0df58bda4fa18a4"}, + {file = "coverage-7.6.8-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:38c51297b35b3ed91670e1e4efb702b790002e3245a28c76e627478aa3c10d83"}, + {file = "coverage-7.6.8-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:2e4e0f60cb4bd7396108823548e82fdab72d4d8a65e58e2c19bbbc2f1e2bfa4b"}, + {file = "coverage-7.6.8-cp313-cp313t-win32.whl", hash = "sha256:6535d996f6537ecb298b4e287a855f37deaf64ff007162ec0afb9ab8ba3b8b71"}, + {file = "coverage-7.6.8-cp313-cp313t-win_amd64.whl", hash = "sha256:c79c0685f142ca53256722a384540832420dff4ab15fec1863d7e5bc8691bdcc"}, + {file = "coverage-7.6.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3ac47fa29d8d41059ea3df65bd3ade92f97ee4910ed638e87075b8e8ce69599e"}, + {file = "coverage-7.6.8-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:24eda3a24a38157eee639ca9afe45eefa8d2420d49468819ac5f88b10de84f4c"}, + {file = "coverage-7.6.8-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4c81ed2820b9023a9a90717020315e63b17b18c274a332e3b6437d7ff70abe0"}, + {file = "coverage-7.6.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bd55f8fc8fa494958772a2a7302b0354ab16e0b9272b3c3d83cdb5bec5bd1779"}, + {file = "coverage-7.6.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f39e2f3530ed1626c66e7493be7a8423b023ca852aacdc91fb30162c350d2a92"}, + {file = "coverage-7.6.8-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:716a78a342679cd1177bc8c2fe957e0ab91405bd43a17094324845200b2fddf4"}, + {file = "coverage-7.6.8-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:177f01eeaa3aee4a5ffb0d1439c5952b53d5010f86e9d2667963e632e30082cc"}, + {file = "coverage-7.6.8-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:912e95017ff51dc3d7b6e2be158dedc889d9a5cc3382445589ce554f1a34c0ea"}, + {file = "coverage-7.6.8-cp39-cp39-win32.whl", hash = "sha256:4db3ed6a907b555e57cc2e6f14dc3a4c2458cdad8919e40b5357ab9b6db6c43e"}, + {file = "coverage-7.6.8-cp39-cp39-win_amd64.whl", hash = "sha256:428ac484592f780e8cd7b6b14eb568f7c85460c92e2a37cb0c0e5186e1a0d076"}, + {file = "coverage-7.6.8-pp39.pp310-none-any.whl", hash = "sha256:5c52a036535d12590c32c49209e79cabaad9f9ad8aa4cbd875b68c4d67a9cbce"}, + {file = "coverage-7.6.8.tar.gz", hash = "sha256:8b2b8503edb06822c86d82fa64a4a5cb0760bb8f31f26e138ec743f422f37cfc"}, ] [package.extras] @@ -3000,18 +3042,18 @@ type = ["mypy (>=1.11.2)"] [[package]] name = "playwright" -version = "1.48.0" +version = "1.49.0" description = "A high-level API to automate web browsers" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "playwright-1.48.0-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:082bce2739f1078acc7d0734da8cc0e23eb91b7fae553f3316d733276f09a6b1"}, - {file = "playwright-1.48.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7da2eb51a19c7f3b523e9faa9d98e7af92e52eb983a099979ea79c9668e3cbf7"}, - {file = "playwright-1.48.0-py3-none-macosx_11_0_universal2.whl", hash = "sha256:115b988d1da322358b77bc3bf2d3cc90f8c881e691461538e7df91614c4833c9"}, - {file = "playwright-1.48.0-py3-none-manylinux1_x86_64.whl", hash = "sha256:8dabb80e62f667fe2640a8b694e26a7b884c0b4803f7514a3954fc849126227b"}, - {file = "playwright-1.48.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8ff8303409ebed76bed4c3d655340320b768817d900ba208b394fdd7d7939a5c"}, - {file = "playwright-1.48.0-py3-none-win32.whl", hash = "sha256:85598c360c590076d4f435525be991246d74a905b654ac19d26eab7ed9b98b2d"}, - {file = "playwright-1.48.0-py3-none-win_amd64.whl", hash = "sha256:e0e87b0c4dc8fce83c725dd851aec37bc4e882bb225ec8a96bd83cf32d4f1623"}, + {file = "playwright-1.49.0-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:704532a2d8ba580ec9e1895bfeafddce2e3d52320d4eb8aa38e80376acc5cbb0"}, + {file = "playwright-1.49.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e453f02c4e5cc2db7e9759c47e7425f32e50ac76c76b7eb17c69eed72f01c4d8"}, + {file = "playwright-1.49.0-py3-none-macosx_11_0_universal2.whl", hash = "sha256:37ae985309184472946a6eb1a237e5d93c9e58a781fa73b75c8751325002a5d4"}, + {file = "playwright-1.49.0-py3-none-manylinux1_x86_64.whl", hash = "sha256:68d94beffb3c9213e3ceaafa66171affd9a5d9162e0c8a3eed1b1132c2e57598"}, + {file = "playwright-1.49.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f12d2aecdb41fc25a624cb15f3e8391c252ebd81985e3d5c1c261fe93779345"}, + {file = "playwright-1.49.0-py3-none-win32.whl", hash = "sha256:91103de52d470594ad375b512d7143fa95d6039111ae11a93eb4fe2f2b4a4858"}, + {file = "playwright-1.49.0-py3-none-win_amd64.whl", hash = "sha256:34d28a2c2d46403368610be4339898dc9c34eb9f7c578207b4715c49743a072a"}, ] [package.dependencies] @@ -3222,19 +3264,19 @@ files = [ [[package]] name = "pydantic" -version = "2.9.2" +version = "2.10.1" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"}, - {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"}, + {file = "pydantic-2.10.1-py3-none-any.whl", hash = "sha256:a8d20db84de64cf4a7d59e899c2caf0fe9d660c7cfc482528e7020d7dd189a7e"}, + {file = "pydantic-2.10.1.tar.gz", hash = "sha256:a4daca2dc0aa429555e0656d6bf94873a7dc5f54ee42b1f5873d666fb3f35560"}, ] [package.dependencies] annotated-types = ">=0.6.0" -pydantic-core = "2.23.4" -typing-extensions = {version = ">=4.6.1", markers = "python_version < \"3.13\""} +pydantic-core = "2.27.1" +typing-extensions = ">=4.12.2" [package.extras] email = ["email-validator (>=2.0.0)"] @@ -3242,100 +3284,111 @@ timezone = ["tzdata"] [[package]] name = "pydantic-core" -version = "2.23.4" +version = "2.27.1" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.23.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:b10bd51f823d891193d4717448fab065733958bdb6a6b351967bd349d48d5c9b"}, - {file = "pydantic_core-2.23.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4fc714bdbfb534f94034efaa6eadd74e5b93c8fa6315565a222f7b6f42ca1166"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63e46b3169866bd62849936de036f901a9356e36376079b05efa83caeaa02ceb"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed1a53de42fbe34853ba90513cea21673481cd81ed1be739f7f2efb931b24916"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cfdd16ab5e59fc31b5e906d1a3f666571abc367598e3e02c83403acabc092e07"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255a8ef062cbf6674450e668482456abac99a5583bbafb73f9ad469540a3a232"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a7cd62e831afe623fbb7aabbb4fe583212115b3ef38a9f6b71869ba644624a2"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f09e2ff1f17c2b51f2bc76d1cc33da96298f0a036a137f5440ab3ec5360b624f"}, - {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e38e63e6f3d1cec5a27e0afe90a085af8b6806ee208b33030e65b6516353f1a3"}, - {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0dbd8dbed2085ed23b5c04afa29d8fd2771674223135dc9bc937f3c09284d071"}, - {file = "pydantic_core-2.23.4-cp310-none-win32.whl", hash = "sha256:6531b7ca5f951d663c339002e91aaebda765ec7d61b7d1e3991051906ddde119"}, - {file = "pydantic_core-2.23.4-cp310-none-win_amd64.whl", hash = "sha256:7c9129eb40958b3d4500fa2467e6a83356b3b61bfff1b414c7361d9220f9ae8f"}, - {file = "pydantic_core-2.23.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:77733e3892bb0a7fa797826361ce8a9184d25c8dffaec60b7ffe928153680ba8"}, - {file = "pydantic_core-2.23.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b84d168f6c48fabd1f2027a3d1bdfe62f92cade1fb273a5d68e621da0e44e6d"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df49e7a0861a8c36d089c1ed57d308623d60416dab2647a4a17fe050ba85de0e"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff02b6d461a6de369f07ec15e465a88895f3223eb75073ffea56b84d9331f607"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:996a38a83508c54c78a5f41456b0103c30508fed9abcad0a59b876d7398f25fd"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d97683ddee4723ae8c95d1eddac7c192e8c552da0c73a925a89fa8649bf13eea"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:216f9b2d7713eb98cb83c80b9c794de1f6b7e3145eef40400c62e86cee5f4e1e"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6f783e0ec4803c787bcea93e13e9932edab72068f68ecffdf86a99fd5918878b"}, - {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d0776dea117cf5272382634bd2a5c1b6eb16767c223c6a5317cd3e2a757c61a0"}, - {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d5f7a395a8cf1621939692dba2a6b6a830efa6b3cee787d82c7de1ad2930de64"}, - {file = "pydantic_core-2.23.4-cp311-none-win32.whl", hash = "sha256:74b9127ffea03643e998e0c5ad9bd3811d3dac8c676e47db17b0ee7c3c3bf35f"}, - {file = "pydantic_core-2.23.4-cp311-none-win_amd64.whl", hash = "sha256:98d134c954828488b153d88ba1f34e14259284f256180ce659e8d83e9c05eaa3"}, - {file = "pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231"}, - {file = "pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126"}, - {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e"}, - {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24"}, - {file = "pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84"}, - {file = "pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9"}, - {file = "pydantic_core-2.23.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc"}, - {file = "pydantic_core-2.23.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327"}, - {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6"}, - {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f"}, - {file = "pydantic_core-2.23.4-cp313-none-win32.whl", hash = "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769"}, - {file = "pydantic_core-2.23.4-cp313-none-win_amd64.whl", hash = "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5"}, - {file = "pydantic_core-2.23.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d4488a93b071c04dc20f5cecc3631fc78b9789dd72483ba15d423b5b3689b555"}, - {file = "pydantic_core-2.23.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:81965a16b675b35e1d09dd14df53f190f9129c0202356ed44ab2728b1c905658"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ffa2ebd4c8530079140dd2d7f794a9d9a73cbb8e9d59ffe24c63436efa8f271"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:61817945f2fe7d166e75fbfb28004034b48e44878177fc54d81688e7b85a3665"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29d2c342c4bc01b88402d60189f3df065fb0dda3654744d5a165a5288a657368"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e11661ce0fd30a6790e8bcdf263b9ec5988e95e63cf901972107efc49218b13"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d18368b137c6295db49ce7218b1a9ba15c5bc254c96d7c9f9e924a9bc7825ad"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ec4e55f79b1c4ffb2eecd8a0cfba9955a2588497d96851f4c8f99aa4a1d39b12"}, - {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:374a5e5049eda9e0a44c696c7ade3ff355f06b1fe0bb945ea3cac2bc336478a2"}, - {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5c364564d17da23db1106787675fc7af45f2f7b58b4173bfdd105564e132e6fb"}, - {file = "pydantic_core-2.23.4-cp38-none-win32.whl", hash = "sha256:d7a80d21d613eec45e3d41eb22f8f94ddc758a6c4720842dc74c0581f54993d6"}, - {file = "pydantic_core-2.23.4-cp38-none-win_amd64.whl", hash = "sha256:5f5ff8d839f4566a474a969508fe1c5e59c31c80d9e140566f9a37bba7b8d556"}, - {file = "pydantic_core-2.23.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a4fa4fc04dff799089689f4fd502ce7d59de529fc2f40a2c8836886c03e0175a"}, - {file = "pydantic_core-2.23.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0a7df63886be5e270da67e0966cf4afbae86069501d35c8c1b3b6c168f42cb36"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcedcd19a557e182628afa1d553c3895a9f825b936415d0dbd3cd0bbcfd29b4b"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f54b118ce5de9ac21c363d9b3caa6c800341e8c47a508787e5868c6b79c9323"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d2f57d3e1379a9525c5ab067b27dbb8a0642fb5d454e17a9ac434f9ce523e3"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:de6d1d1b9e5101508cb37ab0d972357cac5235f5c6533d1071964c47139257df"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1278e0d324f6908e872730c9102b0112477a7f7cf88b308e4fc36ce1bdb6d58c"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a6b5099eeec78827553827f4c6b8615978bb4b6a88e5d9b93eddf8bb6790f55"}, - {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e55541f756f9b3ee346b840103f32779c695a19826a4c442b7954550a0972040"}, - {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a5c7ba8ffb6d6f8f2ab08743be203654bb1aaa8c9dcb09f82ddd34eadb695605"}, - {file = "pydantic_core-2.23.4-cp39-none-win32.whl", hash = "sha256:37b0fe330e4a58d3c58b24d91d1eb102aeec675a3db4c292ec3928ecd892a9a6"}, - {file = "pydantic_core-2.23.4-cp39-none-win_amd64.whl", hash = "sha256:1498bec4c05c9c787bde9125cfdcc63a41004ff167f495063191b863399b1a29"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f455ee30a9d61d3e1a15abd5068827773d6e4dc513e795f380cdd59932c782d5"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1e90d2e3bd2c3863d48525d297cd143fe541be8bbf6f579504b9712cb6b643ec"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e203fdf807ac7e12ab59ca2bfcabb38c7cf0b33c41efeb00f8e5da1d86af480"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e08277a400de01bc72436a0ccd02bdf596631411f592ad985dcee21445bd0068"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f220b0eea5965dec25480b6333c788fb72ce5f9129e8759ef876a1d805d00801"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d06b0c8da4f16d1d1e352134427cb194a0a6e19ad5db9161bf32b2113409e728"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ba1a0996f6c2773bd83e63f18914c1de3c9dd26d55f4ac302a7efe93fb8e7433"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:9a5bce9d23aac8f0cf0836ecfc033896aa8443b501c58d0602dbfd5bd5b37753"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:78ddaaa81421a29574a682b3179d4cf9e6d405a09b99d93ddcf7e5239c742e21"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:883a91b5dd7d26492ff2f04f40fbb652de40fcc0afe07e8129e8ae779c2110eb"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88ad334a15b32a791ea935af224b9de1bf99bcd62fabf745d5f3442199d86d59"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:233710f069d251feb12a56da21e14cca67994eab08362207785cf8c598e74577"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:19442362866a753485ba5e4be408964644dd6a09123d9416c54cd49171f50744"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:624e278a7d29b6445e4e813af92af37820fafb6dcc55c012c834f9e26f9aaaef"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f5ef8f42bec47f21d07668a043f077d507e5bf4e668d5c6dfe6aaba89de1a5b8"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:aea443fffa9fbe3af1a9ba721a87f926fe548d32cab71d188a6ede77d0ff244e"}, - {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"}, + {file = "pydantic_core-2.27.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:71a5e35c75c021aaf400ac048dacc855f000bdfed91614b4a726f7432f1f3d6a"}, + {file = "pydantic_core-2.27.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f82d068a2d6ecfc6e054726080af69a6764a10015467d7d7b9f66d6ed5afa23b"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:121ceb0e822f79163dd4699e4c54f5ad38b157084d97b34de8b232bcaad70278"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4603137322c18eaf2e06a4495f426aa8d8388940f3c457e7548145011bb68e05"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a33cd6ad9017bbeaa9ed78a2e0752c5e250eafb9534f308e7a5f7849b0b1bfb4"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15cc53a3179ba0fcefe1e3ae50beb2784dede4003ad2dfd24f81bba4b23a454f"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45d9c5eb9273aa50999ad6adc6be5e0ecea7e09dbd0d31bd0c65a55a2592ca08"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8bf7b66ce12a2ac52d16f776b31d16d91033150266eb796967a7e4621707e4f6"}, + {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:655d7dd86f26cb15ce8a431036f66ce0318648f8853d709b4167786ec2fa4807"}, + {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:5556470f1a2157031e676f776c2bc20acd34c1990ca5f7e56f1ebf938b9ab57c"}, + {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f69ed81ab24d5a3bd93861c8c4436f54afdf8e8cc421562b0c7504cf3be58206"}, + {file = "pydantic_core-2.27.1-cp310-none-win32.whl", hash = "sha256:f5a823165e6d04ccea61a9f0576f345f8ce40ed533013580e087bd4d7442b52c"}, + {file = "pydantic_core-2.27.1-cp310-none-win_amd64.whl", hash = "sha256:57866a76e0b3823e0b56692d1a0bf722bffb324839bb5b7226a7dbd6c9a40b17"}, + {file = "pydantic_core-2.27.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:ac3b20653bdbe160febbea8aa6c079d3df19310d50ac314911ed8cc4eb7f8cb8"}, + {file = "pydantic_core-2.27.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a5a8e19d7c707c4cadb8c18f5f60c843052ae83c20fa7d44f41594c644a1d330"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f7059ca8d64fea7f238994c97d91f75965216bcbe5f695bb44f354893f11d52"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bed0f8a0eeea9fb72937ba118f9db0cb7e90773462af7962d382445f3005e5a4"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3cb37038123447cf0f3ea4c74751f6a9d7afef0eb71aa07bf5f652b5e6a132c"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:84286494f6c5d05243456e04223d5a9417d7f443c3b76065e75001beb26f88de"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acc07b2cfc5b835444b44a9956846b578d27beeacd4b52e45489e93276241025"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4fefee876e07a6e9aad7a8c8c9f85b0cdbe7df52b8a9552307b09050f7512c7e"}, + {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:258c57abf1188926c774a4c94dd29237e77eda19462e5bb901d88adcab6af919"}, + {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:35c14ac45fcfdf7167ca76cc80b2001205a8d5d16d80524e13508371fb8cdd9c"}, + {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d1b26e1dff225c31897696cab7d4f0a315d4c0d9e8666dbffdb28216f3b17fdc"}, + {file = "pydantic_core-2.27.1-cp311-none-win32.whl", hash = "sha256:2cdf7d86886bc6982354862204ae3b2f7f96f21a3eb0ba5ca0ac42c7b38598b9"}, + {file = "pydantic_core-2.27.1-cp311-none-win_amd64.whl", hash = "sha256:3af385b0cee8df3746c3f406f38bcbfdc9041b5c2d5ce3e5fc6637256e60bbc5"}, + {file = "pydantic_core-2.27.1-cp311-none-win_arm64.whl", hash = "sha256:81f2ec23ddc1b476ff96563f2e8d723830b06dceae348ce02914a37cb4e74b89"}, + {file = "pydantic_core-2.27.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9cbd94fc661d2bab2bc702cddd2d3370bbdcc4cd0f8f57488a81bcce90c7a54f"}, + {file = "pydantic_core-2.27.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5f8c4718cd44ec1580e180cb739713ecda2bdee1341084c1467802a417fe0f02"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:15aae984e46de8d376df515f00450d1522077254ef6b7ce189b38ecee7c9677c"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1ba5e3963344ff25fc8c40da90f44b0afca8cfd89d12964feb79ac1411a260ac"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:992cea5f4f3b29d6b4f7f1726ed8ee46c8331c6b4eed6db5b40134c6fe1768bb"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0325336f348dbee6550d129b1627cb8f5351a9dc91aad141ffb96d4937bd9529"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7597c07fbd11515f654d6ece3d0e4e5093edc30a436c63142d9a4b8e22f19c35"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3bbd5d8cc692616d5ef6fbbbd50dbec142c7e6ad9beb66b78a96e9c16729b089"}, + {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:dc61505e73298a84a2f317255fcc72b710b72980f3a1f670447a21efc88f8381"}, + {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:e1f735dc43da318cad19b4173dd1ffce1d84aafd6c9b782b3abc04a0d5a6f5bb"}, + {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f4e5658dbffe8843a0f12366a4c2d1c316dbe09bb4dfbdc9d2d9cd6031de8aae"}, + {file = "pydantic_core-2.27.1-cp312-none-win32.whl", hash = "sha256:672ebbe820bb37988c4d136eca2652ee114992d5d41c7e4858cdd90ea94ffe5c"}, + {file = "pydantic_core-2.27.1-cp312-none-win_amd64.whl", hash = "sha256:66ff044fd0bb1768688aecbe28b6190f6e799349221fb0de0e6f4048eca14c16"}, + {file = "pydantic_core-2.27.1-cp312-none-win_arm64.whl", hash = "sha256:9a3b0793b1bbfd4146304e23d90045f2a9b5fd5823aa682665fbdaf2a6c28f3e"}, + {file = "pydantic_core-2.27.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:f216dbce0e60e4d03e0c4353c7023b202d95cbaeff12e5fd2e82ea0a66905073"}, + {file = "pydantic_core-2.27.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a2e02889071850bbfd36b56fd6bc98945e23670773bc7a76657e90e6b6603c08"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42b0e23f119b2b456d07ca91b307ae167cc3f6c846a7b169fca5326e32fdc6cf"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:764be71193f87d460a03f1f7385a82e226639732214b402f9aa61f0d025f0737"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1c00666a3bd2f84920a4e94434f5974d7bbc57e461318d6bb34ce9cdbbc1f6b2"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ccaa88b24eebc0f849ce0a4d09e8a408ec5a94afff395eb69baf868f5183107"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c65af9088ac534313e1963443d0ec360bb2b9cba6c2909478d22c2e363d98a51"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:206b5cf6f0c513baffaeae7bd817717140770c74528f3e4c3e1cec7871ddd61a"}, + {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:062f60e512fc7fff8b8a9d680ff0ddaaef0193dba9fa83e679c0c5f5fbd018bc"}, + {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:a0697803ed7d4af5e4c1adf1670af078f8fcab7a86350e969f454daf598c4960"}, + {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:58ca98a950171f3151c603aeea9303ef6c235f692fe555e883591103da709b23"}, + {file = "pydantic_core-2.27.1-cp313-none-win32.whl", hash = "sha256:8065914ff79f7eab1599bd80406681f0ad08f8e47c880f17b416c9f8f7a26d05"}, + {file = "pydantic_core-2.27.1-cp313-none-win_amd64.whl", hash = "sha256:ba630d5e3db74c79300d9a5bdaaf6200172b107f263c98a0539eeecb857b2337"}, + {file = "pydantic_core-2.27.1-cp313-none-win_arm64.whl", hash = "sha256:45cf8588c066860b623cd11c4ba687f8d7175d5f7ef65f7129df8a394c502de5"}, + {file = "pydantic_core-2.27.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:5897bec80a09b4084aee23f9b73a9477a46c3304ad1d2d07acca19723fb1de62"}, + {file = "pydantic_core-2.27.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d0165ab2914379bd56908c02294ed8405c252250668ebcb438a55494c69f44ab"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b9af86e1d8e4cfc82c2022bfaa6f459381a50b94a29e95dcdda8442d6d83864"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f6c8a66741c5f5447e047ab0ba7a1c61d1e95580d64bce852e3df1f895c4067"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9a42d6a8156ff78981f8aa56eb6394114e0dedb217cf8b729f438f643608cbcd"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:64c65f40b4cd8b0e049a8edde07e38b476da7e3aaebe63287c899d2cff253fa5"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdcf339322a3fae5cbd504edcefddd5a50d9ee00d968696846f089b4432cf78"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bf99c8404f008750c846cb4ac4667b798a9f7de673ff719d705d9b2d6de49c5f"}, + {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:8f1edcea27918d748c7e5e4d917297b2a0ab80cad10f86631e488b7cddf76a36"}, + {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:159cac0a3d096f79ab6a44d77a961917219707e2a130739c64d4dd46281f5c2a"}, + {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:029d9757eb621cc6e1848fa0b0310310de7301057f623985698ed7ebb014391b"}, + {file = "pydantic_core-2.27.1-cp38-none-win32.whl", hash = "sha256:a28af0695a45f7060e6f9b7092558a928a28553366519f64083c63a44f70e618"}, + {file = "pydantic_core-2.27.1-cp38-none-win_amd64.whl", hash = "sha256:2d4567c850905d5eaaed2f7a404e61012a51caf288292e016360aa2b96ff38d4"}, + {file = "pydantic_core-2.27.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e9386266798d64eeb19dd3677051f5705bf873e98e15897ddb7d76f477131967"}, + {file = "pydantic_core-2.27.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4228b5b646caa73f119b1ae756216b59cc6e2267201c27d3912b592c5e323b60"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b3dfe500de26c52abe0477dde16192ac39c98f05bf2d80e76102d394bd13854"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aee66be87825cdf72ac64cb03ad4c15ffef4143dbf5c113f64a5ff4f81477bf9"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b748c44bb9f53031c8cbc99a8a061bc181c1000c60a30f55393b6e9c45cc5bd"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ca038c7f6a0afd0b2448941b6ef9d5e1949e999f9e5517692eb6da58e9d44be"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e0bd57539da59a3e4671b90a502da9a28c72322a4f17866ba3ac63a82c4498e"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ac6c2c45c847bbf8f91930d88716a0fb924b51e0c6dad329b793d670ec5db792"}, + {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b94d4ba43739bbe8b0ce4262bcc3b7b9f31459ad120fb595627eaeb7f9b9ca01"}, + {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:00e6424f4b26fe82d44577b4c842d7df97c20be6439e8e685d0d715feceb9fb9"}, + {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:38de0a70160dd97540335b7ad3a74571b24f1dc3ed33f815f0880682e6880131"}, + {file = "pydantic_core-2.27.1-cp39-none-win32.whl", hash = "sha256:7ccebf51efc61634f6c2344da73e366c75e735960b5654b63d7e6f69a5885fa3"}, + {file = "pydantic_core-2.27.1-cp39-none-win_amd64.whl", hash = "sha256:a57847b090d7892f123726202b7daa20df6694cbd583b67a592e856bff603d6c"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3fa80ac2bd5856580e242dbc202db873c60a01b20309c8319b5c5986fbe53ce6"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d950caa237bb1954f1b8c9227b5065ba6875ac9771bb8ec790d956a699b78676"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e4216e64d203e39c62df627aa882f02a2438d18a5f21d7f721621f7a5d3611d"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:02a3d637bd387c41d46b002f0e49c52642281edacd2740e5a42f7017feea3f2c"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:161c27ccce13b6b0c8689418da3885d3220ed2eae2ea5e9b2f7f3d48f1d52c27"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:19910754e4cc9c63bc1c7f6d73aa1cfee82f42007e407c0f413695c2f7ed777f"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:e173486019cc283dc9778315fa29a363579372fe67045e971e89b6365cc035ed"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:af52d26579b308921b73b956153066481f064875140ccd1dfd4e77db89dbb12f"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:981fb88516bd1ae8b0cbbd2034678a39dedc98752f264ac9bc5839d3923fa04c"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5fde892e6c697ce3e30c61b239330fc5d569a71fefd4eb6512fc6caec9dd9e2f"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:816f5aa087094099fff7edabb5e01cc370eb21aa1a1d44fe2d2aefdfb5599b31"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c10c309e18e443ddb108f0ef64e8729363adbfd92d6d57beec680f6261556f3"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98476c98b02c8e9b2eec76ac4156fd006628b1b2d0ef27e548ffa978393fd154"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c3027001c28434e7ca5a6e1e527487051136aa81803ac812be51802150d880dd"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:7699b1df36a48169cdebda7ab5a2bac265204003f153b4bd17276153d997670a"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1c39b07d90be6b48968ddc8c19e7585052088fd7ec8d568bb31ff64c70ae3c97"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:46ccfe3032b3915586e469d4972973f893c0a2bb65669194a5bdea9bacc088c2"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:62ba45e21cf6571d7f716d903b5b7b6d2617e2d5d67c0923dc47b9d41369f840"}, + {file = "pydantic_core-2.27.1.tar.gz", hash = "sha256:62a763352879b84aa31058fc931884055fd75089cccbd9d58bb6afd01141b235"}, ] [package.dependencies] @@ -3639,13 +3692,12 @@ dev = ["pre-commit", "pytest-asyncio", "tox"] [[package]] name = "pytest-playwright" -version = "0.5.2" +version = "0.6.1" description = "A pytest wrapper with fixtures for Playwright to automate web browsers" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "pytest_playwright-0.5.2-py3-none-any.whl", hash = "sha256:2c5720591364a1cdf66610b972ff8492512bc380953e043c85f705b78b2ed582"}, - {file = "pytest_playwright-0.5.2.tar.gz", hash = "sha256:c6d603df9e6c50b35f057b0528e11d41c0963283e98c257267117f5ed6ba1924"}, + {file = "pytest_playwright-0.6.1.tar.gz", hash = "sha256:f4ccbed1ce8d37a945c010811aa9eb9aa7120eea7cad29620b90d5389fd8caf7"}, ] [package.dependencies] @@ -3670,18 +3722,18 @@ pytest = "*" [[package]] name = "pytest-rerunfailures" -version = "14.0" +version = "15.0" description = "pytest plugin to re-run tests to eliminate flaky failures" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "pytest-rerunfailures-14.0.tar.gz", hash = "sha256:4a400bcbcd3c7a4ad151ab8afac123d90eca3abe27f98725dc4d9702887d2e92"}, - {file = "pytest_rerunfailures-14.0-py3-none-any.whl", hash = "sha256:4197bdd2eaeffdbf50b5ea6e7236f47ff0e44d1def8dae08e409f536d84e7b32"}, + {file = "pytest-rerunfailures-15.0.tar.gz", hash = "sha256:2d9ac7baf59f4c13ac730b47f6fa80e755d1ba0581da45ce30b72fb3542b4474"}, + {file = "pytest_rerunfailures-15.0-py3-none-any.whl", hash = "sha256:dd150c4795c229ef44320adc9a0c0532c51b78bb7a6843a8c53556b9a611df1a"}, ] [package.dependencies] packaging = ">=17.1" -pytest = ">=7.2" +pytest = ">=7.4,<8.2.2 || >8.2.2" [[package]] name = "pytest-xdist" @@ -4175,13 +4227,13 @@ files = [ [[package]] name = "s3transfer" -version = "0.10.3" +version = "0.10.4" description = "An Amazon S3 Transfer Manager" optional = false python-versions = ">=3.8" files = [ - {file = "s3transfer-0.10.3-py3-none-any.whl", hash = "sha256:263ed587a5803c6c708d3ce44dc4dfedaab4c1a32e8329bab818933d79ddcf5d"}, - {file = "s3transfer-0.10.3.tar.gz", hash = "sha256:4f50ed74ab84d474ce614475e0b8d5047ff080810aac5d01ea25231cfc944b0c"}, + {file = "s3transfer-0.10.4-py3-none-any.whl", hash = "sha256:244a76a24355363a68164241438de1b72f8781664920260c48465896b712a41e"}, + {file = "s3transfer-0.10.4.tar.gz", hash = "sha256:29edc09801743c21eb5ecbc617a152df41d3c287f67b615f73e5f750583666a7"}, ] [package.dependencies] @@ -4192,13 +4244,13 @@ crt = ["botocore[crt] (>=1.33.2,<2.0a.0)"] [[package]] name = "sentry-sdk" -version = "2.18.0" +version = "2.19.0" description = "Python client for Sentry (https://sentry.io)" optional = false python-versions = ">=3.6" files = [ - {file = "sentry_sdk-2.18.0-py2.py3-none-any.whl", hash = "sha256:ee70e27d1bbe4cd52a38e1bd28a5fadb9b17bc29d91b5f2b97ae29c0a7610442"}, - {file = "sentry_sdk-2.18.0.tar.gz", hash = "sha256:0dc21febd1ab35c648391c664df96f5f79fb0d92d7d4225cd9832e53a617cafd"}, + {file = "sentry_sdk-2.19.0-py2.py3-none-any.whl", hash = "sha256:7b0b3b709dee051337244a09a30dbf6e95afe0d34a1f8b430d45e0982a7c125b"}, + {file = "sentry_sdk-2.19.0.tar.gz", hash = "sha256:ee4a4d2ae8bfe3cac012dcf3e4607975904c137e1738116549fc3dbbb6ff0e36"}, ] [package.dependencies] @@ -4224,7 +4276,7 @@ grpcio = ["grpcio (>=1.21.1)", "protobuf (>=3.8.0)"] http2 = ["httpcore[http2] (==1.*)"] httpx = ["httpx (>=0.16.0)"] huey = ["huey (>=2)"] -huggingface-hub = ["huggingface-hub (>=0.22)"] +huggingface-hub = ["huggingface_hub (>=0.22)"] langchain = ["langchain (>=0.0.210)"] launchdarkly = ["launchdarkly-server-sdk (>=9.8.0)"] litestar = ["litestar (>=2.0.0)"] @@ -4233,7 +4285,7 @@ openai = ["openai (>=1.0.0)", "tiktoken (>=0.3.0)"] openfeature = ["openfeature-sdk (>=0.7.1)"] opentelemetry = ["opentelemetry-distro (>=0.35b0)"] opentelemetry-experimental = ["opentelemetry-distro"] -pure-eval = ["asttokens", "executing", "pure-eval"] +pure-eval = ["asttokens", "executing", "pure_eval"] pymongo = ["pymongo (>=3.1)"] pyspark = ["pyspark (>=2.4.4)"] quart = ["blinker (>=1.1)", "quart (>=0.16.1)"] @@ -4710,20 +4762,20 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "uvicorn" -version = "0.32.0" +version = "0.32.1" description = "The lightning-fast ASGI server." optional = false python-versions = ">=3.8" files = [ - {file = "uvicorn-0.32.0-py3-none-any.whl", hash = "sha256:60b8f3a5ac027dcd31448f411ced12b5ef452c646f76f02f8cc3f25d8d26fd82"}, - {file = "uvicorn-0.32.0.tar.gz", hash = "sha256:f78b36b143c16f54ccdb8190d0a26b5f1901fe5a3c777e1ab29f26391af8551e"}, + {file = "uvicorn-0.32.1-py3-none-any.whl", hash = "sha256:82ad92fd58da0d12af7482ecdb5f2470a04c9c9a53ced65b9bbb4a205377602e"}, + {file = "uvicorn-0.32.1.tar.gz", hash = "sha256:ee9519c246a72b1c084cea8d3b44ed6026e78a4a309cbedae9c37e4cb9fbb175"}, ] [package.dependencies] click = ">=7.0" colorama = {version = ">=0.4", optional = true, markers = "sys_platform == \"win32\" and extra == \"standard\""} h11 = ">=0.8" -httptools = {version = ">=0.5.0", optional = true, markers = "extra == \"standard\""} +httptools = {version = ">=0.6.3", optional = true, markers = "extra == \"standard\""} python-dotenv = {version = ">=0.13", optional = true, markers = "extra == \"standard\""} pyyaml = {version = ">=5.1", optional = true, markers = "extra == \"standard\""} uvloop = {version = ">=0.14.0,<0.15.0 || >0.15.0,<0.15.1 || >0.15.1", optional = true, markers = "(sys_platform != \"win32\" and sys_platform != \"cygwin\") and platform_python_implementation != \"PyPy\" and extra == \"standard\""} @@ -4731,7 +4783,7 @@ watchfiles = {version = ">=0.13", optional = true, markers = "extra == \"standar websockets = {version = ">=10.4", optional = true, markers = "extra == \"standard\""} [package.extras] -standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "watchfiles (>=0.13)", "websockets (>=10.4)"] +standard = ["colorama (>=0.4)", "httptools (>=0.6.3)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "watchfiles (>=0.13)", "websockets (>=10.4)"] [[package]] name = "uvloop" @@ -4797,94 +4849,82 @@ files = [ [[package]] name = "watchfiles" -version = "0.24.0" +version = "1.0.0" description = "Simple, modern and high performance file watching and code reload in python." optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "watchfiles-0.24.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:083dc77dbdeef09fa44bb0f4d1df571d2e12d8a8f985dccde71ac3ac9ac067a0"}, - {file = "watchfiles-0.24.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e94e98c7cb94cfa6e071d401ea3342767f28eb5a06a58fafdc0d2a4974f4f35c"}, - {file = "watchfiles-0.24.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82ae557a8c037c42a6ef26c494d0631cacca040934b101d001100ed93d43f361"}, - {file = "watchfiles-0.24.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:acbfa31e315a8f14fe33e3542cbcafc55703b8f5dcbb7c1eecd30f141df50db3"}, - {file = "watchfiles-0.24.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b74fdffce9dfcf2dc296dec8743e5b0332d15df19ae464f0e249aa871fc1c571"}, - {file = "watchfiles-0.24.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:449f43f49c8ddca87c6b3980c9284cab6bd1f5c9d9a2b00012adaaccd5e7decd"}, - {file = "watchfiles-0.24.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4abf4ad269856618f82dee296ac66b0cd1d71450fc3c98532d93798e73399b7a"}, - {file = "watchfiles-0.24.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f895d785eb6164678ff4bb5cc60c5996b3ee6df3edb28dcdeba86a13ea0465e"}, - {file = "watchfiles-0.24.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7ae3e208b31be8ce7f4c2c0034f33406dd24fbce3467f77223d10cd86778471c"}, - {file = "watchfiles-0.24.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2efec17819b0046dde35d13fb8ac7a3ad877af41ae4640f4109d9154ed30a188"}, - {file = "watchfiles-0.24.0-cp310-none-win32.whl", hash = "sha256:6bdcfa3cd6fdbdd1a068a52820f46a815401cbc2cb187dd006cb076675e7b735"}, - {file = "watchfiles-0.24.0-cp310-none-win_amd64.whl", hash = "sha256:54ca90a9ae6597ae6dc00e7ed0a040ef723f84ec517d3e7ce13e63e4bc82fa04"}, - {file = "watchfiles-0.24.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:bdcd5538e27f188dd3c804b4a8d5f52a7fc7f87e7fd6b374b8e36a4ca03db428"}, - {file = "watchfiles-0.24.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2dadf8a8014fde6addfd3c379e6ed1a981c8f0a48292d662e27cabfe4239c83c"}, - {file = "watchfiles-0.24.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6509ed3f467b79d95fc62a98229f79b1a60d1b93f101e1c61d10c95a46a84f43"}, - {file = "watchfiles-0.24.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8360f7314a070c30e4c976b183d1d8d1585a4a50c5cb603f431cebcbb4f66327"}, - {file = "watchfiles-0.24.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:316449aefacf40147a9efaf3bd7c9bdd35aaba9ac5d708bd1eb5763c9a02bef5"}, - {file = "watchfiles-0.24.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73bde715f940bea845a95247ea3e5eb17769ba1010efdc938ffcb967c634fa61"}, - {file = "watchfiles-0.24.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3770e260b18e7f4e576edca4c0a639f704088602e0bc921c5c2e721e3acb8d15"}, - {file = "watchfiles-0.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa0fd7248cf533c259e59dc593a60973a73e881162b1a2f73360547132742823"}, - {file = "watchfiles-0.24.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d7a2e3b7f5703ffbd500dabdefcbc9eafeff4b9444bbdd5d83d79eedf8428fab"}, - {file = "watchfiles-0.24.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d831ee0a50946d24a53821819b2327d5751b0c938b12c0653ea5be7dea9c82ec"}, - {file = "watchfiles-0.24.0-cp311-none-win32.whl", hash = "sha256:49d617df841a63b4445790a254013aea2120357ccacbed00253f9c2b5dc24e2d"}, - {file = "watchfiles-0.24.0-cp311-none-win_amd64.whl", hash = "sha256:d3dcb774e3568477275cc76554b5a565024b8ba3a0322f77c246bc7111c5bb9c"}, - {file = "watchfiles-0.24.0-cp311-none-win_arm64.whl", hash = "sha256:9301c689051a4857d5b10777da23fafb8e8e921bcf3abe6448a058d27fb67633"}, - {file = "watchfiles-0.24.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:7211b463695d1e995ca3feb38b69227e46dbd03947172585ecb0588f19b0d87a"}, - {file = "watchfiles-0.24.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4b8693502d1967b00f2fb82fc1e744df128ba22f530e15b763c8d82baee15370"}, - {file = "watchfiles-0.24.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cdab9555053399318b953a1fe1f586e945bc8d635ce9d05e617fd9fe3a4687d6"}, - {file = "watchfiles-0.24.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:34e19e56d68b0dad5cff62273107cf5d9fbaf9d75c46277aa5d803b3ef8a9e9b"}, - {file = "watchfiles-0.24.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:41face41f036fee09eba33a5b53a73e9a43d5cb2c53dad8e61fa6c9f91b5a51e"}, - {file = "watchfiles-0.24.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5148c2f1ea043db13ce9b0c28456e18ecc8f14f41325aa624314095b6aa2e9ea"}, - {file = "watchfiles-0.24.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7e4bd963a935aaf40b625c2499f3f4f6bbd0c3776f6d3bc7c853d04824ff1c9f"}, - {file = "watchfiles-0.24.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c79d7719d027b7a42817c5d96461a99b6a49979c143839fc37aa5748c322f234"}, - {file = "watchfiles-0.24.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:32aa53a9a63b7f01ed32e316e354e81e9da0e6267435c7243bf8ae0f10b428ef"}, - {file = "watchfiles-0.24.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ce72dba6a20e39a0c628258b5c308779b8697f7676c254a845715e2a1039b968"}, - {file = "watchfiles-0.24.0-cp312-none-win32.whl", hash = "sha256:d9018153cf57fc302a2a34cb7564870b859ed9a732d16b41a9b5cb2ebed2d444"}, - {file = "watchfiles-0.24.0-cp312-none-win_amd64.whl", hash = "sha256:551ec3ee2a3ac9cbcf48a4ec76e42c2ef938a7e905a35b42a1267fa4b1645896"}, - {file = "watchfiles-0.24.0-cp312-none-win_arm64.whl", hash = "sha256:b52a65e4ea43c6d149c5f8ddb0bef8d4a1e779b77591a458a893eb416624a418"}, - {file = "watchfiles-0.24.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:3d2e3ab79a1771c530233cadfd277fcc762656d50836c77abb2e5e72b88e3a48"}, - {file = "watchfiles-0.24.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:327763da824817b38ad125dcd97595f942d720d32d879f6c4ddf843e3da3fe90"}, - {file = "watchfiles-0.24.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd82010f8ab451dabe36054a1622870166a67cf3fce894f68895db6f74bbdc94"}, - {file = "watchfiles-0.24.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d64ba08db72e5dfd5c33be1e1e687d5e4fcce09219e8aee893a4862034081d4e"}, - {file = "watchfiles-0.24.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1cf1f6dd7825053f3d98f6d33f6464ebdd9ee95acd74ba2c34e183086900a827"}, - {file = "watchfiles-0.24.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:43e3e37c15a8b6fe00c1bce2473cfa8eb3484bbeecf3aefbf259227e487a03df"}, - {file = "watchfiles-0.24.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88bcd4d0fe1d8ff43675360a72def210ebad3f3f72cabfeac08d825d2639b4ab"}, - {file = "watchfiles-0.24.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:999928c6434372fde16c8f27143d3e97201160b48a614071261701615a2a156f"}, - {file = "watchfiles-0.24.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:30bbd525c3262fd9f4b1865cb8d88e21161366561cd7c9e1194819e0a33ea86b"}, - {file = "watchfiles-0.24.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:edf71b01dec9f766fb285b73930f95f730bb0943500ba0566ae234b5c1618c18"}, - {file = "watchfiles-0.24.0-cp313-none-win32.whl", hash = "sha256:f4c96283fca3ee09fb044f02156d9570d156698bc3734252175a38f0e8975f07"}, - {file = "watchfiles-0.24.0-cp313-none-win_amd64.whl", hash = "sha256:a974231b4fdd1bb7f62064a0565a6b107d27d21d9acb50c484d2cdba515b9366"}, - {file = "watchfiles-0.24.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:ee82c98bed9d97cd2f53bdb035e619309a098ea53ce525833e26b93f673bc318"}, - {file = "watchfiles-0.24.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:fd92bbaa2ecdb7864b7600dcdb6f2f1db6e0346ed425fbd01085be04c63f0b05"}, - {file = "watchfiles-0.24.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f83df90191d67af5a831da3a33dd7628b02a95450e168785586ed51e6d28943c"}, - {file = "watchfiles-0.24.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fca9433a45f18b7c779d2bae7beeec4f740d28b788b117a48368d95a3233ed83"}, - {file = "watchfiles-0.24.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b995bfa6bf01a9e09b884077a6d37070464b529d8682d7691c2d3b540d357a0c"}, - {file = "watchfiles-0.24.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ed9aba6e01ff6f2e8285e5aa4154e2970068fe0fc0998c4380d0e6278222269b"}, - {file = "watchfiles-0.24.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5171ef898299c657685306d8e1478a45e9303ddcd8ac5fed5bd52ad4ae0b69b"}, - {file = "watchfiles-0.24.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4933a508d2f78099162da473841c652ad0de892719043d3f07cc83b33dfd9d91"}, - {file = "watchfiles-0.24.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:95cf3b95ea665ab03f5a54765fa41abf0529dbaf372c3b83d91ad2cfa695779b"}, - {file = "watchfiles-0.24.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:01def80eb62bd5db99a798d5e1f5f940ca0a05986dcfae21d833af7a46f7ee22"}, - {file = "watchfiles-0.24.0-cp38-none-win32.whl", hash = "sha256:4d28cea3c976499475f5b7a2fec6b3a36208656963c1a856d328aeae056fc5c1"}, - {file = "watchfiles-0.24.0-cp38-none-win_amd64.whl", hash = "sha256:21ab23fdc1208086d99ad3f69c231ba265628014d4aed31d4e8746bd59e88cd1"}, - {file = "watchfiles-0.24.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:b665caeeda58625c3946ad7308fbd88a086ee51ccb706307e5b1fa91556ac886"}, - {file = "watchfiles-0.24.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5c51749f3e4e269231510da426ce4a44beb98db2dce9097225c338f815b05d4f"}, - {file = "watchfiles-0.24.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82b2509f08761f29a0fdad35f7e1638b8ab1adfa2666d41b794090361fb8b855"}, - {file = "watchfiles-0.24.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9a60e2bf9dc6afe7f743e7c9b149d1fdd6dbf35153c78fe3a14ae1a9aee3d98b"}, - {file = "watchfiles-0.24.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f7d9b87c4c55e3ea8881dfcbf6d61ea6775fffed1fedffaa60bd047d3c08c430"}, - {file = "watchfiles-0.24.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:78470906a6be5199524641f538bd2c56bb809cd4bf29a566a75051610bc982c3"}, - {file = "watchfiles-0.24.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:07cdef0c84c03375f4e24642ef8d8178e533596b229d32d2bbd69e5128ede02a"}, - {file = "watchfiles-0.24.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d337193bbf3e45171c8025e291530fb7548a93c45253897cd764a6a71c937ed9"}, - {file = "watchfiles-0.24.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ec39698c45b11d9694a1b635a70946a5bad066b593af863460a8e600f0dff1ca"}, - {file = "watchfiles-0.24.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2e28d91ef48eab0afb939fa446d8ebe77e2f7593f5f463fd2bb2b14132f95b6e"}, - {file = "watchfiles-0.24.0-cp39-none-win32.whl", hash = "sha256:7138eff8baa883aeaa074359daabb8b6c1e73ffe69d5accdc907d62e50b1c0da"}, - {file = "watchfiles-0.24.0-cp39-none-win_amd64.whl", hash = "sha256:b3ef2c69c655db63deb96b3c3e587084612f9b1fa983df5e0c3379d41307467f"}, - {file = "watchfiles-0.24.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:632676574429bee8c26be8af52af20e0c718cc7f5f67f3fb658c71928ccd4f7f"}, - {file = "watchfiles-0.24.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:a2a9891723a735d3e2540651184be6fd5b96880c08ffe1a98bae5017e65b544b"}, - {file = "watchfiles-0.24.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a7fa2bc0efef3e209a8199fd111b8969fe9db9c711acc46636686331eda7dd4"}, - {file = "watchfiles-0.24.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01550ccf1d0aed6ea375ef259706af76ad009ef5b0203a3a4cce0f6024f9b68a"}, - {file = "watchfiles-0.24.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:96619302d4374de5e2345b2b622dc481257a99431277662c30f606f3e22f42be"}, - {file = "watchfiles-0.24.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:85d5f0c7771dcc7a26c7a27145059b6bb0ce06e4e751ed76cdf123d7039b60b5"}, - {file = "watchfiles-0.24.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:951088d12d339690a92cef2ec5d3cfd957692834c72ffd570ea76a6790222777"}, - {file = "watchfiles-0.24.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49fb58bcaa343fedc6a9e91f90195b20ccb3135447dc9e4e2570c3a39565853e"}, - {file = "watchfiles-0.24.0.tar.gz", hash = "sha256:afb72325b74fa7a428c009c1b8be4b4d7c2afedafb2982827ef2156646df2fe1"}, + {file = "watchfiles-1.0.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:1d19df28f99d6a81730658fbeb3ade8565ff687f95acb59665f11502b441be5f"}, + {file = "watchfiles-1.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:28babb38cf2da8e170b706c4b84aa7e4528a6fa4f3ee55d7a0866456a1662041"}, + {file = "watchfiles-1.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:12ab123135b2f42517f04e720526d41448667ae8249e651385afb5cda31fedc0"}, + {file = "watchfiles-1.0.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:13a4f9ee0cd25682679eea5c14fc629e2eaa79aab74d963bc4e21f43b8ea1877"}, + {file = "watchfiles-1.0.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9e1d9284cc84de7855fcf83472e51d32daf6f6cecd094160192628bc3fee1b78"}, + {file = "watchfiles-1.0.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ee5edc939f53466b329bbf2e58333a5461e6c7b50c980fa6117439e2c18b42d"}, + {file = "watchfiles-1.0.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5dccfc70480087567720e4e36ec381bba1ed68d7e5f368fe40c93b3b1eba0105"}, + {file = "watchfiles-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c83a6d33a9eda0af6a7470240d1af487807adc269704fe76a4972dd982d16236"}, + {file = "watchfiles-1.0.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:905f69aad276639eff3893759a07d44ea99560e67a1cf46ff389cd62f88872a2"}, + {file = "watchfiles-1.0.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:09551237645d6bff3972592f2aa5424df9290e7a2e15d63c5f47c48cde585935"}, + {file = "watchfiles-1.0.0-cp310-none-win32.whl", hash = "sha256:d2b39aa8edd9e5f56f99a2a2740a251dc58515398e9ed5a4b3e5ff2827060755"}, + {file = "watchfiles-1.0.0-cp310-none-win_amd64.whl", hash = "sha256:2de52b499e1ab037f1a87cb8ebcb04a819bf087b1015a4cf6dcf8af3c2a2613e"}, + {file = "watchfiles-1.0.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:fbd0ab7a9943bbddb87cbc2bf2f09317e74c77dc55b1f5657f81d04666c25269"}, + {file = "watchfiles-1.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:774ef36b16b7198669ce655d4f75b4c3d370e7f1cbdfb997fb10ee98717e2058"}, + {file = "watchfiles-1.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9b4fb98100267e6a5ebaff6aaa5d20aea20240584647470be39fe4823012ac96"}, + {file = "watchfiles-1.0.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0fc3bf0effa2d8075b70badfdd7fb839d7aa9cea650d17886982840d71fdeabf"}, + {file = "watchfiles-1.0.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:648e2b6db53eca6ef31245805cd528a16f56fa4cc15aeec97795eaf713c11435"}, + {file = "watchfiles-1.0.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fa13d604fcb9417ae5f2e3de676e66aa97427d888e83662ad205bed35a313176"}, + {file = "watchfiles-1.0.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:936f362e7ff28311b16f0b97ec51e8f2cc451763a3264640c6ed40fb252d1ee4"}, + {file = "watchfiles-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:245fab124b9faf58430da547512d91734858df13f2ddd48ecfa5e493455ffccb"}, + {file = "watchfiles-1.0.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:4ff9c7e84e8b644a8f985c42bcc81457240316f900fc72769aaedec9d088055a"}, + {file = "watchfiles-1.0.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9c9a8d8fd97defe935ef8dd53d562e68942ad65067cd1c54d6ed8a088b1d931d"}, + {file = "watchfiles-1.0.0-cp311-none-win32.whl", hash = "sha256:a0abf173975eb9dd17bb14c191ee79999e650997cc644562f91df06060610e62"}, + {file = "watchfiles-1.0.0-cp311-none-win_amd64.whl", hash = "sha256:2a825ba4b32c214e3855b536eb1a1f7b006511d8e64b8215aac06eb680642d84"}, + {file = "watchfiles-1.0.0-cp311-none-win_arm64.whl", hash = "sha256:a5a7a06cfc65e34fd0a765a7623c5ba14707a0870703888e51d3d67107589817"}, + {file = "watchfiles-1.0.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:28fb64b5843d94e2c2483f7b024a1280662a44409bedee8f2f51439767e2d107"}, + {file = "watchfiles-1.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e3750434c83b61abb3163b49c64b04180b85b4dabb29a294513faec57f2ffdb7"}, + {file = "watchfiles-1.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bedf84835069f51c7b026b3ca04e2e747ea8ed0a77c72006172c72d28c9f69fc"}, + {file = "watchfiles-1.0.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:90004553be36427c3d06ec75b804233f8f816374165d5225b93abd94ba6e7234"}, + {file = "watchfiles-1.0.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b46e15c34d4e401e976d6949ad3a74d244600d5c4b88c827a3fdf18691a46359"}, + {file = "watchfiles-1.0.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:487d15927f1b0bd24e7df921913399bb1ab94424c386bea8b267754d698f8f0e"}, + {file = "watchfiles-1.0.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1ff236d7a3f4b0a42f699a22fc374ba526bc55048a70cbb299661158e1bb5e1f"}, + {file = "watchfiles-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c01446626574561756067f00b37e6b09c8622b0fc1e9fdbc7cbcea328d4e514"}, + {file = "watchfiles-1.0.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b551c465a59596f3d08170bd7e1c532c7260dd90ed8135778038e13c5d48aa81"}, + {file = "watchfiles-1.0.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e1ed613ee107269f66c2df631ec0fc8efddacface85314d392a4131abe299f00"}, + {file = "watchfiles-1.0.0-cp312-none-win32.whl", hash = "sha256:5f75cd42e7e2254117cf37ff0e68c5b3f36c14543756b2da621408349bd9ca7c"}, + {file = "watchfiles-1.0.0-cp312-none-win_amd64.whl", hash = "sha256:cf517701a4a872417f4e02a136e929537743461f9ec6cdb8184d9a04f4843545"}, + {file = "watchfiles-1.0.0-cp312-none-win_arm64.whl", hash = "sha256:8a2127cd68950787ee36753e6d401c8ea368f73beaeb8e54df5516a06d1ecd82"}, + {file = "watchfiles-1.0.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:95de85c254f7fe8cbdf104731f7f87f7f73ae229493bebca3722583160e6b152"}, + {file = "watchfiles-1.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:533a7cbfe700e09780bb31c06189e39c65f06c7f447326fee707fd02f9a6e945"}, + {file = "watchfiles-1.0.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a2218e78e2c6c07b1634a550095ac2a429026b2d5cbcd49a594f893f2bb8c936"}, + {file = "watchfiles-1.0.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9122b8fdadc5b341315d255ab51d04893f417df4e6c1743b0aac8bf34e96e025"}, + {file = "watchfiles-1.0.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9272fdbc0e9870dac3b505bce1466d386b4d8d6d2bacf405e603108d50446940"}, + {file = "watchfiles-1.0.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4a3b33c3aefe9067ebd87846806cd5fc0b017ab70d628aaff077ab9abf4d06b3"}, + {file = "watchfiles-1.0.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bc338ce9f8846543d428260fa0f9a716626963148edc937d71055d01d81e1525"}, + {file = "watchfiles-1.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ac778a460ea22d63c7e6fb0bc0f5b16780ff0b128f7f06e57aaec63bd339285"}, + {file = "watchfiles-1.0.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:53ae447f06f8f29f5ab40140f19abdab822387a7c426a369eb42184b021e97eb"}, + {file = "watchfiles-1.0.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:1f73c2147a453315d672c1ad907abe6d40324e34a185b51e15624bc793f93cc6"}, + {file = "watchfiles-1.0.0-cp313-none-win32.whl", hash = "sha256:eba98901a2eab909dbd79681190b9049acc650f6111fde1845484a4450761e98"}, + {file = "watchfiles-1.0.0-cp313-none-win_amd64.whl", hash = "sha256:d562a6114ddafb09c33246c6ace7effa71ca4b6a2324a47f4b09b6445ea78941"}, + {file = "watchfiles-1.0.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:3d94fd83ed54266d789f287472269c0def9120a2022674990bd24ad989ebd7a0"}, + {file = "watchfiles-1.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:48051d1c504448b2fcda71c5e6e3610ae45de6a0b8f5a43b961f250be4bdf5a8"}, + {file = "watchfiles-1.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29cf884ad4285d23453c702ed03d689f9c0e865e3c85d20846d800d4787de00f"}, + {file = "watchfiles-1.0.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d3572d4c34c4e9c33d25b3da47d9570d5122f8433b9ac6519dca49c2740d23cd"}, + {file = "watchfiles-1.0.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2c2696611182c85eb0e755b62b456f48debff484b7306b56f05478b843ca8ece"}, + {file = "watchfiles-1.0.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:550109001920a993a4383b57229c717fa73627d2a4e8fcb7ed33c7f1cddb0c85"}, + {file = "watchfiles-1.0.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b555a93c15bd2c71081922be746291d776d47521a00703163e5fbe6d2a402399"}, + {file = "watchfiles-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:947ccba18a38b85c366dafeac8df2f6176342d5992ca240a9d62588b214d731f"}, + {file = "watchfiles-1.0.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ffd98a299b0a74d1b704ef0ed959efb753e656a4e0425c14e46ae4c3cbdd2919"}, + {file = "watchfiles-1.0.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f8c4f3a1210ed099a99e6a710df4ff2f8069411059ffe30fa5f9467ebed1256b"}, + {file = "watchfiles-1.0.0-cp39-none-win32.whl", hash = "sha256:1e176b6b4119b3f369b2b4e003d53a226295ee862c0962e3afd5a1c15680b4e3"}, + {file = "watchfiles-1.0.0-cp39-none-win_amd64.whl", hash = "sha256:2d9c0518fabf4a3f373b0a94bb9e4ea7a1df18dec45e26a4d182aa8918dee855"}, + {file = "watchfiles-1.0.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f159ac795785cde4899e0afa539f4c723fb5dd336ce5605bc909d34edd00b79b"}, + {file = "watchfiles-1.0.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:c3d258d78341d5d54c0c804a5b7faa66cd30ba50b2756a7161db07ce15363b8d"}, + {file = "watchfiles-1.0.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bbd0311588c2de7f9ea5cf3922ccacfd0ec0c1922870a2be503cc7df1ca8be7"}, + {file = "watchfiles-1.0.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9a13ac46b545a7d0d50f7641eefe47d1597e7d1783a5d89e09d080e6dff44b0"}, + {file = "watchfiles-1.0.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b2bca898c1dc073912d3db7fa6926cc08be9575add9e84872de2c99c688bac4e"}, + {file = "watchfiles-1.0.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:06d828fe2adc4ac8a64b875ca908b892a3603d596d43e18f7948f3fef5fc671c"}, + {file = "watchfiles-1.0.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:074c7618cd6c807dc4eaa0982b4a9d3f8051cd0b72793511848fd64630174b17"}, + {file = "watchfiles-1.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95dc785bc284552d044e561b8f4fe26d01ab5ca40d35852a6572d542adfeb4bc"}, + {file = "watchfiles-1.0.0.tar.gz", hash = "sha256:37566c844c9ce3b5deb964fe1a23378e575e74b114618d211fbda8f59d7b5dab"}, ] [package.dependencies] @@ -5023,92 +5063,87 @@ brotli = ["brotli"] [[package]] name = "wrapt" -version = "1.16.0" +version = "1.17.0" description = "Module for decorators, wrappers and monkey patching." optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "wrapt-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ffa565331890b90056c01db69c0fe634a776f8019c143a5ae265f9c6bc4bd6d4"}, - {file = "wrapt-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e4fdb9275308292e880dcbeb12546df7f3e0f96c6b41197e0cf37d2826359020"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb2dee3874a500de01c93d5c71415fcaef1d858370d405824783e7a8ef5db440"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a88e6010048489cda82b1326889ec075a8c856c2e6a256072b28eaee3ccf487"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac83a914ebaf589b69f7d0a1277602ff494e21f4c2f743313414378f8f50a4cf"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:73aa7d98215d39b8455f103de64391cb79dfcad601701a3aa0dddacf74911d72"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:807cc8543a477ab7422f1120a217054f958a66ef7314f76dd9e77d3f02cdccd0"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bf5703fdeb350e36885f2875d853ce13172ae281c56e509f4e6eca049bdfb136"}, - {file = "wrapt-1.16.0-cp310-cp310-win32.whl", hash = "sha256:f6b2d0c6703c988d334f297aa5df18c45e97b0af3679bb75059e0e0bd8b1069d"}, - {file = "wrapt-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:decbfa2f618fa8ed81c95ee18a387ff973143c656ef800c9f24fb7e9c16054e2"}, - {file = "wrapt-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1a5db485fe2de4403f13fafdc231b0dbae5eca4359232d2efc79025527375b09"}, - {file = "wrapt-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:75ea7d0ee2a15733684badb16de6794894ed9c55aa5e9903260922f0482e687d"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a452f9ca3e3267cd4d0fcf2edd0d035b1934ac2bd7e0e57ac91ad6b95c0c6389"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43aa59eadec7890d9958748db829df269f0368521ba6dc68cc172d5d03ed8060"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72554a23c78a8e7aa02abbd699d129eead8b147a23c56e08d08dfc29cfdddca1"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d2efee35b4b0a347e0d99d28e884dfd82797852d62fcd7ebdeee26f3ceb72cf3"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6dcfcffe73710be01d90cae08c3e548d90932d37b39ef83969ae135d36ef3956"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:eb6e651000a19c96f452c85132811d25e9264d836951022d6e81df2fff38337d"}, - {file = "wrapt-1.16.0-cp311-cp311-win32.whl", hash = "sha256:66027d667efe95cc4fa945af59f92c5a02c6f5bb6012bff9e60542c74c75c362"}, - {file = "wrapt-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:aefbc4cb0a54f91af643660a0a150ce2c090d3652cf4052a5397fb2de549cd89"}, - {file = "wrapt-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5eb404d89131ec9b4f748fa5cfb5346802e5ee8836f57d516576e61f304f3b7b"}, - {file = "wrapt-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9090c9e676d5236a6948330e83cb89969f433b1943a558968f659ead07cb3b36"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94265b00870aa407bd0cbcfd536f17ecde43b94fb8d228560a1e9d3041462d73"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2058f813d4f2b5e3a9eb2eb3faf8f1d99b81c3e51aeda4b168406443e8ba809"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98b5e1f498a8ca1858a1cdbffb023bfd954da4e3fa2c0cb5853d40014557248b"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:14d7dc606219cdd7405133c713f2c218d4252f2a469003f8c46bb92d5d095d81"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:49aac49dc4782cb04f58986e81ea0b4768e4ff197b57324dcbd7699c5dfb40b9"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:418abb18146475c310d7a6dc71143d6f7adec5b004ac9ce08dc7a34e2babdc5c"}, - {file = "wrapt-1.16.0-cp312-cp312-win32.whl", hash = "sha256:685f568fa5e627e93f3b52fda002c7ed2fa1800b50ce51f6ed1d572d8ab3e7fc"}, - {file = "wrapt-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:dcdba5c86e368442528f7060039eda390cc4091bfd1dca41e8046af7c910dda8"}, - {file = "wrapt-1.16.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d462f28826f4657968ae51d2181a074dfe03c200d6131690b7d65d55b0f360f8"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a33a747400b94b6d6b8a165e4480264a64a78c8a4c734b62136062e9a248dd39"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3646eefa23daeba62643a58aac816945cadc0afaf21800a1421eeba5f6cfb9c"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ebf019be5c09d400cf7b024aa52b1f3aeebeff51550d007e92c3c1c4afc2a40"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:0d2691979e93d06a95a26257adb7bfd0c93818e89b1406f5a28f36e0d8c1e1fc"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:1acd723ee2a8826f3d53910255643e33673e1d11db84ce5880675954183ec47e"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:bc57efac2da352a51cc4658878a68d2b1b67dbe9d33c36cb826ca449d80a8465"}, - {file = "wrapt-1.16.0-cp36-cp36m-win32.whl", hash = "sha256:da4813f751142436b075ed7aa012a8778aa43a99f7b36afe9b742d3ed8bdc95e"}, - {file = "wrapt-1.16.0-cp36-cp36m-win_amd64.whl", hash = "sha256:6f6eac2360f2d543cc875a0e5efd413b6cbd483cb3ad7ebf888884a6e0d2e966"}, - {file = "wrapt-1.16.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a0ea261ce52b5952bf669684a251a66df239ec6d441ccb59ec7afa882265d593"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bd2d7ff69a2cac767fbf7a2b206add2e9a210e57947dd7ce03e25d03d2de292"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9159485323798c8dc530a224bd3ffcf76659319ccc7bbd52e01e73bd0241a0c5"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a86373cf37cd7764f2201b76496aba58a52e76dedfaa698ef9e9688bfd9e41cf"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:73870c364c11f03ed072dda68ff7aea6d2a3a5c3fe250d917a429c7432e15228"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b935ae30c6e7400022b50f8d359c03ed233d45b725cfdd299462f41ee5ffba6f"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:db98ad84a55eb09b3c32a96c576476777e87c520a34e2519d3e59c44710c002c"}, - {file = "wrapt-1.16.0-cp37-cp37m-win32.whl", hash = "sha256:9153ed35fc5e4fa3b2fe97bddaa7cbec0ed22412b85bcdaf54aeba92ea37428c"}, - {file = "wrapt-1.16.0-cp37-cp37m-win_amd64.whl", hash = "sha256:66dfbaa7cfa3eb707bbfcd46dab2bc6207b005cbc9caa2199bcbc81d95071a00"}, - {file = "wrapt-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1dd50a2696ff89f57bd8847647a1c363b687d3d796dc30d4dd4a9d1689a706f0"}, - {file = "wrapt-1.16.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:44a2754372e32ab315734c6c73b24351d06e77ffff6ae27d2ecf14cf3d229202"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e9723528b9f787dc59168369e42ae1c3b0d3fadb2f1a71de14531d321ee05b0"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbed418ba5c3dce92619656802cc5355cb679e58d0d89b50f116e4a9d5a9603e"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:941988b89b4fd6b41c3f0bfb20e92bd23746579736b7343283297c4c8cbae68f"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6a42cd0cfa8ffc1915aef79cb4284f6383d8a3e9dcca70c445dcfdd639d51267"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ca9b6085e4f866bd584fb135a041bfc32cab916e69f714a7d1d397f8c4891ca"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d5e49454f19ef621089e204f862388d29e6e8d8b162efce05208913dde5b9ad6"}, - {file = "wrapt-1.16.0-cp38-cp38-win32.whl", hash = "sha256:c31f72b1b6624c9d863fc095da460802f43a7c6868c5dda140f51da24fd47d7b"}, - {file = "wrapt-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:490b0ee15c1a55be9c1bd8609b8cecd60e325f0575fc98f50058eae366e01f41"}, - {file = "wrapt-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9b201ae332c3637a42f02d1045e1d0cccfdc41f1f2f801dafbaa7e9b4797bfc2"}, - {file = "wrapt-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2076fad65c6736184e77d7d4729b63a6d1ae0b70da4868adeec40989858eb3fb"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5cd603b575ebceca7da5a3a251e69561bec509e0b46e4993e1cac402b7247b8"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b47cfad9e9bbbed2339081f4e346c93ecd7ab504299403320bf85f7f85c7d46c"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f8212564d49c50eb4565e502814f694e240c55551a5f1bc841d4fcaabb0a9b8a"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5f15814a33e42b04e3de432e573aa557f9f0f56458745c2074952f564c50e664"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db2e408d983b0e61e238cf579c09ef7020560441906ca990fe8412153e3b291f"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:edfad1d29c73f9b863ebe7082ae9321374ccb10879eeabc84ba3b69f2579d537"}, - {file = "wrapt-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed867c42c268f876097248e05b6117a65bcd1e63b779e916fe2e33cd6fd0d3c3"}, - {file = "wrapt-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:eb1b046be06b0fce7249f1d025cd359b4b80fc1c3e24ad9eca33e0dcdb2e4a35"}, - {file = "wrapt-1.16.0-py3-none-any.whl", hash = "sha256:6906c4100a8fcbf2fa735f6059214bb13b97f75b1a61777fcf6432121ef12ef1"}, - {file = "wrapt-1.16.0.tar.gz", hash = "sha256:5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d"}, + {file = "wrapt-1.17.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2a0c23b8319848426f305f9cb0c98a6e32ee68a36264f45948ccf8e7d2b941f8"}, + {file = "wrapt-1.17.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1ca5f060e205f72bec57faae5bd817a1560fcfc4af03f414b08fa29106b7e2d"}, + {file = "wrapt-1.17.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e185ec6060e301a7e5f8461c86fb3640a7beb1a0f0208ffde7a65ec4074931df"}, + {file = "wrapt-1.17.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb90765dd91aed05b53cd7a87bd7f5c188fcd95960914bae0d32c5e7f899719d"}, + {file = "wrapt-1.17.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:879591c2b5ab0a7184258274c42a126b74a2c3d5a329df16d69f9cee07bba6ea"}, + {file = "wrapt-1.17.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:fce6fee67c318fdfb7f285c29a82d84782ae2579c0e1b385b7f36c6e8074fffb"}, + {file = "wrapt-1.17.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:0698d3a86f68abc894d537887b9bbf84d29bcfbc759e23f4644be27acf6da301"}, + {file = "wrapt-1.17.0-cp310-cp310-win32.whl", hash = "sha256:69d093792dc34a9c4c8a70e4973a3361c7a7578e9cd86961b2bbf38ca71e4e22"}, + {file = "wrapt-1.17.0-cp310-cp310-win_amd64.whl", hash = "sha256:f28b29dc158ca5d6ac396c8e0a2ef45c4e97bb7e65522bfc04c989e6fe814575"}, + {file = "wrapt-1.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:74bf625b1b4caaa7bad51d9003f8b07a468a704e0644a700e936c357c17dd45a"}, + {file = "wrapt-1.17.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0f2a28eb35cf99d5f5bd12f5dd44a0f41d206db226535b37b0c60e9da162c3ed"}, + {file = "wrapt-1.17.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:81b1289e99cf4bad07c23393ab447e5e96db0ab50974a280f7954b071d41b489"}, + {file = "wrapt-1.17.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f2939cd4a2a52ca32bc0b359015718472d7f6de870760342e7ba295be9ebaf9"}, + {file = "wrapt-1.17.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6a9653131bda68a1f029c52157fd81e11f07d485df55410401f745007bd6d339"}, + {file = "wrapt-1.17.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4e4b4385363de9052dac1a67bfb535c376f3d19c238b5f36bddc95efae15e12d"}, + {file = "wrapt-1.17.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bdf62d25234290db1837875d4dceb2151e4ea7f9fff2ed41c0fde23ed542eb5b"}, + {file = "wrapt-1.17.0-cp311-cp311-win32.whl", hash = "sha256:5d8fd17635b262448ab8f99230fe4dac991af1dabdbb92f7a70a6afac8a7e346"}, + {file = "wrapt-1.17.0-cp311-cp311-win_amd64.whl", hash = "sha256:92a3d214d5e53cb1db8b015f30d544bc9d3f7179a05feb8f16df713cecc2620a"}, + {file = "wrapt-1.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:89fc28495896097622c3fc238915c79365dd0ede02f9a82ce436b13bd0ab7569"}, + {file = "wrapt-1.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:875d240fdbdbe9e11f9831901fb8719da0bd4e6131f83aa9f69b96d18fae7504"}, + {file = "wrapt-1.17.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5ed16d95fd142e9c72b6c10b06514ad30e846a0d0917ab406186541fe68b451"}, + {file = "wrapt-1.17.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18b956061b8db634120b58f668592a772e87e2e78bc1f6a906cfcaa0cc7991c1"}, + {file = "wrapt-1.17.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:daba396199399ccabafbfc509037ac635a6bc18510ad1add8fd16d4739cdd106"}, + {file = "wrapt-1.17.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4d63f4d446e10ad19ed01188d6c1e1bb134cde8c18b0aa2acfd973d41fcc5ada"}, + {file = "wrapt-1.17.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8a5e7cc39a45fc430af1aefc4d77ee6bad72c5bcdb1322cfde852c15192b8bd4"}, + {file = "wrapt-1.17.0-cp312-cp312-win32.whl", hash = "sha256:0a0a1a1ec28b641f2a3a2c35cbe86c00051c04fffcfcc577ffcdd707df3f8635"}, + {file = "wrapt-1.17.0-cp312-cp312-win_amd64.whl", hash = "sha256:3c34f6896a01b84bab196f7119770fd8466c8ae3dfa73c59c0bb281e7b588ce7"}, + {file = "wrapt-1.17.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:714c12485aa52efbc0fc0ade1e9ab3a70343db82627f90f2ecbc898fdf0bb181"}, + {file = "wrapt-1.17.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da427d311782324a376cacb47c1a4adc43f99fd9d996ffc1b3e8529c4074d393"}, + {file = "wrapt-1.17.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ba1739fb38441a27a676f4de4123d3e858e494fac05868b7a281c0a383c098f4"}, + {file = "wrapt-1.17.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e711fc1acc7468463bc084d1b68561e40d1eaa135d8c509a65dd534403d83d7b"}, + {file = "wrapt-1.17.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:140ea00c87fafc42739bd74a94a5a9003f8e72c27c47cd4f61d8e05e6dec8721"}, + {file = "wrapt-1.17.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:73a96fd11d2b2e77d623a7f26e004cc31f131a365add1ce1ce9a19e55a1eef90"}, + {file = "wrapt-1.17.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0b48554952f0f387984da81ccfa73b62e52817a4386d070c75e4db7d43a28c4a"}, + {file = "wrapt-1.17.0-cp313-cp313-win32.whl", hash = "sha256:498fec8da10e3e62edd1e7368f4b24aa362ac0ad931e678332d1b209aec93045"}, + {file = "wrapt-1.17.0-cp313-cp313-win_amd64.whl", hash = "sha256:fd136bb85f4568fffca995bd3c8d52080b1e5b225dbf1c2b17b66b4c5fa02838"}, + {file = "wrapt-1.17.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:17fcf043d0b4724858f25b8826c36e08f9fb2e475410bece0ec44a22d533da9b"}, + {file = "wrapt-1.17.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4a557d97f12813dc5e18dad9fa765ae44ddd56a672bb5de4825527c847d6379"}, + {file = "wrapt-1.17.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0229b247b0fc7dee0d36176cbb79dbaf2a9eb7ecc50ec3121f40ef443155fb1d"}, + {file = "wrapt-1.17.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8425cfce27b8b20c9b89d77fb50e368d8306a90bf2b6eef2cdf5cd5083adf83f"}, + {file = "wrapt-1.17.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9c900108df470060174108012de06d45f514aa4ec21a191e7ab42988ff42a86c"}, + {file = "wrapt-1.17.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:4e547b447073fc0dbfcbff15154c1be8823d10dab4ad401bdb1575e3fdedff1b"}, + {file = "wrapt-1.17.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:914f66f3b6fc7b915d46c1cc424bc2441841083de01b90f9e81109c9759e43ab"}, + {file = "wrapt-1.17.0-cp313-cp313t-win32.whl", hash = "sha256:a4192b45dff127c7d69b3bdfb4d3e47b64179a0b9900b6351859f3001397dabf"}, + {file = "wrapt-1.17.0-cp313-cp313t-win_amd64.whl", hash = "sha256:4f643df3d4419ea3f856c5c3f40fec1d65ea2e89ec812c83f7767c8730f9827a"}, + {file = "wrapt-1.17.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:69c40d4655e078ede067a7095544bcec5a963566e17503e75a3a3e0fe2803b13"}, + {file = "wrapt-1.17.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f495b6754358979379f84534f8dd7a43ff8cff2558dcdea4a148a6e713a758f"}, + {file = "wrapt-1.17.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:baa7ef4e0886a6f482e00d1d5bcd37c201b383f1d314643dfb0367169f94f04c"}, + {file = "wrapt-1.17.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8fc931382e56627ec4acb01e09ce66e5c03c384ca52606111cee50d931a342d"}, + {file = "wrapt-1.17.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:8f8909cdb9f1b237786c09a810e24ee5e15ef17019f7cecb207ce205b9b5fcce"}, + {file = "wrapt-1.17.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ad47b095f0bdc5585bced35bd088cbfe4177236c7df9984b3cc46b391cc60627"}, + {file = "wrapt-1.17.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:948a9bd0fb2c5120457b07e59c8d7210cbc8703243225dbd78f4dfc13c8d2d1f"}, + {file = "wrapt-1.17.0-cp38-cp38-win32.whl", hash = "sha256:5ae271862b2142f4bc687bdbfcc942e2473a89999a54231aa1c2c676e28f29ea"}, + {file = "wrapt-1.17.0-cp38-cp38-win_amd64.whl", hash = "sha256:f335579a1b485c834849e9075191c9898e0731af45705c2ebf70e0cd5d58beed"}, + {file = "wrapt-1.17.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d751300b94e35b6016d4b1e7d0e7bbc3b5e1751e2405ef908316c2a9024008a1"}, + {file = "wrapt-1.17.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7264cbb4a18dc4acfd73b63e4bcfec9c9802614572025bdd44d0721983fc1d9c"}, + {file = "wrapt-1.17.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:33539c6f5b96cf0b1105a0ff4cf5db9332e773bb521cc804a90e58dc49b10578"}, + {file = "wrapt-1.17.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c30970bdee1cad6a8da2044febd824ef6dc4cc0b19e39af3085c763fdec7de33"}, + {file = "wrapt-1.17.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:bc7f729a72b16ee21795a943f85c6244971724819819a41ddbaeb691b2dd85ad"}, + {file = "wrapt-1.17.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:6ff02a91c4fc9b6a94e1c9c20f62ea06a7e375f42fe57587f004d1078ac86ca9"}, + {file = "wrapt-1.17.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:2dfb7cff84e72e7bf975b06b4989477873dcf160b2fd89959c629535df53d4e0"}, + {file = "wrapt-1.17.0-cp39-cp39-win32.whl", hash = "sha256:2399408ac33ffd5b200480ee858baa58d77dd30e0dd0cab6a8a9547135f30a88"}, + {file = "wrapt-1.17.0-cp39-cp39-win_amd64.whl", hash = "sha256:4f763a29ee6a20c529496a20a7bcb16a73de27f5da6a843249c7047daf135977"}, + {file = "wrapt-1.17.0-py3-none-any.whl", hash = "sha256:d2c63b93548eda58abf5188e505ffed0229bf675f7c3090f8e36ad55b8cbc371"}, + {file = "wrapt-1.17.0.tar.gz", hash = "sha256:16187aa2317c731170a88ef35e8937ae0f533c402872c1ee5e6d079fcf320801"}, ] [[package]] name = "wsidicom" -version = "0.21.4" +version = "0.22.0" description = "Tools for handling DICOM based whole scan images" optional = false python-versions = "<4.0,>=3.10" files = [ - {file = "wsidicom-0.21.4-py3-none-any.whl", hash = "sha256:731e1418bab61bb620b8d0c788499444abc36e01c4fc7e24593203d72cc6e048"}, - {file = "wsidicom-0.21.4.tar.gz", hash = "sha256:bcbd16b7b16433af29aa98acee15f3fd6de6f858a17fd9fcb8e1aec7cc49e2d2"}, + {file = "wsidicom-0.22.0-py3-none-any.whl", hash = "sha256:9e364b3cc4f15e29f8c49bc35e57de60682ea03c00fcb379ab72c9fbb934da4e"}, + {file = "wsidicom-0.22.0.tar.gz", hash = "sha256:576b352369171a535faff957cbaa8aa58368ddc1f564dddba175df2fd44085df"}, ] [package.dependencies] @@ -5128,93 +5163,93 @@ pylibjpeg-rle = ["pylibjpeg-rle (>=1.3.0,<2.0.0)"] [[package]] name = "yarl" -version = "1.17.2" +version = "1.18.0" description = "Yet another URL library" optional = false python-versions = ">=3.9" files = [ - {file = "yarl-1.17.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:93771146ef048b34201bfa382c2bf74c524980870bb278e6df515efaf93699ff"}, - {file = "yarl-1.17.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8281db240a1616af2f9c5f71d355057e73a1409c4648c8949901396dc0a3c151"}, - {file = "yarl-1.17.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:170ed4971bf9058582b01a8338605f4d8c849bd88834061e60e83b52d0c76870"}, - {file = "yarl-1.17.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc61b005f6521fcc00ca0d1243559a5850b9dd1e1fe07b891410ee8fe192d0c0"}, - {file = "yarl-1.17.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:871e1b47eec7b6df76b23c642a81db5dd6536cbef26b7e80e7c56c2fd371382e"}, - {file = "yarl-1.17.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3a58a2f2ca7aaf22b265388d40232f453f67a6def7355a840b98c2d547bd037f"}, - {file = "yarl-1.17.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:736bb076f7299c5c55dfef3eb9e96071a795cb08052822c2bb349b06f4cb2e0a"}, - {file = "yarl-1.17.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8fd51299e21da709eabcd5b2dd60e39090804431292daacbee8d3dabe39a6bc0"}, - {file = "yarl-1.17.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:358dc7ddf25e79e1cc8ee16d970c23faee84d532b873519c5036dbb858965795"}, - {file = "yarl-1.17.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:50d866f7b1a3f16f98603e095f24c0eeba25eb508c85a2c5939c8b3870ba2df8"}, - {file = "yarl-1.17.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:8b9c4643e7d843a0dca9cd9d610a0876e90a1b2cbc4c5ba7930a0d90baf6903f"}, - {file = "yarl-1.17.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:d63123bfd0dce5f91101e77c8a5427c3872501acece8c90df457b486bc1acd47"}, - {file = "yarl-1.17.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:4e76381be3d8ff96a4e6c77815653063e87555981329cf8f85e5be5abf449021"}, - {file = "yarl-1.17.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:734144cd2bd633a1516948e477ff6c835041c0536cef1d5b9a823ae29899665b"}, - {file = "yarl-1.17.2-cp310-cp310-win32.whl", hash = "sha256:26bfb6226e0c157af5da16d2d62258f1ac578d2899130a50433ffee4a5dfa673"}, - {file = "yarl-1.17.2-cp310-cp310-win_amd64.whl", hash = "sha256:76499469dcc24759399accd85ec27f237d52dec300daaca46a5352fcbebb1071"}, - {file = "yarl-1.17.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:792155279dc093839e43f85ff7b9b6493a8eaa0af1f94f1f9c6e8f4de8c63500"}, - {file = "yarl-1.17.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:38bc4ed5cae853409cb193c87c86cd0bc8d3a70fd2268a9807217b9176093ac6"}, - {file = "yarl-1.17.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4a8c83f6fcdc327783bdc737e8e45b2e909b7bd108c4da1892d3bc59c04a6d84"}, - {file = "yarl-1.17.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c6d5fed96f0646bfdf698b0a1cebf32b8aae6892d1bec0c5d2d6e2df44e1e2d"}, - {file = "yarl-1.17.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:782ca9c58f5c491c7afa55518542b2b005caedaf4685ec814fadfcee51f02493"}, - {file = "yarl-1.17.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ff6af03cac0d1a4c3c19e5dcc4c05252411bf44ccaa2485e20d0a7c77892ab6e"}, - {file = "yarl-1.17.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6a3f47930fbbed0f6377639503848134c4aa25426b08778d641491131351c2c8"}, - {file = "yarl-1.17.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d1fa68a3c921365c5745b4bd3af6221ae1f0ea1bf04b69e94eda60e57958907f"}, - {file = "yarl-1.17.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:187df91395c11e9f9dc69b38d12406df85aa5865f1766a47907b1cc9855b6303"}, - {file = "yarl-1.17.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:93d1c8cc5bf5df401015c5e2a3ce75a5254a9839e5039c881365d2a9dcfc6dc2"}, - {file = "yarl-1.17.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:11d86c6145ac5c706c53d484784cf504d7d10fa407cb73b9d20f09ff986059ef"}, - {file = "yarl-1.17.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c42774d1d1508ec48c3ed29e7b110e33f5e74a20957ea16197dbcce8be6b52ba"}, - {file = "yarl-1.17.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:0c8e589379ef0407b10bed16cc26e7392ef8f86961a706ade0a22309a45414d7"}, - {file = "yarl-1.17.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1056cadd5e850a1c026f28e0704ab0a94daaa8f887ece8dfed30f88befb87bb0"}, - {file = "yarl-1.17.2-cp311-cp311-win32.whl", hash = "sha256:be4c7b1c49d9917c6e95258d3d07f43cfba2c69a6929816e77daf322aaba6628"}, - {file = "yarl-1.17.2-cp311-cp311-win_amd64.whl", hash = "sha256:ac8eda86cc75859093e9ce390d423aba968f50cf0e481e6c7d7d63f90bae5c9c"}, - {file = "yarl-1.17.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:dd90238d3a77a0e07d4d6ffdebc0c21a9787c5953a508a2231b5f191455f31e9"}, - {file = "yarl-1.17.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c74f0b0472ac40b04e6d28532f55cac8090e34c3e81f118d12843e6df14d0909"}, - {file = "yarl-1.17.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4d486ddcaca8c68455aa01cf53d28d413fb41a35afc9f6594a730c9779545876"}, - {file = "yarl-1.17.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f25b7e93f5414b9a983e1a6c1820142c13e1782cc9ed354c25e933aebe97fcf2"}, - {file = "yarl-1.17.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3a0baff7827a632204060f48dca9e63fbd6a5a0b8790c1a2adfb25dc2c9c0d50"}, - {file = "yarl-1.17.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:460024cacfc3246cc4d9f47a7fc860e4fcea7d1dc651e1256510d8c3c9c7cde0"}, - {file = "yarl-1.17.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5870d620b23b956f72bafed6a0ba9a62edb5f2ef78a8849b7615bd9433384171"}, - {file = "yarl-1.17.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2941756754a10e799e5b87e2319bbec481ed0957421fba0e7b9fb1c11e40509f"}, - {file = "yarl-1.17.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9611b83810a74a46be88847e0ea616794c406dbcb4e25405e52bff8f4bee2d0a"}, - {file = "yarl-1.17.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:cd7e35818d2328b679a13268d9ea505c85cd773572ebb7a0da7ccbca77b6a52e"}, - {file = "yarl-1.17.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:6b981316fcd940f085f646b822c2ff2b8b813cbd61281acad229ea3cbaabeb6b"}, - {file = "yarl-1.17.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:688058e89f512fb7541cb85c2f149c292d3fa22f981d5a5453b40c5da49eb9e8"}, - {file = "yarl-1.17.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:56afb44a12b0864d17b597210d63a5b88915d680f6484d8d202ed68ade38673d"}, - {file = "yarl-1.17.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:17931dfbb84ae18b287279c1f92b76a3abcd9a49cd69b92e946035cff06bcd20"}, - {file = "yarl-1.17.2-cp312-cp312-win32.whl", hash = "sha256:ff8d95e06546c3a8c188f68040e9d0360feb67ba8498baf018918f669f7bc39b"}, - {file = "yarl-1.17.2-cp312-cp312-win_amd64.whl", hash = "sha256:4c840cc11163d3c01a9d8aad227683c48cd3e5be5a785921bcc2a8b4b758c4f3"}, - {file = "yarl-1.17.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:3294f787a437cb5d81846de3a6697f0c35ecff37a932d73b1fe62490bef69211"}, - {file = "yarl-1.17.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f1e7fedb09c059efee2533119666ca7e1a2610072076926fa028c2ba5dfeb78c"}, - {file = "yarl-1.17.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:da9d3061e61e5ae3f753654813bc1cd1c70e02fb72cf871bd6daf78443e9e2b1"}, - {file = "yarl-1.17.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:91c012dceadc695ccf69301bfdccd1fc4472ad714fe2dd3c5ab4d2046afddf29"}, - {file = "yarl-1.17.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f11fd61d72d93ac23718d393d2a64469af40be2116b24da0a4ca6922df26807e"}, - {file = "yarl-1.17.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:46c465ad06971abcf46dd532f77560181387b4eea59084434bdff97524444032"}, - {file = "yarl-1.17.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef6eee1a61638d29cd7c85f7fd3ac7b22b4c0fabc8fd00a712b727a3e73b0685"}, - {file = "yarl-1.17.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4434b739a8a101a837caeaa0137e0e38cb4ea561f39cb8960f3b1e7f4967a3fc"}, - {file = "yarl-1.17.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:752485cbbb50c1e20908450ff4f94217acba9358ebdce0d8106510859d6eb19a"}, - {file = "yarl-1.17.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:17791acaa0c0f89323c57da7b9a79f2174e26d5debbc8c02d84ebd80c2b7bff8"}, - {file = "yarl-1.17.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:5c6ea72fe619fee5e6b5d4040a451d45d8175f560b11b3d3e044cd24b2720526"}, - {file = "yarl-1.17.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:db5ac3871ed76340210fe028f535392f097fb31b875354bcb69162bba2632ef4"}, - {file = "yarl-1.17.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:7a1606ba68e311576bcb1672b2a1543417e7e0aa4c85e9e718ba6466952476c0"}, - {file = "yarl-1.17.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9bc27dd5cfdbe3dc7f381b05e6260ca6da41931a6e582267d5ca540270afeeb2"}, - {file = "yarl-1.17.2-cp313-cp313-win32.whl", hash = "sha256:52492b87d5877ec405542f43cd3da80bdcb2d0c2fbc73236526e5f2c28e6db28"}, - {file = "yarl-1.17.2-cp313-cp313-win_amd64.whl", hash = "sha256:8e1bf59e035534ba4077f5361d8d5d9194149f9ed4f823d1ee29ef3e8964ace3"}, - {file = "yarl-1.17.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c556fbc6820b6e2cda1ca675c5fa5589cf188f8da6b33e9fc05b002e603e44fa"}, - {file = "yarl-1.17.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f2f44a4247461965fed18b2573f3a9eb5e2c3cad225201ee858726cde610daca"}, - {file = "yarl-1.17.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3a3ede8c248f36b60227eb777eac1dbc2f1022dc4d741b177c4379ca8e75571a"}, - {file = "yarl-1.17.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2654caaf5584449d49c94a6b382b3cb4a246c090e72453493ea168b931206a4d"}, - {file = "yarl-1.17.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0d41c684f286ce41fa05ab6af70f32d6da1b6f0457459a56cf9e393c1c0b2217"}, - {file = "yarl-1.17.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2270d590997445a0dc29afa92e5534bfea76ba3aea026289e811bf9ed4b65a7f"}, - {file = "yarl-1.17.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18662443c6c3707e2fc7fad184b4dc32dd428710bbe72e1bce7fe1988d4aa654"}, - {file = "yarl-1.17.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:75ac158560dec3ed72f6d604c81090ec44529cfb8169b05ae6fcb3e986b325d9"}, - {file = "yarl-1.17.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1fee66b32e79264f428dc8da18396ad59cc48eef3c9c13844adec890cd339db5"}, - {file = "yarl-1.17.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:585ce7cd97be8f538345de47b279b879e091c8b86d9dbc6d98a96a7ad78876a3"}, - {file = "yarl-1.17.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:c019abc2eca67dfa4d8fb72ba924871d764ec3c92b86d5b53b405ad3d6aa56b0"}, - {file = "yarl-1.17.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:c6e659b9a24d145e271c2faf3fa6dd1fcb3e5d3f4e17273d9e0350b6ab0fe6e2"}, - {file = "yarl-1.17.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:d17832ba39374134c10e82d137e372b5f7478c4cceeb19d02ae3e3d1daed8721"}, - {file = "yarl-1.17.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:bc3003710e335e3f842ae3fd78efa55f11a863a89a72e9a07da214db3bf7e1f8"}, - {file = "yarl-1.17.2-cp39-cp39-win32.whl", hash = "sha256:f5ffc6b7ace5b22d9e73b2a4c7305740a339fbd55301d52735f73e21d9eb3130"}, - {file = "yarl-1.17.2-cp39-cp39-win_amd64.whl", hash = "sha256:48e424347a45568413deec6f6ee2d720de2cc0385019bedf44cd93e8638aa0ed"}, - {file = "yarl-1.17.2-py3-none-any.whl", hash = "sha256:dd7abf4f717e33b7487121faf23560b3a50924f80e4bef62b22dab441ded8f3b"}, - {file = "yarl-1.17.2.tar.gz", hash = "sha256:753eaaa0c7195244c84b5cc159dc8204b7fd99f716f11198f999f2332a86b178"}, + {file = "yarl-1.18.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:074fee89caab89a97e18ef5f29060ef61ba3cae6cd77673acc54bfdd3214b7b7"}, + {file = "yarl-1.18.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b026cf2c32daf48d90c0c4e406815c3f8f4cfe0c6dfccb094a9add1ff6a0e41a"}, + {file = "yarl-1.18.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ae38bd86eae3ba3d2ce5636cc9e23c80c9db2e9cb557e40b98153ed102b5a736"}, + {file = "yarl-1.18.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:685cc37f3f307c6a8e879986c6d85328f4c637f002e219f50e2ef66f7e062c1d"}, + {file = "yarl-1.18.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8254dbfce84ee5d1e81051ee7a0f1536c108ba294c0fdb5933476398df0654f3"}, + {file = "yarl-1.18.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:20de4a8b04de70c49698dc2390b7fd2d18d424d3b876371f9b775e2b462d4b41"}, + {file = "yarl-1.18.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0a2074a37285570d54b55820687de3d2f2b9ecf1b714e482e48c9e7c0402038"}, + {file = "yarl-1.18.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f576ed278860df2721a5d57da3381040176ef1d07def9688a385c8330db61a1"}, + {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3a3709450a574d61be6ac53d582496014342ea34876af8dc17cc16da32826c9a"}, + {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:bd80ed29761490c622edde5dd70537ca8c992c2952eb62ed46984f8eff66d6e8"}, + {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:32141e13a1d5a48525e519c9197d3f4d9744d818d5c7d6547524cc9eccc8971e"}, + {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8b8d3e4e014fb4274f1c5bf61511d2199e263909fb0b8bda2a7428b0894e8dc6"}, + {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:701bb4a8f4de191c8c0cc9a1e6d5142f4df880e9d1210e333b829ca9425570ed"}, + {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:a45d94075ac0647621eaaf693c8751813a3eccac455d423f473ffed38c8ac5c9"}, + {file = "yarl-1.18.0-cp310-cp310-win32.whl", hash = "sha256:34176bfb082add67cb2a20abd85854165540891147f88b687a5ed0dc225750a0"}, + {file = "yarl-1.18.0-cp310-cp310-win_amd64.whl", hash = "sha256:73553bbeea7d6ec88c08ad8027f4e992798f0abc459361bf06641c71972794dc"}, + {file = "yarl-1.18.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b8e8c516dc4e1a51d86ac975b0350735007e554c962281c432eaa5822aa9765c"}, + {file = "yarl-1.18.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2e6b4466714a73f5251d84b471475850954f1fa6acce4d3f404da1d55d644c34"}, + {file = "yarl-1.18.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c893f8c1a6d48b25961e00922724732d00b39de8bb0b451307482dc87bddcd74"}, + {file = "yarl-1.18.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:13aaf2bdbc8c86ddce48626b15f4987f22e80d898818d735b20bd58f17292ee8"}, + {file = "yarl-1.18.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dd21c0128e301851de51bc607b0a6da50e82dc34e9601f4b508d08cc89ee7929"}, + {file = "yarl-1.18.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:205de377bd23365cd85562c9c6c33844050a93661640fda38e0567d2826b50df"}, + {file = "yarl-1.18.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed69af4fe2a0949b1ea1d012bf065c77b4c7822bad4737f17807af2adb15a73c"}, + {file = "yarl-1.18.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8e1c18890091aa3cc8a77967943476b729dc2016f4cfe11e45d89b12519d4a93"}, + {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:91b8fb9427e33f83ca2ba9501221ffaac1ecf0407f758c4d2f283c523da185ee"}, + {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:536a7a8a53b75b2e98ff96edb2dfb91a26b81c4fed82782035767db5a465be46"}, + {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:a64619a9c47c25582190af38e9eb382279ad42e1f06034f14d794670796016c0"}, + {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c73a6bbc97ba1b5a0c3c992ae93d721c395bdbb120492759b94cc1ac71bc6350"}, + {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:a173401d7821a2a81c7b47d4e7d5c4021375a1441af0c58611c1957445055056"}, + {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7520e799b1f84e095cce919bd6c23c9d49472deeef25fe1ef960b04cca51c3fc"}, + {file = "yarl-1.18.0-cp311-cp311-win32.whl", hash = "sha256:c4cb992d8090d5ae5f7afa6754d7211c578be0c45f54d3d94f7781c495d56716"}, + {file = "yarl-1.18.0-cp311-cp311-win_amd64.whl", hash = "sha256:52c136f348605974c9b1c878addd6b7a60e3bf2245833e370862009b86fa4689"}, + {file = "yarl-1.18.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1ece25e2251c28bab737bdf0519c88189b3dd9492dc086a1d77336d940c28ced"}, + {file = "yarl-1.18.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:454902dc1830d935c90b5b53c863ba2a98dcde0fbaa31ca2ed1ad33b2a7171c6"}, + {file = "yarl-1.18.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:01be8688fc211dc237e628fcc209dda412d35de7642453059a0553747018d075"}, + {file = "yarl-1.18.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4d26f1fa9fa2167bb238f6f4b20218eb4e88dd3ef21bb8f97439fa6b5313e30d"}, + {file = "yarl-1.18.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b234a4a9248a9f000b7a5dfe84b8cb6210ee5120ae70eb72a4dcbdb4c528f72f"}, + {file = "yarl-1.18.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fe94d1de77c4cd8caff1bd5480e22342dbd54c93929f5943495d9c1e8abe9f42"}, + {file = "yarl-1.18.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b4c90c5363c6b0a54188122b61edb919c2cd1119684999d08cd5e538813a28e"}, + {file = "yarl-1.18.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:49a98ecadc5a241c9ba06de08127ee4796e1009555efd791bac514207862b43d"}, + {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9106025c7f261f9f5144f9aa7681d43867eed06349a7cfb297a1bc804de2f0d1"}, + {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:f275ede6199d0f1ed4ea5d55a7b7573ccd40d97aee7808559e1298fe6efc8dbd"}, + {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:f7edeb1dcc7f50a2c8e08b9dc13a413903b7817e72273f00878cb70e766bdb3b"}, + {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c083f6dd6951b86e484ebfc9c3524b49bcaa9c420cb4b2a78ef9f7a512bfcc85"}, + {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:80741ec5b471fbdfb997821b2842c59660a1c930ceb42f8a84ba8ca0f25a66aa"}, + {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b1a3297b9cad594e1ff0c040d2881d7d3a74124a3c73e00c3c71526a1234a9f7"}, + {file = "yarl-1.18.0-cp312-cp312-win32.whl", hash = "sha256:cd6ab7d6776c186f544f893b45ee0c883542b35e8a493db74665d2e594d3ca75"}, + {file = "yarl-1.18.0-cp312-cp312-win_amd64.whl", hash = "sha256:039c299a0864d1f43c3e31570045635034ea7021db41bf4842693a72aca8df3a"}, + {file = "yarl-1.18.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6fb64dd45453225f57d82c4764818d7a205ee31ce193e9f0086e493916bd4f72"}, + {file = "yarl-1.18.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:3adaaf9c6b1b4fc258584f4443f24d775a2086aee82d1387e48a8b4f3d6aecf6"}, + {file = "yarl-1.18.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:da206d1ec78438a563c5429ab808a2b23ad7bc025c8adbf08540dde202be37d5"}, + {file = "yarl-1.18.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:576d258b21c1db4c6449b1c572c75d03f16a482eb380be8003682bdbe7db2f28"}, + {file = "yarl-1.18.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c60e547c0a375c4bfcdd60eef82e7e0e8698bf84c239d715f5c1278a73050393"}, + {file = "yarl-1.18.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e3818eabaefb90adeb5e0f62f047310079d426387991106d4fbf3519eec7d90a"}, + {file = "yarl-1.18.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a5f72421246c21af6a92fbc8c13b6d4c5427dfd949049b937c3b731f2f9076bd"}, + {file = "yarl-1.18.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7fa7d37f2ada0f42e0723632993ed422f2a679af0e200874d9d861720a54f53e"}, + {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:42ba84e2ac26a3f252715f8ec17e6fdc0cbf95b9617c5367579fafcd7fba50eb"}, + {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:6a49ad0102c0f0ba839628d0bf45973c86ce7b590cdedf7540d5b1833ddc6f00"}, + {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:96404e8d5e1bbe36bdaa84ef89dc36f0e75939e060ca5cd45451aba01db02902"}, + {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:a0509475d714df8f6d498935b3f307cd122c4ca76f7d426c7e1bb791bcd87eda"}, + {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:1ff116f0285b5c8b3b9a2680aeca29a858b3b9e0402fc79fd850b32c2bcb9f8b"}, + {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e2580c1d7e66e6d29d6e11855e3b1c6381971e0edd9a5066e6c14d79bc8967af"}, + {file = "yarl-1.18.0-cp313-cp313-win32.whl", hash = "sha256:14408cc4d34e202caba7b5ac9cc84700e3421a9e2d1b157d744d101b061a4a88"}, + {file = "yarl-1.18.0-cp313-cp313-win_amd64.whl", hash = "sha256:1db1537e9cb846eb0ff206eac667f627794be8b71368c1ab3207ec7b6f8c5afc"}, + {file = "yarl-1.18.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:fa2c9cb607e0f660d48c54a63de7a9b36fef62f6b8bd50ff592ce1137e73ac7d"}, + {file = "yarl-1.18.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c0f4808644baf0a434a3442df5e0bedf8d05208f0719cedcd499e168b23bfdc4"}, + {file = "yarl-1.18.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7db9584235895a1dffca17e1c634b13870852094f6389b68dcc6338086aa7b08"}, + {file = "yarl-1.18.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:309f8d27d6f93ceeeb80aa6980e883aa57895270f7f41842b92247e65d7aeddf"}, + {file = "yarl-1.18.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:609ffd44fed2ed88d9b4ef62ee860cf86446cf066333ad4ce4123505b819e581"}, + {file = "yarl-1.18.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f172b8b2c72a13a06ea49225a9c47079549036ad1b34afa12d5491b881f5b993"}, + {file = "yarl-1.18.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d89ae7de94631b60d468412c18290d358a9d805182373d804ec839978b120422"}, + {file = "yarl-1.18.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:466d31fd043ef9af822ee3f1df8fdff4e8c199a7f4012c2642006af240eade17"}, + {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7609b8462351c4836b3edce4201acb6dd46187b207c589b30a87ffd1813b48dc"}, + {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:d9d4f5e471e8dc49b593a80766c2328257e405f943c56a3dc985c125732bc4cf"}, + {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:67b336c15e564d76869c9a21316f90edf546809a5796a083b8f57c845056bc01"}, + {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:b212452b80cae26cb767aa045b051740e464c5129b7bd739c58fbb7deb339e7b"}, + {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:38b39b7b3e692b6c92b986b00137a3891eddb66311b229d1940dcbd4f025083c"}, + {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a7ee6884a8848792d58b854946b685521f41d8871afa65e0d4a774954e9c9e89"}, + {file = "yarl-1.18.0-cp39-cp39-win32.whl", hash = "sha256:b4095c5019bb889aa866bf12ed4c85c0daea5aafcb7c20d1519f02a1e738f07f"}, + {file = "yarl-1.18.0-cp39-cp39-win_amd64.whl", hash = "sha256:2d90f2e4d16a5b0915ee065218b435d2ef619dd228973b1b47d262a6f7cd8fa5"}, + {file = "yarl-1.18.0-py3-none-any.whl", hash = "sha256:dbf53db46f7cf176ee01d8d98c39381440776fcda13779d269a8ba664f69bec0"}, + {file = "yarl-1.18.0.tar.gz", hash = "sha256:20d95535e7d833889982bfe7cc321b7f63bf8879788fee982c76ae2b24cfb715"}, ] [package.dependencies] From a1be572b34717222eced0e5d4e2227197e69b306 Mon Sep 17 00:00:00 2001 From: James Meakin <12661555+jmsmkn@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:16:16 +0100 Subject: [PATCH 03/16] Handle json memory error (#3717) --- app/grandchallenge/components/models.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/grandchallenge/components/models.py b/app/grandchallenge/components/models.py index 41743fa4df..2509eb20bd 100644 --- a/app/grandchallenge/components/models.py +++ b/app/grandchallenge/components/models.py @@ -1456,6 +1456,8 @@ def _validate_value(self): value = json.loads(f.read().decode("utf-8")) except JSONDecodeError as error: raise ValidationError(error) + except UnicodeDecodeError: + raise ValidationError("The file could not be decoded") except MemoryError as error: raise ValidationError( "The file was too large to process, " @@ -1473,8 +1475,15 @@ def validate_user_upload(self, user_upload): if self.interface.is_json_kind: try: value = json.loads(user_upload.read_object()) - except JSONDecodeError as e: - raise ValidationError(e) + except JSONDecodeError as error: + raise ValidationError(error) + except UnicodeDecodeError: + raise ValidationError("The file could not be decoded") + except MemoryError as error: + raise ValidationError( + "The file was too large to process, " + "please try again with a smaller file" + ) from error self.interface.validate_against_schema(value=value) elif self.interface.kind == InterfaceKindChoices.NEWICK: validate_newick_tree_format(tree=user_upload.read_object()) From 60245529ba881f592740301a1542d66bdfba9d92 Mon Sep 17 00:00:00 2001 From: Chris van Run Date: Tue, 26 Nov 2024 10:18:26 +0100 Subject: [PATCH 04/16] Process Newick files on `acks-late-2xlarge` (#3713) This PR introduces an (optional) custom upload processing queue per component interface. --- app/grandchallenge/components/models.py | 13 +++++- app/tests/components_tests/test_models.py | 53 ++++++++++++++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/app/grandchallenge/components/models.py b/app/grandchallenge/components/models.py index 2509eb20bd..c687c5857a 100644 --- a/app/grandchallenge/components/models.py +++ b/app/grandchallenge/components/models.py @@ -56,6 +56,7 @@ validate_no_slash_at_ends, validate_safe_path, ) +from grandchallenge.core.celery import acks_late_2xlarge_task from grandchallenge.core.error_handlers import ( FallbackCIVValidationErrorHandler, JobCIVErrorHandler, @@ -1212,6 +1213,10 @@ def clean(self): **{kind: ".json" for kind in InterfaceKind.interface_type_json()}, } +INTERFACE_KIND_TO_CUSTOM_QUEUE = { + InterfaceKindChoices.NEWICK: acks_late_2xlarge_task.queue, +} + def component_interface_value_path(instance, filename): # Convert the pk to a hex, padded to 4 chars with zeros @@ -2488,6 +2493,11 @@ def create_civ_for_file( elif user_upload: from grandchallenge.components.tasks import add_file_to_object + custom_queue = INTERFACE_KIND_TO_CUSTOM_QUEUE.get(ci.kind, False) + task_queue_kwarg = {} + if custom_queue: + task_queue_kwarg["queue"] = custom_queue + transaction.on_commit( add_file_to_object.signature( kwargs={ @@ -2497,7 +2507,8 @@ def create_civ_for_file( "interface_pk": str(ci.pk), "object_pk": self.pk, "linked_task": linked_task, - } + }, + **task_queue_kwarg, ).apply_async ) diff --git a/app/tests/components_tests/test_models.py b/app/tests/components_tests/test_models.py index 19f2802f4b..babd4e8e2d 100644 --- a/app/tests/components_tests/test_models.py +++ b/app/tests/components_tests/test_models.py @@ -15,6 +15,7 @@ from grandchallenge.cases.models import Image from grandchallenge.components.models import ( INTERFACE_TYPE_JSON_EXAMPLES, + CIVData, ComponentInterface, ComponentInterfaceExampleValue, ComponentInterfaceValue, @@ -45,12 +46,13 @@ ComponentInterfaceValueFactory, ) from tests.evaluation_tests.factories import EvaluationFactory, MethodFactory -from tests.factories import ImageFactory, WorkstationImageFactory +from tests.factories import ImageFactory, UserFactory, WorkstationImageFactory from tests.reader_studies_tests.factories import ( DisplaySetFactory, QuestionFactory, ReaderStudyFactory, ) +from tests.uploads_tests.factories import UserUploadFactory from tests.utils import create_raw_upload_image_session @@ -1634,3 +1636,52 @@ def test_component_interface_value_manager(): assert civ == civ1 assert not created + + +@pytest.mark.django_db +@pytest.mark.parametrize( + "kind,expected_kwargs", + ( + # Ensure queue is not passed since setting to None would + # have Celery use the Celery-scope default ("celerly") + ( + InterfaceKindChoices.STRING, + {}, + ), + ( + InterfaceKindChoices.NEWICK, + {"queue": "acks-late-2xlarge"}, + ), + ), +) +def test_component_interface_custom_queue(kind, expected_kwargs, mocker): + + ci = ComponentInterfaceFactory( + kind=kind, + store_in_database=False, + ) + user = UserFactory() + + # Need an existing CIVSet, use archive here since it is slightly easier setup + archive = ArchiveFactory() + archive.add_editor(user) + ai = ArchiveItemFactory.build(archive=None) + + mock_task_signature = mocker.patch( + "grandchallenge.components.tasks.add_file_to_object.signature" + ) + ai.validate_values_and_execute_linked_task( + values=[ + CIVData( + interface_slug=ci.slug, + value=UserUploadFactory(creator=user), + ) + ], + user=user, + ) + assert mock_task_signature.called_once() # Sanity + + # Ignore the to-task keyword arguments + del mock_task_signature.call_args.kwargs["kwargs"] + + assert mock_task_signature.call_args.kwargs == expected_kwargs From 72c60142793238f06a811099e684bba106579ffa Mon Sep 17 00:00:00 2001 From: Ammar Ammar <43293485+ammar257ammar@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:49:33 +0100 Subject: [PATCH 05/16] Flexible documentation link in view_content help text (#3723) related to https://github.com/DIAGNijmegen/rse-roadmap/issues/362 --- app/config/settings.py | 4 ++++ app/grandchallenge/hanging_protocols/forms.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/config/settings.py b/app/config/settings.py index bbc91b3a53..aa04149822 100644 --- a/app/config/settings.py +++ b/app/config/settings.py @@ -119,6 +119,10 @@ # Use AutoField for backwards compatibility DEFAULT_AUTO_FIELD = "django.db.models.AutoField" +DOCUMENTATION_HELP_VIEWER_CONTENT_SLUG = os.environ.get( + "DOCUMENTATION_HELP_VIEWER_CONTENT_SLUG", "viewer-content" +) + # General forum DOCUMENTATION_HELP_FORUM_PK = os.environ.get( "DOCUMENTATION_HELP_FORUM_PK", "1" diff --git a/app/grandchallenge/hanging_protocols/forms.py b/app/grandchallenge/hanging_protocols/forms.py index 157a126e5f..cf459ec03c 100644 --- a/app/grandchallenge/hanging_protocols/forms.py +++ b/app/grandchallenge/hanging_protocols/forms.py @@ -3,6 +3,7 @@ from crispy_forms.helper import FormHelper from crispy_forms.layout import ButtonHolder, Div, Layout, Submit from django import forms +from django.conf import settings from django.core.exceptions import ValidationError from django.utils.text import format_lazy @@ -157,7 +158,12 @@ def __init__(self, *args, **kwargs): self.fields["view_content"].help_text += format_lazy( 'Refer to the documentation for more information', - reverse("documentation:detail", args=["viewer-content"]), + reverse( + "documentation:detail", + kwargs={ + "slug": settings.DOCUMENTATION_HELP_VIEWER_CONTENT_SLUG + }, + ), ) def generate_view_content_example(self): From b32b8a42702ed4136d900460a4330687ff77bb10 Mon Sep 17 00:00:00 2001 From: Ammar Ammar <43293485+ammar257ammar@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:58:13 +0100 Subject: [PATCH 06/16] Add example to overlay_segments help text (#3716) This is related to Part 2 "Overlay segments" of pitch https://github.com/DIAGNijmegen/rse-roadmap/issues/362. The overlay_segments is used in three places: - It is used in [OverlaySegmentsMixin](https://github.com/comic/grand-challenge.org/blob/cdf9725db3e6b39c1ae69dfb0becb19938011d2e/app/grandchallenge/components/models.py#L311) which is used in: - [ComponentInterface](https://github.com/comic/grand-challenge.org/blob/cdf9725db3e6b39c1ae69dfb0becb19938011d2e/app/grandchallenge/components/models.py#L387) model - [Question](https://github.com/comic/grand-challenge.org/blob/cdf9725db3e6b39c1ae69dfb0becb19938011d2e/app/grandchallenge/reader_studies/models.py#L1233) model (reader studies) - It is used in the [WorkstationConfig](https://github.com/comic/grand-challenge.org/blob/cdf9725db3e6b39c1ae69dfb0becb19938011d2e/app/grandchallenge/workstation_configs/models.py#L131) model. This PR adds a default JSON example and a link to documentation to the overlay_segments field. --- app/config/settings.py | 4 + ...ter_componentinterface_overlay_segments.py | 88 ++++++++++++++++++ app/grandchallenge/components/models.py | 12 ++- app/grandchallenge/reader_studies/forms.py | 11 ++- .../0059_alter_question_overlay_segments.py | 88 ++++++++++++++++++ .../workstation_configs/forms.py | 21 +++-- ...lter_workstationconfig_overlay_segments.py | 91 +++++++++++++++++++ .../workstation_configs/models.py | 13 ++- 8 files changed, 314 insertions(+), 14 deletions(-) create mode 100644 app/grandchallenge/components/migrations/0023_alter_componentinterface_overlay_segments.py create mode 100644 app/grandchallenge/reader_studies/migrations/0059_alter_question_overlay_segments.py create mode 100644 app/grandchallenge/workstation_configs/migrations/0028_alter_workstationconfig_overlay_segments.py diff --git a/app/config/settings.py b/app/config/settings.py index aa04149822..8280fb453c 100644 --- a/app/config/settings.py +++ b/app/config/settings.py @@ -131,6 +131,10 @@ "DOCUMENTATION_HELP_FORUM_SLUG", "general" ) +DOCUMENTATION_HELP_INTERFACES_SLUG = os.environ.get( + "DOCUMENTATION_HELP_INTERFACES_SLUG", "interfaces" +) + # About Flatpage FLATPAGE_ABOUT_URL = os.environ.get("FLATPAGE_ABOUT_URL", "/about/") diff --git a/app/grandchallenge/components/migrations/0023_alter_componentinterface_overlay_segments.py b/app/grandchallenge/components/migrations/0023_alter_componentinterface_overlay_segments.py new file mode 100644 index 0000000000..f7ae4596e5 --- /dev/null +++ b/app/grandchallenge/components/migrations/0023_alter_componentinterface_overlay_segments.py @@ -0,0 +1,88 @@ +# Generated by Django 4.2.16 on 2024-11-28 13:12 + +from django.db import migrations, models + +import grandchallenge.core.validators + + +class Migration(migrations.Migration): + dependencies = [ + ("components", "0022_alter_componentinterface_kind_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="componentinterface", + name="overlay_segments", + field=models.JSONField( + blank=True, + default=list, + help_text='The schema that defines how categories of values in the overlay images are differentiated. Example usage: [{"name": "background", "visible": true, "voxel_value": 0},{"name": "tissue", "visible": true, "voxel_value": 1}]. If a categorical overlay is shown, it is possible to show toggles to change the visibility of the different overlay categories. To do so, configure the categories that should be displayed. Data from the algorithm\'s output.json can be added as an extra label to each toggle using jinja templating. For example: [{"name": "Level 0", "visible": false, "voxel_value": 0, "metric_template": "{{metrics.volumes[0]}} mm³"}]. ', + validators=[ + grandchallenge.core.validators.JSONValidator( + schema={ + "$id": "http://example.com/example.json", + "$schema": "http://json-schema.org/draft-06/schema", + "description": "Define the overlay segments for the LUT.", + "items": { + "$id": "#/items", + "additionalProperties": False, + "default": {}, + "description": "Defines what each segment of the LUT represents.", + "examples": [ + { + "metric_template": "{{metrics.volumes[0]}} mm³", + "name": "Metastasis", + "visible": True, + "voxel_value": 1, + } + ], + "maxItems": 64, + "properties": { + "metric_template": { + "$id": "#/items/properties/metric_template", + "default": "", + "description": "The jinja template to determine which property from the results.json should be used as the label text.", + "examples": [ + "{{metrics.volumes[0]}} mm³" + ], + "title": "The Metric Template Schema", + "type": "string", + }, + "name": { + "$id": "#/items/properties/name", + "default": "", + "description": "What this segment should be called.", + "examples": ["Metastasis"], + "title": "The Name Schema", + "type": "string", + }, + "visible": { + "$id": "#/items/properties/visible", + "default": True, + "description": "Whether this segment is visible by default.", + "examples": [True], + "title": "The Visible Schema", + "type": "boolean", + }, + "voxel_value": { + "$id": "#/items/properties/voxel_value", + "default": 0, + "description": "The value of the LUT for this segment.", + "examples": [1], + "title": "The Voxel Value Schema", + "type": "integer", + }, + }, + "required": ["voxel_value", "name", "visible"], + "title": "The Segment Schema", + "type": "object", + }, + "title": "The Overlay Segments Schema", + "type": "array", + } + ) + ], + ), + ), + ] diff --git a/app/grandchallenge/components/models.py b/app/grandchallenge/components/models.py index c687c5857a..87ffd4d58d 100644 --- a/app/grandchallenge/components/models.py +++ b/app/grandchallenge/components/models.py @@ -314,8 +314,16 @@ class OverlaySegmentsMixin(models.Model): blank=True, default=list, help_text=( - "The schema that defines how categories of values in the overlay " - "images are differentiated." + "The schema that defines how categories of values in the overlay images are differentiated. " + 'Example usage: [{"name": "background", "visible": true, "voxel_value": 0},' + '{"name": "tissue", "visible": true, "voxel_value": 1}]. ' + "If a categorical overlay is shown, " + "it is possible to show toggles to change the visibility of the different overlay categories. " + "To do so, configure the categories that should be displayed. Data from the " + "algorithm's output.json can be added as an extra label to each " + "toggle using jinja templating. " + 'For example: [{"name": "Level 0", "visible": false, "voxel_value": 0, ' + '"metric_template": "{{metrics.volumes[0]}} mm³"}]. ' ), validators=[JSONValidator(schema=OVERLAY_SEGMENTS_SCHEMA)], ) diff --git a/app/grandchallenge/reader_studies/forms.py b/app/grandchallenge/reader_studies/forms.py index 6d81921ca5..e8876f4aa1 100644 --- a/app/grandchallenge/reader_studies/forms.py +++ b/app/grandchallenge/reader_studies/forms.py @@ -13,6 +13,7 @@ Layout, Submit, ) +from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db.models import BLANK_CHOICE_DASH from django.forms import ( @@ -70,7 +71,7 @@ ReaderStudy, ReaderStudyPermissionRequest, ) -from grandchallenge.subdomains.utils import reverse_lazy +from grandchallenge.subdomains.utils import reverse, reverse_lazy from grandchallenge.workstation_configs.models import OVERLAY_SEGMENTS_SCHEMA logger = logging.getLogger(__name__) @@ -306,6 +307,14 @@ def __init__(self, *args, user, reader_study, **kwargs): *AnswerType.choices, ] + self.fields["overlay_segments"].help_text += format_lazy( + 'Refer to the documentation for more information', + reverse( + "documentation:detail", + kwargs={"slug": settings.DOCUMENTATION_HELP_INTERFACES_SLUG}, + ), + ) + if not self.user_can_add_interactive_algorithm: self.fields["interactive_algorithm"].widget = HiddenInput() self.fields["interactive_algorithm"].disabled = True diff --git a/app/grandchallenge/reader_studies/migrations/0059_alter_question_overlay_segments.py b/app/grandchallenge/reader_studies/migrations/0059_alter_question_overlay_segments.py new file mode 100644 index 0000000000..2d7d69e9c0 --- /dev/null +++ b/app/grandchallenge/reader_studies/migrations/0059_alter_question_overlay_segments.py @@ -0,0 +1,88 @@ +# Generated by Django 4.2.16 on 2024-11-28 13:12 + +from django.db import migrations, models + +import grandchallenge.core.validators + + +class Migration(migrations.Migration): + dependencies = [ + ("reader_studies", "0058_alter_question_options"), + ] + + operations = [ + migrations.AlterField( + model_name="question", + name="overlay_segments", + field=models.JSONField( + blank=True, + default=list, + help_text='The schema that defines how categories of values in the overlay images are differentiated. Example usage: [{"name": "background", "visible": true, "voxel_value": 0},{"name": "tissue", "visible": true, "voxel_value": 1}]. If a categorical overlay is shown, it is possible to show toggles to change the visibility of the different overlay categories. To do so, configure the categories that should be displayed. Data from the algorithm\'s output.json can be added as an extra label to each toggle using jinja templating. For example: [{"name": "Level 0", "visible": false, "voxel_value": 0, "metric_template": "{{metrics.volumes[0]}} mm³"}]. ', + validators=[ + grandchallenge.core.validators.JSONValidator( + schema={ + "$id": "http://example.com/example.json", + "$schema": "http://json-schema.org/draft-06/schema", + "description": "Define the overlay segments for the LUT.", + "items": { + "$id": "#/items", + "additionalProperties": False, + "default": {}, + "description": "Defines what each segment of the LUT represents.", + "examples": [ + { + "metric_template": "{{metrics.volumes[0]}} mm³", + "name": "Metastasis", + "visible": True, + "voxel_value": 1, + } + ], + "maxItems": 64, + "properties": { + "metric_template": { + "$id": "#/items/properties/metric_template", + "default": "", + "description": "The jinja template to determine which property from the results.json should be used as the label text.", + "examples": [ + "{{metrics.volumes[0]}} mm³" + ], + "title": "The Metric Template Schema", + "type": "string", + }, + "name": { + "$id": "#/items/properties/name", + "default": "", + "description": "What this segment should be called.", + "examples": ["Metastasis"], + "title": "The Name Schema", + "type": "string", + }, + "visible": { + "$id": "#/items/properties/visible", + "default": True, + "description": "Whether this segment is visible by default.", + "examples": [True], + "title": "The Visible Schema", + "type": "boolean", + }, + "voxel_value": { + "$id": "#/items/properties/voxel_value", + "default": 0, + "description": "The value of the LUT for this segment.", + "examples": [1], + "title": "The Voxel Value Schema", + "type": "integer", + }, + }, + "required": ["voxel_value", "name", "visible"], + "title": "The Segment Schema", + "type": "object", + }, + "title": "The Overlay Segments Schema", + "type": "array", + } + ) + ], + ), + ), + ] diff --git a/app/grandchallenge/workstation_configs/forms.py b/app/grandchallenge/workstation_configs/forms.py index fb58b1f260..df5a9b9eb2 100644 --- a/app/grandchallenge/workstation_configs/forms.py +++ b/app/grandchallenge/workstation_configs/forms.py @@ -1,10 +1,13 @@ from crispy_forms.helper import FormHelper from crispy_forms.layout import Fieldset, Layout, Submit +from django.conf import settings from django.forms import ModelForm +from django.utils.text import format_lazy from django_select2.forms import Select2MultipleWidget from grandchallenge.core.forms import SaveFormInitMixin from grandchallenge.core.widgets import ColorEditorWidget, JSONEditorWidget +from grandchallenge.subdomains.utils import reverse from grandchallenge.workstation_configs.models import ( KEY_BINDINGS_SCHEMA, OVERLAY_SEGMENTS_SCHEMA, @@ -84,6 +87,14 @@ def __init__(self, *args, read_only=False, **kwargs): ), ) + self.fields["overlay_segments"].help_text += format_lazy( + 'Refer to the documentation for more information', + reverse( + "documentation:detail", + kwargs={"slug": settings.DOCUMENTATION_HELP_INTERFACES_SLUG}, + ), + ) + if read_only: for field in self.fields: self.fields[field].disabled = True @@ -108,16 +119,6 @@ class Meta: "overlay_luts": Select2MultipleWidget, } help_texts = { - "overlay_segments": ( - model._meta.get_field("overlay_segments").help_text - + ". If an categorical overlay is shown, it is possible to show toggles " - "to change the visibility of the different overlay categories. To do " - "so, configure the categories that should be displayed. Data from the" - " algorithm's output.json can be added as an extra label to each " - "toggle using jinja templating. " - 'For example: [{ "voxel_value": 0, "name": "Level 0", "visible": ' - 'false, "metric_template": "{{metrics.volumes[0]}} mm³"},]' - ), "key_bindings": model._meta.get_field("key_bindings").help_text + ". A copy and paste JSON can be obtained from the viewer.", } diff --git a/app/grandchallenge/workstation_configs/migrations/0028_alter_workstationconfig_overlay_segments.py b/app/grandchallenge/workstation_configs/migrations/0028_alter_workstationconfig_overlay_segments.py new file mode 100644 index 0000000000..57976bf89e --- /dev/null +++ b/app/grandchallenge/workstation_configs/migrations/0028_alter_workstationconfig_overlay_segments.py @@ -0,0 +1,91 @@ +# Generated by Django 4.2.16 on 2024-11-28 13:12 + +from django.db import migrations, models + +import grandchallenge.core.validators + + +class Migration(migrations.Migration): + dependencies = [ + ( + "workstation_configs", + "0027_workstationconfig_point_bounding_box_size_mm", + ), + ] + + operations = [ + migrations.AlterField( + model_name="workstationconfig", + name="overlay_segments", + field=models.JSONField( + blank=True, + default=list, + help_text='The schema that defines how categories of values in the overlay images are differentiated. Example usage: [{"name": "background", "visible": true, "voxel_value": 0},{"name": "tissue", "visible": true, "voxel_value": 1}]. If a categorical overlay is shown, it is possible to show toggles to change the visibility of the different overlay categories. To do so, configure the categories that should be displayed. Data from the algorithm\'s output.json can be added as an extra label to each toggle using jinja templating. For example: [{"name": "Level 0", "visible": false, "voxel_value": 0, "metric_template": "{{metrics.volumes[0]}} mm³"}]. ', + validators=[ + grandchallenge.core.validators.JSONValidator( + schema={ + "$id": "http://example.com/example.json", + "$schema": "http://json-schema.org/draft-06/schema", + "description": "Define the overlay segments for the LUT.", + "items": { + "$id": "#/items", + "additionalProperties": False, + "default": {}, + "description": "Defines what each segment of the LUT represents.", + "examples": [ + { + "metric_template": "{{metrics.volumes[0]}} mm³", + "name": "Metastasis", + "visible": True, + "voxel_value": 1, + } + ], + "maxItems": 64, + "properties": { + "metric_template": { + "$id": "#/items/properties/metric_template", + "default": "", + "description": "The jinja template to determine which property from the results.json should be used as the label text.", + "examples": [ + "{{metrics.volumes[0]}} mm³" + ], + "title": "The Metric Template Schema", + "type": "string", + }, + "name": { + "$id": "#/items/properties/name", + "default": "", + "description": "What this segment should be called.", + "examples": ["Metastasis"], + "title": "The Name Schema", + "type": "string", + }, + "visible": { + "$id": "#/items/properties/visible", + "default": True, + "description": "Whether this segment is visible by default.", + "examples": [True], + "title": "The Visible Schema", + "type": "boolean", + }, + "voxel_value": { + "$id": "#/items/properties/voxel_value", + "default": 0, + "description": "The value of the LUT for this segment.", + "examples": [1], + "title": "The Voxel Value Schema", + "type": "integer", + }, + }, + "required": ["voxel_value", "name", "visible"], + "title": "The Segment Schema", + "type": "object", + }, + "title": "The Overlay Segments Schema", + "type": "array", + } + ) + ], + ), + ), + ] diff --git a/app/grandchallenge/workstation_configs/models.py b/app/grandchallenge/workstation_configs/models.py index 66deb486f8..ede9db8f09 100644 --- a/app/grandchallenge/workstation_configs/models.py +++ b/app/grandchallenge/workstation_configs/models.py @@ -262,7 +262,18 @@ class ImageInterpolationType(models.TextChoices): default=list, blank=True, validators=[JSONValidator(schema=OVERLAY_SEGMENTS_SCHEMA)], - help_text="The schema that defines how categories of values in the overlay images are differentiated", + help_text=( + "The schema that defines how categories of values in the overlay images are differentiated. " + 'Example usage: [{"name": "background", "visible": true, "voxel_value": 0},' + '{"name": "tissue", "visible": true, "voxel_value": 1}]. ' + "If a categorical overlay is shown, " + "it is possible to show toggles to change the visibility of the different overlay categories. " + "To do so, configure the categories that should be displayed. Data from the " + "algorithm's output.json can be added as an extra label to each " + "toggle using jinja templating. " + 'For example: [{"name": "Level 0", "visible": false, "voxel_value": 0, ' + '"metric_template": "{{metrics.volumes[0]}} mm³"}]. ' + ), ) key_bindings = models.JSONField( From 7ad88f92508e26841711446dc0429ed928efd972 Mon Sep 17 00:00:00 2001 From: Chris van Run Date: Mon, 2 Dec 2024 10:39:33 +0100 Subject: [PATCH 07/16] Fix PUT for ArchiveItem/DisplaySet (#3703) Fixes #3701 Extracts the PostSerializer logic for both `ArchiveItemViewSet` and `DisplaySetViewSet` to address missing logic for PUT / 'update' action. In theory, this also allows overwriting of interfaces: simply PUT a new set of interfaces that re-uses a value/image/file of an earlier one. --- app/grandchallenge/archives/serializers.py | 53 ++----------- app/grandchallenge/archives/views.py | 2 +- app/grandchallenge/components/serializers.py | 78 +++++++++++++++++++ .../reader_studies/serializers.py | 11 ++- app/grandchallenge/reader_studies/views.py | 53 ------------- app/tests/archives_tests/test_views.py | 59 +++++++++++--- app/tests/reader_studies_tests/test_api.py | 47 ++++++++++- 7 files changed, 185 insertions(+), 118 deletions(-) diff --git a/app/grandchallenge/archives/serializers.py b/app/grandchallenge/archives/serializers.py index 4b4d809a42..f586563317 100644 --- a/app/grandchallenge/archives/serializers.py +++ b/app/grandchallenge/archives/serializers.py @@ -1,17 +1,12 @@ import logging from rest_framework import serializers -from rest_framework.exceptions import ValidationError as DRFValidationError from rest_framework.fields import JSONField, ReadOnlyField, URLField from rest_framework.relations import HyperlinkedRelatedField from grandchallenge.archives.models import Archive, ArchiveItem -from grandchallenge.components.backends.exceptions import ( - CIVNotEditableException, -) -from grandchallenge.components.models import CIVData from grandchallenge.components.serializers import ( - ComponentInterfaceValuePostSerializer, + CIVSetPostSerializerMixin, HyperlinkedComponentInterfaceValueSerializer, ) from grandchallenge.core.guardian import filter_by_permission @@ -74,59 +69,23 @@ class Meta: ) -class ArchiveItemPostSerializer(ArchiveItemSerializer): +class ArchiveItemPostSerializer( + CIVSetPostSerializerMixin, + ArchiveItemSerializer, +): archive = HyperlinkedRelatedField( queryset=Archive.objects.none(), view_name="api:archive-detail", - write_only=True, + required=False, ) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.fields["values"] = ComponentInterfaceValuePostSerializer( - many=True, context=self.context - ) if "request" in self.context: user = self.context["request"].user - self.fields["archive"].queryset = filter_by_permission( queryset=Archive.objects.all(), user=user, codename="upload_archive", ) - - def create(self, validated_data): - if validated_data.pop("values") != []: - raise DRFValidationError("Values can only be added via update") - return super().create(validated_data) - - def update(self, instance, validated_data): - values = validated_data.pop("values") - civs = [] - for value in values: - interface = value.get("interface", None) - upload_session = value.get("upload_session", None) - user_upload = value.get("user_upload", None) - image = value.get("image", None) - value = value.get("value", None) - civs.append( - CIVData( - interface_slug=interface.slug, - value=upload_session or user_upload or image or value, - ) - ) - try: - instance.validate_values_and_execute_linked_task( - values=civs, - user=self.context["request"].user, - ) - except CIVNotEditableException as e: - error_handler = instance.get_error_handler() - error_handler.handle_error( - error_message="An unexpected error occurred", - user=self.context["request"].user, - ) - logger.error(e, exc_info=True) - - return instance diff --git a/app/grandchallenge/archives/views.py b/app/grandchallenge/archives/views.py index 327b88f40e..d73a06dc02 100644 --- a/app/grandchallenge/archives/views.py +++ b/app/grandchallenge/archives/views.py @@ -541,7 +541,7 @@ class ArchiveItemViewSet( filterset_fields = ["archive"] def get_serializer_class(self): - if "update" in self.action or "create" in self.action: + if self.action in ["partial_update", "update", "create"]: return ArchiveItemPostSerializer else: return ArchiveItemSerializer diff --git a/app/grandchallenge/components/serializers.py b/app/grandchallenge/components/serializers.py index 61bb871f8d..730c546e87 100644 --- a/app/grandchallenge/components/serializers.py +++ b/app/grandchallenge/components/serializers.py @@ -1,9 +1,16 @@ +import logging + from rest_framework import serializers +from rest_framework.exceptions import ValidationError as DRFValidationError from rest_framework.fields import SerializerMethodField from rest_framework.relations import SlugRelatedField from grandchallenge.cases.models import Image, RawImageUploadSession +from grandchallenge.components.backends.exceptions import ( + CIVNotEditableException, +) from grandchallenge.components.models import ( + CIVData, ComponentInterface, ComponentInterfaceValue, ) @@ -13,6 +20,8 @@ LookUpTableSerializer, ) +logger = logging.getLogger(__name__) + class ComponentInterfaceSerializer(serializers.ModelSerializer): kind = serializers.CharField(source="get_kind_display", read_only=True) @@ -172,3 +181,72 @@ class HyperlinkedComponentInterfaceValueSerializer( read_only=True, allow_null=True, ) + + +class CIVSetPostSerializerMixin: + + editability_error_message = "This object cannot be updated." + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + self.fields["values"] = ComponentInterfaceValuePostSerializer( + many=True, + context=self.context, + required=False, + ) + + def create(self, validated_data): + if validated_data.pop("values", None): + raise DRFValidationError("Values can only be added via update") + return super().create(validated_data) + + def update(self, instance, validated_data): + + if not instance.is_editable: + raise DRFValidationError(self.editability_error_message) + + values = validated_data.pop("values", []) + + instance = super().update(instance, validated_data) + + request = self.context["request"] + + civs = [] + + for value in values: + interface = value["interface"] + upload_session = value.get("upload_session", None) + user_upload = value.get("user_upload", None) + image = value.get("image", None) + value = value.get("value", None) + civs.append( + CIVData( + interface_slug=interface.slug, + value=upload_session or user_upload or image or value, + ) + ) + try: + instance.validate_values_and_execute_linked_task( + values=civs, + user=request.user, + ) + except CIVNotEditableException as e: + error_handler = instance.get_error_handler() + error_handler.handle_error( + error_message="An unexpected error occurred", + user=request.user, + ) + logger.error(e, exc_info=True) + + if not self.partial: + instance.refresh_from_db() + current_civs = { + civ.interface.slug: civ for civ in instance.values.all() + } + current_interfaces = set(current_civs.keys()) + updated_interfaces = {v["interface"].slug for v in values} + for interface in current_interfaces - updated_interfaces: + self.instance.remove_civ(civ=current_civs[interface]) + + return instance diff --git a/app/grandchallenge/reader_studies/serializers.py b/app/grandchallenge/reader_studies/serializers.py index 9828c5073d..f987af53ae 100644 --- a/app/grandchallenge/reader_studies/serializers.py +++ b/app/grandchallenge/reader_studies/serializers.py @@ -18,8 +18,8 @@ from grandchallenge.components.schemas import ANSWER_TYPE_SCHEMA from grandchallenge.components.serializers import ( + CIVSetPostSerializerMixin, ComponentInterfaceSerializer, - ComponentInterfaceValuePostSerializer, HyperlinkedComponentInterfaceValueSerializer, ) from grandchallenge.core.guardian import filter_by_permission @@ -142,11 +142,16 @@ class Meta: ) -class DisplaySetPostSerializer(DisplaySetSerializer): +class DisplaySetPostSerializer( + CIVSetPostSerializerMixin, + DisplaySetSerializer, +): + editability_error_message = ( + "This display set cannot be changed, as answers for it already exist." + ) reader_study = SlugRelatedField( slug_field="slug", queryset=ReaderStudy.objects.none(), required=False ) - values = ComponentInterfaceValuePostSerializer(many=True, required=False) def create(self, validated_data): if validated_data.pop("values", []) != []: diff --git a/app/grandchallenge/reader_studies/views.py b/app/grandchallenge/reader_studies/views.py index d1ae2c2e61..50824bf6f6 100644 --- a/app/grandchallenge/reader_studies/views.py +++ b/app/grandchallenge/reader_studies/views.py @@ -17,7 +17,6 @@ from django.http import ( Http404, HttpResponse, - HttpResponseBadRequest, HttpResponseForbidden, HttpResponseRedirect, JsonResponse, @@ -57,13 +56,6 @@ from grandchallenge.archives.forms import AddCasesForm from grandchallenge.cases.models import Image, RawImageUploadSession -from grandchallenge.components.backends.exceptions import ( - CIVNotEditableException, -) -from grandchallenge.components.models import CIVData -from grandchallenge.components.serializers import ( - ComponentInterfaceValuePostSerializer, -) from grandchallenge.components.views import ( CIVSetBulkDelete, CIVSetDelete, @@ -983,51 +975,6 @@ def get_serializer_class(self): return DisplaySetPostSerializer return DisplaySetSerializer - def partial_update(self, request, pk=None): - instance = self.get_object() - if not instance.is_editable: - return HttpResponseBadRequest( - "This display set cannot be changed, " - "as answers for it already exist." - ) - values = request.data.pop("values", None) - if values: - serialized_data = ComponentInterfaceValuePostSerializer( - many=True, data=values, context={"request": request} - ) - if serialized_data.is_valid(): - civs = [] - for value in serialized_data.validated_data: - interface = value.get("interface", None) - user_upload = value.get("user_upload", None) - upload_session = value.get("upload_session", None) - image = value.get("image", None) - value = value.get("value", None) - civs.append( - CIVData( - interface_slug=interface.slug, - value=upload_session - or user_upload - or image - or value, - ) - ) - try: - instance.validate_values_and_execute_linked_task( - values=civs, - user=request.user, - ) - except CIVNotEditableException as e: - error_handler = self.instance.get_error_handler() - error_handler.handle_error( - error_message="An unexpected error occurred", - user=request.user, - ) - logger.error(e, exc_info=True) - else: - raise DRFValidationError(serialized_data.errors) - return super().partial_update(request, pk) - def list(self, request, *args, **kwargs): queryset = self.filter_queryset(self.get_queryset()) # Note: if more fields besides 'reader_study' are added to the diff --git a/app/tests/archives_tests/test_views.py b/app/tests/archives_tests/test_views.py index d5aad0f38f..0a1a309fa1 100644 --- a/app/tests/archives_tests/test_views.py +++ b/app/tests/archives_tests/test_views.py @@ -313,16 +313,51 @@ def test_api_archive_item_add_and_update_value( editor = UserFactory() archive.add_editor(editor) item = ArchiveItemFactory(archive=archive) - ci = ComponentInterfaceFactory( + ci_bool = ComponentInterfaceFactory( kind=InterfaceKind.InterfaceKindChoices.BOOL ) + ci_int = ComponentInterfaceFactory( + kind=InterfaceKind.InterfaceKindChoices.INTEGER + ) # add civ with django_capture_on_commit_callbacks() as callbacks: response = get_view_for_user( viewname="api:archives-item-detail", reverse_kwargs={"pk": item.pk}, - data={"values": [{"interface": ci.slug, "value": True}]}, + data={ + "values": [ + {"interface": ci_bool.slug, "value": True}, + {"interface": ci_int.slug, "value": 42}, + ] + }, + user=editor, + client=client, + method=client.patch, + content_type="application/json", + HTTP_X_FORWARDED_PROTO="https", + ) + recurse_callbacks( + callbacks=callbacks, + django_capture_on_commit_callbacks=django_capture_on_commit_callbacks, + ) + + assert response.status_code == 200, response.content + assert response.json()["pk"] == str(item.pk) + item.refresh_from_db() + + assert item.values.count() == 2 + civ_bool = item.values.filter(interface__slug=ci_bool.slug).get() + assert civ_bool.value + civ_int = item.values.filter(interface__slug=ci_int.slug).get() + assert civ_int.value == 42 + + # (partial) update civ + with django_capture_on_commit_callbacks() as callbacks: + response = get_view_for_user( + viewname="api:archives-item-detail", + reverse_kwargs={"pk": item.pk}, + data={"values": [{"interface": ci_bool.slug, "value": False}]}, user=editor, client=client, method=client.patch, @@ -337,20 +372,19 @@ def test_api_archive_item_add_and_update_value( assert response.status_code == 200 assert response.json()["pk"] == str(item.pk) item.refresh_from_db() - assert item.values.count() == 1 - civ = item.values.get() - assert civ.interface.slug == ci.slug - assert civ.value + assert item.values.count() == 2 + new_civ_bool = item.values.filter(interface__slug=ci_bool.slug).get() + assert not new_civ_bool.value # update civ with django_capture_on_commit_callbacks() as callbacks: response = get_view_for_user( viewname="api:archives-item-detail", reverse_kwargs={"pk": item.pk}, - data={"values": [{"interface": ci.slug, "value": False}]}, + data={"values": [{"interface": ci_int.slug, "value": 7}]}, user=editor, client=client, - method=client.patch, + method=client.put, content_type="application/json", HTTP_X_FORWARDED_PROTO="https", ) @@ -363,9 +397,10 @@ def test_api_archive_item_add_and_update_value( assert response.json()["pk"] == str(item.pk) item.refresh_from_db() assert item.values.count() == 1 - new_civ = item.values.get() - assert new_civ.interface.slug == ci.slug - assert new_civ != civ + + new_civ_int = item.values.get() + assert new_civ_int.value == 7 + assert new_civ_int != civ_int @pytest.mark.django_db @@ -414,7 +449,7 @@ def test_api_archive_item_add_and_update_non_image_file( civ = item.values.get() assert civ.interface.slug == ci.slug - # update civ + # partial update civ upload2 = create_upload_from_file( creator=editor, file_path=RESOURCE_PATH / "test.zip" ) diff --git a/app/tests/reader_studies_tests/test_api.py b/app/tests/reader_studies_tests/test_api.py index 304c8a5a9d..e0e8b5c52f 100644 --- a/app/tests/reader_studies_tests/test_api.py +++ b/app/tests/reader_studies_tests/test_api.py @@ -1707,6 +1707,7 @@ def test_display_set_add_and_edit( ) assert response.json() == ["Values can only be added via update"] + # Add display set response = get_view_for_user( viewname="api:reader-studies-display-set-list", user=r1, @@ -1716,6 +1717,8 @@ def test_display_set_add_and_edit( data={"reader_study": rs.slug}, ) + assert response.status_code == 201 + ds = DisplaySet.objects.get(pk=response.json()["pk"]) with django_capture_on_commit_callbacks(execute=True): response = get_view_for_user( @@ -1818,6 +1821,46 @@ def test_display_set_add_and_edit( ds.refresh_from_db() assert ds.values.count() == 3 + with django_capture_on_commit_callbacks(execute=True): + response = get_view_for_user( + viewname="api:reader-studies-display-set-detail", + reverse_kwargs={"pk": ds.pk}, + user=r1, + client=client, + method=client.put, + content_type="application/json", + data={ + "values": [{"interface": ci.slug, "value": True}], + }, + ) + + ds.refresh_from_db() + assert ds.values.count() == 1 + + # Test updating title and order (no values) + assert ds.title == "" + old_order = ds.order + + with django_capture_on_commit_callbacks(execute=True): + response = get_view_for_user( + viewname="api:reader-studies-display-set-detail", + reverse_kwargs={"pk": ds.pk}, + user=r1, + client=client, + method=client.patch, + content_type="application/json", + data={ + "title": "foo", + "order": old_order + 1, + }, + ) + + assert response.status_code == 200 + ds.refresh_from_db() + assert ds.title == "foo" + assert ds.order == old_order + 1 + assert ds.values.count() == 1 + # Create another display set ds2 = DisplaySetFactory(reader_study=rs) civ = ComponentInterfaceValueFactory(interface=ci, value=False) @@ -1839,9 +1882,9 @@ def test_display_set_add_and_edit( ) assert response.status_code == 400 - assert response.content.decode("utf-8") == ( + assert response.json() == [ "This display set cannot be changed, as answers for it already exist." - ) + ] @pytest.mark.django_db From 5ed1b3bbc14297e08a4bff48e1030f4969c9a90a Mon Sep 17 00:00:00 2001 From: James Meakin <12661555+jmsmkn@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:44:15 +0100 Subject: [PATCH 08/16] Handle corrupt log lines See https://github.com/DIAGNijmegen/rse-grand-challenge-admin/issues/393 --- .../components/backends/docker_client.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/grandchallenge/components/backends/docker_client.py b/app/grandchallenge/components/backends/docker_client.py index 04dee66541..313d94fd2e 100644 --- a/app/grandchallenge/components/backends/docker_client.py +++ b/app/grandchallenge/components/backends/docker_client.py @@ -1,4 +1,5 @@ import json +import logging import os import shlex from subprocess import CalledProcessError, run @@ -10,6 +11,8 @@ from grandchallenge.components.registry import _get_registry_auth_config from grandchallenge.evaluation.utils import get +logger = logging.getLogger(__name__) + def _run_docker_command(*args, authenticate=False): clean_command = shlex.join(["docker", *args]) @@ -136,9 +139,18 @@ def get_logs(*, name, tail=None): if tail is not None: args.extend(["--tail", str(tail)]) - result = _run_docker_command(*args, container_id) - - return result.stdout.splitlines() + result.stderr.splitlines() + try: + result = _run_docker_command(*args, container_id) + return result.stdout.splitlines() + result.stderr.splitlines() + except CalledProcessError as error: + if ( + "error from daemon in stream: Error grabbing logs: invalid character" + in error.stderr + ): + logger.error("Docker logs are corrupt", exc_info=True) + return error.stdout.splitlines() + else: + raise error def run_container( # noqa: C901 From 9a6f4b1517530c3765f6e1a46e3eec69e8c0e8a5 Mon Sep 17 00:00:00 2001 From: Ammar Ammar <43293485+ammar257ammar@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:33:43 +0100 Subject: [PATCH 09/16] Include hanging protocols check in view_content_example generation (#3722) closes #3721 Basically, example generation should create example with viewports equal to the viewports in the hanging protocol json (if the hanging protocol is defined). Otherwise, the viewports can be up to the number of values in ViewportNames --- app/grandchallenge/hanging_protocols/forms.py | 78 +++++++++++-- .../hanging_protocols_tests/test_forms.py | 105 +++++++++++++++++- 2 files changed, 173 insertions(+), 10 deletions(-) diff --git a/app/grandchallenge/hanging_protocols/forms.py b/app/grandchallenge/hanging_protocols/forms.py index cf459ec03c..4556be190a 100644 --- a/app/grandchallenge/hanging_protocols/forms.py +++ b/app/grandchallenge/hanging_protocols/forms.py @@ -1,4 +1,5 @@ import json +from typing import NamedTuple from crispy_forms.helper import FormHelper from crispy_forms.layout import ButtonHolder, Div, Layout, Submit @@ -132,6 +133,12 @@ def _validate_slice_plane_indicator(self, *, viewport, viewport_names): ) +class InterfaceLists(NamedTuple): + images: list[str] + mandatory_isolation_interfaces: list[str] + overlays: list[str] + + class ViewContentExampleMixin: def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -166,7 +173,7 @@ def __init__(self, *args, **kwargs): ), ) - def generate_view_content_example(self): + def _get_interface_lists(self): images = [ interface.slug for interface in self.instance.interfaces @@ -178,10 +185,6 @@ def generate_view_content_example(self): if interface.kind in InterfaceKind.interface_type_mandatory_isolation() ] - - if not images and not mandatory_isolation_interfaces: - return None - overlays = [ interface.slug for interface in self.instance.interfaces @@ -192,14 +195,52 @@ def generate_view_content_example(self): InterfaceKindChoices.IMAGE, ) ] + return InterfaceLists( + images=images, + mandatory_isolation_interfaces=mandatory_isolation_interfaces, + overlays=overlays, + ) - if images: - overlays_per_image = len(overlays) // len(images) - remaining_overlays = len(overlays) % len(images) + def _get_viewports(self): + if self.instance.hanging_protocol: + return { + x["viewport_name"] + for x in self.instance.hanging_protocol.json + if "viewport_name" in x + } + return ViewportNames.values + def _build_view_content( + self, images, mandatory_isolation_interfaces, overlays, viewports + ): view_content_example = {} - for port in ViewportNames.values: + if self.instance.hanging_protocol: + viewport_count = len(viewports) + + if mandatory_isolation_interfaces: + mandatory_isolation_interfaces = ( + mandatory_isolation_interfaces + * (viewport_count // len(mandatory_isolation_interfaces)) + + mandatory_isolation_interfaces[ + : ( + viewport_count + % len(mandatory_isolation_interfaces) + ) + ] + ) + viewport_count -= len(mandatory_isolation_interfaces) + + if images: + images = ( + images * (viewport_count // len(images)) + + images[: (viewport_count % len(images))] + ) + + overlays_per_image = len(overlays) // len(images) if images else 0 + remaining_overlays = len(overlays) % len(images) if images else 0 + + for port in viewports: if mandatory_isolation_interfaces: view_content_example[port] = [ mandatory_isolation_interfaces.pop(0) @@ -212,6 +253,25 @@ def generate_view_content_example(self): view_content_example[port].append(overlays.pop(0)) remaining_overlays -= 1 + return view_content_example + + def generate_view_content_example(self): + interface_lists = self._get_interface_lists() + + if ( + not interface_lists.images + and not interface_lists.mandatory_isolation_interfaces + ): + return None + + viewports = self._get_viewports() + view_content_example = self._build_view_content( + interface_lists.images.copy(), + interface_lists.mandatory_isolation_interfaces.copy(), + interface_lists.overlays.copy(), + viewports, + ) + try: JSONValidator(schema=VIEW_CONTENT_SCHEMA)( value=view_content_example diff --git a/app/tests/hanging_protocols_tests/test_forms.py b/app/tests/hanging_protocols_tests/test_forms.py index dae3059b0d..45b0180931 100644 --- a/app/tests/hanging_protocols_tests/test_forms.py +++ b/app/tests/hanging_protocols_tests/test_forms.py @@ -11,6 +11,9 @@ InterfaceKind, InterfaceKindChoices, ) +from grandchallenge.core.utils.access_requests import ( + AccessRequestHandlingOptions, +) from grandchallenge.evaluation.forms import PhaseUpdateForm from grandchallenge.hanging_protocols.forms import HangingProtocolForm from grandchallenge.hanging_protocols.models import HangingProtocol @@ -22,7 +25,7 @@ ComponentInterfaceValueFactory, ) from tests.evaluation_tests.factories import PhaseFactory -from tests.factories import UserFactory +from tests.factories import UserFactory, WorkstationFactory from tests.hanging_protocols_tests.factories import HangingProtocolFactory from tests.hanging_protocols_tests.test_models import HangingProtocolTestModel from tests.reader_studies_tests.factories import DisplaySetFactory @@ -666,3 +669,103 @@ def test_generate_view_content_example( ) assert view_content_example_json == expected_example_json + + +@pytest.mark.django_db +@pytest.mark.parametrize( + "hanging_protocol_json,view_content_example_json_expected_keys", + ( + (None, {"main", "secondary", "tertiary", "quaternary"}), + ([{}], {}), + ( + [{"viewport_name": "main"}, {"viewport_name": "secondary"}], + {"main", "secondary"}, + ), + ( + [ + {"viewport_name": "main"}, + {"viewport_name": "secondary"}, + {"viewport_name": "tertiary"}, + {"viewport_name": "quaternary"}, + ], + {"main", "secondary", "tertiary", "quaternary"}, + ), + ( + [ + {"viewport_name": "main"}, + {"viewport_name": "secondary"}, + {"viewport_name": "tertiary"}, + {"viewport_name": "quaternary"}, + {"viewport_name": "quinary"}, + ], + {"main", "secondary", "tertiary", "quaternary", "quinary"}, + ), + ), +) +@pytest.mark.parametrize( + "num_of_images,num_of_isolated_interfaces", + ( + (4, 0), + (1, 3), + (2, 2), + (3, 1), + (0, 4), + ), +) +def test_reader_study_forms_view_content_example_with_hanging_protocol( + hanging_protocol_json, + view_content_example_json_expected_keys, + num_of_images, + num_of_isolated_interfaces, +): + ci_list = make_ci_list( + number_of_images=num_of_images, + number_of_overlays=2, + number_of_isolated_interfaces=num_of_isolated_interfaces, + number_of_undisplayable_interfaces=1, + ) + civ_list = [ComponentInterfaceValueFactory(interface=ci) for ci in ci_list] + + object = DisplaySetFactory() + object.values.set(civ_list) + + ws = WorkstationFactory() + creator = UserFactory() + ws.add_user(creator) + + form_data = { + "title": "foo bar", + "workstation": ws.pk, + "allow_answer_modification": True, + "shuffle_hanging_list": False, + "allow_case_navigation": False, + "access_request_handling": AccessRequestHandlingOptions.MANUAL_REVIEW, + "roll_over_answers_for_n_cases": 0, + "public": True, + "description": "test description", + "is_educational": False, + "instant_verification": False, + } + + if hanging_protocol_json: + form_data["hanging_protocol"] = HangingProtocolFactory( + json=hanging_protocol_json + ) + + form = ReaderStudyUpdateForm( + user=creator, + instance=object.base_object, + data=form_data, + ) + + assert form.is_valid() + + view_content_example = form.generate_view_content_example() + view_content_example_keys = ( + set(json.loads(view_content_example).keys()) + if view_content_example + else None + ) + assert view_content_example_keys == set( + view_content_example_json_expected_keys + ) From cfd5c6741ad0396f3e70ae25dae30f5299877862 Mon Sep 17 00:00:00 2001 From: Thomas Koopman Date: Mon, 2 Dec 2024 14:04:28 +0100 Subject: [PATCH 10/16] Adds adjustable gpu types for algorithms (#3714) Make the selectable gpu type and maximum memory setting for algorithms adjustable using Phase settings. Relevant phases are filtered when updating or creating an algorithm, this is based on inputs and outputs match, participant match, the phase submissions kind must be algorithm, and the phase must be public. The new Phase settings are also used to validate algorithm gpu and memory settings when it is submitted to the phase. See https://github.com/DIAGNijmegen/rse-roadmap/issues/346 --- app/grandchallenge/algorithms/forms.py | 91 +++++++- app/grandchallenge/evaluation/forms.py | 36 ++- ...thm_maximum_settable_memory_gb_and_more.py | 55 +++++ app/grandchallenge/evaluation/models.py | 18 ++ app/tests/algorithms_tests/test_forms.py | 216 ++++++++++++++++++ app/tests/evaluation_tests/test_views.py | 2 + 6 files changed, 405 insertions(+), 13 deletions(-) create mode 100644 app/grandchallenge/evaluation/migrations/0070_phase_algorithm_maximum_settable_memory_gb_and_more.py diff --git a/app/grandchallenge/algorithms/forms.py b/app/grandchallenge/algorithms/forms.py index ffc9133226..159b111403 100644 --- a/app/grandchallenge/algorithms/forms.py +++ b/app/grandchallenge/algorithms/forms.py @@ -15,6 +15,7 @@ from dal import autocomplete from django.conf import settings from django.contrib.auth import get_user_model +from django.contrib.postgres.aggregates import ArrayAgg from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.core.files.base import ContentFile from django.core.validators import ( @@ -22,7 +23,7 @@ MinValueValidator, RegexValidator, ) -from django.db.models import Count, Exists, OuterRef, Q +from django.db.models import Count, Exists, Max, OuterRef, Q from django.db.transaction import on_commit from django.forms import ( CharField, @@ -81,7 +82,7 @@ JSONEditorWidget, MarkdownEditorInlineWidget, ) -from grandchallenge.evaluation.utils import get +from grandchallenge.evaluation.utils import SubmissionKindChoices, get from grandchallenge.groups.forms import UserGroupForm from grandchallenge.hanging_protocols.forms import ViewContentExampleMixin from grandchallenge.hanging_protocols.models import VIEW_CONTENT_SCHEMA @@ -365,20 +366,87 @@ class Meta: "workstation_config": "Viewer Configuration", } - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) + def __init__(self, *args, user, **kwargs): + super().__init__(*args, user=user, **kwargs) + self._user = user self.fields["contact_email"].required = True self.fields["display_editors"].required = True - self.fields["job_requires_gpu_type"].choices = [ - (choice.value, choice.label) - for choice in [GPUTypeChoices.NO_GPU, GPUTypeChoices.T4] - ] + self.fields["job_requires_gpu_type"].choices = ( + self.selectable_gpu_type_choices + ) self.fields["job_requires_memory_gb"].validators = [ MinValueValidator(settings.ALGORITHMS_MIN_MEMORY_GB), - MaxValueValidator(settings.ALGORITHMS_MAX_MEMORY_GB), + MaxValueValidator(self.maximum_settable_memory_gb), + ] + + @cached_property + def job_requirement_properties_from_phases(self): + qs = get_objects_for_user( + self._user, "evaluation.create_phase_submission" + ) + inputs = self.instance.inputs.all() + outputs = self.instance.outputs.all() + return ( + qs.annotate( + total_algorithm_input_count=Count( + "algorithm_inputs", distinct=True + ), + total_algorithm_output_count=Count( + "algorithm_outputs", distinct=True + ), + relevant_algorithm_input_count=Count( + "algorithm_inputs", + filter=Q(algorithm_inputs__in=inputs), + distinct=True, + ), + relevant_algorithm_output_count=Count( + "algorithm_outputs", + filter=Q(algorithm_outputs__in=outputs), + distinct=True, + ), + ) + .filter( + submission_kind=SubmissionKindChoices.ALGORITHM, + public=True, + total_algorithm_input_count=len(inputs), + total_algorithm_output_count=len(outputs), + relevant_algorithm_input_count=len(inputs), + relevant_algorithm_output_count=len(outputs), + ) + .aggregate( + max_memory=Max("algorithm_maximum_settable_memory_gb"), + gpu_type_choices=ArrayAgg( + "algorithm_selectable_gpu_type_choices", distinct=True + ), + ) + ) + + @property + def selectable_gpu_type_choices(self): + choices_set = { + GPUTypeChoices.NO_GPU, + GPUTypeChoices.T4, + *chain.from_iterable( + self.job_requirement_properties_from_phases["gpu_type_choices"] + ), + } + return [ + (choice.value, choice.label) + for choice in GPUTypeChoices + if choice in choices_set + ] + + @property + def maximum_settable_memory_gb(self): + value = settings.ALGORITHMS_MAX_MEMORY_GB + maximum_in_phases = self.job_requirement_properties_from_phases[ + "max_memory" ] + if maximum_in_phases is not None: + value = max(value, maximum_in_phases) + return value class UserAlgorithmsForPhaseMixin: @@ -544,11 +612,12 @@ def __init__( self.fields["job_requires_gpu_type"].choices = [ (choice.value, choice.label) - for choice in [GPUTypeChoices.NO_GPU, GPUTypeChoices.T4] + for choice in GPUTypeChoices + if choice in phase.algorithm_selectable_gpu_type_choices ] self.fields["job_requires_memory_gb"].validators = [ MinValueValidator(settings.ALGORITHMS_MIN_MEMORY_GB), - MaxValueValidator(settings.ALGORITHMS_MAX_MEMORY_GB), + MaxValueValidator(phase.algorithm_maximum_settable_memory_gb), ] def clean(self): diff --git a/app/grandchallenge/evaluation/forms.py b/app/grandchallenge/evaluation/forms.py index 2c7136e941..f4fdf97028 100644 --- a/app/grandchallenge/evaluation/forms.py +++ b/app/grandchallenge/evaluation/forms.py @@ -165,8 +165,9 @@ def __init__(self, *args, **kwargs): ), ] self.fields["evaluation_requires_gpu_type"].choices = [ - (c, GPUTypeChoices(c).label) - for c in self.instance.evaluation_selectable_gpu_type_choices + (choice.value, choice.label) + for choice in GPUTypeChoices + if choice in self.instance.evaluation_selectable_gpu_type_choices ] self.helper.layout = Layout( @@ -542,6 +543,37 @@ def clean_algorithm(self): "complete." ) + job_requirement_errors = [] + phase = self.cleaned_data["phase"] + if ( + algorithm.job_requires_memory_gb + > phase.algorithm_maximum_settable_memory_gb + ): + job_requirement_errors.append( + ValidationError( + "The requested memory for this algorithm " + f"({algorithm.job_requires_memory_gb}) is too high for this " + "phase. The maximum allowed memory is " + f"{phase.algorithm_maximum_settable_memory_gb} GB. " + "Please adjust the setting on the algorithm." + ) + ) + if ( + algorithm.job_requires_gpu_type + not in phase.algorithm_selectable_gpu_type_choices + ): + job_requirement_errors.append( + ValidationError( + "The requested GPU type for this algorithm " + f"({GPUTypeChoices(algorithm.job_requires_gpu_type).name}) is " + "not allowed for this phase. Options are: " + f"{', '.join([GPUTypeChoices(c).name for c in phase.algorithm_selectable_gpu_type_choices])}. " + "Please adjust the setting on the algorithm." + ) + ) + if job_requirement_errors: + raise ValidationError(job_requirement_errors) + self.cleaned_data["algorithm_image"] = algorithm.active_image self.cleaned_data["algorithm_model"] = algorithm.active_model diff --git a/app/grandchallenge/evaluation/migrations/0070_phase_algorithm_maximum_settable_memory_gb_and_more.py b/app/grandchallenge/evaluation/migrations/0070_phase_algorithm_maximum_settable_memory_gb_and_more.py new file mode 100644 index 0000000000..8c1cdb457d --- /dev/null +++ b/app/grandchallenge/evaluation/migrations/0070_phase_algorithm_maximum_settable_memory_gb_and_more.py @@ -0,0 +1,55 @@ +# Generated by Django 4.2.16 on 2024-11-21 15:50 + +from django.db import migrations, models + +import grandchallenge.core.validators +import grandchallenge.evaluation.models + + +class Migration(migrations.Migration): + dependencies = [ + ( + "evaluation", + "0069_phase_maximum_settable_memory_gb_evaluation_and_more", + ), + ] + + operations = [ + migrations.AddField( + model_name="phase", + name="algorithm_maximum_settable_memory_gb", + field=models.PositiveSmallIntegerField( + default=32, + help_text="Maximum amount of memory that participants will be allowed to assign to algorithm inference jobs for submission. The setting on the algorithm will be validated against this on submission.", + ), + ), + migrations.AddField( + model_name="phase", + name="algorithm_selectable_gpu_type_choices", + field=models.JSONField( + default=grandchallenge.evaluation.models.get_default_gpu_type_choices, + help_text='The GPU type choices that participants will be able to select for their algorithm inference jobs. The setting on the algorithm will be validated against this on submission. Options are ["", "A100", "A10G", "V100", "K80", "T4"].', + validators=[ + grandchallenge.core.validators.JSONValidator( + schema={ + "$schema": "http://json-schema.org/draft-07/schema", + "items": { + "enum": [ + "", + "A100", + "A10G", + "V100", + "K80", + "T4", + ], + "type": "string", + }, + "title": "The Selectable GPU Types Schema", + "type": "array", + "uniqueItems": True, + } + ) + ], + ), + ), + ] diff --git a/app/grandchallenge/evaluation/models.py b/app/grandchallenge/evaluation/models.py index 4b896a6999..cdfb6ef796 100644 --- a/app/grandchallenge/evaluation/models.py +++ b/app/grandchallenge/evaluation/models.py @@ -490,6 +490,24 @@ class Phase(FieldChangeMixin, HangingProtocolMixin, UUIDModel): blank=True, help_text="The output interfaces that the algorithms for this phase must use", ) + algorithm_selectable_gpu_type_choices = models.JSONField( + default=get_default_gpu_type_choices, + help_text=( + "The GPU type choices that participants will be able to select for their " + "algorithm inference jobs. The setting on the algorithm will be " + "validated against this on submission. Options are " + f"{GPUTypeChoices.values}.".replace("'", '"') + ), + validators=[JSONValidator(schema=SELECTABLE_GPU_TYPES_SCHEMA)], + ) + algorithm_maximum_settable_memory_gb = models.PositiveSmallIntegerField( + default=settings.ALGORITHMS_MAX_MEMORY_GB, + help_text=( + "Maximum amount of memory that participants will be allowed to " + "assign to algorithm inference jobs for submission. The setting on the " + "algorithm will be validated against this on submission." + ), + ) algorithm_time_limit = models.PositiveIntegerField( default=20 * 60, help_text="Time limit for inference jobs in seconds", diff --git a/app/tests/algorithms_tests/test_forms.py b/app/tests/algorithms_tests/test_forms.py index 87ad0a2bf5..e68bdc30c1 100644 --- a/app/tests/algorithms_tests/test_forms.py +++ b/app/tests/algorithms_tests/test_forms.py @@ -31,6 +31,7 @@ from grandchallenge.core.utils.access_requests import ( AccessRequestHandlingOptions, ) +from grandchallenge.evaluation.utils import SubmissionKindChoices from grandchallenge.verifications.models import Verification from tests.algorithms_tests.factories import ( AlgorithmFactory, @@ -811,6 +812,98 @@ def test_algorithm_form_gpu_limited_choices(): assert actual_choices == expected_choices +@pytest.mark.django_db +def test_algorithm_form_gpu_choices_from_phases(): + user = UserFactory() + algorithm = AlgorithmFactory() + inputs = ComponentInterfaceFactory.create_batch(2) + outputs = ComponentInterfaceFactory.create_batch(2) + algorithm.inputs.set(inputs) + algorithm.outputs.set(outputs) + p1 = PhaseFactory( + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_selectable_gpu_type_choices=[ + GPUTypeChoices.NO_GPU, + GPUTypeChoices.T4, + GPUTypeChoices.A100, + ], + ) + p1.algorithm_inputs.set(inputs) + p1.algorithm_outputs.set(outputs) + p1.challenge.participants_group.user_set.add(user) + p2 = PhaseFactory( + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_selectable_gpu_type_choices=[ + GPUTypeChoices.NO_GPU, + GPUTypeChoices.T4, + GPUTypeChoices.K80, + ], + ) + p2.algorithm_inputs.set(inputs) + p2.algorithm_outputs.set(outputs) + p3 = PhaseFactory( # excluded, wrong inputs + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_selectable_gpu_type_choices=[ + GPUTypeChoices.NO_GPU, + GPUTypeChoices.T4, + GPUTypeChoices.V100, + ], + ) + p3.algorithm_outputs.set(outputs) + p4 = PhaseFactory( # excluded, wrong outputs + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_selectable_gpu_type_choices=[ + GPUTypeChoices.NO_GPU, + GPUTypeChoices.T4, + GPUTypeChoices.V100, + ], + ) + p4.algorithm_inputs.set(inputs) + PhaseFactory( # excluded, not public + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_selectable_gpu_type_choices=[ + GPUTypeChoices.NO_GPU, + GPUTypeChoices.T4, + GPUTypeChoices.V100, + ], + public=False, + ) + PhaseFactory( # excluded, not algorithm submission kind + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.CSV, + algorithm_selectable_gpu_type_choices=[ + GPUTypeChoices.NO_GPU, + GPUTypeChoices.T4, + GPUTypeChoices.V100, + ], + ) + PhaseFactory( # excluded, user not participant + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_selectable_gpu_type_choices=[ + GPUTypeChoices.NO_GPU, + GPUTypeChoices.T4, + GPUTypeChoices.V100, + ], + ) + + form = AlgorithmForm(instance=algorithm, user=user) + + expected_choices = [ + (GPUTypeChoices.NO_GPU, "No GPU"), + (GPUTypeChoices.A100, "NVIDIA A100 Tensor Core GPU"), + (GPUTypeChoices.K80, "NVIDIA K80 GPU"), + (GPUTypeChoices.T4, "NVIDIA T4 Tensor Core GPU"), + ] + + actual_choices = form.fields["job_requires_gpu_type"].choices + + assert actual_choices == expected_choices + + def test_algorithm_for_phase_form_gpu_limited_choices(): form = AlgorithmForPhaseForm( workstation_config=WorkstationConfigFactory.build(), @@ -839,6 +932,41 @@ def test_algorithm_for_phase_form_gpu_limited_choices(): assert actual_choices == expected_choices +def test_algorithm_for_phase_form_gpu_additional_choices(): + form = AlgorithmForPhaseForm( + workstation_config=WorkstationConfigFactory.build(), + hanging_protocol=HangingProtocolFactory.build(), + optional_hanging_protocols=[HangingProtocolFactory.build()], + view_content="{}", + display_editors=True, + contact_email="test@test.com", + workstation=WorkstationFactory.build(), + inputs=[ComponentInterfaceFactory.build()], + outputs=[ComponentInterfaceFactory.build()], + structures=[], + modalities=[], + logo=ImageField(filename="test.jpeg"), + phase=PhaseFactory.build( + algorithm_selectable_gpu_type_choices=[ + GPUTypeChoices.NO_GPU, + GPUTypeChoices.T4, + GPUTypeChoices.A100, + ] + ), + user=UserFactory.build(), + ) + + expected_choices = [ + (GPUTypeChoices.NO_GPU, "No GPU"), + (GPUTypeChoices.A100, "NVIDIA A100 Tensor Core GPU"), + (GPUTypeChoices.T4, "NVIDIA T4 Tensor Core GPU"), + ] + + actual_choices = form.fields["job_requires_gpu_type"].choices + + assert actual_choices == expected_choices + + @pytest.mark.django_db def test_algorithm_form_memory_limited(): form = AlgorithmForm(user=UserFactory()) @@ -858,6 +986,67 @@ def test_algorithm_form_memory_limited(): assert max_validator.limit_value == 32 +@pytest.mark.django_db +def test_algorithm_form_max_memory_from_phases(): + user = UserFactory() + algorithm = AlgorithmFactory() + inputs = ComponentInterfaceFactory.create_batch(2) + outputs = ComponentInterfaceFactory.create_batch(2) + algorithm.inputs.set(inputs) + algorithm.outputs.set(outputs) + p1 = PhaseFactory( + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_maximum_settable_memory_gb=21, + ) + p1.algorithm_inputs.set(inputs) + p1.algorithm_outputs.set(outputs) + p1.challenge.participants_group.user_set.add(user) + p2 = PhaseFactory( + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_maximum_settable_memory_gb=42, + ) + p2.algorithm_inputs.set(inputs) + p2.algorithm_outputs.set(outputs) + p3 = PhaseFactory( # excluded, wrong inputs + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_maximum_settable_memory_gb=1337, + ) + p3.algorithm_outputs.set(outputs) + p4 = PhaseFactory( # excluded, wrong outputs + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_maximum_settable_memory_gb=1337, + ) + p4.algorithm_inputs.set(inputs) + PhaseFactory( # excluded, not public + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_maximum_settable_memory_gb=1337, + public=False, + ) + PhaseFactory( # excluded, not algorithm submission kind + challenge=p1.challenge, + submission_kind=SubmissionKindChoices.CSV, + algorithm_maximum_settable_memory_gb=1337, + ) + PhaseFactory( # excluded, user not participant + submission_kind=SubmissionKindChoices.ALGORITHM, + algorithm_maximum_settable_memory_gb=1337, + ) + + form = AlgorithmForm(instance=algorithm, user=user) + + validators = form.fields["job_requires_memory_gb"].validators + + max_validator = next( + (v for v in validators if isinstance(v, MaxValueValidator)), None + ) + assert max_validator is not None + assert max_validator.limit_value == 42 + + def test_algorithm_for_phase_form_memory_limited(): form = AlgorithmForPhaseForm( workstation_config=WorkstationConfigFactory.build(), @@ -889,3 +1078,30 @@ def test_algorithm_for_phase_form_memory_limited(): ) assert max_validator is not None assert max_validator.limit_value == 32 + + +def test_algorithm_for_phase_form_memory(): + form = AlgorithmForPhaseForm( + workstation_config=WorkstationConfigFactory.build(), + hanging_protocol=HangingProtocolFactory.build(), + optional_hanging_protocols=[HangingProtocolFactory.build()], + view_content="{}", + display_editors=True, + contact_email="test@test.com", + workstation=WorkstationFactory.build(), + inputs=[ComponentInterfaceFactory.build()], + outputs=[ComponentInterfaceFactory.build()], + structures=[], + modalities=[], + logo=ImageField(filename="test.jpeg"), + phase=PhaseFactory.build(algorithm_maximum_settable_memory_gb=42), + user=UserFactory.build(), + ) + + validators = form.fields["job_requires_memory_gb"].validators + + max_validator = next( + (v for v in validators if isinstance(v, MaxValueValidator)), None + ) + assert max_validator is not None + assert max_validator.limit_value == 42 diff --git a/app/tests/evaluation_tests/test_views.py b/app/tests/evaluation_tests/test_views.py index 92fbb32193..3d29255199 100644 --- a/app/tests/evaluation_tests/test_views.py +++ b/app/tests/evaluation_tests/test_views.py @@ -1601,6 +1601,8 @@ def test_submission_create_sets_limits_correctly_with_algorithm(client): archive=archive, submission_kind=SubmissionKindChoices.ALGORITHM, submissions_limit_per_user_per_period=1, + algorithm_selectable_gpu_type_choices=[GPUTypeChoices.V100], + algorithm_maximum_settable_memory_gb=1337, ) phase.algorithm_inputs.set(inputs) phase.algorithm_outputs.set(outputs) From efac102c212f58f7a04431f92004fe5831b3aac1 Mon Sep 17 00:00:00 2001 From: Chris van Run Date: Mon, 2 Dec 2024 17:14:28 +0100 Subject: [PATCH 11/16] Adds support for Biological Observation Matrix (BIOM) files (#3715) This PR introduces support for BIOM files. It validates them by attempting to parse them via the `biom-format` library. An explicit check is made that all uploaded BIOM are in hd5f format. This is the binary compressed version and I'd argue it's the only one we should support. BIOM file validation is hooked to a larger worker queue. ## Isolated virtualenv After some (painful) debugging I've refactored the way the BIOM parser is called. This alleviates the problem with incorrect versioned HDF5 libraries being pre-loaded. The base container now also generates a 'biom' virtual environment under `/opt/virtualenvs`. Apart from fixing the import bug, it has the benefit of isolating the parser libraries from the web app. See https://github.com/DIAGNijmegen/rse-roadmap/issues/354 --- app/config/settings.py | 3 + app/grandchallenge/components/__init__.py | 4 + ..._alter_componentinterface_kind_and_more.py | 109 ++++++++++++++++++ app/grandchallenge/components/models.py | 55 ++++++--- .../components/utils/virtualenvs.py | 38 ++++++ .../validate_scripts/validate_biom.py | 58 ++++++++++ app/grandchallenge/components/validators.py | 33 +++++- app/tests/components_tests/__init__.py | 3 + .../resources/biom/broken.biom | Bin 0 -> 33822 bytes .../resources/biom/not_a_biom.h5 | Bin 0 -> 10240 bytes .../resources/biom/uncompressed_OTU_json.biom | 1 + .../resources/biom/valid.biom | Bin 0 -> 33824 bytes app/tests/components_tests/test_models.py | 75 +++++++++++- app/tests/components_tests/test_tasks.py | 27 +++-- app/tests/components_tests/test_validators.py | 56 +++++---- dockerfiles/web-base/Dockerfile | 9 +- poetry.lock | 2 + setup.cfg | 2 + 18 files changed, 413 insertions(+), 62 deletions(-) create mode 100644 app/grandchallenge/components/migrations/0024_alter_componentinterface_kind_and_more.py create mode 100644 app/grandchallenge/components/utils/virtualenvs.py create mode 100644 app/grandchallenge/components/validate_scripts/validate_biom.py create mode 100644 app/tests/components_tests/resources/biom/broken.biom create mode 100644 app/tests/components_tests/resources/biom/not_a_biom.h5 create mode 100644 app/tests/components_tests/resources/biom/uncompressed_OTU_json.biom create mode 100644 app/tests/components_tests/resources/biom/valid.biom diff --git a/app/config/settings.py b/app/config/settings.py index 8280fb453c..8e06ba64a0 100644 --- a/app/config/settings.py +++ b/app/config/settings.py @@ -1103,6 +1103,9 @@ def sentry_before_send(event, hint): ) COMPONENTS_CONTAINER_PLATFORM = "linux/amd64" +COMPONENTS_VIRTUAL_ENV_BIOM_LOCATION = os.environ.get( + "COMPONENTS_VIRTUAL_ENV_BIOM_LOCATION", "/opt/virtualenvs/biom" +) # Set which template pack to use for forms CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap4" CRISPY_TEMPLATE_PACK = "bootstrap4" diff --git a/app/grandchallenge/components/__init__.py b/app/grandchallenge/components/__init__.py index d934c8d974..b48742e880 100644 --- a/app/grandchallenge/components/__init__.py +++ b/app/grandchallenge/components/__init__.py @@ -1,5 +1,9 @@ +from pathlib import Path + from django.core.checks import Error, register +VALIDATION_SCRIPT_DIR = Path(__file__).resolve().parent / "validate_scripts" + @register(deploy=True) def check_sagemaker_is_used(app_configs, **kwargs): diff --git a/app/grandchallenge/components/migrations/0024_alter_componentinterface_kind_and_more.py b/app/grandchallenge/components/migrations/0024_alter_componentinterface_kind_and_more.py new file mode 100644 index 0000000000..0864f747fd --- /dev/null +++ b/app/grandchallenge/components/migrations/0024_alter_componentinterface_kind_and_more.py @@ -0,0 +1,109 @@ +# Generated by Django 4.2.16 on 2024-12-02 13:37 + +from django.db import migrations, models + +import grandchallenge.components.models +import grandchallenge.core.storage +import grandchallenge.core.validators + + +class Migration(migrations.Migration): + dependencies = [ + ("components", "0023_alter_componentinterface_overlay_segments"), + ] + + operations = [ + migrations.AlterField( + model_name="componentinterface", + name="kind", + field=models.CharField( + choices=[ + ("STR", "String"), + ("INT", "Integer"), + ("FLT", "Float"), + ("BOOL", "Bool"), + ("JSON", "Anything"), + ("CHART", "Chart"), + ("2DBB", "2D bounding box"), + ("M2DB", "Multiple 2D bounding boxes"), + ("DIST", "Distance measurement"), + ("MDIS", "Multiple distance measurements"), + ("POIN", "Point"), + ("MPOI", "Multiple points"), + ("POLY", "Polygon"), + ("MPOL", "Multiple polygons"), + ("LINE", "Line"), + ("MLIN", "Multiple lines"), + ("ANGL", "Angle"), + ("MANG", "Multiple angles"), + ("ELLI", "Ellipse"), + ("MELL", "Multiple ellipses"), + ("3ANG", "Three-point angle"), + ("M3AN", "Multiple three-point angles"), + ("ATRG", "Affine transform registration"), + ("CHOI", "Choice"), + ("MCHO", "Multiple choice"), + ("IMG", "Image"), + ("SEG", "Segmentation"), + ("HMAP", "Heat Map"), + ("DSPF", "Displacement field"), + ("PDF", "PDF file"), + ("SQREG", "SQREG file"), + ("JPEG", "Thumbnail jpg"), + ("PNG", "Thumbnail png"), + ("OBJ", "OBJ file"), + ("MP4", "MP4 file"), + ("NEWCK", "Newick tree-format file"), + ("BIOM", "BIOM format"), + ("CSV", "CSV file"), + ("ZIP", "ZIP file"), + ], + help_text="What is the type of this interface? Used to validate interface values and connections between components.", + max_length=5, + ), + ), + migrations.AlterField( + model_name="componentinterfacevalue", + name="file", + field=models.FileField( + blank=True, + null=True, + storage=grandchallenge.core.storage.ProtectedS3Storage(), + upload_to=grandchallenge.components.models.component_interface_value_path, + validators=[ + grandchallenge.core.validators.ExtensionValidator( + allowed_extensions=( + ".json", + ".zip", + ".csv", + ".png", + ".jpg", + ".jpeg", + ".pdf", + ".sqreg", + ".obj", + ".mp4", + ".newick", + ".biom", + ) + ), + grandchallenge.core.validators.MimeTypeValidator( + allowed_types=( + "application/json", + "application/zip", + "text/plain", + "application/csv", + "text/csv", + "application/pdf", + "image/png", + "image/jpeg", + "application/octet-stream", + "application/x-sqlite3", + "application/vnd.sqlite3", + "video/mp4", + ) + ), + ], + ), + ), + ] diff --git a/app/grandchallenge/components/models.py b/app/grandchallenge/components/models.py index 87ffd4d58d..f2994eaf4f 100644 --- a/app/grandchallenge/components/models.py +++ b/app/grandchallenge/components/models.py @@ -4,8 +4,10 @@ from datetime import timedelta from json import JSONDecodeError from pathlib import Path +from tempfile import NamedTemporaryFile from typing import NamedTuple +from billiard.exceptions import SoftTimeLimitExceeded, TimeLimitExceeded from celery import signature from django import forms from django.apps import apps @@ -52,6 +54,7 @@ validate_docker_image, ) from grandchallenge.components.validators import ( + validate_biom_format, validate_newick_tree_format, validate_no_slash_at_ends, validate_safe_path, @@ -148,6 +151,7 @@ class InterfaceKindChoices(models.TextChoices): OBJ = "OBJ", _("OBJ file") MP4 = "MP4", _("MP4 file") NEWICK = "NEWCK", _("Newick tree-format file") + BIOM = "BIOM", _("BIOM format") # Legacy support CSV = "CSV", _("CSV file") @@ -274,6 +278,7 @@ def interface_type_file(): * OBJ file * MP4 file * Newick file + * BIOM file """ return { InterfaceKind.InterfaceKindChoices.CSV, @@ -285,6 +290,7 @@ def interface_type_file(): InterfaceKind.InterfaceKindChoices.OBJ, InterfaceKind.InterfaceKindChoices.MP4, InterfaceKind.InterfaceKindChoices.NEWICK, + InterfaceKind.InterfaceKindChoices.BIOM, } @staticmethod @@ -306,6 +312,7 @@ def interface_type_undisplayable(): InterfaceKind.InterfaceKindChoices.ZIP, InterfaceKind.InterfaceKindChoices.OBJ, InterfaceKind.InterfaceKindChoices.NEWICK, + InterfaceKind.InterfaceKindChoices.BIOM, } @@ -1194,6 +1201,12 @@ def clean(self): ".nwk", ".tree", ), + InterfaceKindChoices.BIOM: ( + # MIME type + "application/octet-stream", + # File extension + ".biom", + ), InterfaceKindChoices.OBJ: ( "text/plain", "application/octet-stream", @@ -1218,11 +1231,13 @@ def clean(self): InterfaceKindChoices.OBJ: ".obj", InterfaceKindChoices.MP4: ".mp4", InterfaceKindChoices.NEWICK: ".newick", + InterfaceKindChoices.BIOM: ".biom", **{kind: ".json" for kind in InterfaceKind.interface_type_json()}, } INTERFACE_KIND_TO_CUSTOM_QUEUE = { InterfaceKindChoices.NEWICK: acks_late_2xlarge_task.queue, + InterfaceKindChoices.BIOM: acks_late_2xlarge_task.queue, } @@ -1274,6 +1289,7 @@ class ComponentInterfaceValue(models.Model): ".obj", ".mp4", ".newick", + ".biom", ) ), MimeTypeValidator( @@ -1485,21 +1501,30 @@ def _validate_value(self): def validate_user_upload(self, user_upload): if not user_upload.is_completed: raise ValidationError("User upload is not completed.") - if self.interface.is_json_kind: - try: - value = json.loads(user_upload.read_object()) - except JSONDecodeError as error: - raise ValidationError(error) - except UnicodeDecodeError: - raise ValidationError("The file could not be decoded") - except MemoryError as error: - raise ValidationError( - "The file was too large to process, " - "please try again with a smaller file" - ) from error - self.interface.validate_against_schema(value=value) - elif self.interface.kind == InterfaceKindChoices.NEWICK: - validate_newick_tree_format(tree=user_upload.read_object()) + try: + if self.interface.is_json_kind: + try: + value = json.loads(user_upload.read_object()) + except JSONDecodeError as error: + raise ValidationError(error) + self.interface.validate_against_schema(value=value) + elif self.interface.kind == InterfaceKindChoices.NEWICK: + validate_newick_tree_format(tree=user_upload.read_object()) + elif self.interface.kind == InterfaceKindChoices.BIOM: + with NamedTemporaryFile() as temp_file: + user_upload.download_fileobj(temp_file) + validate_biom_format(file=temp_file.name) + except UnicodeDecodeError: + raise ValidationError("The file could not be decoded") + except ( + MemoryError, + SoftTimeLimitExceeded, + TimeLimitExceeded, + ) as error: + raise ValidationError( + "The file was too large to process, " + "please try again with a smaller file" + ) from error self._user_upload_validated = True diff --git a/app/grandchallenge/components/utils/virtualenvs.py b/app/grandchallenge/components/utils/virtualenvs.py new file mode 100644 index 0000000000..43ee66f109 --- /dev/null +++ b/app/grandchallenge/components/utils/virtualenvs.py @@ -0,0 +1,38 @@ +import shlex +import subprocess +from pathlib import Path + + +def run_script_in_venv(*, venv_location, python_script, args=None): + """ + Runs a Python script as a subprocess in an existing isolated virtual environment. + + Returns the result of the process. + """ + venv_activate = Path(venv_location).resolve() / "bin" / "activate" + python_script = Path(python_script).resolve() + + venv_activate_command = shlex.join( + [ + "source", + str(venv_activate), + ] + ) + python_command = shlex.join( + [ + "python", + str(python_script), + *args, + ] + ) + return subprocess.run( + [ + "bash", + "-c", + f"{venv_activate_command} && {python_command}", + ], + env=None, + text=True, + check=True, + capture_output=True, + ) diff --git a/app/grandchallenge/components/validate_scripts/validate_biom.py b/app/grandchallenge/components/validate_scripts/validate_biom.py new file mode 100644 index 0000000000..97b9175e08 --- /dev/null +++ b/app/grandchallenge/components/validate_scripts/validate_biom.py @@ -0,0 +1,58 @@ +""" +Script that validates BIOM files by passing them through a parser. +Provide the BIOM file as an argument to the script. + +If the file is valid, the script will exit cleanly (0). +Raises a ValidationScriptError if the BIOM file is not valid. + + + +The rational for having a seperate script and virtual environment is to provide +isolation of web-app and modality-specific libraries. + +In the case of BIOM the clashing HDF5 libraries of the libvips library (used in panimg) +and those of h5py would lead to imports crashing when not using an virtual environment. +""" + +import sys +from pathlib import Path + +import biom +import h5py + + +class ValidationScriptError(Exception): + pass + + +def run(biom_file_path): + try: + hdf5_file = h5py.File(biom_file_path, "r") + except OSError: + raise ValidationScriptError( + "Only BIOM in valid HDF5 binary file format are supported" + ) + + # Attempt to parse it as a BIOM table + try: + biom.Table.from_hdf5(hdf5_file) + except Exception: + raise ValidationScriptError("Does not appear to be a BIOM-format file") + + +def _get_file_path(): + if len(sys.argv) == 2: + biom_file_path = Path(sys.argv[1]) + if not biom_file_path.is_file(): + raise RuntimeError( + f"Provided BIOM file path is not an existing file: {biom_file_path}" + ) + return biom_file_path + else: + raise RuntimeError( + "Incorrect number of arguments, provide (only) the BIOM file path" + ) + + +if __name__ == "__main__": + run(_get_file_path()) diff --git a/app/grandchallenge/components/validators.py b/app/grandchallenge/components/validators.py index 4bc236f4b4..080c70ee35 100644 --- a/app/grandchallenge/components/validators.py +++ b/app/grandchallenge/components/validators.py @@ -1,8 +1,14 @@ -from billiard.exceptions import SoftTimeLimitExceeded, TimeLimitExceeded +import subprocess +from pathlib import Path + from Bio.Phylo import NewickIO +from django.conf import settings from django.core.exceptions import SuspiciousFileOperation, ValidationError from django.utils._os import safe_join +from grandchallenge.components import VALIDATION_SCRIPT_DIR +from grandchallenge.components.utils.virtualenvs import run_script_in_venv + def validate_safe_path(value): """Ensures that the path is safe and normalised.""" @@ -37,10 +43,31 @@ def validate_newick_tree_format(tree): try: for _ in parser.parse(): has_tree = True - except (MemoryError, SoftTimeLimitExceeded, TimeLimitExceeded): - raise ValidationError("The file is too large") except NewickIO.NewickError as e: raise ValidationError(f"Invalid Newick tree format: {e}") if not has_tree: raise ValidationError("No Newick tree found") + + +def validate_biom_format(*, file): + """Validates an uploaded BIOM file by passing its content through a parser""" + file = Path(file).resolve() + + try: + run_script_in_venv( + venv_location=settings.COMPONENTS_VIRTUAL_ENV_BIOM_LOCATION, + python_script=VALIDATION_SCRIPT_DIR / "validate_biom.py", + args=[str(file)], + ) + except subprocess.CalledProcessError as e: + error_lines = e.stderr.strip().split("\n") + for line in error_lines: + # Pass along any validation errors + if line.startswith("ValidationScriptError"): + error_message = line.split(":", 1)[1].strip() + raise ValidationError( + error_message or "Does not appear to be a BIOM-format file" + ) + else: + raise RuntimeError(f"An unexpected error occured: {e.stderr}") diff --git a/app/tests/components_tests/__init__.py b/app/tests/components_tests/__init__.py index e69de29bb2..556d8632e1 100644 --- a/app/tests/components_tests/__init__.py +++ b/app/tests/components_tests/__init__.py @@ -0,0 +1,3 @@ +from pathlib import Path + +RESOURCE_DIR = Path(__file__).parent / "resources" diff --git a/app/tests/components_tests/resources/biom/broken.biom b/app/tests/components_tests/resources/biom/broken.biom new file mode 100644 index 0000000000000000000000000000000000000000..d2dc8ff602d511112ff18c65d678100d4de180c9 GIT binary patch literal 33822 zcmeHQO>ERf6o3ES?T56qiy@?ZD1Q`mFI#rE+d?=%`D#mov`WQBW7*wy+iuc!>vkbU zD=9$@A(9Zi5JMs%nt0HJ#0$qF)nKBLgNGhTFv!6J2cvkx`FL+Xru}ydbjfb}=CE(( z&CGiMRw9%x&=YQrj!sk$0G;8j`rc!bIRNOP!6^%2ZiNY5et#-%eBtO8lr zfP62?x80gCf$h5AICv05OOj6%yTJqsAUVWmx-t;xIJmb<&a?-oYa_jd>j#UFjE%=r zC!^^^a#XR#qa$O(ak;W|+DQ!;N!Q?dHP>}5v?>V}xM3|+L!w^`TyI&bhqNNCvl`p! z`Wi_zOVwxPR46&=Q)6PZ0EOf{mm^0)PzxQBBV^VnIRnYmNHpy~ks4O)g7VhMW;iZs znzf+d7V_#vz5!6)$#`m9LF*N5b@Nu)6D%=rndottld?>0O$YSR!Wyn;iiI5Rc zIZJrfS~2j^(f3t(jy!B%kJJ*#OU%gM(K?(a1z1tYZ%%E}0ueHl&V&)r2(<6-JgjU} zIxLaMPL-b$m_k-cTpyPegVoogUk@eS0jC z9Pw)((wIyQg0Kdils${=zC)d_`P-D!vO|r*#$b!Cr{%8fRIoyUP}m;~`a_}aU~pG+ zU{|22aYsv2OHi9x#_njnx3?b`Lp&a?(&ET<0P>ru9Z}>r(fka4NN#OcOA>KM-2rlr05hUyuV%pP>u0F9VZ0G z^OY3>7f;gx0n-nVUHWkSP&cwWeL6tgC#TvEcrtPBTQ6u?q~`&ay|(6Km=C%-7S`#* z>T}qSA zN!bJ%hK1i~bS_TkH$>f{UN&80@4-EAD}-wx{0I-wDg;;7yWB1%u?B2a#$$Gom-QC( z#|MVxNjIIRRij?F%XMX&9=lXYUvnZG(cB_`>hE=TMsdf>3oG_1gEUVqjec|3vTI2)OFJH>Rg6`u6>Id1%u6@h^k>?|$zN z!rJR_O6j-OR0V#VhOhU`e%^lb@0!*`o$o^9qZ=>6tXADGBv;1Te82tx*5QuHi<{2X zUyTl5+ytJjV54SN?3mO%YTvVBr|n8`MPP@h8q~^dnE9(?@^pCj<_%wNyztxEpZ=_f z!InSZ+p>RvJOM_45nu!u0Y=~n5P1AJlvhL-0OWlH9YeB})+LBP-N9G5We9@8QzAR0 zN6RNYQ&_(8w&n*kfjjzV9kDc* z_>k4`j?R$0RxC%})qI*~7upN8Gwo-thSK6V`2iC@_5-E$+)8aUPJUn-?T^MwcCu7{ zz-j%O_F8BkcE4AT(CNI4#?N$lB4Dmx8>cyi{+?#N0`8**B6_kVaUXToz@MH2QHr-l zhKMsiCA+@z-u(5;jVt|~^o?{6m8fyOIy3DqBc9FoQ8UnRh7n){7y(9r5m>ee6nY3w)crr;8~q!F`kmA816SN;+l~*@)&A`O_)>QS!YOCqMIJGWX9O4lMt~7u K1Q>y5jllo^U6zXg literal 0 HcmV?d00001 diff --git a/app/tests/components_tests/resources/biom/not_a_biom.h5 b/app/tests/components_tests/resources/biom/not_a_biom.h5 new file mode 100644 index 0000000000000000000000000000000000000000..307a4d4b425241abf6917d26b3833166a1c50c16 GIT binary patch literal 10240 zcmeI0%}xR_5P+u(Bpag<(1Us~d-P)BBj68;iHcDV-f)qPlE_bBNjQ4Mn~&hpqmSXy zH`2B<17VFI(E#E!+G(fV{(MX)oj&CD_7~>X=D;M^g*YT_k+XM7uz{LxojP2RR3tkj zpB*eHh=FNaA$^j@e@mmHPWp?pY!-A+9-k#O!&V$iJPzwc{tp7V?DnbI=_PHK%n@G6 z&X_{b_AB+fpiuHdzZrzk@T;X-rEt@zwXCVJoo?|5L!^R)wO`DPg`x#2g(Hz!>T`oB zrtRCbBwc-+tSV#kgsvIA<2d$1m&S=H>IRner&m+50KF;jV@L~Y4 zOsiQZ$^LgNi2r& zf$V?Bz3-KY4N&mtmeCyMUzVs0zyCt2mv7=1cZPP5CTF#2nYcoAOxm?zz3wHbX@=d literal 0 HcmV?d00001 diff --git a/app/tests/components_tests/resources/biom/uncompressed_OTU_json.biom b/app/tests/components_tests/resources/biom/uncompressed_OTU_json.biom new file mode 100644 index 0000000000..5e6f4251de --- /dev/null +++ b/app/tests/components_tests/resources/biom/uncompressed_OTU_json.biom @@ -0,0 +1 @@ +{"id": "None","format": "Biological Observation Matrix 1.0.0","format_url": "http://biom-format.org","matrix_type": "sparse","generated_by": "BIOM-Format 2.1.16","date": "2024-11-22T11:51:18.155574","type": "OTU table","matrix_element_type": "float","shape": [5, 6],"data": [[0,2,1.000000],[1,0,5.000000],[1,1,1.000000],[1,3,2.000000],[1,4,3.000000],[1,5,1.000000],[2,2,1.000000],[2,3,4.000000],[2,5,2.000000],[3,0,2.000000],[3,1,1.000000],[3,2,1.000000],[3,5,1.000000],[4,1,1.000000],[4,2,1.000000]],"rows": [{"id": "GG_OTU_1", "metadata": null},{"id": "GG_OTU_2", "metadata": null},{"id": "GG_OTU_3", "metadata": null},{"id": "GG_OTU_4", "metadata": null},{"id": "GG_OTU_5", "metadata": null}],"columns": [{"id": "Sample1", "metadata": null},{"id": "Sample2", "metadata": null},{"id": "Sample3", "metadata": null},{"id": "Sample4", "metadata": null},{"id": "Sample5", "metadata": null},{"id": "Sample6", "metadata": null}]} diff --git a/app/tests/components_tests/resources/biom/valid.biom b/app/tests/components_tests/resources/biom/valid.biom new file mode 100644 index 0000000000000000000000000000000000000000..dce81469e56afd13e2923e5365ab052b8b2fe780 GIT binary patch literal 33824 zcmeHQO>9(E6h3ce`XepvU3Z6|3vbvlru zm6V_ci6lff#E?jgCN4A~al^7mHJE5*;i5|t46<;+!YHor{+u&EuYH{Y9Wv9NyO?wD zx%ZxP@AvLGb9?T)(~qME+E=gIunJ_VtpyKwRhB*;VlqF_94b?N3^NAOb4b5&>5KuZ zK-M)O-;451w`NRWyYANx9t6>nU=dQ* zcp`l=o=K)g6>B^`GB%u$D@&)H)Nqk>4X#)Fx~_+al3;)v);HYcw^$?Hoe)Wi4p3!#gUw;@knRe`)}HSh7ExOyOqov)N3Q?({S zMnL5Z;aTg&z(+^lRpmMIuze#^Lm)3PBY#KhaGDfgMKQlQwMh#^$WS^HMnEIbvA^@M zvQ6o*L?Sy?eoB;&q|ENPHJmUH9Z>aT*UJA0PG|S)W=1wpwIIBqPRgH%>`*2%wrl%# zE14ScYah~_N)Ljt2Az~Wi|oEbov--YmD4gq&B5kio35wjuIyB>LV-}&9}N0Kq3&RC zS8HHbprv_7TT5F|n_1TGXuWrI92Y}89o#KS|)@uN2G5)9H zgy49-vO?hEX*wWa_XA{?K3qT4jqFaJ4iNY8srCb&Y@GY%b6OVZxsPS9sreY@gRbbp zI(=Au4*QY3t60AEf^IWU2gs z)B3gBYq9gLo~?SEv|lJ3HJ6q<0`~Q5;)L&`zo+@rUN$+}pX^JFgP>!Xbng6XCpBCo zHN?r2vI#T{1HaMeT%68th`L3+Y`VtWgL~izgzF&u5D(C*1XtF(+%6@t4op?XV|J03 z^#=4O28QKHH=U=|qF%Slb!D3#yHrVEb0Qnl+!BB4?{#-parDK76?(DyR_ns;$gaJ6 z7H+p(YNfxE&zatbBKoq!1aJ8ZD`>stEr7xXTw(+m0Y-okU<4R}ibr6gw=V`~8vlu% z-#cUMyYZmDYj@4(J3m=Bb^gZh*M~AEE`{OD`}N(TnKcFN=0LTz&K#(+Uh-|8`RM1f zGm*)rjo|qTwn;f6d8{_`uE**%@77pgTn7I{@0}R98obx1r>pw*{dak2()-~rgZuA% z?+(J+Yj8^GH`deyew>D{_so9QapUj0NV36qq50wU=V4Z>?iZ4)t#;q9KY(#KI(c!^ zxyCQ!!xuM!XDgVf*<~G*nn%sMhIQJk23HJrh^j%Y+=Q9GqLZh?yEkw6V&jG1&i?dg zl?7Y=fNv}Q0rCVG0Y-okU<4R}$3WoG<4|4^T>y~x5p)d6R9crH{&X8(;g%r?3Qvjb zkdptjKAhqwTO0=PuS5JKZvqZInav0=0*nA7zz8q`m5M;I{S)2mByeN1)jLiSF|grT3tme)l66 zhf>=t@#`j!{2o;7kVaLiq}Pl@Hm12H{&b2znGSjbw*3>~ls9mPp3G(h7y(9r5nu!u zfl5Wd=^ljro@23l5Z*U50{q@@rLKf08@K%)1l?zNV7n)qyTPmVJ?Xt(r}aD0t>s@j zrm0@Pd>{46p7QeTZC}6S$FAY}p_$9ryG%=U56ylbwWmkRCp}YGzVfE#2Q-1(`ez-n zG?)00)%2Fmkh}<%V{dCd&9e*bh1%KeXRe0w;yC#MJAUj3%Imq6+i0Bpz%<$)jhF0X zsr-P``nB6@v3=ORUOhsm^D-Jg)8&bPef^p^%_;QvH0u>`A2krulP!z;sIxZw={XRk zcx!BkIP+7o>nrcfU%%YA(%(tnNcT{Q+OAh;r`=_XXY+m3EHs>91Q-EEfDvE>mMsFs z-Up!l0MQb@PdS#$=E^nZVdmT>=cRs1}jOj1?e_M<%ZPaD8=@fr*`gz{(Z2Kp|DR1B<9x;n&1Q-EE NfDvE>7=fpa!2jcmms|h< literal 0 HcmV?d00001 diff --git a/app/tests/components_tests/test_models.py b/app/tests/components_tests/test_models.py index babd4e8e2d..abb89aa0a5 100644 --- a/app/tests/components_tests/test_models.py +++ b/app/tests/components_tests/test_models.py @@ -6,6 +6,7 @@ from unittest.mock import call import pytest +from billiard.exceptions import SoftTimeLimitExceeded, TimeLimitExceeded from django.core.exceptions import MultipleObjectsReturned, ValidationError from django.core.files.base import ContentFile from django.utils import timezone @@ -160,6 +161,7 @@ def test_average_duration_filtering(): (InterfaceKindChoices.OBJ, True, False), (InterfaceKindChoices.MP4, True, False), (InterfaceKindChoices.NEWICK, True, False), + (InterfaceKindChoices.BIOM, True, False), ), ) def test_saved_in_object_store(kind, object_store_required, is_image): @@ -225,6 +227,7 @@ def test_saved_in_object_store(kind, object_store_required, is_image): (InterfaceKindChoices.THUMBNAIL_PNG, True), (InterfaceKindChoices.MP4, True), (InterfaceKindChoices.NEWICK, True), + (InterfaceKindChoices.BIOM, True), ), ) def test_clean_store_in_db(kind, object_store_required): @@ -308,6 +311,7 @@ def test_no_uuid_validation(): (InterfaceKind.InterfaceKindChoices.OBJ, "obj"), (InterfaceKind.InterfaceKindChoices.MP4, "mp4"), (InterfaceKind.InterfaceKindChoices.NEWICK, "newick"), + (InterfaceKind.InterfaceKindChoices.BIOM, "biom"), *((k, "json") for k in InterfaceKind.interface_type_json()), ), ) @@ -1638,6 +1642,63 @@ def test_component_interface_value_manager(): assert not created +@pytest.mark.parametrize( + "mock_error, expected_error, msg", + ( + # Ensure all resource errors are covered + ( + MemoryError, + ValidationError, + "The file was too large", + ), + ( + TimeLimitExceeded, + ValidationError, + "The file was too large", + ), + ( + SoftTimeLimitExceeded, + ValidationError, + "The file was too large", + ), + ( + UnicodeDecodeError, + ValidationError, + "The file could not be decoded", + ), + # Other Exceptions are not a ValidationError + ( + RuntimeError("Some secret"), + RuntimeError, + "Some secret", + ), + ), +) +def test_validate_user_upload_resource_error_handling( + mock_error, msg, expected_error +): + ci = ComponentInterfaceFactory.build(kind=InterfaceKindChoices.FLOAT) + civ = ComponentInterfaceValueFactory.build(interface=ci) + + assert ci.is_json_kind # sanity + + class MockUserUpload: + is_completed = True + + @classmethod + def read_object(cls, *_, **__): + if mock_error is UnicodeDecodeError: + # Requires some args + raise mock_error("foo", b"", 0, 1, "bar") + raise mock_error + + with pytest.raises(expected_error) as err: + civ.validate_user_upload(user_upload=MockUserUpload) + + if msg: + assert msg in str(err) + + @pytest.mark.django_db @pytest.mark.parametrize( "kind,expected_kwargs", @@ -1652,6 +1713,10 @@ def test_component_interface_value_manager(): InterfaceKindChoices.NEWICK, {"queue": "acks-late-2xlarge"}, ), + ( + InterfaceKindChoices.BIOM, + {"queue": "acks-late-2xlarge"}, + ), ), ) def test_component_interface_custom_queue(kind, expected_kwargs, mocker): @@ -1667,8 +1732,8 @@ def test_component_interface_custom_queue(kind, expected_kwargs, mocker): archive.add_editor(user) ai = ArchiveItemFactory.build(archive=None) - mock_task_signature = mocker.patch( - "grandchallenge.components.tasks.add_file_to_object.signature" + mock_task = mocker.patch( + "grandchallenge.components.tasks.add_file_to_object" ) ai.validate_values_and_execute_linked_task( values=[ @@ -1679,9 +1744,9 @@ def test_component_interface_custom_queue(kind, expected_kwargs, mocker): ], user=user, ) - assert mock_task_signature.called_once() # Sanity + assert mock_task.signature.called_once() # Sanity # Ignore the to-task keyword arguments - del mock_task_signature.call_args.kwargs["kwargs"] + del mock_task.signature.call_args.kwargs["kwargs"] - assert mock_task_signature.call_args.kwargs == expected_kwargs + assert mock_task.signature.call_args.kwargs == expected_kwargs diff --git a/app/tests/components_tests/test_tasks.py b/app/tests/components_tests/test_tasks.py index b864b2f993..9b65196d77 100644 --- a/app/tests/components_tests/test_tasks.py +++ b/app/tests/components_tests/test_tasks.py @@ -650,7 +650,22 @@ def test_add_file_to_object_updates_job_on_validation_fail( @pytest.mark.django_db -def test_add_file_to_object_validates_newick( +@pytest.mark.parametrize( + "kind,mock_validator_path", + ( + ( + InterfaceKind.InterfaceKindChoices.NEWICK, + "grandchallenge.components.models.validate_newick_tree_format", + ), + ( + InterfaceKind.InterfaceKindChoices.BIOM, + "grandchallenge.components.models.validate_biom_format", + ), + ), +) +def test_add_file_to_object_validates_kinds( + kind, + mock_validator_path, settings, django_capture_on_commit_callbacks, mocker, @@ -672,16 +687,14 @@ def test_add_file_to_object_validates_newick( ) us.save() ci = ComponentInterfaceFactory( - kind=InterfaceKind.InterfaceKindChoices.NEWICK, + kind=kind, store_in_database=False, ) - mock_validate_newick = mocker.patch( - "grandchallenge.components.models.validate_newick_tree_format" - ) + mock_validator = mocker.patch(mock_validator_path) # Sanity - mock_validate_newick.assert_not_called() + mock_validator.assert_not_called() assert ComponentInterfaceValue.objects.filter(interface=ci).count() == 0 with django_capture_on_commit_callbacks(execute=True) as callbacks: @@ -694,7 +707,7 @@ def test_add_file_to_object_validates_newick( linked_task=linked_task, ) - mock_validate_newick.assert_called_once() + mock_validator.assert_called_once() assert ComponentInterfaceValue.objects.filter(interface=ci).count() == 1 assert "some_async_task" not in str(callbacks) diff --git a/app/tests/components_tests/test_validators.py b/app/tests/components_tests/test_validators.py index d0f87f09c5..334c854540 100644 --- a/app/tests/components_tests/test_validators.py +++ b/app/tests/components_tests/test_validators.py @@ -1,14 +1,14 @@ from contextlib import nullcontext import pytest -from billiard.exceptions import SoftTimeLimitExceeded, TimeLimitExceeded -from Bio.Phylo.NewickIO import NewickError from django.core.exceptions import ValidationError from grandchallenge.components.validators import ( + validate_biom_format, validate_newick_tree_format, validate_safe_path, ) +from tests.components_tests import RESOURCE_DIR @pytest.mark.parametrize( @@ -68,40 +68,36 @@ def test_valid_paths(rel_path): ), ), ) -def test_validate_newick_formats(tree, context): +def test_validate_newick_format(tree, context): with context: validate_newick_tree_format(tree=tree) +def test_valid_biom_format(): + validate_biom_format(file=RESOURCE_DIR / "biom" / "valid.biom") + + @pytest.mark.parametrize( - "error, msg, expected_error", + "biom_file, msg", ( - (MemoryError, "The file is too large", ValidationError), - (SoftTimeLimitExceeded, "The file is too large", ValidationError), - (TimeLimitExceeded, "The file is too large", ValidationError), - (NewickError, "Invalid Newick tree format", ValidationError), - ( # No secrets: only ValidationErrors are returned to user - Exception, - "", - Exception, + ( + # Uncompressed + RESOURCE_DIR / "biom" / "uncompressed_OTU_json.biom", + "Only BIOM in valid HDF5 binary file format are supported", + ), + ( + # Compressed, but removed first few bytes + RESOURCE_DIR / "biom" / "broken.biom", + "Only BIOM in valid HDF5 binary file format are supported", + ), + ( + # HD5 Format, but not a biom + RESOURCE_DIR / "biom" / "not_a_biom.h5", + "Does not appear to be a BIOM-format file", ), ), ) -def test_validate_newick_exception_handling( - error, msg, expected_error, mocker -): - - class MockParser: - @staticmethod - def parse(*_, **__): - raise error - - mocker.patch( - "grandchallenge.components.validators._newick_parser", - return_value=MockParser, - ) - - with pytest.raises(expected_error) as err: - validate_newick_tree_format("();") - - assert msg in str(err) +def test_invalid_biom_formats(biom_file, msg): + with pytest.raises(ValidationError) as error: + validate_biom_format(file=biom_file) + assert msg in str(error) diff --git a/dockerfiles/web-base/Dockerfile b/dockerfiles/web-base/Dockerfile index 745b55e78d..635f242d3f 100644 --- a/dockerfiles/web-base/Dockerfile +++ b/dockerfiles/web-base/Dockerfile @@ -80,9 +80,9 @@ ENV PYTHONUNBUFFERED=1\ COMPONENTS_SAGEMAKER_SHIM_VERSION=0.3.5\ PATH="/opt/poetry/.venv/bin:/home/django/.local/bin:${PATH}" -RUN mkdir -p /opt/poetry /app /static /opt/sagemaker-shim \ +RUN mkdir -p /opt/poetry /app /static /opt/sagemaker-shim /opt/virtualenvs \ && groupadd -r django && useradd -m -r -g django django \ - && chown django:django /opt/poetry /app /static /opt/sagemaker-shim + && chown django:django /opt/poetry /app /static /opt/sagemaker-shim /opt/virtualenvs USER django:django @@ -93,6 +93,11 @@ RUN mkdir -p /opt/sagemaker-shim \ && tar -C /opt/sagemaker-shim/ -xzvf "/opt/sagemaker-shim/sagemaker-shim-${COMPONENTS_SAGEMAKER_SHIM_VERSION}-Linux-x86_64.tar.gz" \ && rm "/opt/sagemaker-shim/sagemaker-shim-${COMPONENTS_SAGEMAKER_SHIM_VERSION}-Linux-x86_64.tar.gz" +# Create virtual environments +RUN mkdir -p /opt/virtualenvs \ + && python -m venv /opt/virtualenvs/biom \ + && /opt/virtualenvs/biom/bin/python -m pip --no-cache-dir --no-color install biom-format + WORKDIR /opt/poetry # Install base python packages diff --git a/poetry.lock b/poetry.lock index 7dce639ceb..bd05594d8b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. + + [[package]] name = "aiohappyeyeballs" version = "2.4.3" diff --git a/setup.cfg b/setup.cfg index fdc37a41e2..3c4284254f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,6 +15,8 @@ banned-modules = django.core.mail.send_mail = Please use grandchallenge.emails.emails.send_standard_email_batch celery.shared_task = Please use acks_late_2xlarge_task or acks_late_xlarge_task instead datetime.datetime.now = Please use django.utils.timezone.now instead + grandchallenge.components.validate_scripts = Please do not import any validation script components + select = # B are bugbear checks (including the optionals) B From dee4273d668403a4342b5c860b088b623f49960d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 09:35:30 +0100 Subject: [PATCH 12/16] Update dependencies (#3726) Automated dependency update, see changes to `poetry.lock`. Co-authored-by: jmsmkn --- poetry.lock | 875 ++++++++++++++++++++++++++-------------------------- 1 file changed, 446 insertions(+), 429 deletions(-) diff --git a/poetry.lock b/poetry.lock index bd05594d8b..3de532f3cb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,101 +1,99 @@ # This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. - - [[package]] name = "aiohappyeyeballs" -version = "2.4.3" +version = "2.4.4" description = "Happy Eyeballs for asyncio" optional = false python-versions = ">=3.8" files = [ - {file = "aiohappyeyeballs-2.4.3-py3-none-any.whl", hash = "sha256:8a7a83727b2756f394ab2895ea0765a0a8c475e3c71e98d43d76f22b4b435572"}, - {file = "aiohappyeyeballs-2.4.3.tar.gz", hash = "sha256:75cf88a15106a5002a8eb1dab212525c00d1f4c0fa96e551c9fbe6f09a621586"}, + {file = "aiohappyeyeballs-2.4.4-py3-none-any.whl", hash = "sha256:a980909d50efcd44795c4afeca523296716d50cd756ddca6af8c65b996e27de8"}, + {file = "aiohappyeyeballs-2.4.4.tar.gz", hash = "sha256:5fdd7d87889c63183afc18ce9271f9b0a7d32c2303e394468dd45d514a757745"}, ] [[package]] name = "aiohttp" -version = "3.11.7" +version = "3.11.9" description = "Async http client/server framework (asyncio)" optional = false python-versions = ">=3.9" files = [ - {file = "aiohttp-3.11.7-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8bedb1f6cb919af3b6353921c71281b1491f948ca64408871465d889b4ee1b66"}, - {file = "aiohttp-3.11.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f5022504adab881e2d801a88b748ea63f2a9d130e0b2c430824682a96f6534be"}, - {file = "aiohttp-3.11.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e22d1721c978a6494adc824e0916f9d187fa57baeda34b55140315fa2f740184"}, - {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e993676c71288618eb07e20622572b1250d8713e7e00ab3aabae28cb70f3640d"}, - {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e13a05db87d3b241c186d0936808d0e4e12decc267c617d54e9c643807e968b6"}, - {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ba8d043fed7ffa117024d7ba66fdea011c0e7602327c6d73cacaea38abe4491"}, - {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dda3ed0a7869d2fa16aa41f9961ade73aa2c2e3b2fcb0a352524e7b744881889"}, - {file = "aiohttp-3.11.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43bfd25113c1e98aec6c70e26d5f4331efbf4aa9037ba9ad88f090853bf64d7f"}, - {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3dd3e7e7c9ef3e7214f014f1ae260892286647b3cf7c7f1b644a568fd410f8ca"}, - {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:78c657ece7a73b976905ab9ec8be9ef2df12ed8984c24598a1791c58ce3b4ce4"}, - {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:db70a47987e34494b451a334605bee57a126fe8d290511349e86810b4be53b01"}, - {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:9e67531370a3b07e49b280c1f8c2df67985c790ad2834d1b288a2f13cd341c5f"}, - {file = "aiohttp-3.11.7-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:9202f184cc0582b1db15056f2225ab4c1e3dac4d9ade50dd0613ac3c46352ac2"}, - {file = "aiohttp-3.11.7-cp310-cp310-win32.whl", hash = "sha256:2257bdd5cf54a4039a4337162cd8048f05a724380a2283df34620f55d4e29341"}, - {file = "aiohttp-3.11.7-cp310-cp310-win_amd64.whl", hash = "sha256:b7215bf2b53bc6cb35808149980c2ae80a4ae4e273890ac85459c014d5aa60ac"}, - {file = "aiohttp-3.11.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:cea52d11e02123f125f9055dfe0ccf1c3857225fb879e4a944fae12989e2aef2"}, - {file = "aiohttp-3.11.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3ce18f703b7298e7f7633efd6a90138d99a3f9a656cb52c1201e76cb5d79cf08"}, - {file = "aiohttp-3.11.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:670847ee6aeb3a569cd7cdfbe0c3bec1d44828bbfbe78c5d305f7f804870ef9e"}, - {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4dda726f89bfa5c465ba45b76515135a3ece0088dfa2da49b8bb278f3bdeea12"}, - {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c25b74a811dba37c7ea6a14d99eb9402d89c8d739d50748a75f3cf994cf19c43"}, - {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5522ee72f95661e79db691310290c4618b86dff2d9b90baedf343fd7a08bf79"}, - {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1fbf41a6bbc319a7816ae0f0177c265b62f2a59ad301a0e49b395746eb2a9884"}, - {file = "aiohttp-3.11.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:59ee1925b5a5efdf6c4e7be51deee93984d0ac14a6897bd521b498b9916f1544"}, - {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:24054fce8c6d6f33a3e35d1c603ef1b91bbcba73e3f04a22b4f2f27dac59b347"}, - {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:351849aca2c6f814575c1a485c01c17a4240413f960df1bf9f5deb0003c61a53"}, - {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:12724f3a211fa243570e601f65a8831372caf1a149d2f1859f68479f07efec3d"}, - {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:7ea4490360b605804bea8173d2d086b6c379d6bb22ac434de605a9cbce006e7d"}, - {file = "aiohttp-3.11.7-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:e0bf378db07df0a713a1e32381a1b277e62ad106d0dbe17b5479e76ec706d720"}, - {file = "aiohttp-3.11.7-cp311-cp311-win32.whl", hash = "sha256:cd8d62cab363dfe713067027a5adb4907515861f1e4ce63e7be810b83668b847"}, - {file = "aiohttp-3.11.7-cp311-cp311-win_amd64.whl", hash = "sha256:bf0e6cce113596377cadda4e3ac5fb89f095bd492226e46d91b4baef1dd16f60"}, - {file = "aiohttp-3.11.7-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:4bb7493c3e3a36d3012b8564bd0e2783259ddd7ef3a81a74f0dbfa000fce48b7"}, - {file = "aiohttp-3.11.7-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e143b0ef9cb1a2b4f74f56d4fbe50caa7c2bb93390aff52f9398d21d89bc73ea"}, - {file = "aiohttp-3.11.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f7c58a240260822dc07f6ae32a0293dd5bccd618bb2d0f36d51c5dbd526f89c0"}, - {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d20cfe63a1c135d26bde8c1d0ea46fd1200884afbc523466d2f1cf517d1fe33"}, - {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:12e4d45847a174f77b2b9919719203769f220058f642b08504cf8b1cf185dacf"}, - {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cf4efa2d01f697a7dbd0509891a286a4af0d86902fc594e20e3b1712c28c0106"}, - {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ee6a4cdcbf54b8083dc9723cdf5f41f722c00db40ccf9ec2616e27869151129"}, - {file = "aiohttp-3.11.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c6095aaf852c34f42e1bd0cf0dc32d1e4b48a90bfb5054abdbb9d64b36acadcb"}, - {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1cf03d27885f8c5ebf3993a220cc84fc66375e1e6e812731f51aab2b2748f4a6"}, - {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:1a17f6a230f81eb53282503823f59d61dff14fb2a93847bf0399dc8e87817307"}, - {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:481f10a1a45c5f4c4a578bbd74cff22eb64460a6549819242a87a80788461fba"}, - {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:db37248535d1ae40735d15bdf26ad43be19e3d93ab3f3dad8507eb0f85bb8124"}, - {file = "aiohttp-3.11.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9d18a8b44ec8502a7fde91446cd9c9b95ce7c49f1eacc1fb2358b8907d4369fd"}, - {file = "aiohttp-3.11.7-cp312-cp312-win32.whl", hash = "sha256:3d1c9c15d3999107cbb9b2d76ca6172e6710a12fda22434ee8bd3f432b7b17e8"}, - {file = "aiohttp-3.11.7-cp312-cp312-win_amd64.whl", hash = "sha256:018f1b04883a12e77e7fc161934c0f298865d3a484aea536a6a2ca8d909f0ba0"}, - {file = "aiohttp-3.11.7-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:241a6ca732d2766836d62c58c49ca7a93d08251daef0c1e3c850df1d1ca0cbc4"}, - {file = "aiohttp-3.11.7-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:aa3705a8d14de39898da0fbad920b2a37b7547c3afd2a18b9b81f0223b7d0f68"}, - {file = "aiohttp-3.11.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9acfc7f652b31853eed3b92095b0acf06fd5597eeea42e939bd23a17137679d5"}, - {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcefcf2915a2dbdbce37e2fc1622129a1918abfe3d06721ce9f6cdac9b6d2eaa"}, - {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c1f6490dd1862af5aae6cfcf2a274bffa9a5b32a8f5acb519a7ecf5a99a88866"}, - {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1ac5462582d6561c1c1708853a9faf612ff4e5ea5e679e99be36143d6eabd8e"}, - {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c1a6309005acc4b2bcc577ba3b9169fea52638709ffacbd071f3503264620da"}, - {file = "aiohttp-3.11.7-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f5b973cce96793725ef63eb449adfb74f99c043c718acb76e0d2a447ae369962"}, - {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ce91a24aac80de6be8512fb1c4838a9881aa713f44f4e91dd7bb3b34061b497d"}, - {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:875f7100ce0e74af51d4139495eec4025affa1a605280f23990b6434b81df1bd"}, - {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c171fc35d3174bbf4787381716564042a4cbc008824d8195eede3d9b938e29a8"}, - {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:ee9afa1b0d2293c46954f47f33e150798ad68b78925e3710044e0d67a9487791"}, - {file = "aiohttp-3.11.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8360c7cc620abb320e1b8d603c39095101391a82b1d0be05fb2225471c9c5c52"}, - {file = "aiohttp-3.11.7-cp313-cp313-win32.whl", hash = "sha256:7a9318da4b4ada9a67c1dd84d1c0834123081e746bee311a16bb449f363d965e"}, - {file = "aiohttp-3.11.7-cp313-cp313-win_amd64.whl", hash = "sha256:fc6da202068e0a268e298d7cd09b6e9f3997736cd9b060e2750963754552a0a9"}, - {file = "aiohttp-3.11.7-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:17829f37c0d31d89aa6b8b010475a10233774771f9b6dc2cc352ea4f8ce95d9a"}, - {file = "aiohttp-3.11.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d6177077a31b1aecfc3c9070bd2f11419dbb4a70f30f4c65b124714f525c2e48"}, - {file = "aiohttp-3.11.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:badda65ac99555791eed75e234afb94686ed2317670c68bff8a4498acdaee935"}, - {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0de6466b9d742b4ee56fe1b2440706e225eb48c77c63152b1584864a236e7a50"}, - {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04b0cc74d5a882c9dacaeeccc1444f0233212b6f5be8bc90833feef1e1ce14b9"}, - {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c7af3e50e5903d21d7b935aceed901cc2475463bc16ddd5587653548661fdb"}, - {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c63f898f683d1379b9be5afc3dd139e20b30b0b1e0bf69a3fc3681f364cf1629"}, - {file = "aiohttp-3.11.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fdadc3f6a32d6eca45f9a900a254757fd7855dfb2d8f8dcf0e88f0fae3ff8eb1"}, - {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d329300fb23e14ed1f8c6d688dfd867d1dcc3b1d7cd49b7f8c5b44e797ce0932"}, - {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:5578cf40440eafcb054cf859964bc120ab52ebe0e0562d2b898126d868749629"}, - {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:7b2f8107a3c329789f3c00b2daad0e35f548d0a55cda6291579136622099a46e"}, - {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:43dd89a6194f6ab02a3fe36b09e42e2df19c211fc2050ce37374d96f39604997"}, - {file = "aiohttp-3.11.7-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:d2fa6fc7cc865d26ff42480ac9b52b8c9b7da30a10a6442a9cdf429de840e949"}, - {file = "aiohttp-3.11.7-cp39-cp39-win32.whl", hash = "sha256:a7d9a606355655617fee25dd7e54d3af50804d002f1fd3118dd6312d26692d70"}, - {file = "aiohttp-3.11.7-cp39-cp39-win_amd64.whl", hash = "sha256:53c921b58fdc6485d6b2603e0132bb01cd59b8f0620ffc0907f525e0ba071687"}, - {file = "aiohttp-3.11.7.tar.gz", hash = "sha256:01a8aca4af3da85cea5c90141d23f4b0eee3cbecfd33b029a45a80f28c66c668"}, + {file = "aiohttp-3.11.9-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0411777249f25d11bd2964a230b3ffafcbed6cd65d0f2b132bc2b8f5b8c347c7"}, + {file = "aiohttp-3.11.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:499368eb904566fbdf1a3836a1532000ef1308f34a1bcbf36e6351904cced771"}, + {file = "aiohttp-3.11.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0b5a5009b0159a8f707879dc102b139466d8ec6db05103ec1520394fdd8ea02c"}, + {file = "aiohttp-3.11.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:176f8bb8931da0613bb0ed16326d01330066bb1e172dd97e1e02b1c27383277b"}, + {file = "aiohttp-3.11.9-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6435a66957cdba1a0b16f368bde03ce9c79c57306b39510da6ae5312a1a5b2c1"}, + {file = "aiohttp-3.11.9-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:202f40fb686e5f93908eee0c75d1e6fbe50a43e9bd4909bf3bf4a56b560ca180"}, + {file = "aiohttp-3.11.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39625703540feb50b6b7f938b3856d1f4886d2e585d88274e62b1bd273fae09b"}, + {file = "aiohttp-3.11.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c6beeac698671baa558e82fa160be9761cf0eb25861943f4689ecf9000f8ebd0"}, + {file = "aiohttp-3.11.9-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:96726839a42429318017e67a42cca75d4f0d5248a809b3cc2e125445edd7d50d"}, + {file = "aiohttp-3.11.9-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3f5461c77649358610fb9694e790956b4238ac5d9e697a17f63619c096469afe"}, + {file = "aiohttp-3.11.9-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:4313f3bc901255b22f01663eeeae167468264fdae0d32c25fc631d5d6e15b502"}, + {file = "aiohttp-3.11.9-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:d6e274661c74195708fc4380a4ef64298926c5a50bb10fbae3d01627d7a075b7"}, + {file = "aiohttp-3.11.9-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:db2914de2559809fdbcf3e48f41b17a493b58cb7988d3e211f6b63126c55fe82"}, + {file = "aiohttp-3.11.9-cp310-cp310-win32.whl", hash = "sha256:27935716f8d62c1c73010428db310fd10136002cfc6d52b0ba7bdfa752d26066"}, + {file = "aiohttp-3.11.9-cp310-cp310-win_amd64.whl", hash = "sha256:afbe85b50ade42ddff5669947afde9e8a610e64d2c80be046d67ec4368e555fa"}, + {file = "aiohttp-3.11.9-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:afcda759a69c6a8be3aae764ec6733155aa4a5ad9aad4f398b52ba4037942fe3"}, + {file = "aiohttp-3.11.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c5bba6b83fde4ca233cfda04cbd4685ab88696b0c8eaf76f7148969eab5e248a"}, + {file = "aiohttp-3.11.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:442356e8924fe1a121f8c87866b0ecdc785757fd28924b17c20493961b3d6697"}, + {file = "aiohttp-3.11.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f737fef6e117856400afee4f17774cdea392b28ecf058833f5eca368a18cf1bf"}, + {file = "aiohttp-3.11.9-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ea142255d4901b03f89cb6a94411ecec117786a76fc9ab043af8f51dd50b5313"}, + {file = "aiohttp-3.11.9-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6e1e9e447856e9b7b3d38e1316ae9a8c92e7536ef48373de758ea055edfd5db5"}, + {file = "aiohttp-3.11.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7f6173302f8a329ca5d1ee592af9e628d3ade87816e9958dcf7cdae2841def7"}, + {file = "aiohttp-3.11.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7c6147c6306f537cff59409609508a1d2eff81199f0302dd456bb9e7ea50c39"}, + {file = "aiohttp-3.11.9-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e9d036a9a41fc78e8a3f10a86c2fc1098fca8fab8715ba9eb999ce4788d35df0"}, + {file = "aiohttp-3.11.9-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:2ac9fd83096df36728da8e2f4488ac3b5602238f602706606f3702f07a13a409"}, + {file = "aiohttp-3.11.9-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:d3108f0ad5c6b6d78eec5273219a5bbd884b4aacec17883ceefaac988850ce6e"}, + {file = "aiohttp-3.11.9-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:96bbec47beb131bbf4bae05d8ef99ad9e5738f12717cfbbf16648b78b0232e87"}, + {file = "aiohttp-3.11.9-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:fc726c3fa8f606d07bd2b500e5dc4c0fd664c59be7788a16b9e34352c50b6b6b"}, + {file = "aiohttp-3.11.9-cp311-cp311-win32.whl", hash = "sha256:5720ebbc7a1b46c33a42d489d25d36c64c419f52159485e55589fbec648ea49a"}, + {file = "aiohttp-3.11.9-cp311-cp311-win_amd64.whl", hash = "sha256:17af09d963fa1acd7e4c280e9354aeafd9e3d47eaa4a6bfbd2171ad7da49f0c5"}, + {file = "aiohttp-3.11.9-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:c1f2d7fd583fc79c240094b3e7237d88493814d4b300d013a42726c35a734bc9"}, + {file = "aiohttp-3.11.9-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d4b8a1b6c7a68c73191f2ebd3bf66f7ce02f9c374e309bdb68ba886bbbf1b938"}, + {file = "aiohttp-3.11.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bd3f711f4c99da0091ced41dccdc1bcf8be0281dc314d6d9c6b6cf5df66f37a9"}, + {file = "aiohttp-3.11.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:44cb1a1326a0264480a789e6100dc3e07122eb8cd1ad6b784a3d47d13ed1d89c"}, + {file = "aiohttp-3.11.9-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7a7ddf981a0b953ade1c2379052d47ccda2f58ab678fca0671c7c7ca2f67aac2"}, + {file = "aiohttp-3.11.9-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6ffa45cc55b18d4ac1396d1ddb029f139b1d3480f1594130e62bceadf2e1a838"}, + {file = "aiohttp-3.11.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cca505829cdab58c2495ff418c96092d225a1bbd486f79017f6de915580d3c44"}, + {file = "aiohttp-3.11.9-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44d323aa80a867cb6db6bebb4bbec677c6478e38128847f2c6b0f70eae984d72"}, + {file = "aiohttp-3.11.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b2fab23003c4bb2249729a7290a76c1dda38c438300fdf97d4e42bf78b19c810"}, + {file = "aiohttp-3.11.9-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:be0c7c98e38a1e3ad7a6ff64af8b6d6db34bf5a41b1478e24c3c74d9e7f8ed42"}, + {file = "aiohttp-3.11.9-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5cc5e0d069c56645446c45a4b5010d4b33ac6c5ebfd369a791b5f097e46a3c08"}, + {file = "aiohttp-3.11.9-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9bcf97b971289be69638d8b1b616f7e557e1342debc7fc86cf89d3f08960e411"}, + {file = "aiohttp-3.11.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c7333e7239415076d1418dbfb7fa4df48f3a5b00f8fdf854fca549080455bc14"}, + {file = "aiohttp-3.11.9-cp312-cp312-win32.whl", hash = "sha256:9384b07cfd3045b37b05ed002d1c255db02fb96506ad65f0f9b776b762a7572e"}, + {file = "aiohttp-3.11.9-cp312-cp312-win_amd64.whl", hash = "sha256:f5252ba8b43906f206048fa569debf2cd0da0316e8d5b4d25abe53307f573941"}, + {file = "aiohttp-3.11.9-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:282e0a7ddd36ebc411f156aeaa0491e8fe7f030e2a95da532cf0c84b0b70bc66"}, + {file = "aiohttp-3.11.9-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ebd3e6b0c7d4954cca59d241970011f8d3327633d555051c430bd09ff49dc494"}, + {file = "aiohttp-3.11.9-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:30f9f89ae625d412043f12ca3771b2ccec227cc93b93bb1f994db6e1af40a7d3"}, + {file = "aiohttp-3.11.9-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a3b5b2c012d70c63d9d13c57ed1603709a4d9d7d473e4a9dfece0e4ea3d5f51"}, + {file = "aiohttp-3.11.9-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6ef1550bb5f55f71b97a6a395286db07f7f2c01c8890e613556df9a51da91e8d"}, + {file = "aiohttp-3.11.9-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:317251b9c9a2f1a9ff9cd093775b34c6861d1d7df9439ce3d32a88c275c995cd"}, + {file = "aiohttp-3.11.9-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21cbe97839b009826a61b143d3ca4964c8590d7aed33d6118125e5b71691ca46"}, + {file = "aiohttp-3.11.9-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:618b18c3a2360ac940a5503da14fa4f880c5b9bc315ec20a830357bcc62e6bae"}, + {file = "aiohttp-3.11.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a0cf4d814689e58f57ecd5d8c523e6538417ca2e72ff52c007c64065cef50fb2"}, + {file = "aiohttp-3.11.9-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:15c4e489942d987d5dac0ba39e5772dcbed4cc9ae3710d1025d5ba95e4a5349c"}, + {file = "aiohttp-3.11.9-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:ec8df0ff5a911c6d21957a9182402aad7bf060eaeffd77c9ea1c16aecab5adbf"}, + {file = "aiohttp-3.11.9-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:ed95d66745f53e129e935ad726167d3a6cb18c5d33df3165974d54742c373868"}, + {file = "aiohttp-3.11.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:647ec5bee7e4ec9f1034ab48173b5fa970d9a991e565549b965e93331f1328fe"}, + {file = "aiohttp-3.11.9-cp313-cp313-win32.whl", hash = "sha256:ef2c9499b7bd1e24e473dc1a85de55d72fd084eea3d8bdeec7ee0720decb54fa"}, + {file = "aiohttp-3.11.9-cp313-cp313-win_amd64.whl", hash = "sha256:84de955314aa5e8d469b00b14d6d714b008087a0222b0f743e7ffac34ef56aff"}, + {file = "aiohttp-3.11.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e738aabff3586091221044b7a584865ddc4d6120346d12e28e788307cd731043"}, + {file = "aiohttp-3.11.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:28f29bce89c3b401a53d6fd4bee401ee943083bf2bdc12ef297c1d63155070b0"}, + {file = "aiohttp-3.11.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:31de2f10f63f96cc19e04bd2df9549559beadd0b2ee2da24a17e7ed877ca8c60"}, + {file = "aiohttp-3.11.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f31cebd8c27a36af6c7346055ac564946e562080ee1a838da724585c67474f"}, + {file = "aiohttp-3.11.9-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0bcb7f6976dc0b6b56efde13294862adf68dd48854111b422a336fa729a82ea6"}, + {file = "aiohttp-3.11.9-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a8b13b9950d8b2f8f58b6e5842c4b842b5887e2c32e3f4644d6642f1659a530"}, + {file = "aiohttp-3.11.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9c23e62f3545c2216100603614f9e019e41b9403c47dd85b8e7e5015bf1bde0"}, + {file = "aiohttp-3.11.9-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ec656680fc53a13f849c71afd0c84a55c536206d524cbc831cde80abbe80489e"}, + {file = "aiohttp-3.11.9-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:36df00e0541f264ce42d62280281541a47474dfda500bc5b7f24f70a7f87be7a"}, + {file = "aiohttp-3.11.9-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:8dcfd14c712aa9dd18049280bfb2f95700ff6a8bde645e09f17c3ed3f05a0130"}, + {file = "aiohttp-3.11.9-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:14624d96f0d69cf451deed3173079a68c322279be6030208b045ab77e1e8d550"}, + {file = "aiohttp-3.11.9-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4b01d9cfcb616eeb6d40f02e66bebfe7b06d9f2ef81641fdd50b8dd981166e0b"}, + {file = "aiohttp-3.11.9-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:928f92f80e2e8d6567b87d3316c1fd9860ccfe36e87a9a7f5237d4cda8baa1ba"}, + {file = "aiohttp-3.11.9-cp39-cp39-win32.whl", hash = "sha256:c8a02f74ae419e3955af60f570d83187423e42e672a6433c5e292f1d23619269"}, + {file = "aiohttp-3.11.9-cp39-cp39-win_amd64.whl", hash = "sha256:0a97d657f6cf8782a830bb476c13f7d777cfcab8428ac49dde15c22babceb361"}, + {file = "aiohttp-3.11.9.tar.gz", hash = "sha256:a9266644064779840feec0e34f10a89b3ff1d2d6b751fe90017abcad1864fa7c"}, ] [package.dependencies] @@ -404,17 +402,17 @@ css = ["tinycss2 (>=1.1.0,<1.5)"] [[package]] name = "boto3" -version = "1.35.69" +version = "1.35.73" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.35.69-py3-none-any.whl", hash = "sha256:20945912130cca1505f45819cd9b7183a0e376e91a1221a0b1f50c80d35fd7e2"}, - {file = "boto3-1.35.69.tar.gz", hash = "sha256:40db86c7732a310b282f595251995ecafcbd62009a57e47a22683862e570cc7a"}, + {file = "boto3-1.35.73-py3-none-any.whl", hash = "sha256:473438feafe77d29fbea532a91a65de0d8751a4fa5822127218710a205e28e7a"}, + {file = "boto3-1.35.73.tar.gz", hash = "sha256:ccb1a365d3084de53b58f8dfc056462f49b16931c139f4c8ac5f0bca8cb8fe81"}, ] [package.dependencies] -botocore = ">=1.35.69,<1.36.0" +botocore = ">=1.35.73,<1.36.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -423,13 +421,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.35.69" +version = "1.35.73" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.35.69-py3-none-any.whl", hash = "sha256:cad8d9305f873404eee4b197d84e60a40975d43cbe1ab63abe893420ddfe6e3c"}, - {file = "botocore-1.35.69.tar.gz", hash = "sha256:f9f23dd76fb247d9b0e8d411d2995e6f847fc451c026f1e58e300f815b0b36eb"}, + {file = "botocore-1.35.73-py3-none-any.whl", hash = "sha256:8a6a0f5ad119e38d850571df8c625dbad66aec1b20c15f84cdcb95258f9f1edb"}, + {file = "botocore-1.35.73.tar.gz", hash = "sha256:b2e3ecdd1769f011f72c4c0d0094570ba125f4ca327f24269e4d68eb5d9878b9"}, ] [package.dependencies] @@ -1048,51 +1046,53 @@ dev = ["polib"] [[package]] name = "cryptography" -version = "43.0.3" +version = "44.0.0" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false -python-versions = ">=3.7" -files = [ - {file = "cryptography-43.0.3-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:bf7a1932ac4176486eab36a19ed4c0492da5d97123f1406cf15e41b05e787d2e"}, - {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63efa177ff54aec6e1c0aefaa1a241232dcd37413835a9b674b6e3f0ae2bfd3e"}, - {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e1ce50266f4f70bf41a2c6dc4358afadae90e2a1e5342d3c08883df1675374f"}, - {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:443c4a81bb10daed9a8f334365fe52542771f25aedaf889fd323a853ce7377d6"}, - {file = "cryptography-43.0.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:74f57f24754fe349223792466a709f8e0c093205ff0dca557af51072ff47ab18"}, - {file = "cryptography-43.0.3-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:9762ea51a8fc2a88b70cf2995e5675b38d93bf36bd67d91721c309df184f49bd"}, - {file = "cryptography-43.0.3-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:81ef806b1fef6b06dcebad789f988d3b37ccaee225695cf3e07648eee0fc6b73"}, - {file = "cryptography-43.0.3-cp37-abi3-win32.whl", hash = "sha256:cbeb489927bd7af4aa98d4b261af9a5bc025bd87f0e3547e11584be9e9427be2"}, - {file = "cryptography-43.0.3-cp37-abi3-win_amd64.whl", hash = "sha256:f46304d6f0c6ab8e52770addfa2fc41e6629495548862279641972b6215451cd"}, - {file = "cryptography-43.0.3-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:8ac43ae87929a5982f5948ceda07001ee5e83227fd69cf55b109144938d96984"}, - {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:846da004a5804145a5f441b8530b4bf35afbf7da70f82409f151695b127213d5"}, - {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f996e7268af62598f2fc1204afa98a3b5712313a55c4c9d434aef49cadc91d4"}, - {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:f7b178f11ed3664fd0e995a47ed2b5ff0a12d893e41dd0494f406d1cf555cab7"}, - {file = "cryptography-43.0.3-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:c2e6fc39c4ab499049df3bdf567f768a723a5e8464816e8f009f121a5a9f4405"}, - {file = "cryptography-43.0.3-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:e1be4655c7ef6e1bbe6b5d0403526601323420bcf414598955968c9ef3eb7d16"}, - {file = "cryptography-43.0.3-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:df6b6c6d742395dd77a23ea3728ab62f98379eff8fb61be2744d4679ab678f73"}, - {file = "cryptography-43.0.3-cp39-abi3-win32.whl", hash = "sha256:d56e96520b1020449bbace2b78b603442e7e378a9b3bd68de65c782db1507995"}, - {file = "cryptography-43.0.3-cp39-abi3-win_amd64.whl", hash = "sha256:0c580952eef9bf68c4747774cde7ec1d85a6e61de97281f2dba83c7d2c806362"}, - {file = "cryptography-43.0.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d03b5621a135bffecad2c73e9f4deb1a0f977b9a8ffe6f8e002bf6c9d07b918c"}, - {file = "cryptography-43.0.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:a2a431ee15799d6db9fe80c82b055bae5a752bef645bba795e8e52687c69efe3"}, - {file = "cryptography-43.0.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:281c945d0e28c92ca5e5930664c1cefd85efe80e5c0d2bc58dd63383fda29f83"}, - {file = "cryptography-43.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:f18c716be16bc1fea8e95def49edf46b82fccaa88587a45f8dc0ff6ab5d8e0a7"}, - {file = "cryptography-43.0.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4a02ded6cd4f0a5562a8887df8b3bd14e822a90f97ac5e544c162899bc467664"}, - {file = "cryptography-43.0.3-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:53a583b6637ab4c4e3591a15bc9db855b8d9dee9a669b550f311480acab6eb08"}, - {file = "cryptography-43.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:1ec0bcf7e17c0c5669d881b1cd38c4972fade441b27bda1051665faaa89bdcaa"}, - {file = "cryptography-43.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2ce6fae5bdad59577b44e4dfed356944fbf1d925269114c28be377692643b4ff"}, - {file = "cryptography-43.0.3.tar.gz", hash = "sha256:315b9001266a492a6ff443b61238f956b214dbec9910a081ba5b6646a055a805"}, +python-versions = "!=3.9.0,!=3.9.1,>=3.7" +files = [ + {file = "cryptography-44.0.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:84111ad4ff3f6253820e6d3e58be2cc2a00adb29335d4cacb5ab4d4d34f2a123"}, + {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b15492a11f9e1b62ba9d73c210e2416724633167de94607ec6069ef724fad092"}, + {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:831c3c4d0774e488fdc83a1923b49b9957d33287de923d58ebd3cec47a0ae43f"}, + {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:761817a3377ef15ac23cd7834715081791d4ec77f9297ee694ca1ee9c2c7e5eb"}, + {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3c672a53c0fb4725a29c303be906d3c1fa99c32f58abe008a82705f9ee96f40b"}, + {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:4ac4c9f37eba52cb6fbeaf5b59c152ea976726b865bd4cf87883a7e7006cc543"}, + {file = "cryptography-44.0.0-cp37-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:60eb32934076fa07e4316b7b2742fa52cbb190b42c2df2863dbc4230a0a9b385"}, + {file = "cryptography-44.0.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:ed3534eb1090483c96178fcb0f8893719d96d5274dfde98aa6add34614e97c8e"}, + {file = "cryptography-44.0.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:f3f6fdfa89ee2d9d496e2c087cebef9d4fcbb0ad63c40e821b39f74bf48d9c5e"}, + {file = "cryptography-44.0.0-cp37-abi3-win32.whl", hash = "sha256:eb33480f1bad5b78233b0ad3e1b0be21e8ef1da745d8d2aecbb20671658b9053"}, + {file = "cryptography-44.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:abc998e0c0eee3c8a1904221d3f67dcfa76422b23620173e28c11d3e626c21bd"}, + {file = "cryptography-44.0.0-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:660cb7312a08bc38be15b696462fa7cc7cd85c3ed9c576e81f4dc4d8b2b31591"}, + {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1923cb251c04be85eec9fda837661c67c1049063305d6be5721643c22dd4e2b7"}, + {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:404fdc66ee5f83a1388be54300ae978b2efd538018de18556dde92575e05defc"}, + {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:c5eb858beed7835e5ad1faba59e865109f3e52b3783b9ac21e7e47dc5554e289"}, + {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f53c2c87e0fb4b0c00fa9571082a057e37690a8f12233306161c8f4b819960b7"}, + {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:9e6fc8a08e116fb7c7dd1f040074c9d7b51d74a8ea40d4df2fc7aa08b76b9e6c"}, + {file = "cryptography-44.0.0-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:9abcc2e083cbe8dde89124a47e5e53ec38751f0d7dfd36801008f316a127d7ba"}, + {file = "cryptography-44.0.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:d2436114e46b36d00f8b72ff57e598978b37399d2786fd39793c36c6d5cb1c64"}, + {file = "cryptography-44.0.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a01956ddfa0a6790d594f5b34fc1bfa6098aca434696a03cfdbe469b8ed79285"}, + {file = "cryptography-44.0.0-cp39-abi3-win32.whl", hash = "sha256:eca27345e1214d1b9f9490d200f9db5a874479be914199194e746c893788d417"}, + {file = "cryptography-44.0.0-cp39-abi3-win_amd64.whl", hash = "sha256:708ee5f1bafe76d041b53a4f95eb28cdeb8d18da17e597d46d7833ee59b97ede"}, + {file = "cryptography-44.0.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:37d76e6863da3774cd9db5b409a9ecfd2c71c981c38788d3fcfaf177f447b731"}, + {file = "cryptography-44.0.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:f677e1268c4e23420c3acade68fac427fffcb8d19d7df95ed7ad17cdef8404f4"}, + {file = "cryptography-44.0.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:f5e7cb1e5e56ca0933b4873c0220a78b773b24d40d186b6738080b73d3d0a756"}, + {file = "cryptography-44.0.0-pp310-pypy310_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:8b3e6eae66cf54701ee7d9c83c30ac0a1e3fa17be486033000f2a73a12ab507c"}, + {file = "cryptography-44.0.0-pp310-pypy310_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:be4ce505894d15d5c5037167ffb7f0ae90b7be6f2a98f9a5c3442395501c32fa"}, + {file = "cryptography-44.0.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:62901fb618f74d7d81bf408c8719e9ec14d863086efe4185afd07c352aee1d2c"}, + {file = "cryptography-44.0.0.tar.gz", hash = "sha256:cd4e834f340b4293430701e772ec543b0fbe6c2dea510a5286fe0acabe153a02"}, ] [package.dependencies] cffi = {version = ">=1.12", markers = "platform_python_implementation != \"PyPy\""} [package.extras] -docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] -docstest = ["pyenchant (>=1.6.11)", "readme-renderer", "sphinxcontrib-spelling (>=4.0.1)"] -nox = ["nox"] -pep8test = ["check-sdist", "click", "mypy", "ruff"] -sdist = ["build"] +docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=3.0.0)"] +docstest = ["pyenchant (>=3)", "readme-renderer (>=30.0)", "sphinxcontrib-spelling (>=7.3.1)"] +nox = ["nox (>=2024.4.15)", "nox[uv] (>=2024.3.2)"] +pep8test = ["check-sdist", "click (>=8.0.1)", "mypy (>=1.4)", "ruff (>=0.3.6)"] +sdist = ["build (>=1.0.0)"] ssh = ["bcrypt (>=3.1.5)"] -test = ["certifi", "cryptography-vectors (==43.0.3)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test = ["certifi (>=2024)", "cryptography-vectors (==44.0.0)", "pretend (>=0.7)", "pytest (>=7.4.0)", "pytest-benchmark (>=4.0)", "pytest-cov (>=2.10.1)", "pytest-xdist (>=3.5.0)"] test-randomorder = ["pytest-randomly"] [[package]] @@ -1120,13 +1120,13 @@ test = ["mypy (==0.982)", "pytest (==7.1.3)", "pytest-cov (==3.0.0)", "pytest-fl [[package]] name = "disposable-email-domains" -version = "0.0.108" +version = "0.0.110" description = "A set of disposable email domains" optional = false python-versions = "*" files = [ - {file = "disposable_email_domains-0.0.108-py2.py3-none-any.whl", hash = "sha256:57a3ae6cfb03ef29f93c6aa069137f57b60cbcb8295d9f82b0158e357b32c799"}, - {file = "disposable_email_domains-0.0.108.tar.gz", hash = "sha256:4427cb11962dbfc5bb5afddbb6381fb7072eb7abf941bae4c37e414b544ae3c3"}, + {file = "disposable_email_domains-0.0.110-py2.py3-none-any.whl", hash = "sha256:bf0edb8dcd9f150a836a141362cc9b37e1c54f075ea82cc5b2c9f58b12eb14d7"}, + {file = "disposable_email_domains-0.0.110.tar.gz", hash = "sha256:c67df03fdc8cab867c74b578def8b2ae725276165a231f5fd2b28b1df0b9c5b9"}, ] [package.extras] @@ -1185,12 +1185,12 @@ Django = ">=1.11" [[package]] name = "django-allauth" -version = "65.2.0" +version = "65.3.0" description = "Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication." optional = false python-versions = ">=3.8" files = [ - {file = "django_allauth-65.2.0.tar.gz", hash = "sha256:0a3d7baf7beefd6fe8027316302c26ece7433cf4331a3b245d15fc9a7be68b6f"}, + {file = "django_allauth-65.3.0.tar.gz", hash = "sha256:92e0242724af03458b05b88c5fa798b01112ab22a86d873a8a9fd8f0ec57bbbf"}, ] [package.dependencies] @@ -1736,13 +1736,13 @@ files = [ [[package]] name = "drf-spectacular" -version = "0.27.2" +version = "0.28.0" description = "Sane and flexible OpenAPI 3 schema generation for Django REST framework" optional = false python-versions = ">=3.7" files = [ - {file = "drf-spectacular-0.27.2.tar.gz", hash = "sha256:a199492f2163c4101055075ebdbb037d59c6e0030692fc83a1a8c0fc65929981"}, - {file = "drf_spectacular-0.27.2-py3-none-any.whl", hash = "sha256:b1c04bf8b2fbbeaf6f59414b4ea448c8787aba4d32f76055c3b13335cf7ec37b"}, + {file = "drf_spectacular-0.28.0-py3-none-any.whl", hash = "sha256:856e7edf1056e49a4245e87a61e8da4baff46c83dbc25be1da2df77f354c7cb4"}, + {file = "drf_spectacular-0.28.0.tar.gz", hash = "sha256:2c778a47a40ab2f5078a7c42e82baba07397bb35b074ae4680721b2805943061"}, ] [package.dependencies] @@ -1791,13 +1791,13 @@ doc = ["Sphinx", "sphinx-rtd-theme", "sphinxcontrib-spelling"] [[package]] name = "faker" -version = "33.0.0" +version = "33.1.0" description = "Faker is a Python package that generates fake data for you." optional = false python-versions = ">=3.8" files = [ - {file = "Faker-33.0.0-py3-none-any.whl", hash = "sha256:68e5580cb6b4226710886e595eabc13127149d6e71e9d1db65506a7fbe2c7fce"}, - {file = "faker-33.0.0.tar.gz", hash = "sha256:9b01019c1ddaf2253ca2308c0472116e993f4ad8fc9905f82fa965e0c6f932e9"}, + {file = "Faker-33.1.0-py3-none-any.whl", hash = "sha256:d30c5f0e2796b8970de68978365247657486eb0311c5abe88d0b895b68dff05d"}, + {file = "faker-33.1.0.tar.gz", hash = "sha256:1c925fc0e86a51fc46648b504078c88d0cd48da1da2595c4e712841cab43a1e4"}, ] [package.dependencies] @@ -1806,13 +1806,13 @@ typing-extensions = "*" [[package]] name = "fido2" -version = "1.1.3" +version = "1.2.0" description = "FIDO2/WebAuthn library for implementing clients and servers." optional = false -python-versions = ">=3.8,<4.0" +python-versions = "<4.0,>=3.8" files = [ - {file = "fido2-1.1.3-py3-none-any.whl", hash = "sha256:6be34c0b9fe85e4911fd2d103cce7ae8ce2f064384a7a2a3bd970b3ef7702931"}, - {file = "fido2-1.1.3.tar.gz", hash = "sha256:26100f226d12ced621ca6198528ce17edf67b78df4287aee1285fee3cd5aa9fc"}, + {file = "fido2-1.2.0-py3-none-any.whl", hash = "sha256:f7c8ee62e359aa980a45773f9493965bb29ede1b237a9218169dbfe60c80e130"}, + {file = "fido2-1.2.0.tar.gz", hash = "sha256:e39f95920122d64283fda5e5581d95a206e704fa42846bfa4662f86aa0d3333b"}, ] [package.dependencies] @@ -3104,109 +3104,93 @@ wcwidth = "*" [[package]] name = "propcache" -version = "0.2.0" +version = "0.2.1" description = "Accelerated property cache" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "propcache-0.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c5869b8fd70b81835a6f187c5fdbe67917a04d7e52b6e7cc4e5fe39d55c39d58"}, - {file = "propcache-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:952e0d9d07609d9c5be361f33b0d6d650cd2bae393aabb11d9b719364521984b"}, - {file = "propcache-0.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:33ac8f098df0585c0b53009f039dfd913b38c1d2edafed0cedcc0c32a05aa110"}, - {file = "propcache-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:97e48e8875e6c13909c800fa344cd54cc4b2b0db1d5f911f840458a500fde2c2"}, - {file = "propcache-0.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:388f3217649d6d59292b722d940d4d2e1e6a7003259eb835724092a1cca0203a"}, - {file = "propcache-0.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f571aea50ba5623c308aa146eb650eebf7dbe0fd8c5d946e28343cb3b5aad577"}, - {file = "propcache-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3dfafb44f7bb35c0c06eda6b2ab4bfd58f02729e7c4045e179f9a861b07c9850"}, - {file = "propcache-0.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3ebe9a75be7ab0b7da2464a77bb27febcb4fab46a34f9288f39d74833db7f61"}, - {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d2f0d0f976985f85dfb5f3d685697ef769faa6b71993b46b295cdbbd6be8cc37"}, - {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:a3dc1a4b165283bd865e8f8cb5f0c64c05001e0718ed06250d8cac9bec115b48"}, - {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:9e0f07b42d2a50c7dd2d8675d50f7343d998c64008f1da5fef888396b7f84630"}, - {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:e63e3e1e0271f374ed489ff5ee73d4b6e7c60710e1f76af5f0e1a6117cd26394"}, - {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:56bb5c98f058a41bb58eead194b4db8c05b088c93d94d5161728515bd52b052b"}, - {file = "propcache-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7665f04d0c7f26ff8bb534e1c65068409bf4687aa2534faf7104d7182debb336"}, - {file = "propcache-0.2.0-cp310-cp310-win32.whl", hash = "sha256:7cf18abf9764746b9c8704774d8b06714bcb0a63641518a3a89c7f85cc02c2ad"}, - {file = "propcache-0.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:cfac69017ef97db2438efb854edf24f5a29fd09a536ff3a992b75990720cdc99"}, - {file = "propcache-0.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:63f13bf09cc3336eb04a837490b8f332e0db41da66995c9fd1ba04552e516354"}, - {file = "propcache-0.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:608cce1da6f2672a56b24a015b42db4ac612ee709f3d29f27a00c943d9e851de"}, - {file = "propcache-0.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:466c219deee4536fbc83c08d09115249db301550625c7fef1c5563a584c9bc87"}, - {file = "propcache-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc2db02409338bf36590aa985a461b2c96fce91f8e7e0f14c50c5fcc4f229016"}, - {file = "propcache-0.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a6ed8db0a556343d566a5c124ee483ae113acc9a557a807d439bcecc44e7dfbb"}, - {file = "propcache-0.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:91997d9cb4a325b60d4e3f20967f8eb08dfcb32b22554d5ef78e6fd1dda743a2"}, - {file = "propcache-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c7dde9e533c0a49d802b4f3f218fa9ad0a1ce21f2c2eb80d5216565202acab4"}, - {file = "propcache-0.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffcad6c564fe6b9b8916c1aefbb37a362deebf9394bd2974e9d84232e3e08504"}, - {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:97a58a28bcf63284e8b4d7b460cbee1edaab24634e82059c7b8c09e65284f178"}, - {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:945db8ee295d3af9dbdbb698cce9bbc5c59b5c3fe328bbc4387f59a8a35f998d"}, - {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:39e104da444a34830751715f45ef9fc537475ba21b7f1f5b0f4d71a3b60d7fe2"}, - {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c5ecca8f9bab618340c8e848d340baf68bcd8ad90a8ecd7a4524a81c1764b3db"}, - {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:c436130cc779806bdf5d5fae0d848713105472b8566b75ff70048c47d3961c5b"}, - {file = "propcache-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:191db28dc6dcd29d1a3e063c3be0b40688ed76434622c53a284e5427565bbd9b"}, - {file = "propcache-0.2.0-cp311-cp311-win32.whl", hash = "sha256:5f2564ec89058ee7c7989a7b719115bdfe2a2fb8e7a4543b8d1c0cc4cf6478c1"}, - {file = "propcache-0.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:6e2e54267980349b723cff366d1e29b138b9a60fa376664a157a342689553f71"}, - {file = "propcache-0.2.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:2ee7606193fb267be4b2e3b32714f2d58cad27217638db98a60f9efb5efeccc2"}, - {file = "propcache-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:91ee8fc02ca52e24bcb77b234f22afc03288e1dafbb1f88fe24db308910c4ac7"}, - {file = "propcache-0.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2e900bad2a8456d00a113cad8c13343f3b1f327534e3589acc2219729237a2e8"}, - {file = "propcache-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f52a68c21363c45297aca15561812d542f8fc683c85201df0bebe209e349f793"}, - {file = "propcache-0.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1e41d67757ff4fbc8ef2af99b338bfb955010444b92929e9e55a6d4dcc3c4f09"}, - {file = "propcache-0.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a64e32f8bd94c105cc27f42d3b658902b5bcc947ece3c8fe7bc1b05982f60e89"}, - {file = "propcache-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:55346705687dbd7ef0d77883ab4f6fabc48232f587925bdaf95219bae072491e"}, - {file = "propcache-0.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:00181262b17e517df2cd85656fcd6b4e70946fe62cd625b9d74ac9977b64d8d9"}, - {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6994984550eaf25dd7fc7bd1b700ff45c894149341725bb4edc67f0ffa94efa4"}, - {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:56295eb1e5f3aecd516d91b00cfd8bf3a13991de5a479df9e27dd569ea23959c"}, - {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:439e76255daa0f8151d3cb325f6dd4a3e93043e6403e6491813bcaaaa8733887"}, - {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:f6475a1b2ecb310c98c28d271a30df74f9dd436ee46d09236a6b750a7599ce57"}, - {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3444cdba6628accf384e349014084b1cacd866fbb88433cd9d279d90a54e0b23"}, - {file = "propcache-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4a9d9b4d0a9b38d1c391bb4ad24aa65f306c6f01b512e10a8a34a2dc5675d348"}, - {file = "propcache-0.2.0-cp312-cp312-win32.whl", hash = "sha256:69d3a98eebae99a420d4b28756c8ce6ea5a29291baf2dc9ff9414b42676f61d5"}, - {file = "propcache-0.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:ad9c9b99b05f163109466638bd30ada1722abb01bbb85c739c50b6dc11f92dc3"}, - {file = "propcache-0.2.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ecddc221a077a8132cf7c747d5352a15ed763b674c0448d811f408bf803d9ad7"}, - {file = "propcache-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0e53cb83fdd61cbd67202735e6a6687a7b491c8742dfc39c9e01e80354956763"}, - {file = "propcache-0.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92fe151145a990c22cbccf9ae15cae8ae9eddabfc949a219c9f667877e40853d"}, - {file = "propcache-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d6a21ef516d36909931a2967621eecb256018aeb11fc48656e3257e73e2e247a"}, - {file = "propcache-0.2.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3f88a4095e913f98988f5b338c1d4d5d07dbb0b6bad19892fd447484e483ba6b"}, - {file = "propcache-0.2.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5a5b3bb545ead161be780ee85a2b54fdf7092815995661947812dde94a40f6fb"}, - {file = "propcache-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67aeb72e0f482709991aa91345a831d0b707d16b0257e8ef88a2ad246a7280bf"}, - {file = "propcache-0.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c997f8c44ec9b9b0bcbf2d422cc00a1d9b9c681f56efa6ca149a941e5560da2"}, - {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2a66df3d4992bc1d725b9aa803e8c5a66c010c65c741ad901e260ece77f58d2f"}, - {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:3ebbcf2a07621f29638799828b8d8668c421bfb94c6cb04269130d8de4fb7136"}, - {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1235c01ddaa80da8235741e80815ce381c5267f96cc49b1477fdcf8c047ef325"}, - {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3947483a381259c06921612550867b37d22e1df6d6d7e8361264b6d037595f44"}, - {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d5bed7f9805cc29c780f3aee05de3262ee7ce1f47083cfe9f77471e9d6777e83"}, - {file = "propcache-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e4a91d44379f45f5e540971d41e4626dacd7f01004826a18cb048e7da7e96544"}, - {file = "propcache-0.2.0-cp313-cp313-win32.whl", hash = "sha256:f902804113e032e2cdf8c71015651c97af6418363bea8d78dc0911d56c335032"}, - {file = "propcache-0.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:8f188cfcc64fb1266f4684206c9de0e80f54622c3f22a910cbd200478aeae61e"}, - {file = "propcache-0.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:53d1bd3f979ed529f0805dd35ddaca330f80a9a6d90bc0121d2ff398f8ed8861"}, - {file = "propcache-0.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:83928404adf8fb3d26793665633ea79b7361efa0287dfbd372a7e74311d51ee6"}, - {file = "propcache-0.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:77a86c261679ea5f3896ec060be9dc8e365788248cc1e049632a1be682442063"}, - {file = "propcache-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:218db2a3c297a3768c11a34812e63b3ac1c3234c3a086def9c0fee50d35add1f"}, - {file = "propcache-0.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7735e82e3498c27bcb2d17cb65d62c14f1100b71723b68362872bca7d0913d90"}, - {file = "propcache-0.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:20a617c776f520c3875cf4511e0d1db847a076d720714ae35ffe0df3e440be68"}, - {file = "propcache-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67b69535c870670c9f9b14a75d28baa32221d06f6b6fa6f77a0a13c5a7b0a5b9"}, - {file = "propcache-0.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4569158070180c3855e9c0791c56be3ceeb192defa2cdf6a3f39e54319e56b89"}, - {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:db47514ffdbd91ccdc7e6f8407aac4ee94cc871b15b577c1c324236b013ddd04"}, - {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_armv7l.whl", hash = "sha256:2a60ad3e2553a74168d275a0ef35e8c0a965448ffbc3b300ab3a5bb9956c2162"}, - {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:662dd62358bdeaca0aee5761de8727cfd6861432e3bb828dc2a693aa0471a563"}, - {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:25a1f88b471b3bc911d18b935ecb7115dff3a192b6fef46f0bfaf71ff4f12418"}, - {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:f60f0ac7005b9f5a6091009b09a419ace1610e163fa5deaba5ce3484341840e7"}, - {file = "propcache-0.2.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:74acd6e291f885678631b7ebc85d2d4aec458dd849b8c841b57ef04047833bed"}, - {file = "propcache-0.2.0-cp38-cp38-win32.whl", hash = "sha256:d9b6ddac6408194e934002a69bcaadbc88c10b5f38fb9307779d1c629181815d"}, - {file = "propcache-0.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:676135dcf3262c9c5081cc8f19ad55c8a64e3f7282a21266d05544450bffc3a5"}, - {file = "propcache-0.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:25c8d773a62ce0451b020c7b29a35cfbc05de8b291163a7a0f3b7904f27253e6"}, - {file = "propcache-0.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:375a12d7556d462dc64d70475a9ee5982465fbb3d2b364f16b86ba9135793638"}, - {file = "propcache-0.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1ec43d76b9677637a89d6ab86e1fef70d739217fefa208c65352ecf0282be957"}, - {file = "propcache-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f45eec587dafd4b2d41ac189c2156461ebd0c1082d2fe7013571598abb8505d1"}, - {file = "propcache-0.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc092ba439d91df90aea38168e11f75c655880c12782facf5cf9c00f3d42b562"}, - {file = "propcache-0.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fa1076244f54bb76e65e22cb6910365779d5c3d71d1f18b275f1dfc7b0d71b4d"}, - {file = "propcache-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:682a7c79a2fbf40f5dbb1eb6bfe2cd865376deeac65acf9beb607505dced9e12"}, - {file = "propcache-0.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8e40876731f99b6f3c897b66b803c9e1c07a989b366c6b5b475fafd1f7ba3fb8"}, - {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:363ea8cd3c5cb6679f1c2f5f1f9669587361c062e4899fce56758efa928728f8"}, - {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:140fbf08ab3588b3468932974a9331aff43c0ab8a2ec2c608b6d7d1756dbb6cb"}, - {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e70fac33e8b4ac63dfc4c956fd7d85a0b1139adcfc0d964ce288b7c527537fea"}, - {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:b33d7a286c0dc1a15f5fc864cc48ae92a846df287ceac2dd499926c3801054a6"}, - {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:f6d5749fdd33d90e34c2efb174c7e236829147a2713334d708746e94c4bde40d"}, - {file = "propcache-0.2.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:22aa8f2272d81d9317ff5756bb108021a056805ce63dd3630e27d042c8092798"}, - {file = "propcache-0.2.0-cp39-cp39-win32.whl", hash = "sha256:73e4b40ea0eda421b115248d7e79b59214411109a5bc47d0d48e4c73e3b8fcf9"}, - {file = "propcache-0.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:9517d5e9e0731957468c29dbfd0f976736a0e55afaea843726e887f36fe017df"}, - {file = "propcache-0.2.0-py3-none-any.whl", hash = "sha256:2ccc28197af5313706511fab3a8b66dcd6da067a1331372c82ea1cb74285e036"}, - {file = "propcache-0.2.0.tar.gz", hash = "sha256:df81779732feb9d01e5d513fad0122efb3d53bbc75f61b2a4f29a020bc985e70"}, + {file = "propcache-0.2.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6b3f39a85d671436ee3d12c017f8fdea38509e4f25b28eb25877293c98c243f6"}, + {file = "propcache-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39d51fbe4285d5db5d92a929e3e21536ea3dd43732c5b177c7ef03f918dff9f2"}, + {file = "propcache-0.2.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6445804cf4ec763dc70de65a3b0d9954e868609e83850a47ca4f0cb64bd79fea"}, + {file = "propcache-0.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9479aa06a793c5aeba49ce5c5692ffb51fcd9a7016e017d555d5e2b0045d212"}, + {file = "propcache-0.2.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9631c5e8b5b3a0fda99cb0d29c18133bca1e18aea9effe55adb3da1adef80d3"}, + {file = "propcache-0.2.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3156628250f46a0895f1f36e1d4fbe062a1af8718ec3ebeb746f1d23f0c5dc4d"}, + {file = "propcache-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b6fb63ae352e13748289f04f37868099e69dba4c2b3e271c46061e82c745634"}, + {file = "propcache-0.2.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:887d9b0a65404929641a9fabb6452b07fe4572b269d901d622d8a34a4e9043b2"}, + {file = "propcache-0.2.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a96dc1fa45bd8c407a0af03b2d5218392729e1822b0c32e62c5bf7eeb5fb3958"}, + {file = "propcache-0.2.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:a7e65eb5c003a303b94aa2c3852ef130230ec79e349632d030e9571b87c4698c"}, + {file = "propcache-0.2.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:999779addc413181912e984b942fbcc951be1f5b3663cd80b2687758f434c583"}, + {file = "propcache-0.2.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:19a0f89a7bb9d8048d9c4370c9c543c396e894c76be5525f5e1ad287f1750ddf"}, + {file = "propcache-0.2.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:1ac2f5fe02fa75f56e1ad473f1175e11f475606ec9bd0be2e78e4734ad575034"}, + {file = "propcache-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:574faa3b79e8ebac7cb1d7930f51184ba1ccf69adfdec53a12f319a06030a68b"}, + {file = "propcache-0.2.1-cp310-cp310-win32.whl", hash = "sha256:03ff9d3f665769b2a85e6157ac8b439644f2d7fd17615a82fa55739bc97863f4"}, + {file = "propcache-0.2.1-cp310-cp310-win_amd64.whl", hash = "sha256:2d3af2e79991102678f53e0dbf4c35de99b6b8b58f29a27ca0325816364caaba"}, + {file = "propcache-0.2.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:1ffc3cca89bb438fb9c95c13fc874012f7b9466b89328c3c8b1aa93cdcfadd16"}, + {file = "propcache-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f174bbd484294ed9fdf09437f889f95807e5f229d5d93588d34e92106fbf6717"}, + {file = "propcache-0.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:70693319e0b8fd35dd863e3e29513875eb15c51945bf32519ef52927ca883bc3"}, + {file = "propcache-0.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b480c6a4e1138e1aa137c0079b9b6305ec6dcc1098a8ca5196283e8a49df95a9"}, + {file = "propcache-0.2.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d27b84d5880f6d8aa9ae3edb253c59d9f6642ffbb2c889b78b60361eed449787"}, + {file = "propcache-0.2.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:857112b22acd417c40fa4595db2fe28ab900c8c5fe4670c7989b1c0230955465"}, + {file = "propcache-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cf6c4150f8c0e32d241436526f3c3f9cbd34429492abddbada2ffcff506c51af"}, + {file = "propcache-0.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:66d4cfda1d8ed687daa4bc0274fcfd5267873db9a5bc0418c2da19273040eeb7"}, + {file = "propcache-0.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c2f992c07c0fca81655066705beae35fc95a2fa7366467366db627d9f2ee097f"}, + {file = "propcache-0.2.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:4a571d97dbe66ef38e472703067021b1467025ec85707d57e78711c085984e54"}, + {file = "propcache-0.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:bb6178c241278d5fe853b3de743087be7f5f4c6f7d6d22a3b524d323eecec505"}, + {file = "propcache-0.2.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:ad1af54a62ffe39cf34db1aa6ed1a1873bd548f6401db39d8e7cd060b9211f82"}, + {file = "propcache-0.2.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:e7048abd75fe40712005bcfc06bb44b9dfcd8e101dda2ecf2f5aa46115ad07ca"}, + {file = "propcache-0.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:160291c60081f23ee43d44b08a7e5fb76681221a8e10b3139618c5a9a291b84e"}, + {file = "propcache-0.2.1-cp311-cp311-win32.whl", hash = "sha256:819ce3b883b7576ca28da3861c7e1a88afd08cc8c96908e08a3f4dd64a228034"}, + {file = "propcache-0.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:edc9fc7051e3350643ad929df55c451899bb9ae6d24998a949d2e4c87fb596d3"}, + {file = "propcache-0.2.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:081a430aa8d5e8876c6909b67bd2d937bfd531b0382d3fdedb82612c618bc41a"}, + {file = "propcache-0.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d2ccec9ac47cf4e04897619c0e0c1a48c54a71bdf045117d3a26f80d38ab1fb0"}, + {file = "propcache-0.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:14d86fe14b7e04fa306e0c43cdbeebe6b2c2156a0c9ce56b815faacc193e320d"}, + {file = "propcache-0.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:049324ee97bb67285b49632132db351b41e77833678432be52bdd0289c0e05e4"}, + {file = "propcache-0.2.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1cd9a1d071158de1cc1c71a26014dcdfa7dd3d5f4f88c298c7f90ad6f27bb46d"}, + {file = "propcache-0.2.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98110aa363f1bb4c073e8dcfaefd3a5cea0f0834c2aab23dda657e4dab2f53b5"}, + {file = "propcache-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:647894f5ae99c4cf6bb82a1bb3a796f6e06af3caa3d32e26d2350d0e3e3faf24"}, + {file = "propcache-0.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bfd3223c15bebe26518d58ccf9a39b93948d3dcb3e57a20480dfdd315356baff"}, + {file = "propcache-0.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d71264a80f3fcf512eb4f18f59423fe82d6e346ee97b90625f283df56aee103f"}, + {file = "propcache-0.2.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:e73091191e4280403bde6c9a52a6999d69cdfde498f1fdf629105247599b57ec"}, + {file = "propcache-0.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3935bfa5fede35fb202c4b569bb9c042f337ca4ff7bd540a0aa5e37131659348"}, + {file = "propcache-0.2.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:f508b0491767bb1f2b87fdfacaba5f7eddc2f867740ec69ece6d1946d29029a6"}, + {file = "propcache-0.2.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:1672137af7c46662a1c2be1e8dc78cb6d224319aaa40271c9257d886be4363a6"}, + {file = "propcache-0.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b74c261802d3d2b85c9df2dfb2fa81b6f90deeef63c2db9f0e029a3cac50b518"}, + {file = "propcache-0.2.1-cp312-cp312-win32.whl", hash = "sha256:d09c333d36c1409d56a9d29b3a1b800a42c76a57a5a8907eacdbce3f18768246"}, + {file = "propcache-0.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:c214999039d4f2a5b2073ac506bba279945233da8c786e490d411dfc30f855c1"}, + {file = "propcache-0.2.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aca405706e0b0a44cc6bfd41fbe89919a6a56999157f6de7e182a990c36e37bc"}, + {file = "propcache-0.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:12d1083f001ace206fe34b6bdc2cb94be66d57a850866f0b908972f90996b3e9"}, + {file = "propcache-0.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d93f3307ad32a27bda2e88ec81134b823c240aa3abb55821a8da553eed8d9439"}, + {file = "propcache-0.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba278acf14471d36316159c94a802933d10b6a1e117b8554fe0d0d9b75c9d536"}, + {file = "propcache-0.2.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4e6281aedfca15301c41f74d7005e6e3f4ca143584ba696ac69df4f02f40d629"}, + {file = "propcache-0.2.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5b750a8e5a1262434fb1517ddf64b5de58327f1adc3524a5e44c2ca43305eb0b"}, + {file = "propcache-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf72af5e0fb40e9babf594308911436c8efde3cb5e75b6f206c34ad18be5c052"}, + {file = "propcache-0.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b2d0a12018b04f4cb820781ec0dffb5f7c7c1d2a5cd22bff7fb055a2cb19ebce"}, + {file = "propcache-0.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e800776a79a5aabdb17dcc2346a7d66d0777e942e4cd251defeb084762ecd17d"}, + {file = "propcache-0.2.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:4160d9283bd382fa6c0c2b5e017acc95bc183570cd70968b9202ad6d8fc48dce"}, + {file = "propcache-0.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:30b43e74f1359353341a7adb783c8f1b1c676367b011709f466f42fda2045e95"}, + {file = "propcache-0.2.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:58791550b27d5488b1bb52bc96328456095d96206a250d28d874fafe11b3dfaf"}, + {file = "propcache-0.2.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:0f022d381747f0dfe27e99d928e31bc51a18b65bb9e481ae0af1380a6725dd1f"}, + {file = "propcache-0.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:297878dc9d0a334358f9b608b56d02e72899f3b8499fc6044133f0d319e2ec30"}, + {file = "propcache-0.2.1-cp313-cp313-win32.whl", hash = "sha256:ddfab44e4489bd79bda09d84c430677fc7f0a4939a73d2bba3073036f487a0a6"}, + {file = "propcache-0.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:556fc6c10989f19a179e4321e5d678db8eb2924131e64652a51fe83e4c3db0e1"}, + {file = "propcache-0.2.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:6a9a8c34fb7bb609419a211e59da8887eeca40d300b5ea8e56af98f6fbbb1541"}, + {file = "propcache-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ae1aa1cd222c6d205853b3013c69cd04515f9d6ab6de4b0603e2e1c33221303e"}, + {file = "propcache-0.2.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:accb6150ce61c9c4b7738d45550806aa2b71c7668c6942f17b0ac182b6142fd4"}, + {file = "propcache-0.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5eee736daafa7af6d0a2dc15cc75e05c64f37fc37bafef2e00d77c14171c2097"}, + {file = "propcache-0.2.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7a31fc1e1bd362874863fdeed71aed92d348f5336fd84f2197ba40c59f061bd"}, + {file = "propcache-0.2.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba4cfa1052819d16699e1d55d18c92b6e094d4517c41dd231a8b9f87b6fa681"}, + {file = "propcache-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f089118d584e859c62b3da0892b88a83d611c2033ac410e929cb6754eec0ed16"}, + {file = "propcache-0.2.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:781e65134efaf88feb447e8c97a51772aa75e48b794352f94cb7ea717dedda0d"}, + {file = "propcache-0.2.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:31f5af773530fd3c658b32b6bdc2d0838543de70eb9a2156c03e410f7b0d3aae"}, + {file = "propcache-0.2.1-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:a7a078f5d37bee6690959c813977da5291b24286e7b962e62a94cec31aa5188b"}, + {file = "propcache-0.2.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:cea7daf9fc7ae6687cf1e2c049752f19f146fdc37c2cc376e7d0032cf4f25347"}, + {file = "propcache-0.2.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:8b3489ff1ed1e8315674d0775dc7d2195fb13ca17b3808721b54dbe9fd020faf"}, + {file = "propcache-0.2.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:9403db39be1393618dd80c746cb22ccda168efce239c73af13c3763ef56ffc04"}, + {file = "propcache-0.2.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:5d97151bc92d2b2578ff7ce779cdb9174337390a535953cbb9452fb65164c587"}, + {file = "propcache-0.2.1-cp39-cp39-win32.whl", hash = "sha256:9caac6b54914bdf41bcc91e7eb9147d331d29235a7c967c150ef5df6464fd1bb"}, + {file = "propcache-0.2.1-cp39-cp39-win_amd64.whl", hash = "sha256:92fc4500fcb33899b05ba73276dfb684a20d31caa567b7cb5252d48f896a91b1"}, + {file = "propcache-0.2.1-py3-none-any.whl", hash = "sha256:52277518d6aae65536e9cea52d4e7fd2f7a66f4aa2d30ed3f2fcea620ace3c54"}, + {file = "propcache-0.2.1.tar.gz", hash = "sha256:3f77ce728b19cb537714499928fe800c3dda29e8d9428778fc7c186da4c09a64"}, ] [[package]] @@ -3266,13 +3250,13 @@ files = [ [[package]] name = "pydantic" -version = "2.10.1" +version = "2.10.2" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.10.1-py3-none-any.whl", hash = "sha256:a8d20db84de64cf4a7d59e899c2caf0fe9d660c7cfc482528e7020d7dd189a7e"}, - {file = "pydantic-2.10.1.tar.gz", hash = "sha256:a4daca2dc0aa429555e0656d6bf94873a7dc5f54ee42b1f5873d666fb3f35560"}, + {file = "pydantic-2.10.2-py3-none-any.whl", hash = "sha256:cfb96e45951117c3024e6b67b25cdc33a3cb7b2fa62e239f7af1378358a1d99e"}, + {file = "pydantic-2.10.2.tar.gz", hash = "sha256:2bc2d7f17232e0841cbba4641e65ba1eb6fafb3a08de3a091ff3ce14a197c4fa"}, ] [package.dependencies] @@ -3447,13 +3431,13 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pyjwt" -version = "2.10.0" +version = "2.10.1" description = "JSON Web Token implementation in Python" optional = false python-versions = ">=3.9" files = [ - {file = "PyJWT-2.10.0-py3-none-any.whl", hash = "sha256:543b77207db656de204372350926bed5a86201c4cbff159f623f79c7bb487a15"}, - {file = "pyjwt-2.10.0.tar.gz", hash = "sha256:7628a7eb7938959ac1b26e819a1df0fd3259505627b575e4bad6d08f76db695c"}, + {file = "PyJWT-2.10.1-py3-none-any.whl", hash = "sha256:dcdd193e30abefd5debf142f9adfcdd2b58004e644f25406ffaebd50bd98dacb"}, + {file = "pyjwt-2.10.1.tar.gz", hash = "sha256:3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953"}, ] [package.dependencies] @@ -3603,13 +3587,13 @@ files = [ [[package]] name = "pytest" -version = "8.3.3" +version = "8.3.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" files = [ - {file = "pytest-8.3.3-py3-none-any.whl", hash = "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2"}, - {file = "pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181"}, + {file = "pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6"}, + {file = "pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761"}, ] [package.dependencies] @@ -3694,12 +3678,13 @@ dev = ["pre-commit", "pytest-asyncio", "tox"] [[package]] name = "pytest-playwright" -version = "0.6.1" +version = "0.6.2" description = "A pytest wrapper with fixtures for Playwright to automate web browsers" optional = false python-versions = ">=3.9" files = [ - {file = "pytest_playwright-0.6.1.tar.gz", hash = "sha256:f4ccbed1ce8d37a945c010811aa9eb9aa7120eea7cad29620b90d5389fd8caf7"}, + {file = "pytest_playwright-0.6.2-py3-none-any.whl", hash = "sha256:0eff73bebe497b0158befed91e2f5fe94cfa17181f8b3acf575beed84e7e9043"}, + {file = "pytest_playwright-0.6.2.tar.gz", hash = "sha256:ff4054b19aa05df096ac6f74f0572591566aaf0f6d97f6cb9674db8a4d4ed06c"}, ] [package.dependencies] @@ -4130,101 +4115,112 @@ files = [ [[package]] name = "rpds-py" -version = "0.21.0" +version = "0.22.0" description = "Python bindings to Rust's persistent data structures (rpds)" optional = false python-versions = ">=3.9" files = [ - {file = "rpds_py-0.21.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:a017f813f24b9df929674d0332a374d40d7f0162b326562daae8066b502d0590"}, - {file = "rpds_py-0.21.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:20cc1ed0bcc86d8e1a7e968cce15be45178fd16e2ff656a243145e0b439bd250"}, - {file = "rpds_py-0.21.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad116dda078d0bc4886cb7840e19811562acdc7a8e296ea6ec37e70326c1b41c"}, - {file = "rpds_py-0.21.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:808f1ac7cf3b44f81c9475475ceb221f982ef548e44e024ad5f9e7060649540e"}, - {file = "rpds_py-0.21.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de552f4a1916e520f2703ec474d2b4d3f86d41f353e7680b597512ffe7eac5d0"}, - {file = "rpds_py-0.21.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:efec946f331349dfc4ae9d0e034c263ddde19414fe5128580f512619abed05f1"}, - {file = "rpds_py-0.21.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b80b4690bbff51a034bfde9c9f6bf9357f0a8c61f548942b80f7b66356508bf5"}, - {file = "rpds_py-0.21.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:085ed25baac88953d4283e5b5bd094b155075bb40d07c29c4f073e10623f9f2e"}, - {file = "rpds_py-0.21.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:daa8efac2a1273eed2354397a51216ae1e198ecbce9036fba4e7610b308b6153"}, - {file = "rpds_py-0.21.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:95a5bad1ac8a5c77b4e658671642e4af3707f095d2b78a1fdd08af0dfb647624"}, - {file = "rpds_py-0.21.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3e53861b29a13d5b70116ea4230b5f0f3547b2c222c5daa090eb7c9c82d7f664"}, - {file = "rpds_py-0.21.0-cp310-none-win32.whl", hash = "sha256:ea3a6ac4d74820c98fcc9da4a57847ad2cc36475a8bd9683f32ab6d47a2bd682"}, - {file = "rpds_py-0.21.0-cp310-none-win_amd64.whl", hash = "sha256:b8f107395f2f1d151181880b69a2869c69e87ec079c49c0016ab96860b6acbe5"}, - {file = "rpds_py-0.21.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:5555db3e618a77034954b9dc547eae94166391a98eb867905ec8fcbce1308d95"}, - {file = "rpds_py-0.21.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:97ef67d9bbc3e15584c2f3c74bcf064af36336c10d2e21a2131e123ce0f924c9"}, - {file = "rpds_py-0.21.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ab2c2a26d2f69cdf833174f4d9d86118edc781ad9a8fa13970b527bf8236027"}, - {file = "rpds_py-0.21.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4e8921a259f54bfbc755c5bbd60c82bb2339ae0324163f32868f63f0ebb873d9"}, - {file = "rpds_py-0.21.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8a7ff941004d74d55a47f916afc38494bd1cfd4b53c482b77c03147c91ac0ac3"}, - {file = "rpds_py-0.21.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5145282a7cd2ac16ea0dc46b82167754d5e103a05614b724457cffe614f25bd8"}, - {file = "rpds_py-0.21.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de609a6f1b682f70bb7163da745ee815d8f230d97276db049ab447767466a09d"}, - {file = "rpds_py-0.21.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:40c91c6e34cf016fa8e6b59d75e3dbe354830777fcfd74c58b279dceb7975b75"}, - {file = "rpds_py-0.21.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d2132377f9deef0c4db89e65e8bb28644ff75a18df5293e132a8d67748397b9f"}, - {file = "rpds_py-0.21.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:0a9e0759e7be10109645a9fddaaad0619d58c9bf30a3f248a2ea57a7c417173a"}, - {file = "rpds_py-0.21.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9e20da3957bdf7824afdd4b6eeb29510e83e026473e04952dca565170cd1ecc8"}, - {file = "rpds_py-0.21.0-cp311-none-win32.whl", hash = "sha256:f71009b0d5e94c0e86533c0b27ed7cacc1239cb51c178fd239c3cfefefb0400a"}, - {file = "rpds_py-0.21.0-cp311-none-win_amd64.whl", hash = "sha256:e168afe6bf6ab7ab46c8c375606298784ecbe3ba31c0980b7dcbb9631dcba97e"}, - {file = "rpds_py-0.21.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:30b912c965b2aa76ba5168fd610087bad7fcde47f0a8367ee8f1876086ee6d1d"}, - {file = "rpds_py-0.21.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ca9989d5d9b1b300bc18e1801c67b9f6d2c66b8fd9621b36072ed1df2c977f72"}, - {file = "rpds_py-0.21.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f54e7106f0001244a5f4cf810ba8d3f9c542e2730821b16e969d6887b664266"}, - {file = "rpds_py-0.21.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fed5dfefdf384d6fe975cc026886aece4f292feaf69d0eeb716cfd3c5a4dd8be"}, - {file = "rpds_py-0.21.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:590ef88db231c9c1eece44dcfefd7515d8bf0d986d64d0caf06a81998a9e8cab"}, - {file = "rpds_py-0.21.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f983e4c2f603c95dde63df633eec42955508eefd8d0f0e6d236d31a044c882d7"}, - {file = "rpds_py-0.21.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b229ce052ddf1a01c67d68166c19cb004fb3612424921b81c46e7ea7ccf7c3bf"}, - {file = "rpds_py-0.21.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ebf64e281a06c904a7636781d2e973d1f0926a5b8b480ac658dc0f556e7779f4"}, - {file = "rpds_py-0.21.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:998a8080c4495e4f72132f3d66ff91f5997d799e86cec6ee05342f8f3cda7dca"}, - {file = "rpds_py-0.21.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:98486337f7b4f3c324ab402e83453e25bb844f44418c066623db88e4c56b7c7b"}, - {file = "rpds_py-0.21.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a78d8b634c9df7f8d175451cfeac3810a702ccb85f98ec95797fa98b942cea11"}, - {file = "rpds_py-0.21.0-cp312-none-win32.whl", hash = "sha256:a58ce66847711c4aa2ecfcfaff04cb0327f907fead8945ffc47d9407f41ff952"}, - {file = "rpds_py-0.21.0-cp312-none-win_amd64.whl", hash = "sha256:e860f065cc4ea6f256d6f411aba4b1251255366e48e972f8a347cf88077b24fd"}, - {file = "rpds_py-0.21.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:ee4eafd77cc98d355a0d02f263efc0d3ae3ce4a7c24740010a8b4012bbb24937"}, - {file = "rpds_py-0.21.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:688c93b77e468d72579351a84b95f976bd7b3e84aa6686be6497045ba84be560"}, - {file = "rpds_py-0.21.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c38dbf31c57032667dd5a2f0568ccde66e868e8f78d5a0d27dcc56d70f3fcd3b"}, - {file = "rpds_py-0.21.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2d6129137f43f7fa02d41542ffff4871d4aefa724a5fe38e2c31a4e0fd343fb0"}, - {file = "rpds_py-0.21.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:520ed8b99b0bf86a176271f6fe23024323862ac674b1ce5b02a72bfeff3fff44"}, - {file = "rpds_py-0.21.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aaeb25ccfb9b9014a10eaf70904ebf3f79faaa8e60e99e19eef9f478651b9b74"}, - {file = "rpds_py-0.21.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:af04ac89c738e0f0f1b913918024c3eab6e3ace989518ea838807177d38a2e94"}, - {file = "rpds_py-0.21.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b9b76e2afd585803c53c5b29e992ecd183f68285b62fe2668383a18e74abe7a3"}, - {file = "rpds_py-0.21.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5afb5efde74c54724e1a01118c6e5c15e54e642c42a1ba588ab1f03544ac8c7a"}, - {file = "rpds_py-0.21.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:52c041802a6efa625ea18027a0723676a778869481d16803481ef6cc02ea8cb3"}, - {file = "rpds_py-0.21.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ee1e4fc267b437bb89990b2f2abf6c25765b89b72dd4a11e21934df449e0c976"}, - {file = "rpds_py-0.21.0-cp313-none-win32.whl", hash = "sha256:0c025820b78817db6a76413fff6866790786c38f95ea3f3d3c93dbb73b632202"}, - {file = "rpds_py-0.21.0-cp313-none-win_amd64.whl", hash = "sha256:320c808df533695326610a1b6a0a6e98f033e49de55d7dc36a13c8a30cfa756e"}, - {file = "rpds_py-0.21.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:2c51d99c30091f72a3c5d126fad26236c3f75716b8b5e5cf8effb18889ced928"}, - {file = "rpds_py-0.21.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cbd7504a10b0955ea287114f003b7ad62330c9e65ba012c6223dba646f6ffd05"}, - {file = "rpds_py-0.21.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6dcc4949be728ede49e6244eabd04064336012b37f5c2200e8ec8eb2988b209c"}, - {file = "rpds_py-0.21.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f414da5c51bf350e4b7960644617c130140423882305f7574b6cf65a3081cecb"}, - {file = "rpds_py-0.21.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9afe42102b40007f588666bc7de82451e10c6788f6f70984629db193849dced1"}, - {file = "rpds_py-0.21.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3b929c2bb6e29ab31f12a1117c39f7e6d6450419ab7464a4ea9b0b417174f044"}, - {file = "rpds_py-0.21.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8404b3717da03cbf773a1d275d01fec84ea007754ed380f63dfc24fb76ce4592"}, - {file = "rpds_py-0.21.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e12bb09678f38b7597b8346983d2323a6482dcd59e423d9448108c1be37cac9d"}, - {file = "rpds_py-0.21.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:58a0e345be4b18e6b8501d3b0aa540dad90caeed814c515e5206bb2ec26736fd"}, - {file = "rpds_py-0.21.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:c3761f62fcfccf0864cc4665b6e7c3f0c626f0380b41b8bd1ce322103fa3ef87"}, - {file = "rpds_py-0.21.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c2b2f71c6ad6c2e4fc9ed9401080badd1469fa9889657ec3abea42a3d6b2e1ed"}, - {file = "rpds_py-0.21.0-cp39-none-win32.whl", hash = "sha256:b21747f79f360e790525e6f6438c7569ddbfb1b3197b9e65043f25c3c9b489d8"}, - {file = "rpds_py-0.21.0-cp39-none-win_amd64.whl", hash = "sha256:0626238a43152918f9e72ede9a3b6ccc9e299adc8ade0d67c5e142d564c9a83d"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:6b4ef7725386dc0762857097f6b7266a6cdd62bfd209664da6712cb26acef035"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:6bc0e697d4d79ab1aacbf20ee5f0df80359ecf55db33ff41481cf3e24f206919"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da52d62a96e61c1c444f3998c434e8b263c384f6d68aca8274d2e08d1906325c"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:98e4fe5db40db87ce1c65031463a760ec7906ab230ad2249b4572c2fc3ef1f9f"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:30bdc973f10d28e0337f71d202ff29345320f8bc49a31c90e6c257e1ccef4333"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:faa5e8496c530f9c71f2b4e1c49758b06e5f4055e17144906245c99fa6d45356"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32eb88c30b6a4f0605508023b7141d043a79b14acb3b969aa0b4f99b25bc7d4a"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a89a8ce9e4e75aeb7fa5d8ad0f3fecdee813802592f4f46a15754dcb2fd6b061"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:241e6c125568493f553c3d0fdbb38c74babf54b45cef86439d4cd97ff8feb34d"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:3b766a9f57663396e4f34f5140b3595b233a7b146e94777b97a8413a1da1be18"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:af4a644bf890f56e41e74be7d34e9511e4954894d544ec6b8efe1e21a1a8da6c"}, - {file = "rpds_py-0.21.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:3e30a69a706e8ea20444b98a49f386c17b26f860aa9245329bab0851ed100677"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:031819f906bb146561af051c7cef4ba2003d28cff07efacef59da973ff7969ba"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:b876f2bc27ab5954e2fd88890c071bd0ed18b9c50f6ec3de3c50a5ece612f7a6"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc5695c321e518d9f03b7ea6abb5ea3af4567766f9852ad1560f501b17588c7b"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b4de1da871b5c0fd5537b26a6fc6814c3cc05cabe0c941db6e9044ffbb12f04a"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:878f6fea96621fda5303a2867887686d7a198d9e0f8a40be100a63f5d60c88c9"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8eeec67590e94189f434c6d11c426892e396ae59e4801d17a93ac96b8c02a6c"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ff2eba7f6c0cb523d7e9cff0903f2fe1feff8f0b2ceb6bd71c0e20a4dcee271"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a429b99337062877d7875e4ff1a51fe788424d522bd64a8c0a20ef3021fdb6ed"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:d167e4dbbdac48bd58893c7e446684ad5d425b407f9336e04ab52e8b9194e2ed"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:4eb2de8a147ffe0626bfdc275fc6563aa7bf4b6db59cf0d44f0ccd6ca625a24e"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:e78868e98f34f34a88e23ee9ccaeeec460e4eaf6db16d51d7a9b883e5e785a5e"}, - {file = "rpds_py-0.21.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:4991ca61656e3160cdaca4851151fd3f4a92e9eba5c7a530ab030d6aee96ec89"}, - {file = "rpds_py-0.21.0.tar.gz", hash = "sha256:ed6378c9d66d0de903763e7706383d60c33829581f0adff47b6535f1802fa6db"}, + {file = "rpds_py-0.22.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:a4366f264fa60d3c109f0b27af0cd9eb8d46746bd70bd3d9d425f035b6c7e286"}, + {file = "rpds_py-0.22.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e34a3e665d38d0749072e6565400c8ce9abae976e338919a0dfbfb0e1ba43068"}, + {file = "rpds_py-0.22.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38cacf1f378571450576f2c8ce87da6f3fddc59d744de5c12b37acc23285b1e1"}, + {file = "rpds_py-0.22.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8cbb040fec8eddd5a6a75e737fd73c9ce37e51f94bacdd0b178d0174a4758395"}, + {file = "rpds_py-0.22.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d80fd710b3307a3c63809048b72c536689b9b0b31a2518339c3f1a4d29c73d7a"}, + {file = "rpds_py-0.22.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b5d17d8f5b885ce50e0cda85f99c0719e365e98b587338535fa566a48375afb"}, + {file = "rpds_py-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f7a048ec1ebc991331d709be4884dc318c9eaafa66dcde8be0933ac0e702149"}, + {file = "rpds_py-0.22.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:306da3dfa174b489a3fc63b0872e2226a5ddf94c59875a770d72aff945d5ed96"}, + {file = "rpds_py-0.22.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c7b4450093c0c909299770226fb0285be47b0a57545bae25b5c4e51566b0e587"}, + {file = "rpds_py-0.22.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0903ffdb5b9007e503203b6285e4ff0faf96d875c19f1d103b475acf7d9f7311"}, + {file = "rpds_py-0.22.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d1522025cda9e57329aade769f56e5793b2a5da7759a21914ee10e67e17e601e"}, + {file = "rpds_py-0.22.0-cp310-cp310-win32.whl", hash = "sha256:49e084d47a66027ac72844f9f52f13d347a9a1f05d4f84381b420e47f836a7fd"}, + {file = "rpds_py-0.22.0-cp310-cp310-win_amd64.whl", hash = "sha256:d9ceca96df54cb1675a0b7f52f1c6d5d1df62c5b40741ba211780f1b05a282a2"}, + {file = "rpds_py-0.22.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:771c9a3851beaa617d8c8115d65f834a2b52490f42ee2b88b13f1fc5529e9e0c"}, + {file = "rpds_py-0.22.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:341a07a4b55126bfae68c9bf24220a73d456111e5eb3dcbdab9fd16de2341224"}, + {file = "rpds_py-0.22.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f7649c8b8e4bd1ccc5fcbd51a855d57a617deeba19c66e3d04b1abecc61036b2"}, + {file = "rpds_py-0.22.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2f513758e7cda8bc262e80299a8e3395d7ef7f4ae705be62632f229bc6c33208"}, + {file = "rpds_py-0.22.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba1fc34d0b2f6fd53377a4c954116251eba6d076bf64f903311f4a7d27d10acd"}, + {file = "rpds_py-0.22.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:632d2fdddd9fbe3ac8896a119fd18a71fc95ca9c4cbe5223096c142d8c4a2b1d"}, + {file = "rpds_py-0.22.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:326e42f2b49462e05f8527a1311ce98f9f97c484b3e443ec0ea4638bed3aebcf"}, + {file = "rpds_py-0.22.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e9bbdba9e75b1a9ee1dd1335034dad998ef1acc08492226c6fd50aa773bdfa7d"}, + {file = "rpds_py-0.22.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:41f65a97bf2c4b161c9f8f89bc37058346bec9b36e373c8ad00a16c957bff625"}, + {file = "rpds_py-0.22.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:0686f2c16eafdc2c6b4ce6e86e5b3092e87db09ae64be2787616444eb35b9756"}, + {file = "rpds_py-0.22.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4e7c9aa2353eb0b0d845323857197daa036c2ff8624df990b0d886d22a8f665e"}, + {file = "rpds_py-0.22.0-cp311-cp311-win32.whl", hash = "sha256:2d2fc3ab021be3e0b5aec6d4164f2689d231b8bfc5185cc454314746aa4aee72"}, + {file = "rpds_py-0.22.0-cp311-cp311-win_amd64.whl", hash = "sha256:87453d491369cd8018016d2714a13e8461975161703c18ee31eecf087a8ae5d4"}, + {file = "rpds_py-0.22.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:e9d4293b21c69ee4f9e1a99ac4f772951d345611c614a0cfae2ec6b565279bc9"}, + {file = "rpds_py-0.22.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:67e013a17a3db4d98cc228fd5aeb36a51b0f5cf7330b9102a552060f1fe4e560"}, + {file = "rpds_py-0.22.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b639a19e1791b646d27f15d17530a51722cc728d43b2dff3aeb904f92d91bac"}, + {file = "rpds_py-0.22.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1357c3092702078b7782b6ebd5ba9b22c1a291c34fbf9d8f1a48237466ac7758"}, + {file = "rpds_py-0.22.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:842855bbb113a19c393c6de5aa6ed9a26c6b13c2fead5e49114d39f0d08b94d8"}, + {file = "rpds_py-0.22.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ae7927cd2b869ca4dc645169d8af5494a29c99afd0ea0f24dd00c811ab1d8b8"}, + {file = "rpds_py-0.22.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91bfef5daa2a5a4fe62f8d317fc91a626073639f951f851bd2cb252d01bc6c5"}, + {file = "rpds_py-0.22.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4fc4824e38c1e91a73bc820e7caacaf19d0acd557465aceef0420ca59489b390"}, + {file = "rpds_py-0.22.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:92d28a608127b357da47c99e0d0e0655ca2060286540fe9f2a25a2e8ac666e05"}, + {file = "rpds_py-0.22.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c637188b930175c256f13adbfc427b83ec7e64476d1ec9d6608f312bb84e06c3"}, + {file = "rpds_py-0.22.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:93bbd66f46dddc41e8c656130c97c0fb515e0fa44e1eebb2592769dbbd41b2f5"}, + {file = "rpds_py-0.22.0-cp312-cp312-win32.whl", hash = "sha256:54d8f94dec5765a9edc19610fecf0fdf9cab36cbb9def1213188215f735a6f98"}, + {file = "rpds_py-0.22.0-cp312-cp312-win_amd64.whl", hash = "sha256:931bf3d0705b2834fed29354f35170fa022fe22a95542b61b7c66aca5f8a224f"}, + {file = "rpds_py-0.22.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:2a57300cc8b034c5707085249efd09f19116bb80278d0ec925d7f3710165c510"}, + {file = "rpds_py-0.22.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c398a5a8e258dfdc5ea2aa4e5aa2ca3207f654a8eb268693dd1a76939074a588"}, + {file = "rpds_py-0.22.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a6cc4eb1e86364331928acafb2bb41d8ab735ca3caf2d6019b9f6dac3f4f65d"}, + {file = "rpds_py-0.22.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:574c5c94213bc9990805bfd7e4ba3826d3c098516cbc19f0d0ef0433ad93fa06"}, + {file = "rpds_py-0.22.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c0321bc03a1c513eca1837e3bba948b975bcf3a172aebc197ab3573207f137a"}, + {file = "rpds_py-0.22.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d276280649305c1da6cdd84585d48ae1f0efa67434d8b10d2df95228e59a05bb"}, + {file = "rpds_py-0.22.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c17b43fe9c6da16885e3fe28922bcd1a029e61631fb771c7d501019b40bcc904"}, + {file = "rpds_py-0.22.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:48c95997af9314f4034fe5ba2d837399e786586e220835a578d28fe8161e6ae5"}, + {file = "rpds_py-0.22.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e9aa4af6b879bb75a3c7766fbf49d77f4097dd12b548ecbbd8b3f85caa833281"}, + {file = "rpds_py-0.22.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:8426f97117b914b9bfb2a7bd46edc148e8defda728a55a5df3a564abe70cd7a4"}, + {file = "rpds_py-0.22.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:034964ea0ea09645bdde13038b38abb14be0aa747f20fcfab6181207dd9e0483"}, + {file = "rpds_py-0.22.0-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:3dc7c64b56b82428894f056e9ff6e8ee917ff74fc26b65211a33602c2372e928"}, + {file = "rpds_py-0.22.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:1212cb231f2002934cd8d71a0d718fdd9d9a2dd671e0feef8501038df3508026"}, + {file = "rpds_py-0.22.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f21e1278c9456cd601832375c778ca44614d3433996488221a56572c223f04a"}, + {file = "rpds_py-0.22.0-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:875fe8dffb43c20f68379ee098b035a7038d7903c795d46715f66575a7050b19"}, + {file = "rpds_py-0.22.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e23dcdd4b2ff9c6b3317ea7921b210d39592f8ca1cdea58ada25b202c65c0a69"}, + {file = "rpds_py-0.22.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f0fb8efc9e579acf1e556fd86277fecec320c21ca9b5d39db96433ad8c45bc4a"}, + {file = "rpds_py-0.22.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe23687924b25a2dee52fab15976fd6577ed8518072bcda9ff2e2b88ab1f168b"}, + {file = "rpds_py-0.22.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d5469b347445d1c31105f33e7bfc9a8ba213d48e42641a610dda65bf9e3c83f5"}, + {file = "rpds_py-0.22.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:a810a57ce5e8ecf8eac6ec4dab534ff80c34e5a2c31db60e992009cd20f58e0f"}, + {file = "rpds_py-0.22.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:d9bb9242b38a664f307b3b897f093896f7ed51ef4fe25a0502e5a368de9151ea"}, + {file = "rpds_py-0.22.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:b4660943030406aaa40ec9f51960dd88049903d9536bc3c8ebb5cc4e1f119bbe"}, + {file = "rpds_py-0.22.0-cp313-cp313t-win32.whl", hash = "sha256:208ce1d8e3af138d1d9b21d7206356b7f29b96675e0113aea652cf024e4ddfdc"}, + {file = "rpds_py-0.22.0-cp313-cp313t-win_amd64.whl", hash = "sha256:e6da2e0500742e0f157f005924a0589f2e2dcbfdd6cd0cc0abce367433e989be"}, + {file = "rpds_py-0.22.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:f980a0640599a74f27fd9d50c84c293f1cb7afc2046c5c6d3efaf8ec7cdbc326"}, + {file = "rpds_py-0.22.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ca505fd3767a09a139737f3278bc8a485cb64043062da89bcba27e2f2ea78d33"}, + {file = "rpds_py-0.22.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba235e00e0878ba1080b0f2a761f143b2a2d1c354f3d8e507fbf2f3de401bf18"}, + {file = "rpds_py-0.22.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:81e7a27365b02fe70a77f1365376879917235b3fec551d19b4c91b51d0bc1d07"}, + {file = "rpds_py-0.22.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:32a0e24cab2daae0503b06666d516e90a080c1a95aff0406b9f03c6489177c4b"}, + {file = "rpds_py-0.22.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a73ed43d64209e853bba567a543170267a5cd64f359540b0ca2d597e329ba172"}, + {file = "rpds_py-0.22.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e0abcce5e874474d3eab5ad53be03dae2abe651d248bdeaabe83708e82969e78"}, + {file = "rpds_py-0.22.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f4e9946c8c7def17e4fcb5eddb14c4eb6ebc7f6f309075e6c8d23b133c104607"}, + {file = "rpds_py-0.22.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:758098b38c344d9a7f279baf0689261777e601f620078ef5afdc9bd3339965c3"}, + {file = "rpds_py-0.22.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:9ad4640a409bc2b7d22b7921e7660f0db96c5c8c69fbb2e8f3261d4f71d33983"}, + {file = "rpds_py-0.22.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8c48fc7458fe3a74dcdf56ba3534ff41bd421f69436df09ff3497fdaac18b431"}, + {file = "rpds_py-0.22.0-cp39-cp39-win32.whl", hash = "sha256:fde778947304e55fc732bc8ea5c6063e74244ac1808471cb498983a210aaf62c"}, + {file = "rpds_py-0.22.0-cp39-cp39-win_amd64.whl", hash = "sha256:5fdf91a7c07f40e47b193f2acae0ed9da35d09325d7c3c3279f722b7cbf3d264"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c8fd7a16f7a047e06c747cfcf2acef3ac316132df1c6077445b29ee6f3f3a70b"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:6b6e4bcfc32f831bfe3d6d8a5acedfbfd5e252a03c83fa24813b277a3a8a13ca"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eadd2417e83a77ce3ae4a0efd08cb0ebdfd317b6406d11020354a53ad458ec84"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f9dc2113e0cf0dd637751ca736186fca63664939ceb9f9f67e93ade88c69c0c9"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc2c00acdf68f1f69a476b770af311a7dc3955b7de228b04a40bcc51ac4d743b"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dfdabdf8519c93908b2bf0f87c3f86f9e88bab279fb4acfd0907519ca5a1739f"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8338db3c76833d02dc21c3e2c42534091341d26e4f7ba32c6032bb558a02e07b"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8ad4dfda52e64af3202ceb2143a62deba97894b71c64a4405ee80f6b3ea77285"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:3b94b074dcce39976db22ea75c7aea8b22d95e6d3b62f76e20e1179a278521d8"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:d4f2af3107fe4dc40c0d1a2409863f5249c6796398a1d83c1d99a0b3fa6cfb8d"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:bb11809b0de643a292a82f728c494a2bbef0e30a7c42d37464abbd6bef7ca7b1"}, + {file = "rpds_py-0.22.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:c1c21030ed494deb10226f90e2dbd84a012d59810c409832714a3dd576527be2"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:64a0c965a1e299c9b280006bdb15c276c427c45360aed676305dc36bcaa4d13c"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:2498ff422823be087b48bc82710deb87ac34f6b7c8034ee39920647647de1e60"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59e63da174ff287db05ef7c21d75974a5bac727ed60452aeb3a14278477842a8"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e1c04fb380bc8efaae2fdf17ed6cd5d223da78a8b0b18a610f53d4c5d6e31dfd"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e04919ffa9a728c446b27b6b625fa1d00ece221bdb9d633e978a7e0353a12c0e"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:24c28df05bd284879d0fac850ba697077d2a33b7ebcaea6318d6b6cdfdc86ddc"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d33622dc63c295788eed09dbb1d11bed178909d3267b02d873116ee6be368244"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7539dbb8f705e13629ba6f23388976aad809e387f32a6e5c0712e4e8d9bfcce7"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:b8906f537978da3f7f0bd1ba37b69f6a877bb43312023b086582707d2835bf2f"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:62ab12fe03ffc49978d29de9c31bbb216610157f7e5ca8e172fed6642aead3be"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:762206ba3bf1d6c8c9e0055871d3c0d5b074b7c3120193e6c067e7866f106ab1"}, + {file = "rpds_py-0.22.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:ed0102146574e5e9f079b2e1a06e6b5b12a691f9c74a65b93b7f3d4feda566c6"}, + {file = "rpds_py-0.22.0.tar.gz", hash = "sha256:32de71c393f126d8203e9815557c7ff4d72ed1ad3aa3f52f6c7938413176750a"}, ] [[package]] @@ -4707,15 +4703,36 @@ files = [ [[package]] name = "ua-parser" -version = "0.18.0" +version = "1.0.0" description = "Python port of Browserscope's user agent parser" optional = false -python-versions = "*" +python-versions = ">=3.9" +files = [ + {file = "ua_parser-1.0.0-py3-none-any.whl", hash = "sha256:5b31133606a781f56692caa11a9671a9f330c22604b3c4957a7ba18c152212d0"}, + {file = "ua_parser-1.0.0.tar.gz", hash = "sha256:a9740f53f4fbb72b7a03d304cae32a2785cafc55e8207efb74877bba17c35324"}, +] + +[package.dependencies] +ua-parser-builtins = "*" + +[package.extras] +re2 = ["google-re2"] +regex = ["ua-parser-rs"] +yaml = ["PyYaml"] + +[[package]] +name = "ua-parser-builtins" +version = "0.18.0" +description = "Precompiled rules for User Agent Parser" +optional = false +python-versions = ">=3.9" files = [ - {file = "ua-parser-0.18.0.tar.gz", hash = "sha256:db51f1b59bfaa82ed9e2a1d99a54d3e4153dddf99ac1435d51828165422e624e"}, - {file = "ua_parser-0.18.0-py2.py3-none-any.whl", hash = "sha256:9d94ac3a80bcb0166823956a779186c746b50ea4c9fd9bf30fdb758553c38950"}, + {file = "ua_parser_builtins-0.18.0-py3-none-any.whl", hash = "sha256:51cbc3d6ab9c533fc12fc7cededbef503c8d04e465d0aff20d869e15320b5ca9"}, ] +[package.dependencies] +ua-parser = "*" + [[package]] name = "universal-pathlib" version = "0.2.5" @@ -5165,93 +5182,93 @@ pylibjpeg-rle = ["pylibjpeg-rle (>=1.3.0,<2.0.0)"] [[package]] name = "yarl" -version = "1.18.0" +version = "1.18.3" description = "Yet another URL library" optional = false python-versions = ">=3.9" files = [ - {file = "yarl-1.18.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:074fee89caab89a97e18ef5f29060ef61ba3cae6cd77673acc54bfdd3214b7b7"}, - {file = "yarl-1.18.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b026cf2c32daf48d90c0c4e406815c3f8f4cfe0c6dfccb094a9add1ff6a0e41a"}, - {file = "yarl-1.18.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ae38bd86eae3ba3d2ce5636cc9e23c80c9db2e9cb557e40b98153ed102b5a736"}, - {file = "yarl-1.18.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:685cc37f3f307c6a8e879986c6d85328f4c637f002e219f50e2ef66f7e062c1d"}, - {file = "yarl-1.18.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8254dbfce84ee5d1e81051ee7a0f1536c108ba294c0fdb5933476398df0654f3"}, - {file = "yarl-1.18.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:20de4a8b04de70c49698dc2390b7fd2d18d424d3b876371f9b775e2b462d4b41"}, - {file = "yarl-1.18.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0a2074a37285570d54b55820687de3d2f2b9ecf1b714e482e48c9e7c0402038"}, - {file = "yarl-1.18.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f576ed278860df2721a5d57da3381040176ef1d07def9688a385c8330db61a1"}, - {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:3a3709450a574d61be6ac53d582496014342ea34876af8dc17cc16da32826c9a"}, - {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:bd80ed29761490c622edde5dd70537ca8c992c2952eb62ed46984f8eff66d6e8"}, - {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:32141e13a1d5a48525e519c9197d3f4d9744d818d5c7d6547524cc9eccc8971e"}, - {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8b8d3e4e014fb4274f1c5bf61511d2199e263909fb0b8bda2a7428b0894e8dc6"}, - {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:701bb4a8f4de191c8c0cc9a1e6d5142f4df880e9d1210e333b829ca9425570ed"}, - {file = "yarl-1.18.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:a45d94075ac0647621eaaf693c8751813a3eccac455d423f473ffed38c8ac5c9"}, - {file = "yarl-1.18.0-cp310-cp310-win32.whl", hash = "sha256:34176bfb082add67cb2a20abd85854165540891147f88b687a5ed0dc225750a0"}, - {file = "yarl-1.18.0-cp310-cp310-win_amd64.whl", hash = "sha256:73553bbeea7d6ec88c08ad8027f4e992798f0abc459361bf06641c71972794dc"}, - {file = "yarl-1.18.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b8e8c516dc4e1a51d86ac975b0350735007e554c962281c432eaa5822aa9765c"}, - {file = "yarl-1.18.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2e6b4466714a73f5251d84b471475850954f1fa6acce4d3f404da1d55d644c34"}, - {file = "yarl-1.18.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c893f8c1a6d48b25961e00922724732d00b39de8bb0b451307482dc87bddcd74"}, - {file = "yarl-1.18.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:13aaf2bdbc8c86ddce48626b15f4987f22e80d898818d735b20bd58f17292ee8"}, - {file = "yarl-1.18.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dd21c0128e301851de51bc607b0a6da50e82dc34e9601f4b508d08cc89ee7929"}, - {file = "yarl-1.18.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:205de377bd23365cd85562c9c6c33844050a93661640fda38e0567d2826b50df"}, - {file = "yarl-1.18.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed69af4fe2a0949b1ea1d012bf065c77b4c7822bad4737f17807af2adb15a73c"}, - {file = "yarl-1.18.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8e1c18890091aa3cc8a77967943476b729dc2016f4cfe11e45d89b12519d4a93"}, - {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:91b8fb9427e33f83ca2ba9501221ffaac1ecf0407f758c4d2f283c523da185ee"}, - {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:536a7a8a53b75b2e98ff96edb2dfb91a26b81c4fed82782035767db5a465be46"}, - {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:a64619a9c47c25582190af38e9eb382279ad42e1f06034f14d794670796016c0"}, - {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c73a6bbc97ba1b5a0c3c992ae93d721c395bdbb120492759b94cc1ac71bc6350"}, - {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:a173401d7821a2a81c7b47d4e7d5c4021375a1441af0c58611c1957445055056"}, - {file = "yarl-1.18.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7520e799b1f84e095cce919bd6c23c9d49472deeef25fe1ef960b04cca51c3fc"}, - {file = "yarl-1.18.0-cp311-cp311-win32.whl", hash = "sha256:c4cb992d8090d5ae5f7afa6754d7211c578be0c45f54d3d94f7781c495d56716"}, - {file = "yarl-1.18.0-cp311-cp311-win_amd64.whl", hash = "sha256:52c136f348605974c9b1c878addd6b7a60e3bf2245833e370862009b86fa4689"}, - {file = "yarl-1.18.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1ece25e2251c28bab737bdf0519c88189b3dd9492dc086a1d77336d940c28ced"}, - {file = "yarl-1.18.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:454902dc1830d935c90b5b53c863ba2a98dcde0fbaa31ca2ed1ad33b2a7171c6"}, - {file = "yarl-1.18.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:01be8688fc211dc237e628fcc209dda412d35de7642453059a0553747018d075"}, - {file = "yarl-1.18.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4d26f1fa9fa2167bb238f6f4b20218eb4e88dd3ef21bb8f97439fa6b5313e30d"}, - {file = "yarl-1.18.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b234a4a9248a9f000b7a5dfe84b8cb6210ee5120ae70eb72a4dcbdb4c528f72f"}, - {file = "yarl-1.18.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fe94d1de77c4cd8caff1bd5480e22342dbd54c93929f5943495d9c1e8abe9f42"}, - {file = "yarl-1.18.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b4c90c5363c6b0a54188122b61edb919c2cd1119684999d08cd5e538813a28e"}, - {file = "yarl-1.18.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:49a98ecadc5a241c9ba06de08127ee4796e1009555efd791bac514207862b43d"}, - {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9106025c7f261f9f5144f9aa7681d43867eed06349a7cfb297a1bc804de2f0d1"}, - {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:f275ede6199d0f1ed4ea5d55a7b7573ccd40d97aee7808559e1298fe6efc8dbd"}, - {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:f7edeb1dcc7f50a2c8e08b9dc13a413903b7817e72273f00878cb70e766bdb3b"}, - {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c083f6dd6951b86e484ebfc9c3524b49bcaa9c420cb4b2a78ef9f7a512bfcc85"}, - {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:80741ec5b471fbdfb997821b2842c59660a1c930ceb42f8a84ba8ca0f25a66aa"}, - {file = "yarl-1.18.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b1a3297b9cad594e1ff0c040d2881d7d3a74124a3c73e00c3c71526a1234a9f7"}, - {file = "yarl-1.18.0-cp312-cp312-win32.whl", hash = "sha256:cd6ab7d6776c186f544f893b45ee0c883542b35e8a493db74665d2e594d3ca75"}, - {file = "yarl-1.18.0-cp312-cp312-win_amd64.whl", hash = "sha256:039c299a0864d1f43c3e31570045635034ea7021db41bf4842693a72aca8df3a"}, - {file = "yarl-1.18.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6fb64dd45453225f57d82c4764818d7a205ee31ce193e9f0086e493916bd4f72"}, - {file = "yarl-1.18.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:3adaaf9c6b1b4fc258584f4443f24d775a2086aee82d1387e48a8b4f3d6aecf6"}, - {file = "yarl-1.18.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:da206d1ec78438a563c5429ab808a2b23ad7bc025c8adbf08540dde202be37d5"}, - {file = "yarl-1.18.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:576d258b21c1db4c6449b1c572c75d03f16a482eb380be8003682bdbe7db2f28"}, - {file = "yarl-1.18.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c60e547c0a375c4bfcdd60eef82e7e0e8698bf84c239d715f5c1278a73050393"}, - {file = "yarl-1.18.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e3818eabaefb90adeb5e0f62f047310079d426387991106d4fbf3519eec7d90a"}, - {file = "yarl-1.18.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a5f72421246c21af6a92fbc8c13b6d4c5427dfd949049b937c3b731f2f9076bd"}, - {file = "yarl-1.18.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7fa7d37f2ada0f42e0723632993ed422f2a679af0e200874d9d861720a54f53e"}, - {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:42ba84e2ac26a3f252715f8ec17e6fdc0cbf95b9617c5367579fafcd7fba50eb"}, - {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:6a49ad0102c0f0ba839628d0bf45973c86ce7b590cdedf7540d5b1833ddc6f00"}, - {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:96404e8d5e1bbe36bdaa84ef89dc36f0e75939e060ca5cd45451aba01db02902"}, - {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:a0509475d714df8f6d498935b3f307cd122c4ca76f7d426c7e1bb791bcd87eda"}, - {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:1ff116f0285b5c8b3b9a2680aeca29a858b3b9e0402fc79fd850b32c2bcb9f8b"}, - {file = "yarl-1.18.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e2580c1d7e66e6d29d6e11855e3b1c6381971e0edd9a5066e6c14d79bc8967af"}, - {file = "yarl-1.18.0-cp313-cp313-win32.whl", hash = "sha256:14408cc4d34e202caba7b5ac9cc84700e3421a9e2d1b157d744d101b061a4a88"}, - {file = "yarl-1.18.0-cp313-cp313-win_amd64.whl", hash = "sha256:1db1537e9cb846eb0ff206eac667f627794be8b71368c1ab3207ec7b6f8c5afc"}, - {file = "yarl-1.18.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:fa2c9cb607e0f660d48c54a63de7a9b36fef62f6b8bd50ff592ce1137e73ac7d"}, - {file = "yarl-1.18.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c0f4808644baf0a434a3442df5e0bedf8d05208f0719cedcd499e168b23bfdc4"}, - {file = "yarl-1.18.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7db9584235895a1dffca17e1c634b13870852094f6389b68dcc6338086aa7b08"}, - {file = "yarl-1.18.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:309f8d27d6f93ceeeb80aa6980e883aa57895270f7f41842b92247e65d7aeddf"}, - {file = "yarl-1.18.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:609ffd44fed2ed88d9b4ef62ee860cf86446cf066333ad4ce4123505b819e581"}, - {file = "yarl-1.18.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f172b8b2c72a13a06ea49225a9c47079549036ad1b34afa12d5491b881f5b993"}, - {file = "yarl-1.18.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d89ae7de94631b60d468412c18290d358a9d805182373d804ec839978b120422"}, - {file = "yarl-1.18.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:466d31fd043ef9af822ee3f1df8fdff4e8c199a7f4012c2642006af240eade17"}, - {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7609b8462351c4836b3edce4201acb6dd46187b207c589b30a87ffd1813b48dc"}, - {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:d9d4f5e471e8dc49b593a80766c2328257e405f943c56a3dc985c125732bc4cf"}, - {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:67b336c15e564d76869c9a21316f90edf546809a5796a083b8f57c845056bc01"}, - {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:b212452b80cae26cb767aa045b051740e464c5129b7bd739c58fbb7deb339e7b"}, - {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:38b39b7b3e692b6c92b986b00137a3891eddb66311b229d1940dcbd4f025083c"}, - {file = "yarl-1.18.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a7ee6884a8848792d58b854946b685521f41d8871afa65e0d4a774954e9c9e89"}, - {file = "yarl-1.18.0-cp39-cp39-win32.whl", hash = "sha256:b4095c5019bb889aa866bf12ed4c85c0daea5aafcb7c20d1519f02a1e738f07f"}, - {file = "yarl-1.18.0-cp39-cp39-win_amd64.whl", hash = "sha256:2d90f2e4d16a5b0915ee065218b435d2ef619dd228973b1b47d262a6f7cd8fa5"}, - {file = "yarl-1.18.0-py3-none-any.whl", hash = "sha256:dbf53db46f7cf176ee01d8d98c39381440776fcda13779d269a8ba664f69bec0"}, - {file = "yarl-1.18.0.tar.gz", hash = "sha256:20d95535e7d833889982bfe7cc321b7f63bf8879788fee982c76ae2b24cfb715"}, + {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7df647e8edd71f000a5208fe6ff8c382a1de8edfbccdbbfe649d263de07d8c34"}, + {file = "yarl-1.18.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c69697d3adff5aa4f874b19c0e4ed65180ceed6318ec856ebc423aa5850d84f7"}, + {file = "yarl-1.18.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:602d98f2c2d929f8e697ed274fbadc09902c4025c5a9963bf4e9edfc3ab6f7ed"}, + {file = "yarl-1.18.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c654d5207c78e0bd6d749f6dae1dcbbfde3403ad3a4b11f3c5544d9906969dde"}, + {file = "yarl-1.18.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5094d9206c64181d0f6e76ebd8fb2f8fe274950a63890ee9e0ebfd58bf9d787b"}, + {file = "yarl-1.18.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35098b24e0327fc4ebdc8ffe336cee0a87a700c24ffed13161af80124b7dc8e5"}, + {file = "yarl-1.18.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3236da9272872443f81fedc389bace88408f64f89f75d1bdb2256069a8730ccc"}, + {file = "yarl-1.18.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e2c08cc9b16f4f4bc522771d96734c7901e7ebef70c6c5c35dd0f10845270bcd"}, + {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:80316a8bd5109320d38eef8833ccf5f89608c9107d02d2a7f985f98ed6876990"}, + {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:c1e1cc06da1491e6734f0ea1e6294ce00792193c463350626571c287c9a704db"}, + {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:fea09ca13323376a2fdfb353a5fa2e59f90cd18d7ca4eaa1fd31f0a8b4f91e62"}, + {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:e3b9fd71836999aad54084906f8663dffcd2a7fb5cdafd6c37713b2e72be1760"}, + {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:757e81cae69244257d125ff31663249b3013b5dc0a8520d73694aed497fb195b"}, + {file = "yarl-1.18.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b1771de9944d875f1b98a745bc547e684b863abf8f8287da8466cf470ef52690"}, + {file = "yarl-1.18.3-cp310-cp310-win32.whl", hash = "sha256:8874027a53e3aea659a6d62751800cf6e63314c160fd607489ba5c2edd753cf6"}, + {file = "yarl-1.18.3-cp310-cp310-win_amd64.whl", hash = "sha256:93b2e109287f93db79210f86deb6b9bbb81ac32fc97236b16f7433db7fc437d8"}, + {file = "yarl-1.18.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8503ad47387b8ebd39cbbbdf0bf113e17330ffd339ba1144074da24c545f0069"}, + {file = "yarl-1.18.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:02ddb6756f8f4517a2d5e99d8b2f272488e18dd0bfbc802f31c16c6c20f22193"}, + {file = "yarl-1.18.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:67a283dd2882ac98cc6318384f565bffc751ab564605959df4752d42483ad889"}, + {file = "yarl-1.18.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d980e0325b6eddc81331d3f4551e2a333999fb176fd153e075c6d1c2530aa8a8"}, + {file = "yarl-1.18.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b643562c12680b01e17239be267bc306bbc6aac1f34f6444d1bded0c5ce438ca"}, + {file = "yarl-1.18.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c017a3b6df3a1bd45b9fa49a0f54005e53fbcad16633870104b66fa1a30a29d8"}, + {file = "yarl-1.18.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75674776d96d7b851b6498f17824ba17849d790a44d282929c42dbb77d4f17ae"}, + {file = "yarl-1.18.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ccaa3a4b521b780a7e771cc336a2dba389a0861592bbce09a476190bb0c8b4b3"}, + {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2d06d3005e668744e11ed80812e61efd77d70bb7f03e33c1598c301eea20efbb"}, + {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:9d41beda9dc97ca9ab0b9888cb71f7539124bc05df02c0cff6e5acc5a19dcc6e"}, + {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ba23302c0c61a9999784e73809427c9dbedd79f66a13d84ad1b1943802eaaf59"}, + {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:6748dbf9bfa5ba1afcc7556b71cda0d7ce5f24768043a02a58846e4a443d808d"}, + {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:0b0cad37311123211dc91eadcb322ef4d4a66008d3e1bdc404808992260e1a0e"}, + {file = "yarl-1.18.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0fb2171a4486bb075316ee754c6d8382ea6eb8b399d4ec62fde2b591f879778a"}, + {file = "yarl-1.18.3-cp311-cp311-win32.whl", hash = "sha256:61b1a825a13bef4a5f10b1885245377d3cd0bf87cba068e1d9a88c2ae36880e1"}, + {file = "yarl-1.18.3-cp311-cp311-win_amd64.whl", hash = "sha256:b9d60031cf568c627d028239693fd718025719c02c9f55df0a53e587aab951b5"}, + {file = "yarl-1.18.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1dd4bdd05407ced96fed3d7f25dbbf88d2ffb045a0db60dbc247f5b3c5c25d50"}, + {file = "yarl-1.18.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7c33dd1931a95e5d9a772d0ac5e44cac8957eaf58e3c8da8c1414de7dd27c576"}, + {file = "yarl-1.18.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:25b411eddcfd56a2f0cd6a384e9f4f7aa3efee14b188de13048c25b5e91f1640"}, + {file = "yarl-1.18.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:436c4fc0a4d66b2badc6c5fc5ef4e47bb10e4fd9bf0c79524ac719a01f3607c2"}, + {file = "yarl-1.18.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e35ef8683211db69ffe129a25d5634319a677570ab6b2eba4afa860f54eeaf75"}, + {file = "yarl-1.18.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:84b2deecba4a3f1a398df819151eb72d29bfeb3b69abb145a00ddc8d30094512"}, + {file = "yarl-1.18.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00e5a1fea0fd4f5bfa7440a47eff01d9822a65b4488f7cff83155a0f31a2ecba"}, + {file = "yarl-1.18.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d0e883008013c0e4aef84dcfe2a0b172c4d23c2669412cf5b3371003941f72bb"}, + {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5a3f356548e34a70b0172d8890006c37be92995f62d95a07b4a42e90fba54272"}, + {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:ccd17349166b1bee6e529b4add61727d3f55edb7babbe4069b5764c9587a8cc6"}, + {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b958ddd075ddba5b09bb0be8a6d9906d2ce933aee81100db289badbeb966f54e"}, + {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c7d79f7d9aabd6011004e33b22bc13056a3e3fb54794d138af57f5ee9d9032cb"}, + {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:4891ed92157e5430874dad17b15eb1fda57627710756c27422200c52d8a4e393"}, + {file = "yarl-1.18.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ce1af883b94304f493698b00d0f006d56aea98aeb49d75ec7d98cd4a777e9285"}, + {file = "yarl-1.18.3-cp312-cp312-win32.whl", hash = "sha256:f91c4803173928a25e1a55b943c81f55b8872f0018be83e3ad4938adffb77dd2"}, + {file = "yarl-1.18.3-cp312-cp312-win_amd64.whl", hash = "sha256:7e2ee16578af3b52ac2f334c3b1f92262f47e02cc6193c598502bd46f5cd1477"}, + {file = "yarl-1.18.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:90adb47ad432332d4f0bc28f83a5963f426ce9a1a8809f5e584e704b82685dcb"}, + {file = "yarl-1.18.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:913829534200eb0f789d45349e55203a091f45c37a2674678744ae52fae23efa"}, + {file = "yarl-1.18.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ef9f7768395923c3039055c14334ba4d926f3baf7b776c923c93d80195624782"}, + {file = "yarl-1.18.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88a19f62ff30117e706ebc9090b8ecc79aeb77d0b1f5ec10d2d27a12bc9f66d0"}, + {file = "yarl-1.18.3-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e17c9361d46a4d5addf777c6dd5eab0715a7684c2f11b88c67ac37edfba6c482"}, + {file = "yarl-1.18.3-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a74a13a4c857a84a845505fd2d68e54826a2cd01935a96efb1e9d86c728e186"}, + {file = "yarl-1.18.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:41f7ce59d6ee7741af71d82020346af364949314ed3d87553763a2df1829cc58"}, + {file = "yarl-1.18.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f52a265001d830bc425f82ca9eabda94a64a4d753b07d623a9f2863fde532b53"}, + {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:82123d0c954dc58db301f5021a01854a85bf1f3bb7d12ae0c01afc414a882ca2"}, + {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:2ec9bbba33b2d00999af4631a3397d1fd78290c48e2a3e52d8dd72db3a067ac8"}, + {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:fbd6748e8ab9b41171bb95c6142faf068f5ef1511935a0aa07025438dd9a9bc1"}, + {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:877d209b6aebeb5b16c42cbb377f5f94d9e556626b1bfff66d7b0d115be88d0a"}, + {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b464c4ab4bfcb41e3bfd3f1c26600d038376c2de3297760dfe064d2cb7ea8e10"}, + {file = "yarl-1.18.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8d39d351e7faf01483cc7ff7c0213c412e38e5a340238826be7e0e4da450fdc8"}, + {file = "yarl-1.18.3-cp313-cp313-win32.whl", hash = "sha256:61ee62ead9b68b9123ec24bc866cbef297dd266175d53296e2db5e7f797f902d"}, + {file = "yarl-1.18.3-cp313-cp313-win_amd64.whl", hash = "sha256:578e281c393af575879990861823ef19d66e2b1d0098414855dd367e234f5b3c"}, + {file = "yarl-1.18.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:61e5e68cb65ac8f547f6b5ef933f510134a6bf31bb178be428994b0cb46c2a04"}, + {file = "yarl-1.18.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fe57328fbc1bfd0bd0514470ac692630f3901c0ee39052ae47acd1d90a436719"}, + {file = "yarl-1.18.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a440a2a624683108a1b454705ecd7afc1c3438a08e890a1513d468671d90a04e"}, + {file = "yarl-1.18.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09c7907c8548bcd6ab860e5f513e727c53b4a714f459b084f6580b49fa1b9cee"}, + {file = "yarl-1.18.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b4f6450109834af88cb4cc5ecddfc5380ebb9c228695afc11915a0bf82116789"}, + {file = "yarl-1.18.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9ca04806f3be0ac6d558fffc2fdf8fcef767e0489d2684a21912cc4ed0cd1b8"}, + {file = "yarl-1.18.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:77a6e85b90a7641d2e07184df5557132a337f136250caafc9ccaa4a2a998ca2c"}, + {file = "yarl-1.18.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6333c5a377c8e2f5fae35e7b8f145c617b02c939d04110c76f29ee3676b5f9a5"}, + {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0b3c92fa08759dbf12b3a59579a4096ba9af8dd344d9a813fc7f5070d86bbab1"}, + {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:4ac515b860c36becb81bb84b667466885096b5fc85596948548b667da3bf9f24"}, + {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:045b8482ce9483ada4f3f23b3774f4e1bf4f23a2d5c912ed5170f68efb053318"}, + {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:a4bb030cf46a434ec0225bddbebd4b89e6471814ca851abb8696170adb163985"}, + {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:54d6921f07555713b9300bee9c50fb46e57e2e639027089b1d795ecd9f7fa910"}, + {file = "yarl-1.18.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1d407181cfa6e70077df3377938c08012d18893f9f20e92f7d2f314a437c30b1"}, + {file = "yarl-1.18.3-cp39-cp39-win32.whl", hash = "sha256:ac36703a585e0929b032fbaab0707b75dc12703766d0b53486eabd5139ebadd5"}, + {file = "yarl-1.18.3-cp39-cp39-win_amd64.whl", hash = "sha256:ba87babd629f8af77f557b61e49e7c7cac36f22f871156b91e10a6e9d4f829e9"}, + {file = "yarl-1.18.3-py3-none-any.whl", hash = "sha256:b57f4f58099328dfb26c6a771d09fb20dbbae81d20cfb66141251ea063bd101b"}, + {file = "yarl-1.18.3.tar.gz", hash = "sha256:ac1801c45cbf77b6c99242eeff4fffb5e4e73a800b5c4ad4fc0be5def634d2e1"}, ] [package.dependencies] From b3376b46950e5039753a78e319c7b3b2e0fcfc9e Mon Sep 17 00:00:00 2001 From: Chris van Run Date: Tue, 3 Dec 2024 16:50:47 +0100 Subject: [PATCH 13/16] Update `JSONEditorWidget` to 10.1.1 (#3728) This PR has a few changes bundled with respect to the JS-dependency JSONEditorWidget. ## Amass - Update `amass.lock`, this was outdated with respect to the `pyproject.toml`, a lot of no-longer-defined dependencies are present - Update JSONEditor to the latest version (`10.1.1`) ## JsonEditor invocation Fixes #3698 The crux of the original issue lies with `setCustomValidty` on a `d-none` classed `' + '' + '
' + (0,i18n/* translate */.Iu)('transformPreviewLabel') + '
' + '
' + ' ' + '
' + '
' + ' ' + '
' + ''; + var content = '
' + '
' + (0,i18n/* translate */.Tl)('transform') + '
' + '

' + queryDescription + '

' + '
' + (0,i18n/* translate */.Tl)('transformWizardLabel') + '
' + '
' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + (0,i18n/* translate */.Tl)('transformWizardFilter') + '' + '
' + ' ' + '
' + '
' + ' ' + '
' + '
' + ' ' + '
' + '
' + (0,i18n/* translate */.Tl)('transformWizardSortBy') + '' + '
' + ' ' + '
' + '
' + ' ' + '
' + '
' + (0,i18n/* translate */.Tl)('transformWizardSelectFields') + '' + ' ' + '
' + '
' + '
' + (0,i18n/* translate */.Tl)('transformQueryLabel') + '
' + '
' + ' ' + '
' + '
' + (0,i18n/* translate */.Tl)('transformPreviewLabel') + '
' + '
' + ' ' + '
' + '
' + ' ' + '
' + '
'; picoModal_default()({ parent: container, content: content, @@ -6984,12 +6641,10 @@ function showTransformModal(_ref) { var selectFields = elem.querySelector('#selectFields'); var query = elem.querySelector('#query'); var preview = elem.querySelector('#preview'); - if (!Array.isArray(value)) { wizard.style.fontStyle = 'italic'; wizard.textContent = '(wizard not available for objects, only for arrays)'; } - var sortablePaths = (0,util.getChildPaths)(json); sortablePaths.forEach(function (path) { var formattedPath = preprocessPath(path); @@ -7005,7 +6660,6 @@ function showTransformModal(_ref) { var selectablePaths = (0,util.getChildPaths)(json, true).filter(function (path) { return path !== ''; }); - if (selectablePaths.length > 0) { selectablePaths.forEach(function (path) { var formattedPath = preprocessPath(path); @@ -7016,12 +6670,10 @@ function showTransformModal(_ref) { }); } else { var selectFieldsPart = elem.querySelector('#selectFieldsPart'); - if (selectFieldsPart) { selectFieldsPart.style.display = 'none'; } } - var selectrFilterField = new (selectr_default())(filterField, { defaultSelected: false, clearable: true, @@ -7058,7 +6710,6 @@ function showTransformModal(_ref) { selectrSortField.on('selectr.change', generateQueryFromWizard); selectrSortOrder.on('selectr.change', generateQueryFromWizard); selectrSelectFields.on('selectr.change', generateQueryFromWizard); - elem.querySelector('.pico-modal-contents').onclick = function (event) { // prevent the first clear button (in any select box) from getting // focus when clicking anywhere in the modal. Only allow clicking links. @@ -7066,16 +6717,14 @@ function showTransformModal(_ref) { event.preventDefault(); } }; - function preprocessPath(path) { return path === '' ? '@' : path[0] === '.' ? path.slice(1) : path; } - function updatePreview() { try { var transformed = executeQuery(value, query.value); preview.className = 'jsoneditor-transform-preview'; - preview.value = stringifyPartial(transformed, 2, constants/* MAX_PREVIEW_CHARACTERS */.WF); + preview.value = stringifyPartial(transformed, 2, constants/* MAX_PREVIEW_CHARACTERS */.hJ); ok.disabled = false; } catch (err) { preview.className = 'jsoneditor-transform-preview jsoneditor-error'; @@ -7083,9 +6732,7 @@ function showTransformModal(_ref) { ok.disabled = true; } } - var debouncedUpdatePreview = (0,util.debounce)(updatePreview, 300); - function tryCreateQuery(json, queryOptions) { try { query.value = createQuery(json, queryOptions); @@ -7099,10 +6746,8 @@ function showTransformModal(_ref) { preview.value = message; } } - function generateQueryFromWizard() { var queryOptions = {}; - if (filterField.value && filterRelation.value && filterValue.value) { queryOptions.filter = { field: filterField.value, @@ -7110,42 +6755,35 @@ function showTransformModal(_ref) { value: filterValue.value }; } - if (sortField.value && sortOrder.value) { queryOptions.sort = { field: sortField.value, direction: sortOrder.value }; } - if (selectFields.value) { var fields = []; - for (var i = 0; i < selectFields.options.length; i++) { if (selectFields.options[i].selected) { var selectedField = selectFields.options[i].value; fields.push(selectedField); } } - queryOptions.projection = { fields: fields }; } - tryCreateQuery(json, queryOptions); } - query.oninput = debouncedUpdatePreview; - ok.onclick = function (event) { event.preventDefault(); event.stopPropagation(); modal.close(); onTransform(query.value); - }; // initialize with empty query - + }; + // initialize with empty query tryCreateQuery(json, {}); setTimeout(function () { query.select(); @@ -7160,7 +6798,7 @@ function showTransformModal(_ref) { /***/ }), -/***/ 5956: +/***/ 1948: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -7169,48 +6807,300 @@ __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { - "textModeMixins": function() { return /* binding */ textModeMixins; } + textModeMixins: function() { return /* binding */ textModeMixins; } }); -// EXTERNAL MODULE: ./node_modules/jsonrepair/lib/cjs/index-commonjs.js -var index_commonjs = __webpack_require__(8909); -var index_commonjs_default = /*#__PURE__*/__webpack_require__.n(index_commonjs); +// EXTERNAL MODULE: ./node_modules/jsonrepair/lib/esm/regular/jsonrepair.js + 2 modules +var jsonrepair = __webpack_require__(9857); // EXTERNAL MODULE: ./src/js/ace/index.js -var ace = __webpack_require__(8170); +var ace = __webpack_require__(7413); var ace_default = /*#__PURE__*/__webpack_require__.n(ace); // EXTERNAL MODULE: ./src/js/constants.js -var constants = __webpack_require__(4188); +var constants = __webpack_require__(660); // EXTERNAL MODULE: ./src/js/ErrorTable.js -var ErrorTable = __webpack_require__(6436); +var ErrorTable = __webpack_require__(2115); // EXTERNAL MODULE: ./src/js/FocusTracker.js -var FocusTracker = __webpack_require__(2474); +var FocusTracker = __webpack_require__(2877); // EXTERNAL MODULE: ./src/js/i18n.js -var i18n = __webpack_require__(7907); +var i18n = __webpack_require__(3057); // EXTERNAL MODULE: ./src/js/jmespathQuery.js -var jmespathQuery = __webpack_require__(6056); +var jmespathQuery = __webpack_require__(359); // EXTERNAL MODULE: ./src/js/ModeSwitcher.js -var ModeSwitcher = __webpack_require__(6617); +var ModeSwitcher = __webpack_require__(1389); // EXTERNAL MODULE: ./src/js/showSortModal.js -var showSortModal = __webpack_require__(6210); +var showSortModal = __webpack_require__(2915); // EXTERNAL MODULE: ./src/js/showTransformModal.js + 1 modules -var showTransformModal = __webpack_require__(2558); +var showTransformModal = __webpack_require__(5609); // EXTERNAL MODULE: ./src/js/tryRequireThemeJsonEditor.js -var tryRequireThemeJsonEditor = __webpack_require__(9125); +var tryRequireThemeJsonEditor = __webpack_require__(5467); +// EXTERNAL MODULE: ./node_modules/json-source-map/index.js +var json_source_map = __webpack_require__(3094); // EXTERNAL MODULE: ./src/js/util.js -var util = __webpack_require__(9791); -;// CONCATENATED MODULE: ./src/js/validationUtils.js +var util = __webpack_require__(6237); +;// ./src/js/SchemaTextCompleter.js + + +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } +function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } + + + +/** + * SchemaTextCompleter class implements the ace ext-language_tools completer API, + * and suggests completions for the text editor that are relative + * to the cursor position and the json schema + */ +var SchemaTextCompleter = /*#__PURE__*/function () { + function SchemaTextCompleter(schema, schemaRefs) { + _classCallCheck(this, SchemaTextCompleter); + this.schema = schema; + this.schemaRefs = schemaRefs || {}; + this.suggestions = {}; + this.suggestionsRefs = {}; + this._buildSuggestions(); + } + return _createClass(SchemaTextCompleter, [{ + key: "_buildSuggestions", + value: function _buildSuggestions() { + this._handleSchemaEntry('', this.schema, this.suggestions); + for (var refName in this.schemaRefs) { + this.suggestionsRefs[refName] = {}; + this._handleSchemaEntry('', this.schemaRefs[refName], this.suggestionsRefs[refName]); + } + } + }, { + key: "_handleRef", + value: function _handleRef(currectPath, refName, suggestionsObj) { + suggestionsObj[currectPath] = suggestionsObj[currectPath] || {}; + suggestionsObj[currectPath].refs = suggestionsObj[currectPath].refs || []; + suggestionsObj[currectPath].refs = (0,util.uniqueMergeArrays)(suggestionsObj[currectPath].refs, [refName]); + } + }, { + key: "_handleSchemaEntry", + value: function _handleSchemaEntry(currectPath, schemaNode, suggestionsObj) { + if (!schemaNode) { + console.error('SchemaTextCompleter: schema node is missing for path', currectPath); + return; + } + if (schemaNode.$ref) { + this._handleRef(currectPath, schemaNode.$ref, suggestionsObj); + return; + } + var ofConditionEntry = this._checkOfConditon(schemaNode); + if (ofConditionEntry) { + this._handleOfCondition(currectPath, schemaNode[ofConditionEntry], suggestionsObj); + return; + } + switch (schemaNode.type) { + case 'object': + this._handleObject(currectPath, schemaNode, suggestionsObj); + break; + case 'string': + case 'number': + case 'integer': + this._handlePrimitive(currectPath, schemaNode, suggestionsObj); + break; + case 'boolean': + this._handleBoolean(currectPath, schemaNode, suggestionsObj); + break; + case 'array': + this._handleArray(currectPath, schemaNode, suggestionsObj); + } + } + }, { + key: "_handleObject", + value: function _handleObject(currectPath, schemaNode, suggestionsObj) { + var _this = this; + if ((0,util.isObject)(schemaNode.properties)) { + var props = Object.keys(schemaNode.properties); + suggestionsObj[currectPath] = suggestionsObj[currectPath] || {}; + suggestionsObj[currectPath].props = suggestionsObj[currectPath].props || []; + suggestionsObj[currectPath].props = (0,util.uniqueMergeArrays)(suggestionsObj[currectPath].props, props); + props.forEach(function (prop) { + (0,util.asyncExec)(function () { + _this._handleSchemaEntry("".concat(currectPath, "/").concat(prop), schemaNode.properties[prop], suggestionsObj); + }); + }); + } + } + }, { + key: "_handlePrimitive", + value: function _handlePrimitive(currectPath, schemaNode, suggestionsObj) { + suggestionsObj[currectPath] = suggestionsObj[currectPath] || {}; + if ((0,util.isArray)(schemaNode.examples)) { + suggestionsObj[currectPath].examples = suggestionsObj[currectPath].examples || []; + suggestionsObj[currectPath].examples = (0,util.uniqueMergeArrays)(suggestionsObj[currectPath].examples, schemaNode.examples); + } + if ((0,util.isArray)(schemaNode["enum"])) { + suggestionsObj[currectPath]["enum"] = suggestionsObj[currectPath]["enum"] || []; + suggestionsObj[currectPath]["enum"] = (0,util.uniqueMergeArrays)(suggestionsObj[currectPath]["enum"], schemaNode["enum"]); + } + } + }, { + key: "_handleBoolean", + value: function _handleBoolean(currectPath, schemaNode, suggestionsObj) { + if (!suggestionsObj[currectPath]) { + suggestionsObj[currectPath] = { + bool: [true, false] + }; + } + } + }, { + key: "_handleArray", + value: function _handleArray(currectPath, schemaNode, suggestionsObj) { + var _this2 = this; + if (schemaNode.items) { + (0,util.asyncExec)(function () { + _this2._handleSchemaEntry("".concat(currectPath, "/\\d+"), schemaNode.items, suggestionsObj); + }); + } + } + }, { + key: "_handleOfCondition", + value: function _handleOfCondition(currectPath, schemaNode, suggestionsObj) { + var _this3 = this; + if (schemaNode && schemaNode.length) { + schemaNode.forEach(function (schemaEntry) { + (0,util.asyncExec)(function () { + _this3._handleSchemaEntry(currectPath, schemaEntry, suggestionsObj); + }); + }); + } + } + }, { + key: "_checkOfConditon", + value: function _checkOfConditon(entry) { + if (!entry) { + return; + } + if (entry.oneOf) { + return 'oneOf'; + } + if (entry.anyOf) { + return 'anyOf'; + } + if (entry.allOf) { + return 'allOf'; + } + } + }, { + key: "getCompletions", + value: function getCompletions(editor, session, pos, prefix, callback) { + var _this4 = this; + try { + var map = json_source_map.parse(session.getValue()); + var pointers = map.pointers || {}; + var processCompletionsCallback = function processCompletionsCallback(suggestions) { + var completions = []; + var score = 0; + var appendSuggesions = function appendSuggesions(type) { + var _suggestions$type; + var typeTitle = { + props: 'property', + "enum": 'enum', + bool: 'boolean', + examples: 'examples' + }; + if (suggestions && (_suggestions$type = suggestions[type]) !== null && _suggestions$type !== void 0 && _suggestions$type.length) { + completions = completions.concat(suggestions[type].map(function (term) { + return { + caption: term + '', + meta: "schema [".concat(typeTitle[type], "]"), + score: score++, + value: term + '' + }; + })); + } + }; + appendSuggesions('props'); + appendSuggesions('enum'); + appendSuggesions('bool'); + appendSuggesions('examples'); + if (completions.length) { + callback(null, completions); + } + }; + Object.keys(pointers).forEach(function (ptr) { + (0,util.asyncExec)(function () { + var _pointers$ptr$key, _pointers$ptr$value, _pointers$ptr$value2, _pointers$ptr$valueEn; + var _matchPointersToPath = function matchPointersToPath(pointer, currentSuggestions, path) { + var option = Object.keys(currentSuggestions).reduce(function (last, key) { + if (new RegExp("^".concat(path).concat(key)).test(pointer)) { + if (!last || last.length < key.length) { + return key; + } + } + return last; + }, null); + if (typeof option === 'string') { + var _currentSuggestions$o; + if ((_currentSuggestions$o = currentSuggestions[option]) !== null && _currentSuggestions$o !== void 0 && (_currentSuggestions$o = _currentSuggestions$o.refs) !== null && _currentSuggestions$o !== void 0 && _currentSuggestions$o.length) { + var mergedSuggestions = {}; + for (var idx in currentSuggestions[option].refs) { + var refName = currentSuggestions[option].refs[idx]; + if (_this4.suggestionsRefs[refName]) { + var refSuggestion = _matchPointersToPath(pointer, _this4.suggestionsRefs[refName], "".concat(path).concat(option)); + if (refSuggestion !== null && refSuggestion !== void 0 && refSuggestion["enum"]) { + mergedSuggestions["enum"] = (0,util.uniqueMergeArrays)(mergedSuggestions["enum"], refSuggestion["enum"]); + } + if (refSuggestion !== null && refSuggestion !== void 0 && refSuggestion.examples) { + mergedSuggestions.examples = (0,util.uniqueMergeArrays)(mergedSuggestions.examples, refSuggestion.examples); + } + if (refSuggestion !== null && refSuggestion !== void 0 && refSuggestion.bool) { + mergedSuggestions.bool = (0,util.uniqueMergeArrays)(mergedSuggestions.bool, refSuggestion.bool); + } + if (refSuggestion !== null && refSuggestion !== void 0 && refSuggestion.props) { + mergedSuggestions.props = (0,util.uniqueMergeArrays)(mergedSuggestions.props, refSuggestion.props); + } + } + } + return mergedSuggestions; + } else if (new RegExp("^".concat(path).concat(option, "$")).test(pointer)) { + // console.log('SchemaTextCompleter: Text suggestion match', { path: pointer, schemaPath: `${path}${option}`, suggestions: currentSuggestions[option] }) + return currentSuggestions[option]; + } + } + }; + var selectedPtr; + if (((_pointers$ptr$key = pointers[ptr].key) === null || _pointers$ptr$key === void 0 ? void 0 : _pointers$ptr$key.line) === pos.row) { + if (pos.column >= pointers[ptr].key.column && pos.column <= pointers[ptr].keyEnd.column) { + selectedPtr = ptr.slice(0, ptr.lastIndexOf('/')); + } + } + if (((_pointers$ptr$value = pointers[ptr].value) === null || _pointers$ptr$value === void 0 ? void 0 : _pointers$ptr$value.line) === pos.row && ((_pointers$ptr$value2 = pointers[ptr].value) === null || _pointers$ptr$value2 === void 0 ? void 0 : _pointers$ptr$value2.line) === ((_pointers$ptr$valueEn = pointers[ptr].valueEnd) === null || _pointers$ptr$valueEn === void 0 ? void 0 : _pointers$ptr$valueEn.line)) { + // multiline values are objects + if (pos.column >= pointers[ptr].value.column && pos.column <= pointers[ptr].valueEnd.column) { + selectedPtr = ptr; + } + } + if (selectedPtr) { + var chosenCompletions = _matchPointersToPath(selectedPtr, _this4.suggestions, ''); + processCompletionsCallback(chosenCompletions); + } + }); + }); + } catch (e) { + // probably not valid json, ignore. + } + } + }]); +}(); +;// ./src/js/validationUtils.js + /** * Execute custom validation if configured. * * Returns a promise resolving with the custom errors (or an empty array). */ - function validateCustom(json, onValidate) { if (!onValidate) { return Promise.resolve([]); } - try { var customValidateResults = onValidate(json); var resultPromise = (0,util.isPromise)(customValidateResults) ? customValidateResults : Promise.resolve(customValidateResults); @@ -7218,18 +7108,19 @@ function validateCustom(json, onValidate) { if (Array.isArray(customValidationPathErrors)) { return customValidationPathErrors.filter(function (error) { var valid = (0,util.isValidValidationError)(error); - if (!valid) { console.warn('Ignoring a custom validation error with invalid structure. ' + 'Expected structure: {path: [...], message: "..."}. ' + 'Actual error:', error); } - return valid; }).map(function (error) { - return { - dataPath: (0,util.stringifyPath)(error.path), - message: error.message, - type: 'customValidation' - }; + return ( + // change data structure into the structure matching the JSON schema errors + { + dataPath: (0,util.stringifyPath)(error.path), + message: error.message, + type: 'customValidation' + } + ); }); } else { return []; @@ -7239,10 +7130,10 @@ function validateCustom(json, onValidate) { return Promise.reject(err); } } -;// CONCATENATED MODULE: ./src/js/textmode.js +;// ./src/js/textmode.js -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +function textmode_typeof(o) { "@babel/helpers - typeof"; return textmode_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, textmode_typeof(o); } @@ -7256,261 +7147,238 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi - // create a mixin with the functions for text mode + +// create a mixin with the functions for text mode var textmode = {}; var DEFAULT_THEME = 'ace/theme/jsoneditor'; + /** * Create a text editor * @param {Element} container * @param {Object} [options] Object with options. See docs for details. * @private */ - textmode.create = function (container) { var _this = this; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (typeof options.statusBar === 'undefined') { options.statusBar = true; - } // setting default for textmode - + } + // setting default for textmode options.mainMenuBar = options.mainMenuBar !== false; options.enableSort = options.enableSort !== false; options.enableTransform = options.enableTransform !== false; - options.createQuery = options.createQuery || jmespathQuery/* createQuery */.r; - options.executeQuery = options.executeQuery || jmespathQuery/* executeQuery */.J; - this.options = options; // indentation + options.createQuery = options.createQuery || jmespathQuery/* createQuery */.V; + options.executeQuery = options.executeQuery || jmespathQuery/* executeQuery */.e; + options.showErrorTable = options.showErrorTable !== undefined ? options.showErrorTable : ['text', 'preview']; + this.options = options; + // indentation if (typeof options.indentation === 'number') { this.indentation = Number(options.indentation); } else { this.indentation = 2; // number of spaces - } // language + } + // language + (0,i18n/* setLanguages */.AI)(this.options.languages); + (0,i18n/* setLanguage */.xC)(this.options.language); - (0,i18n/* setLanguages */.cC)(this.options.languages); - (0,i18n/* setLanguage */.m0)(this.options.language); // grab ace from options if provided + // grab ace from options if provided + var _ace = options.ace ? options.ace : (ace_default()); + // TODO: make the option options.ace deprecated, it's not needed anymore (see #309) - var _ace = options.ace ? options.ace : (ace_default()); // TODO: make the option options.ace deprecated, it's not needed anymore (see #309) // determine mode - - this.mode = options.mode === 'code' ? 'code' : 'text'; - if (this.mode === 'code') { // verify whether Ace editor is available and supported if (typeof _ace === 'undefined') { this.mode = 'text'; console.warn('Failed to load Ace editor, falling back to plain text mode. Please use a JSONEditor bundle including Ace, or pass Ace as via the configuration option `ace`.'); } - } // determine theme - + } + // determine theme this.theme = options.theme || DEFAULT_THEME; - if (this.theme === DEFAULT_THEME && _ace) { - (0,tryRequireThemeJsonEditor/* tryRequireThemeJsonEditor */.O)(); + (0,tryRequireThemeJsonEditor/* tryRequireThemeJsonEditor */.J)(); } - if (options.onTextSelectionChange) { this.onTextSelectionChange(options.onTextSelectionChange); } - var me = this; this.container = container; this.dom = {}; this.aceEditor = undefined; // ace code editor - this.textarea = undefined; // plain text editor (fallback when Ace is not available) - this.validateSchema = null; this.annotations = []; - this.lastSchemaErrors = undefined; // create a debounced validate function + this.lastSchemaErrors = undefined; + // create a debounced validate function this._debouncedValidate = (0,util.debounce)(this._validateAndCatch.bind(this), this.DEBOUNCE_INTERVAL); this.width = container.clientWidth; this.height = container.clientHeight; this.frame = document.createElement('div'); this.frame.className = 'jsoneditor jsoneditor-mode-' + this.options.mode; - this.frame.onclick = function (event) { // prevent default submit action when the editor is located inside a form event.preventDefault(); }; - this.frame.onkeydown = function (event) { me._onKeyDown(event); - }; // setting the FocusTracker on 'this.frame' to track the editor's focus event - + }; + // setting the FocusTracker on 'this.frame' to track the editor's focus event var focusTrackerConfig = { target: this.frame, onFocus: this.options.onFocus || null, onBlur: this.options.onBlur || null }; - this.frameFocusTracker = new FocusTracker/* FocusTracker */.R(focusTrackerConfig); + this.frameFocusTracker = new FocusTracker/* FocusTracker */.$(focusTrackerConfig); this.content = document.createElement('div'); this.content.className = 'jsoneditor-outer'; - if (this.options.mainMenuBar) { - (0,util.addClassName)(this.content, 'has-main-menu-bar'); // create menu + (0,util.addClassName)(this.content, 'has-main-menu-bar'); + // create menu this.menu = document.createElement('div'); this.menu.className = 'jsoneditor-menu'; - this.frame.appendChild(this.menu); // create format button + this.frame.appendChild(this.menu); + // create format button var buttonFormat = document.createElement('button'); buttonFormat.type = 'button'; buttonFormat.className = 'jsoneditor-format'; - buttonFormat.title = (0,i18n/* translate */.Iu)('formatTitle'); + buttonFormat.title = (0,i18n/* translate */.Tl)('formatTitle'); this.menu.appendChild(buttonFormat); - buttonFormat.onclick = function () { try { me.format(); - me._onChange(); } catch (err) { me._onError(err); } - }; // create compact button - + }; + // create compact button var buttonCompact = document.createElement('button'); buttonCompact.type = 'button'; buttonCompact.className = 'jsoneditor-compact'; - buttonCompact.title = (0,i18n/* translate */.Iu)('compactTitle'); + buttonCompact.title = (0,i18n/* translate */.Tl)('compactTitle'); this.menu.appendChild(buttonCompact); - buttonCompact.onclick = function () { try { me.compact(); - me._onChange(); } catch (err) { me._onError(err); } - }; // create sort button - + }; + // create sort button if (this.options.enableSort) { var _sort = document.createElement('button'); - _sort.type = 'button'; _sort.className = 'jsoneditor-sort'; - _sort.title = (0,i18n/* translate */.Iu)('sortTitleShort'); - + _sort.title = (0,i18n/* translate */.Tl)('sortTitleShort'); _sort.onclick = function () { me._showSortModal(); }; - this.menu.appendChild(_sort); - } // create transform button - + } + // create transform button if (this.options.enableTransform) { var transform = document.createElement('button'); transform.type = 'button'; - transform.title = (0,i18n/* translate */.Iu)('transformTitleShort'); + transform.title = (0,i18n/* translate */.Tl)('transformTitleShort'); transform.className = 'jsoneditor-transform'; - transform.onclick = function () { me._showTransformModal(); }; - this.menu.appendChild(transform); - } // create repair button - + } + // create repair button var buttonRepair = document.createElement('button'); buttonRepair.type = 'button'; buttonRepair.className = 'jsoneditor-repair'; - buttonRepair.title = (0,i18n/* translate */.Iu)('repairTitle'); + buttonRepair.title = (0,i18n/* translate */.Tl)('repairTitle'); this.menu.appendChild(buttonRepair); - buttonRepair.onclick = function () { try { me.repair(); - me._onChange(); } catch (err) { me._onError(err); } - }; // create undo/redo buttons - + }; + // create undo/redo buttons if (this.mode === 'code') { // create undo button var undo = document.createElement('button'); undo.type = 'button'; undo.className = 'jsoneditor-undo jsoneditor-separator'; - undo.title = (0,i18n/* translate */.Iu)('undo'); - + undo.title = (0,i18n/* translate */.Tl)('undo'); undo.onclick = function () { _this.aceEditor.getSession().getUndoManager().undo(); }; - this.menu.appendChild(undo); - this.dom.undo = undo; // create redo button + this.dom.undo = undo; + // create redo button var redo = document.createElement('button'); redo.type = 'button'; redo.className = 'jsoneditor-redo'; - redo.title = (0,i18n/* translate */.Iu)('redo'); - + redo.title = (0,i18n/* translate */.Tl)('redo'); redo.onclick = function () { _this.aceEditor.getSession().getUndoManager().redo(); }; - this.menu.appendChild(redo); this.dom.redo = redo; - } // create mode box - + } + // create mode box if (this.options && this.options.modes && this.options.modes.length) { - this.modeSwitcher = new ModeSwitcher/* ModeSwitcher */.x(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) { + this.modeSwitcher = new ModeSwitcher/* ModeSwitcher */.n(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) { // switch mode and restore focus - me.setMode(mode); - me.modeSwitcher.focus(); + try { + me.setMode(mode); + me.modeSwitcher.focus(); + } catch (err) { + me._onError(err); + } }); } - if (this.mode === 'code') { var poweredBy = document.createElement('a'); poweredBy.appendChild(document.createTextNode('powered by ace')); poweredBy.href = 'https://ace.c9.io/'; poweredBy.target = '_blank'; poweredBy.className = 'jsoneditor-poweredBy'; - poweredBy.onclick = function () { // TODO: this anchor falls below the margin of the content, // therefore the normal a.href does not work. We use a click event // for now, but this should be fixed. - window.open(poweredBy.href, poweredBy.target, 'noopener'); + window.open(poweredBy.href, poweredBy.target, 'noreferrer'); }; - this.menu.appendChild(poweredBy); } } - var emptyNode = {}; - var isReadOnly = this.options.onEditable && _typeof(this.options.onEditable === 'function') && !this.options.onEditable(emptyNode); + var isReadOnly = this.options.onEditable && textmode_typeof(this.options.onEditable === 'function') && !this.options.onEditable(emptyNode); this.frame.appendChild(this.content); this.container.appendChild(this.frame); - if (this.mode === 'code') { this.editorDom = document.createElement('div'); this.editorDom.style.height = '100%'; // TODO: move to css - this.editorDom.style.width = '100%'; // TODO: move to css - this.content.appendChild(this.editorDom); - var aceEditor = _ace.edit(this.editorDom); - var aceSession = aceEditor.getSession(); aceEditor.$blockScrolling = Infinity; aceEditor.setTheme(this.theme); @@ -7518,28 +7386,30 @@ textmode.create = function (container) { readOnly: isReadOnly }); aceEditor.setShowPrintMargin(false); - aceEditor.setFontSize('13px'); + aceEditor.setFontSize('14px'); aceSession.setMode('ace/mode/json'); aceSession.setTabSize(this.indentation); aceSession.setUseSoftTabs(true); - aceSession.setUseWrapMode(true); // replace ace setAnnotations with custom function that also covers jsoneditor annotations + aceSession.setUseWrapMode(true); + // replace ace setAnnotations with custom function that also covers jsoneditor annotations var originalSetAnnotations = aceSession.setAnnotations; - aceSession.setAnnotations = function (annotations) { originalSetAnnotations.call(this, annotations && annotations.length ? annotations : me.annotations); - }; // disable Ctrl+L quickkey of Ace (is used by the browser to select the address bar) - + }; + // disable Ctrl+L quickkey of Ace (is used by the browser to select the address bar) aceEditor.commands.bindKey('Ctrl-L', null); - aceEditor.commands.bindKey('Command-L', null); // disable the quickkeys we want to use for Format and Compact + aceEditor.commands.bindKey('Command-L', null); + // disable the quickkeys we want to use for Format and Compact aceEditor.commands.bindKey('Ctrl-\\', null); aceEditor.commands.bindKey('Command-\\', null); aceEditor.commands.bindKey('Ctrl-Shift-\\', null); aceEditor.commands.bindKey('Command-Shift-\\', null); - this.aceEditor = aceEditor; // register onchange event + this.aceEditor = aceEditor; + // register onchange event aceEditor.on('change', this._onChange.bind(this)); aceEditor.on('changeSelection', this._onSelect.bind(this)); } else { @@ -7549,30 +7419,28 @@ textmode.create = function (container) { textarea.spellcheck = false; this.content.appendChild(textarea); this.textarea = textarea; - this.textarea.readOnly = isReadOnly; // register onchange event + this.textarea.readOnly = isReadOnly; + // register onchange event if (this.textarea.oninput === null) { this.textarea.oninput = this._onChange.bind(this); } else { // oninput is undefined. For IE8- this.textarea.onchange = this._onChange.bind(this); } - textarea.onselect = this._onSelect.bind(this); textarea.onmousedown = this._onMouseDown.bind(this); textarea.onblur = this._onBlur.bind(this); } - this._updateHistoryButtons(); - - this.errorTable = new ErrorTable/* ErrorTable */.Q({ - errorTableVisible: this.mode === 'text', + var errorTableVisible = Array.isArray(this.options.showErrorTable) ? this.options.showErrorTable.includes(this.mode) : this.options.showErrorTable === true; + this.errorTable = new ErrorTable/* ErrorTable */.N({ + errorTableVisible: errorTableVisible, onToggleVisibility: function onToggleVisibility() { me._validateAndCatch(); }, onFocusLine: function onFocusLine(line) { me.isFocused = true; - if (!isNaN(line)) { me.setTextSelection({ row: line, @@ -7592,7 +7460,6 @@ textmode.create = function (container) { } }); this.frame.appendChild(this.errorTable.getErrorTable()); - if (options.statusBar) { (0,util.addClassName)(this.content, 'has-status-bar'); this.curserInfoElements = {}; @@ -7634,43 +7501,53 @@ textmode.create = function (container) { statusBar.appendChild(this.errorTable.getWarningIcon()); statusBar.appendChild(this.errorTable.getErrorIcon()); } - this.setSchema(this.options.schema, this.options.schemaRefs); }; +textmode._onSchemaChange = function (schema, schemaRefs) { + if (!this.aceEditor) { + return; + } + if (this.options.allowSchemaSuggestions && schema) { + this.aceEditor.setOption('enableBasicAutocompletion', [new SchemaTextCompleter(schema, schemaRefs)]); + this.aceEditor.setOption('enableLiveAutocompletion', true); + } else { + this.aceEditor.setOption('enableBasicAutocompletion', undefined); + this.aceEditor.setOption('enableLiveAutocompletion', false); + } +}; + /** * Handle a change: * - Validate JSON schema * - Send a callback to the onChange listener if provided * @private */ - - textmode._onChange = function () { var _this2 = this; - if (this.onChangeDisabled) { return; - } // enable/disable undo/redo buttons - + } + // enable/disable undo/redo buttons setTimeout(function () { if (_this2._updateHistoryButtons) { _this2._updateHistoryButtons(); } - }); // validate JSON schema (if configured) - - this._debouncedValidate(); // trigger the onChange callback + }); + // validate JSON schema (if configured) + this._debouncedValidate(); + // trigger the onChange callback if (this.options.onChange) { try { this.options.onChange(); } catch (err) { console.error('Error in onChange callback: ', err); } - } // trigger the onChangeText callback - + } + // trigger the onChangeText callback if (this.options.onChangeText) { try { this.options.onChangeText(this.getText()); @@ -7679,171 +7556,150 @@ textmode._onChange = function () { } } }; - textmode._updateHistoryButtons = function () { if (this.aceEditor && this.dom.undo && this.dom.redo) { var undoManager = this.aceEditor.getSession().getUndoManager(); - if (undoManager && undoManager.hasUndo && undoManager.hasRedo) { this.dom.undo.disabled = !undoManager.hasUndo(); this.dom.redo.disabled = !undoManager.hasRedo(); } } }; + /** * Open a sort modal * @private */ - - textmode._showSortModal = function () { - var me = this; - var container = this.options.modalAnchor || constants/* DEFAULT_MODAL_ANCHOR */.qD; - var json = this.get(); - - function onSort(sortedBy) { - if (Array.isArray(json)) { - var sortedJson = (0,util.sort)(json, sortedBy.path, sortedBy.direction); - me.sortedBy = sortedBy; - me.update(sortedJson); - } - - if ((0,util.isObject)(json)) { - var _sortedJson = (0,util.sortObjectKeys)(json, sortedBy.direction); - - me.sortedBy = sortedBy; - me.update(_sortedJson); - } + try { + var onSort = function onSort(sortedBy) { + if (Array.isArray(json)) { + var sortedJson = (0,util.sort)(json, sortedBy.path, sortedBy.direction); + me.sortedBy = sortedBy; + me.update(sortedJson); + } + if ((0,util.isObject)(json)) { + var _sortedJson = (0,util.sortObjectKeys)(json, sortedBy.direction); + me.sortedBy = sortedBy; + me.update(_sortedJson); + } + }; + var me = this; + var container = this.options.modalAnchor || constants/* DEFAULT_MODAL_ANCHOR */.ai; + var json = this.get(); + (0,showSortModal.showSortModal)(container, json, onSort, me.sortedBy); + } catch (err) { + this._onError(err); } - - (0,showSortModal.showSortModal)(container, json, onSort, me.sortedBy); }; + /** * Open a transform modal * @private */ - - textmode._showTransformModal = function () { var _this3 = this; - - var _this$options = this.options, + try { + var _this$options = this.options, modalAnchor = _this$options.modalAnchor, - createQuery = _this$options.createQuery, - executeQuery = _this$options.executeQuery, + _createQuery = _this$options.createQuery, + _executeQuery = _this$options.executeQuery, queryDescription = _this$options.queryDescription; - var json = this.get(); - (0,showTransformModal.showTransformModal)({ - container: modalAnchor || constants/* DEFAULT_MODAL_ANCHOR */.qD, - json: json, - queryDescription: queryDescription, - // can be undefined - createQuery: createQuery, - executeQuery: executeQuery, - onTransform: function onTransform(query) { - var updatedJson = executeQuery(json, query); - - _this3.update(updatedJson); - } - }); + var json = this.get(); + (0,showTransformModal.showTransformModal)({ + container: modalAnchor || constants/* DEFAULT_MODAL_ANCHOR */.ai, + json: json, + queryDescription: queryDescription, + // can be undefined + createQuery: _createQuery, + executeQuery: _executeQuery, + onTransform: function onTransform(query) { + var updatedJson = _executeQuery(json, query); + _this3.update(updatedJson); + } + }); + } catch (err) { + this._onError(err); + } }; + /** * Handle text selection * Calculates the cursor position and selection range and updates menu * @private */ - - textmode._onSelect = function () { this._updateCursorInfo(); - this._emitSelectionChange(); }; + /** * Event handler for keydown. Handles shortcut keys * @param {Event} event * @private */ - - textmode._onKeyDown = function (event) { var keynum = event.which || event.keyCode; var handled = false; - if (keynum === 73 && event.ctrlKey) { if (event.shiftKey) { // Ctrl+Shift+I this.compact(); - this._onChange(); } else { // Ctrl+I this.format(); - this._onChange(); } - handled = true; } - if (handled) { event.preventDefault(); event.stopPropagation(); } - this._updateCursorInfo(); - this._emitSelectionChange(); }; + /** * Event handler for mousedown. * @private */ - - textmode._onMouseDown = function () { this._updateCursorInfo(); - this._emitSelectionChange(); }; + /** * Event handler for blur. * @private */ - - textmode._onBlur = function () { - var me = this; // this allows to avoid blur when clicking inner elements (like the errors panel) + var me = this; + // this allows to avoid blur when clicking inner elements (like the errors panel) // just make sure to set the isFocused to true on the inner element onclick callback - setTimeout(function () { if (!me.isFocused) { me._updateCursorInfo(); - me._emitSelectionChange(); } - me.isFocused = false; }); }; + /** * Update the cursor info and the status bar, if presented */ - - textmode._updateCursorInfo = function () { var me = this; var line, col, count; - if (this.textarea) { setTimeout(function () { // this to verify we get the most updated textarea cursor selection var selectionRange = (0,util.getInputSelection)(me.textarea); - if (selectionRange.startIndex !== selectionRange.endIndex) { count = selectionRange.endIndex - selectionRange.startIndex; } - if (count && me.cursorInfo && me.cursorInfo.line === selectionRange.end.row && me.cursorInfo.column === selectionRange.end.column) { line = selectionRange.start.row; col = selectionRange.start.column; @@ -7851,13 +7707,11 @@ textmode._updateCursorInfo = function () { line = selectionRange.end.row; col = selectionRange.end.column; } - me.cursorInfo = { line: line, column: col, count: count }; - if (me.options.statusBar) { updateDisplay(); } @@ -7873,36 +7727,32 @@ textmode._updateCursorInfo = function () { column: col, count: count }; - if (this.options.statusBar) { updateDisplay(); } } - function updateDisplay() { if (me.curserInfoElements.countVal.innerText !== count) { me.curserInfoElements.countVal.innerText = count; me.curserInfoElements.countVal.style.display = count ? 'inline' : 'none'; me.curserInfoElements.countLabel.style.display = count ? 'inline' : 'none'; } - me.curserInfoElements.lnVal.innerText = line; me.curserInfoElements.colVal.innerText = col; } }; + /** * emits selection change callback, if given * @private */ - - textmode._emitSelectionChange = function () { if (this._selectionChangedHandler) { var currentSelection = this.getTextSelection(); - this._selectionChangedHandler(currentSelection.start, currentSelection.end, currentSelection.text); } }; + /** * refresh ERROR annotations state * error annotations are handled by the ace json mode (ace/mode/json) @@ -7910,11 +7760,8 @@ textmode._emitSelectionChange = function () { * therefore in order to refresh we send only the annotations of error type in order to maintain its state * @private */ - - textmode._refreshAnnotations = function () { var session = this.aceEditor && this.aceEditor.getSession(); - if (session) { var errEnnotations = session.getAnnotations().filter(function (annotation) { return annotation.type === 'error'; @@ -7922,159 +7769,139 @@ textmode._refreshAnnotations = function () { session.setAnnotations(errEnnotations); } }; + /** * Destroy the editor. Clean up DOM, event listeners, and web workers. */ - - textmode.destroy = function () { // remove old ace editor if (this.aceEditor) { this.aceEditor.destroy(); this.aceEditor = null; } - if (this.frame && this.container && this.frame.parentNode === this.container) { this.container.removeChild(this.frame); } - if (this.modeSwitcher) { this.modeSwitcher.destroy(); this.modeSwitcher = null; } - this.textarea = null; - this._debouncedValidate = null; // Removing the FocusTracker set to track the editor's focus event + this._debouncedValidate = null; + // Removing the FocusTracker set to track the editor's focus event this.frameFocusTracker.destroy(); }; + /** * Compact the code in the text editor */ - - textmode.compact = function () { var json = this.get(); var text = JSON.stringify(json); this.updateText(text); }; + /** * Format the code in the text editor */ - - textmode.format = function () { var json = this.get(); var text = JSON.stringify(json, null, this.indentation); this.updateText(text); }; + /** * Repair the code in the text editor */ - - textmode.repair = function () { var text = this.getText(); - try { - var repairedText = index_commonjs_default()(text); + var repairedText = (0,jsonrepair/* jsonrepair */.m)(text); this.updateText(repairedText); - } catch (err) {// repair was not successful, do nothing + } catch (err) { + // repair was not successful, do nothing } }; + /** * Set focus to the formatter */ - - textmode.focus = function () { if (this.textarea) { this.textarea.focus(); } - if (this.aceEditor) { this.aceEditor.focus(); } }; + /** * Resize the formatter */ - - textmode.resize = function () { if (this.aceEditor) { var force = false; this.aceEditor.resize(force); } }; + /** * Set json data in the formatter * @param {*} json */ - - textmode.set = function (json) { this.setText(JSON.stringify(json, null, this.indentation)); }; + /** * Update data. Same as calling `set` in text/code mode. * @param {*} json */ - - textmode.update = function (json) { this.updateText(JSON.stringify(json, null, this.indentation)); }; + /** * Get json data from the formatter * @return {*} json */ - - textmode.get = function () { var text = this.getText(); return (0,util.parse)(text); // this can throw an error }; + /** * Get the text contents of the editor * @return {String} jsonText */ - - textmode.getText = function () { if (this.textarea) { return this.textarea.value; } - if (this.aceEditor) { return this.aceEditor.getValue(); } - return ''; }; + /** * Set the text contents of the editor and optionally clear the history * @param {String} jsonText * @param {boolean} clearHistory Only applicable for mode 'code' * @private */ - - textmode._setText = function (jsonText, clearHistory) { var _this4 = this; - var text = this.options.escapeUnicode === true ? (0,util.escapeUnicodeChars)(jsonText) : jsonText; - if (this.textarea) { this.textarea.value = text; } - if (this.aceEditor) { // prevent emitting onChange events while setting new text this.onChangeDisabled = true; this.aceEditor.setValue(text, -1); this.onChangeDisabled = false; - if (clearHistory) { // prevent initial undo action clearing the initial contents var me = this; @@ -8084,70 +7911,62 @@ textmode._setText = function (jsonText, clearHistory) { } }); } - setTimeout(function () { if (_this4._updateHistoryButtons) { _this4._updateHistoryButtons(); } }); - } // validate JSON schema - + } + // validate JSON schema this._debouncedValidate(); }; + /** * Set the text contents of the editor * @param {String} jsonText */ - - textmode.setText = function (jsonText) { this._setText(jsonText, true); }; + /** * Update the text contents * @param {string} jsonText */ - - textmode.updateText = function (jsonText) { // don't update if there are no changes if (this.getText() === jsonText) { return; } - this._setText(jsonText, false); }; + /** * Validate current JSON object against the configured JSON schema * Throws an exception when no JSON schema is configured */ - - textmode.validate = function () { var _this5 = this; - var schemaErrors = []; var parseErrors = []; var json; - try { json = this.get(); // this can fail when there is no valid json - // execute JSON schema validation (ajv) + // execute JSON schema validation (ajv) if (this.validateSchema) { var valid = this.validateSchema(json); - if (!valid) { schemaErrors = this.validateSchema.errors.map(function (error) { error.type = 'validation'; return (0,util.improveSchemaError)(error); }); } - } // execute custom validation and after than merge and render all errors - // TODO: implement a better mechanism for only using the last validation action - + } + // execute custom validation and after than merge and render all errors + // TODO: implement a better mechanism for only using the last validation action this.validationSequence = (this.validationSequence || 0) + 1; var me = this; var seq = this.validationSequence; @@ -8155,16 +7974,12 @@ textmode.validate = function () { // only apply when there was no other validation started whilst resolving async results if (seq === me.validationSequence) { var errors = schemaErrors.concat(parseErrors).concat(customValidationErrors); - me._renderErrors(errors); - if (typeof _this5.options.onValidationError === 'function' && (0,util.isValidationErrorChanged)(errors, _this5.lastSchemaErrors)) { _this5.options.onValidationError.call(_this5, errors); } - _this5.lastSchemaErrors = errors; } - return _this5.lastSchemaErrors; }); } catch (err) { @@ -8172,35 +7987,28 @@ textmode.validate = function () { // try to extract the line number from the jsonlint error message var match = /\w*line\s*(\d+)\w*/g.exec(err.message); var line; - if (match) { line = +match[1]; } - parseErrors = [{ type: 'error', message: err.message.replace(/\n/g, '
'), line: line }]; } - this._renderErrors(parseErrors); - if (typeof this.options.onValidationError === 'function' && (0,util.isValidationErrorChanged)(parseErrors, this.lastSchemaErrors)) { this.options.onValidationError.call(this, parseErrors); } - this.lastSchemaErrors = parseErrors; return Promise.resolve(this.lastSchemaErrors); } }; - textmode._validateAndCatch = function () { this.validate()["catch"](function (err) { console.error('Error running validation:', err); }); }; - textmode._renderErrors = function (errors) { var jsonText = this.getText(); var errorPaths = []; @@ -8208,11 +8016,11 @@ textmode._renderErrors = function (errors) { if (typeof curr.dataPath === 'string' && acc.indexOf(curr.dataPath) === -1) { acc.push(curr.dataPath); } - return acc; }, errorPaths); - var errorLocations = (0,util.getPositionForPath)(jsonText, errorPaths); // render annotations in Ace Editor (if any) + var errorLocations = (0,util.getPositionForPath)(jsonText, errorPaths); + // render annotations in Ace Editor (if any) if (this.aceEditor) { this.annotations = errorLocations.map(function (errLoc) { var validationErrors = errors.filter(function (err) { @@ -8221,7 +8029,6 @@ textmode._renderErrors = function (errors) { var message = validationErrors.map(function (err) { return err.message; }).join('\n'); - if (message) { return { row: errLoc.line, @@ -8231,33 +8038,29 @@ textmode._renderErrors = function (errors) { source: 'jsoneditor' }; } - return {}; }); - this._refreshAnnotations(); - } // render errors in the errors table (if any) - + } - this.errorTable.setErrors(errors, errorLocations); // update the height of the ace editor + // render errors in the errors table (if any) + this.errorTable.setErrors(errors, errorLocations); + // update the height of the ace editor if (this.aceEditor) { var force = false; this.aceEditor.resize(force); } }; + /** * Get the selection details * @returns {{start:{row:Number, column:Number},end:{row:Number, column:Number},text:String}} */ - - textmode.getTextSelection = function () { var selection = {}; - if (this.textarea) { var selectionRange = (0,util.getInputSelection)(this.textarea); - if (this.cursorInfo && this.cursorInfo.line === selectionRange.end.row && this.cursorInfo.column === selectionRange.end.column) { // selection direction is bottom => up selection.start = selectionRange.end; @@ -8265,20 +8068,17 @@ textmode.getTextSelection = function () { } else { selection = selectionRange; } - return { start: selection.start, end: selection.end, text: this.textarea.value.substring(selectionRange.startIndex, selectionRange.endIndex) }; } - if (this.aceEditor) { var aceSelection = this.aceEditor.getSelection(); var selectedText = this.aceEditor.getSelectedText(); var range = aceSelection.getRange(); var lead = aceSelection.getSelectionLead(); - if (lead.row === range.end.row && lead.column === range.end.column) { selection = range; } else { @@ -8286,7 +8086,6 @@ textmode.getTextSelection = function () { selection.start = range.end; selection.end = range.start; } - return { start: { row: selection.start.row + 1, @@ -8300,33 +8099,29 @@ textmode.getTextSelection = function () { }; } }; + /** * Callback registration for selection change * @param {selectionCallback} callback * * @callback selectionCallback */ - - textmode.onTextSelectionChange = function (callback) { if (typeof callback === 'function') { this._selectionChangedHandler = (0,util.debounce)(callback, this.DEBOUNCE_INTERVAL); } }; + /** * Set selection on editor's text * @param {{row:Number, column:Number}} startPos selection start position * @param {{row:Number, column:Number}} endPos selected end position */ - - textmode.setTextSelection = function (startPos, endPos) { if (!startPos || !endPos) return; - if (this.textarea) { var startIndex = (0,util.getIndexForPosition)(this.textarea, startPos.row, startPos.column); var endIndex = (0,util.getIndexForPosition)(this.textarea, endPos.row, endPos.column); - if (startIndex > -1 && endIndex > -1) { if (this.textarea.setSelectionRange) { this.textarea.focus(); @@ -8339,7 +8134,6 @@ textmode.setTextSelection = function (startPos, endPos) { range.moveStart('character', startIndex); range.select(); } - var rows = (this.textarea.value.match(/\n/g) || []).length + 1; var lineHeight = this.textarea.scrollHeight / rows; var selectionScrollPos = startPos.row * lineHeight; @@ -8360,15 +8154,15 @@ textmode.setTextSelection = function (startPos, endPos) { this.aceEditor.scrollToLine(startPos.row - 1, true); } }; - function load() { try { this.format(); - } catch (err) {// in case of an error, just move on, failing formatting is not a big deal + } catch (err) { + // in case of an error, just move on, failing formatting is not a big deal } -} // define modes - +} +// define modes var textModeMixins = [{ mode: 'text', mixin: textmode, @@ -8383,7 +8177,7 @@ var textModeMixins = [{ /***/ }), -/***/ 8038: +/***/ 5633: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8392,10 +8186,10 @@ __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { - "treeModeMixins": function() { return /* binding */ treeModeMixins; } + treeModeMixins: function() { return /* binding */ treeModeMixins; } }); -;// CONCATENATED MODULE: ./src/js/autocomplete.js +;// ./src/js/autocomplete.js var defaultFilterFunction = { @@ -8411,7 +8205,6 @@ function autocomplete(config) { config.filter = config.filter || 'start'; config.trigger = config.trigger || 'keydown'; config.confirmKeys = config.confirmKeys || [39, 35, 9]; // right, end, tab - config.caseSensitive = config.caseSensitive || false; // autocomplete case sensitive var fontSize = ''; @@ -8428,29 +8221,27 @@ function autocomplete(config) { dropDown.style.visibility = 'hidden'; var spacer; var leftSide; // <-- it will contain the leftSide part of the textfield (the bit that was already autocompleted) - var createDropDownController = function createDropDownController(elem, rs) { var rows = []; var ix = 0; - var oldIndex = -1; // TODO: move this styling in JS to SCSS + var oldIndex = -1; + // TODO: move this styling in JS to SCSS var onMouseOver = function onMouseOver() { this.style.backgroundColor = '#ddd'; }; - var onMouseOut = function onMouseOut() { this.style.backgroundColor = ''; }; - var onMouseDown = function onMouseDown() { p.hide(); p.onmouseselection(this.__hint, p.rs); }; - var p = { rs: rs, hide: function hide() { - elem.style.visibility = 'hidden'; // rs.hideDropDown(); + elem.style.visibility = 'hidden'; + // rs.hideDropDown(); }, refresh: function refresh(token, array) { elem.style.visibility = 'hidden'; @@ -8459,7 +8250,6 @@ function autocomplete(config) { var vph = window.innerHeight || document.documentElement.clientHeight; var rect = elem.parentNode.getBoundingClientRect(); var distanceToTop = rect.top - 6; // heuristic give 6px - var distanceToBottom = vph - rect.bottom - 6; // distance from the browser border. rows = []; @@ -8469,8 +8259,8 @@ function autocomplete(config) { }); rows = filtered.map(function (row) { var divRow = document.createElement('div'); - divRow.className = 'item'; // divRow.style.color = config.color; - + divRow.className = 'item'; + // divRow.style.color = config.color; divRow.onmouseover = onMouseOver; divRow.onmouseout = onMouseOut; divRow.onmousedown = onMouseDown; @@ -8483,22 +8273,17 @@ function autocomplete(config) { elem.appendChild(divRow); return divRow; }); - if (rows.length === 0) { return; // nothing to show. } - if (rows.length === 1 && (token.toLowerCase() === rows[0].__hint.toLowerCase() && !config.caseSensitive || token === rows[0].__hint && config.caseSensitive)) { return; // do not show the dropDown if it has only one element which matches what we have just displayed. } - if (rows.length < 2) return; p.highlight(0); - if (distanceToTop > distanceToBottom * 3) { // Heuristic (only when the distance to the to top is 4 times more than distance to the bottom elem.style.maxHeight = distanceToTop + 'px'; // we display the dropDown on the top of the input text - elem.style.top = ''; elem.style.bottom = '100%'; } else { @@ -8506,61 +8291,45 @@ function autocomplete(config) { elem.style.bottom = ''; elem.style.maxHeight = distanceToBottom + 'px'; } - elem.style.visibility = 'visible'; }, highlight: function highlight(index) { if (oldIndex !== -1 && rows[oldIndex]) { rows[oldIndex].className = 'item'; } - rows[index].className = 'item hover'; oldIndex = index; }, move: function move(step) { // moves the selection either up or down (unless it's not possible) step is either +1 or -1. if (elem.style.visibility === 'hidden') return ''; // nothing to move if there is no dropDown. (this happens if the user hits escape and then down or up) - if (ix + step === -1 || ix + step === rows.length) return rows[ix].__hint; // NO CIRCULAR SCROLLING. - ix += step; p.highlight(ix); return rows[ix].__hint; // txtShadow.value = uRows[uIndex].__hint ; }, onmouseselection: function onmouseselection() {} // it will be overwritten. - }; return p; }; - function setEndOfContenteditable(contentEditableElement) { var range, selection; - if (document.createRange) { // Firefox, Chrome, Opera, Safari, IE 9+ range = document.createRange(); // Create a range (a range is a like the selection but invisible) - range.selectNodeContents(contentEditableElement); // Select the entire contents of the element with the range - range.collapse(false); // collapse the range to the end point. false means collapse to end rather than the start - selection = window.getSelection(); // get the selection object (allows you to change selection) - selection.removeAllRanges(); // remove any selections already made - selection.addRange(range); // make the range you have just created the visible selection } else if (document.selection) { // IE 8 and lower range = document.body.createTextRange(); // Create a range (a range is a like the selection but invisible) - range.moveToElementText(contentEditableElement); // Select the entire contents of the element with the range - range.collapse(false); // collapse the range to the end point. false means collapse to end rather than the start - range.select(); // Select the range (make it the visible selection } } - function calculateWidthForText(text) { if (spacer === undefined) { // on first call only. @@ -8578,11 +8347,9 @@ function autocomplete(config) { spacer.style.fontWeight = 'normal'; document.body.appendChild(spacer); } - spacer.textContent = text; return spacer.getBoundingClientRect().right; } - var rs = { onArrowDown: function onArrowDown() {}, // defaults to no action. @@ -8601,27 +8368,21 @@ function autocomplete(config) { // Only to allow easy access to the HTML elements to the final user (possibly for minor customizations) show: function show(element, startPos, options) { var _this = this; - this.startFrom = startPos; this.wrapper.remove(); - if (this.elementHint) { this.elementHint.remove(); this.elementHint = null; } - if (fontSize === '') { fontSize = window.getComputedStyle(element).getPropertyValue('font-size'); } - if (fontFamily === '') { fontFamily = window.getComputedStyle(element).getPropertyValue('font-family'); } - dropDown.style.marginLeft = '0'; dropDown.style.marginTop = element.getBoundingClientRect().height + 'px'; this.options = options.map(String); - if (this.element !== element) { this.element = element; this.elementStyle = { @@ -8631,7 +8392,6 @@ function autocomplete(config) { borderColor: this.element.style.borderColor }; } - this.element.style.zIndex = 3; this.element.style.position = 'relative'; this.element.style.backgroundColor = 'transparent'; @@ -8640,18 +8400,15 @@ function autocomplete(config) { this.elementHint.className = 'autocomplete hint'; this.elementHint.style.zIndex = 2; this.elementHint.style.position = 'absolute'; - this.elementHint.onfocus = function () { _this.element.focus(); }; - if (this.element.addEventListener) { this.element.removeEventListener('keydown', keyDownHandler); this.element.addEventListener('keydown', keyDownHandler, false); this.element.removeEventListener('blur', onBlurHandler); this.element.addEventListener('blur', onBlurHandler, false); } - wrapper.appendChild(this.elementHint); wrapper.appendChild(dropDown); element.parentElement.appendChild(wrapper); @@ -8665,7 +8422,6 @@ function autocomplete(config) { }, hideDropDown: function hideDropDown() { this.wrapper.remove(); - if (this.elementHint) { this.elementHint.remove(); this.elementHint = null; @@ -8679,51 +8435,44 @@ function autocomplete(config) { repaint: function repaint(element) { var text = element.innerText; text = text.replace('\n', ''); - var optionsLength = this.options.length; // breaking text in leftSide and token. + var optionsLength = this.options.length; + + // breaking text in leftSide and token. var token = text.substring(this.startFrom); leftSide = text.substring(0, this.startFrom); - for (var i = 0; i < optionsLength; i++) { var opt = this.options[i]; - if (!config.caseSensitive && opt.toLowerCase().indexOf(token.toLowerCase()) === 0 || config.caseSensitive && opt.indexOf(token) === 0) { // <-- how about upperCase vs. lowercase this.elementHint.innerText = leftSide + token + opt.substring(token.length); this.elementHint.realInnerText = leftSide + opt; break; } - } // moving the dropDown and refreshing it. - - + } + // moving the dropDown and refreshing it. dropDown.style.left = calculateWidthForText(leftSide) + 'px'; dropDownController.refresh(token, this.options); this.elementHint.style.width = calculateWidthForText(this.elementHint.innerText) + 10 + 'px'; var wasDropDownHidden = dropDown.style.visibility === 'hidden'; - if (!wasDropDownHidden) { this.elementHint.style.width = calculateWidthForText(this.elementHint.innerText) + dropDown.clientWidth + 'px'; } } }; var dropDownController = createDropDownController(dropDown, rs); - var keyDownHandler = function (e) { // console.log("Keydown:" + e.keyCode); e = e || window.event; var keyCode = e.keyCode; if (this.elementHint == null) return; - if (keyCode === 33) { return; } // page up (do nothing) - - if (keyCode === 34) { return; } // page down (do nothing); - if (keyCode === 27) { // escape rs.hideDropDown(); @@ -8732,10 +8481,8 @@ function autocomplete(config) { e.stopPropagation(); return; } - var text = this.element.innerText; text = text.replace('\n', ''); - if (config.confirmKeys.indexOf(keyCode) >= 0) { // (autocomplete triggered) if (keyCode === 9) { @@ -8743,14 +8490,12 @@ function autocomplete(config) { rs.onTab(); } } - if (this.elementHint.innerText.length > 0) { // if there is a hint if (this.element.innerText !== this.elementHint.realInnerText) { this.element.innerText = this.elementHint.realInnerText; rs.hideDropDown(); setEndOfContenteditable(this.element); - if (keyCode === 9) { rs.element.focus(); e.preventDefault(); @@ -8758,10 +8503,8 @@ function autocomplete(config) { } } } - return; } - if (keyCode === 13) { // enter (autocomplete triggered) if (this.elementHint.innerText.length === 0) { @@ -8770,61 +8513,50 @@ function autocomplete(config) { } else { var wasDropDownHidden = dropDown.style.visibility === 'hidden'; dropDownController.hide(); - if (wasDropDownHidden) { rs.hideDropDown(); rs.element.focus(); rs.onEnter(); return; } - this.element.innerText = this.elementHint.realInnerText; rs.hideDropDown(); setEndOfContenteditable(this.element); e.preventDefault(); e.stopPropagation(); } - return; } - if (keyCode === 40) { // down var token = text.substring(this.startFrom); var m = dropDownController.move(+1); - if (m === '') { rs.onArrowDown(); } - this.elementHint.innerText = leftSide + token + m.substring(token.length); this.elementHint.realInnerText = leftSide + m; e.preventDefault(); e.stopPropagation(); return; } - if (keyCode === 38) { // up var _token = text.substring(this.startFrom); - var _m = dropDownController.move(-1); - if (_m === '') { rs.onArrowUp(); } - this.elementHint.innerText = leftSide + _token + _m.substring(_token.length); this.elementHint.realInnerText = leftSide + _m; e.preventDefault(); e.stopPropagation(); } }.bind(rs); - var onBlurHandler = function onBlurHandler(e) { - rs.hideDropDown(); // console.log("Lost focus."); + rs.hideDropDown(); + // console.log("Lost focus."); }; - dropDownController.onmouseselection = function (text, rs) { rs.element.innerText = rs.elementHint.innerText = leftSide + text; rs.hideDropDown(); @@ -8833,80 +8565,74 @@ function autocomplete(config) { setEndOfContenteditable(rs.element); }, 1); }; - return rs; } // EXTERNAL MODULE: ./src/js/ContextMenu.js -var ContextMenu = __webpack_require__(897); +var ContextMenu = __webpack_require__(6545); // EXTERNAL MODULE: ./src/js/FocusTracker.js -var FocusTracker = __webpack_require__(2474); -;// CONCATENATED MODULE: ./src/js/Highlighter.js +var FocusTracker = __webpack_require__(2877); +;// ./src/js/Highlighter.js + /** * The highlighter can highlight/unhighlight a node, and * animate the visibility of a context menu. * @constructor Highlighter */ - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } +function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var Highlighter = /*#__PURE__*/function () { function Highlighter() { _classCallCheck(this, Highlighter); - this.locked = false; } + /** * Hightlight given node and its childs * @param {Node} node */ - - - _createClass(Highlighter, [{ + return _createClass(Highlighter, [{ key: "highlight", value: function highlight(node) { if (this.locked) { return; } - if (this.node !== node) { // unhighlight current node if (this.node) { this.node.setHighlight(false); - } // highlight new node - + } + // highlight new node this.node = node; this.node.setHighlight(true); - } // cancel any current timeout - + } + // cancel any current timeout this._cancelUnhighlight(); } + /** * Unhighlight currently highlighted node. * Will be done after a delay */ - }, { key: "unhighlight", value: function unhighlight() { if (this.locked) { return; } - var me = this; - if (this.node) { - this._cancelUnhighlight(); // do the unhighlighting after a small delay, to prevent re-highlighting + this._cancelUnhighlight(); + + // do the unhighlighting after a small delay, to prevent re-highlighting // the same node when moving from the drag-icon to the contextmenu-icon // or vice versa. - - this.unhighlightTimer = setTimeout(function () { me.node.setHighlight(false); me.node = undefined; @@ -8914,11 +8640,11 @@ var Highlighter = /*#__PURE__*/function () { }, 0); } } + /** * Cancel an unhighlight action (if before the timeout of the unhighlight action) * @private */ - }, { key: "_cancelUnhighlight", value: function _cancelUnhighlight() { @@ -8927,43 +8653,42 @@ var Highlighter = /*#__PURE__*/function () { this.unhighlightTimer = undefined; } } + /** * Lock highlighting or unhighlighting nodes. * methods highlight and unhighlight do not work while locked. */ - }, { key: "lock", value: function lock() { this.locked = true; } + /** * Unlock highlighting or unhighlighting nodes */ - }, { key: "unlock", value: function unlock() { this.locked = false; } }]); - - return Highlighter; }(); // EXTERNAL MODULE: ./src/js/i18n.js -var i18n = __webpack_require__(7907); +var i18n = __webpack_require__(3057); // EXTERNAL MODULE: ./src/js/jmespathQuery.js -var jmespathQuery = __webpack_require__(6056); +var jmespathQuery = __webpack_require__(359); // EXTERNAL MODULE: ./src/js/ModeSwitcher.js -var ModeSwitcher = __webpack_require__(6617); +var ModeSwitcher = __webpack_require__(1389); // EXTERNAL MODULE: ./node_modules/javascript-natural-sort/naturalSort.js -var naturalSort = __webpack_require__(233); +var naturalSort = __webpack_require__(1342); var naturalSort_default = /*#__PURE__*/__webpack_require__.n(naturalSort); // EXTERNAL MODULE: ./src/js/createAbsoluteAnchor.js -var createAbsoluteAnchor = __webpack_require__(2602); +var createAbsoluteAnchor = __webpack_require__(1925); // EXTERNAL MODULE: ./src/js/util.js -var util = __webpack_require__(9791); -;// CONCATENATED MODULE: ./src/js/appendNodeFactory.js +var util = __webpack_require__(6237); +;// ./src/js/appendNodeFactory.js + @@ -8973,7 +8698,6 @@ var util = __webpack_require__(9791); * A factory function to create an AppendNode, which depends on a Node * @param {Node} Node */ - function appendNodeFactory(Node) { /** * @constructor AppendNode @@ -8987,33 +8711,33 @@ function appendNodeFactory(Node) { this.editor = editor; this.dom = {}; } - AppendNode.prototype = new Node(); + /** * Return a table row with an append button. * @return {Element} dom TR element */ - AppendNode.prototype.getDom = function () { // TODO: implement a new solution for the append node var dom = this.dom; - if (dom.tr) { return dom.tr; } + this._updateEditability(); - this._updateEditability(); // a row for the append button - - + // a row for the append button var trAppend = document.createElement('tr'); trAppend.className = 'jsoneditor-append'; trAppend.node = this; - dom.tr = trAppend; // TODO: consistent naming + dom.tr = trAppend; + + // TODO: consistent naming if (this.editor.options.mode === 'tree') { // a cell for the dragarea column - dom.tdDrag = document.createElement('td'); // create context menu + dom.tdDrag = document.createElement('td'); + // create context menu var tdMenu = document.createElement('td'); dom.tdMenu = tdMenu; var menu = document.createElement('button'); @@ -9022,12 +8746,12 @@ function appendNodeFactory(Node) { menu.title = 'Click to open the actions menu (Ctrl+M)'; dom.menu = menu; tdMenu.appendChild(dom.menu); - } // a cell for the contents (showing text 'empty') - + } + // a cell for the contents (showing text 'empty') var tdAppend = document.createElement('td'); var domText = document.createElement('div'); - domText.appendChild(document.createTextNode('(' + (0,i18n/* translate */.Iu)('empty') + ')')); + domText.appendChild(document.createTextNode('(' + (0,i18n/* translate */.Tl)('empty') + ')')); domText.className = 'jsoneditor-readonly'; tdAppend.appendChild(domText); dom.td = tdAppend; @@ -9035,57 +8759,49 @@ function appendNodeFactory(Node) { this.updateDom(); return trAppend; }; + /** * Append node doesn't have a path * @returns {null} */ - - AppendNode.prototype.getPath = function () { return null; }; + /** * Append node doesn't have an index * @returns {null} */ - - AppendNode.prototype.getIndex = function () { return null; }; + /** * Update the HTML dom of the Node */ - - AppendNode.prototype.updateDom = function (options) { var dom = this.dom; var tdAppend = dom.td; - if (tdAppend) { - tdAppend.style.paddingLeft = this.getLevel() * 24 + 26 + 'px'; // TODO: not so nice hard coded offset + tdAppend.style.paddingLeft = this.getLevel() * 24 + 26 + 'px'; + // TODO: not so nice hard coded offset } - var domText = dom.text; - if (domText) { - domText.firstChild.nodeValue = '(' + (0,i18n/* translate */.Iu)('empty') + ' ' + this.parent.type + ')'; - } // attach or detach the contents of the append node: - // hide when the parent has childs, show when the parent has no childs - + domText.firstChild.nodeValue = '(' + (0,i18n/* translate */.Tl)('empty') + ' ' + this.parent.type + ')'; + } + // attach or detach the contents of the append node: + // hide when the parent has childs, show when the parent has no childs var trAppend = dom.tr; - if (!this.isVisible()) { if (dom.tr.firstChild) { if (dom.tdDrag) { trAppend.removeChild(dom.tdDrag); } - if (dom.tdMenu) { trAppend.removeChild(dom.tdMenu); } - trAppend.removeChild(tdAppend); } } else { @@ -9093,77 +8809,73 @@ function appendNodeFactory(Node) { if (dom.tdDrag) { trAppend.appendChild(dom.tdDrag); } - if (dom.tdMenu) { trAppend.appendChild(dom.tdMenu); } - trAppend.appendChild(tdAppend); } } }; + /** * Check whether the AppendNode is currently visible. * the AppendNode is visible when its parent has no childs (i.e. is empty). * @return {boolean} isVisible */ - - AppendNode.prototype.isVisible = function () { return this.parent.childs.length === 0; }; + /** * Show a contextmenu for this node * @param {HTMLElement} anchor The element to attach the menu to. * @param {function} [onClose] Callback method called when the context menu * is being closed. */ - - AppendNode.prototype.showContextMenu = function (anchor, onClose) { var node = this; var appendSubmenu = [{ - text: (0,i18n/* translate */.Iu)('auto'), + text: (0,i18n/* translate */.Tl)('auto'), className: 'jsoneditor-type-auto', - title: (0,i18n/* translate */.Iu)('autoType'), + title: (0,i18n/* translate */.Tl)('autoType'), click: function click() { node._onAppend('', '', 'auto'); } }, { - text: (0,i18n/* translate */.Iu)('array'), + text: (0,i18n/* translate */.Tl)('array'), className: 'jsoneditor-type-array', - title: (0,i18n/* translate */.Iu)('arrayType'), + title: (0,i18n/* translate */.Tl)('arrayType'), click: function click() { node._onAppend('', []); } }, { - text: (0,i18n/* translate */.Iu)('object'), + text: (0,i18n/* translate */.Tl)('object'), className: 'jsoneditor-type-object', - title: (0,i18n/* translate */.Iu)('objectType'), + title: (0,i18n/* translate */.Tl)('objectType'), click: function click() { node._onAppend('', {}); } }, { - text: (0,i18n/* translate */.Iu)('string'), + text: (0,i18n/* translate */.Tl)('string'), className: 'jsoneditor-type-string', - title: (0,i18n/* translate */.Iu)('stringType'), + title: (0,i18n/* translate */.Tl)('stringType'), click: function click() { node._onAppend('', '', 'string'); } }]; node.addTemplates(appendSubmenu, true); - var items = [// create append button + var items = [ + // create append button { - text: (0,i18n/* translate */.Iu)('appendText'), - title: (0,i18n/* translate */.Iu)('appendTitleAuto'), - submenuTitle: (0,i18n/* translate */.Iu)('appendSubmenuTitle'), + text: (0,i18n/* translate */.Tl)('appendText'), + title: (0,i18n/* translate */.Tl)('appendTitleAuto'), + submenuTitle: (0,i18n/* translate */.Tl)('appendSubmenuTitle'), className: 'jsoneditor-insert', click: function click() { node._onAppend('', '', 'auto'); }, submenu: appendSubmenu }]; - if (this.editor.options.onCreateMenu) { var path = node.parent.getPath(); items = this.editor.options.onCreateMenu(items, { @@ -9172,34 +8884,32 @@ function appendNodeFactory(Node) { paths: [path] }); } - - var menu = new ContextMenu/* ContextMenu */.x(items, { + var menu = new ContextMenu/* ContextMenu */.t(items, { close: onClose }); menu.show(anchor, this.editor.getPopupAnchor()); }; + /** * Handle an event. The event is caught centrally by the editor * @param {Event} event */ - - AppendNode.prototype.onEvent = function (event) { var type = event.type; var target = event.target || event.srcElement; - var dom = this.dom; // highlight the append nodes parent + var dom = this.dom; + // highlight the append nodes parent var menu = dom.menu; - if (target === menu) { if (type === 'mouseover') { this.editor.highlighter.highlight(this.parent); } else if (type === 'mouseout') { this.editor.highlighter.unhighlight(); } - } // context menu events - + } + // context menu events if (type === 'click' && target === dom.menu) { var highlighter = this.editor.highlighter; highlighter.highlight(this.parent); @@ -9211,15 +8921,14 @@ function appendNodeFactory(Node) { highlighter.unhighlight(); }); } - if (type === 'keydown') { this.onKeyDown(event); } }; - return AppendNode; } -;// CONCATENATED MODULE: ./src/js/showMoreNodeFactory.js +;// ./src/js/showMoreNodeFactory.js + @@ -9227,7 +8936,6 @@ function appendNodeFactory(Node) { * A factory function to create an ShowMoreNode, which depends on a Node * @param {function} Node */ - function showMoreNodeFactory(Node) { /** * @constructor ShowMoreNode @@ -9243,28 +8951,25 @@ function showMoreNodeFactory(Node) { this.parent = parent; this.dom = {}; } - ShowMoreNode.prototype = new Node(); + /** * Return a table row with an append button. * @return {Element} dom TR element */ - ShowMoreNode.prototype.getDom = function () { if (this.dom.tr) { return this.dom.tr; } + this._updateEditability(); - this._updateEditability(); // display "show more" - - + // display "show more" if (!this.dom.tr) { var me = this; var parent = this.parent; var showMoreButton = document.createElement('a'); - showMoreButton.appendChild(document.createTextNode((0,i18n/* translate */.Iu)('showMore'))); + showMoreButton.appendChild(document.createTextNode((0,i18n/* translate */.Tl)('showMore'))); showMoreButton.href = '#'; - showMoreButton.onclick = function (event) { // TODO: use callback instead of accessing a method of the parent parent.visibleChilds = Math.floor(parent.visibleChilds / parent.getMaxVisibleChilds() + 1) * parent.getMaxVisibleChilds(); @@ -9273,11 +8978,9 @@ function showMoreNodeFactory(Node) { event.preventDefault(); return false; }; - var showAllButton = document.createElement('a'); - showAllButton.appendChild(document.createTextNode((0,i18n/* translate */.Iu)('showAll'))); + showAllButton.appendChild(document.createTextNode((0,i18n/* translate */.Tl)('showAll'))); showAllButton.href = '#'; - showAllButton.onclick = function (event) { // TODO: use callback instead of accessing a method of the parent parent.visibleChilds = Infinity; @@ -9286,7 +8989,6 @@ function showMoreNodeFactory(Node) { event.preventDefault(); return false; }; - var moreContents = document.createElement('div'); var moreText = document.createTextNode(this._getShowMoreText()); moreContents.className = 'jsoneditor-show-more'; @@ -9298,43 +9000,38 @@ function showMoreNodeFactory(Node) { var tdContents = document.createElement('td'); tdContents.appendChild(moreContents); var moreTr = document.createElement('tr'); - if (this.editor.options.mode === 'tree') { moreTr.appendChild(document.createElement('td')); moreTr.appendChild(document.createElement('td')); } - moreTr.appendChild(tdContents); moreTr.className = 'jsoneditor-show-more'; this.dom.tr = moreTr; this.dom.moreContents = moreContents; this.dom.moreText = moreText; } - this.updateDom(); return this.dom.tr; }; + /** * Update the HTML dom of the Node */ - - ShowMoreNode.prototype.updateDom = function (options) { if (this.isVisible()) { // attach to the right child node (the first non-visible child) this.dom.tr.node = this.parent.childs[this.parent.visibleChilds]; - if (!this.dom.tr.parentNode) { var nextTr = this.parent._getNextTr(); - if (nextTr) { nextTr.parentNode.insertBefore(this.dom.tr, nextTr); } - } // update the counts in the text - + } - this.dom.moreText.nodeValue = this._getShowMoreText(); // update left margin + // update the counts in the text + this.dom.moreText.nodeValue = this._getShowMoreText(); + // update left margin this.dom.moreContents.style.marginLeft = (this.getLevel() + 1) * 24 + 'px'; } else { if (this.dom.tr && this.dom.tr.parentNode) { @@ -9342,70 +9039,62 @@ function showMoreNodeFactory(Node) { } } }; - ShowMoreNode.prototype._getShowMoreText = function () { - return (0,i18n/* translate */.Iu)('showMoreStatus', { + return (0,i18n/* translate */.Tl)('showMoreStatus', { visibleChilds: this.parent.visibleChilds, totalChilds: this.parent.childs.length }) + ' '; }; + /** * Check whether the ShowMoreNode is currently visible. * the ShowMoreNode is visible when it's parent has more childs than * the current visibleChilds * @return {boolean} isVisible */ - - ShowMoreNode.prototype.isVisible = function () { return this.parent.expanded && this.parent.childs.length > this.parent.visibleChilds; }; + /** * Handle an event. The event is caught centrally by the editor * @param {Event} event */ - - ShowMoreNode.prototype.onEvent = function (event) { var type = event.type; - if (type === 'keydown') { this.onKeyDown(event); } }; - return ShowMoreNode; } // EXTERNAL MODULE: ./src/js/showSortModal.js -var js_showSortModal = __webpack_require__(6210); +var js_showSortModal = __webpack_require__(2915); // EXTERNAL MODULE: ./src/js/showTransformModal.js + 1 modules -var js_showTransformModal = __webpack_require__(2558); +var js_showTransformModal = __webpack_require__(5609); // EXTERNAL MODULE: ./src/js/constants.js -var constants = __webpack_require__(4188); -;// CONCATENATED MODULE: ./src/js/Node.js - +var constants = __webpack_require__(660); +;// ./src/js/Node.js -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } +function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - -function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function Node_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function Node_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function Node_createClass(Constructor, protoProps, staticProps) { if (protoProps) Node_defineProperties(Constructor.prototype, protoProps); if (staticProps) Node_defineProperties(Constructor, staticProps); return Constructor; } +function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); } +function Node_typeof(o) { "@babel/helpers - typeof"; return Node_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, Node_typeof(o); } +function Node_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function Node_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, Node_toPropertyKey(o.key), o); } } +function Node_createClass(e, r, t) { return r && Node_defineProperties(e.prototype, r), t && Node_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function Node_toPropertyKey(t) { var i = Node_toPrimitive(t, "string"); return "symbol" == Node_typeof(i) ? i : i + ""; } +function Node_toPrimitive(t, r) { if ("object" != Node_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != Node_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } @@ -9428,23 +9117,18 @@ function Node_createClass(Constructor, protoProps, staticProps) { if (protoProps * {String} type Can have values 'auto', 'array', * 'object', or 'string'. */ - var Node = /*#__PURE__*/function () { function Node(editor, params) { Node_classCallCheck(this, Node); - /** @type {./treemode} */ this.editor = editor; this.dom = {}; this.expanded = false; - if (params && params instanceof Object) { this.setField(params.field, params.fieldEditable); - if ('value' in params) { this.setValue(params.value, params.type); } - if ('internalValue' in params) { this.setInternalValue(params.internalValue); } @@ -9452,23 +9136,22 @@ var Node = /*#__PURE__*/function () { this.setField(''); this.setValue(null); } - this._debouncedOnChangeValue = (0,util.debounce)(this._onChangeValue.bind(this), Node.prototype.DEBOUNCE_INTERVAL); - this._debouncedOnChangeField = (0,util.debounce)(this._onChangeField.bind(this), Node.prototype.DEBOUNCE_INTERVAL); // starting value for visible children + this._debouncedOnChangeField = (0,util.debounce)(this._onChangeField.bind(this), Node.prototype.DEBOUNCE_INTERVAL); + // starting value for visible children this.visibleChilds = this.getMaxVisibleChilds(); } - - Node_createClass(Node, [{ + return Node_createClass(Node, [{ key: "getMaxVisibleChilds", value: function getMaxVisibleChilds() { return this.editor && this.editor.options && this.editor.options.maxVisibleChilds ? this.editor.options.maxVisibleChilds : DEFAULT_MAX_VISIBLE_CHILDS; } + /** * Determine whether the field and/or value of this node are editable * @private */ - }, { key: "_updateEditability", value: function _updateEditability() { @@ -9476,22 +9159,22 @@ var Node = /*#__PURE__*/function () { field: true, value: true }; - if (this.editor) { this.editable.field = this.editor.options.mode === 'tree'; this.editable.value = this.editor.options.mode !== 'view'; - if ((this.editor.options.mode === 'tree' || this.editor.options.mode === 'form') && typeof this.editor.options.onEditable === 'function') { + var getValue = this.getValue.bind(this); var editable = this.editor.options.onEditable({ field: this.field, - value: this.value, + get value() { + return getValue(); + }, path: this.getPath() }); - if (typeof editable === 'boolean') { this.editable.field = editable; this.editable.value = editable; - } else if (_typeof(editable) === 'object' && editable !== null) { + } else if (Node_typeof(editable) === 'object' && editable !== null) { if (typeof editable.field === 'boolean') this.editable.field = editable.field; if (typeof editable.value === 'boolean') this.editable.value = editable.value; } else { @@ -9502,78 +9185,69 @@ var Node = /*#__PURE__*/function () { } } } + /** * Get the path of this node * @return {{string|number}[]} Array containing the path to this node. * Element is a number if is the index of an array, a string otherwise. */ - }, { key: "getPath", value: function getPath() { var node = this; var path = []; - while (node) { var field = node.getName(); - if (field !== undefined) { path.unshift(field); } - node = node.parent; } - return path; } + /** * Get the internal path of this node, a list with the child indexes. * @return {String[]} Array containing the internal path to this node */ - }, { key: "getInternalPath", value: function getInternalPath() { var node = this; var internalPath = []; - while (node) { if (node.parent) { internalPath.unshift(node.getIndex()); } - node = node.parent; } - return internalPath; } + /** * Get node serializable name * @returns {String|Number} */ - }, { key: "getName", value: function getName() { return !this.parent ? undefined // do not add an (optional) field name of the root node : this.parent.type !== 'array' ? this.field : this.index; } + /** * Find child node by serializable path * @param {Array} path */ - }, { key: "findNodeByPath", value: function findNodeByPath(path) { if (!path) { return; } - if (path.length === 0) { return this; } - if (path.length && this.childs && this.childs.length) { for (var i = 0; i < this.childs.length; ++i) { if ('' + path[0] === '' + this.childs[i].getName()) { @@ -9582,36 +9256,33 @@ var Node = /*#__PURE__*/function () { } } } + /** * Find child node by an internal path: the indexes of the childs nodes * @param {Array} internalPath * @return {Node | undefined} Returns the node if the path exists. * Returns undefined otherwise. */ - }, { key: "findNodeByInternalPath", value: function findNodeByInternalPath(internalPath) { if (!internalPath) { return undefined; } - var node = this; - for (var i = 0; i < internalPath.length && node; i++) { var childIndex = internalPath[i]; node = node.childs[childIndex]; } - return node; } + /** * @typedef {{value: String|Object|Number|Boolean, path: Array.}} SerializableNode * * Returns serializable representation for the node * @return {SerializableNode} */ - }, { key: "serialize", value: function serialize() { @@ -9620,64 +9291,57 @@ var Node = /*#__PURE__*/function () { path: this.getPath() }; } + /** * Find a Node from a JSON path like '.items[3].name' * @param {string} jsonPath * @return {Node | null} Returns the Node when found, returns null if not found */ - }, { key: "findNode", value: function findNode(jsonPath) { var path = (0,util.parsePath)(jsonPath); var node = this; - var _loop = function _loop() { var prop = path.shift(); - if (typeof prop === 'number') { if (node.type !== 'array') { throw new Error('Cannot get child node at index ' + prop + ': node is no array'); } - node = node.childs[prop]; } else { // string if (node.type !== 'object') { throw new Error('Cannot get child node ' + prop + ': node is no object'); } - node = node.childs.filter(function (child) { return child.field === prop; })[0]; } }; - while (node && path.length > 0) { _loop(); } - return node; } + /** * Find all parents of this node. The parents are ordered from root node towards * the original node. * @return {Array.} */ - }, { key: "findParents", value: function findParents() { var parents = []; var parent = this.parent; - while (parent) { parents.unshift(parent); parent = parent.parent; } - return parents; } + /** * * @param {{dataPath: string, keyword: string, message: string, params: Object, schemaPath: string} | null} error @@ -9686,87 +9350,71 @@ var Node = /*#__PURE__*/function () { * can be provided. If provided, clicking the error * icon will set focus to the invalid child node. */ - }, { key: "setError", value: function setError(error, child) { this.error = error; this.errorChild = child; - if (this.dom && this.dom.tr) { this.updateError(); } } + /** * Render the error */ - }, { key: "updateError", value: function updateError() { var _this = this; - var error = this.fieldError || this.valueError || this.error; var tdError = this.dom.tdError; - if (error && this.dom && this.dom.tr) { (0,util.addClassName)(this.dom.tr, 'jsoneditor-validation-error'); - if (!tdError) { tdError = document.createElement('td'); this.dom.tdError = tdError; this.dom.tdValue.parentNode.appendChild(tdError); } - var button = document.createElement('button'); button.type = 'button'; button.className = 'jsoneditor-button jsoneditor-schema-error'; - var destroy = function destroy() { if (_this.dom.popupAnchor) { _this.dom.popupAnchor.destroy(); // this will trigger the onDestroy callback - } }; - var onDestroy = function onDestroy() { delete _this.dom.popupAnchor; }; - var createPopup = function createPopup(destroyOnMouseOut) { var frame = _this.editor.frame; - _this.dom.popupAnchor = (0,createAbsoluteAnchor/* createAbsoluteAnchor */.w)(button, _this.editor.getPopupAnchor(), onDestroy, destroyOnMouseOut); + _this.dom.popupAnchor = (0,createAbsoluteAnchor/* createAbsoluteAnchor */.p)(button, _this.editor.getPopupAnchor(), onDestroy, destroyOnMouseOut); var popupWidth = 200; // must correspond to what's configured in the CSS - var buttonRect = button.getBoundingClientRect(); var frameRect = frame.getBoundingClientRect(); var position = frameRect.width - buttonRect.x > popupWidth / 2 + 20 ? 'jsoneditor-above' : 'jsoneditor-left'; var popover = document.createElement('div'); popover.className = 'jsoneditor-popover ' + position; popover.appendChild(document.createTextNode(error.message)); - _this.dom.popupAnchor.appendChild(popover); }; - button.onmouseover = function () { if (!_this.dom.popupAnchor) { createPopup(true); } }; - button.onfocus = function () { destroy(); createPopup(false); }; - button.onblur = function () { destroy(); - }; // when clicking the error icon, expand all nodes towards the invalid - // child node, and set focus to the child node - + }; + // when clicking the error icon, expand all nodes towards the invalid + // child node, and set focus to the child node var child = this.errorChild; - if (child) { button.onclick = function showInvalidNode() { child.findParents().forEach(function (parent) { @@ -9776,31 +9424,29 @@ var Node = /*#__PURE__*/function () { child.focus(); }); }; - } // apply the error message to the node - + } + // apply the error message to the node while (tdError.firstChild) { tdError.removeChild(tdError.firstChild); } - tdError.appendChild(button); } else { if (this.dom.tr) { (0,util.removeClassName)(this.dom.tr, 'jsoneditor-validation-error'); } - if (tdError) { this.dom.tdError.parentNode.removeChild(this.dom.tdError); delete this.dom.tdError; } } } + /** * Get the index of this node: the index in the list of childs where this * node is part of * @return {number | null} Returns the index, or null if this is the root node */ - }, { key: "getIndex", value: function getIndex() { @@ -9811,22 +9457,22 @@ var Node = /*#__PURE__*/function () { return -1; } } + /** * Set parent node * @param {Node} parent */ - }, { key: "setParent", value: function setParent(parent) { this.parent = parent; } + /** * Set field * @param {String} field * @param {boolean} [fieldEditable] */ - }, { key: "setField", value: function setField(field, fieldEditable) { @@ -9834,27 +9480,26 @@ var Node = /*#__PURE__*/function () { this.previousField = field; this.fieldEditable = fieldEditable === true; } + /** * Get field * @return {String} */ - }, { key: "getField", value: function getField() { if (this.field === undefined) { this._getDomField(); } - return this.field; } + /** * Set value. Value is a JSON structure or an element String, Boolean, etc. * @param {*} value * @param {String} [type] Specify the type of the value. Can be 'auto', * 'array', 'object', or 'string' */ - }, { key: "setValue", value: function setValue(value, type) { @@ -9862,8 +9507,9 @@ var Node = /*#__PURE__*/function () { var i, j; var updateDom = false; var previousChilds = this.childs; - this.type = this._getType(value); // check if type corresponds with the provided type + this.type = this._getType(value); + // check if type corresponds with the provided type if (type && type !== this.type) { if (type === 'string' && this.type === 'auto') { this.type = type; @@ -9871,16 +9517,13 @@ var Node = /*#__PURE__*/function () { throw new Error('Type mismatch: ' + 'cannot cast value of type "' + this.type + ' to the specified type "' + type + '"'); } } - if (this.type === 'array') { // array if (!this.childs) { this.childs = []; } - for (i = 0; i < value.length; i++) { childValue = value[i]; - if (childValue !== undefined && !(childValue instanceof Function)) { if (i < this.childs.length) { // reuse existing child, keep its state @@ -9897,10 +9540,10 @@ var Node = /*#__PURE__*/function () { this.appendChild(child, visible, updateDom); } } - } // cleanup redundant childs - // we loop backward to prevent issues with shifting index numbers - + } + // cleanup redundant childs + // we loop backward to prevent issues with shifting index numbers for (j = this.childs.length; j >= value.length; j--) { this.removeChild(this.childs[j], updateDom); } @@ -9908,29 +9551,24 @@ var Node = /*#__PURE__*/function () { // object if (!this.childs) { this.childs = []; - } // cleanup redundant childs - // we loop backward to prevent issues with shifting index numbers - + } + // cleanup redundant childs + // we loop backward to prevent issues with shifting index numbers for (j = this.childs.length - 1; j >= 0; j--) { if (!Node_hasOwnProperty(value, this.childs[j].field)) { this.removeChild(this.childs[j], updateDom); } } - i = 0; - for (var childField in value) { if (Node_hasOwnProperty(value, childField)) { childValue = value[childField]; - if (childValue !== undefined && !(childValue instanceof Function)) { var _child = this.findChildByProperty(childField); - if (_child) { // reuse existing child, keep its state _child.setField(childField, true); - _child.setValue(childValue); } else { // create a new child, append to the end @@ -9938,19 +9576,16 @@ var Node = /*#__PURE__*/function () { field: childField, value: childValue }); - var _visible = i < this.getMaxVisibleChilds(); - this.appendChild(newChild, _visible, updateDom); } } - i++; } } + this.value = ''; - this.value = ''; // sort object keys during initialization. Must not trigger an onChange action - + // sort object keys during initialization. Must not trigger an onChange action if (this.editor.options.sortObjectKeys === true) { var triggerAction = false; this.sort([], 'asc', triggerAction); @@ -9963,25 +9598,24 @@ var Node = /*#__PURE__*/function () { delete this.expanded; delete this.childs; this.value = value; - } // recreate the DOM if switching from an object/array to auto/string or vice versa - // needed to recreated the expand button for example - + } + // recreate the DOM if switching from an object/array to auto/string or vice versa + // needed to recreated the expand button for example if (Array.isArray(previousChilds) !== Array.isArray(this.childs)) { this.recreateDom(); } - this.updateDom({ updateIndexes: true }); this.previousValue = this.value; // used only to check for changes in DOM vs JS model } + /** * Set internal value * @param {*} internalValue Internal value structure keeping type, * order and duplicates in objects */ - }, { key: "setInternalValue", value: function setInternalValue(internalValue) { @@ -9990,16 +9624,13 @@ var Node = /*#__PURE__*/function () { var notUpdateDom = false; var previousChilds = this.childs; this.type = internalValue.type; - if (internalValue.type === 'array') { // array if (!this.childs) { this.childs = []; } - for (i = 0; i < internalValue.childs.length; i++) { childValue = internalValue.childs[i]; - if (childValue !== undefined && !(childValue instanceof Function)) { if (i < this.childs.length) { // reuse existing child, keep its state @@ -10016,10 +9647,10 @@ var Node = /*#__PURE__*/function () { this.appendChild(child, visible, notUpdateDom); } } - } // cleanup redundant childs - // we loop backward to prevent issues with shifting index numbers - + } + // cleanup redundant childs + // we loop backward to prevent issues with shifting index numbers for (j = this.childs.length; j >= internalValue.childs.length; j--) { this.removeChild(this.childs[j], notUpdateDom); } @@ -10028,10 +9659,8 @@ var Node = /*#__PURE__*/function () { if (!this.childs) { this.childs = []; } - for (i = 0; i < internalValue.childs.length; i++) { childValue = internalValue.childs[i]; - if (childValue !== undefined && !(childValue instanceof Function)) { if (i < this.childs.length) { // reuse existing child, keep its state @@ -10049,10 +9678,10 @@ var Node = /*#__PURE__*/function () { this.appendChild(child, visible, notUpdateDom); } } - } // cleanup redundant childs - // we loop backward to prevent issues with shifting index numbers - + } + // cleanup redundant childs + // we loop backward to prevent issues with shifting index numbers for (j = this.childs.length; j >= internalValue.childs.length; j--) { this.removeChild(this.childs[j], notUpdateDom); } @@ -10064,41 +9693,38 @@ var Node = /*#__PURE__*/function () { delete this.expanded; delete this.childs; this.value = internalValue.value; - } // recreate the DOM if switching from an object/array to auto/string or vice versa - // needed to recreated the expand button for example - + } + // recreate the DOM if switching from an object/array to auto/string or vice versa + // needed to recreated the expand button for example if (Array.isArray(previousChilds) !== Array.isArray(this.childs)) { this.recreateDom(); } - this.updateDom({ updateIndexes: true }); this.previousValue = this.value; // used only to check for changes in DOM vs JS model } + /** * Remove the DOM of this node and it's childs and recreate it again */ - }, { key: "recreateDom", value: function recreateDom() { if (this.dom && this.dom.tr && this.dom.tr.parentNode) { var domAnchor = this._detachFromDom(); - this.clearDom(); - this._attachToDom(domAnchor); } else { this.clearDom(); } } + /** * Get value. Value is a JSON structure * @return {*} value */ - }, { key: "getValue", value: function getValue() { @@ -10118,15 +9744,14 @@ var Node = /*#__PURE__*/function () { if (this.value === undefined) { this._getDomValue(); } - return this.value; } } + /** * Get internal value, a structure which maintains ordering and duplicates in objects * @return {*} value */ - }, { key: "getInternalValue", value: function getInternalValue() { @@ -10151,28 +9776,27 @@ var Node = /*#__PURE__*/function () { if (this.value === undefined) { this._getDomValue(); } - return { type: this.type, value: this.value }; } } + /** * Get the nesting level of this node * @return {Number} level */ - }, { key: "getLevel", value: function getLevel() { return this.parent ? this.parent.getLevel() + 1 : 0; } + /** * Get jsonpath of the current node * @return {Node[]} Returns an array with nodes */ - }, { key: "getNodePath", value: function getNodePath() { @@ -10180,13 +9804,13 @@ var Node = /*#__PURE__*/function () { path.push(this); return path; } + /** * Create a clone of a node * The complete state of a clone is copied, including whether it is expanded or * not. The DOM elements are not cloned. * @return {Node} clone */ - }, { key: "clone", value: function clone() { @@ -10201,7 +9825,6 @@ var Node = /*#__PURE__*/function () { clone.previousValue = this.previousValue; clone.expanded = this.expanded; clone.visibleChilds = this.visibleChilds; - if (this.childs) { // an object or array var cloneChilds = []; @@ -10215,131 +9838,116 @@ var Node = /*#__PURE__*/function () { // a value clone.childs = undefined; } - return clone; } + /** * Expand this node and optionally its childs. * @param {boolean} [recurse] Optional recursion, true by default. When * true, all childs will be expanded recursively */ - }, { key: "expand", value: function expand(recurse) { if (!this.childs) { return; - } // set this node expanded - + } + // set this node expanded this.expanded = true; - if (this.dom.expand) { this.dom.expand.className = 'jsoneditor-button jsoneditor-expanded'; } - this.showChilds(); - if (recurse !== false) { this.childs.forEach(function (child) { child.expand(recurse); }); - } // update the css classes of table row, and fire onClassName etc - + } + // update the css classes of table row, and fire onClassName etc this.updateDom({ recurse: false }); } + /** * Collapse this node and optionally its childs. * @param {boolean} [recurse] Optional recursion, true by default. When * true, all childs will be collapsed recursively */ - }, { key: "collapse", value: function collapse(recurse) { if (!this.childs) { return; } + this.hideChilds(); - this.hideChilds(); // collapse childs in case of recurse - + // collapse childs in case of recurse if (recurse !== false) { this.childs.forEach(function (child) { child.collapse(recurse); }); - } // make this node collapsed - + } + // make this node collapsed if (this.dom.expand) { this.dom.expand.className = 'jsoneditor-button jsoneditor-collapsed'; } + this.expanded = false; - this.expanded = false; // update the css classes of table row, and fire onClassName etc - + // update the css classes of table row, and fire onClassName etc this.updateDom({ recurse: false }); } + /** * Recursively show all childs when they are expanded */ - }, { key: "showChilds", value: function showChilds() { var childs = this.childs; - if (!childs) { return; } - if (!this.expanded) { return; } - var tr = this.dom.tr; var nextTr; var table = tr ? tr.parentNode : undefined; - if (table) { // show row with append button var append = this.getAppendDom(); - if (!append.parentNode) { nextTr = tr.nextSibling; - if (nextTr) { table.insertBefore(append, nextTr); } else { table.appendChild(append); } - } // show childs - + } + // show childs var iMax = Math.min(this.childs.length, this.visibleChilds); nextTr = this._getNextTr(); - for (var i = 0; i < iMax; i++) { var child = this.childs[i]; - if (!child.getDom().parentNode) { table.insertBefore(child.getDom(), nextTr); } - child.showChilds(); - } // show "show more childs" if limited - + } + // show "show more childs" if limited var showMore = this.getShowMoreDom(); nextTr = this._getNextTr(); - if (!showMore.parentNode) { table.insertBefore(showMore, nextTr); } - this.showMore.updateDom(); // to update the counter } } @@ -10349,86 +9957,82 @@ var Node = /*#__PURE__*/function () { if (this.showMore && this.showMore.getDom().parentNode) { return this.showMore.getDom(); } - if (this.append && this.append.getDom().parentNode) { return this.append.getDom(); } } + /** * Hide the node with all its childs * @param {{resetVisibleChilds: boolean}} [options] */ - }, { key: "hide", value: function hide(options) { var tr = this.dom.tr; var table = tr ? tr.parentNode : undefined; - if (table) { table.removeChild(tr); } - if (this.dom.popupAnchor) { this.dom.popupAnchor.destroy(); } - this.hideChilds(options); } + /** * Recursively hide all childs * @param {{resetVisibleChilds: boolean}} [options] */ - }, { key: "hideChilds", value: function hideChilds(options) { var childs = this.childs; - if (!childs) { return; } - if (!this.expanded) { return; - } // hide append row - + } + // hide append row var append = this.getAppendDom(); - if (append.parentNode) { append.parentNode.removeChild(append); - } // hide childs - + } + // hide childs this.childs.forEach(function (child) { child.hide(); - }); // hide "show more" row + }); + // hide "show more" row var showMore = this.getShowMoreDom(); - if (showMore.parentNode) { showMore.parentNode.removeChild(showMore); - } // reset max visible childs - + } + // reset max visible childs if (!options || options.resetVisibleChilds) { this.visibleChilds = this.getMaxVisibleChilds(); } } + /** * set custom css classes on a node */ - }, { key: "_updateCssClassName", value: function _updateCssClassName() { if (this.dom.field && this.editor && this.editor.options && typeof this.editor.options.onClassName === 'function' && this.dom.tree) { (0,util.removeAllClassNames)(this.dom.tree); + var getValue = this.getValue.bind(this); var addClasses = this.editor.options.onClassName({ path: this.getPath(), field: this.field, - value: this.value + get value() { + return getValue(); + } }) || ''; (0,util.addClassName)(this.dom.tree, 'jsoneditor-values ' + addClasses); } @@ -10437,30 +10041,28 @@ var Node = /*#__PURE__*/function () { key: "recursivelyUpdateCssClassesOnNodes", value: function recursivelyUpdateCssClassesOnNodes() { this._updateCssClassName(); - if (Array.isArray(this.childs)) { for (var i = 0; i < this.childs.length; i++) { this.childs[i].recursivelyUpdateCssClassesOnNodes(); } } } + /** * Goes through the path from the node to the root and ensures that it is expanded */ - }, { key: "expandTo", value: function expandTo() { var currentNode = this.parent; - while (currentNode) { if (!currentNode.expanded) { currentNode.expand(); } - currentNode = currentNode.parent; } } + /** * Add a new child to the node. * Only applicable when Node value is of type array or object @@ -10470,7 +10072,6 @@ var Node = /*#__PURE__*/function () { * node and appended node will be updated * (child count, indexes) */ - }, { key: "appendChild", value: function appendChild(node, visible, updateDom) { @@ -10478,34 +10079,25 @@ var Node = /*#__PURE__*/function () { // adjust the link to the parent node.setParent(this); node.fieldEditable = this.type === 'object'; - if (this.type === 'array') { node.index = this.childs.length; } - if (this.type === 'object' && node.field === undefined) { // initialize field value if needed node.setField(''); } - this.childs.push(node); - if (this.expanded && visible !== false) { // insert into the DOM, before the appendRow var newTr = node.getDom(); - var nextTr = this._getNextTr(); - var table = nextTr ? nextTr.parentNode : undefined; - if (nextTr && table) { table.insertBefore(newTr, nextTr); } - node.showChilds(); this.visibleChilds++; } - if (updateDom !== false) { this.updateDom({ updateIndexes: true @@ -10516,6 +10108,7 @@ var Node = /*#__PURE__*/function () { } } } + /** * Move a node from its current parent to this node * Only applicable when Node value is of type array or object @@ -10525,7 +10118,6 @@ var Node = /*#__PURE__*/function () { * node and appended node will be updated * (child count, indexes) */ - }, { key: "moveBefore", value: function moveBefore(node, beforeNode, updateDom) { @@ -10534,17 +10126,14 @@ var Node = /*#__PURE__*/function () { // when removing the node var tbody = this.dom.tr ? this.dom.tr.parentNode : undefined; var trTemp; - if (tbody) { trTemp = document.createElement('tr'); trTemp.style.height = tbody.clientHeight + 'px'; tbody.appendChild(trTemp); } - if (node.parent) { node.parent.removeChild(node); } - if (beforeNode instanceof AppendNode || !beforeNode) { // the this.childs.length + 1 is to reckon with the node that we're about to add if (this.childs.length + 1 > this.visibleChilds) { @@ -10557,12 +10146,12 @@ var Node = /*#__PURE__*/function () { } else { this.insertBefore(node, beforeNode, updateDom); } - if (tbody && trTemp) { tbody.removeChild(trTemp); } } } + /** * Insert a new child before a given node * Only applicable when Node value is of type array or object @@ -10572,19 +10161,19 @@ var Node = /*#__PURE__*/function () { * node and appended node will be updated * (child count, indexes) */ - }, { key: "insertBefore", value: function insertBefore(node, beforeNode, updateDom) { if (this._hasChilds()) { - this.visibleChilds++; // initialize field value if needed + this.visibleChilds++; + // initialize field value if needed if (this.type === 'object' && node.field === undefined) { node.setField(''); } - if (beforeNode === this.append) { // append to the child nodes + // adjust the link to the parent node.setParent(this); node.fieldEditable = this.type === 'object'; @@ -10592,31 +10181,26 @@ var Node = /*#__PURE__*/function () { } else { // insert before a child node var index = this.childs.indexOf(beforeNode); - if (index === -1) { throw new Error('Node not found'); - } // adjust the link to the parent - + } + // adjust the link to the parent node.setParent(this); node.fieldEditable = this.type === 'object'; this.childs.splice(index, 0, node); } - if (this.expanded) { // insert into the DOM var newTr = node.getDom(); var nextTr = beforeNode.getDom(); var table = nextTr ? nextTr.parentNode : undefined; - if (nextTr && table) { table.insertBefore(newTr, nextTr); } - node.showChilds(); this.showChilds(); } - if (updateDom !== false) { this.updateDom({ updateIndexes: true @@ -10627,20 +10211,19 @@ var Node = /*#__PURE__*/function () { } } } + /** * Insert a new child before a given node * Only applicable when Node value is of type array or object * @param {Node} node * @param {Node} afterNode */ - }, { key: "insertAfter", value: function insertAfter(node, afterNode) { if (this._hasChilds()) { var index = this.childs.indexOf(afterNode); var beforeNode = this.childs[index + 1]; - if (beforeNode) { this.insertBefore(node, beforeNode); } else { @@ -10648,6 +10231,7 @@ var Node = /*#__PURE__*/function () { } } } + /** * Search in this node * Searches are case insensitive. @@ -10656,39 +10240,39 @@ var Node = /*#__PURE__*/function () { * used to count and limit the results whilst iterating * @return {Node[]} results Array with nodes containing the search text */ - }, { key: "search", value: function search(text, results) { if (!Array.isArray(results)) { results = []; } - var index; - var search = text ? text.toLowerCase() : undefined; // delete old search data + var search = text ? text.toLowerCase() : undefined; + // delete old search data delete this.searchField; - delete this.searchValue; // search in field + delete this.searchValue; + // search in field if (this.field !== undefined && results.length <= this.MAX_SEARCH_RESULTS) { var field = String(this.field).toLowerCase(); index = field.indexOf(search); - if (index !== -1) { this.searchField = true; results.push({ node: this, elem: 'field' }); - } // update dom - + } + // update dom this._updateDomField(); - } // search in value - + } + // search in value if (this._hasChilds()) { // array, object + // search the nodes childs if (this.childs) { this.childs.forEach(function (child) { @@ -10700,75 +10284,68 @@ var Node = /*#__PURE__*/function () { if (this.value !== undefined && results.length <= this.MAX_SEARCH_RESULTS) { var value = String(this.value).toLowerCase(); index = value.indexOf(search); - if (index !== -1) { this.searchValue = true; results.push({ node: this, elem: 'value' }); - } // update dom - + } + // update dom this._updateDomValue(); } } - return results; } + /** * Move the scroll position such that this node is in the visible area. * The node will not get the focus * @param {function(boolean)} [callback] */ - }, { key: "scrollTo", value: function scrollTo(callback) { this.expandPathToNode(); - if (this.dom.tr && this.dom.tr.parentNode) { this.editor.scrollTo(this.dom.tr.offsetTop, callback); } } + /** * if the node is not visible, expand its parents */ - }, { key: "expandPathToNode", value: function expandPathToNode() { var node = this; var recurse = false; - while (node && node.parent) { // expand visible childs of the parent if needed var index = node.parent.type === 'array' ? node.index : node.parent.childs.indexOf(node); - while (node.parent.visibleChilds < index + 1) { node.parent.visibleChilds += this.getMaxVisibleChilds(); - } // expand the parent itself - + } + // expand the parent itself node.parent.expand(recurse); node = node.parent; } } + /** * Set focus to this node * @param {String} [elementName] The field name of the element to get the * focus available values: 'drag', 'menu', * 'expand', 'field', 'value' (default) */ - }, { key: "focus", value: function focus(elementName) { Node.focusElement = elementName; - if (this.dom.tr && this.dom.tr.parentNode) { var dom = this.dom; - switch (elementName) { case 'drag': if (dom.drag) { @@ -10776,13 +10353,10 @@ var Node = /*#__PURE__*/function () { } else { dom.menu.focus(); } - break; - case 'menu': dom.menu.focus(); break; - case 'expand': if (this._hasChilds()) { dom.expand.focus(); @@ -10795,9 +10369,7 @@ var Node = /*#__PURE__*/function () { } else { dom.menu.focus(); } - break; - case 'field': if (dom.field && this.fieldEditable) { dom.field.focus(); @@ -10810,9 +10382,7 @@ var Node = /*#__PURE__*/function () { } else { dom.menu.focus(); } - break; - case 'value': default: if (dom.select) { @@ -10829,27 +10399,24 @@ var Node = /*#__PURE__*/function () { } else { dom.menu.focus(); } - break; } } } + /** * Check if given node is a child. The method will check recursively to find * this node. * @param {Node} node * @return {boolean} containsNode */ - }, { key: "containsNode", value: function containsNode(node) { if (this === node) { return true; } - var childs = this.childs; - if (childs) { // TODO: use the js5 Array.some() here? for (var i = 0, iMax = childs.length; i < iMax; i++) { @@ -10858,9 +10425,9 @@ var Node = /*#__PURE__*/function () { } } } - return false; } + /** * Remove a child from the node. * Only applicable when Node value is of type array or object @@ -10870,37 +10437,33 @@ var Node = /*#__PURE__*/function () { * @return {Node | undefined} node The removed node on success, * else undefined */ - }, { key: "removeChild", value: function removeChild(node, updateDom) { if (this.childs) { var index = this.childs.indexOf(node); - if (index !== -1) { if (index < this.visibleChilds && this.expanded) { this.visibleChilds--; } + node.hide(); - node.hide(); // delete old search results - + // delete old search results delete node.searchField; delete node.searchValue; var removedNode = this.childs.splice(index, 1)[0]; removedNode.parent = null; - if (updateDom !== false) { this.updateDom({ updateIndexes: true }); } - return removedNode; } } - return undefined; } + /** * Remove a child node node from this node * This method is equal to Node.removeChild, except that _remove fire an @@ -10908,54 +10471,50 @@ var Node = /*#__PURE__*/function () { * @param {Node} node * @private */ - }, { key: "_remove", value: function _remove(node) { this.removeChild(node); } + /** * Change the type of the value of this Node * @param {String} newType */ - }, { key: "changeType", value: function changeType(newType) { var oldType = this.type; - if (oldType === newType) { // type is not changed return; } - if ((newType === 'string' || newType === 'auto') && (oldType === 'string' || oldType === 'auto')) { // this is an easy change this.type = newType; } else { // change from array to object, or from string/auto to object/array - var domAnchor = this._detachFromDom(); // delete the old DOM - + var domAnchor = this._detachFromDom(); - this.clearDom(); // adjust the field and the value + // delete the old DOM + this.clearDom(); - this.type = newType; // adjust childs + // adjust the field and the value + this.type = newType; + // adjust childs if (newType === 'object') { if (!this.childs) { this.childs = []; } - this.childs.forEach(function (child) { child.clearDom(); delete child.index; child.fieldEditable = true; - if (child.field === undefined) { child.field = ''; } }); - if (oldType === 'string' || oldType === 'auto') { this.expanded = true; } @@ -10963,23 +10522,19 @@ var Node = /*#__PURE__*/function () { if (!this.childs) { this.childs = []; } - this.childs.forEach(function (child, index) { child.clearDom(); child.fieldEditable = false; child.index = index; }); - if (oldType === 'string' || oldType === 'auto') { this.expanded = true; } } else { this.expanded = false; } - this._attachToDom(domAnchor); } - if (newType === 'auto' || newType === 'string') { // cast value to the correct type if (newType === 'string') { @@ -10987,53 +10542,45 @@ var Node = /*#__PURE__*/function () { } else { this.value = (0,util.parseString)(String(this.value)); } - this.focus(); } - this.updateDom({ updateIndexes: true }); } + /** * Test whether the JSON contents of this node are deep equal to provided JSON object. * @param {*} json */ - }, { key: "deepEqual", value: function deepEqual(json) { var i; - if (this.type === 'array') { if (!Array.isArray(json)) { return false; } - if (this.childs.length !== json.length) { return false; } - for (i = 0; i < this.childs.length; i++) { if (!this.childs[i].deepEqual(json[i])) { return false; } } } else if (this.type === 'object') { - if (_typeof(json) !== 'object' || !json) { + if (Node_typeof(json) !== 'object' || !json) { return false; - } // we reckon with the order of the properties too. - + } + // we reckon with the order of the properties too. var props = Object.keys(json); - if (this.childs.length !== props.length) { return false; } - for (i = 0; i < props.length; i++) { var child = this.childs[i]; - if (child.field !== props[i] || !child.deepEqual(json[child.field])) { return false; } @@ -11043,59 +10590,51 @@ var Node = /*#__PURE__*/function () { return false; } } - return true; } + /** * Retrieve value from DOM * @private */ - }, { key: "_getDomValue", value: function _getDomValue() { this._clearValueError(); - if (this.dom.value && this.type !== 'array' && this.type !== 'object') { this.valueInnerText = (0,util.getInnerText)(this.dom.value); - if (this.valueInnerText === '' && this.dom.value.innerHTML !== '') { // When clearing the contents, often a
remains, messing up the // styling of the empty text box. Therefore we remove the
this.dom.value.textContent = ''; } } - if (this.valueInnerText !== undefined) { try { // retrieve the value var value; - if (this.type === 'string') { value = this._unescapeHTML(this.valueInnerText); } else { var str = this._unescapeHTML(this.valueInnerText); - value = (0,util.parseString)(str); } - if (value !== this.value) { this.value = value; - this._debouncedOnChangeValue(); } } catch (err) { // keep the previous value - this._setValueError((0,i18n/* translate */.Iu)('cannotParseValueError')); + this._setValueError((0,i18n/* translate */.Tl)('cannotParseValueError')); } } } + /** * Show a local error in case of invalid value * @param {string} message * @private */ - }, { key: "_setValueError", value: function _setValueError(message) { @@ -11112,12 +10651,12 @@ var Node = /*#__PURE__*/function () { this.updateError(); } } + /** * Show a local error in case of invalid or duplicate field * @param {string} message * @private */ - }, { key: "_setFieldError", value: function _setFieldError(message) { @@ -11134,32 +10673,28 @@ var Node = /*#__PURE__*/function () { this.updateError(); } } + /** * Handle a changed value * @private */ - }, { key: "_onChangeValue", value: function _onChangeValue() { // get current selection, then override the range such that we can select // the added/removed text on undo/redo var oldSelection = this.editor.getDomSelection(); - if (oldSelection.range) { var undoDiff = (0,util.textDiff)(String(this.value), String(this.previousValue)); oldSelection.range.startOffset = undoDiff.start; oldSelection.range.endOffset = undoDiff.end; } - var newSelection = this.editor.getDomSelection(); - if (newSelection.range) { var redoDiff = (0,util.textDiff)(String(this.previousValue), String(this.value)); newSelection.range.startOffset = redoDiff.start; newSelection.range.endOffset = redoDiff.end; } - this.editor._onAction('editValue', { path: this.getInternalPath(), oldValue: this.previousValue, @@ -11167,14 +10702,13 @@ var Node = /*#__PURE__*/function () { oldSelection: oldSelection, newSelection: newSelection }); - this.previousValue = this.value; } + /** * Handle a changed field * @private */ - }, { key: "_onChangeField", value: function _onChangeField() { @@ -11182,21 +10716,17 @@ var Node = /*#__PURE__*/function () { // the added/removed text on undo/redo var oldSelection = this.editor.getDomSelection(); var previous = this.previousField || ''; - if (oldSelection.range) { var undoDiff = (0,util.textDiff)(this.field, previous); oldSelection.range.startOffset = undoDiff.start; oldSelection.range.endOffset = undoDiff.end; } - var newSelection = this.editor.getDomSelection(); - if (newSelection.range) { var redoDiff = (0,util.textDiff)(previous, this.field); newSelection.range.startOffset = redoDiff.start; newSelection.range.endOffset = redoDiff.end; } - this.editor._onAction('editField', { parentPath: this.parent.getInternalPath(), index: this.getIndex(), @@ -11205,9 +10735,9 @@ var Node = /*#__PURE__*/function () { oldSelection: oldSelection, newSelection: newSelection }); - this.previousField = this.field; } + /** * Update dom value: * - the text color of the value, depending on the type of the value @@ -11215,52 +10745,48 @@ var Node = /*#__PURE__*/function () { * - background color in case it is empty * @private */ - }, { key: "_updateDomValue", value: function _updateDomValue() { var domValue = this.dom.value; - if (domValue) { - var classNames = ['jsoneditor-value']; // set text color depending on value type + var classNames = ['jsoneditor-value']; + // set text color depending on value type var value = this.value; var valueType = this.type === 'auto' ? (0,util.getType)(value) : this.type; var valueIsUrl = valueType === 'string' && (0,util.isUrl)(value); classNames.push('jsoneditor-' + valueType); - if (valueIsUrl) { classNames.push('jsoneditor-url'); - } // visual styling when empty - + } + // visual styling when empty var isEmpty = String(this.value) === '' && this.type !== 'array' && this.type !== 'object'; - if (isEmpty) { classNames.push('jsoneditor-empty'); - } // highlight when there is a search result - + } + // highlight when there is a search result if (this.searchValueActive) { classNames.push('jsoneditor-highlight-active'); } - if (this.searchValue) { classNames.push('jsoneditor-highlight'); } + domValue.className = classNames.join(' '); - domValue.className = classNames.join(' '); // update title - + // update title if (valueType === 'array' || valueType === 'object') { var count = this.childs ? this.childs.length : 0; domValue.title = this.type + ' containing ' + count + ' items'; } else if (valueIsUrl && this.editable.value) { - domValue.title = (0,i18n/* translate */.Iu)('openUrl'); + domValue.title = (0,i18n/* translate */.Tl)('openUrl'); } else { domValue.title = ''; - } // show checkbox when the value is a boolean - + } + // show checkbox when the value is a boolean if (valueType === 'boolean' && this.editable.value) { if (!this.dom.checkbox) { this.dom.checkbox = document.createElement('input'); @@ -11270,7 +10796,6 @@ var Node = /*#__PURE__*/function () { this.dom.tdCheckbox.appendChild(this.dom.checkbox); this.dom.tdValue.parentNode.insertBefore(this.dom.tdCheckbox, this.dom.tdValue); } - this.dom.checkbox.checked = this.value; } else { // cleanup checkbox when displayed @@ -11279,39 +10804,35 @@ var Node = /*#__PURE__*/function () { delete this.dom.tdCheckbox; delete this.dom.checkbox; } - } // create select box when this node has an enum object - + } + // create select box when this node has an enum object if (this["enum"] && this.editable.value) { if (!this.dom.select) { this.dom.select = document.createElement('select'); this.id = this.field + '_' + new Date().getUTCMilliseconds(); this.dom.select.id = this.id; - this.dom.select.name = this.dom.select.id; // Create the default empty option + this.dom.select.name = this.dom.select.id; + // Create the default empty option var defaultOption = document.createElement('option'); defaultOption.value = ''; defaultOption.textContent = '--'; - this.dom.select.appendChild(defaultOption); // Iterate all enum values and add them as options - - for (var i = 0; i < this["enum"].length; i++) { - var option = document.createElement('option'); - option.value = this["enum"][i]; - option.textContent = this["enum"][i]; - this.dom.select.appendChild(option); - } + this.dom.select.appendChild(defaultOption); + // Iterate all enum values and add them as options + this._updateEnumOptions(); this.dom.tdSelect = document.createElement('td'); this.dom.tdSelect.className = 'jsoneditor-tree'; this.dom.tdSelect.appendChild(this.dom.select); this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect, this.dom.tdValue); - } // Select the matching value - + } + // Select the matching value this.dom.select.value = this["enum"].indexOf(this.value) !== -1 ? this.value : ''; // default + // If the enum is inside a composite type display // both the simple input and the dropdown field - if (this.schema && !Node_hasOwnProperty(this.schema, 'oneOf') && !Node_hasOwnProperty(this.schema, 'anyOf') && !Node_hasOwnProperty(this.schema, 'allOf')) { this.valueFieldHTML = this.dom.tdValue.innerHTML; this.dom.tdValue.style.visibility = 'hidden'; @@ -11320,7 +10841,7 @@ var Node = /*#__PURE__*/function () { delete this.valueFieldHTML; } } else { - // cleanup select box when displayed + // cleanup select box when displayed, and attach the editable div instead if (this.dom.tdSelect) { this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect); delete this.dom.tdSelect; @@ -11328,11 +10849,12 @@ var Node = /*#__PURE__*/function () { this.dom.tdValue.innerHTML = this.valueFieldHTML; this.dom.tdValue.style.visibility = ''; delete this.valueFieldHTML; + this.dom.tdValue.appendChild(this.dom.value); } - } // show color picker when value is a color - + } - if (this.editable.value && this.editor.options.colorPicker && typeof value === 'string' && (0,util.isValidColor)(value)) { + // show color picker when value is a color + if (this.editor.options.colorPicker && typeof value === 'string' && (0,util.isValidColor)(value)) { if (!this.dom.color) { this.dom.color = document.createElement('div'); this.dom.color.className = 'jsoneditor-color'; @@ -11340,26 +10862,29 @@ var Node = /*#__PURE__*/function () { this.dom.tdColor.className = 'jsoneditor-tree'; this.dom.tdColor.appendChild(this.dom.color); this.dom.tdValue.parentNode.insertBefore(this.dom.tdColor, this.dom.tdValue); - } // update styling of value and color background - + } + // update styling of value and color background (0,util.addClassName)(this.dom.value, 'jsoneditor-color-value'); + if (!this.editable.value) { + (0,util.addClassName)(this.dom.color, 'jsoneditor-color-readonly'); + } else { + (0,util.removeClassName)(this.dom.color, 'jsoneditor-color-readonly'); + } this.dom.color.style.backgroundColor = value; } else { // cleanup color picker when displayed this._deleteDomColor(); - } // show date tag when value is a timestamp in milliseconds - + } + // show date tag when value is a timestamp in milliseconds if (this._showTimestampTag()) { if (!this.dom.date) { this.dom.date = document.createElement('div'); this.dom.date.className = 'jsoneditor-date'; this.dom.value.parentNode.appendChild(this.dom.date); } - var title = null; - if (typeof this.editor.options.timestampFormat === 'function') { title = this.editor.options.timestampFormat({ field: this.field, @@ -11367,17 +10892,14 @@ var Node = /*#__PURE__*/function () { path: this.getPath() }); } - if (!title) { this.dom.date.textContent = new Date(value).toISOString(); } else { while (this.dom.date.firstChild) { this.dom.date.removeChild(this.dom.date.firstChild); } - this.dom.date.appendChild(document.createTextNode(title)); } - this.dom.date.title = new Date(value).toString(); } else { // cleanup date tag @@ -11385,14 +10907,31 @@ var Node = /*#__PURE__*/function () { this.dom.date.parentNode.removeChild(this.dom.date); delete this.dom.date; } - } // strip formatting from the contents of the editable div - + } + // strip formatting from the contents of the editable div (0,util.stripFormatting)(domValue); - this._updateDomDefault(); } } + }, { + key: "_updateEnumOptions", + value: function _updateEnumOptions() { + if (!this["enum"] || !this.dom.select) { + return; + } + + // clear the existing options + this.dom.select.innerHTML = ''; + + // Iterate all enum values and add them as options + for (var i = 0; i < this["enum"].length; i++) { + var option = document.createElement('option'); + option.value = this["enum"][i]; + option.textContent = this["enum"][i]; + this.dom.select.appendChild(option); + } + } }, { key: "_deleteDomColor", value: function _deleteDomColor() { @@ -11403,6 +10942,7 @@ var Node = /*#__PURE__*/function () { (0,util.removeClassName)(this.dom.value, 'jsoneditor-color-value'); } } + /** * Update dom field: * - the text color of the field, depending on the text @@ -11410,123 +10950,110 @@ var Node = /*#__PURE__*/function () { * - background color in case it is empty * @private */ - }, { key: "_updateDomField", value: function _updateDomField() { var domField = this.dom.field; - if (domField) { var tooltip = (0,util.makeFieldTooltip)(this.schema, this.editor.options.language); - if (tooltip) { domField.title = tooltip; - } // make background color lightgray when empty - + } + // make background color lightgray when empty var isEmpty = String(this.field) === '' && this.parent && this.parent.type !== 'array'; - if (isEmpty) { (0,util.addClassName)(domField, 'jsoneditor-empty'); } else { (0,util.removeClassName)(domField, 'jsoneditor-empty'); - } // highlight when there is a search result - + } + // highlight when there is a search result if (this.searchFieldActive) { (0,util.addClassName)(domField, 'jsoneditor-highlight-active'); } else { (0,util.removeClassName)(domField, 'jsoneditor-highlight-active'); } - if (this.searchField) { (0,util.addClassName)(domField, 'jsoneditor-highlight'); } else { (0,util.removeClassName)(domField, 'jsoneditor-highlight'); - } // strip formatting from the contents of the editable div - + } + // strip formatting from the contents of the editable div (0,util.stripFormatting)(domField); } } + /** * Retrieve field from DOM * @param {boolean} [forceUnique] If true, the field name will be changed * into a unique name in case it is a duplicate. * @private */ - }, { key: "_getDomField", value: function _getDomField(forceUnique) { this._clearFieldError(); - if (this.dom.field && this.fieldEditable) { this.fieldInnerText = (0,util.getInnerText)(this.dom.field); - if (this.fieldInnerText === '' && this.dom.field.innerHTML !== '') { // When clearing the contents, often a
remains, messing up the // styling of the empty text box. Therefore we remove the
this.dom.field.textContent = ''; } } - if (this.fieldInnerText !== undefined) { try { var field = this._unescapeHTML(this.fieldInnerText); - var existingFieldNames = this.parent.getFieldNames(this); var isDuplicate = existingFieldNames.indexOf(field) !== -1; - if (!isDuplicate) { if (field !== this.field) { this.field = field; - this._debouncedOnChangeField(); } } else { if (forceUnique) { // fix duplicate field: change it into a unique name field = (0,util.findUniqueName)(field, existingFieldNames); - if (field !== this.field) { - this.field = field; // TODO: don't debounce but resolve right away, and cancel current debounce + this.field = field; + // TODO: don't debounce but resolve right away, and cancel current debounce this._debouncedOnChangeField(); } } else { - this._setFieldError((0,i18n/* translate */.Iu)('duplicateFieldError')); + this._setFieldError((0,i18n/* translate */.Tl)('duplicateFieldError')); } } } catch (err) { // keep the previous field value - this._setFieldError((0,i18n/* translate */.Iu)('cannotParseFieldError')); + this._setFieldError((0,i18n/* translate */.Tl)('cannotParseFieldError')); } } } + /** * Update the value of the schema default element in the DOM. * @private * @returns {undefined} */ - }, { key: "_updateDomDefault", value: function _updateDomDefault() { // Short-circuit if schema is missing, has no default, or if Node has children if (!this.schema || this.schema["default"] === undefined || this._hasChilds()) { return; - } // select either enum dropdown (select) or input value - + } + // select either enum dropdown (select) or input value var inputElement = this.dom.select ? this.dom.select : this.dom.value; - if (!inputElement) { return; } - if (this.value === this.schema["default"]) { - inputElement.title = (0,i18n/* translate */.Iu)('default'); + inputElement.title = (0,i18n/* translate */.Tl)('default'); (0,util.addClassName)(inputElement, 'jsoneditor-is-default'); (0,util.removeClassName)(inputElement, 'jsoneditor-is-not-default'); } else { @@ -11535,27 +11062,24 @@ var Node = /*#__PURE__*/function () { (0,util.addClassName)(inputElement, 'jsoneditor-is-not-default'); } } + /** * Test whether to show a timestamp tag or not * @return {boolean} Returns true when the value is a timestamp */ - }, { key: "_showTimestampTag", value: function _showTimestampTag() { if (typeof this.value !== 'number') { return false; } - var timestampTag = this.editor.options.timestampTag; - if (typeof timestampTag === 'function') { var result = timestampTag({ field: this.field, value: this.value, path: this.getPath() }); - if (typeof result === 'boolean') { return result; } else { @@ -11567,43 +11091,40 @@ var Node = /*#__PURE__*/function () { return false; } } + /** * Clear the dom of the node */ - }, { key: "clearDom", value: function clearDom() { // TODO: hide the node first? // this.hide(); // TODO: recursively clear dom? + this.dom = {}; } + /** * Get the HTML DOM TR element of the node. * The dom will be generated when not yet created * @return {Element} tr HTML DOM TR Element */ - }, { key: "getDom", value: function getDom() { var dom = this.dom; - if (dom.tr) { return dom.tr; } + this._updateEditability(); - this._updateEditability(); // create row - - + // create row dom.tr = document.createElement('tr'); dom.tr.node = this; - if (this.editor.options.mode === 'tree') { // note: we take here the global setting var tdDrag = document.createElement('td'); - if (this.editable.field) { // create draggable area if (this.parent) { @@ -11611,24 +11132,24 @@ var Node = /*#__PURE__*/function () { domDrag.type = 'button'; dom.drag = domDrag; domDrag.className = 'jsoneditor-button jsoneditor-dragarea'; - domDrag.title = (0,i18n/* translate */.Iu)('drag'); + domDrag.title = (0,i18n/* translate */.Tl)('drag'); tdDrag.appendChild(domDrag); } } + dom.tr.appendChild(tdDrag); - dom.tr.appendChild(tdDrag); // create context menu - + // create context menu var tdMenu = document.createElement('td'); var menu = document.createElement('button'); menu.type = 'button'; dom.menu = menu; menu.className = 'jsoneditor-button jsoneditor-contextmenu-button'; - menu.title = (0,i18n/* translate */.Iu)('actionsMenu'); + menu.title = (0,i18n/* translate */.Tl)('actionsMenu'); tdMenu.appendChild(dom.menu); dom.tr.appendChild(tdMenu); - } // create tree and field - + } + // create tree and field var tdField = document.createElement('td'); dom.tr.appendChild(tdField); dom.tree = this._createDomTree(); @@ -11638,55 +11159,52 @@ var Node = /*#__PURE__*/function () { }); return dom.tr; } + /** * Test whether a Node is rendered and visible * @returns {boolean} */ - }, { key: "isVisible", value: function isVisible() { return this.dom && this.dom.tr && this.dom.tr.parentNode || false; } + /** * Test if this node is a sescendant of an other node * @param {Node} node * @return {boolean} isDescendant * @private */ - }, { key: "isDescendantOf", value: function isDescendantOf(node) { var n = this.parent; - while (n) { if (n === node) { return true; } - n = n.parent; } - return false; } + /** * Create an editable field * @return {Element} domField * @private */ - }, { key: "_createDomField", value: function _createDomField() { return document.createElement('div'); } + /** * Set highlighting for this node and all its childs. * Only applied to the currently visible (expanded childs) * @param {boolean} highlight */ - }, { key: "setHighlight", value: function setHighlight(highlight) { @@ -11696,11 +11214,9 @@ var Node = /*#__PURE__*/function () { } else { (0,util.removeClassName)(this.dom.tr, 'jsoneditor-highlight'); } - if (this.append) { this.append.setHighlight(highlight); } - if (this.childs) { this.childs.forEach(function (child) { child.setHighlight(highlight); @@ -11708,38 +11224,33 @@ var Node = /*#__PURE__*/function () { } } } + /** * Select or deselect a node * @param {boolean} selected * @param {boolean} [isFirst] */ - }, { key: "setSelected", value: function setSelected(selected, isFirst) { this.selected = selected; - if (this.dom.tr) { if (selected) { (0,util.addClassName)(this.dom.tr, 'jsoneditor-selected'); } else { (0,util.removeClassName)(this.dom.tr, 'jsoneditor-selected'); } - if (isFirst) { (0,util.addClassName)(this.dom.tr, 'jsoneditor-first'); } else { (0,util.removeClassName)(this.dom.tr, 'jsoneditor-first'); } - if (this.append) { this.append.setSelected(selected); } - if (this.showMore) { this.showMore.setSelected(selected); } - if (this.childs) { this.childs.forEach(function (child) { child.setSelected(selected); @@ -11747,12 +11258,12 @@ var Node = /*#__PURE__*/function () { } } } + /** * Update the value of the node. Only primitive types are allowed, no Object * or Array is allowed. * @param {String | Number | Boolean | null} value */ - }, { key: "updateValue", value: function updateValue(value) { @@ -11761,11 +11272,11 @@ var Node = /*#__PURE__*/function () { this.valueError = undefined; this.updateDom(); } + /** * Update the field of the node. * @param {String} field */ - }, { key: "updateField", value: function updateField(field) { @@ -11774,6 +11285,7 @@ var Node = /*#__PURE__*/function () { this.fieldError = undefined; this.updateDom(); } + /** * Update the HTML DOM, optionally recursing through the childs * @param {Object} [options] Available parameters: @@ -11784,20 +11296,17 @@ var Node = /*#__PURE__*/function () { * indexes of the node will be updated too. False by * default. */ - }, { key: "updateDom", value: function updateDom(options) { // update level indentation var domTree = this.dom.tree; - if (domTree) { domTree.style.marginLeft = this.getLevel() * 24 + 'px'; - } // apply field to DOM - + } + // apply field to DOM var domField = this.dom.field; - if (domField) { if (this.fieldEditable) { // parent is an object @@ -11809,16 +11318,13 @@ var Node = /*#__PURE__*/function () { domField.contentEditable = false; domField.className = 'jsoneditor-readonly'; } - var fieldText; - if (this.index !== undefined) { fieldText = this.index; } else if (this.field !== undefined) { fieldText = this.field; } else { var schema = this.editor.options.schema ? Node._findSchema(this.editor.options.schema, this.editor.options.schemaRefs || {}, this.getPath()) : undefined; - if (schema && schema.title) { fieldText = schema.title; } else if (this._hasChilds()) { @@ -11827,28 +11333,24 @@ var Node = /*#__PURE__*/function () { fieldText = ''; } } - var escapedField = this._escapeHTML(fieldText); - if (document.activeElement !== domField && escapedField !== this._unescapeHTML((0,util.getInnerText)(domField))) { // only update if it not has the focus or when there is an actual change, // else you would needlessly loose the caret position when changing tabs // or whilst typing domField.innerHTML = escapedField; } - this._updateSchema(); - } // apply value to DOM - + this._updateEnumOptions(); + } + // apply value to DOM var domValue = this.dom.value; - if (domValue) { if (this.type === 'array' || this.type === 'object') { this.updateNodeName(); } else { var escapedValue = this._escapeHTML(this.value); - if (document.activeElement !== domValue && escapedValue !== this._unescapeHTML((0,util.getInnerText)(domValue))) { // only update if it not has the focus or when there is an actual change, // else you would needlessly loose the caret position when changing tabs @@ -11856,15 +11358,13 @@ var Node = /*#__PURE__*/function () { domValue.innerHTML = escapedValue; } } - } // apply styling to the table row - + } + // apply styling to the table row var tr = this.dom.tr; - if (tr) { if (this.type === 'array' || this.type === 'object') { (0,util.addClassName)(tr, 'jsoneditor-expandable'); - if (this.expanded) { (0,util.addClassName)(tr, 'jsoneditor-expanded'); (0,util.removeClassName)(tr, 'jsoneditor-collapsed'); @@ -11877,60 +11377,59 @@ var Node = /*#__PURE__*/function () { (0,util.removeClassName)(tr, 'jsoneditor-expanded'); (0,util.removeClassName)(tr, 'jsoneditor-collapsed'); } - } // update field and value - + } + // update field and value this._updateDomField(); + this._updateDomValue(); - this._updateDomValue(); // update childs indexes - - + // update childs indexes if (options && options.updateIndexes === true) { // updateIndexes is true or undefined this._updateDomIndexes(); - } // update childs recursively - + } + // update childs recursively if (options && options.recurse === true) { if (this.childs) { this.childs.forEach(function (child) { child.updateDom(options); }); } - } // update rendering of error - + } + // update rendering of error if (this.error) { this.updateError(); - } // update row with append button - + } + // update row with append button if (this.append) { this.append.updateDom(); - } // update "show more" text at the bottom of large arrays - + } + // update "show more" text at the bottom of large arrays if (this.showMore) { this.showMore.updateDom(); - } // fire onClassName - + } + // fire onClassName this._updateCssClassName(); } + /** * Locate the JSON schema of the node and check for any enum type * @private */ - }, { key: "_updateSchema", value: function _updateSchema() { // Locating the schema of the node and checking for any enum type if (this.editor && this.editor.options) { // find the part of the json schema matching this nodes path - this.schema = this.editor.options.schema // fix childSchema with $ref, and not display the select element on the child schema because of not found enum + this.schema = this.editor.options.schema + // fix childSchema with $ref, and not display the select element on the child schema because of not found enum ? Node._findSchema(this.editor.options.schema, this.editor.options.schemaRefs || {}, this.getPath()) : null; - if (this.schema) { this["enum"] = Node._findEnum(this.schema); } else { @@ -11938,25 +11437,23 @@ var Node = /*#__PURE__*/function () { } } } + /** * Update the DOM of the childs of a node: update indexes and undefined field * names. * Only applicable when structure is an array or object * @private */ - }, { key: "_updateDomIndexes", value: function _updateDomIndexes() { var domValue = this.dom.value; var childs = this.childs; - if (domValue && childs) { if (this.type === 'array') { childs.forEach(function (child, index) { child.index = index; var childField = child.dom.field; - if (childField) { childField.textContent = index; } @@ -11965,7 +11462,6 @@ var Node = /*#__PURE__*/function () { childs.forEach(function (child) { if (child.index !== undefined) { delete child.index; - if (child.field === undefined) { child.field = ''; } @@ -11974,16 +11470,15 @@ var Node = /*#__PURE__*/function () { } } } + /** * Create an editable value * @private */ - }, { key: "_createDomValue", value: function _createDomValue() { var domValue; - if (this.type === 'array') { domValue = document.createElement('div'); domValue.textContent = '[...]'; @@ -12004,38 +11499,35 @@ var Node = /*#__PURE__*/function () { domValue.innerHTML = this._escapeHTML(this.value); } } - return domValue; } + /** * Create an expand/collapse button * @return {Element} expand * @private */ - }, { key: "_createDomExpandButton", value: function _createDomExpandButton() { // create expand button var expand = document.createElement('button'); expand.type = 'button'; - if (this._hasChilds()) { expand.className = this.expanded ? 'jsoneditor-button jsoneditor-expanded' : 'jsoneditor-button jsoneditor-collapsed'; - expand.title = (0,i18n/* translate */.Iu)('expandTitle'); + expand.title = (0,i18n/* translate */.Tl)('expandTitle'); } else { expand.className = 'jsoneditor-button jsoneditor-invisible'; expand.title = ''; } - return expand; } + /** * Create a DOM tree element, containing the expand/collapse button * @return {Element} domTree * @private */ - }, { key: "_createDomTree", value: function _createDomTree() { @@ -12043,37 +11535,38 @@ var Node = /*#__PURE__*/function () { var domTree = document.createElement('table'); var tbody = document.createElement('tbody'); domTree.style.borderCollapse = 'collapse'; // TODO: put in css - domTree.className = 'jsoneditor-values'; domTree.appendChild(tbody); var tr = document.createElement('tr'); - tbody.appendChild(tr); // create expand button + tbody.appendChild(tr); + // create expand button var tdExpand = document.createElement('td'); tdExpand.className = 'jsoneditor-tree'; tr.appendChild(tdExpand); dom.expand = this._createDomExpandButton(); tdExpand.appendChild(dom.expand); - dom.tdExpand = tdExpand; // create the field + dom.tdExpand = tdExpand; + // create the field var tdField = document.createElement('td'); tdField.className = 'jsoneditor-tree'; tr.appendChild(tdField); dom.field = this._createDomField(); tdField.appendChild(dom.field); - dom.tdField = tdField; // create a separator + dom.tdField = tdField; + // create a separator var tdSeparator = document.createElement('td'); tdSeparator.className = 'jsoneditor-tree'; tr.appendChild(tdSeparator); - if (this.type !== 'object' && this.type !== 'array') { tdSeparator.appendChild(document.createTextNode(':')); tdSeparator.className = 'jsoneditor-separator'; } + dom.tdSeparator = tdSeparator; - dom.tdSeparator = tdSeparator; // create the value - + // create the value var tdValue = document.createElement('td'); tdValue.className = 'jsoneditor-tree'; tr.appendChild(tdValue); @@ -12082,11 +11575,11 @@ var Node = /*#__PURE__*/function () { dom.tdValue = tdValue; return domTree; } + /** * Handle an event. The event is caught centrally by the editor * @param {Event} event */ - }, { key: "onEvent", value: function onEvent(event) { @@ -12094,20 +11587,19 @@ var Node = /*#__PURE__*/function () { var target = event.target || event.srcElement; var dom = this.dom; var node = this; + var expandable = this._hasChilds(); - var expandable = this._hasChilds(); // check if mouse is on menu or on dragarea. + // check if mouse is on menu or on dragarea. // If so, highlight current row and its childs - - if (target === dom.drag || target === dom.menu) { if (type === 'mouseover') { this.editor.highlighter.highlight(this); } else if (type === 'mouseout') { this.editor.highlighter.unhighlight(); } - } // context menu events - + } + // context menu events if (type === 'click' && target === dom.menu) { var highlighter = node.editor.highlighter; highlighter.highlight(node); @@ -12118,44 +11610,37 @@ var Node = /*#__PURE__*/function () { highlighter.unlock(); highlighter.unhighlight(); }); - } // expand events - + } + // expand events if (type === 'click') { if (target === dom.expand) { if (expandable) { var recurse = event.ctrlKey; // with ctrl-key, expand/collapse all - this._onExpand(recurse); } } } - - if (type === 'click' && (event.target === node.dom.tdColor || event.target === node.dom.color)) { + if (type === 'click' && (event.target === node.dom.tdColor || event.target === node.dom.color) && this.editable.value) { this._showColorPicker(); - } // swap the value of a boolean when the checkbox displayed left is clicked - + } + // swap the value of a boolean when the checkbox displayed left is clicked if (type === 'change' && target === dom.checkbox) { this.dom.value.textContent = String(!this.value); - this._getDomValue(); - this._updateDomDefault(); - } // update the value of the node based on the selected option - + } + // update the value of the node based on the selected option if (type === 'change' && target === dom.select) { this.dom.value.innerHTML = this._escapeHTML(dom.select.value); - this._getDomValue(); - this._updateDomValue(); - } // value events - + } + // value events var domValue = dom.value; - if (target === domValue) { // noinspection FallthroughInSwitchStatementJS switch (type) { @@ -12163,129 +11648,95 @@ var Node = /*#__PURE__*/function () { case 'change': { this._getDomValue(); - this._clearValueError(); - this._updateDomValue(); - var escapedValue = this._escapeHTML(this.value); - if (escapedValue !== this._unescapeHTML((0,util.getInnerText)(domValue))) { // only update when there is an actual change, else you loose the // caret position when changing tabs or whilst typing domValue.innerHTML = escapedValue; } - break; } - case 'input': // this._debouncedGetDomValue(true); // TODO this._getDomValue(); - this._updateDomValue(); - break; - case 'keydown': case 'mousedown': // TODO: cleanup this.editor.selection = this.editor.getDomSelection(); break; - case 'click': if (event.ctrlKey && this.editable.value) { // if read-only, we use the regular click behavior of an anchor if ((0,util.isUrl)(this.value)) { event.preventDefault(); - window.open(this.value, '_blank', 'noopener'); + window.open(this.value, '_blank', 'noreferrer'); } } - break; - case 'keyup': // this._debouncedGetDomValue(true); // TODO this._getDomValue(); - this._updateDomValue(); - break; - case 'cut': case 'paste': setTimeout(function () { node._getDomValue(); - node._updateDomValue(); }, 1); break; } - } // field events - + } + // field events var domField = dom.field; - if (target === domField) { switch (type) { case 'blur': { this._getDomField(true); - this._updateDomField(); - var escapedField = this._escapeHTML(this.field); - if (escapedField !== this._unescapeHTML((0,util.getInnerText)(domField))) { // only update when there is an actual change, else you loose the // caret position when changing tabs or whilst typing domField.innerHTML = escapedField; } - break; } - case 'input': this._getDomField(); - this._updateSchema(); - this._updateDomField(); - this._updateDomValue(); - break; - case 'keydown': case 'mousedown': this.editor.selection = this.editor.getDomSelection(); break; - case 'keyup': this._getDomField(); - this._updateDomField(); - break; - case 'cut': case 'paste': setTimeout(function () { node._getDomField(); - node._updateDomField(); }, 1); break; } - } // focus - // when clicked in whitespace left or right from the field or value, set focus - + } + // focus + // when clicked in whitespace left or right from the field or value, set focus var domTree = dom.tree; - if (domTree && target === domTree.parentNode && type === 'click' && !event.hasMoved) { var left = event.offsetX !== undefined ? event.offsetX < (this.getLevel() + 1) * 24 : event.pageX < (0,util.getAbsoluteLeft)(dom.tdSeparator); // for FF - if (left || expandable) { // node is expandable when it is an object or array if (domField) { @@ -12299,23 +11750,22 @@ var Node = /*#__PURE__*/function () { } } } - if ((target === dom.tdExpand && !expandable || target === dom.tdField || target === dom.tdSeparator) && type === 'click' && !event.hasMoved) { if (domField) { (0,util.setEndOfContentEditable)(domField); domField.focus(); } } - if (type === 'keydown') { this.onKeyDown(event); - } // fire after applying for example a change by clicking a checkbox - + } + // fire after applying for example a change by clicking a checkbox if (typeof this.editor.options.onEvent === 'function') { this._onEvent(event); } } + /** * Trigger external onEvent provided in options if node is a JSON field or * value. @@ -12325,32 +11775,30 @@ var Node = /*#__PURE__*/function () { * @param {Event} event * @private */ - }, { key: "_onEvent", value: function _onEvent(event) { var element = event.target; var isField = element === this.dom.field; var isValue = element === this.dom.value || element === this.dom.checkbox || element === this.dom.select; - if (isField || isValue) { var info = { field: this.getField(), path: this.getPath() - }; // For leaf values, include value + }; + // For leaf values, include value if (isValue && !this._hasChilds()) { info.value = this.getValue(); } - this.editor.options.onEvent(info, event); } } + /** * Key down event handler * @param {Event} event */ - }, { key: "onKeyDown", value: function onKeyDown(event) { @@ -12373,25 +11821,23 @@ var Node = /*#__PURE__*/function () { var multiselection; var selectedNodes = this.editor.multiselection.nodes.length > 0 ? this.editor.multiselection.nodes : [this]; var firstNode = selectedNodes[0]; - var lastNode = selectedNodes[selectedNodes.length - 1]; // console.log(ctrlKey, keynum, event.charCode); // TODO: cleanup + var lastNode = selectedNodes[selectedNodes.length - 1]; + // console.log(ctrlKey, keynum, event.charCode); // TODO: cleanup if (keynum === 13) { // Enter if (target === this.dom.value) { if (!this.editable.value || event.ctrlKey) { if ((0,util.isUrl)(this.value)) { - window.open(this.value, '_blank', 'noopener'); + window.open(this.value, '_blank', 'noreferrer'); handled = true; } } } else if (target === this.dom.expand) { var expandable = this._hasChilds(); - if (expandable) { var recurse = event.ctrlKey; // with ctrl-key, expand/collapse all - this._onExpand(recurse); - target.focus(); handled = true; } @@ -12408,10 +11854,7 @@ var Node = /*#__PURE__*/function () { if (ctrlKey) { // Ctrl+E and Ctrl+Shift+E this._onExpand(shiftKey); // recurse = shiftKey - - target.focus(); // TODO: should restore focus in case of recursing expand (which takes DOM offline) - handled = true; } } else if (keynum === 77 && editable) { @@ -12433,12 +11876,10 @@ var Node = /*#__PURE__*/function () { if (ctrlKey && !shiftKey) { // Ctrl+Ins this._onInsertBefore(); - handled = true; } else if (ctrlKey && shiftKey) { // Ctrl+Shift+Ins this._onInsertAfter(); - handled = true; } } else if (keynum === 35) { @@ -12447,11 +11888,9 @@ var Node = /*#__PURE__*/function () { // Alt+End // find the last node var endNode = this._lastNode(); - if (endNode) { endNode.focus(Node.focusElement || this._getElementName(target)); } - handled = true; } } else if (keynum === 36) { @@ -12460,11 +11899,9 @@ var Node = /*#__PURE__*/function () { // Alt+Home // find the first node var homeNode = this._firstNode(); - if (homeNode) { homeNode.focus(Node.focusElement || this._getElementName(target)); } - handled = true; } } else if (keynum === 37) { @@ -12473,11 +11910,9 @@ var Node = /*#__PURE__*/function () { // Alt + Arrow Left // move to left element var prevElement = this._previousElement(target); - if (prevElement) { this.focus(this._getElementName(prevElement)); } - handled = true; } else if (altKey && shiftKey && editable) { // Alt + Shift + Arrow left @@ -12488,12 +11923,10 @@ var Node = /*#__PURE__*/function () { var dom = lastNode.getDom(); nextDom = dom.nextSibling; } - if (nextDom) { nextNode = Node.getNodeFromTarget(nextDom); nextDom2 = nextDom.nextSibling; var nextNode2 = Node.getNodeFromTarget(nextDom2); - if (nextNode && nextNode instanceof AppendNode && !(lastNode.parent.childs.length === 1) && nextNode2 && nextNode2.parent) { oldSelection = this.editor.getDomSelection(); oldParent = firstNode.parent; @@ -12506,7 +11939,6 @@ var Node = /*#__PURE__*/function () { nextNode2.parent.moveBefore(node, nextNode2); }); this.focus(Node.focusElement || this._getElementName(target)); - this.editor._onAction('moveNodes', { count: selectedNodes.length, fieldNames: selectedNodes.map(getField), @@ -12530,18 +11962,15 @@ var Node = /*#__PURE__*/function () { // Alt + Arrow Up // find the previous node prevNode = this._previousNode(); - if (prevNode) { this.editor.deselect(true); prevNode.focus(Node.focusElement || this._getElementName(target)); } - handled = true; } else if (!altKey && ctrlKey && shiftKey && editable) { // Ctrl + Shift + Arrow Up // select multiple nodes prevNode = this._previousNode(); - if (prevNode) { multiselection = this.editor.multiselection; multiselection.start = multiselection.start || this; @@ -12550,13 +11979,11 @@ var Node = /*#__PURE__*/function () { this.editor.select(nodes); prevNode.focus('field'); // select field as we know this always exists } - handled = true; } else if (altKey && shiftKey && editable) { // Alt + Shift + Arrow Up // find the previous node prevNode = firstNode._previousNode(); - if (prevNode && prevNode.parent) { oldSelection = this.editor.getDomSelection(); oldParent = firstNode.parent; @@ -12569,7 +11996,6 @@ var Node = /*#__PURE__*/function () { prevNode.parent.moveBefore(node, prevNode); }); this.focus(Node.focusElement || this._getElementName(target)); - this.editor._onAction('moveNodes', { count: selectedNodes.length, fieldNames: selectedNodes.map(getField), @@ -12585,7 +12011,6 @@ var Node = /*#__PURE__*/function () { newSelection: this.editor.getDomSelection() }); } - handled = true; } } else if (keynum === 39) { @@ -12594,21 +12019,16 @@ var Node = /*#__PURE__*/function () { // Alt + Arrow Right // move to right element var nextElement = this._nextElement(target); - if (nextElement) { this.focus(this._getElementName(nextElement)); } - handled = true; } else if (altKey && shiftKey && editable) { // Alt + Shift + Arrow Right var _dom = firstNode.getDom(); - var prevDom = _dom.previousSibling; - if (prevDom) { prevNode = Node.getNodeFromTarget(prevDom); - if (prevNode && prevNode.parent && !prevNode.isVisible()) { oldSelection = this.editor.getDomSelection(); oldParent = firstNode.parent; @@ -12621,7 +12041,6 @@ var Node = /*#__PURE__*/function () { prevNode.parent.moveBefore(node, prevNode); }); this.focus(Node.focusElement || this._getElementName(target)); - this.editor._onAction('moveNodes', { count: selectedNodes.length, fieldNames: selectedNodes.map(getField), @@ -12645,18 +12064,15 @@ var Node = /*#__PURE__*/function () { // Alt + Arrow Down // find the next node nextNode = this._nextNode(); - if (nextNode) { this.editor.deselect(true); nextNode.focus(Node.focusElement || this._getElementName(target)); } - handled = true; } else if (!altKey && ctrlKey && shiftKey && editable) { // Ctrl + Shift + Arrow Down // select multiple nodes nextNode = this._nextNode(); - if (nextNode) { multiselection = this.editor.multiselection; multiselection.start = multiselection.start || this; @@ -12665,7 +12081,6 @@ var Node = /*#__PURE__*/function () { this.editor.select(nodes); nextNode.focus('field'); // select field as we know this always exists } - handled = true; } else if (altKey && shiftKey && editable) { // Alt + Shift + Arrow Down @@ -12674,19 +12089,16 @@ var Node = /*#__PURE__*/function () { nextNode = lastNode.append ? lastNode.append._nextNode() : undefined; } else { nextNode = lastNode._nextNode(); - } // when the next node is not visible, we've reached the "showMore" buttons - + } + // when the next node is not visible, we've reached the "showMore" buttons if (nextNode && !nextNode.isVisible()) { nextNode = nextNode.parent.showMore; } - if (nextNode && nextNode instanceof AppendNode) { nextNode = lastNode; } - var _nextNode2 = nextNode && (nextNode._nextNode() || nextNode.parent.append); - if (_nextNode2 && _nextNode2.parent) { oldSelection = this.editor.getDomSelection(); oldParent = firstNode.parent; @@ -12699,7 +12111,6 @@ var Node = /*#__PURE__*/function () { _nextNode2.parent.moveBefore(node, _nextNode2); }); this.focus(Node.focusElement || this._getElementName(target)); - this.editor._onAction('moveNodes', { count: selectedNodes.length, fieldNames: selectedNodes.map(getField), @@ -12715,84 +12126,83 @@ var Node = /*#__PURE__*/function () { newSelection: this.editor.getDomSelection() }); } - handled = true; } } - if (handled) { event.preventDefault(); event.stopPropagation(); } } + /** * Handle the expand event, when clicked on the expand button * @param {boolean} recurse If true, child nodes will be expanded too * @private */ - }, { key: "_onExpand", value: function _onExpand(recurse) { var table; var frame; var scrollTop; - if (recurse) { // Take the table offline table = this.dom.tr.parentNode; // TODO: not nice to access the main table like this - frame = table.parentNode; scrollTop = frame.scrollTop; frame.removeChild(table); } - if (this.expanded) { this.collapse(recurse); } else { this.expand(recurse); } - if (recurse) { // Put the table online again frame.appendChild(table); frame.scrollTop = scrollTop; } + if (typeof this.editor.options.onExpand === 'function') { + this.editor.options.onExpand({ + path: this.getPath(), + isExpand: this.expanded, + recursive: recurse + }); + } } + /** * Open a color picker to select a new color * @private */ - }, { key: "_showColorPicker", value: function _showColorPicker() { if (typeof this.editor.options.onColorPicker === 'function' && this.dom.color) { - var node = this; // force deleting current color picker (if any) + var node = this; + // force deleting current color picker (if any) node._deleteDomColor(); - node.updateDom(); - var colorAnchor = (0,createAbsoluteAnchor/* createAbsoluteAnchor */.w)(this.dom.color, this.editor.getPopupAnchor()); + var colorAnchor = (0,createAbsoluteAnchor/* createAbsoluteAnchor */.p)(this.dom.color, this.editor.getPopupAnchor()); this.editor.options.onColorPicker(colorAnchor, this.value, function onChange(value) { if (typeof value === 'string' && value !== node.value) { // force recreating the color block, to cleanup any attached color picker node._deleteDomColor(); - node.value = value; node.updateDom(); - node._debouncedOnChangeValue(); } }); } } + /** * Get all field names of an object * @param {Node} [excludeNode] Optional node to be excluded from the returned field names * @return {string[]} */ - }, { key: "getFieldNames", value: function getFieldNames(excludeNode) { @@ -12803,9 +12213,9 @@ var Node = /*#__PURE__*/function () { return child.field; }); } - return []; } + /** * Handle insert before event * @param {String} [field] @@ -12813,7 +12223,6 @@ var Node = /*#__PURE__*/function () { * @param {String} [type] Can be 'auto', 'array', 'object', or 'string' * @private */ - }, { key: "_onInsertBefore", value: function _onInsertBefore(field, value, type) { @@ -12829,7 +12238,6 @@ var Node = /*#__PURE__*/function () { this.editor.highlighter.unhighlight(); newNode.focus('field'); var newSelection = this.editor.getDomSelection(); - this.editor._onAction('insertBeforeNodes', { nodes: [newNode], paths: [newNode.getInternalPath()], @@ -12839,6 +12247,7 @@ var Node = /*#__PURE__*/function () { newSelection: newSelection }); } + /** * Handle insert after event * @param {String} [field] @@ -12846,7 +12255,6 @@ var Node = /*#__PURE__*/function () { * @param {String} [type] Can be 'auto', 'array', 'object', or 'string' * @private */ - }, { key: "_onInsertAfter", value: function _onInsertAfter(field, value, type) { @@ -12861,7 +12269,6 @@ var Node = /*#__PURE__*/function () { this.editor.highlighter.unhighlight(); newNode.focus('field'); var newSelection = this.editor.getDomSelection(); - this.editor._onAction('insertAfterNodes', { nodes: [newNode], paths: [newNode.getInternalPath()], @@ -12871,6 +12278,7 @@ var Node = /*#__PURE__*/function () { newSelection: newSelection }); } + /** * Handle append event * @param {String} [field] @@ -12878,7 +12286,6 @@ var Node = /*#__PURE__*/function () { * @param {String} [type] Can be 'auto', 'array', 'object', or 'string' * @private */ - }, { key: "_onAppend", value: function _onAppend(field, value, type) { @@ -12893,7 +12300,6 @@ var Node = /*#__PURE__*/function () { this.editor.highlighter.unhighlight(); newNode.focus('field'); var newSelection = this.editor.getDomSelection(); - this.editor._onAction('appendNodes', { nodes: [newNode], paths: [newNode.getInternalPath()], @@ -12902,22 +12308,20 @@ var Node = /*#__PURE__*/function () { newSelection: newSelection }); } + /** * Change the type of the node's value * @param {String} newType * @private */ - }, { key: "_onChangeType", value: function _onChangeType(newType) { var oldType = this.type; - if (newType !== oldType) { var oldSelection = this.editor.getDomSelection(); this.changeType(newType); var newSelection = this.editor.getDomSelection(); - this.editor._onAction('changeType', { path: this.getInternalPath(), oldType: oldType, @@ -12927,6 +12331,7 @@ var Node = /*#__PURE__*/function () { }); } } + /** * Sort the child's of the node. Only applicable when the node has type 'object' * or 'array'. @@ -12937,28 +12342,24 @@ var Node = /*#__PURE__*/function () { * and invoking onChange. * @private */ - }, { key: "sort", value: function sort(path, direction) { var triggerAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - if (typeof path === 'string') { path = (0,util.parsePath)(path); } - if (!this._hasChilds()) { return; } - this.hideChilds(); // sorting is faster when the childs are not attached to the dom - // copy the childs array (the old one will be kept for an undo action + // copy the childs array (the old one will be kept for an undo action var oldChilds = this.childs; - this.childs = this.childs.concat(); // sort the childs array + this.childs = this.childs.concat(); + // sort the childs array var order = direction === 'desc' ? -1 : 1; - if (this.type === 'object') { this.childs.sort(function (a, b) { return order * naturalSort_default()(a.field, b.field); @@ -12968,32 +12369,25 @@ var Node = /*#__PURE__*/function () { this.childs.sort(function (a, b) { var nodeA = a.getNestedChild(path); var nodeB = b.getNestedChild(path); - if (!nodeA) { return order; } - if (!nodeB) { return -order; } - var valueA = nodeA.value; var valueB = nodeB.value; - if (typeof valueA !== 'string' && typeof valueB !== 'string') { // both values are a number, boolean, or null -> use simple, fast sorting return valueA > valueB ? order : valueA < valueB ? -order : 0; } - return order * naturalSort_default()(valueA, valueB); }); - } // update the index numbering - + } + // update the index numbering this._updateDomIndexes(); - this.showChilds(); - if (triggerAction === true) { this.editor._onAction('sort', { path: this.getInternalPath(), @@ -13002,23 +12396,23 @@ var Node = /*#__PURE__*/function () { }); } } + /** * Replace the value of the node, keep it's state * @param {*} newValue */ - }, { key: "update", value: function update(newValue) { var oldValue = this.getInternalValue(); this.setValue(newValue); - this.editor._onAction('transform', { path: this.getInternalPath(), oldValue: oldValue, newValue: this.getInternalValue() }); } + /** * Remove this node from the DOM * @returns {{table: Element, nextTr?: Element}} @@ -13026,19 +12420,16 @@ var Node = /*#__PURE__*/function () { * to the DOM again, see _attachToDom. * @private */ - }, { key: "_detachFromDom", value: function _detachFromDom() { var table = this.dom.tr ? this.dom.tr.parentNode : undefined; var lastTr; - if (this.expanded) { lastTr = this.getAppendDom(); } else { lastTr = this.getDom(); } - var nextTr = lastTr && lastTr.parentNode ? lastTr.nextSibling : undefined; this.hide({ resetVisibleChilds: false @@ -13048,13 +12439,13 @@ var Node = /*#__PURE__*/function () { nextTr: nextTr }; } + /** * Attach this node to the DOM again * @param {{table: Element, nextTr?: Element}} domAnchor * The DOM elements returned by _detachFromDom. * @private */ - }, { key: "_attachToDom", value: function _attachToDom(domAnchor) { @@ -13065,64 +12456,56 @@ var Node = /*#__PURE__*/function () { domAnchor.table.appendChild(this.getDom()); } } - if (this.expanded) { this.showChilds(); } } + /** * Transform the node given a JMESPath query. * @param {String} query JMESPath query to apply * @private */ - }, { key: "transform", value: function transform(query) { if (!this._hasChilds()) { return; } - this.hideChilds(); // sorting is faster when the childs are not attached to the dom try { - var oldInternalValue = this.getInternalValue(); // apply the JMESPath query + var oldInternalValue = this.getInternalValue(); + // apply the JMESPath query var oldValue = this.getValue(); var newValue = this.editor.options.executeQuery(oldValue, query); this.setValue(newValue); var newInternalValue = this.getInternalValue(); - this.editor._onAction('transform', { path: this.getInternalPath(), oldValue: oldInternalValue, newValue: newInternalValue }); - this.showChilds(); } catch (err) { this.showChilds(); - this.editor._onError(err); } } + /** * Make this object the root object of the ditor */ - }, { key: "extract", value: function extract() { this.editor.node.hideChilds(); this.hideChilds(); - try { var oldInternalValue = this.editor.node.getInternalValue(); - this.editor._setRoot(this); - var newInternalValue = this.editor.node.getInternalValue(); - this.editor._onAction('transform', { path: this.editor.node.getInternalPath(), oldValue: oldInternalValue, @@ -13137,47 +12520,44 @@ var Node = /*#__PURE__*/function () { this.showChilds(); } } + /** * Get a nested child given a path with properties * @param {String[]} path * @returns {Node} */ - }, { key: "getNestedChild", value: function getNestedChild(path) { var i = 0; var child = this; - while (child && i < path.length) { child = child.findChildByProperty(path[i]); i++; } - return child; } + /** * Find a child by property name * @param {string} prop * @return {Node | undefined} Returns the child node when found, or undefined otherwise */ - }, { key: "findChildByProperty", value: function findChildByProperty(prop) { if (this.type !== 'object') { return undefined; } - return this.childs.find(function (child) { return child.field === prop; }); } + /** * Create a table row with an append button. * @return {HTMLElement | undefined} tr with the AppendNode contents */ - }, { key: "getAppendDom", value: function getAppendDom() { @@ -13185,206 +12565,180 @@ var Node = /*#__PURE__*/function () { this.append = new AppendNode(this.editor); this.append.setParent(this); } - return this.append.getDom(); } + /** * Create a table row with an showMore button and text * @return {HTMLElement | undefined} tr with the AppendNode contents */ - }, { key: "getShowMoreDom", value: function getShowMoreDom() { if (!this.showMore) { this.showMore = new ShowMoreNode(this.editor, this); } - return this.showMore.getDom(); } + /** * Get the next sibling of current node * @return {Node} nextSibling */ - }, { key: "nextSibling", value: function nextSibling() { var index = this.parent.childs.indexOf(this); return this.parent.childs[index + 1] || this.parent.append; } + /** * Get the previously rendered node * @return {Node | null} previousNode */ - }, { key: "_previousNode", value: function _previousNode() { var prevNode = null; var dom = this.getDom(); - if (dom && dom.parentNode) { // find the previous field var prevDom = dom; - do { prevDom = prevDom.previousSibling; prevNode = Node.getNodeFromTarget(prevDom); } while (prevDom && prevNode && prevNode instanceof AppendNode && !prevNode.isVisible()); } - return prevNode; } + /** * Get the next rendered node * @return {Node | null} nextNode * @private */ - }, { key: "_nextNode", value: function _nextNode() { var nextNode = null; var dom = this.getDom(); - if (dom && dom.parentNode) { // find the previous field var nextDom = dom; - do { nextDom = nextDom.nextSibling; nextNode = Node.getNodeFromTarget(nextDom); } while (nextDom && nextNode && nextNode instanceof AppendNode && !nextNode.isVisible()); } - return nextNode; } + /** * Get the first rendered node * @return {Node | null} firstNode * @private */ - }, { key: "_firstNode", value: function _firstNode() { var firstNode = null; var dom = this.getDom(); - if (dom && dom.parentNode) { var firstDom = dom.parentNode.firstChild; firstNode = Node.getNodeFromTarget(firstDom); } - return firstNode; } + /** * Get the last rendered node * @return {Node | null} lastNode * @private */ - }, { key: "_lastNode", value: function _lastNode() { var lastNode = null; var dom = this.getDom(); - if (dom && dom.parentNode) { var lastDom = dom.parentNode.lastChild; lastNode = Node.getNodeFromTarget(lastDom); - while (lastDom && lastNode && !lastNode.isVisible()) { lastDom = lastDom.previousSibling; lastNode = Node.getNodeFromTarget(lastDom); } } - return lastNode; } + /** * Get the next element which can have focus. * @param {Element} elem * @return {Element | null} nextElem * @private */ - }, { key: "_previousElement", value: function _previousElement(elem) { - var dom = this.dom; // noinspection FallthroughInSwitchStatementJS - + var dom = this.dom; + // noinspection FallthroughInSwitchStatementJS switch (elem) { case dom.value: if (this.fieldEditable) { return dom.field; } - // intentional fall through - case dom.field: if (this._hasChilds()) { return dom.expand; } - // intentional fall through - case dom.expand: return dom.menu; - case dom.menu: if (dom.drag) { return dom.drag; } - // intentional fall through - default: return null; } } + /** * Get the next element which can have focus. * @param {Element} elem * @return {Element | null} nextElem * @private */ - }, { key: "_nextElement", value: function _nextElement(elem) { - var dom = this.dom; // noinspection FallthroughInSwitchStatementJS - + var dom = this.dom; + // noinspection FallthroughInSwitchStatementJS switch (elem) { case dom.drag: return dom.menu; - case dom.menu: if (this._hasChilds()) { return dom.expand; } - // intentional fall through - case dom.expand: if (this.fieldEditable) { return dom.field; } - // intentional fall through - case dom.field: if (!this._hasChilds()) { return dom.value; } - // intentional fall through - default: return null; } } + /** * Get the dom name of given element. returns null if not found. * For example when element === dom.field, "field" is returned. @@ -13393,23 +12747,21 @@ var Node = /*#__PURE__*/function () { * 'menu', 'expand', 'field', 'value' * @private */ - }, { key: "_getElementName", value: function _getElementName(element) { var _this2 = this; - return Object.keys(this.dom).find(function (name) { return _this2.dom[name] === element; }); } + /** * Test if this node has childs. This is the case when the node is an object * or array. * @return {boolean} hasChilds * @private */ - }, { key: "_hasChilds", value: function _hasChilds() { @@ -13421,22 +12773,18 @@ var Node = /*#__PURE__*/function () { var node = this; var templates = node.editor.options.templates; if (templates == null) return; - if (templates.length) { // create a separator menu.push({ type: 'separator' }); } - var appendData = function appendData(name, data) { node._onAppend(name, data); }; - var insertData = function insertData(name, data) { node._onInsertBefore(name, data); }; - templates.forEach(function (template) { menu.push({ text: template.text, @@ -13446,6 +12794,7 @@ var Node = /*#__PURE__*/function () { }); }); } + /** * Show a contextmenu for this node * @param {HTMLElement} anchor Anchor element to attach the context menu to @@ -13453,55 +12802,52 @@ var Node = /*#__PURE__*/function () { * @param {function} [onClose] Callback method called when the context menu * is being closed. */ - }, { key: "showContextMenu", value: function showContextMenu(anchor, onClose) { var node = this; var items = []; - if (this.editable.value) { items.push({ - text: (0,i18n/* translate */.Iu)('type'), - title: (0,i18n/* translate */.Iu)('typeTitle'), + text: (0,i18n/* translate */.Tl)('type'), + title: (0,i18n/* translate */.Tl)('typeTitle'), className: 'jsoneditor-type-' + this.type, submenu: [{ - text: (0,i18n/* translate */.Iu)('auto'), + text: (0,i18n/* translate */.Tl)('auto'), className: 'jsoneditor-type-auto' + (this.type === 'auto' ? ' jsoneditor-selected' : ''), - title: (0,i18n/* translate */.Iu)('autoType'), + title: (0,i18n/* translate */.Tl)('autoType'), click: function click() { node._onChangeType('auto'); } }, { - text: (0,i18n/* translate */.Iu)('array'), + text: (0,i18n/* translate */.Tl)('array'), className: 'jsoneditor-type-array' + (this.type === 'array' ? ' jsoneditor-selected' : ''), - title: (0,i18n/* translate */.Iu)('arrayType'), + title: (0,i18n/* translate */.Tl)('arrayType'), click: function click() { node._onChangeType('array'); } }, { - text: (0,i18n/* translate */.Iu)('object'), + text: (0,i18n/* translate */.Tl)('object'), className: 'jsoneditor-type-object' + (this.type === 'object' ? ' jsoneditor-selected' : ''), - title: (0,i18n/* translate */.Iu)('objectType'), + title: (0,i18n/* translate */.Tl)('objectType'), click: function click() { node._onChangeType('object'); } }, { - text: (0,i18n/* translate */.Iu)('string'), + text: (0,i18n/* translate */.Tl)('string'), className: 'jsoneditor-type-string' + (this.type === 'string' ? ' jsoneditor-selected' : ''), - title: (0,i18n/* translate */.Iu)('stringType'), + title: (0,i18n/* translate */.Tl)('stringType'), click: function click() { node._onChangeType('string'); } }] }); } - if (this._hasChilds()) { if (this.editor.options.enableSort) { items.push({ - text: (0,i18n/* translate */.Iu)('sort'), - title: (0,i18n/* translate */.Iu)('sortTitle', { + text: (0,i18n/* translate */.Tl)('sort'), + title: (0,i18n/* translate */.Tl)('sortTitle', { type: this.type }), className: 'jsoneditor-sort-asc', @@ -13510,11 +12856,10 @@ var Node = /*#__PURE__*/function () { } }); } - if (this.editor.options.enableTransform) { items.push({ - text: (0,i18n/* translate */.Iu)('transform'), - title: (0,i18n/* translate */.Iu)('transformTitle', { + text: (0,i18n/* translate */.Tl)('transform'), + title: (0,i18n/* translate */.Tl)('transformTitle', { type: this.type }), className: 'jsoneditor-transform', @@ -13523,11 +12868,10 @@ var Node = /*#__PURE__*/function () { } }); } - if (this.parent) { items.push({ - text: (0,i18n/* translate */.Iu)('extract'), - title: (0,i18n/* translate */.Iu)('extractTitle', { + text: (0,i18n/* translate */.Tl)('extract'), + title: (0,i18n/* translate */.Tl)('extractTitle', { type: this.type }), className: 'jsoneditor-extract', @@ -13537,117 +12881,115 @@ var Node = /*#__PURE__*/function () { }); } } - if (this.parent && this.parent._hasChilds()) { if (items.length) { // create a separator items.push({ type: 'separator' }); - } // create append button (for last child node only) - + } + // create append button (for last child node only) var childs = node.parent.childs; - if (node === childs[childs.length - 1]) { var appendSubmenu = [{ - text: (0,i18n/* translate */.Iu)('auto'), + text: (0,i18n/* translate */.Tl)('auto'), className: 'jsoneditor-type-auto', - title: (0,i18n/* translate */.Iu)('autoType'), + title: (0,i18n/* translate */.Tl)('autoType'), click: function click() { node._onAppend('', '', 'auto'); } }, { - text: (0,i18n/* translate */.Iu)('array'), + text: (0,i18n/* translate */.Tl)('array'), className: 'jsoneditor-type-array', - title: (0,i18n/* translate */.Iu)('arrayType'), + title: (0,i18n/* translate */.Tl)('arrayType'), click: function click() { node._onAppend('', []); } }, { - text: (0,i18n/* translate */.Iu)('object'), + text: (0,i18n/* translate */.Tl)('object'), className: 'jsoneditor-type-object', - title: (0,i18n/* translate */.Iu)('objectType'), + title: (0,i18n/* translate */.Tl)('objectType'), click: function click() { node._onAppend('', {}); } }, { - text: (0,i18n/* translate */.Iu)('string'), + text: (0,i18n/* translate */.Tl)('string'), className: 'jsoneditor-type-string', - title: (0,i18n/* translate */.Iu)('stringType'), + title: (0,i18n/* translate */.Tl)('stringType'), click: function click() { node._onAppend('', '', 'string'); } }]; node.addTemplates(appendSubmenu, true); items.push({ - text: (0,i18n/* translate */.Iu)('appendText'), - title: (0,i18n/* translate */.Iu)('appendTitle'), - submenuTitle: (0,i18n/* translate */.Iu)('appendSubmenuTitle'), + text: (0,i18n/* translate */.Tl)('appendText'), + title: (0,i18n/* translate */.Tl)('appendTitle'), + submenuTitle: (0,i18n/* translate */.Tl)('appendSubmenuTitle'), className: 'jsoneditor-append', click: function click() { node._onAppend('', '', 'auto'); }, submenu: appendSubmenu }); - } // create insert button - + } + // create insert button var insertSubmenu = [{ - text: (0,i18n/* translate */.Iu)('auto'), + text: (0,i18n/* translate */.Tl)('auto'), className: 'jsoneditor-type-auto', - title: (0,i18n/* translate */.Iu)('autoType'), + title: (0,i18n/* translate */.Tl)('autoType'), click: function click() { node._onInsertBefore('', '', 'auto'); } }, { - text: (0,i18n/* translate */.Iu)('array'), + text: (0,i18n/* translate */.Tl)('array'), className: 'jsoneditor-type-array', - title: (0,i18n/* translate */.Iu)('arrayType'), + title: (0,i18n/* translate */.Tl)('arrayType'), click: function click() { node._onInsertBefore('', []); } }, { - text: (0,i18n/* translate */.Iu)('object'), + text: (0,i18n/* translate */.Tl)('object'), className: 'jsoneditor-type-object', - title: (0,i18n/* translate */.Iu)('objectType'), + title: (0,i18n/* translate */.Tl)('objectType'), click: function click() { node._onInsertBefore('', {}); } }, { - text: (0,i18n/* translate */.Iu)('string'), + text: (0,i18n/* translate */.Tl)('string'), className: 'jsoneditor-type-string', - title: (0,i18n/* translate */.Iu)('stringType'), + title: (0,i18n/* translate */.Tl)('stringType'), click: function click() { node._onInsertBefore('', '', 'string'); } }]; node.addTemplates(insertSubmenu, false); items.push({ - text: (0,i18n/* translate */.Iu)('insert'), - title: (0,i18n/* translate */.Iu)('insertTitle'), - submenuTitle: (0,i18n/* translate */.Iu)('insertSub'), + text: (0,i18n/* translate */.Tl)('insert'), + title: (0,i18n/* translate */.Tl)('insertTitle'), + submenuTitle: (0,i18n/* translate */.Tl)('insertSub'), className: 'jsoneditor-insert', click: function click() { node._onInsertBefore('', '', 'auto'); }, submenu: insertSubmenu }); - if (this.editable.field) { // create duplicate button items.push({ - text: (0,i18n/* translate */.Iu)('duplicateText'), - title: (0,i18n/* translate */.Iu)('duplicateField'), + text: (0,i18n/* translate */.Tl)('duplicateText'), + title: (0,i18n/* translate */.Tl)('duplicateField'), className: 'jsoneditor-duplicate', click: function click() { Node.onDuplicate(node); } - }); // create remove button + }); + // create remove button items.push({ - text: (0,i18n/* translate */.Iu)('removeText'), - title: (0,i18n/* translate */.Iu)('removeField'), + text: (0,i18n/* translate */.Tl)('removeText'), + title: (0,i18n/* translate */.Tl)('removeField'), className: 'jsoneditor-remove', click: function click() { Node.onRemove(node); @@ -13655,7 +12997,6 @@ var Node = /*#__PURE__*/function () { }); } } - if (this.editor.options.onCreateMenu) { var path = node.getPath(); items = this.editor.options.onCreateMenu(items, { @@ -13664,50 +13005,45 @@ var Node = /*#__PURE__*/function () { paths: [path] }); } - - var menu = new ContextMenu/* ContextMenu */.x(items, { + var menu = new ContextMenu/* ContextMenu */.t(items, { close: onClose }); menu.show(anchor, this.editor.getPopupAnchor()); } + /** * Show sorting modal */ - }, { key: "showSortModal", value: function showSortModal() { var node = this; - var container = this.editor.options.modalAnchor || constants/* DEFAULT_MODAL_ANCHOR */.qD; + var container = this.editor.options.modalAnchor || constants/* DEFAULT_MODAL_ANCHOR */.ai; var json = this.getValue(); - function onSort(sortedBy) { var path = sortedBy.path; var pathArray = (0,util.parsePath)(path); node.sortedBy = sortedBy; node.sort(pathArray, sortedBy.direction); } - (0,js_showSortModal.showSortModal)(container, json, onSort, node.sortedBy); } + /** * Show transform modal */ - }, { key: "showTransformModal", value: function showTransformModal() { var _this3 = this; - var _this$editor$options = this.editor.options, - modalAnchor = _this$editor$options.modalAnchor, - createQuery = _this$editor$options.createQuery, - executeQuery = _this$editor$options.executeQuery, - queryDescription = _this$editor$options.queryDescription; + modalAnchor = _this$editor$options.modalAnchor, + createQuery = _this$editor$options.createQuery, + executeQuery = _this$editor$options.executeQuery, + queryDescription = _this$editor$options.queryDescription; var json = this.getValue(); - (0,js_showTransformModal.showTransformModal)({ - container: modalAnchor || constants/* DEFAULT_MODAL_ANCHOR */.qD, + container: modalAnchor || constants/* DEFAULT_MODAL_ANCHOR */.ai, json: json, queryDescription: queryDescription, // can be undefined @@ -13718,37 +13054,34 @@ var Node = /*#__PURE__*/function () { } }); } + /** * get the type of a value * @param {*} value * @return {String} type Can be 'object', 'array', 'string', 'auto' * @private */ - }, { key: "_getType", value: function _getType(value) { if (value instanceof Array) { return 'array'; } - if (value instanceof Object) { return 'object'; } - if (typeof value === 'string' && typeof (0,util.parseString)(value) !== 'string') { return 'string'; } - return 'auto'; } + /** * escape a text, such that it can be displayed safely in an HTML element * @param {String} text * @return {String} escapedText * @private */ - }, { key: "_escapeHTML", value: function _escapeHTML(text) { @@ -13762,21 +13095,19 @@ var Node = /*#__PURE__*/function () { var json = JSON.stringify(htmlEscaped); var html = json.substring(1, json.length - 1); - if (this.editor.options.escapeUnicode === true) { html = (0,util.escapeUnicodeChars)(html); } - return html; } } + /** * unescape a string. * @param {String} escapedText * @return {String} text * @private */ - }, { key: "_unescapeHTML", value: function _unescapeHTML(escapedText) { @@ -13784,6 +13115,7 @@ var Node = /*#__PURE__*/function () { var htmlEscaped = (0,util.parse)(json); return htmlEscaped.replace(/</g, '<').replace(/>/g, '>').replace(/ |\u00A0/g, ' ').replace(/&/g, '&'); // must be replaced last } + /** * escape a text to make it a valid JSON string. The method will: * - replace unescaped double quotes with '\"' @@ -13793,81 +13125,74 @@ var Node = /*#__PURE__*/function () { * @return {String} escapedText * @private */ - }, { key: "_escapeJSON", value: function _escapeJSON(text) { // TODO: replace with some smart regex (only when a new solution is faster!) var escaped = ''; var i = 0; - while (i < text.length) { var c = text.charAt(i); - if (c === '\n') { escaped += '\\n'; } else if (c === '\\') { escaped += c; i++; c = text.charAt(i); - if (c === '' || '"\\/bfnrtu'.indexOf(c) === -1) { escaped += '\\'; // no valid escape character } - escaped += c; } else if (c === '"') { escaped += '\\"'; } else { escaped += c; } - i++; } - return escaped; } + /** * update the object name according to the callback onNodeName * @private */ - }, { key: "updateNodeName", value: function updateNodeName() { var count = this.childs ? this.childs.length : 0; var nodeName; - if (this.type === 'object' || this.type === 'array') { if (this.editor.options.onNodeName) { try { + var getValue = this.getValue.bind(this); nodeName = this.editor.options.onNodeName({ path: this.getPath(), size: count, - type: this.type + type: this.type, + get value() { + return getValue(); + } }); } catch (err) { console.error('Error in onNodeName callback: ', err); } } - this.dom.value.textContent = this.type === 'object' ? '{' + (nodeName || count) + '}' : '[' + (nodeName || count) + ']'; } } + /** * update recursively the object's and its children's name. * @private */ - }, { key: "recursivelyUpdateNodeName", value: function recursivelyUpdateNodeName() { if (this.expanded) { this.updateNodeName(); - if (this.childs !== 'undefined') { var i; - for (i in this.childs) { this.childs[i].recursivelyUpdateNodeName(); } @@ -13875,64 +13200,61 @@ var Node = /*#__PURE__*/function () { } } }]); +}(); - return Node; -}(); // debounce interval for keyboard input in milliseconds - -Node.prototype.DEBOUNCE_INTERVAL = 150; // search will stop iterating as soon as the max is reached +// debounce interval for keyboard input in milliseconds +Node.prototype.DEBOUNCE_INTERVAL = 150; -Node.prototype.MAX_SEARCH_RESULTS = 999; // default number of child nodes to display +// search will stop iterating as soon as the max is reached +Node.prototype.MAX_SEARCH_RESULTS = 999; -var DEFAULT_MAX_VISIBLE_CHILDS = 100; // stores the element name currently having the focus +// default number of child nodes to display +var DEFAULT_MAX_VISIBLE_CHILDS = 100; +// stores the element name currently having the focus Node.focusElement = undefined; + /** * Select all text in an editable div after a delay of 0 ms * @param {Element} editableDiv */ - Node.select = function (editableDiv) { setTimeout(function () { (0,util.selectContentEditable)(editableDiv); }, 0); }; + /** * DragStart event, fired on mousedown on the dragarea at the left side of a Node * @param {Node[] | Node} nodes * @param {Event} event */ - - Node.onDragStart = function (nodes, event) { if (!Array.isArray(nodes)) { return Node.onDragStart([nodes], event); } - if (nodes.length === 0) { return; } - var firstNode = nodes[0]; var lastNode = nodes[nodes.length - 1]; var parent = firstNode.parent; var draggedNode = Node.getNodeFromTarget(event.target); - var editor = firstNode.editor; // in case of multiple selected nodes, offsetY prevents the selection from - // jumping when you start dragging one of the lower down nodes in the selection + var editor = firstNode.editor; + // in case of multiple selected nodes, offsetY prevents the selection from + // jumping when you start dragging one of the lower down nodes in the selection var offsetY = (0,util.getAbsoluteTop)(draggedNode.dom.tr) - (0,util.getAbsoluteTop)(firstNode.dom.tr); - if (!editor.mousemove) { editor.mousemove = (0,util.addEventListener)(event.view, 'mousemove', function (event) { Node.onDrag(nodes, event); }); } - if (!editor.mouseup) { editor.mouseup = (0,util.addEventListener)(event.view, 'mouseup', function (event) { Node.onDragEnd(nodes, event); }); } - editor.highlighter.lock(); editor.drag = { oldCursor: document.body.style.cursor, @@ -13949,72 +13271,64 @@ Node.onDragStart = function (nodes, event) { document.body.style.cursor = 'move'; event.preventDefault(); }; + /** * Drag event, fired when moving the mouse while dragging a Node * @param {Node[] | Node} nodes * @param {Event} event */ - - Node.onDrag = function (nodes, event) { if (!Array.isArray(nodes)) { return Node.onDrag([nodes], event); } - if (nodes.length === 0) { return; - } // TODO: this method has grown too large. Split it in a number of methods - + } + // TODO: this method has grown too large. Split it in a number of methods var editor = nodes[0].editor; var mouseY = event.pageY - editor.drag.offsetY; var mouseX = event.pageX; var trPrev, trNext, trFirst, trLast, trRoot; var nodePrev, nodeNext; var topPrev, topFirst, bottomNext, heightNext; - var moved = false; // TODO: add an ESC option, which resets to the original position - // move up/down + var moved = false; + + // TODO: add an ESC option, which resets to the original position + // move up/down var firstNode = nodes[0]; var trThis = firstNode.dom.tr; var topThis = (0,util.getAbsoluteTop)(trThis); var heightThis = trThis.offsetHeight; - if (mouseY < topThis) { // move up trPrev = trThis; - do { trPrev = trPrev.previousSibling; nodePrev = Node.getNodeFromTarget(trPrev); topPrev = trPrev ? (0,util.getAbsoluteTop)(trPrev) : 0; } while (trPrev && mouseY < topPrev); - if (nodePrev && !nodePrev.parent) { nodePrev = undefined; } - if (!nodePrev) { // move to the first node trRoot = trThis.parentNode.firstChild; trPrev = trRoot ? trRoot.nextSibling : undefined; nodePrev = Node.getNodeFromTarget(trPrev); - if (nodePrev === firstNode) { nodePrev = undefined; } } - if (nodePrev && nodePrev.isVisible()) { // check if mouseY is really inside the found node trPrev = nodePrev.dom.tr; topPrev = trPrev ? (0,util.getAbsoluteTop)(trPrev) : 0; - if (mouseY > topPrev + heightThis) { nodePrev = undefined; } } - if (nodePrev && (editor.options.limitDragging === false || nodePrev.parent === nodes[0].parent)) { nodes.forEach(function (node) { nodePrev.parent.moveBefore(node, nodePrev); @@ -14026,49 +13340,41 @@ Node.onDrag = function (nodes, event) { var lastNode = nodes[nodes.length - 1]; trLast = lastNode.expanded && lastNode.append ? lastNode.append.getDom() : lastNode.dom.tr; trFirst = trLast ? trLast.nextSibling : undefined; - if (trFirst) { topFirst = (0,util.getAbsoluteTop)(trFirst); trNext = trFirst; - do { nodeNext = Node.getNodeFromTarget(trNext); - if (trNext) { bottomNext = trNext.nextSibling ? (0,util.getAbsoluteTop)(trNext.nextSibling) : 0; heightNext = trNext ? bottomNext - topFirst : 0; - if (nodeNext && nodeNext.parent.childs.length === nodes.length && nodeNext.parent.childs[nodes.length - 1] === lastNode) { // We are about to remove the last child of this parent, // which will make the parents appendNode visible. - topThis += 27; // TODO: dangerous to suppose the height of the appendNode a constant of 27 px. + topThis += 27; + // TODO: dangerous to suppose the height of the appendNode a constant of 27 px. } - trNext = trNext.nextSibling; } } while (trNext && mouseY > topThis + heightNext); - if (nodeNext && nodeNext.parent) { // calculate the desired level var diffX = mouseX - editor.drag.mouseX; var diffLevel = Math.round(diffX / 24 / 2); var level = editor.drag.level + diffLevel; // desired level - var levelNext = nodeNext.getLevel(); // level to be - // find the best fitting level (move upwards over the append nodes) + // find the best fitting level (move upwards over the append nodes) trPrev = nodeNext.dom.tr && nodeNext.dom.tr.previousSibling; - while (levelNext < level && trPrev) { nodePrev = Node.getNodeFromTarget(trPrev); var isDraggedNode = nodes.some(function (node) { return node === nodePrev || nodePrev.isDescendantOf(node); }); - - if (isDraggedNode) {// neglect the dragged nodes themselves and their childs + if (isDraggedNode) { + // neglect the dragged nodes themselves and their childs } else if (nodePrev instanceof AppendNode) { var childs = nodePrev.parent.childs; - if (childs.length !== nodes.length || childs[nodes.length - 1] !== lastNode) { // non-visible append node of a list of childs // consisting of not only this node (else the @@ -14082,15 +13388,13 @@ Node.onDrag = function (nodes, event) { } else { break; } - trPrev = trPrev.previousSibling; } - if (nodeNext instanceof AppendNode && !nodeNext.isVisible() && nodeNext.parent.showMore.isVisible()) { nodeNext = nodeNext._nextNode(); - } // move the node when its position is changed - + } + // move the node when its position is changed if (nodeNext && (editor.options.limitDragging === false || nodeNext.parent === nodes[0].parent) && nodeNext.dom.tr && nodeNext.dom.tr !== trLast.nextSibling) { nodes.forEach(function (node) { nodeNext.parent.moveBefore(node, nodeNext); @@ -14100,40 +13404,36 @@ Node.onDrag = function (nodes, event) { } } } - if (moved) { // update the dragging parameters when moved editor.drag.mouseX = mouseX; editor.drag.level = firstNode.getLevel(); - } // auto scroll when hovering around the top of the editor - + } + // auto scroll when hovering around the top of the editor editor.startAutoScroll(mouseY); event.preventDefault(); }; + /** * Drag event, fired on mouseup after having dragged a node * @param {Node[] | Node} nodes * @param {Event} event */ - - Node.onDragEnd = function (nodes, event) { if (!Array.isArray(nodes)) { return Node.onDrag([nodes], event); } - if (nodes.length === 0) { return; } - var firstNode = nodes[0]; - var editor = firstNode.editor; // set focus to the context menu button of the first node + var editor = firstNode.editor; + // set focus to the context menu button of the first node if (firstNode && firstNode.dom.menu) { firstNode.dom.menu.focus(); } - var oldParentPath = editor.drag.oldParent.getInternalPath(); var newParentPath = firstNode.parent.getInternalPath(); var sameParent = editor.drag.oldParent === firstNode.parent; @@ -14142,7 +13442,6 @@ Node.onDragEnd = function (nodes, event) { var oldParentPathRedo = editor.drag.oldParentPathRedo; var oldIndexRedo = editor.drag.oldIndexRedo; var newIndexRedo = sameParent && oldIndexRedo < newIndex ? newIndex + nodes.length : newIndex; - if (!sameParent || oldIndexRedo !== newIndex) { // only register this action if the node is actually moved to another place editor._onAction('moveNodes', { @@ -14157,36 +13456,34 @@ Node.onDragEnd = function (nodes, event) { oldParentPathRedo: oldParentPathRedo, newParentPathRedo: null, // This is a hack, value will be filled in during undo + oldSelection: editor.drag.oldSelection, newSelection: editor.getDomSelection() }); } - document.body.style.cursor = editor.drag.oldCursor; editor.highlighter.unlock(); nodes.forEach(function (node) { node.updateDom(); - if (event.target !== node.dom.drag && event.target !== node.dom.menu) { editor.highlighter.unhighlight(); } }); delete editor.drag; - if (editor.mousemove) { (0,util.removeEventListener)(event.view, 'mousemove', editor.mousemove); delete editor.mousemove; } - if (editor.mouseup) { (0,util.removeEventListener)(event.view, 'mouseup', editor.mouseup); delete editor.mouseup; - } // Stop any running auto scroll - + } + // Stop any running auto scroll editor.stopAutoScroll(); event.preventDefault(); }; + /** * find an enum definition in a JSON schema, as property `enum` or inside * one of the schemas composites (`oneOf`, `anyOf`, `allOf`) @@ -14194,27 +13491,22 @@ Node.onDragEnd = function (nodes, event) { * @return {Array | null} Returns the enum when found, null otherwise. * @private */ - - Node._findEnum = function (schema) { if (schema["enum"]) { return schema["enum"]; } - var composite = schema.oneOf || schema.anyOf || schema.allOf; - if (composite) { var match = composite.filter(function (entry) { return entry["enum"]; }); - if (match.length > 0) { return match[0]["enum"]; } } - return null; }; + /** * Return the part of a JSON schema matching given path. * @param {Object} topLevelSchema @@ -14224,52 +13516,40 @@ Node._findEnum = function (schema) { * @return {Object | null} * @private */ - - Node._findSchema = function (topLevelSchema, schemaRefs, path) { var currentSchema = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : topLevelSchema; var nextPath = path.slice(1, path.length); var nextKey = path[0]; var possibleSchemas = [currentSchema]; - for (var _i = 0, _arr = [currentSchema.oneOf, currentSchema.anyOf, currentSchema.allOf]; _i < _arr.length; _i++) { var subSchemas = _arr[_i]; - if (Array.isArray(subSchemas)) { possibleSchemas = possibleSchemas.concat(subSchemas); } } - var _iterator = _createForOfIteratorHelper(possibleSchemas), - _step; - + _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var schema = _step.value; currentSchema = schema; - if ('$ref' in currentSchema && typeof currentSchema.$ref === 'string') { var _ref$match; - var ref = currentSchema.$ref; - if (ref in schemaRefs) { currentSchema = schemaRefs[ref]; } else if (ref.startsWith('#/')) { var refPath = ref.substring(2).split('/'); currentSchema = topLevelSchema; - var _iterator2 = _createForOfIteratorHelper(refPath), - _step2; - + _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var segment = _step2.value; - if (segment in currentSchema) { currentSchema = currentSchema[segment]; } else { - throw Error("Unable to resovle reference ".concat(ref)); + throw Error("Unable to resolve reference ".concat(ref)); } } } catch (err) { @@ -14279,37 +13559,39 @@ Node._findSchema = function (topLevelSchema, schemaRefs, path) { } } else if (((_ref$match = ref.match(/#\//g)) === null || _ref$match === void 0 ? void 0 : _ref$match.length) === 1) { var _ref$split = ref.split('#/'), - _ref$split2 = _slicedToArray(_ref$split, 2), - schemaUrl = _ref$split2[0], - relativePath = _ref$split2[1]; - + _ref$split2 = _slicedToArray(_ref$split, 2), + schemaUrl = _ref$split2[0], + relativePath = _ref$split2[1]; if (schemaUrl in schemaRefs) { var referencedSchema = schemaRefs[schemaUrl]; var reference = { $ref: '#/'.concat(relativePath) }; - return Node._findSchema(referencedSchema, schemaRefs, nextPath, reference); + var auxNextPath = []; + auxNextPath.push(nextKey); + if (nextPath.length > 0) { + auxNextPath.push.apply(auxNextPath, _toConsumableArray(nextPath)); + } + return Node._findSchema(referencedSchema, schemaRefs, auxNextPath, reference); } else { throw Error("Unable to resolve reference ".concat(ref)); } } else { throw Error("Unable to resolve reference ".concat(ref)); } - } // We have no more path segments to resolve, return the currently found schema - // We do this here, after resolving references, in case of the leaf schema beeing a reference - + } + // We have no more path segments to resolve, return the currently found schema + // We do this here, after resolving references, in case of the leaf schema beeing a reference if (nextKey === undefined) { return currentSchema; } - if (typeof nextKey === 'string') { - if (_typeof(currentSchema.properties) === 'object' && currentSchema.properties !== null && nextKey in currentSchema.properties) { + if (Node_typeof(currentSchema.properties) === 'object' && currentSchema.properties !== null && nextKey in currentSchema.properties) { currentSchema = currentSchema.properties[nextKey]; return Node._findSchema(topLevelSchema, schemaRefs, nextPath, currentSchema); } - - if (_typeof(currentSchema.patternProperties) === 'object' && currentSchema.patternProperties !== null) { + if (Node_typeof(currentSchema.patternProperties) === 'object' && currentSchema.patternProperties !== null) { for (var prop in currentSchema.patternProperties) { if (nextKey.match(prop)) { currentSchema = currentSchema.patternProperties[prop]; @@ -14317,16 +13599,13 @@ Node._findSchema = function (topLevelSchema, schemaRefs, path) { } } } - - if (_typeof(currentSchema.additionalProperties) === 'object') { + if (Node_typeof(currentSchema.additionalProperties) === 'object') { currentSchema = currentSchema.additionalProperties; return Node._findSchema(topLevelSchema, schemaRefs, nextPath, currentSchema); } - continue; } - - if (typeof nextKey === 'number' && _typeof(currentSchema.items) === 'object' && currentSchema.items !== null) { + if (typeof nextKey === 'number' && Node_typeof(currentSchema.items) === 'object' && currentSchema.items !== null) { currentSchema = currentSchema.items; return Node._findSchema(topLevelSchema, schemaRefs, nextPath, currentSchema); } @@ -14336,37 +13615,38 @@ Node._findSchema = function (topLevelSchema, schemaRefs, path) { } finally { _iterator.f(); } - return null; }; + /** * Remove nodes * @param {Node[] | Node} nodes */ - - Node.onRemove = function (nodes) { if (!Array.isArray(nodes)) { return Node.onRemove([nodes]); } - if (nodes && nodes.length > 0) { var firstNode = nodes[0]; var parent = firstNode.parent; var editor = firstNode.editor; var firstIndex = firstNode.getIndex(); - editor.highlighter.unhighlight(); // adjust the focus + editor.highlighter.unhighlight(); + // adjust the focus var oldSelection = editor.getDomSelection(); Node.blurNodes(nodes); - var newSelection = editor.getDomSelection(); // store the paths before removing them (needed for history) + var newSelection = editor.getDomSelection(); - var paths = nodes.map(getInternalPath); // remove the nodes + // store the paths before removing them (needed for history) + var paths = nodes.map(getInternalPath); + // remove the nodes nodes.forEach(function (node) { node.parent._remove(node); - }); // store history action + }); + // store history action editor._onAction('removeNodes', { nodes: nodes, paths: paths, @@ -14377,39 +13657,37 @@ Node.onRemove = function (nodes) { }); } }; + /** * Duplicate nodes * duplicated nodes will be added right after the original nodes * @param {Node[] | Node} nodes */ - - Node.onDuplicate = function (nodes) { if (!Array.isArray(nodes)) { return Node.onDuplicate([nodes]); } - if (nodes && nodes.length > 0) { var lastNode = nodes[nodes.length - 1]; var parent = lastNode.parent; var editor = lastNode.editor; - editor.deselect(editor.multiselection.nodes); // duplicate the nodes + editor.deselect(editor.multiselection.nodes); + // duplicate the nodes var oldSelection = editor.getDomSelection(); var afterNode = lastNode; var clones = nodes.map(function (node) { var clone = node.clone(); - if (node.parent.type === 'object') { var existingFieldNames = node.parent.getFieldNames(); clone.field = (0,util.findUniqueName)(node.field, existingFieldNames); } - parent.insertAfter(clone, afterNode); afterNode = clone; return clone; - }); // set selection to the duplicated nodes + }); + // set selection to the duplicated nodes if (nodes.length === 1) { if (clones[0].parent.type === 'object') { // when duplicating a single object property, @@ -14422,9 +13700,7 @@ Node.onDuplicate = function (nodes) { } else { editor.select(clones); } - var newSelection = editor.getDomSelection(); - editor._onAction('duplicateNodes', { paths: nodes.map(getInternalPath), clonePaths: clones.map(getInternalPath), @@ -14435,66 +13711,55 @@ Node.onDuplicate = function (nodes) { }); } }; + /** * Find the node from an event target * @param {HTMLElement} target * @return {Node | undefined} node or undefined when not found * @static */ - - Node.getNodeFromTarget = function (target) { while (target) { if (target.node) { return target.node; } - target = target.parentNode; } - return undefined; }; + /** * Test whether target is a child of the color DOM of a node * @param {HTMLElement} target * @returns {boolean} */ - - Node.targetIsColorPicker = function (target) { var node = Node.getNodeFromTarget(target); - if (node) { var parent = target && target.parentNode; - while (parent) { if (parent === node.dom.color) { return true; } - parent = parent.parentNode; } } - return false; }; + /** * Remove the focus of given nodes, and move the focus to the (a) node before, * (b) the node after, or (c) the parent node. * @param {Array. | Node} nodes */ - - Node.blurNodes = function (nodes) { if (!Array.isArray(nodes)) { Node.blurNodes([nodes]); return; } - var firstNode = nodes[0]; var parent = firstNode.parent; var firstIndex = firstNode.getIndex(); - if (parent.childs[firstIndex + nodes.length]) { parent.childs[firstIndex + nodes.length].focus(); } else if (parent.childs[firstIndex - 1]) { @@ -14502,34 +13767,34 @@ Node.blurNodes = function (nodes) { } else { parent.focus(); } -}; // helper function to get the internal path of a node - +}; +// helper function to get the internal path of a node function getInternalPath(node) { return node.getInternalPath(); -} // helper function to get the field of a node - +} +// helper function to get the field of a node function getField(node) { return node.getField(); } - function Node_hasOwnProperty(object, key) { return Object.prototype.hasOwnProperty.call(object, key); -} // TODO: find a nicer solution to resolve this circular dependency between Node and AppendNode -// idea: introduce properties .isAppendNode and .isNode and use that instead of instanceof AppendNode checks - +} +// TODO: find a nicer solution to resolve this circular dependency between Node and AppendNode +// idea: introduce properties .isAppendNode and .isNode and use that instead of instanceof AppendNode checks var AppendNode = appendNodeFactory(Node); var ShowMoreNode = showMoreNodeFactory(Node); -;// CONCATENATED MODULE: ./src/js/NodeHistory.js - - -function NodeHistory_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +;// ./src/js/NodeHistory.js -function NodeHistory_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } -function NodeHistory_createClass(Constructor, protoProps, staticProps) { if (protoProps) NodeHistory_defineProperties(Constructor.prototype, protoProps); if (staticProps) NodeHistory_defineProperties(Constructor, staticProps); return Constructor; } +function NodeHistory_typeof(o) { "@babel/helpers - typeof"; return NodeHistory_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, NodeHistory_typeof(o); } +function NodeHistory_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function NodeHistory_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, NodeHistory_toPropertyKey(o.key), o); } } +function NodeHistory_createClass(e, r, t) { return r && NodeHistory_defineProperties(e.prototype, r), t && NodeHistory_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function NodeHistory_toPropertyKey(t) { var i = NodeHistory_toPrimitive(t, "string"); return "symbol" == NodeHistory_typeof(i) ? i : i + ""; } +function NodeHistory_toPrimitive(t, r) { if ("object" != NodeHistory_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != NodeHistory_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** @@ -14537,21 +13802,20 @@ function NodeHistory_createClass(Constructor, protoProps, staticProps) { if (pro * Store action history, enables undo and redo * @param {JSONEditor} editor */ - var NodeHistory = /*#__PURE__*/function () { function NodeHistory(editor) { NodeHistory_classCallCheck(this, NodeHistory); - this.editor = editor; this.history = []; this.index = -1; - this.clear(); // helper function to find a Node from a path + this.clear(); + // helper function to find a Node from a path function findNode(path) { return editor.node.findNodeByInternalPath(path); - } // map with all supported actions - + } + // map with all supported actions this.actions = { editField: { undo: function undo(params) { @@ -14654,12 +13918,10 @@ var NodeHistory = /*#__PURE__*/function () { var nodes = params.paths.map(findNode); nodes.forEach(function (node) { var clone = node.clone(); - if (parentNode.type === 'object') { var existingFieldNames = parentNode.getFieldNames(); clone.field = (0,util.findUniqueName)(node.field, existingFieldNames); } - parentNode.insertAfter(clone, afterNode); afterNode = clone; }); @@ -14669,15 +13931,17 @@ var NodeHistory = /*#__PURE__*/function () { undo: function undo(params) { var oldParentNode = findNode(params.oldParentPath); var newParentNode = findNode(params.newParentPath); - var oldBeforeNode = oldParentNode.childs[params.oldIndex] || oldParentNode.append; // first copy the nodes, then move them + var oldBeforeNode = oldParentNode.childs[params.oldIndex] || oldParentNode.append; + // first copy the nodes, then move them var nodes = newParentNode.childs.slice(params.newIndex, params.newIndex + params.count); nodes.forEach(function (node, index) { node.field = params.fieldNames[index]; oldParentNode.moveBefore(node, oldBeforeNode); - }); // This is a hack to work around an issue that we don't know tha original - // path of the new parent after dragging, as the node is already moved at that time. + }); + // This is a hack to work around an issue that we don't know tha original + // path of the new parent after dragging, as the node is already moved at that time. if (params.newParentPathRedo === null) { params.newParentPathRedo = newParentNode.getInternalPath(); } @@ -14685,8 +13949,9 @@ var NodeHistory = /*#__PURE__*/function () { redo: function redo(params) { var oldParentNode = findNode(params.oldParentPathRedo); var newParentNode = findNode(params.newParentPathRedo); - var newBeforeNode = newParentNode.childs[params.newIndexRedo] || newParentNode.append; // first copy the nodes, then move them + var newBeforeNode = newParentNode.childs[params.newIndexRedo] || newParentNode.append; + // first copy the nodes, then move them var nodes = oldParentNode.childs.slice(params.oldIndexRedo, params.oldIndexRedo + params.count); nodes.forEach(function (node, index) { node.field = params.fieldNames[index]; @@ -14716,25 +13981,30 @@ var NodeHistory = /*#__PURE__*/function () { }, transform: { undo: function undo(params) { - findNode(params.path).setInternalValue(params.oldValue); // TODO: would be nice to restore the state of the node and childs + findNode(params.path).setInternalValue(params.oldValue); + + // TODO: would be nice to restore the state of the node and childs }, redo: function redo(params) { - findNode(params.path).setInternalValue(params.newValue); // TODO: would be nice to restore the state of the node and childs + findNode(params.path).setInternalValue(params.newValue); + + // TODO: would be nice to restore the state of the node and childs } - } // TODO: restore the original caret position and selection with each undo - // TODO: implement history for actions "expand", "collapse", "scroll", "setDocument" + } + // TODO: restore the original caret position and selection with each undo + // TODO: implement history for actions "expand", "collapse", "scroll", "setDocument" }; } + /** * The method onChange is executed when the History is changed, and can * be overloaded. */ - - - NodeHistory_createClass(NodeHistory, [{ + return NodeHistory_createClass(NodeHistory, [{ key: "onChange", value: function onChange() {} + /** * Add a new action to the history * @param {String} action The executed action. Available actions: "editField", @@ -14746,7 +14016,6 @@ var NodeHistory = /*#__PURE__*/function () { * value are provided). params contains all information * needed to undo or redo the action. */ - }, { key: "add", value: function add(action, params) { @@ -14755,63 +14024,62 @@ var NodeHistory = /*#__PURE__*/function () { action: action, params: params, timestamp: new Date() - }; // remove redo actions which are invalid now + }; + // remove redo actions which are invalid now if (this.index < this.history.length - 1) { this.history.splice(this.index + 1, this.history.length - this.index - 1); - } // fire onchange event - + } + // fire onchange event this.onChange(); } + /** * Clear history */ - }, { key: "clear", value: function clear() { this.history = []; - this.index = -1; // fire onchange event + this.index = -1; + // fire onchange event this.onChange(); } + /** * Check if there is an action available for undo * @return {Boolean} canUndo */ - }, { key: "canUndo", value: function canUndo() { return this.index >= 0; } + /** * Check if there is an action available for redo * @return {Boolean} canRedo */ - }, { key: "canRedo", value: function canRedo() { return this.index < this.history.length - 1; } + /** * Undo the last action */ - }, { key: "undo", value: function undo() { if (this.canUndo()) { var obj = this.history[this.index]; - if (obj) { var action = this.actions[obj.action]; - if (action && action.undo) { action.undo(obj.params); - if (obj.params.oldSelection) { try { this.editor.setDomSelection(obj.params.oldSelection); @@ -14823,29 +14091,26 @@ var NodeHistory = /*#__PURE__*/function () { console.error(new Error('unknown action "' + obj.action + '"')); } } + this.index--; - this.index--; // fire onchange event - + // fire onchange event this.onChange(); } } + /** * Redo the last action */ - }, { key: "redo", value: function redo() { if (this.canRedo()) { this.index++; var obj = this.history[this.index]; - if (obj) { var action = this.actions[obj.action]; - if (action && action.redo) { action.redo(obj.params); - if (obj.params.newSelection) { try { this.editor.setDomSelection(obj.params.newSelection); @@ -14856,16 +14121,16 @@ var NodeHistory = /*#__PURE__*/function () { } else { console.error(new Error('unknown action "' + obj.action + '"')); } - } // fire onchange event - + } + // fire onchange event this.onChange(); } } + /** * Destroy history */ - }, { key: "destroy", value: function destroy() { @@ -14874,17 +14139,16 @@ var NodeHistory = /*#__PURE__*/function () { this.index = -1; } }]); - - return NodeHistory; }(); -;// CONCATENATED MODULE: ./src/js/SearchBox.js +;// ./src/js/SearchBox.js -function SearchBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function SearchBox_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function SearchBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) SearchBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) SearchBox_defineProperties(Constructor, staticProps); return Constructor; } +function SearchBox_typeof(o) { "@babel/helpers - typeof"; return SearchBox_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, SearchBox_typeof(o); } +function SearchBox_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function SearchBox_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, SearchBox_toPropertyKey(o.key), o); } } +function SearchBox_createClass(e, r, t) { return r && SearchBox_defineProperties(e.prototype, r), t && SearchBox_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function SearchBox_toPropertyKey(t) { var i = SearchBox_toPrimitive(t, "string"); return "symbol" == SearchBox_typeof(i) ? i : i + ""; } +function SearchBox_toPrimitive(t, r) { if ("object" != SearchBox_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != SearchBox_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** @@ -14894,16 +14158,13 @@ function SearchBox_createClass(Constructor, protoProps, staticProps) { if (proto * @param {Element} container HTML container element of where to * create the search box */ - var SearchBox = /*#__PURE__*/function () { function SearchBox(editor, container) { SearchBox_classCallCheck(this, SearchBox); - var searchBox = this; this.editor = editor; this.timeout = undefined; this.delay = 200; // ms - this.lastText = undefined; this.results = null; this.dom = {}; @@ -14919,7 +14180,7 @@ var SearchBox = /*#__PURE__*/function () { var divInput = document.createElement('div'); this.dom.input = divInput; divInput.className = 'jsoneditor-frame'; - divInput.title = (0,i18n/* translate */.Iu)('searchTitle'); + divInput.title = (0,i18n/* translate */.Tl)('searchTitle'); wrapper.appendChild(divInput); var refreshSearch = document.createElement('button'); refreshSearch.type = 'button'; @@ -14928,91 +14189,78 @@ var SearchBox = /*#__PURE__*/function () { var search = document.createElement('input'); search.type = 'text'; this.dom.search = search; - search.oninput = function (event) { searchBox._onDelayedSearch(event); }; - search.onchange = function (event) { // For IE 9 searchBox._onSearch(); }; - search.onkeydown = function (event) { searchBox._onKeyDown(event); }; - search.onkeyup = function (event) { searchBox._onKeyUp(event); }; - refreshSearch.onclick = function (event) { search.select(); - }; // TODO: ESC in FF restores the last input, is a FF bug, https://bugzilla.mozilla.org/show_bug.cgi?id=598819 - + }; + // TODO: ESC in FF restores the last input, is a FF bug, https://bugzilla.mozilla.org/show_bug.cgi?id=598819 divInput.appendChild(search); var searchNext = document.createElement('button'); searchNext.type = 'button'; - searchNext.title = (0,i18n/* translate */.Iu)('searchNextResultTitle'); + searchNext.title = (0,i18n/* translate */.Tl)('searchNextResultTitle'); searchNext.className = 'jsoneditor-next'; - searchNext.onclick = function () { searchBox.next(); }; - divInput.appendChild(searchNext); var searchPrevious = document.createElement('button'); searchPrevious.type = 'button'; - searchPrevious.title = (0,i18n/* translate */.Iu)('searchPreviousResultTitle'); + searchPrevious.title = (0,i18n/* translate */.Tl)('searchPreviousResultTitle'); searchPrevious.className = 'jsoneditor-previous'; - searchPrevious.onclick = function () { searchBox.previous(); }; - divInput.appendChild(searchPrevious); } + /** * Go to the next search result * @param {boolean} [focus] If true, focus will be set to the next result * focus is false by default. */ - - - SearchBox_createClass(SearchBox, [{ + return SearchBox_createClass(SearchBox, [{ key: "next", value: function next(focus) { if (this.results) { var index = this.resultIndex !== null ? this.resultIndex + 1 : 0; - if (index > this.results.length - 1) { index = 0; } - this._setActiveResult(index, focus); } } + /** * Go to the prevous search result * @param {boolean} [focus] If true, focus will be set to the next result * focus is false by default. */ - }, { key: "previous", value: function previous(focus) { if (this.results) { var max = this.results.length - 1; var index = this.resultIndex !== null ? this.resultIndex - 1 : max; - if (index < 0) { index = max; } - this._setActiveResult(index, focus); } } + /** * Set new value for the current active result * @param {Number} index @@ -15020,7 +14268,6 @@ var SearchBox = /*#__PURE__*/function () { * focus is false by default. * @private */ - }, { key: "_setActiveResult", value: function _setActiveResult(index, focus) { @@ -15028,48 +14275,44 @@ var SearchBox = /*#__PURE__*/function () { if (this.activeResult) { var prevNode = this.activeResult.node; var prevElem = this.activeResult.elem; - if (prevElem === 'field') { delete prevNode.searchFieldActive; } else { delete prevNode.searchValueActive; } - prevNode.updateDom(); } - if (!this.results || !this.results[index]) { // out of range, set to undefined this.resultIndex = undefined; this.activeResult = undefined; return; } + this.resultIndex = index; - this.resultIndex = index; // set new node active - + // set new node active var node = this.results[this.resultIndex].node; var elem = this.results[this.resultIndex].elem; - if (elem === 'field') { node.searchFieldActive = true; } else { node.searchValueActive = true; } - this.activeResult = this.results[this.resultIndex]; - node.updateDom(); // TODO: not so nice that the focus is only set after the animation is finished + node.updateDom(); + // TODO: not so nice that the focus is only set after the animation is finished node.scrollTo(function () { if (focus) { node.focus(elem); } }); } + /** * Cancel any running onDelayedSearch. * @private */ - }, { key: "_clearDelay", value: function _clearDelay() { @@ -15078,25 +14321,25 @@ var SearchBox = /*#__PURE__*/function () { delete this.timeout; } } + /** * Start a timer to execute a search after a short delay. * Used for reducing the number of searches while typing. * @param {Event} event * @private */ - }, { key: "_onDelayedSearch", value: function _onDelayedSearch(event) { // execute the search after a short delay (reduces the number of // search actions while typing in the search text box) this._clearDelay(); - var searchBox = this; this.timeout = setTimeout(function (event) { searchBox._onSearch(); }, this.delay); } + /** * Handle onSearch event * @param {boolean} [forceSearch] If true, search will be executed again even @@ -15104,23 +14347,20 @@ var SearchBox = /*#__PURE__*/function () { * Default is false. * @private */ - }, { key: "_onSearch", value: function _onSearch(forceSearch) { this._clearDelay(); - var value = this.dom.search.value; var text = value.length > 0 ? value : undefined; - if (text !== this.lastText || forceSearch) { // only search again when changed this.lastText = text; this.results = this.editor.search(text); - var MAX_SEARCH_RESULTS = this.results[0] ? this.results[0].node.MAX_SEARCH_RESULTS : Infinity; // try to maintain the current active result if this is still part of the new search results + var MAX_SEARCH_RESULTS = this.results[0] ? this.results[0].node.MAX_SEARCH_RESULTS : Infinity; + // try to maintain the current active result if this is still part of the new search results var activeResultIndex = 0; - if (this.activeResult) { for (var i = 0; i < this.results.length; i++) { if (this.results[i].node === this.activeResult.node) { @@ -15129,13 +14369,11 @@ var SearchBox = /*#__PURE__*/function () { } } } + this._setActiveResult(activeResultIndex, false); - this._setActiveResult(activeResultIndex, false); // display search results - - + // display search results if (text !== undefined) { var resultCount = this.results.length; - if (resultCount === 0) { this.dom.results.textContent = "no\xA0results"; } else if (resultCount === 1) { @@ -15150,23 +14388,20 @@ var SearchBox = /*#__PURE__*/function () { } } } + /** * Handle onKeyDown event in the input box * @param {Event} event * @private */ - }, { key: "_onKeyDown", value: function _onKeyDown(event) { var keynum = event.which; - if (keynum === 27) { // ESC this.dom.search.value = ''; // clear search - this._onSearch(); - event.preventDefault(); event.stopPropagation(); } else if (keynum === 13) { @@ -15181,62 +14416,58 @@ var SearchBox = /*#__PURE__*/function () { // move to the next search result this.next(); } - event.preventDefault(); event.stopPropagation(); } } + /** * Handle onKeyUp event in the input box * @param {Event} event * @private */ - }, { key: "_onKeyUp", value: function _onKeyUp(event) { var keynum = event.keyCode; - if (keynum !== 27 && keynum !== 13) { // !show and !Enter this._onDelayedSearch(event); // For IE 9 - } } + /** * Clear the search results */ - }, { key: "clear", value: function clear() { this.dom.search.value = ''; - this._onSearch(); } + /** * Refresh searchResults if there is a search value */ - }, { key: "forceSearch", value: function forceSearch() { this._onSearch(true); } + /** * Test whether the search box value is empty * @returns {boolean} Returns true when empty. */ - }, { key: "isEmpty", value: function isEmpty() { return this.dom.search.value === ''; } + /** * Destroy the search box */ - }, { key: "destroy", value: function destroy() { @@ -15245,21 +14476,19 @@ var SearchBox = /*#__PURE__*/function () { this.dom = null; this.results = null; this.activeResult = null; - this._clearDelay(); } }]); - - return SearchBox; }(); -;// CONCATENATED MODULE: ./src/js/TreePath.js - +;// ./src/js/TreePath.js -function TreePath_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function TreePath_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function TreePath_createClass(Constructor, protoProps, staticProps) { if (protoProps) TreePath_defineProperties(Constructor.prototype, protoProps); if (staticProps) TreePath_defineProperties(Constructor, staticProps); return Constructor; } +function TreePath_typeof(o) { "@babel/helpers - typeof"; return TreePath_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, TreePath_typeof(o); } +function TreePath_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function TreePath_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, TreePath_toPropertyKey(o.key), o); } } +function TreePath_createClass(e, r, t) { return r && TreePath_defineProperties(e.prototype, r), t && TreePath_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function TreePath_toPropertyKey(t) { var i = TreePath_toPrimitive(t, "string"); return "symbol" == TreePath_typeof(i) ? i : i + ""; } +function TreePath_toPrimitive(t, r) { if ("object" != TreePath_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != TreePath_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } @@ -15270,11 +14499,9 @@ function TreePath_createClass(Constructor, protoProps, staticProps) { if (protoP * @param {HTMLElement} root * @constructor */ - var TreePath = /*#__PURE__*/function () { function TreePath(container, root) { TreePath_classCallCheck(this, TreePath); - if (container) { this.root = root; this.path = document.createElement('div'); @@ -15285,28 +14512,26 @@ var TreePath = /*#__PURE__*/function () { this.reset(); } } + /** * Reset component to initial status */ - - - TreePath_createClass(TreePath, [{ + return TreePath_createClass(TreePath, [{ key: "reset", value: function reset() { - this.path.textContent = (0,i18n/* translate */.Iu)('selectNode'); + this.path.textContent = (0,i18n/* translate */.Tl)('selectNode'); } + /** * Renders the component UI according to a given path objects * @param {Array<{name: String, childs: Array}>} pathObjs a list of path objects * */ - }, { key: "setPath", value: function setPath(pathObjs) { var me = this; this.path.textContent = ''; - if (pathObjs && pathObjs.length) { pathObjs.forEach(function (pathObj, idx) { var pathEl = document.createElement('span'); @@ -15315,12 +14540,10 @@ var TreePath = /*#__PURE__*/function () { pathEl.innerText = pathObj.name; pathEl.onclick = _onSegmentClick.bind(me, pathObj); me.path.appendChild(pathEl); - if (pathObj.children.length) { sepEl = document.createElement('span'); sepEl.className = 'jsoneditor-treepath-seperator'; sepEl.textContent = "\u25BA"; - sepEl.onclick = function () { me.contentMenuClicked = true; var items = []; @@ -15331,22 +14554,18 @@ var TreePath = /*#__PURE__*/function () { click: _onContextMenuItemClick.bind(me, pathObj, child.name) }); }); - var menu = new ContextMenu/* ContextMenu */.x(items, { + var menu = new ContextMenu/* ContextMenu */.t(items, { limitHeight: true }); menu.show(sepEl, me.root, true); }; - me.path.appendChild(sepEl); } - if (idx === pathObjs.length - 1) { var leftRectPos = (sepEl || pathEl).getBoundingClientRect().right; - if (me.path.offsetWidth < leftRectPos) { me.path.scrollLeft = leftRectPos; } - if (me.path.scrollLeft) { var showAllBtn = document.createElement('span'); showAllBtn.className = 'jsoneditor-treepath-show-all-btn'; @@ -15358,43 +14577,38 @@ var TreePath = /*#__PURE__*/function () { } }); } - function _onShowAllClick(pathObjs) { me.contentMenuClicked = false; (0,util.addClassName)(me.path, 'show-all'); me.path.style.width = me.path.parentNode.getBoundingClientRect().width - 10 + 'px'; - me.path.onblur = function () { if (me.contentMenuClicked) { me.contentMenuClicked = false; me.path.focus(); return; } - (0,util.removeClassName)(me.path, 'show-all'); me.path.onblur = undefined; me.path.style.width = ''; me.setPath(pathObjs); }; } - function _onSegmentClick(pathObj) { if (this.selectionCallback) { this.selectionCallback(pathObj); } } - function _onContextMenuItemClick(pathObj, selection) { if (this.contextMenuCallback) { this.contextMenuCallback(pathObj, selection); } } } + /** * set a callback function for selection of path section * @param {Function} callback function to invoke when section is selected */ - }, { key: "onSectionSelected", value: function onSectionSelected(callback) { @@ -15402,11 +14616,11 @@ var TreePath = /*#__PURE__*/function () { this.selectionCallback = callback; } } + /** * set a callback function for selection of path section * @param {Function} callback function to invoke when section is selected */ - }, { key: "onContextMenuItemSelected", value: function onContextMenuItemSelected(callback) { @@ -15415,13 +14629,12 @@ var TreePath = /*#__PURE__*/function () { } } }]); - - return TreePath; }(); // EXTERNAL MODULE: ./src/js/vanilla-picker/index.js -var vanilla_picker = __webpack_require__(8037); +var vanilla_picker = __webpack_require__(1746); var vanilla_picker_default = /*#__PURE__*/__webpack_require__.n(vanilla_picker); -;// CONCATENATED MODULE: ./src/js/treemode.js +;// ./src/js/treemode.js + @@ -15436,62 +14649,52 @@ var vanilla_picker_default = /*#__PURE__*/__webpack_require__.n(vanilla_picker); - // create a mixin with the functions for tree mode +// create a mixin with the functions for tree mode var treemode = {}; + /** * Create a tree editor * @param {Element} container Container element * @param {Object} [options] Object with options. See docs for details. * @private */ - treemode.create = function (container, options) { if (!container) { throw new Error('No container element provided.'); } - this.container = container; this.dom = {}; this.highlighter = new Highlighter(); this.selection = undefined; // will hold the last input selection - this.multiselection = { nodes: [] }; this.validateSchema = null; // will be set in .setSchema(schema) - this.validationSequence = 0; this.errorNodes = []; this.lastSchemaErrors = undefined; this.node = null; this.focusTarget = null; - this._setOptions(options); - if (options.autocomplete) { this.autocomplete = autocomplete(options.autocomplete); } - if (this.options.history && this.options.mode !== 'view') { this.history = new NodeHistory(this); } - this._createFrame(); - this._createTable(); }; + /** * Destroy the editor. Clean up DOM, event listeners, and web workers. */ - - treemode.destroy = function () { if (this.frame && this.container && this.frame.parentNode === this.container) { this.container.removeChild(this.frame); this.frame = null; } - this.container = null; this.dom = null; this.clear(); @@ -15502,35 +14705,30 @@ treemode.destroy = function () { this.errorNodes = null; this.validateSchema = null; this._debouncedValidate = null; - if (this.history) { this.history.destroy(); this.history = null; } - if (this.searchBox) { this.searchBox.destroy(); this.searchBox = null; } - if (this.modeSwitcher) { this.modeSwitcher.destroy(); this.modeSwitcher = null; - } // Removing the FocusTracker set to track the editor's focus event - + } + // Removing the FocusTracker set to track the editor's focus event this.frameFocusTracker.destroy(); }; + /** * Initialize and set default options * @param {Object} [options] See description in constructor * @private */ - - treemode._setOptions = function (options) { var _this = this; - this.options = { search: true, history: true, @@ -15550,7 +14748,6 @@ treemode._setOptions = function (options) { // we'll render the color picker on top // when there is not enough space below, and there is enough space above var pickerHeight = 300; // estimated height of the color picker - var top = parent.getBoundingClientRect().top; var windowHeight = (0,util.getWindow)(parent).innerHeight; var showOnTop = windowHeight - top < pickerHeight && top > pickerHeight; @@ -15562,7 +14759,6 @@ treemode._setOptions = function (options) { var alpha = color.rgba[3]; var hex = alpha === 1 ? color.hex.substr(0, 7) // return #RRGGBB : color.hex; // return #RRGGBBAA - onChange(hex); } }).show(); @@ -15572,113 +14768,110 @@ treemode._setOptions = function (options) { }, timestampTag: true, timestampFormat: null, - createQuery: jmespathQuery/* createQuery */.r, - executeQuery: jmespathQuery/* executeQuery */.J, + createQuery: jmespathQuery/* createQuery */.V, + executeQuery: jmespathQuery/* executeQuery */.e, onEvent: null, enableSort: true, enableTransform: true - }; // copy all options + }; + // copy all options if (options) { Object.keys(options).forEach(function (prop) { _this.options[prop] = options[prop]; - }); // default limitDragging to true when a JSON schema is defined + }); + // default limitDragging to true when a JSON schema is defined if (options.limitDragging == null && options.schema != null) { this.options.limitDragging = true; } - } // compile a JSON schema validator if a JSON schema is provided - + } - this.setSchema(this.options.schema, this.options.schemaRefs); // create a debounced validate function + // compile a JSON schema validator if a JSON schema is provided + this.setSchema(this.options.schema, this.options.schemaRefs); + // create a debounced validate function this._debouncedValidate = (0,util.debounce)(this._validateAndCatch.bind(this), this.DEBOUNCE_INTERVAL); - if (options.onSelectionChange) { this.onSelectionChange(options.onSelectionChange); } - - (0,i18n/* setLanguages */.cC)(this.options.languages); - (0,i18n/* setLanguage */.m0)(this.options.language); + (0,i18n/* setLanguages */.AI)(this.options.languages); + (0,i18n/* setLanguage */.xC)(this.options.language); }; + /** * Set new JSON object in editor. * Resets the state of the editor (expanded nodes, search, selection). * * @param {*} json */ - - treemode.set = function (json) { // verify if json is valid JSON, ignore when a function if (json instanceof Function || json === undefined) { this.clear(); } else { this.content.removeChild(this.table); // Take the table offline - // replace the root node + // replace the root node var params = { field: this.options.name, value: json }; var node = new Node(this, params); + this._setRoot(node); - this._setRoot(node); // validate JSON schema (if configured) - - - this._validateAndCatch(); // expand - + // validate JSON schema (if configured) + this._validateAndCatch(); + // expand var recurse = false; this.node.expand(recurse); this.content.appendChild(this.table); // Put the table online again - } // TODO: maintain history, store last state and previous document - + } + // TODO: maintain history, store last state and previous document if (this.history) { this.history.clear(); - } // clear search - + } + // clear search if (this.searchBox) { this.searchBox.clear(); } }; + /** * Update JSON object in editor. * Maintains the state of the editor (expanded nodes, search, selection). * * @param {*} json */ - - treemode.update = function (json) { // don't update if there are no changes if (this.node.deepEqual(json)) { return; } + var selection = this.getSelection(); - var selection = this.getSelection(); // apply the changed json - + // apply the changed json this.onChangeDisabled = true; // don't fire an onChange event - this.node.update(json); - this.onChangeDisabled = false; // validate JSON schema - - this._validateAndCatch(); // update search result if any + this.onChangeDisabled = false; + // validate JSON schema + this._validateAndCatch(); + // update search result if any if (this.searchBox && !this.searchBox.isEmpty()) { this.searchBox.forceSearch(); - } // update selection if any - + } + // update selection if any if (selection && selection.start && selection.end) { // only keep/update the selection if both start and end node still exists, // else we clear the selection var startNode = this.node.findNodeByPath(selection.start.path); var endNode = this.node.findNodeByPath(selection.end.path); - if (startNode && endNode) { this.setSelection(selection.start, selection.end); } else { @@ -15688,85 +14881,82 @@ treemode.update = function (json) { this.setSelection({}, {}); // clear selection } }; + /** * Get JSON object from editor * @return {Object | undefined} json */ - - treemode.get = function () { // TODO: resolve pending debounced input changes if any, but do not resolve invalid inputs + if (this.node) { return this.node.getValue(); } else { return undefined; } }; + /** * Get the text contents of the editor * @return {String} jsonText */ - - treemode.getText = function () { return JSON.stringify(this.get()); }; + /** * Set the text contents of the editor. * Resets the state of the editor (expanded nodes, search, selection). * @param {String} jsonText */ - - treemode.setText = function (jsonText) { try { this.set((0,util.parse)(jsonText)); // this can throw an error } catch (err) { // try to repair json, replace JavaScript notation with JSON notation - var repairedJsonText = (0,util.tryJsonRepair)(jsonText); // try to parse again + var repairedJsonText = (0,util.tryJsonRepair)(jsonText); + // try to parse again this.set((0,util.parse)(repairedJsonText)); // this can throw an error } }; + /** * Update the text contents of the editor. * Maintains the state of the editor (expanded nodes, search, selection). * @param {String} jsonText */ - - treemode.updateText = function (jsonText) { try { this.update((0,util.parse)(jsonText)); // this can throw an error } catch (err) { // try to repair json, replace JavaScript notation with JSON notation - var repairJsonText = (0,util.tryJsonRepair)(jsonText); // try to parse again + var repairJsonText = (0,util.tryJsonRepair)(jsonText); + // try to parse again this.update((0,util.parse)(repairJsonText)); // this can throw an error } }; + /** * Set a field name for the root node. * @param {String | undefined} name */ - - treemode.setName = function (name) { this.options.name = name; - if (this.node) { this.node.updateField(this.options.name); } }; + /** * Get the field name for the root node. * @return {String | undefined} name */ - - treemode.getName = function () { return this.options.name; }; + /** * Set focus to the editor. Focus will be set to: * - the first editable field or value, or else @@ -15774,11 +14964,8 @@ treemode.getName = function () { * - to the context menu button of the root node, or else * - to the first button in the top menu */ - - treemode.focus = function () { var input = this.scrollableContent.querySelector('[contenteditable=true]'); - if (input) { input.focus(); } else if (this.node.dom.expand) { @@ -15788,43 +14975,41 @@ treemode.focus = function () { } else { // focus to the first button in the menu input = this.frame.querySelector('button'); - if (input) { input.focus(); } } }; + /** * Remove the root node from the editor */ - - treemode.clear = function () { if (this.node) { this.node.hide(); delete this.node; } - if (this.treePath) { this.treePath.reset(); } }; + /** * Set the root node for the json editor * @param {Node} node * @private */ - - treemode._setRoot = function (node) { this.clear(); this.node = node; node.setParent(null); node.setField(this.getName(), false); - delete node.index; // append to the dom + delete node.index; + // append to the dom this.tbody.appendChild(node.getDom()); }; + /** * Search text in all nodes * The nodes will be expanded when the text is found one of its childs, @@ -15837,48 +15022,58 @@ treemode._setRoot = function (node) { * the result is found ('field' or * 'value') */ - - treemode.search = function (text) { var results; - if (this.node) { this.content.removeChild(this.table); // Take the table offline - results = this.node.search(text); this.content.appendChild(this.table); // Put the table online again } else { results = []; } - return results; }; + /** * Expand all nodes */ - - treemode.expandAll = function () { if (this.node) { this.content.removeChild(this.table); // Take the table offline - this.node.expand(); this.content.appendChild(this.table); // Put the table online again } }; + /** * Collapse all nodes */ - - treemode.collapseAll = function () { if (this.node) { this.content.removeChild(this.table); // Take the table offline - this.node.collapse(); this.content.appendChild(this.table); // Put the table online again } }; + +/** + * Expand/collapse a given JSON node. + * @param {Object} [options] Available parameters: + * {Array} [path] Path for the node to expand/collapse. + * {Boolean} [isExpand] Whether to expand the node (else collapse). + * {Boolean} [recursive] Whether to expand/collapse child nodes recursively. + */ +treemode.expand = function (options) { + if (!options) return; + var node = this.node ? this.node.findNodeByPath(options.path) : null; + if (!node) return; + if (options.isExpand) { + node.expand(options.recursive); + } else { + node.collapse(options.recursive); + } +}; + /** * The method onChange is called whenever a field or value is changed, created, * deleted, duplicated, etc. @@ -15893,77 +15088,72 @@ treemode.collapseAll = function () { * needed to undo or redo the action. * @private */ - - treemode._onAction = function (action, params) { // add an action to the history if (this.history) { this.history.add(action, params); } - this._onChange(); }; + /** * Handle a change: * - Validate JSON schema * - Send a callback to the onChange listener if provided * @private */ - - treemode._onChange = function () { if (this.onChangeDisabled) { return; - } // selection can be changed after undo/redo - + } - this.selection = this.getDomSelection(); // validate JSON schema (if configured) + // selection can be changed after undo/redo + this.selection = this.getDomSelection(); + // validate JSON schema (if configured) this._debouncedValidate(); - if (this.treePath) { var selectedNode = this.node && this.selection ? this.node.findNodeByInternalPath(this.selection.path) : this.multiselection ? this.multiselection.nodes[0] : undefined; - if (selectedNode) { this._updateTreePath(selectedNode.getNodePath()); } else { this.treePath.reset(); } - } // trigger the onChange callback - + } + // trigger the onChange callback if (this.options.onChange) { try { this.options.onChange(); } catch (err) { console.error('Error in onChange callback: ', err); } - } // trigger the onChangeJSON callback - + } + // trigger the onChangeJSON callback if (this.options.onChangeJSON) { try { this.options.onChangeJSON(this.get()); } catch (err) { console.error('Error in onChangeJSON callback: ', err); } - } // trigger the onChangeText callback - + } + // trigger the onChangeText callback if (this.options.onChangeText) { try { this.options.onChangeText(this.getText()); } catch (err) { console.error('Error in onChangeText callback: ', err); } - } // trigger the onClassName callback - + } + // trigger the onClassName callback if (this.options.onClassName) { this.node.recursivelyUpdateCssClassesOnNodes(); - } // trigger the onNodeName callback - + } + // trigger the onNodeName callback if (this.options.onNodeName && this.node.childs) { try { this.node.recursivelyUpdateNodeName(); @@ -15972,29 +15162,24 @@ treemode._onChange = function () { } } }; + /** * Validate current JSON object against the configured JSON schema * Throws an exception when no JSON schema is configured */ - - treemode.validate = function () { var _this2 = this; - var root = this.node; - if (!root) { // TODO: this should be redundant but is needed on mode switch return; } + var json = root.getValue(); - var json = root.getValue(); // execute JSON schema validation - + // execute JSON schema validation var schemaErrors = []; - if (this.validateSchema) { var valid = this.validateSchema(json); - if (!valid) { // apply all new errors schemaErrors = this.validateSchema.errors.map(function (error) { @@ -16009,9 +15194,9 @@ treemode.validate = function () { return entry.node != null; }); } - } // execute custom validation and after than merge and render all errors - + } + // execute custom validation and after than merge and render all errors try { this.validationSequence++; var me = this; @@ -16020,38 +15205,32 @@ treemode.validate = function () { // only apply when there was no other validation started whilst resolving async results if (seq === me.validationSequence) { var errorNodes = [].concat(schemaErrors, customValidationErrors || []); - me._renderValidationErrors(errorNodes); - if (typeof _this2.options.onValidationError === 'function' && (0,util.isValidationErrorChanged)(errorNodes, _this2.lastSchemaErrors)) { _this2.options.onValidationError.call(_this2, errorNodes); } - _this2.lastSchemaErrors = errorNodes; } - return _this2.lastSchemaErrors; }); } catch (err) { return Promise.reject(err); } }; - treemode._validateAndCatch = function () { this.validate()["catch"](function (err) { console.error('Error running validation:', err); }); }; - treemode._renderValidationErrors = function (errorNodes) { // clear all current errors if (this.errorNodes) { this.errorNodes.forEach(function (node) { node.setError(null); }); - } // render the new errors - + } + // render the new errors var parentPairs = errorNodes.reduce(function (all, entry) { return entry.node.findParents().filter(function (parent) { return !all.some(function (pair) { @@ -16066,9 +15245,8 @@ treemode._renderValidationErrors = function (errorNodes) { node: pair[0], child: pair[1], error: { - message: pair[0].type === 'object' ? (0,i18n/* translate */.Iu)('containsInvalidProperties') // object - : (0,i18n/* translate */.Iu)('containsInvalidItems') // array - + message: pair[0].type === 'object' ? (0,i18n/* translate */.Tl)('containsInvalidProperties') // object + : (0,i18n/* translate */.Tl)('containsInvalidItems') // array } }; }).concat(errorNodes).map(function setError(entry) { @@ -16076,13 +15254,12 @@ treemode._renderValidationErrors = function (errorNodes) { return entry.node; }); }; + /** * Execute custom validation if configured. * * Returns a promise resolving with the custom errors (or nothing). */ - - treemode._validateCustom = function (json) { try { if (this.options.onValidate) { @@ -16093,24 +15270,20 @@ treemode._validateCustom = function (json) { if (Array.isArray(customValidationPathErrors)) { return customValidationPathErrors.filter(function (error) { var valid = (0,util.isValidValidationError)(error); - if (!valid) { console.warn('Ignoring a custom validation error with invalid structure. ' + 'Expected structure: {path: [...], message: "..."}. ' + 'Actual error:', error); } - return valid; }).map(function (error) { var node; - try { node = error && error.path ? root.findNodeByPath(error.path) : null; - } catch (err) {// stay silent here, we throw a generic warning if no node is found + } catch (err) { + // stay silent here, we throw a generic warning if no node is found } - if (!node) { console.warn('Ignoring validation error: node not found. Path:', error.path, 'Error:', error); } - return { node: node, error: error, @@ -16127,14 +15300,12 @@ treemode._validateCustom = function (json) { } catch (err) { return Promise.reject(err); } - return Promise.resolve(null); }; + /** * Refresh the rendered contents */ - - treemode.refresh = function () { if (this.node) { this.node.updateDom({ @@ -16142,13 +15313,12 @@ treemode.refresh = function () { }); } }; + /** * Start autoscrolling when given mouse position is above the top of the * editor contents, or below the bottom. * @param {Number} mouseY Absolute mouse position in pixels */ - - treemode.startAutoScroll = function (mouseY) { var me = this; var content = this.scrollableContent; @@ -16165,7 +15335,6 @@ treemode.startAutoScroll = function (mouseY) { } else { this.autoScrollStep = undefined; } - if (this.autoScrollStep) { if (!this.autoScrollTimer) { this.autoScrollTimer = setInterval(function () { @@ -16180,21 +15349,20 @@ treemode.startAutoScroll = function (mouseY) { this.stopAutoScroll(); } }; + /** * Stop auto scrolling. Only applicable when scrolling */ - - treemode.stopAutoScroll = function () { if (this.autoScrollTimer) { clearTimeout(this.autoScrollTimer); delete this.autoScrollTimer; } - if (this.autoScrollStep) { delete this.autoScrollStep; } }; + /** * Set the focus to an element in the editor, set text selection, and * set scroll position. @@ -16205,18 +15373,14 @@ treemode.stopAutoScroll = function () { * {Node[]} nodes Nodes in case of multi selection * {Number} scrollTop Scroll position */ - - treemode.setDomSelection = function (selection) { if (!selection) { return; } - if ('scrollTop' in selection && this.scrollableContent) { // TODO: animated scroll this.scrollableContent.scrollTop = selection.scrollTop; } - if (selection.paths) { // multi-select var me = this; @@ -16228,7 +15392,6 @@ treemode.setDomSelection = function (selection) { // find the actual DOM element where to apply the focus var node = selection.path ? this.node.findNodeByInternalPath(selection.path) : null; var container = node && selection.domName ? node.dom[selection.domName] : null; - if (selection.range && container) { var range = Object.assign({}, selection.range, { container: container @@ -16240,6 +15403,7 @@ treemode.setDomSelection = function (selection) { } } }; + /** * Get the current focus * @return {Object} selection An object containing fields: @@ -16249,8 +15413,6 @@ treemode.setDomSelection = function (selection) { * {Node[]} nodes Nodes in case of multi selection * {Number} scrollTop Scroll position */ - - treemode.getDomSelection = function () { // find the node and field name of the current target, // so we can store the current selection in a serializable @@ -16261,23 +15423,19 @@ treemode.getDomSelection = function () { return node.dom[domName] === focusTarget; }) : null; var range = (0,util.getSelectionOffset)(); - if (range && range.container.nodeName !== 'DIV') { // filter on (editable) divs) range = null; } - if (range && range.container !== focusTarget) { range = null; } - if (range) { // we cannot rely on the current instance of the container, // we need to store the internal node path and field and // find the actual DOM field when applying the selection delete range.container; } - return { path: node ? node.getInternalPath() : null, domName: domName, @@ -16288,6 +15446,7 @@ treemode.getDomSelection = function () { scrollTop: this.scrollableContent ? this.scrollableContent.scrollTop : 0 }; }; + /** * Adjust the scroll position such that given top position is shown at 1/4 * of the window height. @@ -16297,100 +15456,94 @@ treemode.getDomSelection = function () { * when animation is finished, or false * when not. */ - - treemode.scrollTo = function (top, animateCallback) { var content = this.scrollableContent; - if (content) { - var editor = this; // cancel any running animation - + var editor = this; + // cancel any running animation if (editor.animateTimeout) { clearTimeout(editor.animateTimeout); delete editor.animateTimeout; } - if (editor.animateCallback) { editor.animateCallback(false); delete editor.animateCallback; - } // calculate final scroll position - + } + // calculate final scroll position var height = content.clientHeight; var bottom = content.scrollHeight - height; - var finalScrollTop = Math.min(Math.max(top - height / 4, 0), bottom); // animate towards the new scroll position + var finalScrollTop = Math.min(Math.max(top - height / 4, 0), bottom); - var animate = function animate() { + // animate towards the new scroll position + var _animate = function animate() { var scrollTop = content.scrollTop; var diff = finalScrollTop - scrollTop; - if (Math.abs(diff) > 3) { content.scrollTop += diff / 3; editor.animateCallback = animateCallback; - editor.animateTimeout = setTimeout(animate, 50); + editor.animateTimeout = setTimeout(_animate, 50); } else { // finished if (animateCallback) { animateCallback(true); } - content.scrollTop = finalScrollTop; delete editor.animateTimeout; delete editor.animateCallback; } }; - - animate(); + _animate(); } else { if (animateCallback) { animateCallback(false); } } }; + /** * Create main frame * @private */ - - treemode._createFrame = function () { + var _this3 = this; // create the frame this.frame = document.createElement('div'); - this.frame.className = 'jsoneditor jsoneditor-mode-' + this.options.mode; // this.frame.setAttribute("tabindex","0"); + this.frame.className = 'jsoneditor jsoneditor-mode-' + this.options.mode; + // this.frame.setAttribute("tabindex","0"); this.container.appendChild(this.frame); this.contentOuter = document.createElement('div'); - this.contentOuter.className = 'jsoneditor-outer'; // create one global event listener to handle all events from all nodes + this.contentOuter.className = 'jsoneditor-outer'; + // create one global event listener to handle all events from all nodes var editor = this; - function onEvent(event) { // when switching to mode "code" or "text" via the menu, some events // are still fired whilst the _onEvent methods is already removed. if (editor._onEvent) { editor._onEvent(event); } - } // setting the FocusTracker on 'this.frame' to track the editor's focus event - + } + // setting the FocusTracker on 'this.frame' to track the editor's focus event var focusTrackerConfig = { target: this.frame, onFocus: this.options.onFocus || null, onBlur: this.options.onBlur || null }; - this.frameFocusTracker = new FocusTracker/* FocusTracker */.R(focusTrackerConfig); - + this.frameFocusTracker = new FocusTracker/* FocusTracker */.$(focusTrackerConfig); this.frame.onclick = function (event) { var target = event.target; // || event.srcElement; - onEvent(event); // prevent default submit action of buttons when editor is located - // inside a form + onEvent(event); + // prevent default submit action of buttons when editor is located + // inside a form if (target.nodeName === 'BUTTON') { event.preventDefault(); } }; - this.frame.oninput = onEvent; this.frame.onchange = onEvent; this.frame.onkeydown = onEvent; @@ -16400,123 +15553,132 @@ treemode._createFrame = function () { this.frame.onmousedown = onEvent; this.frame.onmouseup = onEvent; this.frame.onmouseover = onEvent; - this.frame.onmouseout = onEvent; // Note: focus and blur events do not propagate, therefore they defined + this.frame.onmouseout = onEvent; + // Note: focus and blur events do not propagate, therefore they defined // using an eventListener with useCapture=true // see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html - (0,util.addEventListener)(this.frame, 'focus', onEvent, true); (0,util.addEventListener)(this.frame, 'blur', onEvent, true); this.frame.onfocusin = onEvent; // for IE - this.frame.onfocusout = onEvent; // for IE if (this.options.mainMenuBar) { - (0,util.addClassName)(this.contentOuter, 'has-main-menu-bar'); // create menu + (0,util.addClassName)(this.contentOuter, 'has-main-menu-bar'); + // create menu this.menu = document.createElement('div'); this.menu.className = 'jsoneditor-menu'; - this.frame.appendChild(this.menu); // create expand all button + this.frame.appendChild(this.menu); + // create expand all button var expandAll = document.createElement('button'); expandAll.type = 'button'; expandAll.className = 'jsoneditor-expand-all'; - expandAll.title = (0,i18n/* translate */.Iu)('expandAll'); - + expandAll.title = (0,i18n/* translate */.Tl)('expandAll'); expandAll.onclick = function () { editor.expandAll(); + if (typeof _this3.options.onExpand === 'function') { + _this3.options.onExpand({ + path: [], + isExpand: true, + recursive: true + }); + } }; + this.menu.appendChild(expandAll); - this.menu.appendChild(expandAll); // create collapse all button - + // create collapse all button var collapseAll = document.createElement('button'); collapseAll.type = 'button'; - collapseAll.title = (0,i18n/* translate */.Iu)('collapseAll'); + collapseAll.title = (0,i18n/* translate */.Tl)('collapseAll'); collapseAll.className = 'jsoneditor-collapse-all'; - collapseAll.onclick = function () { editor.collapseAll(); + if (typeof _this3.options.onExpand === 'function') { + _this3.options.onExpand({ + path: [], + isExpand: false, + recursive: true + }); + } }; + this.menu.appendChild(collapseAll); - this.menu.appendChild(collapseAll); // create sort button - + // create sort button if (this.options.enableSort) { var sort = document.createElement('button'); sort.type = 'button'; sort.className = 'jsoneditor-sort'; - sort.title = (0,i18n/* translate */.Iu)('sortTitleShort'); - + sort.title = (0,i18n/* translate */.Tl)('sortTitleShort'); sort.onclick = function () { editor.node.showSortModal(); }; - this.menu.appendChild(sort); - } // create transform button - + } + // create transform button if (this.options.enableTransform) { var transform = document.createElement('button'); transform.type = 'button'; - transform.title = (0,i18n/* translate */.Iu)('transformTitleShort'); + transform.title = (0,i18n/* translate */.Tl)('transformTitleShort'); transform.className = 'jsoneditor-transform'; - transform.onclick = function () { editor.node.showTransformModal(); }; - this.menu.appendChild(transform); - } // create undo/redo buttons - + } + // create undo/redo buttons if (this.history) { // create undo button var undo = document.createElement('button'); undo.type = 'button'; undo.className = 'jsoneditor-undo jsoneditor-separator'; - undo.title = (0,i18n/* translate */.Iu)('undo'); - + undo.title = (0,i18n/* translate */.Tl)('undo'); undo.onclick = function () { editor._onUndo(); }; - this.menu.appendChild(undo); - this.dom.undo = undo; // create redo button + this.dom.undo = undo; + // create redo button var redo = document.createElement('button'); redo.type = 'button'; redo.className = 'jsoneditor-redo'; - redo.title = (0,i18n/* translate */.Iu)('redo'); - + redo.title = (0,i18n/* translate */.Tl)('redo'); redo.onclick = function () { editor._onRedo(); }; - this.menu.appendChild(redo); - this.dom.redo = redo; // register handler for onchange of history + this.dom.redo = redo; + // register handler for onchange of history this.history.onChange = function () { undo.disabled = !editor.history.canUndo(); redo.disabled = !editor.history.canRedo(); }; - this.history.onChange(); - } // create mode box - + } + // create mode box if (this.options && this.options.modes && this.options.modes.length) { var me = this; - this.modeSwitcher = new ModeSwitcher/* ModeSwitcher */.x(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) { + this.modeSwitcher = new ModeSwitcher/* ModeSwitcher */.n(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) { // switch mode and restore focus - me.setMode(mode); - me.modeSwitcher.focus(); + try { + me.setMode(mode); + me.modeSwitcher.focus(); + } catch (err) { + me._onError(err); + } }); - } // create search box - + } + // create search box if (this.options.search) { this.searchBox = new SearchBox(this, this.menu); } } - if (this.options.navigationBar) { // create second menu row for treepath this.navBar = document.createElement('div'); @@ -16527,69 +15689,61 @@ treemode._createFrame = function () { this.treePath.onContextMenuItemSelected(this._onTreePathMenuItemSelected.bind(this)); } }; + /** * Perform an undo action * @private */ - - treemode._onUndo = function () { if (this.history) { // undo last action - this.history.undo(); // fire change event + this.history.undo(); + // fire change event this._onChange(); } }; + /** * Perform a redo action * @private */ - - treemode._onRedo = function () { if (this.history) { // redo last action - this.history.redo(); // fire change event + this.history.redo(); + // fire change event this._onChange(); } }; + /** * Event handler * @param event * @private */ - - treemode._onEvent = function (event) { // don't process events when coming from the color picker if (Node.targetIsColorPicker(event.target)) { return; } - var node = Node.getNodeFromTarget(event.target); - if (event.type === 'keydown') { this._onKeyDown(event); } - if (node && event.type === 'focus') { this.focusTarget = event.target; - if (this.options.autocomplete && this.options.autocomplete.trigger === 'focus') { this._showAutoComplete(event.target); } } - if (event.type === 'mousedown') { this._startDragDistance(event); } - if (event.type === 'mousemove' || event.type === 'mouseup' || event.type === 'click') { this._updateDragDistance(event); } - if (node && this.options && this.options.navigationBar && node && (event.type === 'keydown' || event.type === 'mousedown')) { // apply on next tick, right after the new key press is applied var me = this; @@ -16597,21 +15751,20 @@ treemode._onEvent = function (event) { me._updateTreePath(node.getNodePath()); }); } - if (node && node.selected) { if (event.type === 'click') { if (event.target === node.dom.menu) { - this.showContextMenu(event.target); // stop propagation (else we will open the context menu of a single node) + this.showContextMenu(event.target); + // stop propagation (else we will open the context menu of a single node) return; - } // deselect a multi selection - + } + // deselect a multi selection if (!event.hasMoved) { this.deselect(); } } - if (event.type === 'mousedown') { // drag multiple nodes Node.onDragStart(this.multiselection.nodes, event); @@ -16620,7 +15773,6 @@ treemode._onEvent = function (event) { // filter mouse events in the contents part of the editor (not the main menu) if (event.type === 'mousedown' && (0,util.hasParentNode)(event.target, this.content)) { this.deselect(); - if (node && event.target === node.dom.drag) { // drag a singe node Node.onDragStart(node, event); @@ -16630,18 +15782,16 @@ treemode._onEvent = function (event) { } } } - if (node) { node.onEvent(event); } }; + /** * Update TreePath components * @param {Array} pathNodes list of nodes in path from root to selection * @private */ - - treemode._updateTreePath = function (pathNodes) { if (pathNodes && pathNodes.length) { (0,util.removeClassName)(this.navBar, 'nav-bar-empty'); @@ -16652,7 +15802,6 @@ treemode._updateTreePath = function (pathNodes) { node: node, children: [] }; - if (node.childs && node.childs.length) { node.childs.forEach(function (childNode) { pathObj.children.push({ @@ -16661,54 +15810,47 @@ treemode._updateTreePath = function (pathNodes) { }); }); } - pathObjs.push(pathObj); }); this.treePath.setPath(pathObjs); } else { (0,util.addClassName)(this.navBar, 'nav-bar-empty'); } - function getName(node) { return node.parent ? node.parent.type === 'array' ? node.index : node.field : node.field || node.type; } }; + /** * Callback for tree path section selection - focus the selected node in the tree * @param {Object} pathObj path object that was represents the selected section node * @private */ - - treemode._onTreePathSectionSelected = function (pathObj) { if (pathObj && pathObj.node) { pathObj.node.expandTo(); pathObj.node.focus(); } }; + /** * Callback for tree path menu item selection - rebuild the path accrding to the new selection and focus the selected node in the tree * @param {Object} pathObj path object that was represents the parent section node * @param {String} selection selected section child * @private */ - - treemode._onTreePathMenuItemSelected = function (pathObj, selection) { if (pathObj && pathObj.children.length) { var selectionObj = pathObj.children.find(function (obj) { return obj.name === selection; }); - if (selectionObj && selectionObj.node) { this._updateTreePath(selectionObj.node.getNodePath()); - selectionObj.node.expandTo(); selectionObj.node.focus(); } } }; - treemode._startDragDistance = function (event) { this.dragDistanceEvent = { initialTarget: event.target, @@ -16718,12 +15860,10 @@ treemode._startDragDistance = function (event) { hasMoved: false }; }; - treemode._updateDragDistance = function (event) { if (!this.dragDistanceEvent) { this._startDragDistance(event); } - var diffX = event.pageX - this.dragDistanceEvent.initialPageX; var diffY = event.pageY - this.dragDistanceEvent.initialPageY; this.dragDistanceEvent.dragDistance = Math.sqrt(diffX * diffX + diffY * diffY); @@ -16732,159 +15872,134 @@ treemode._updateDragDistance = function (event) { event.hasMoved = this.dragDistanceEvent.hasMoved; return event.dragDistance; }; + /** * Start multi selection of nodes by dragging the mouse * @param {MouseEvent} event * @private */ - - treemode._onMultiSelectStart = function (event) { var node = Node.getNodeFromTarget(event.target); - if (this.options.mode !== 'tree' || this.options.onEditable !== undefined) { // dragging not allowed in modes 'view' and 'form' // TODO: allow multiselection of items when option onEditable is specified return; } - this.multiselection = { start: node || null, end: null, nodes: [] }; - this._startDragDistance(event); - var editor = this; - if (!this.mousemove) { this.mousemove = (0,util.addEventListener)(event.view, 'mousemove', function (event) { editor._onMultiSelect(event); }); } - if (!this.mouseup) { this.mouseup = (0,util.addEventListener)(event.view, 'mouseup', function (event) { editor._onMultiSelectEnd(event); }); } - event.preventDefault(); }; + /** * Multiselect nodes by dragging * @param {MouseEvent} event * @private */ - - treemode._onMultiSelect = function (event) { event.preventDefault(); - this._updateDragDistance(event); - if (!event.hasMoved) { return; } - var node = Node.getNodeFromTarget(event.target); - if (node) { if (this.multiselection.start == null) { this.multiselection.start = node; } - this.multiselection.end = node; - } // deselect previous selection - + } - this.deselect(); // find the selected nodes in the range from first to last + // deselect previous selection + this.deselect(); + // find the selected nodes in the range from first to last var start = this.multiselection.start; var end = this.multiselection.end || this.multiselection.start; - if (start && end) { // find the top level childs, all having the same parent this.multiselection.nodes = this._findTopLevelNodes(start, end); - if (this.multiselection.nodes && this.multiselection.nodes.length) { var firstNode = this.multiselection.nodes[0]; - if (this.multiselection.start === firstNode || this.multiselection.start.isDescendantOf(firstNode)) { this.multiselection.direction = 'down'; } else { this.multiselection.direction = 'up'; } } - this.select(this.multiselection.nodes); } }; + /** * End of multiselect nodes by dragging * @param {MouseEvent} event * @private */ - - treemode._onMultiSelectEnd = function (event) { // set focus to the context menu button of the first node var firstNode = this.multiselection.nodes[0]; - if (firstNode && firstNode.dom.menu) { firstNode.dom.menu.focus(); } - this.multiselection.start = null; - this.multiselection.end = null; // cleanup global event listeners + this.multiselection.end = null; + // cleanup global event listeners if (this.mousemove) { (0,util.removeEventListener)(event.view, 'mousemove', this.mousemove); delete this.mousemove; } - if (this.mouseup) { (0,util.removeEventListener)(event.view, 'mouseup', this.mouseup); delete this.mouseup; } }; + /** * deselect currently selected nodes * @param {boolean} [clearStartAndEnd=false] If true, the `start` and `end` * state is cleared too. */ - - treemode.deselect = function (clearStartAndEnd) { var selectionChanged = !!this.multiselection.nodes.length; this.multiselection.nodes.forEach(function (node) { node.setSelected(false); }); this.multiselection.nodes = []; - if (clearStartAndEnd) { this.multiselection.start = null; this.multiselection.end = null; } - if (selectionChanged) { if (this._selectionChangedHandler) { this._selectionChangedHandler(); } } }; + /** * select nodes * @param {Node[] | Node} nodes */ - - treemode.select = function (nodes) { if (!Array.isArray(nodes)) { return this.select([nodes]); } - if (nodes) { this.deselect(); this.multiselection.nodes = nodes.slice(0); @@ -16893,14 +16008,13 @@ treemode.select = function (nodes) { node.expandPathToNode(); node.setSelected(true, node === first); }); - if (this._selectionChangedHandler) { var selection = this.getSelection(); - this._selectionChangedHandler(selection.start, selection.end); } } }; + /** * From two arbitrary selected nodes, find their shared parent node. * From that parent node, select the two child nodes in the brances going to @@ -16910,21 +16024,16 @@ treemode.select = function (nodes) { * @return {Array.} Returns an ordered list with child nodes * @private */ - - treemode._findTopLevelNodes = function (start, end) { var startPath = start.getNodePath(); var endPath = end.getNodePath(); var i = 0; - while (i < startPath.length && startPath[i] === endPath[i]) { i++; } - var root = startPath[i - 1]; var startChild = startPath[i]; var endChild = endPath[i]; - if (!startChild || !endChild) { if (root.parent) { // startChild is a parent of endChild or vice versa @@ -16937,7 +16046,6 @@ treemode._findTopLevelNodes = function (start, end) { endChild = root.childs[root.childs.length - 1]; } } - if (root && startChild && endChild) { var startIndex = root.childs.indexOf(startChild); var endIndex = root.childs.indexOf(endChild); @@ -16948,29 +16056,25 @@ treemode._findTopLevelNodes = function (start, end) { return []; } }; + /** * Show autocomplete menu * @param {HTMLElement} element * @private */ - - treemode._showAutoComplete = function (element) { var node = Node.getNodeFromTarget(element); var jsonElementType = ''; if (element.className.indexOf('jsoneditor-value') >= 0) jsonElementType = 'value'; if (element.className.indexOf('jsoneditor-field') >= 0) jsonElementType = 'field'; - if (jsonElementType === '') { // Unknown element field. Could be a button or something else return; } - var self = this; setTimeout(function () { if (node && (self.options.autocomplete.trigger === 'focus' || element.innerText.length > 0)) { var result = self.options.autocomplete.getOptions(element.innerText, node.getPath(), jsonElementType, node.editor); - if (result === null) { self.autocomplete.hideDropDown(); } else if (typeof result.then === 'function') { @@ -16999,13 +16103,12 @@ treemode._showAutoComplete = function (element) { } }, 50); }; + /** * Event handler for keydown. Handles shortcut keys * @param {Event} event * @private */ - - treemode._onKeyDown = function (event) { var keynum = event.which || event.keyCode; var altKey = event.altKey; @@ -17014,7 +16117,6 @@ treemode._onKeyDown = function (event) { var shiftKey = event.shiftKey; var handled = false; var currentTarget = this.focusTarget; - if (keynum === 9) { // Tab or Shift+Tab var me = this; @@ -17031,7 +16133,6 @@ treemode._onKeyDown = function (event) { } }, 0); } - if (this.searchBox) { if (ctrlKey && keynum === 70) { // Ctrl+F @@ -17041,7 +16142,6 @@ treemode._onKeyDown = function (event) { } else if (keynum === 114 || ctrlKey && keynum === 71) { // F3 or Ctrl+G var focus = true; - if (!shiftKey) { // select next search result (F3 or Ctrl+G) this.searchBox.next(focus); @@ -17049,76 +16149,68 @@ treemode._onKeyDown = function (event) { // select previous search result (Shift+F3 or Ctrl+Shift+G) this.searchBox.previous(focus); } - handled = true; } } - if (this.history) { if (ctrlKey && !shiftKey && keynum === 90) { // Ctrl+Z // undo this._onUndo(); - handled = true; } else if (ctrlKey && shiftKey && keynum === 90) { // Ctrl+Shift+Z // redo this._onRedo(); - handled = true; } } - if (this.options.autocomplete && !handled) { if (!ctrlKey && !altKey && !metaKey && (event.key.length === 1 || keynum === 8 || keynum === 46)) { - handled = false; // Activate autocomplete - + handled = false; + // Activate autocomplete this._showAutoComplete(event.target); } } - if (handled) { event.preventDefault(); event.stopPropagation(); } }; + /** * Create main table * @private */ - - treemode._createTable = function () { if (this.options.navigationBar) { (0,util.addClassName)(this.contentOuter, 'has-nav-bar'); } - this.scrollableContent = document.createElement('div'); this.scrollableContent.className = 'jsoneditor-tree'; - this.contentOuter.appendChild(this.scrollableContent); // the jsoneditor-tree-inner div with bottom padding is here to + this.contentOuter.appendChild(this.scrollableContent); + + // the jsoneditor-tree-inner div with bottom padding is here to // keep space for the action menu dropdown. It's created as a // separate div instead of using scrollableContent to work around // and issue in the Chrome browser showing scrollable contents outside of the div // see https://github.com/josdejong/jsoneditor/issues/557 - this.content = document.createElement('div'); this.content.className = 'jsoneditor-tree-inner'; this.scrollableContent.appendChild(this.content); this.table = document.createElement('table'); this.table.className = 'jsoneditor-tree'; - this.content.appendChild(this.table); // create colgroup where the first two columns don't have a fixed - // width, and the edit columns do have a fixed width + this.content.appendChild(this.table); + // create colgroup where the first two columns don't have a fixed + // width, and the edit columns do have a fixed width var col; this.colgroupContent = document.createElement('colgroup'); - if (this.options.mode === 'tree') { col = document.createElement('col'); col.width = '24px'; this.colgroupContent.appendChild(col); } - col = document.createElement('col'); col.width = '24px'; this.colgroupContent.appendChild(col); @@ -17129,6 +16221,7 @@ treemode._createTable = function () { this.table.appendChild(this.tbody); this.frame.appendChild(this.contentOuter); }; + /** * Show a contextmenu for this node. * Used for multiselection @@ -17136,30 +16229,29 @@ treemode._createTable = function () { * @param {function} [onClose] Callback method called when the context menu * is being closed. */ - - treemode.showContextMenu = function (anchor, onClose) { var items = []; - var selectedNodes = this.multiselection.nodes.slice(); // create duplicate button + var selectedNodes = this.multiselection.nodes.slice(); + // create duplicate button items.push({ - text: (0,i18n/* translate */.Iu)('duplicateText'), - title: (0,i18n/* translate */.Iu)('duplicateTitle'), + text: (0,i18n/* translate */.Tl)('duplicateText'), + title: (0,i18n/* translate */.Tl)('duplicateTitle'), className: 'jsoneditor-duplicate', click: function click() { Node.onDuplicate(selectedNodes); } - }); // create remove button + }); + // create remove button items.push({ - text: (0,i18n/* translate */.Iu)('remove'), - title: (0,i18n/* translate */.Iu)('removeTitle'), + text: (0,i18n/* translate */.Tl)('remove'), + title: (0,i18n/* translate */.Tl)('removeTitle'), className: 'jsoneditor-remove', click: function click() { Node.onRemove(selectedNodes); } }); - if (this.options.onCreateMenu) { var paths = selectedNodes.map(function (node) { return node.getPath(); @@ -17170,33 +16262,28 @@ treemode.showContextMenu = function (anchor, onClose) { paths: paths }); } - - var menu = new ContextMenu/* ContextMenu */.x(items, { + var menu = new ContextMenu/* ContextMenu */.t(items, { close: onClose }); menu.show(anchor, this.getPopupAnchor()); }; - treemode.getPopupAnchor = function () { return this.options.popupAnchor || this.frame; }; + /** * Get current selected nodes * @return {{start:SerializableNode, end: SerializableNode}} */ - - treemode.getSelection = function () { var selection = { start: null, end: null }; - if (this.multiselection.nodes && this.multiselection.nodes.length) { if (this.multiselection.nodes.length) { var selection1 = this.multiselection.nodes[0]; var selection2 = this.multiselection.nodes[this.multiselection.nodes.length - 1]; - if (this.multiselection.direction === 'down') { selection.start = selection1.serialize(); selection.end = selection2.serialize(); @@ -17206,22 +16293,21 @@ treemode.getSelection = function () { } } } - return selection; }; + /** * Callback registration for selection change * @param {selectionCallback} callback * * @callback selectionCallback */ - - treemode.onSelectionChange = function (callback) { if (typeof callback === 'function') { this._selectionChangedHandler = (0,util.debounce)(callback, this.DEBOUNCE_INTERVAL); } }; + /** * Select range of nodes. * For selecting single node send only the start parameter @@ -17230,22 +16316,19 @@ treemode.onSelectionChange = function (callback) { * @param {{path: Array.}} start object contains the path for selection start * @param {{path: Array.}} end object contains the path for selection end */ - - treemode.setSelection = function (start, end) { // check for old usage if (start && start.dom && start.range) { console.warn('setSelection/getSelection usage for text selection is deprecated and should not be used, see documentation for supported selection options'); this.setDomSelection(start); } - var nodes = this._getNodeInstancesByRange(start, end); - nodes.forEach(function (node) { node.expandTo(); }); this.select(nodes); }; + /** * Returns a set of Nodes according to a range of selection * @param {{path: Array.}} start object contains the path for range start @@ -17253,21 +16336,15 @@ treemode.setSelection = function (start, end) { * @return {Array.} Node instances on the given range * @private */ - - treemode._getNodeInstancesByRange = function (start, end) { var startNode, endNode; - if (start && start.path) { startNode = this.node.findNodeByPath(start.path); - if (end && end.path) { endNode = this.node.findNodeByPath(end.path); } } - var nodes = []; - if (startNode instanceof Node) { if (endNode instanceof Node && endNode !== startNode) { if (startNode.parent === endNode.parent) { @@ -17278,10 +16355,8 @@ treemode._getNodeInstancesByRange = function (start, end) { start = endNode; end = startNode; } - var current = start; nodes.push(current); - do { current = current.nextSibling(); nodes.push(current); @@ -17293,21 +16368,18 @@ treemode._getNodeInstancesByRange = function (start, end) { nodes.push(startNode); } } - return nodes; }; - treemode.getNodesByRange = function (start, end) { var nodes = this._getNodeInstancesByRange(start, end); - var serializableNodes = []; nodes.forEach(function (node) { serializableNodes.push(node.serialize()); }); return serializableNodes; -}; // define modes - +}; +// define modes var treeModeMixins = [{ mode: 'tree', mixin: treemode, @@ -17324,24 +16396,25 @@ var treeModeMixins = [{ /***/ }), -/***/ 2744: +/***/ 2870: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { exports.tryRequireAjv = function () { try { - return __webpack_require__(8903); - } catch (err) {// no problem... when we need Ajv we will throw a neat exception + return __webpack_require__(2229); + } catch (err) { + // no problem... when we need Ajv we will throw a neat exception } }; /***/ }), -/***/ 9125: +/***/ 5467: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { -exports.O = function () { +exports.J = function () { try { - __webpack_require__(4864); + __webpack_require__(9762); } catch (err) { console.error(err); } @@ -17349,82 +16422,89 @@ exports.O = function () { /***/ }), -/***/ 9791: +/***/ 6237: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "parse": function() { return /* binding */ parse; }, -/* harmony export */ "tryJsonRepair": function() { return /* binding */ tryJsonRepair; }, -/* harmony export */ "escapeUnicodeChars": function() { return /* binding */ escapeUnicodeChars; }, -/* harmony export */ "validate": function() { return /* binding */ validate; }, -/* harmony export */ "extend": function() { return /* binding */ extend; }, -/* harmony export */ "clear": function() { return /* binding */ clear; }, -/* harmony export */ "getType": function() { return /* binding */ getType; }, -/* harmony export */ "isUrl": function() { return /* binding */ isUrl; }, -/* harmony export */ "isArray": function() { return /* binding */ isArray; }, -/* harmony export */ "getWindow": function() { return /* binding */ getWindow; }, -/* harmony export */ "getAbsoluteLeft": function() { return /* binding */ getAbsoluteLeft; }, -/* harmony export */ "getAbsoluteTop": function() { return /* binding */ getAbsoluteTop; }, -/* harmony export */ "addClassName": function() { return /* binding */ addClassName; }, -/* harmony export */ "removeAllClassNames": function() { return /* binding */ removeAllClassNames; }, -/* harmony export */ "removeClassName": function() { return /* binding */ removeClassName; }, -/* harmony export */ "stripFormatting": function() { return /* binding */ stripFormatting; }, -/* harmony export */ "setEndOfContentEditable": function() { return /* binding */ setEndOfContentEditable; }, -/* harmony export */ "selectContentEditable": function() { return /* binding */ selectContentEditable; }, -/* harmony export */ "getSelection": function() { return /* binding */ getSelection; }, -/* harmony export */ "setSelection": function() { return /* binding */ setSelection; }, -/* harmony export */ "getSelectionOffset": function() { return /* binding */ getSelectionOffset; }, -/* harmony export */ "setSelectionOffset": function() { return /* binding */ setSelectionOffset; }, -/* harmony export */ "getInnerText": function() { return /* binding */ getInnerText; }, -/* harmony export */ "hasParentNode": function() { return /* binding */ hasParentNode; }, -/* harmony export */ "getInternetExplorerVersion": function() { return /* binding */ getInternetExplorerVersion; }, -/* harmony export */ "isFirefox": function() { return /* binding */ isFirefox; }, -/* harmony export */ "addEventListener": function() { return /* binding */ addEventListener; }, -/* harmony export */ "removeEventListener": function() { return /* binding */ removeEventListener; }, -/* harmony export */ "isChildOf": function() { return /* binding */ isChildOf; }, -/* harmony export */ "parsePath": function() { return /* binding */ parsePath; }, -/* harmony export */ "stringifyPath": function() { return /* binding */ stringifyPath; }, -/* harmony export */ "improveSchemaError": function() { return /* binding */ improveSchemaError; }, -/* harmony export */ "isPromise": function() { return /* binding */ isPromise; }, -/* harmony export */ "isValidValidationError": function() { return /* binding */ isValidValidationError; }, -/* harmony export */ "insideRect": function() { return /* binding */ insideRect; }, -/* harmony export */ "debounce": function() { return /* binding */ debounce; }, -/* harmony export */ "textDiff": function() { return /* binding */ textDiff; }, -/* harmony export */ "getInputSelection": function() { return /* binding */ getInputSelection; }, -/* harmony export */ "getIndexForPosition": function() { return /* binding */ getIndexForPosition; }, -/* harmony export */ "getPositionForPath": function() { return /* binding */ getPositionForPath; }, -/* harmony export */ "compileJSONPointer": function() { return /* binding */ compileJSONPointer; }, -/* harmony export */ "getColorCSS": function() { return /* binding */ getColorCSS; }, -/* harmony export */ "isValidColor": function() { return /* binding */ isValidColor; }, -/* harmony export */ "makeFieldTooltip": function() { return /* binding */ makeFieldTooltip; }, -/* harmony export */ "get": function() { return /* binding */ get; }, -/* harmony export */ "findUniqueName": function() { return /* binding */ findUniqueName; }, -/* harmony export */ "getChildPaths": function() { return /* binding */ getChildPaths; }, -/* harmony export */ "sort": function() { return /* binding */ sort; }, -/* harmony export */ "sortObjectKeys": function() { return /* binding */ sortObjectKeys; }, -/* harmony export */ "parseString": function() { return /* binding */ parseString; }, -/* harmony export */ "isTimestamp": function() { return /* binding */ isTimestamp; }, -/* harmony export */ "formatSize": function() { return /* binding */ formatSize; }, -/* harmony export */ "limitCharacters": function() { return /* binding */ limitCharacters; }, -/* harmony export */ "isObject": function() { return /* binding */ isObject; }, -/* harmony export */ "contains": function() { return /* binding */ contains; }, -/* harmony export */ "isValidationErrorChanged": function() { return /* binding */ isValidationErrorChanged; } +/* harmony export */ addClassName: function() { return /* binding */ addClassName; }, +/* harmony export */ addEventListener: function() { return /* binding */ addEventListener; }, +/* harmony export */ asyncExec: function() { return /* binding */ asyncExec; }, +/* harmony export */ clear: function() { return /* binding */ clear; }, +/* harmony export */ compileJSONPointer: function() { return /* binding */ compileJSONPointer; }, +/* harmony export */ contains: function() { return /* binding */ contains; }, +/* harmony export */ debounce: function() { return /* binding */ debounce; }, +/* harmony export */ escapeUnicodeChars: function() { return /* binding */ escapeUnicodeChars; }, +/* harmony export */ extend: function() { return /* binding */ extend; }, +/* harmony export */ findUniqueName: function() { return /* binding */ findUniqueName; }, +/* harmony export */ formatSize: function() { return /* binding */ formatSize; }, +/* harmony export */ get: function() { return /* binding */ get; }, +/* harmony export */ getAbsoluteLeft: function() { return /* binding */ getAbsoluteLeft; }, +/* harmony export */ getAbsoluteTop: function() { return /* binding */ getAbsoluteTop; }, +/* harmony export */ getChildPaths: function() { return /* binding */ getChildPaths; }, +/* harmony export */ getColorCSS: function() { return /* binding */ getColorCSS; }, +/* harmony export */ getIndexForPosition: function() { return /* binding */ getIndexForPosition; }, +/* harmony export */ getInnerText: function() { return /* binding */ getInnerText; }, +/* harmony export */ getInputSelection: function() { return /* binding */ getInputSelection; }, +/* harmony export */ getInternetExplorerVersion: function() { return /* binding */ getInternetExplorerVersion; }, +/* harmony export */ getPositionForPath: function() { return /* binding */ getPositionForPath; }, +/* harmony export */ getSelection: function() { return /* binding */ getSelection; }, +/* harmony export */ getSelectionOffset: function() { return /* binding */ getSelectionOffset; }, +/* harmony export */ getType: function() { return /* binding */ getType; }, +/* harmony export */ getWindow: function() { return /* binding */ getWindow; }, +/* harmony export */ hasParentNode: function() { return /* binding */ hasParentNode; }, +/* harmony export */ improveSchemaError: function() { return /* binding */ improveSchemaError; }, +/* harmony export */ insideRect: function() { return /* binding */ insideRect; }, +/* harmony export */ isArray: function() { return /* binding */ isArray; }, +/* harmony export */ isChildOf: function() { return /* binding */ isChildOf; }, +/* harmony export */ isFirefox: function() { return /* binding */ isFirefox; }, +/* harmony export */ isObject: function() { return /* binding */ isObject; }, +/* harmony export */ isPromise: function() { return /* binding */ isPromise; }, +/* harmony export */ isTimestamp: function() { return /* binding */ isTimestamp; }, +/* harmony export */ isUrl: function() { return /* binding */ isUrl; }, +/* harmony export */ isValidColor: function() { return /* binding */ isValidColor; }, +/* harmony export */ isValidValidationError: function() { return /* binding */ isValidValidationError; }, +/* harmony export */ isValidationErrorChanged: function() { return /* binding */ isValidationErrorChanged; }, +/* harmony export */ limitCharacters: function() { return /* binding */ limitCharacters; }, +/* harmony export */ makeFieldTooltip: function() { return /* binding */ makeFieldTooltip; }, +/* harmony export */ parse: function() { return /* binding */ parse; }, +/* harmony export */ parsePath: function() { return /* binding */ parsePath; }, +/* harmony export */ parseString: function() { return /* binding */ parseString; }, +/* harmony export */ removeAllClassNames: function() { return /* binding */ removeAllClassNames; }, +/* harmony export */ removeClassName: function() { return /* binding */ removeClassName; }, +/* harmony export */ removeEventListener: function() { return /* binding */ removeEventListener; }, +/* harmony export */ removeReturnsAndSurroundingWhitespace: function() { return /* binding */ removeReturnsAndSurroundingWhitespace; }, +/* harmony export */ selectContentEditable: function() { return /* binding */ selectContentEditable; }, +/* harmony export */ setEndOfContentEditable: function() { return /* binding */ setEndOfContentEditable; }, +/* harmony export */ setSelection: function() { return /* binding */ setSelection; }, +/* harmony export */ setSelectionOffset: function() { return /* binding */ setSelectionOffset; }, +/* harmony export */ sort: function() { return /* binding */ sort; }, +/* harmony export */ sortObjectKeys: function() { return /* binding */ sortObjectKeys; }, +/* harmony export */ stringifyPath: function() { return /* binding */ stringifyPath; }, +/* harmony export */ stripFormatting: function() { return /* binding */ stripFormatting; }, +/* harmony export */ textDiff: function() { return /* binding */ textDiff; }, +/* harmony export */ tryJsonRepair: function() { return /* binding */ tryJsonRepair; }, +/* harmony export */ uniqueMergeArrays: function() { return /* binding */ uniqueMergeArrays; }, +/* harmony export */ validate: function() { return /* binding */ validate; } /* harmony export */ }); -/* harmony import */ var _polyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4987); +/* harmony import */ var _polyfills__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1081); /* harmony import */ var _polyfills__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_polyfills__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var javascript_natural_sort__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(233); +/* harmony import */ var javascript_natural_sort__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1342); /* harmony import */ var javascript_natural_sort__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(javascript_natural_sort__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var jsonrepair__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8909); -/* harmony import */ var jsonrepair__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jsonrepair__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6589); -/* harmony import */ var json_source_map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7026); -/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7907); +/* harmony import */ var jsonrepair__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9857); +/* harmony import */ var _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5736); +/* harmony import */ var json_source_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3094); +/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3057); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - +function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } +function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } @@ -17433,52 +16513,56 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi var MAX_ITEMS_FIELDS_COLLECTION = 10000; var YEAR_2000 = 946684800000; + /** * Parse JSON using the parser built-in in the browser. * On exception, the jsonString is validated and a detailed error is thrown. * @param {String} jsonString * @return {JSON} json */ - function parse(jsonString) { try { return JSON.parse(jsonString); } catch (err) { // try to throw a more detailed error message using validate - validate(jsonString); // rethrow the original error + validate(jsonString); + // rethrow the original error throw err; } } + /** * Try to fix the JSON string. If not successful, return the original string * @param {string} jsonString */ - function tryJsonRepair(jsonString) { try { - return jsonrepair__WEBPACK_IMPORTED_MODULE_2___default()(jsonString); + return (0,jsonrepair__WEBPACK_IMPORTED_MODULE_5__/* .jsonrepair */ .m)(jsonString); } catch (err) { // repair was not successful, return original text return jsonString; } } + /** * Escape unicode characters. * For example input '\u2661' (length 1) will output '\\u2661' (length 5). * @param {string} text * @return {string} */ - -function escapeUnicodeChars( // see https://www.wikiwand.com/en/UTF-16 +function escapeUnicodeChars( +// see https://www.wikiwand.com/en/UTF-16 text) { - return (// note: we leave surrogate pairs as two individual chars, + return ( + // note: we leave surrogate pairs as two individual chars, // as JSON doesn't interpret them as a single unicode char. text.replace(/[\u007F-\uFFFF]/g, function (c) { return "\\u" + ('0000' + c.charCodeAt(0).toString(16)).slice(-4); }) ); } + /** * Validate a string containing a JSON object * This method uses JSONLint to validate the String. If JSONLint is not @@ -17486,206 +16570,191 @@ text) { * @param {String} jsonString String with an (invalid) JSON object * @throws Error */ - function validate(jsonString) { - if (typeof _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_3__ !== 'undefined') { - _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_3__.parse(jsonString); + if (typeof _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_2__ !== 'undefined') { + _assets_jsonlint_jsonlint__WEBPACK_IMPORTED_MODULE_2__.parse(jsonString); } else { JSON.parse(jsonString); } } + /** * Extend object a with the properties of object b * @param {Object} a * @param {Object} b * @return {Object} a */ - function extend(a, b) { for (var prop in b) { if (hasOwnProperty(b, prop)) { a[prop] = b[prop]; } } - return a; } + /** * Remove all properties from object a * @param {Object} a * @return {Object} a */ - function clear(a) { for (var prop in a) { if (hasOwnProperty(a, prop)) { delete a[prop]; } } - return a; } + /** * Get the type of an object * @param {*} object * @return {String} type */ - function getType(object) { if (object === null) { return 'null'; } - if (object === undefined) { return 'undefined'; } - if (object instanceof Number || typeof object === 'number') { return 'number'; } - if (object instanceof String || typeof object === 'string') { return 'string'; } - if (object instanceof Boolean || typeof object === 'boolean') { return 'boolean'; } - if (object instanceof RegExp) { return 'regexp'; } - if (isArray(object)) { return 'array'; } - return 'object'; } + /** * Test whether a text contains a url (matches when a string starts * with 'http://*' or 'https://*' and has no whitespace characters) * @param {String} text */ - var isUrlRegex = /^https?:\/\/\S+$/; function isUrl(text) { return (typeof text === 'string' || text instanceof String) && isUrlRegex.test(text); } + /** * Tes whether given object is an Array * @param {*} obj * @returns {boolean} returns true when obj is an array */ - function isArray(obj) { return Object.prototype.toString.call(obj) === '[object Array]'; } + /** * Gets a DOM element's Window. This is normally just the global `window` * variable, but if we opened a child window, it may be different. * @param {HTMLElement} element * @return {Window} */ - function getWindow(element) { return element.ownerDocument.defaultView; } + /** * Retrieve the absolute left value of a DOM element * @param {Element} elem A dom element, for example a div * @return {Number} left The absolute left position of this element * in the browser page. */ - function getAbsoluteLeft(elem) { var rect = elem.getBoundingClientRect(); return rect.left + window.pageXOffset || document.scrollLeft || 0; } + /** * Retrieve the absolute top value of a DOM element * @param {Element} elem A dom element, for example a div * @return {Number} top The absolute top position of this element * in the browser page. */ - function getAbsoluteTop(elem) { var rect = elem.getBoundingClientRect(); return rect.top + window.pageYOffset || document.scrollTop || 0; } + /** * add a className to the given elements style * @param {Element} elem * @param {String} className */ - function addClassName(elem, className) { var classes = elem.className.split(' '); - if (classes.indexOf(className) === -1) { classes.push(className); // add the class to the array - elem.className = classes.join(' '); } } + /** * remove all classes from the given elements style * @param {Element} elem */ - function removeAllClassNames(elem) { elem.className = ''; } + /** * add a className to the given elements style * @param {Element} elem * @param {String} className */ - function removeClassName(elem, className) { var classes = elem.className.split(' '); var index = classes.indexOf(className); - if (index !== -1) { classes.splice(index, 1); // remove the class from the array - elem.className = classes.join(' '); } } + /** * Strip the formatting from the contents of a div * the formatting from the div itself is not stripped, only from its childs. * @param {Element} divElement */ - function stripFormatting(divElement) { var childs = divElement.childNodes; - for (var i = 0, iMax = childs.length; i < iMax; i++) { - var child = childs[i]; // remove the style + var child = childs[i]; + // remove the style if (child.style) { // TODO: test if child.attributes does contain style child.removeAttribute('style'); - } // remove all attributes - + } + // remove all attributes var attributes = child.attributes; - if (attributes) { for (var j = attributes.length - 1; j >= 0; j--) { var attribute = attributes[j]; - if (attribute.specified === true) { child.removeAttribute(attribute.name); } } - } // recursively strip childs - + } + // recursively strip childs stripFormatting(child); } } + /** * Set focus to the end of an editable div * code from Nico Burns @@ -17693,37 +16762,28 @@ function stripFormatting(divElement) { * http://stackoverflow.com/questions/1125292/how-to-move-cursor-to-end-of-contenteditable-entity * @param {Element} contentEditableElement A content editable div */ - function setEndOfContentEditable(contentEditableElement) { var range, selection; - if (document.createRange) { range = document.createRange(); // Create a range (a range is a like the selection but invisible) - range.selectNodeContents(contentEditableElement); // Select the entire contents of the element with the range - range.collapse(false); // collapse the range to the end point. false means collapse to end rather than the start - selection = window.getSelection(); // get the selection object (allows you to change selection) - selection.removeAllRanges(); // remove any selections already made - selection.addRange(range); // make the range you have just created the visible selection } } + /** * Select all text of a content editable div. * http://stackoverflow.com/a/3806004/1262753 * @param {Element} contentEditableElement A content editable div */ - function selectContentEditable(contentEditableElement) { if (!contentEditableElement || contentEditableElement.nodeName !== 'DIV') { return; } - var sel, range; - if (window.getSelection && document.createRange) { range = document.createRange(); range.selectNodeContents(contentEditableElement); @@ -17732,29 +16792,27 @@ function selectContentEditable(contentEditableElement) { sel.addRange(range); } } + /** * Get text selection * http://stackoverflow.com/questions/4687808/contenteditable-selected-text-save-and-restore * @return {Range | TextRange | null} range */ - function getSelection() { if (window.getSelection) { var sel = window.getSelection(); - if (sel.getRangeAt && sel.rangeCount) { return sel.getRangeAt(0); } } - return null; } + /** * Set text selection * http://stackoverflow.com/questions/4687808/contenteditable-selected-text-save-and-restore * @param {Range | TextRange | null} range */ - function setSelection(range) { if (range) { if (window.getSelection) { @@ -17764,6 +16822,7 @@ function setSelection(range) { } } } + /** * Get selected text range * @return {Object} params object containing parameters: @@ -17773,10 +16832,8 @@ function setSelection(range) { * selected text element * Returns null if no text selection is found */ - function getSelectionOffset() { var range = getSelection(); - if (range && 'startOffset' in range && 'endOffset' in range && range.startContainer && range.startContainer === range.endContainer) { return { startOffset: range.startOffset, @@ -17784,9 +16841,9 @@ function getSelectionOffset() { container: range.startContainer.parentNode }; } - return null; } + /** * Set selected text range in given element * @param {Object} params An object containing: @@ -17794,20 +16851,17 @@ function getSelectionOffset() { * {Number} startOffset * {Number} endOffset */ - function setSelectionOffset(params) { if (document.createRange && window.getSelection) { var selection = window.getSelection(); - if (selection) { var range = document.createRange(); - if (!params.container.firstChild) { params.container.appendChild(document.createTextNode('')); - } // TODO: do not suppose that the first child of the container is a textnode, - // but recursively find the textnodes - + } + // TODO: do not suppose that the first child of the container is a textnode, + // but recursively find the textnodes range.setStart(params.container.firstChild, params.startOffset); range.setEnd(params.container.firstChild, params.endOffset); setSelection(range); @@ -17820,10 +16874,8 @@ function setSelectionOffset(params) { * @param {Object} [buffer] * @return {String} innerText */ - function getInnerText(element, buffer) { var first = buffer === undefined; - if (first) { buffer = { _text: '', @@ -17836,41 +16888,35 @@ function getInnerText(element, buffer) { this._text = text; } }; - } // text node - + } + // text node if (element.nodeValue) { - // remove return characters and the whitespace surrounding return characters - var trimmedValue = element.nodeValue.replace(/\s*\n\s*/g, ''); - + // remove return characters and the whitespaces surrounding those return characters + var trimmedValue = removeReturnsAndSurroundingWhitespace(element.nodeValue); if (trimmedValue !== '') { return buffer.flush() + trimmedValue; } else { // ignore empty text return ''; } - } // divs or other HTML elements - + } + // divs or other HTML elements if (element.hasChildNodes()) { var childNodes = element.childNodes; var innerText = ''; - for (var i = 0, iMax = childNodes.length; i < iMax; i++) { var child = childNodes[i]; - if (child.nodeName === 'DIV' || child.nodeName === 'P') { var prevChild = childNodes[i - 1]; var prevName = prevChild ? prevChild.nodeName : undefined; - if (prevName && prevName !== 'DIV' && prevName !== 'P' && prevName !== 'BR') { if (innerText !== '') { innerText += '\n'; } - buffer.flush(); } - innerText += getInnerText(child, buffer); buffer.set('\n'); } else if (child.nodeName === 'BR') { @@ -17880,74 +16926,74 @@ function getInnerText(element, buffer) { innerText += getInnerText(child, buffer); } } - return innerText; - } // br or unknown - + } + // br or unknown return ''; } + +// regular expression matching one or multiple return characters with all their +// enclosing white spaces +function removeReturnsAndSurroundingWhitespace(text) { + return text.replace(/(\b|^)\s*(\b|$)/g, function (match) { + return /\n/.exec(match) ? '' : match; + }); +} + /** * Test whether an element has the provided parent node somewhere up the node tree. * @param {Element} elem * @param {Element} parent * @return {boolean} */ - function hasParentNode(elem, parent) { var e = elem ? elem.parentNode : undefined; - while (e) { if (e === parent) { return true; } - e = e.parentNode; } - return false; } + /** * Returns the version of Internet Explorer or a -1 * (indicating the use of another browser). * Source: http://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx * @return {Number} Internet Explorer version, or -1 in case of an other browser */ - function getInternetExplorerVersion() { if (_ieVersion === -1) { var rv = -1; // Return value assumes failure. - if (typeof navigator !== 'undefined' && navigator.appName === 'Microsoft Internet Explorer') { var ua = navigator.userAgent; var re = /MSIE ([0-9]+[.0-9]+)/; - if (re.exec(ua) != null) { rv = parseFloat(RegExp.$1); } } - _ieVersion = rv; } - return _ieVersion; } + /** * cached internet explorer version * @type {Number} * @private */ - var _ieVersion = -1; + /** * Test whether the current browser is Firefox * @returns {boolean} isFirefox */ - - function isFirefox() { return typeof navigator !== 'undefined' && navigator.userAgent.indexOf('Firefox') !== -1; } + /** * Add an event listener. Works for all browsers * @param {Element} element An html element @@ -17957,17 +17003,14 @@ function isFirefox() { * @param {boolean} [useCapture] false by default * @return {function} the created event listener */ - function addEventListener(element, action, listener, useCapture) { if (element.addEventListener) { if (useCapture === undefined) { useCapture = false; } - if (action === 'mousewheel' && isFirefox()) { action = 'DOMMouseScroll'; // For Firefox } - element.addEventListener(action, listener, useCapture); return listener; } else if (element.attachEvent) { @@ -17975,11 +17018,11 @@ function addEventListener(element, action, listener, useCapture) { var f = function f() { return listener.call(element, window.event); }; - element.attachEvent('on' + action, f); return f; } } + /** * Remove an event listener from an element * @param {Element} element An html dom element @@ -17987,130 +17030,107 @@ function addEventListener(element, action, listener, useCapture) { * @param {function} listener The listener function * @param {boolean} [useCapture] false by default */ - function removeEventListener(element, action, listener, useCapture) { if (element.removeEventListener) { if (useCapture === undefined) { useCapture = false; } - if (action === 'mousewheel' && isFirefox()) { action = 'DOMMouseScroll'; // For Firefox } - element.removeEventListener(action, listener, useCapture); } else if (element.detachEvent) { // Old IE browsers element.detachEvent('on' + action, listener); } } + /** * Test if an element is a child of a parent element. * @param {Element} elem * @param {Element} parent * @return {boolean} returns true if elem is a child of the parent */ - function isChildOf(elem, parent) { var e = elem.parentNode; - while (e) { if (e === parent) { return true; } - e = e.parentNode; } - return false; } + /** * Parse a JSON path like '.items[3].name' into an array * @param {string} jsonPath * @return {Array} */ - function parsePath(jsonPath) { var path = []; var i = 0; - function parseProperty() { var prop = ''; - while (jsonPath[i] !== undefined && /[\w$]/.test(jsonPath[i])) { prop += jsonPath[i]; i++; } - if (prop === '') { throw new Error('Invalid JSON path: property name expected at index ' + i); } - return prop; } - function parseIndex(end) { var name = ''; - while (jsonPath[i] !== undefined && jsonPath[i] !== end) { name += jsonPath[i]; i++; } - if (jsonPath[i] !== end) { throw new Error('Invalid JSON path: unexpected end, character ' + end + ' expected'); } - return name; } - while (jsonPath[i] !== undefined) { if (jsonPath[i] === '.') { i++; path.push(parseProperty()); } else if (jsonPath[i] === '[') { i++; - if (jsonPath[i] === '\'' || jsonPath[i] === '"') { var end = jsonPath[i]; i++; path.push(parseIndex(end)); - if (jsonPath[i] !== end) { throw new Error('Invalid JSON path: closing quote \' expected at index ' + i); } - i++; } else { var index = parseIndex(']').trim(); - if (index.length === 0) { throw new Error('Invalid JSON path: array value expected at index ' + i); - } // Coerce numeric indices to numbers, but ignore star - - + } + // Coerce numeric indices to numbers, but ignore star index = index === '*' ? index : JSON.parse(index); path.push(index); } - if (jsonPath[i] !== ']') { throw new Error('Invalid JSON path: closing bracket ] expected at index ' + i); } - i++; } else { throw new Error('Invalid JSON path: unexpected character "' + jsonPath[i] + '" at index ' + i); } } - return path; } + /** * Stringify an array with a path in a JSON path like '.items[3].name' * @param {Array.} path * @returns {string} */ - function stringifyPath(path) { return path.map(function (p) { if (typeof p === 'number') { @@ -18122,67 +17142,62 @@ function stringifyPath(path) { } }).join(''); } + /** * Improve the error message of a JSON schema error * @param {Object} error * @return {Object} The error */ - function improveSchemaError(error) { if (error.keyword === 'enum' && Array.isArray(error.schema)) { var enums = error.schema; - if (enums) { enums = enums.map(function (value) { return JSON.stringify(value); }); - if (enums.length > 5) { var more = ['(' + (enums.length - 5) + ' more...)']; enums = enums.slice(0, 5); enums.push(more); } - error.message = 'should be equal to one of: ' + enums.join(', '); } } - if (error.keyword === 'additionalProperties') { error.message = 'should NOT have additional property: ' + error.params.additionalProperty; } - return error; } + /** * Test whether something is a Promise * @param {*} object * @returns {boolean} Returns true when object is a promise, false otherwise */ - function isPromise(object) { return object && typeof object.then === 'function' && typeof object["catch"] === 'function'; } + /** * Test whether a custom validation error has the correct structure * @param {*} validationError The error to be checked. * @returns {boolean} Returns true if the structure is ok, false otherwise */ - function isValidValidationError(validationError) { return _typeof(validationError) === 'object' && Array.isArray(validationError.path) && typeof validationError.message === 'string'; } + /** * Test whether the child rect fits completely inside the parent rect. * @param {ClientRect} parent * @param {ClientRect} child * @param {number} margin */ - function insideRect(parent, child, margin) { var _margin = margin !== undefined ? margin : 0; - return child.left - _margin >= parent.left && child.right + _margin <= parent.right && child.top - _margin >= parent.top && child.bottom + _margin <= parent.bottom; } + /** * Returns a function, that, as long as it continues to be invoked, will not * be triggered. The function will be called after it stops being called for @@ -18197,24 +17212,22 @@ function insideRect(parent, child, margin) { * of the trailing. * @return {function} Return the debounced function */ - function debounce(func, wait, immediate) { var timeout; return function () { var context = this; var args = arguments; - var later = function later() { timeout = null; if (!immediate) func.apply(context, args); }; - var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; } + /** * Determines the difference between two texts. * Can only detect one removed or inserted block of characters. @@ -18223,27 +17236,24 @@ function debounce(func, wait, immediate) { * @return {{start: number, end: number}} Returns the start and end * of the changed part in newText. */ - function textDiff(oldText, newText) { var len = newText.length; var start = 0; var oldEnd = oldText.length; var newEnd = newText.length; - while (newText.charAt(start) === oldText.charAt(start) && start < len) { start++; } - while (newText.charAt(newEnd - 1) === oldText.charAt(oldEnd - 1) && newEnd > start && oldEnd > 0) { newEnd--; oldEnd--; } - return { start: start, end: newEnd }; } + /** * Return an object with the selection range or cursor position (if both have the same value) * Support also old browsers (IE8-) @@ -18251,7 +17261,6 @@ function textDiff(oldText, newText) { * @param {DOMElement} el A dom element of a textarea or input text. * @return {Object} reference Object with 2 properties (start and end) with the identifier of the location of the cursor and selected text. **/ - function getInputSelection(el) { var startIndex = 0; var endIndex = 0; @@ -18260,31 +17269,29 @@ function getInputSelection(el) { var textInputRange; var len; var endRange; - if (typeof el.selectionStart === 'number' && typeof el.selectionEnd === 'number') { startIndex = el.selectionStart; endIndex = el.selectionEnd; } else { range = document.selection.createRange(); - if (range && range.parentElement() === el) { len = el.value.length; - normalizedValue = el.value.replace(/\r\n/g, '\n'); // Create a working TextRange that lives only in the input + normalizedValue = el.value.replace(/\r\n/g, '\n'); + // Create a working TextRange that lives only in the input textInputRange = el.createTextRange(); - textInputRange.moveToBookmark(range.getBookmark()); // Check if the startIndex and endIndex of the selection are at the very end + textInputRange.moveToBookmark(range.getBookmark()); + + // Check if the startIndex and endIndex of the selection are at the very end // of the input, since moveStart/moveEnd doesn't return what we want // in those cases - endRange = el.createTextRange(); endRange.collapse(false); - if (textInputRange.compareEndPoints('StartToEnd', endRange) > -1) { startIndex = endIndex = len; } else { startIndex = -textInputRange.moveStart('character', -len); startIndex += normalizedValue.slice(0, startIndex).split('\n').length - 1; - if (textInputRange.compareEndPoints('EndToEnd', endRange) > -1) { endIndex = len; } else { @@ -18294,19 +17301,18 @@ function getInputSelection(el) { } } } - return { startIndex: startIndex, endIndex: endIndex, start: _positionForIndex(startIndex), end: _positionForIndex(endIndex) }; + /** * Returns textarea row and column position for certain index * @param {Number} index text index * @returns {{row: Number, column: Number}} */ - function _positionForIndex(index) { var textTillIndex = el.value.substring(0, index); var row = (textTillIndex.match(/\n/g) || []).length + 1; @@ -18317,6 +17323,7 @@ function getInputSelection(el) { }; } } + /** * Returns the index for certain position in text element * @param {DOMElement} el A dom element of a textarea or input text. @@ -18324,47 +17331,39 @@ function getInputSelection(el) { * @param {Number} column column value, > 0, if exceeds column length - end of column will be returned * @returns {Number} index of position in text, -1 if not found */ - function getIndexForPosition(el, row, column) { var text = el.value || ''; - if (row > 0 && column > 0) { var rows = text.split('\n', row); row = Math.min(rows.length, row); column = Math.min(rows[row - 1].length, column - 1); var columnCount = row === 1 ? column : column + 1; // count new line on multiple rows - return rows.slice(0, row - 1).join('\n').length + columnCount; } - return -1; } + /** * Returns location of json paths in certain json string * @param {String} text json string * @param {Array} paths array of json paths * @returns {Array<{path: String, line: Number, row: Number}>} */ - function getPositionForPath(text, paths) { var result = []; var jsmap; - if (!paths || !paths.length) { return result; } - try { - jsmap = json_source_map__WEBPACK_IMPORTED_MODULE_4__.parse(text); + jsmap = json_source_map__WEBPACK_IMPORTED_MODULE_3__.parse(text); } catch (err) { return result; } - paths.forEach(function (path) { var pathArr = parsePath(path); var pointerName = compileJSONPointer(pathArr); var pointer = jsmap.pointers[pointerName]; - if (pointer) { result.push({ path: path, @@ -18375,18 +17374,19 @@ function getPositionForPath(text, paths) { }); return result; } + /** * Compile a JSON Pointer * WARNING: this is an incomplete implementation * @param {Array.} path * @return {string} */ - function compileJSONPointer(path) { return path.map(function (p) { return '/' + String(p).replace(/~/g, '~0').replace(/\//g, '~1'); }).join(''); } + /** * Get the applied color given a color name or code * Source: https://stackoverflow.com/questions/6386090/validating-css-color-names/33184805 @@ -18395,73 +17395,63 @@ function compileJSONPointer(path) { * color, and returns null otherwise. Example output: * 'rgba(255,0,0,0.7)' or 'rgb(255,0,0)' */ - function getColorCSS(color) { var ele = document.createElement('div'); ele.style.color = color; return ele.style.color.split(/\s+/).join('').toLowerCase() || null; } + /** * Test if a string contains a valid color name or code. * @param {string} color * @returns {boolean} returns true if a valid color, false otherwise */ - function isValidColor(color) { return !!getColorCSS(color); } + /** * Make a tooltip for a field based on the field's schema. * @param {object} schema JSON schema * @param {string} [locale] Locale code (for example, zh-CN) * @returns {string} Field tooltip, may be empty string if all relevant schema properties are missing */ - function makeFieldTooltip(schema, locale) { if (!schema) { return ''; } - var tooltip = ''; - if (schema.title) { tooltip += schema.title; } - if (schema.description) { if (tooltip.length > 0) { tooltip += '\n'; } - tooltip += schema.description; } - if (schema["default"]) { if (tooltip.length > 0) { tooltip += '\n\n'; } - - tooltip += (0,_i18n__WEBPACK_IMPORTED_MODULE_5__/* .translate */ .Iu)('default', undefined, locale) + '\n'; + tooltip += (0,_i18n__WEBPACK_IMPORTED_MODULE_4__/* .translate */ .Tl)('default', undefined, locale) + '\n'; tooltip += JSON.stringify(schema["default"], null, 2); } - if (Array.isArray(schema.examples) && schema.examples.length > 0) { if (tooltip.length > 0) { tooltip += '\n\n'; } - - tooltip += (0,_i18n__WEBPACK_IMPORTED_MODULE_5__/* .translate */ .Iu)('examples', undefined, locale) + '\n'; + tooltip += (0,_i18n__WEBPACK_IMPORTED_MODULE_4__/* .translate */ .Tl)('examples', undefined, locale) + '\n'; schema.examples.forEach(function (example, index) { tooltip += JSON.stringify(example, null, 2); - if (index !== schema.examples.length - 1) { tooltip += '\n'; } }); } - return tooltip; } + /** * Get a nested property from an object. * Returns undefined when the property does not exist. @@ -18469,63 +17459,56 @@ function makeFieldTooltip(schema, locale) { * @param {string[]} path * @return {*} */ - function get(object, path) { var value = object; - for (var i = 0; i < path.length && value !== undefined && value !== null; i++) { value = value[path[i]]; } - return value; } + /** * Find a unique name. Suffix the name with ' (copy)', '(copy 2)', etc * until a unique name is found * @param {string} name * @param {Array} existingPropNames Array with existing prop names */ - function findUniqueName(name, existingPropNames) { + if (existingPropNames.indexOf(name) === -1) { + return name; + } var strippedName = name.replace(/ \(copy( \d+)?\)$/, ''); var validName = strippedName; var i = 1; - while (existingPropNames.indexOf(validName) !== -1) { var copy = 'copy' + (i > 1 ? ' ' + i : ''); validName = strippedName + ' (' + copy + ')'; i++; } - return validName; } + /** * Get the child paths of an array * @param {JSON} json * @param {boolean} [includeObjects=false] If true, object and array paths are returned as well * @return {string[]} */ - function getChildPaths(json, includeObjects) { var pathsMap = {}; - function getObjectChildPaths(json, pathsMap, rootPath, includeObjects) { var isValue = !Array.isArray(json) && !isObject(json); - if (isValue || includeObjects) { pathsMap[rootPath || ''] = true; } - if (isObject(json)) { Object.keys(json).forEach(function (field) { getObjectChildPaths(json[field], pathsMap, rootPath + '.' + field, includeObjects); }); } } - if (Array.isArray(json)) { var max = Math.min(json.length, MAX_ITEMS_FIELDS_COLLECTION); - for (var i = 0; i < max; i++) { var item = json[i]; getObjectChildPaths(item, pathsMap, '', includeObjects); @@ -18533,16 +17516,15 @@ function getChildPaths(json, includeObjects) { } else { pathsMap[''] = true; } - return Object.keys(pathsMap).sort(); } + /** * Sort object keys using natural sort * @param {Array} array * @param {String} [path] JSON pointer * @param {'asc' | 'desc'} [direction] */ - function sort(array, path, direction) { var parsedPath = path && path !== '.' ? parsePath(path) : []; var sign = direction === 'desc' ? -1 : 1; @@ -18554,12 +17536,12 @@ function sort(array, path, direction) { }); return sortedArray; } + /** * Sort object keys using natural sort * @param {Object} object * @param {'asc' | 'desc'} [direction] */ - function sortObjectKeys(object, direction) { var sign = direction === 'desc' ? -1 : 1; var sortedFields = Object.keys(object).sort(function (a, b) { @@ -18571,6 +17553,7 @@ function sortObjectKeys(object, direction) { }); return sortedObject; } + /** * Cast contents of a string to the correct type. * This can be a string, a number, a boolean, etc @@ -18578,79 +17561,70 @@ function sortObjectKeys(object, direction) { * @return {*} castedStr * @private */ - function parseString(str) { if (str === '') { return ''; } - var lower = str.toLowerCase(); - if (lower === 'null') { return null; } - if (lower === 'true') { return true; } - if (lower === 'false') { return false; } - + var containsLeadingZero = /^0\d+$/; + var startsWithZeroPrefix = /^0[xbo]/i; // hex, binary, octal numbers + if (containsLeadingZero.test(str) || startsWithZeroPrefix.test(str)) { + // treat '001', '0x1A', '0b1101', and '0o3700' as a string + return str; + } var num = Number(str); // will nicely fail with '123ab' - var numFloat = parseFloat(str); // will nicely fail with ' ' - if (!isNaN(num) && !isNaN(numFloat)) { return num; } - return str; } + /** * Test whether some field contains a timestamp in milliseconds after the year 2000. * @param {string} field * @param {number} value * @return {boolean} */ - function isTimestamp(field, value) { return typeof value === 'number' && value > YEAR_2000 && isFinite(value) && Math.floor(value) === value && !isNaN(new Date(value).valueOf()); } + /** * Return a human readable document size * For example formatSize(7570718) outputs '7.6 MB' * @param {number} size * @return {string} Returns a human readable size */ - function formatSize(size) { if (size < 900) { return size.toFixed() + ' B'; } - var KB = size / 1000; - if (KB < 900) { return KB.toFixed(1) + ' KB'; } - var MB = KB / 1000; - if (MB < 900) { return MB.toFixed(1) + ' MB'; } - var GB = MB / 1000; - if (GB < 900) { return GB.toFixed(1) + ' GB'; } - var TB = GB / 1000; return TB.toFixed(1) + ' TB'; } + /** * Limit text to a maximum number of characters * @param {string} text @@ -18658,108 +17632,94 @@ function formatSize(size) { * @return {string} Returns the limited text, * ending with '...' if the max was exceeded */ - function limitCharacters(text, maxCharacterCount) { if (text.length <= maxCharacterCount) { return text; } - return text.slice(0, maxCharacterCount) + '...'; } + /** * Test whether a value is an Object * @param {*} value * @return {boolean} */ - function isObject(value) { return _typeof(value) === 'object' && value !== null && !Array.isArray(value); } + /** * Helper function to test whether an array contains an item * @param {Array} array * @param {*} item * @return {boolean} Returns true if `item` is in `array`, returns false otherwise. */ - function contains(array, item) { return array.indexOf(item) !== -1; } + /** * Checks if validation has changed from the previous execution * @param {Array} currErr current validation errors * @param {Array} prevErr previous validation errors */ - function isValidationErrorChanged(currErr, prevErr) { - if (!prevErr && !currErr) { + if (!currErr && !prevErr) { return false; } - - if (prevErr && !currErr || !prevErr && currErr) { - return true; - } - - if (prevErr.length !== currErr.length) { + if (!Array.isArray(currErr) || !Array.isArray(prevErr) || prevErr.length !== currErr.length) { return true; } - - var _loop = function _loop(i) { - var pErr = void 0; - - if (currErr[i].type === 'error') { - pErr = prevErr.find(function (p) { - return p.line === currErr[i].line; - }); - } else { - pErr = prevErr.find(function (p) { - return p.dataPath === currErr[i].dataPath && p.schemaPath === currErr[i].schemaPath; - }); - } - - if (!pErr) { - return { - v: true - }; + for (var i = 0; i < currErr.length; i++) { + var currItem = currErr[i]; + var prevItem = prevErr[i]; + if (currItem.type !== prevItem.type || JSON.stringify(currItem.error) !== JSON.stringify(prevItem.error)) { + return true; } - }; - - for (var i = 0; i < currErr.length; ++i) { - var _ret = _loop(i); - - if (_typeof(_ret) === "object") return _ret.v; } - return false; } +/** + * Uniquely merge array of elements + * @param {Array} inputArray1 + * @param {Array} inputArray2 + * @returns {Array} an array with unique merged elements + */ +function uniqueMergeArrays(inputArray1, inputArray2) { + var arr1 = inputArray1 !== null && inputArray1 !== void 0 && inputArray1.length ? inputArray1 : []; + var arr2 = inputArray2 !== null && inputArray2 !== void 0 && inputArray2.length ? inputArray2 : []; + return _toConsumableArray(new Set(arr1.concat(arr2))); +} +function asyncExec(callback) { + setTimeout(callback); +} function hasOwnProperty(object, key) { return Object.prototype.hasOwnProperty.call(object, key); } /***/ }), -/***/ 8037: +/***/ 1746: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var VanillaPicker; - if (window.Picker) { // use the already loaded instance of VanillaPicker VanillaPicker = window.Picker; } else { try { // load color picker - VanillaPicker = __webpack_require__(4049); - } catch (err) {// probably running the minimalist bundle + VanillaPicker = __webpack_require__(7598); + } catch (err) { + // probably running the minimalist bundle } } - module.exports = VanillaPicker; /***/ }), -/***/ 6225: +/***/ 6990: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); @@ -18938,38 +17898,326 @@ exportAce(ACE_NAMESPACE); })(); -ace.define("ace/lib/fixoldbrowsers",["require","exports","module"], function(require, exports, module) { -"use strict"; -if (typeof Element != "undefined" && !Element.prototype.remove) { - Object.defineProperty(Element.prototype, "remove", { +ace.define("ace/lib/es6-shim",["require","exports","module"], function(require, exports, module){function defineProp(obj, name, val) { + Object.defineProperty(obj, name, { + value: val, enumerable: false, writable: true, - configurable: true, - value: function() { this.parentNode && this.parentNode.removeChild(this); } + configurable: true + }); +} +if (!String.prototype.startsWith) { + defineProp(String.prototype, "startsWith", function (searchString, position) { + position = position || 0; + return this.lastIndexOf(searchString, position) === position; + }); +} +if (!String.prototype.endsWith) { + defineProp(String.prototype, "endsWith", function (searchString, position) { + var subjectString = this; + if (position === undefined || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }); +} +if (!String.prototype.repeat) { + defineProp(String.prototype, "repeat", function (count) { + var result = ""; + var string = this; + while (count > 0) { + if (count & 1) + result += string; + if ((count >>= 1)) + string += string; + } + return result; + }); +} +if (!String.prototype.includes) { + defineProp(String.prototype, "includes", function (str, position) { + return this.indexOf(str, position) != -1; + }); +} +if (!Object.assign) { + Object.assign = function (target) { + if (target === undefined || target === null) { + throw new TypeError("Cannot convert undefined or null to object"); + } + var output = Object(target); + for (var index = 1; index < arguments.length; index++) { + var source = arguments[index]; + if (source !== undefined && source !== null) { + Object.keys(source).forEach(function (key) { + output[key] = source[key]; + }); + } + } + return output; + }; +} +if (!Object.values) { + Object.values = function (o) { + return Object.keys(o).map(function (k) { + return o[k]; + }); + }; +} +if (!Array.prototype.find) { + defineProp(Array.prototype, "find", function (predicate) { + var len = this.length; + var thisArg = arguments[1]; + for (var k = 0; k < len; k++) { + var kValue = this[k]; + if (predicate.call(thisArg, kValue, k, this)) { + return kValue; + } + } + }); +} +if (!Array.prototype.findIndex) { + defineProp(Array.prototype, "findIndex", function (predicate) { + var len = this.length; + var thisArg = arguments[1]; + for (var k = 0; k < len; k++) { + var kValue = this[k]; + if (predicate.call(thisArg, kValue, k, this)) { + return k; + } + } + }); +} +if (!Array.prototype.includes) { + defineProp(Array.prototype, "includes", function (item, position) { + return this.indexOf(item, position) != -1; + }); +} +if (!Array.prototype.fill) { + defineProp(Array.prototype, "fill", function (value) { + var O = this; + var len = O.length >>> 0; + var start = arguments[1]; + var relativeStart = start >> 0; + var k = relativeStart < 0 + ? Math.max(len + relativeStart, 0) + : Math.min(relativeStart, len); + var end = arguments[2]; + var relativeEnd = end === undefined ? len : end >> 0; + var final = relativeEnd < 0 + ? Math.max(len + relativeEnd, 0) + : Math.min(relativeEnd, len); + while (k < final) { + O[k] = value; + k++; + } + return O; + }); +} +if (!Array.of) { + defineProp(Array, "of", function () { + return Array.prototype.slice.call(arguments); }); } - }); -ace.define("ace/lib/useragent",["require","exports","module"], function(require, exports, module) { +ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"], function(require, exports, module){// vim:set ts=4 sts=4 sw=4 st: "use strict"; +require("./es6-shim"); + +}); + +ace.define("ace/lib/deep_copy",["require","exports","module"], function(require, exports, module){exports.deepCopy = function deepCopy(obj) { + if (typeof obj !== "object" || !obj) + return obj; + var copy; + if (Array.isArray(obj)) { + copy = []; + for (var key = 0; key < obj.length; key++) { + copy[key] = deepCopy(obj[key]); + } + return copy; + } + if (Object.prototype.toString.call(obj) !== "[object Object]") + return obj; + copy = {}; + for (var key in obj) + copy[key] = deepCopy(obj[key]); + return copy; +}; + +}); + +ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"], function(require, exports, module){"use strict"; +exports.last = function (a) { + return a[a.length - 1]; +}; +exports.stringReverse = function (string) { + return string.split("").reverse().join(""); +}; +exports.stringRepeat = function (string, count) { + var result = ''; + while (count > 0) { + if (count & 1) + result += string; + if (count >>= 1) + string += string; + } + return result; +}; +var trimBeginRegexp = /^\s\s*/; +var trimEndRegexp = /\s\s*$/; +exports.stringTrimLeft = function (string) { + return string.replace(trimBeginRegexp, ''); +}; +exports.stringTrimRight = function (string) { + return string.replace(trimEndRegexp, ''); +}; +exports.copyObject = function (obj) { + var copy = {}; + for (var key in obj) { + copy[key] = obj[key]; + } + return copy; +}; +exports.copyArray = function (array) { + var copy = []; + for (var i = 0, l = array.length; i < l; i++) { + if (array[i] && typeof array[i] == "object") + copy[i] = this.copyObject(array[i]); + else + copy[i] = array[i]; + } + return copy; +}; +exports.deepCopy = require("./deep_copy").deepCopy; +exports.arrayToMap = function (arr) { + var map = {}; + for (var i = 0; i < arr.length; i++) { + map[arr[i]] = 1; + } + return map; +}; +exports.createMap = function (props) { + var map = Object.create(null); + for (var i in props) { + map[i] = props[i]; + } + return map; +}; +exports.arrayRemove = function (array, value) { + for (var i = 0; i <= array.length; i++) { + if (value === array[i]) { + array.splice(i, 1); + } + } +}; +exports.escapeRegExp = function (str) { + return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); +}; +exports.escapeHTML = function (str) { + return ("" + str).replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/ 0xffff ? 2 : 1; +}; + +}); + +ace.define("ace/lib/useragent",["require","exports","module"], function(require, exports, module){"use strict"; exports.OS = { LINUX: "LINUX", MAC: "MAC", WINDOWS: "WINDOWS" }; -exports.getOS = function() { +exports.getOS = function () { if (exports.isMac) { return exports.OS.MAC; - } else if (exports.isLinux) { + } + else if (exports.isLinux) { return exports.OS.LINUX; - } else { + } + else { return exports.OS.WINDOWS; } }; var _navigator = typeof navigator == "object" ? navigator : {}; - var os = (/mac|win|linux/i.exec(_navigator.platform) || ["other"])[0].toLowerCase(); var ua = _navigator.userAgent || ""; var appName = _navigator.appName || ""; @@ -18978,38 +18226,28 @@ exports.isMac = (os == "mac"); exports.isLinux = (os == "linux"); exports.isIE = (appName == "Microsoft Internet Explorer" || appName.indexOf("MSAppHost") >= 0) - ? parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]) - : parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]); // for ie - + ? parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]) + : parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]); // for ie exports.isOldIE = exports.isIE && exports.isIE < 9; exports.isGecko = exports.isMozilla = ua.match(/ Gecko\/\d+/); -exports.isOpera = typeof opera == "object" && Object.prototype.toString.call(window.opera) == "[object Opera]"; +exports.isOpera = typeof opera == "object" && Object.prototype.toString.call(window["opera"]) == "[object Opera]"; exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; - exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined; - +exports.isSafari = parseFloat(ua.split(" Safari/")[1]) && !exports.isChrome || undefined; exports.isEdge = parseFloat(ua.split(" Edge/")[1]) || undefined; - exports.isAIR = ua.indexOf("AdobeAIR") >= 0; - exports.isAndroid = ua.indexOf("Android") >= 0; - exports.isChromeOS = ua.indexOf(" CrOS ") >= 0; - -exports.isIOS = /iPad|iPhone|iPod/.test(ua) && !window.MSStream; - -if (exports.isIOS) exports.isMac = true; - +exports.isIOS = /iPad|iPhone|iPod/.test(ua) && !window["MSStream"]; +if (exports.isIOS) + exports.isMac = true; exports.isMobile = exports.isIOS || exports.isAndroid; }); -ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"], function(require, exports, module) { -"use strict"; - +ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"], function(require, exports, module){"use strict"; var useragent = require("./useragent"); var XHTML_NS = "http://www.w3.org/1999/xhtml"; - exports.buildDom = function buildDom(arr, parent, refs) { if (typeof arr == "string" && arr) { var txt = document.createTextNode(arr); @@ -19017,7 +18255,6 @@ exports.buildDom = function buildDom(arr, parent, refs) { parent.appendChild(txt); return txt; } - if (!Array.isArray(arr)) { if (arr && arr.appendChild && parent) parent.appendChild(arr); @@ -19031,7 +18268,6 @@ exports.buildDom = function buildDom(arr, parent, refs) { } return els; } - var el = document.createElement(arr[0]); var options = arr[1]; var childIndex = 1; @@ -19040,15 +18276,23 @@ exports.buildDom = function buildDom(arr, parent, refs) { for (var i = childIndex; i < arr.length; i++) buildDom(arr[i], el, refs); if (childIndex == 2) { - Object.keys(options).forEach(function(n) { + Object.keys(options).forEach(function (n) { var val = options[n]; if (n === "class") { el.className = Array.isArray(val) ? val.join(" ") : val; - } else if (typeof val == "function" || n == "value" || n[0] == "$") { + } + else if (typeof val == "function" || n == "value" || n[0] == "$") { el[n] = val; - } else if (n === "ref") { - if (refs) refs[val] = el; - } else if (val != null) { + } + else if (n === "ref") { + if (refs) + refs[val] = el; + } + else if (n === "style") { + if (typeof val == "string") + el.style.cssText = val; + } + else if (val != null) { el.setAttribute(n, val); } }); @@ -19057,43 +18301,37 @@ exports.buildDom = function buildDom(arr, parent, refs) { parent.appendChild(el); return el; }; - -exports.getDocumentHead = function(doc) { +exports.getDocumentHead = function (doc) { if (!doc) doc = document; return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; }; - -exports.createElement = function(tag, ns) { +exports.createElement = function (tag, ns) { return document.createElementNS ? - document.createElementNS(ns || XHTML_NS, tag) : - document.createElement(tag); + document.createElementNS(ns || XHTML_NS, tag) : + document.createElement(tag); }; - -exports.removeChildren = function(element) { +exports.removeChildren = function (element) { element.innerHTML = ""; }; - -exports.createTextNode = function(textContent, element) { +exports.createTextNode = function (textContent, element) { var doc = element ? element.ownerDocument : document; return doc.createTextNode(textContent); }; - -exports.createFragment = function(element) { +exports.createFragment = function (element) { var doc = element ? element.ownerDocument : document; return doc.createDocumentFragment(); }; - -exports.hasCssClass = function(el, name) { +exports.hasCssClass = function (el, name) { var classes = (el.className + "").split(/\s+/g); return classes.indexOf(name) !== -1; }; -exports.addCssClass = function(el, name) { +exports.addCssClass = function (el, name) { if (!exports.hasCssClass(el, name)) { el.className += " " + name; } }; -exports.removeCssClass = function(el, name) { +exports.removeCssClass = function (el, name) { var classes = el.className.split(/\s+/g); while (true) { var index = classes.indexOf(name); @@ -19104,8 +18342,7 @@ exports.removeCssClass = function(el, name) { } el.className = classes.join(" "); }; - -exports.toggleCssClass = function(el, name) { +exports.toggleCssClass = function (el, name) { var classes = el.className.split(/\s+/g), add = true; while (true) { var index = classes.indexOf(name); @@ -19117,68 +18354,97 @@ exports.toggleCssClass = function(el, name) { } if (add) classes.push(name); - el.className = classes.join(" "); return add; }; -exports.setCssClass = function(node, className, include) { +exports.setCssClass = function (node, className, include) { if (include) { exports.addCssClass(node, className); - } else { + } + else { exports.removeCssClass(node, className); } }; - -exports.hasCssString = function(id, doc) { +exports.hasCssString = function (id, doc) { var index = 0, sheets; doc = doc || document; if ((sheets = doc.querySelectorAll("style"))) { - while (index < sheets.length) - if (sheets[index++].id === id) + while (index < sheets.length) { + if (sheets[index++].id === id) { return true; + } + } } }; - -exports.importCssString = function importCssString(cssText, id, target) { +exports.removeElementById = function (id, doc) { + doc = doc || document; + if (doc.getElementById(id)) { + doc.getElementById(id).remove(); + } +}; +var strictCSP; +var cssCache = []; +exports.useStrictCSP = function (value) { + strictCSP = value; + if (value == false) + insertPendingStyles(); + else if (!cssCache) + cssCache = []; +}; +function insertPendingStyles() { + var cache = cssCache; + cssCache = null; + cache && cache.forEach(function (item) { + importCssString(item[0], item[1]); + }); +} +function importCssString(cssText, id, target) { + if (typeof document == "undefined") + return; + if (cssCache) { + if (target) { + insertPendingStyles(); + } + else if (target === false) { + return cssCache.push([cssText, id]); + } + } + if (strictCSP) + return; var container = target; if (!target || !target.getRootNode) { container = document; - } else { + } + else { container = target.getRootNode(); if (!container || container == target) container = document; } - var doc = container.ownerDocument || container; if (id && exports.hasCssString(id, container)) return null; - if (id) cssText += "\n/*# sourceURL=ace/css/" + id + " */"; - var style = exports.createElement("style"); style.appendChild(doc.createTextNode(cssText)); if (id) style.id = id; - if (container == doc) container = exports.getDocumentHead(doc); container.insertBefore(style, container.firstChild); +} +exports.importCssString = importCssString; +exports.importCssStylsheet = function (uri, doc) { + exports.buildDom(["link", { rel: "stylesheet", href: uri }], exports.getDocumentHead(doc)); }; - -exports.importCssStylsheet = function(uri, doc) { - exports.buildDom(["link", {rel: "stylesheet", href: uri}], exports.getDocumentHead(doc)); -}; -exports.scrollbarWidth = function(document) { +exports.scrollbarWidth = function (doc) { var inner = exports.createElement("ace_inner"); inner.style.width = "100%"; inner.style.minWidth = "0px"; inner.style.height = "200px"; inner.style.display = "block"; - var outer = exports.createElement("ace_outer"); var style = outer.style; - style.position = "absolute"; style.left = "-10000px"; style.overflow = "hidden"; @@ -19186,61 +18452,50 @@ exports.scrollbarWidth = function(document) { style.minWidth = "0px"; style.height = "150px"; style.display = "block"; - outer.appendChild(inner); - - var body = document.documentElement; + var body = (doc && doc.documentElement) || (document && document.documentElement); + if (!body) + return 0; body.appendChild(outer); - var noScrollbar = inner.offsetWidth; - style.overflow = "scroll"; var withScrollbar = inner.offsetWidth; - - if (noScrollbar == withScrollbar) { + if (noScrollbar === withScrollbar) { withScrollbar = outer.clientWidth; } - body.removeChild(outer); - - return noScrollbar-withScrollbar; + return noScrollbar - withScrollbar; }; - -if (typeof document == "undefined") { - exports.importCssString = function() {}; -} - -exports.computedStyle = function(element, style) { +exports.computedStyle = function (element, style) { return window.getComputedStyle(element, "") || {}; }; - -exports.setStyle = function(styles, property, value) { +exports.setStyle = function (styles, property, value) { if (styles[property] !== value) { styles[property] = value; } }; - exports.HAS_CSS_ANIMATION = false; exports.HAS_CSS_TRANSFORMS = false; exports.HI_DPI = useragent.isWin ? typeof window !== "undefined" && window.devicePixelRatio >= 1.5 : true; - +if (useragent.isChromeOS) + exports.HI_DPI = false; if (typeof document !== "undefined") { var div = document.createElement("div"); - if (exports.HI_DPI && div.style.transform !== undefined) + if (exports.HI_DPI && div.style.transform !== undefined) exports.HAS_CSS_TRANSFORMS = true; if (!useragent.isEdge && typeof div.style.animationName !== "undefined") exports.HAS_CSS_ANIMATION = true; div = null; } - if (exports.HAS_CSS_TRANSFORMS) { - exports.translate = function(element, tx, ty) { - element.style.transform = "translate(" + Math.round(tx) + "px, " + Math.round(ty) +"px)"; + exports.translate = function (element, tx, ty) { + element.style.transform = "translate(" + Math.round(tx) + "px, " + Math.round(ty) + "px)"; }; -} else { - exports.translate = function(element, tx, ty) { +} +else { + exports.translate = function (element, tx, ty) { element.style.top = Math.round(ty) + "px"; element.style.left = Math.round(tx) + "px"; }; @@ -19248,10 +18503,48 @@ if (exports.HAS_CSS_TRANSFORMS) { }); -ace.define("ace/lib/oop",["require","exports","module"], function(require, exports, module) { +ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"], function(require, exports, module){/* + * based on code from: + * + * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ "use strict"; +var dom = require("./dom"); +exports.get = function (url, callback) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + callback(xhr.responseText); + } + }; + xhr.send(null); +}; +exports.loadScript = function (path, callback) { + var head = dom.getDocumentHead(); + var s = document.createElement('script'); + s.src = path; + head.appendChild(s); + s.onload = s.onreadystatechange = function (_, isAbort) { + if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") { + s = s.onload = s.onreadystatechange = null; + if (!isAbort) + callback(); + } + }; +}; +exports.qualifyURL = function (url) { + var a = document.createElement('a'); + a.href = url; + return a.href; +}; + +}); -exports.inherits = function(ctor, superCtor) { +ace.define("ace/lib/oop",["require","exports","module"], function(require, exports, module){"use strict"; +exports.inherits = function (ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { @@ -19262,978 +18555,1338 @@ exports.inherits = function(ctor, superCtor) { } }); }; - -exports.mixin = function(obj, mixin) { +exports.mixin = function (obj, mixin) { for (var key in mixin) { obj[key] = mixin[key]; } return obj; }; - -exports.implement = function(proto, mixin) { +exports.implement = function (proto, mixin) { exports.mixin(proto, mixin); }; }); -ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"], function(require, exports, module) { -"use strict"; - -var oop = require("./oop"); -var Keys = (function() { - var ret = { - MODIFIER_KEYS: { - 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta', - 91: 'MetaLeft', 92: 'MetaRight', 93: 'ContextMenu' - }, - - KEY_MODS: { - "ctrl": 1, "alt": 2, "option" : 2, "shift": 4, - "super": 8, "meta": 8, "command": 8, "cmd": 8, - "control": 1 - }, - - FUNCTION_KEYS : { - 8 : "Backspace", - 9 : "Tab", - 13 : "Return", - 19 : "Pause", - 27 : "Esc", - 32 : "Space", - 33 : "PageUp", - 34 : "PageDown", - 35 : "End", - 36 : "Home", - 37 : "Left", - 38 : "Up", - 39 : "Right", - 40 : "Down", - 44 : "Print", - 45 : "Insert", - 46 : "Delete", - 96 : "Numpad0", - 97 : "Numpad1", - 98 : "Numpad2", - 99 : "Numpad3", - 100: "Numpad4", - 101: "Numpad5", - 102: "Numpad6", - 103: "Numpad7", - 104: "Numpad8", - 105: "Numpad9", - '-13': "NumpadEnter", - 112: "F1", - 113: "F2", - 114: "F3", - 115: "F4", - 116: "F5", - 117: "F6", - 118: "F7", - 119: "F8", - 120: "F9", - 121: "F10", - 122: "F11", - 123: "F12", - 144: "Numlock", - 145: "Scrolllock" - }, - - PRINTABLE_KEYS: { - 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', - 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 61: '=', 65: 'a', - 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', - 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', - 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v', - 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.', - 186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`', - 219: '[', 220: '\\',221: ']', 222: "'", 111: '/', 106: '*' - } - }; - var name, i; - for (i in ret.FUNCTION_KEYS) { - name = ret.FUNCTION_KEYS[i].toLowerCase(); - ret[name] = parseInt(i, 10); - } - for (i in ret.PRINTABLE_KEYS) { - name = ret.PRINTABLE_KEYS[i].toLowerCase(); - ret[name] = parseInt(i, 10); - } - oop.mixin(ret, ret.MODIFIER_KEYS); - oop.mixin(ret, ret.PRINTABLE_KEYS); - oop.mixin(ret, ret.FUNCTION_KEYS); - ret.enter = ret["return"]; - ret.escape = ret.esc; - ret.del = ret["delete"]; - ret[173] = '-'; - - (function() { - var mods = ["cmd", "ctrl", "alt", "shift"]; - for (var i = Math.pow(2, mods.length); i--;) { - ret.KEY_MODS[i] = mods.filter(function(x) { - return i & ret.KEY_MODS[x]; - }).join("-") + "-"; - } - })(); - - ret.KEY_MODS[0] = ""; - ret.KEY_MODS[-1] = "input-"; - - return ret; -})(); -oop.mixin(exports, Keys); - -exports.keyCodeToString = function(keyCode) { - var keyString = Keys[keyCode]; - if (typeof keyString != "string") - keyString = String.fromCharCode(keyCode); - return keyString.toLowerCase(); +ace.define("ace/lib/event_emitter",["require","exports","module"], function(require, exports, module){"use strict"; +var EventEmitter = {}; +var stopPropagation = function () { this.propagationStopped = true; }; +var preventDefault = function () { this.defaultPrevented = true; }; +EventEmitter._emit = + EventEmitter._dispatchEvent = function (eventName, e) { + this._eventRegistry || (this._eventRegistry = {}); + this._defaultHandlers || (this._defaultHandlers = {}); + var listeners = this._eventRegistry[eventName] || []; + var defaultHandler = this._defaultHandlers[eventName]; + if (!listeners.length && !defaultHandler) + return; + if (typeof e != "object" || !e) + e = {}; + if (!e.type) + e.type = eventName; + if (!e.stopPropagation) + e.stopPropagation = stopPropagation; + if (!e.preventDefault) + e.preventDefault = preventDefault; + listeners = listeners.slice(); + for (var i = 0; i < listeners.length; i++) { + listeners[i](e, this); + if (e.propagationStopped) + break; + } + if (defaultHandler && !e.defaultPrevented) + return defaultHandler(e, this); + }; +EventEmitter._signal = function (eventName, e) { + var listeners = (this._eventRegistry || {})[eventName]; + if (!listeners) + return; + listeners = listeners.slice(); + for (var i = 0; i < listeners.length; i++) + listeners[i](e, this); }; - -}); - -ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(require, exports, module) { -"use strict"; - -var keys = require("./keys"); -var useragent = require("./useragent"); - -var pressedKeys = null; -var ts = 0; - -var activeListenerOptions; -function detectListenerOptionsSupport() { - activeListenerOptions = false; - try { - document.createComment("").addEventListener("test", function() {}, { - get passive() { - activeListenerOptions = {passive: false}; - } +EventEmitter.once = function (eventName, callback) { + var _self = this; + this.on(eventName, function newCallback() { + _self.off(eventName, newCallback); + callback.apply(null, arguments); + }); + if (!callback) { + return new Promise(function (resolve) { + callback = resolve; }); - } catch(e) {} -} - -function getListenerOptions() { - if (activeListenerOptions == undefined) - detectListenerOptionsSupport(); - return activeListenerOptions; -} - -function EventListener(elem, type, callback) { - this.elem = elem; - this.type = type; - this.callback = callback; -} -EventListener.prototype.destroy = function() { - removeListener(this.elem, this.type, this.callback); - this.elem = this.type = this.callback = undefined; + } }; - -var addListener = exports.addListener = function(elem, type, callback, destroyer) { - elem.addEventListener(type, callback, getListenerOptions()); - if (destroyer) - destroyer.$toDestroy.push(new EventListener(elem, type, callback)); +EventEmitter.setDefaultHandler = function (eventName, callback) { + var handlers = this._defaultHandlers; + if (!handlers) + handlers = this._defaultHandlers = { _disabled_: {} }; + if (handlers[eventName]) { + var old = handlers[eventName]; + var disabled = handlers._disabled_[eventName]; + if (!disabled) + handlers._disabled_[eventName] = disabled = []; + disabled.push(old); + var i = disabled.indexOf(callback); + if (i != -1) + disabled.splice(i, 1); + } + handlers[eventName] = callback; }; - -var removeListener = exports.removeListener = function(elem, type, callback) { - elem.removeEventListener(type, callback, getListenerOptions()); +EventEmitter.removeDefaultHandler = function (eventName, callback) { + var handlers = this._defaultHandlers; + if (!handlers) + return; + var disabled = handlers._disabled_[eventName]; + if (handlers[eventName] == callback) { + if (disabled) + this.setDefaultHandler(eventName, disabled.pop()); + } + else if (disabled) { + var i = disabled.indexOf(callback); + if (i != -1) + disabled.splice(i, 1); + } }; -exports.stopEvent = function(e) { - exports.stopPropagation(e); - exports.preventDefault(e); - return false; +EventEmitter.on = + EventEmitter.addEventListener = function (eventName, callback, capturing) { + this._eventRegistry = this._eventRegistry || {}; + var listeners = this._eventRegistry[eventName]; + if (!listeners) + listeners = this._eventRegistry[eventName] = []; + if (listeners.indexOf(callback) == -1) + listeners[capturing ? "unshift" : "push"](callback); + return callback; + }; +EventEmitter.off = + EventEmitter.removeListener = + EventEmitter.removeEventListener = function (eventName, callback) { + this._eventRegistry = this._eventRegistry || {}; + var listeners = this._eventRegistry[eventName]; + if (!listeners) + return; + var index = listeners.indexOf(callback); + if (index !== -1) + listeners.splice(index, 1); + }; +EventEmitter.removeAllListeners = function (eventName) { + if (!eventName) + this._eventRegistry = this._defaultHandlers = undefined; + if (this._eventRegistry) + this._eventRegistry[eventName] = undefined; + if (this._defaultHandlers) + this._defaultHandlers[eventName] = undefined; }; +exports.EventEmitter = EventEmitter; -exports.stopPropagation = function(e) { - if (e.stopPropagation) - e.stopPropagation(); -}; +}); -exports.preventDefault = function(e) { - if (e.preventDefault) - e.preventDefault(); -}; -exports.getButton = function(e) { - if (e.type == "dblclick") - return 0; - if (e.type == "contextmenu" || (useragent.isMac && (e.ctrlKey && !e.altKey && !e.shiftKey))) - return 2; - return e.button; +ace.define("ace/lib/report_error",["require","exports","module"], function(require, exports, module){exports.reportError = function reportError(msg, data) { + var e = new Error(msg); + e["data"] = data; + if (typeof console == "object" && console.error) + console.error(e); + setTimeout(function () { throw e; }); }; -exports.capture = function(el, eventHandler, releaseCaptureHandler) { - var ownerDocument = el && el.ownerDocument || document; - function onMouseUp(e) { - eventHandler && eventHandler(e); - releaseCaptureHandler && releaseCaptureHandler(e); +}); - removeListener(ownerDocument, "mousemove", eventHandler); - removeListener(ownerDocument, "mouseup", onMouseUp); - removeListener(ownerDocument, "dragstart", onMouseUp); - } +ace.define("ace/lib/default_english_messages",["require","exports","module"], function(require, exports, module){var defaultEnglishMessages = { + "autocomplete.popup.aria-roledescription": "Autocomplete suggestions", + "autocomplete.popup.aria-label": "Autocomplete suggestions", + "autocomplete.popup.item.aria-roledescription": "item", + "autocomplete.loading": "Loading...", + "editor.scroller.aria-roledescription": "editor", + "editor.scroller.aria-label": "Editor content, press Enter to start editing, press Escape to exit", + "editor.gutter.aria-roledescription": "editor", + "editor.gutter.aria-label": "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit", + "error-marker.good-state": "Looks good!", + "prompt.recently-used": "Recently used", + "prompt.other-commands": "Other commands", + "prompt.no-matching-commands": "No matching commands", + "search-box.find.placeholder": "Search for", + "search-box.find-all.text": "All", + "search-box.replace.placeholder": "Replace with", + "search-box.replace-next.text": "Replace", + "search-box.replace-all.text": "All", + "search-box.toggle-replace.title": "Toggle Replace mode", + "search-box.toggle-regexp.title": "RegExp Search", + "search-box.toggle-case.title": "CaseSensitive Search", + "search-box.toggle-whole-word.title": "Whole Word Search", + "search-box.toggle-in-selection.title": "Search In Selection", + "search-box.search-counter": "$0 of $1", + "text-input.aria-roledescription": "editor", + "text-input.aria-label": "Cursor at row $0", + "gutter.code-folding.range.aria-label": "Toggle code folding, rows $0 through $1", + "gutter.code-folding.closed.aria-label": "Toggle code folding, rows $0 through $1", + "gutter.code-folding.open.aria-label": "Toggle code folding, row $0", + "gutter.code-folding.closed.title": "Unfold code", + "gutter.code-folding.open.title": "Fold code", + "gutter.annotation.aria-label.error": "Error, read annotations row $0", + "gutter.annotation.aria-label.warning": "Warning, read annotations row $0", + "gutter.annotation.aria-label.info": "Info, read annotations row $0", + "inline-fold.closed.title": "Unfold code", + "gutter-tooltip.aria-label.error.singular": "error", + "gutter-tooltip.aria-label.error.plural": "errors", + "gutter-tooltip.aria-label.warning.singular": "warning", + "gutter-tooltip.aria-label.warning.plural": "warnings", + "gutter-tooltip.aria-label.info.singular": "information message", + "gutter-tooltip.aria-label.info.plural": "information messages", + "gutter.annotation.aria-label.security": "Security finding, read annotations row $0", + "gutter.annotation.aria-label.hint": "Suggestion, read annotations row $0", + "gutter-tooltip.aria-label.security.singular": "security finding", + "gutter-tooltip.aria-label.security.plural": "security findings", + "gutter-tooltip.aria-label.hint.singular": "suggestion", + "gutter-tooltip.aria-label.hint.plural": "suggestions" +}; +exports.defaultEnglishMessages = defaultEnglishMessages; - addListener(ownerDocument, "mousemove", eventHandler); - addListener(ownerDocument, "mouseup", onMouseUp); - addListener(ownerDocument, "dragstart", onMouseUp); +}); - return onMouseUp; +ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"], function(require, exports, module){"no use strict"; +var oop = require("./oop"); +var EventEmitter = require("./event_emitter").EventEmitter; +var reportError = require("./report_error").reportError; +var defaultEnglishMessages = require("./default_english_messages").defaultEnglishMessages; +var optionsProvider = { + setOptions: function (optList) { + Object.keys(optList).forEach(function (key) { + this.setOption(key, optList[key]); + }, this); + }, + getOptions: function (optionNames) { + var result = {}; + if (!optionNames) { + var options = this.$options; + optionNames = Object.keys(options).filter(function (key) { + return !options[key].hidden; + }); + } + else if (!Array.isArray(optionNames)) { + result = optionNames; + optionNames = Object.keys(result); + } + optionNames.forEach(function (key) { + result[key] = this.getOption(key); + }, this); + return result; + }, + setOption: function (name, value) { + if (this["$" + name] === value) + return; + var opt = this.$options[name]; + if (!opt) { + return warn('misspelled option "' + name + '"'); + } + if (opt.forwardTo) + return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value); + if (!opt.handlesSet) + this["$" + name] = value; + if (opt && opt.set) + opt.set.call(this, value); + }, + getOption: function (name) { + var opt = this.$options[name]; + if (!opt) { + return warn('misspelled option "' + name + '"'); + } + if (opt.forwardTo) + return this[opt.forwardTo] && this[opt.forwardTo].getOption(name); + return opt && opt.get ? opt.get.call(this) : this["$" + name]; + } }; - -exports.addMouseWheelListener = function(el, callback, destroyer) { - if ("onmousewheel" in el) { - addListener(el, "mousewheel", function(e) { - var factor = 8; - if (e.wheelDeltaX !== undefined) { - e.wheelX = -e.wheelDeltaX / factor; - e.wheelY = -e.wheelDeltaY / factor; - } else { - e.wheelX = 0; - e.wheelY = -e.wheelDelta / factor; - } - callback(e); - }, destroyer); - } else if ("onwheel" in el) { - addListener(el, "wheel", function(e) { - var factor = 0.35; - switch (e.deltaMode) { - case e.DOM_DELTA_PIXEL: - e.wheelX = e.deltaX * factor || 0; - e.wheelY = e.deltaY * factor || 0; - break; - case e.DOM_DELTA_LINE: - case e.DOM_DELTA_PAGE: - e.wheelX = (e.deltaX || 0) * 5; - e.wheelY = (e.deltaY || 0) * 5; +function warn(message) { + if (typeof console != "undefined" && console.warn) + console.warn.apply(console, arguments); +} +var messages; +var nlsPlaceholders; +var AppConfig = /** @class */ (function () { + function AppConfig() { + this.$defaultOptions = {}; + messages = defaultEnglishMessages; + nlsPlaceholders = "dollarSigns"; + } + AppConfig.prototype.defineOptions = function (obj, path, options) { + if (!obj.$options) + this.$defaultOptions[path] = obj.$options = {}; + Object.keys(options).forEach(function (key) { + var opt = options[key]; + if (typeof opt == "string") + opt = { forwardTo: opt }; + opt.name || (opt.name = key); + obj.$options[opt.name] = opt; + if ("initialValue" in opt) + obj["$" + opt.name] = opt.initialValue; + }); + oop.implement(obj, optionsProvider); + return this; + }; + AppConfig.prototype.resetOptions = function (obj) { + Object.keys(obj.$options).forEach(function (key) { + var opt = obj.$options[key]; + if ("value" in opt) + obj.setOption(key, opt.value); + }); + }; + AppConfig.prototype.setDefaultValue = function (path, name, value) { + if (!path) { + for (path in this.$defaultOptions) + if (this.$defaultOptions[path][name]) break; + if (!this.$defaultOptions[path][name]) + return false; + } + var opts = this.$defaultOptions[path] || (this.$defaultOptions[path] = {}); + if (opts[name]) { + if (opts.forwardTo) + this.setDefaultValue(opts.forwardTo, name, value); + else + opts[name].value = value; + } + }; + AppConfig.prototype.setDefaultValues = function (path, optionHash) { + Object.keys(optionHash).forEach(function (key) { + this.setDefaultValue(path, key, optionHash[key]); + }, this); + }; + AppConfig.prototype.setMessages = function (value, options) { + messages = value; + if (options && options.placeholders) { + nlsPlaceholders = options.placeholders; + } + }; + AppConfig.prototype.nls = function (key, defaultString, params) { + if (!messages[key]) { + warn("No message found for the key '" + key + "' in the provided messages, trying to find a translation for the default string '" + defaultString + "'."); + if (!messages[defaultString]) { + warn("No message found for the default string '" + defaultString + "' in the provided messages. Falling back to the default English message."); } - - callback(e); - }, destroyer); - } else { - addListener(el, "DOMMouseScroll", function(e) { - if (e.axis && e.axis == e.HORIZONTAL_AXIS) { - e.wheelX = (e.detail || 0) * 5; - e.wheelY = 0; - } else { - e.wheelX = 0; - e.wheelY = (e.detail || 0) * 5; + } + var translated = messages[key] || messages[defaultString] || defaultString; + if (params) { + if (nlsPlaceholders === "dollarSigns") { + translated = translated.replace(/\$(\$|[\d]+)/g, function (_, dollarMatch) { + if (dollarMatch == "$") + return "$"; + return params[dollarMatch]; + }); } - callback(e); - }, destroyer); - } -}; + if (nlsPlaceholders === "curlyBrackets") { + translated = translated.replace(/\{([^\}]+)\}/g, function (_, curlyBracketMatch) { + return params[curlyBracketMatch]; + }); + } + } + return translated; + }; + return AppConfig; +}()); +AppConfig.prototype.warn = warn; +AppConfig.prototype.reportError = reportError; +oop.implement(AppConfig.prototype, EventEmitter); +exports.AppConfig = AppConfig; -exports.addMultiMouseDownListener = function(elements, timeouts, eventHandler, callbackName, destroyer) { - var clicks = 0; - var startX, startY, timer; - var eventNames = { - 2: "dblclick", - 3: "tripleclick", - 4: "quadclick" - }; +}); - function onMousedown(e) { - if (exports.getButton(e) !== 0) { - clicks = 0; - } else if (e.detail > 1) { - clicks++; - if (clicks > 4) - clicks = 1; - } else { - clicks = 1; - } - if (useragent.isIE) { - var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5; - if (!timer || isNewClick) - clicks = 1; - if (timer) - clearTimeout(timer); - timer = setTimeout(function() {timer = null;}, timeouts[clicks - 1] || 600); +ace.define("ace/theme/textmate-css",["require","exports","module"], function(require, exports, module){module.exports = ".ace-tm .ace_gutter {\n background: #f0f0f0;\n color: #333;\n}\n\n.ace-tm .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_fold {\n background-color: #6B72E6;\n}\n\n.ace-tm {\n background-color: #FFFFFF;\n color: black;\n}\n\n.ace-tm .ace_cursor {\n color: black;\n}\n \n.ace-tm .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_storage,\n.ace-tm .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_constant {\n color: rgb(197, 6, 11);\n}\n\n.ace-tm .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_constant.ace_language {\n color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_invalid {\n background-color: rgba(255, 0, 0, 0.1);\n color: red;\n}\n\n.ace-tm .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_support.ace_constant {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_support.ace_type,\n.ace-tm .ace_support.ace_class {\n color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_xml-pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_entity.ace_name.ace_function {\n color: #0000A2;\n}\n\n\n.ace-tm .ace_heading {\n color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_list {\n color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_meta.ace_tag {\n color:rgb(0, 22, 142);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0)\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n.ace-tm.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px white;\n}\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active-line {\n background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_gutter-active-line {\n background-color : #dcdcdc;\n}\n\n.ace-tm .ace_marker-layer .ace_selected-word {\n background: rgb(250, 250, 255);\n border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_indent-guide {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\n}\n\n.ace-tm .ace_indent-guide-active {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC\") right repeat-y;\n}\n"; - if (clicks == 1) { - startX = e.clientX; - startY = e.clientY; - } - } +}); - e._clicks = clicks; +ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"], function(require, exports, module){"use strict"; +exports.isDark = false; +exports.cssClass = "ace-tm"; +exports.cssText = require("./textmate-css"); +exports.$id = "ace/theme/textmate"; +var dom = require("../lib/dom"); +dom.importCssString(exports.cssText, exports.cssClass, false); - eventHandler[callbackName]("mousedown", e); +}); - if (clicks > 4) - clicks = 0; - else if (clicks > 1) - return eventHandler[callbackName](eventNames[clicks], e); +ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"], function(require, exports, module){"no use strict"; +var lang = require("./lib/lang"); +var net = require("./lib/net"); +var dom = require("./lib/dom"); +var AppConfig = require("./lib/app_config").AppConfig; +module.exports = exports = new AppConfig(); +var options = { + packaged: false, + workerPath: null, + modePath: null, + themePath: null, + basePath: "", + suffix: ".js", + $moduleUrls: {}, + loadWorkerFromBlob: true, + sharedPopups: false, + useStrictCSP: null +}; +exports.get = function (key) { + if (!options.hasOwnProperty(key)) + throw new Error("Unknown config key: " + key); + return options[key]; +}; +exports.set = function (key, value) { + if (options.hasOwnProperty(key)) + options[key] = value; + else if (this.setDefaultValue("", key, value) == false) + throw new Error("Unknown config key: " + key); + if (key == "useStrictCSP") + dom.useStrictCSP(value); +}; +exports.all = function () { + return lang.copyObject(options); +}; +exports.$modes = {}; +exports.moduleUrl = function (name, component) { + if (options.$moduleUrls[name]) + return options.$moduleUrls[name]; + var parts = name.split("/"); + component = component || parts[parts.length - 2] || ""; + var sep = component == "snippets" ? "/" : "-"; + var base = parts[parts.length - 1]; + if (component == "worker" && sep == "-") { + var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g"); + base = base.replace(re, ""); } - if (!Array.isArray(elements)) - elements = [elements]; - elements.forEach(function(el) { - addListener(el, "mousedown", onMousedown, destroyer); - }); + if ((!base || base == component) && parts.length > 1) + base = parts[parts.length - 2]; + var path = options[component + "Path"]; + if (path == null) { + path = options.basePath; + } + else if (sep == "/") { + component = sep = ""; + } + if (path && path.slice(-1) != "/") + path += "/"; + return path + component + sep + base + this.get("suffix"); }; - -var getModifierHash = function(e) { - return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0); +exports.setModuleUrl = function (name, subst) { + return options.$moduleUrls[name] = subst; }; - -exports.getModifierString = function(e) { - return keys.KEY_MODS[getModifierHash(e)]; +var loader = function (moduleName, cb) { + if (moduleName === "ace/theme/textmate" || moduleName === "./theme/textmate") + return cb(null, require("./theme/textmate")); + if (customLoader) + return customLoader(moduleName, cb); + console.error("loader is not configured"); }; - -function normalizeCommandKeys(callback, e, keyCode) { - var hashId = getModifierHash(e); - - if (!useragent.isMac && pressedKeys) { - if (e.getModifierState && (e.getModifierState("OS") || e.getModifierState("Win"))) - hashId |= 8; - if (pressedKeys.altGr) { - if ((3 & hashId) != 3) - pressedKeys.altGr = 0; - else - return; - } - if (keyCode === 18 || keyCode === 17) { - var location = "location" in e ? e.location : e.keyLocation; - if (keyCode === 17 && location === 1) { - if (pressedKeys[keyCode] == 1) - ts = e.timeStamp; - } else if (keyCode === 18 && hashId === 3 && location === 2) { - var dt = e.timeStamp - ts; - if (dt < 50) - pressedKeys.altGr = true; +var customLoader; +exports.setLoader = function (cb) { + customLoader = cb; +}; +exports.dynamicModules = Object.create(null); +exports.$loading = {}; +exports.$loaded = {}; +exports.loadModule = function (moduleId, onLoad) { + var loadedModule; + if (Array.isArray(moduleId)) { + var moduleType = moduleId[0]; + var moduleName = moduleId[1]; + } + else if (typeof moduleId == "string") { + var moduleName = moduleId; + } + var load = function (module) { + if (module && !exports.$loading[moduleName]) + return onLoad && onLoad(module); + if (!exports.$loading[moduleName]) + exports.$loading[moduleName] = []; + exports.$loading[moduleName].push(onLoad); + if (exports.$loading[moduleName].length > 1) + return; + var afterLoad = function () { + loader(moduleName, function (err, module) { + if (module) + exports.$loaded[moduleName] = module; + exports._emit("load.module", { name: moduleName, module: module }); + var listeners = exports.$loading[moduleName]; + exports.$loading[moduleName] = null; + listeners.forEach(function (onLoad) { + onLoad && onLoad(module); + }); + }); + }; + if (!exports.get("packaged")) + return afterLoad(); + net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad); + reportErrorIfPathIsNotConfigured(); + }; + if (exports.dynamicModules[moduleName]) { + exports.dynamicModules[moduleName]().then(function (module) { + if (module.default) { + load(module.default); } - } - } - - if (keyCode in keys.MODIFIER_KEYS) { - keyCode = -1; + else { + load(module); + } + }); } - - if (!hashId && keyCode === 13) { - var location = "location" in e ? e.location : e.keyLocation; - if (location === 3) { - callback(e, hashId, -keyCode); - if (e.defaultPrevented) - return; + else { + try { + loadedModule = this.$require(moduleName); } + catch (e) { } + load(loadedModule || exports.$loaded[moduleName]); } - - if (useragent.isChromeOS && hashId & 8) { - callback(e, hashId, keyCode); - if (e.defaultPrevented) - return; - else - hashId &= ~8; +}; +exports.$require = function (moduleName) { + if (typeof module["require"] == "function") { + var req = "require"; + return module[req](moduleName); } - if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) { - return false; +}; +exports.setModuleLoader = function (moduleName, onLoad) { + exports.dynamicModules[moduleName] = onLoad; +}; +var reportErrorIfPathIsNotConfigured = function () { + if (!options.basePath && !options.workerPath + && !options.modePath && !options.themePath + && !Object.keys(options.$moduleUrls).length) { + console.error("Unable to infer path to ace from script src,", "use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes", "or with webpack use ace/webpack-resolver"); + reportErrorIfPathIsNotConfigured = function () { }; } +}; +exports.version = "1.36.4"; - return callback(e, hashId, keyCode); -} - +}); -exports.addCommandKeyListener = function(el, callback, destroyer) { - if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) { - var lastKeyDownKeyCode = null; - addListener(el, "keydown", function(e) { - lastKeyDownKeyCode = e.keyCode; - }, destroyer); - addListener(el, "keypress", function(e) { - return normalizeCommandKeys(callback, e, lastKeyDownKeyCode); - }, destroyer); - } else { - var lastDefaultPrevented = null; +ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"], function(require, exports, module) { +"use strict"; - addListener(el, "keydown", function(e) { - pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1; - var result = normalizeCommandKeys(callback, e, e.keyCode); - lastDefaultPrevented = e.defaultPrevented; - return result; - }, destroyer); +require("./lib/fixoldbrowsers"); +var config = require("./config"); +config.setLoader(function(moduleName, cb) { + require([moduleName], function(module) { + cb(null, module); + }); +}); - addListener(el, "keypress", function(e) { - if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) { - exports.stopEvent(e); - lastDefaultPrevented = null; - } - }, destroyer); +var global = (function() { + return this || typeof window != "undefined" && window; +})(); - addListener(el, "keyup", function(e) { - pressedKeys[e.keyCode] = null; - }, destroyer); +module.exports = function(ace) { + config.init = init; + config.$require = require; + ace.require = require; - if (!pressedKeys) { - resetPressedKeys(); - addListener(window, "focus", resetPressedKeys); - } - } + if (true) + ace.define = __webpack_require__.amdD; }; -function resetPressedKeys() { - pressedKeys = Object.create(null); -} +init(true);function init(packaged) { -if (typeof window == "object" && window.postMessage && !useragent.isOldIE) { - var postMessageId = 1; - exports.nextTick = function(callback, win) { - win = win || window; - var messageName = "zero-timeout-message-" + (postMessageId++); + if (!global || !global.document) + return; - var listener = function(e) { - if (e.data == messageName) { - exports.stopPropagation(e); - removeListener(win, "message", listener); - callback(); - } - }; + config.set("packaged", packaged || require.packaged || module.packaged || (global.define && __webpack_require__.amdD.packaged)); - addListener(win, "message", listener); - win.postMessage(messageName, "*"); - }; -} + var scriptOptions = {}; + var scriptUrl = ""; + var currentScript = (document.currentScript || document._currentScript ); // native or polyfill + var currentDocument = currentScript && currentScript.ownerDocument || document; -exports.$idleBlocked = false; -exports.onIdle = function(cb, timeout) { - return setTimeout(function handler() { - if (!exports.$idleBlocked) { - cb(); - } else { - setTimeout(handler, 100); - } - }, timeout); -}; + if (currentScript && currentScript.src) { + scriptUrl = currentScript.src.split(/[?#]/)[0].split("/").slice(0, -1).join("/") || ""; + } -exports.$idleBlockId = null; -exports.blockIdle = function(delay) { - if (exports.$idleBlockId) - clearTimeout(exports.$idleBlockId); + var scripts = currentDocument.getElementsByTagName("script"); + for (var i=0; i [" + this.end.row + "/" + this.end.column + "]"); }; - - this.contains = function(row, column) { + Range.prototype.contains = function (row, column) { return this.compare(row, column) == 0; }; - this.compareRange = function(range) { - var cmp, - end = range.end, - start = range.start; - + Range.prototype.compareRange = function (range) { + var cmp, end = range.end, start = range.start; cmp = this.compare(end.row, end.column); if (cmp == 1) { cmp = this.compare(start.row, start.column); if (cmp == 1) { return 2; - } else if (cmp == 0) { + } + else if (cmp == 0) { return 1; - } else { + } + else { return 0; } - } else if (cmp == -1) { + } + else if (cmp == -1) { return -2; - } else { + } + else { cmp = this.compare(start.row, start.column); if (cmp == -1) { return -1; - } else if (cmp == 1) { + } + else if (cmp == 1) { return 42; - } else { + } + else { return 0; } } }; - this.comparePoint = function(p) { + Range.prototype.comparePoint = function (p) { return this.compare(p.row, p.column); }; - this.containsRange = function(range) { + Range.prototype.containsRange = function (range) { return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; }; - this.intersects = function(range) { + Range.prototype.intersects = function (range) { var cmp = this.compareRange(range); return (cmp == -1 || cmp == 0 || cmp == 1); }; - this.isEnd = function(row, column) { + Range.prototype.isEnd = function (row, column) { return this.end.row == row && this.end.column == column; }; - this.isStart = function(row, column) { + Range.prototype.isStart = function (row, column) { return this.start.row == row && this.start.column == column; }; - this.setStart = function(row, column) { + Range.prototype.setStart = function (row, column) { if (typeof row == "object") { this.start.column = row.column; this.start.row = row.row; - } else { + } + else { this.start.row = row; this.start.column = column; } }; - this.setEnd = function(row, column) { + Range.prototype.setEnd = function (row, column) { if (typeof row == "object") { this.end.column = row.column; this.end.row = row.row; - } else { + } + else { this.end.row = row; this.end.column = column; } }; - this.inside = function(row, column) { + Range.prototype.inside = function (row, column) { if (this.compare(row, column) == 0) { if (this.isEnd(row, column) || this.isStart(row, column)) { return false; - } else { + } + else { return true; } } return false; }; - this.insideStart = function(row, column) { + Range.prototype.insideStart = function (row, column) { if (this.compare(row, column) == 0) { if (this.isEnd(row, column)) { return false; - } else { + } + else { return true; } } return false; }; - this.insideEnd = function(row, column) { + Range.prototype.insideEnd = function (row, column) { if (this.compare(row, column) == 0) { if (this.isStart(row, column)) { return false; - } else { + } + else { return true; } } return false; }; - this.compare = function(row, column) { + Range.prototype.compare = function (row, column) { if (!this.isMultiLine()) { if (row === this.start.row) { return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); } } - if (row < this.start.row) return -1; - if (row > this.end.row) return 1; - if (this.start.row === row) return column >= this.start.column ? 0 : -1; - if (this.end.row === row) return column <= this.end.column ? 0 : 1; - return 0; }; - this.compareStart = function(row, column) { + Range.prototype.compareStart = function (row, column) { if (this.start.row == row && this.start.column == column) { return -1; - } else { + } + else { return this.compare(row, column); } }; - this.compareEnd = function(row, column) { + Range.prototype.compareEnd = function (row, column) { if (this.end.row == row && this.end.column == column) { return 1; - } else { + } + else { return this.compare(row, column); } }; - this.compareInside = function(row, column) { + Range.prototype.compareInside = function (row, column) { if (this.end.row == row && this.end.column == column) { return 1; - } else if (this.start.row == row && this.start.column == column) { + } + else if (this.start.row == row && this.start.column == column) { return -1; - } else { + } + else { return this.compare(row, column); } }; - this.clipRows = function(firstRow, lastRow) { + Range.prototype.clipRows = function (firstRow, lastRow) { if (this.end.row > lastRow) - var end = {row: lastRow + 1, column: 0}; + var end = { row: lastRow + 1, column: 0 }; else if (this.end.row < firstRow) - var end = {row: firstRow, column: 0}; - + var end = { row: firstRow, column: 0 }; if (this.start.row > lastRow) - var start = {row: lastRow + 1, column: 0}; + var start = { row: lastRow + 1, column: 0 }; else if (this.start.row < firstRow) - var start = {row: firstRow, column: 0}; - + var start = { row: firstRow, column: 0 }; return Range.fromPoints(start || this.start, end || this.end); }; - this.extend = function(row, column) { + Range.prototype.extend = function (row, column) { var cmp = this.compare(row, column); - if (cmp == 0) return this; else if (cmp == -1) - var start = {row: row, column: column}; + var start = { row: row, column: column }; else - var end = {row: row, column: column}; - + var end = { row: row, column: column }; return Range.fromPoints(start || this.start, end || this.end); }; - - this.isEmpty = function() { + Range.prototype.isEmpty = function () { return (this.start.row === this.end.row && this.start.column === this.end.column); }; - this.isMultiLine = function() { + Range.prototype.isMultiLine = function () { return (this.start.row !== this.end.row); }; - this.clone = function() { + Range.prototype.clone = function () { return Range.fromPoints(this.start, this.end); }; - this.collapseRows = function() { + Range.prototype.collapseRows = function () { if (this.end.column == 0) - return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0); + return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0); else return new Range(this.start.row, 0, this.end.row, 0); }; - this.toScreenRange = function(session) { + Range.prototype.toScreenRange = function (session) { var screenPosStart = session.documentToScreenPosition(this.start); var screenPosEnd = session.documentToScreenPosition(this.end); - - return new Range( - screenPosStart.row, screenPosStart.column, - screenPosEnd.row, screenPosEnd.column - ); + return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column); }; - this.moveBy = function(row, column) { + Range.prototype.moveBy = function (row, column) { this.start.row += row; this.start.column += column; this.end.row += row; this.end.column += column; }; - -}).call(Range.prototype); -Range.fromPoints = function(start, end) { + return Range; +}()); +Range.fromPoints = function (start, end) { return new Range(start.row, start.column, end.row, end.column); }; -Range.comparePoints = comparePoints; - -Range.comparePoints = function(p1, p2) { +Range.comparePoints = function (p1, p2) { return p1.row - p2.row || p1.column - p2.column; }; - - exports.Range = Range; -}); - -ace.define("ace/lib/lang",["require","exports","module"], function(require, exports, module) { -"use strict"; - -exports.last = function(a) { - return a[a.length - 1]; -}; - -exports.stringReverse = function(string) { - return string.split("").reverse().join(""); -}; -exports.stringRepeat = function (string, count) { - var result = ''; - while (count > 0) { - if (count & 1) - result += string; +}); - if (count >>= 1) - string += string; +ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"], function(require, exports, module){"use strict"; +var oop = require("./oop"); +var Keys = { + MODIFIER_KEYS: { + 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta', + 91: 'MetaLeft', 92: 'MetaRight', 93: 'ContextMenu' + }, + KEY_MODS: { + "ctrl": 1, "alt": 2, "option": 2, "shift": 4, + "super": 8, "meta": 8, "command": 8, "cmd": 8, + "control": 1 + }, + FUNCTION_KEYS: { + 8: "Backspace", + 9: "Tab", + 13: "Return", + 19: "Pause", + 27: "Esc", + 32: "Space", + 33: "PageUp", + 34: "PageDown", + 35: "End", + 36: "Home", + 37: "Left", + 38: "Up", + 39: "Right", + 40: "Down", + 44: "Print", + 45: "Insert", + 46: "Delete", + '-13': "NumpadEnter", + 144: "Numlock", + 145: "Scrolllock" + }, + PRINTABLE_KEYS: { + 32: ' ', 59: ';', 61: '=', 107: '+', 109: '-', 110: '.', + 186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`', + 219: '[', 220: '\\', 221: ']', 222: "'", 111: '/', 106: '*' + } +}; +var codeToKeyCode = { + Command: 224, + Backspace: 8, + Tab: 9, + Return: 13, + Enter: 13, + Pause: 19, + Escape: 27, + PageUp: 33, + PageDown: 34, + End: 35, + Home: 36, + Insert: 45, + Delete: 46, + ArrowLeft: 37, + ArrowUp: 38, + ArrowRight: 39, + ArrowDown: 40, + Backquote: 192, + Minus: 189, + Equal: 187, + BracketLeft: 219, + Backslash: 220, + BracketRight: 221, + Semicolon: 186, + Quote: 222, + Comma: 188, + Period: 190, + Slash: 191, + Space: 32, + NumpadAdd: 107, + NumpadDecimal: 110, + NumpadSubtract: 109, + NumpadDivide: 111, + NumpadMultiply: 106 +}; +for (var i = 0; i < 10; i++) { + codeToKeyCode["Digit" + i] = 48 + i; + codeToKeyCode["Numpad" + i] = 96 + i; + Keys.PRINTABLE_KEYS[48 + i] = "" + i; + Keys.FUNCTION_KEYS[96 + i] = "Numpad" + i; +} +for (var i = 65; i < 91; i++) { + var chr = String.fromCharCode(i + 32); + codeToKeyCode["Key" + chr.toUpperCase()] = i; + Keys.PRINTABLE_KEYS[i] = chr; +} +for (var i = 1; i < 13; i++) { + codeToKeyCode["F" + i] = 111 + i; + Keys.FUNCTION_KEYS[111 + i] = "F" + i; +} +var modifiers = { + Shift: 16, + Control: 17, + Alt: 18, + Meta: 224 +}; +for (var mod in modifiers) { + codeToKeyCode[mod] = codeToKeyCode[mod + "Left"] + = codeToKeyCode[mod + "Right"] = modifiers[mod]; +} +exports.$codeToKeyCode = codeToKeyCode; +Keys.PRINTABLE_KEYS[173] = '-'; +for (var j in Keys.FUNCTION_KEYS) { + var name = Keys.FUNCTION_KEYS[j].toLowerCase(); + Keys[name] = parseInt(j, 10); +} +for (var j in Keys.PRINTABLE_KEYS) { + var name = Keys.PRINTABLE_KEYS[j].toLowerCase(); + Keys[name] = parseInt(j, 10); +} +oop.mixin(Keys, Keys.MODIFIER_KEYS); +oop.mixin(Keys, Keys.PRINTABLE_KEYS); +oop.mixin(Keys, Keys.FUNCTION_KEYS); +Keys.enter = Keys["return"]; +Keys.escape = Keys.esc; +Keys.del = Keys["delete"]; +(function () { + var mods = ["cmd", "ctrl", "alt", "shift"]; + for (var i = Math.pow(2, mods.length); i--;) { + Keys.KEY_MODS[i] = mods.filter(function (x) { + return i & Keys.KEY_MODS[x]; + }).join("-") + "-"; } - return result; +})(); +Keys.KEY_MODS[0] = ""; +Keys.KEY_MODS[-1] = "input-"; +oop.mixin(exports, Keys); +exports.default = exports; +exports.keyCodeToString = function (keyCode) { + var keyString = Keys[keyCode]; + if (typeof keyString != "string") + keyString = String.fromCharCode(keyCode); + return keyString.toLowerCase(); }; -var trimBeginRegexp = /^\s\s*/; -var trimEndRegexp = /\s\s*$/; +}); -exports.stringTrimLeft = function (string) { - return string.replace(trimBeginRegexp, ''); +ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(require, exports, module){"use strict"; var keys = require("./keys"); +var useragent = require("./useragent"); +var pressedKeys = null; +var ts = 0; +var activeListenerOptions; +function detectListenerOptionsSupport() { + activeListenerOptions = false; + try { + document.createComment("").addEventListener("test", function () { }, { + get passive() { + activeListenerOptions = { passive: false }; + return true; + } + }); + } + catch (e) { } +} +function getListenerOptions() { + if (activeListenerOptions == undefined) + detectListenerOptionsSupport(); + return activeListenerOptions; +} +function EventListener(elem, type, callback) { + this.elem = elem; + this.type = type; + this.callback = callback; +} +EventListener.prototype.destroy = function () { + removeListener(this.elem, this.type, this.callback); + this.elem = this.type = this.callback = undefined; }; - -exports.stringTrimRight = function (string) { - return string.replace(trimEndRegexp, ''); +var addListener = exports.addListener = function (elem, type, callback, /**@type{any?}*/ destroyer) { + elem.addEventListener(type, callback, getListenerOptions()); + if (destroyer) + destroyer.$toDestroy.push(new EventListener(elem, type, callback)); }; - -exports.copyObject = function(obj) { - var copy = {}; - for (var key in obj) { - copy[key] = obj[key]; - } - return copy; +var removeListener = exports.removeListener = function (elem, type, callback) { + elem.removeEventListener(type, callback, getListenerOptions()); }; - -exports.copyArray = function(array){ - var copy = []; - for (var i=0, l=array.length; i 1) { + clicks++; + if (clicks > 4) + clicks = 1; + } + else { + clicks = 1; + } + if (useragent.isIE) { + var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5; + if (!timer || isNewClick) + clicks = 1; + if (timer) + clearTimeout(timer); + timer = setTimeout(function () { timer = null; }, timeouts[clicks - 1] || 600); + if (clicks == 1) { + startX = e.clientX; + startY = e.clientY; + } + } + e._clicks = clicks; + eventHandler[callbackName]("mousedown", e); + if (clicks > 4) + clicks = 0; + else if (clicks > 1) + return eventHandler[callbackName](eventNames[clicks], e); + } + if (!Array.isArray(elements)) + elements = [elements]; + elements.forEach(function (el) { + addListener(el, "mousedown", onMousedown, destroyer); }); - - return matches; }; -exports.deferredCall = function(fcn) { - var timer = null; - var callback = function() { - timer = null; - fcn(); - }; - - var deferred = function(timeout) { - deferred.cancel(); - timer = setTimeout(callback, timeout || 0); - return deferred; - }; - - deferred.schedule = deferred; - - deferred.call = function() { - this.cancel(); - fcn(); - return deferred; - }; - - deferred.cancel = function() { - clearTimeout(timer); - timer = null; - return deferred; - }; - - deferred.isPending = function() { - return timer; - }; - - return deferred; +function getModifierHash(e) { + return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0); +} +exports.getModifierString = function (e) { + return keys.KEY_MODS[getModifierHash(e)]; }; - - -exports.delayedCall = function(fcn, defaultTimeout) { - var timer = null; - var callback = function() { - timer = null; - fcn(); - }; - - var _self = function(timeout) { - if (timer == null) - timer = setTimeout(callback, timeout || defaultTimeout); - }; - - _self.delay = function(timeout) { - timer && clearTimeout(timer); - timer = setTimeout(callback, timeout || defaultTimeout); - }; - _self.schedule = _self; - - _self.call = function() { - this.cancel(); - fcn(); - }; - - _self.cancel = function() { - timer && clearTimeout(timer); - timer = null; +function normalizeCommandKeys(callback, e, keyCode) { + var hashId = getModifierHash(e); + if (!keyCode && e.code) { + keyCode = keys.$codeToKeyCode[e.code] || keyCode; + } + if (!useragent.isMac && pressedKeys) { + if (e.getModifierState && (e.getModifierState("OS") || e.getModifierState("Win"))) + hashId |= 8; + if (pressedKeys.altGr) { + if ((3 & hashId) != 3) + pressedKeys.altGr = 0; + else + return; + } + if (keyCode === 18 || keyCode === 17) { + var location = e.location; + if (keyCode === 17 && location === 1) { + if (pressedKeys[keyCode] == 1) + ts = e.timeStamp; + } + else if (keyCode === 18 && hashId === 3 && location === 2) { + var dt = e.timeStamp - ts; + if (dt < 50) + pressedKeys.altGr = true; + } + } + } + if (keyCode in keys.MODIFIER_KEYS) { + keyCode = -1; + } + if (!hashId && keyCode === 13) { + if (e.location === 3) { + callback(e, hashId, -keyCode); + if (e.defaultPrevented) + return; + } + } + if (useragent.isChromeOS && hashId & 8) { + callback(e, hashId, keyCode); + if (e.defaultPrevented) + return; + else + hashId &= ~8; + } + if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) { + return false; + } + return callback(e, hashId, keyCode); +} +exports.addCommandKeyListener = function (el, callback, destroyer) { + var lastDefaultPrevented = null; + addListener(el, "keydown", function (e) { + pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1; + var result = normalizeCommandKeys(callback, e, e.keyCode); + lastDefaultPrevented = e.defaultPrevented; + return result; + }, destroyer); + addListener(el, "keypress", function (e) { + if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) { + exports.stopEvent(e); + lastDefaultPrevented = null; + } + }, destroyer); + addListener(el, "keyup", function (e) { + pressedKeys[e.keyCode] = null; + }, destroyer); + if (!pressedKeys) { + resetPressedKeys(); + addListener(window, "focus", resetPressedKeys); + } +}; +function resetPressedKeys() { + pressedKeys = Object.create(null); +} +if (typeof window == "object" && window.postMessage && !useragent.isOldIE) { + var postMessageId = 1; + exports.nextTick = function (callback, win) { + win = win || window; + var messageName = "zero-timeout-message-" + (postMessageId++); + var listener = function (e) { + if (e.data == messageName) { + exports.stopPropagation(e); + removeListener(win, "message", listener); + callback(); + } + }; + addListener(win, "message", listener); + win.postMessage(messageName, "*"); }; - - _self.isPending = function() { - return timer; +} +exports.$idleBlocked = false; +exports.onIdle = function (cb, timeout) { + return setTimeout(function handler() { + if (!exports.$idleBlocked) { + cb(); + } + else { + setTimeout(handler, 100); + } + }, timeout); +}; +exports.$idleBlockId = null; +exports.blockIdle = function (delay) { + if (exports.$idleBlockId) + clearTimeout(exports.$idleBlockId); + exports.$idleBlocked = true; + exports.$idleBlockId = setTimeout(function () { + exports.$idleBlocked = false; + }, delay || 100); +}; +exports.nextFrame = typeof window == "object" && (window.requestAnimationFrame + || window["mozRequestAnimationFrame"] + || window["webkitRequestAnimationFrame"] + || window["msRequestAnimationFrame"] + || window["oRequestAnimationFrame"]); +if (exports.nextFrame) + exports.nextFrame = exports.nextFrame.bind(window); +else + exports.nextFrame = function (callback) { + setTimeout(callback, 17); }; - return _self; -}; }); -ace.define("ace/clipboard",["require","exports","module"], function(require, exports, module) { -"use strict"; - +ace.define("ace/clipboard",["require","exports","module"], function(require, exports, module){"use strict"; var $cancelT; module.exports = { lineMode: false, - pasteCancelled: function() { + pasteCancelled: function () { if ($cancelT && $cancelT > Date.now() - 50) return true; return $cancelT = false; }, - cancel: function() { + cancel: function () { $cancelT = Date.now(); } }; }); -ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"], function(require, exports, module) { -"use strict"; - +ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"], function(require, exports, module){"use strict"; var event = require("../lib/event"); +var nls = require("../config").nls; var useragent = require("../lib/useragent"); var dom = require("../lib/dom"); var lang = require("../lib/lang"); var clipboard = require("../clipboard"); var BROKEN_SETDATA = useragent.isChrome < 18; -var USE_IE_MIME_TYPE = useragent.isIE; +var USE_IE_MIME_TYPE = useragent.isIE; var HAS_FOCUS_ARGS = useragent.isChrome > 63; var MAX_LINE_LENGTH = 400; - var KEYS = require("../lib/keys"); var MODS = KEYS.KEY_MODS; var isIOS = useragent.isIOS; var valueResetRegex = isIOS ? /\s/ : /\n/; var isMobile = useragent.isMobile; - -var TextInput = function(parentNode, host) { +var TextInput; +TextInput = function (parentNode, host) { var text = dom.createElement("textarea"); text.className = "ace_text-input"; - text.setAttribute("wrap", "off"); text.setAttribute("autocorrect", "off"); text.setAttribute("autocapitalize", "off"); - text.setAttribute("spellcheck", false); - + text.setAttribute("spellcheck", "false"); text.style.opacity = "0"; parentNode.insertBefore(text, parentNode.firstChild); - var copied = false; var pasted = false; var inComposition = false; var sendingText = false; var tempStyle = ''; - if (!isMobile) text.style.fontSize = "1px"; - var commandMode = false; var ignoreFocusEvents = false; - var lastValue = ""; var lastSelectionStart = 0; var lastSelectionEnd = 0; var lastRestoreEnd = 0; - try { var isFocused = document.activeElement === text; } catch(e) {} - - event.addListener(text, "blur", function(e) { - if (ignoreFocusEvents) return; + var rowStart = Number.MAX_SAFE_INTEGER; + var rowEnd = Number.MIN_SAFE_INTEGER; + var numberOfExtraLines = 0; + try { + var isFocused = document.activeElement === text; + } + catch (e) { } + this.setNumberOfExtraLines = function (number) { + rowStart = Number.MAX_SAFE_INTEGER; + rowEnd = Number.MIN_SAFE_INTEGER; + if (number < 0) { + numberOfExtraLines = 0; + return; + } + numberOfExtraLines = number; + }; + this.setAriaLabel = function () { + var ariaLabel = ""; + if (host.$textInputAriaLabel) { + ariaLabel += "".concat(host.$textInputAriaLabel, ", "); + } + if (host.session) { + var row = host.session.selection.cursor.row; + ariaLabel += nls("text-input.aria-label", "Cursor at row $0", [row + 1]); + } + text.setAttribute("aria-label", ariaLabel); + }; + this.setAriaOptions = function (options) { + if (options.activeDescendant) { + text.setAttribute("aria-haspopup", "true"); + text.setAttribute("aria-autocomplete", options.inline ? "both" : "list"); + text.setAttribute("aria-activedescendant", options.activeDescendant); + } + else { + text.setAttribute("aria-haspopup", "false"); + text.setAttribute("aria-autocomplete", "both"); + text.removeAttribute("aria-activedescendant"); + } + if (options.role) { + text.setAttribute("role", options.role); + } + if (options.setLabel) { + text.setAttribute("aria-roledescription", nls("text-input.aria-roledescription", "editor")); + this.setAriaLabel(); + } + }; + this.setAriaOptions({ role: "textbox" }); + event.addListener(text, "blur", function (e) { + if (ignoreFocusEvents) + return; host.onBlur(e); isFocused = false; }, host); - event.addListener(text, "focus", function(e) { - if (ignoreFocusEvents) return; + event.addListener(text, "focus", function (e) { + if (ignoreFocusEvents) + return; isFocused = true; if (useragent.isEdge) { try { if (!document.hasFocus()) return; - } catch(e) {} + } + catch (e) { } } host.onFocus(e); if (useragent.isEdge) @@ -20242,16 +19895,19 @@ var TextInput = function(parentNode, host) { resetSelection(); }, host); this.$focusScroll = false; - this.focus = function() { + this.focus = function () { + this.setAriaOptions({ + setLabel: host.renderer.enableKeyboardAccessibility + }); if (tempStyle || HAS_FOCUS_ARGS || this.$focusScroll == "browser") return text.focus({ preventScroll: true }); - var top = text.style.top; text.style.position = "fixed"; text.style.top = "0px"; try { var isTransformed = text.getBoundingClientRect().top != 0; - } catch(e) { + } + catch (e) { return; } var ancestors = []; @@ -20259,33 +19915,32 @@ var TextInput = function(parentNode, host) { var t = text.parentElement; while (t && t.nodeType == 1) { ancestors.push(t); - t.setAttribute("ace_nocontext", true); + t.setAttribute("ace_nocontext", "true"); if (!t.parentElement && t.getRootNode) - t = t.getRootNode().host; + t = t.getRootNode()["host"]; else t = t.parentElement; } } text.focus({ preventScroll: true }); if (isTransformed) { - ancestors.forEach(function(p) { + ancestors.forEach(function (p) { p.removeAttribute("ace_nocontext"); }); } - setTimeout(function() { + setTimeout(function () { text.style.position = ""; if (text.style.top == "0px") text.style.top = top; }, 0); }; - this.blur = function() { + this.blur = function () { text.blur(); }; - this.isFocused = function() { + this.isFocused = function () { return isFocused; }; - - host.on("beforeEndOperation", function() { + host.on("beforeEndOperation", function () { var curOp = host.curOp; var commandName = curOp && curOp.command && curOp.command.name; if (commandName == "insertstring") @@ -20297,131 +19952,145 @@ var TextInput = function(parentNode, host) { } resetSelection(); }); - + host.on("changeSelection", this.setAriaLabel); + var positionToSelection = function (row, column) { + var selection = column; + for (var i = 1; i <= row - rowStart && i < 2 * numberOfExtraLines + 1; i++) { + selection += host.session.getLine(row - i).length + 1; + } + return selection; + }; var resetSelection = isIOS - ? function(value) { - if (!isFocused || (copied && !value) || sendingText) return; - if (!value) - value = ""; - var newValue = "\n ab" + value + "cde fg\n"; - if (newValue != text.value) - text.value = lastValue = newValue; - - var selectionStart = 4; - var selectionEnd = 4 + (value.length || (host.selection.isEmpty() ? 0 : 1)); - - if (lastSelectionStart != selectionStart || lastSelectionEnd != selectionEnd) { - text.setSelectionRange(selectionStart, selectionEnd); + ? function (value) { + if (!isFocused || (copied && !value) || sendingText) + return; + if (!value) + value = ""; + var newValue = "\n ab" + value + "cde fg\n"; + if (newValue != text.value) + text.value = lastValue = newValue; + var selectionStart = 4; + var selectionEnd = 4 + (value.length || (host.selection.isEmpty() ? 0 : 1)); + if (lastSelectionStart != selectionStart || lastSelectionEnd != selectionEnd) { + text.setSelectionRange(selectionStart, selectionEnd); + } + lastSelectionStart = selectionStart; + lastSelectionEnd = selectionEnd; } - lastSelectionStart = selectionStart; - lastSelectionEnd = selectionEnd; - } - : function() { - if (inComposition || sendingText) - return; - if (!isFocused && !afterContextMenu) - return; - inComposition = true; - - var selectionStart = 0; - var selectionEnd = 0; - var line = ""; - - if (host.session) { - var selection = host.selection; - var range = selection.getRange(); - var row = selection.cursor.row; - selectionStart = range.start.column; - selectionEnd = range.end.column; - line = host.session.getLine(row); - - if (range.start.row != row) { - var prevLine = host.session.getLine(row - 1); - selectionStart = range.start.row < row - 1 ? 0 : selectionStart; - selectionEnd += prevLine.length + 1; - line = prevLine + "\n" + line; - } - else if (range.end.row != row) { - var nextLine = host.session.getLine(row + 1); - selectionEnd = range.end.row > row + 1 ? nextLine.length : selectionEnd; - selectionEnd += line.length + 1; - line = line + "\n" + nextLine; - } - else if (isMobile && row > 0) { - line = "\n" + line; - selectionEnd += 1; - selectionStart += 1; - } - - if (line.length > MAX_LINE_LENGTH) { - if (selectionStart < MAX_LINE_LENGTH && selectionEnd < MAX_LINE_LENGTH) { - line = line.slice(0, MAX_LINE_LENGTH); - } else { - line = "\n"; - if (selectionStart == selectionEnd) { - selectionStart = selectionEnd = 0; + : function () { + if (inComposition || sendingText) + return; + if (!isFocused && !afterContextMenu) + return; + inComposition = true; + var selectionStart = 0; + var selectionEnd = 0; + var line = ""; + if (host.session) { + var selection = host.selection; + var range = selection.getRange(); + var row = selection.cursor.row; + if (row === rowEnd + 1) { + rowStart = rowEnd + 1; + rowEnd = rowStart + 2 * numberOfExtraLines; + } + else if (row === rowStart - 1) { + rowEnd = rowStart - 1; + rowStart = rowEnd - 2 * numberOfExtraLines; + } + else if (row < rowStart - 1 || row > rowEnd + 1) { + rowStart = row > numberOfExtraLines ? row - numberOfExtraLines : 0; + rowEnd = row > numberOfExtraLines ? row + numberOfExtraLines : 2 * numberOfExtraLines; + } + var lines = []; + for (var i = rowStart; i <= rowEnd; i++) { + lines.push(host.session.getLine(i)); + } + line = lines.join('\n'); + selectionStart = positionToSelection(range.start.row, range.start.column); + selectionEnd = positionToSelection(range.end.row, range.end.column); + if (range.start.row < rowStart) { + var prevLine = host.session.getLine(rowStart - 1); + selectionStart = range.start.row < rowStart - 1 ? 0 : selectionStart; + selectionEnd += prevLine.length + 1; + line = prevLine + "\n" + line; + } + else if (range.end.row > rowEnd) { + var nextLine = host.session.getLine(rowEnd + 1); + selectionEnd = range.end.row > rowEnd + 1 ? nextLine.length : range.end.column; + selectionEnd += line.length + 1; + line = line + "\n" + nextLine; + } + else if (isMobile && row > 0) { + line = "\n" + line; + selectionEnd += 1; + selectionStart += 1; + } + if (line.length > MAX_LINE_LENGTH) { + if (selectionStart < MAX_LINE_LENGTH && selectionEnd < MAX_LINE_LENGTH) { + line = line.slice(0, MAX_LINE_LENGTH); } else { - selectionStart = 0; - selectionEnd = 1; + line = "\n"; + if (selectionStart == selectionEnd) { + selectionStart = selectionEnd = 0; + } + else { + selectionStart = 0; + selectionEnd = 1; + } } } + var newValue = line + "\n\n"; + if (newValue != lastValue) { + text.value = lastValue = newValue; + lastSelectionStart = lastSelectionEnd = newValue.length; + } } - } - - var newValue = line + "\n\n"; - if (newValue != lastValue) { - text.value = lastValue = newValue; - lastSelectionStart = lastSelectionEnd = newValue.length; - } - if (afterContextMenu) { - lastSelectionStart = text.selectionStart; - lastSelectionEnd = text.selectionEnd; - } - if ( - lastSelectionEnd != selectionEnd - || lastSelectionStart != selectionStart - || text.selectionEnd != lastSelectionEnd // on ie edge selectionEnd changes silently after the initialization - ) { - try { - text.setSelectionRange(selectionStart, selectionEnd); - lastSelectionStart = selectionStart; - lastSelectionEnd = selectionEnd; - } catch(e){} - } - inComposition = false; - }; + if (afterContextMenu) { + lastSelectionStart = text.selectionStart; + lastSelectionEnd = text.selectionEnd; + } + if (lastSelectionEnd != selectionEnd + || lastSelectionStart != selectionStart + || text.selectionEnd != lastSelectionEnd // on ie edge selectionEnd changes silently after the initialization + ) { + try { + text.setSelectionRange(selectionStart, selectionEnd); + lastSelectionStart = selectionStart; + lastSelectionEnd = selectionEnd; + } + catch (e) { } + } + inComposition = false; + }; this.resetSelection = resetSelection; - if (isFocused) host.onFocus(); - - - var isAllSelected = function(text) { + var isAllSelected = function (text) { return text.selectionStart === 0 && text.selectionEnd >= lastValue.length && text.value === lastValue && lastValue && text.selectionEnd !== lastSelectionEnd; }; - - var onSelect = function(e) { + var onSelect = function (e) { if (inComposition) return; if (copied) { copied = false; - } else if (isAllSelected(text)) { + } + else if (isAllSelected(text)) { host.selectAll(); resetSelection(); - } else if (isMobile && text.selectionStart != lastSelectionStart) { + } + else if (isMobile && text.selectionStart != lastSelectionStart) { resetSelection(); } }; - var inputHandler = null; - this.setInputHandler = function(cb) {inputHandler = cb;}; - this.getInputHandler = function() {return inputHandler;}; + this.setInputHandler = function (cb) { inputHandler = cb; }; + this.getInputHandler = function () { return inputHandler; }; var afterContextMenu = false; - - var sendText = function(value, fromInput) { + var sendText = function (value, fromInput) { if (afterContextMenu) afterContextMenu = false; if (pasted) { @@ -20430,17 +20099,15 @@ var TextInput = function(parentNode, host) { host.onPaste(value); pasted = false; return ""; - } else { + } + else { var selectionStart = text.selectionStart; var selectionEnd = text.selectionEnd; - var extendLeft = lastSelectionStart; var extendRight = lastValue.length - lastSelectionEnd; - var inserted = value; var restoreStart = value.length - selectionStart; var restoreEnd = value.length - selectionEnd; - var i = 0; while (extendLeft > 0 && lastValue[i] == value[i]) { i++; @@ -20448,12 +20115,12 @@ var TextInput = function(parentNode, host) { } inserted = inserted.slice(i); i = 1; - while (extendRight > 0 && lastValue.length - i > lastSelectionStart - 1 && lastValue[lastValue.length - i] == value[value.length - i]) { + while (extendRight > 0 && lastValue.length - i > lastSelectionStart - 1 && lastValue[lastValue.length - i] == value[value.length - i]) { i++; extendRight--; } - restoreStart -= i-1; - restoreEnd -= i-1; + restoreStart -= i - 1; + restoreEnd -= i - 1; var endIndex = inserted.length - i + 1; if (endIndex < 0) { extendLeft = -endIndex; @@ -20468,10 +20135,10 @@ var TextInput = function(parentNode, host) { inserted = " "; shouldReset = true; } - if (inserted && !extendLeft && !extendRight && !restoreStart && !restoreEnd || commandMode) { host.onTextInput(inserted); - } else { + } + else { host.onTextInput(inserted, { extendLeft: extendLeft, extendRight: extendRight, @@ -20480,7 +20147,6 @@ var TextInput = function(parentNode, host) { }); } sendingText = false; - lastValue = value; lastSelectionStart = selectionStart; lastSelectionEnd = selectionEnd; @@ -20488,46 +20154,45 @@ var TextInput = function(parentNode, host) { return shouldReset ? "\n" : inserted; } }; - var onInput = function(e) { + var onInput = function (e) { if (inComposition) return onCompositionUpdate(); if (e && e.inputType) { - if (e.inputType == "historyUndo") return host.execCommand("undo"); - if (e.inputType == "historyRedo") return host.execCommand("redo"); + if (e.inputType == "historyUndo") + return host.execCommand("undo"); + if (e.inputType == "historyRedo") + return host.execCommand("redo"); } var data = text.value; var inserted = sendText(data, true); - if ( - data.length > MAX_LINE_LENGTH + 100 + if (data.length > MAX_LINE_LENGTH + 100 || valueResetRegex.test(inserted) - || isMobile && lastSelectionStart < 1 && lastSelectionStart == lastSelectionEnd - ) { + || isMobile && lastSelectionStart < 1 && lastSelectionStart == lastSelectionEnd) { resetSelection(); } }; - - var handleClipboardData = function(e, data, forceIEMime) { - var clipboardData = e.clipboardData || window.clipboardData; + var handleClipboardData = function (e, data, forceIEMime) { + var clipboardData = e.clipboardData || window["clipboardData"]; if (!clipboardData || BROKEN_SETDATA) return; var mime = USE_IE_MIME_TYPE || forceIEMime ? "Text" : "text/plain"; try { if (data) { return clipboardData.setData(mime, data) !== false; - } else { + } + else { return clipboardData.getData(mime); } - } catch(e) { + } + catch (e) { if (!forceIEMime) return handleClipboardData(e, data, true); } }; - - var doCopy = function(e, isCut) { + var doCopy = function (e, isCut) { var data = host.getCopyText(); if (!data) return event.preventDefault(e); - if (handleClipboardData(e, data)) { if (isIOS) { resetSelection(data); @@ -20538,27 +20203,25 @@ var TextInput = function(parentNode, host) { } isCut ? host.onCut() : host.onCopy(); event.preventDefault(e); - } else { + } + else { copied = true; text.value = data; text.select(); - setTimeout(function(){ + setTimeout(function () { copied = false; resetSelection(); isCut ? host.onCut() : host.onCopy(); }); } }; - - var onCut = function(e) { + var onCut = function (e) { doCopy(e, true); }; - - var onCopy = function(e) { + var onCopy = function (e) { doCopy(e, false); }; - - var onPaste = function(e) { + var onPaste = function (e) { var data = handleClipboardData(e); if (clipboard.pasteCancelled()) return; @@ -20574,20 +20237,20 @@ var TextInput = function(parentNode, host) { pasted = true; } }; - - event.addCommandKeyListener(text, host.onCommandKey.bind(host), host); - + event.addCommandKeyListener(text, function (e, hashId, keyCode) { + if (inComposition) + return; + return host.onCommandKey(e, hashId, keyCode); + }, host); event.addListener(text, "select", onSelect, host); event.addListener(text, "input", onInput, host); - event.addListener(text, "cut", onCut, host); event.addListener(text, "copy", onCopy, host); event.addListener(text, "paste", onPaste, host); if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)) { - event.addListener(parentNode, "keydown", function(e) { + event.addListener(parentNode, "keydown", function (e) { if ((useragent.isMac && !e.metaKey) || !e.ctrlKey) return; - switch (e.keyCode) { case 67: onCopy(e); @@ -20601,29 +20264,23 @@ var TextInput = function(parentNode, host) { } }, host); } - var onCompositionStart = function(e) { + var onCompositionStart = function (e) { if (inComposition || !host.onCompositionStart || host.$readOnly) return; - inComposition = {}; - if (commandMode) return; - if (e.data) inComposition.useTextareaForIME = false; - setTimeout(onCompositionUpdate, 0); host._signal("compositionStart"); host.on("mousedown", cancelComposition); - var range = host.getSelectionRange(); range.end.row = range.start.row; range.end.column = range.start.column; inComposition.markerRange = range; inComposition.selectionStart = lastSelectionStart; host.onCompositionStart(inComposition); - if (inComposition.useTextareaForIME) { lastValue = text.value = ""; lastSelectionStart = 0; @@ -20636,13 +20293,11 @@ var TextInput = function(parentNode, host) { inComposition.context = text.getInputContext(); } }; - - var onCompositionUpdate = function() { + var onCompositionUpdate = function () { if (!inComposition || !host.onCompositionUpdate || host.$readOnly) return; if (commandMode) return cancelComposition(); - if (inComposition.useTextareaForIME) { host.onCompositionUpdate(text.value); } @@ -20659,25 +20314,22 @@ var TextInput = function(parentNode, host) { } } }; - - var onCompositionEnd = function(e) { - if (!host.onCompositionEnd || host.$readOnly) return; + var onCompositionEnd = function (e) { + if (!host.onCompositionEnd || host.$readOnly) + return; inComposition = false; host.onCompositionEnd(); host.off("mousedown", cancelComposition); - if (e) onInput(); + if (e) + onInput(); }; - - function cancelComposition() { ignoreFocusEvents = true; text.blur(); text.focus(); ignoreFocusEvents = false; } - var syncComposition = lang.delayedCall(onCompositionUpdate, 50).schedule.bind(null, null); - function onKeyup(e) { if (e.keyCode == 27 && text.value.length < text.selectionStart) { if (!inComposition) @@ -20687,63 +20339,52 @@ var TextInput = function(parentNode, host) { } syncComposition(); } - event.addListener(text, "compositionstart", onCompositionStart, host); event.addListener(text, "compositionupdate", onCompositionUpdate, host); event.addListener(text, "keyup", onKeyup, host); event.addListener(text, "keydown", syncComposition, host); event.addListener(text, "compositionend", onCompositionEnd, host); - - this.getElement = function() { + this.getElement = function () { return text; }; - this.setCommandMode = function(value) { - commandMode = value; - text.readOnly = false; + this.setCommandMode = function (value) { + commandMode = value; + text.readOnly = false; }; - - this.setReadOnly = function(readOnly) { + this.setReadOnly = function (readOnly) { if (!commandMode) text.readOnly = readOnly; }; - - this.setCopyWithEmptySelection = function(value) { + this.setCopyWithEmptySelection = function (value) { }; - - this.onContextMenu = function(e) { + this.onContextMenu = function (e) { afterContextMenu = true; resetSelection(); - host._emit("nativecontextmenu", {target: host, domEvent: e}); + host._emit("nativecontextmenu", { target: host, domEvent: e }); this.moveToMouse(e, true); }; - - this.moveToMouse = function(e, bringToFront) { + this.moveToMouse = function (e, bringToFront) { if (!tempStyle) tempStyle = text.style.cssText; text.style.cssText = (bringToFront ? "z-index:100000;" : "") + (useragent.isIE ? "opacity:0.1;" : "") + "text-indent: -" + (lastSelectionStart + lastSelectionEnd) * host.renderer.characterWidth * 0.5 + "px;"; - var rect = host.container.getBoundingClientRect(); var style = dom.computedStyle(host.container); var top = rect.top + (parseInt(style.borderTopWidth) || 0); var left = rect.left + (parseInt(rect.borderLeftWidth) || 0); - var maxTop = rect.bottom - top - text.clientHeight -2; - var move = function(e) { + var maxTop = rect.bottom - top - text.clientHeight - 2; + var move = function (e) { dom.translate(text, e.clientX - left - 2, Math.min(e.clientY - top - 2, maxTop)); }; move(e); - if (e.type != "mousedown") return; - host.renderer.$isMousePressed = true; - clearTimeout(closeTimeout); if (useragent.isWin) event.capture(host.container, move, onContextMenuClose); }; - this.onContextMenuClose = onContextMenuClose; var closeTimeout; function onContextMenuClose() { @@ -20758,85 +20399,78 @@ var TextInput = function(parentNode, host) { host.renderer.$moveTextAreaToCursor(); }, 0); } - - var onContextMenu = function(e) { + var onContextMenu = function (e) { host.textInput.onContextMenu(e); onContextMenuClose(); }; event.addListener(text, "mouseup", onContextMenu, host); - event.addListener(text, "mousedown", function(e) { + event.addListener(text, "mousedown", function (e) { e.preventDefault(); onContextMenuClose(); }, host); event.addListener(host.renderer.scroller, "contextmenu", onContextMenu, host); event.addListener(text, "contextmenu", onContextMenu, host); - if (isIOS) addIosSelectionHandler(parentNode, host, text); - function addIosSelectionHandler(parentNode, host, text) { var typingResetTimeout = null; var typing = false; - text.addEventListener("keydown", function (e) { - if (typingResetTimeout) clearTimeout(typingResetTimeout); + if (typingResetTimeout) + clearTimeout(typingResetTimeout); typing = true; }, true); - text.addEventListener("keyup", function (e) { typingResetTimeout = setTimeout(function () { typing = false; }, 100); }, true); - var detectArrowKeys = function(e) { - if (document.activeElement !== text) return; - if (typing || inComposition || host.$mouseHandler.isMousePressed) return; - + var detectArrowKeys = function (e) { + if (document.activeElement !== text) + return; + if (typing || inComposition || host.$mouseHandler.isMousePressed) + return; if (copied) { return; } var selectionStart = text.selectionStart; var selectionEnd = text.selectionEnd; - var key = null; var modifier = 0; if (selectionStart == 0) { key = KEYS.up; - } else if (selectionStart == 1) { + } + else if (selectionStart == 1) { key = KEYS.home; - } else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd] == "\n") { + } + else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd] == "\n") { key = KEYS.end; - } else if (selectionStart < lastSelectionStart && lastValue[selectionStart - 1] == " ") { + } + else if (selectionStart < lastSelectionStart && lastValue[selectionStart - 1] == " ") { key = KEYS.left; modifier = MODS.option; - } else if ( - selectionStart < lastSelectionStart - || ( - selectionStart == lastSelectionStart + } + else if (selectionStart < lastSelectionStart + || (selectionStart == lastSelectionStart && lastSelectionEnd != lastSelectionStart - && selectionStart == selectionEnd - ) - ) { + && selectionStart == selectionEnd)) { key = KEYS.left; - } else if (selectionEnd > lastSelectionEnd && lastValue.slice(0, selectionEnd).split("\n").length > 2) { + } + else if (selectionEnd > lastSelectionEnd && lastValue.slice(0, selectionEnd).split("\n").length > 2) { key = KEYS.down; - } else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd - 1] == " ") { + } + else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd - 1] == " ") { key = KEYS.right; modifier = MODS.option; - } else if ( - selectionEnd > lastSelectionEnd - || ( - selectionEnd == lastSelectionEnd + } + else if (selectionEnd > lastSelectionEnd + || (selectionEnd == lastSelectionEnd && lastSelectionEnd != lastSelectionStart - && selectionStart == selectionEnd - ) - ) { + && selectionStart == selectionEnd)) { key = KEYS.right; } - if (selectionStart !== selectionEnd) modifier |= MODS.shift; - if (key) { var result = host.onCommandKey({}, modifier, key); if (!result && host.commands) { @@ -20851,56 +20485,49 @@ var TextInput = function(parentNode, host) { } }; document.addEventListener("selectionchange", detectArrowKeys); - host.on("destroy", function() { + host.on("destroy", function () { document.removeEventListener("selectionchange", detectArrowKeys); }); } + this.destroy = function () { + if (text.parentElement) + text.parentElement.removeChild(text); + }; }; - exports.TextInput = TextInput; -exports.$setUserAgentForTests = function(_isMobile, _isIOS) { +exports.$setUserAgentForTests = function (_isMobile, _isIOS) { isMobile = _isMobile; isIOS = _isIOS; }; -}); -ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"], function(require, exports, module){"use strict"; var useragent = require("../lib/useragent"); - var DRAG_OFFSET = 0; // pixels var SCROLL_COOLDOWN_T = 550; // milliseconds - -function DefaultHandlers(mouseHandler) { - mouseHandler.$clickSelection = null; - - var editor = mouseHandler.editor; - editor.setDefaultHandler("mousedown", this.onMouseDown.bind(mouseHandler)); - editor.setDefaultHandler("dblclick", this.onDoubleClick.bind(mouseHandler)); - editor.setDefaultHandler("tripleclick", this.onTripleClick.bind(mouseHandler)); - editor.setDefaultHandler("quadclick", this.onQuadClick.bind(mouseHandler)); - editor.setDefaultHandler("mousewheel", this.onMouseWheel.bind(mouseHandler)); - - var exports = ["select", "startSelect", "selectEnd", "selectAllEnd", "selectByWordsEnd", - "selectByLinesEnd", "dragWait", "dragWaitEnd", "focusWait"]; - - exports.forEach(function(x) { - mouseHandler[x] = this[x]; - }, this); - - mouseHandler.selectByLines = this.extendSelectionBy.bind(mouseHandler, "getLineRange"); - mouseHandler.selectByWords = this.extendSelectionBy.bind(mouseHandler, "getWordRange"); -} - -(function() { - - this.onMouseDown = function(ev) { +var DefaultHandlers = /** @class */ (function () { + function DefaultHandlers(mouseHandler) { + mouseHandler.$clickSelection = null; + var editor = mouseHandler.editor; + editor.setDefaultHandler("mousedown", this.onMouseDown.bind(mouseHandler)); + editor.setDefaultHandler("dblclick", this.onDoubleClick.bind(mouseHandler)); + editor.setDefaultHandler("tripleclick", this.onTripleClick.bind(mouseHandler)); + editor.setDefaultHandler("quadclick", this.onQuadClick.bind(mouseHandler)); + editor.setDefaultHandler("mousewheel", this.onMouseWheel.bind(mouseHandler)); + var exports = ["select", "startSelect", "selectEnd", "selectAllEnd", "selectByWordsEnd", + "selectByLinesEnd", "dragWait", "dragWaitEnd", "focusWait"]; + exports.forEach(function (x) { + mouseHandler[x] = this[x]; + }, this); + mouseHandler["selectByLines"] = this.extendSelectionBy.bind(mouseHandler, "getLineRange"); + mouseHandler["selectByWords"] = this.extendSelectionBy.bind(mouseHandler, "getWordRange"); + } + DefaultHandlers.prototype.onMouseDown = function (ev) { var inSelection = ev.inSelection(); var pos = ev.getDocumentPosition(); this.mousedownEvent = ev; var editor = this.editor; - var button = ev.getButton(); if (button !== 0) { var selectionRange = editor.getSelectionRange(); @@ -20914,7 +20541,6 @@ function DefaultHandlers(mouseHandler) { } return; } - this.mousedownEvent.time = Date.now(); if (inSelection && !editor.isFocused()) { editor.focus(); @@ -20924,40 +20550,36 @@ function DefaultHandlers(mouseHandler) { return; } } - this.captureMouse(ev); this.startSelect(pos, ev.domEvent._clicks > 1); return ev.preventDefault(); }; - - this.startSelect = function(pos, waitForClickSelection) { + DefaultHandlers.prototype.startSelect = function (pos, waitForClickSelection) { pos = pos || this.editor.renderer.screenToTextCoordinates(this.x, this.y); var editor = this.editor; - if (!this.mousedownEvent) return; + if (!this.mousedownEvent) + return; if (this.mousedownEvent.getShiftKey()) editor.selection.selectToPosition(pos); else if (!waitForClickSelection) editor.selection.moveToPosition(pos); if (!waitForClickSelection) this.select(); - if (editor.renderer.scroller.setCapture) { - editor.renderer.scroller.setCapture(); - } editor.setStyle("ace_selecting"); this.setState("select"); }; - - this.select = function() { + DefaultHandlers.prototype.select = function () { var anchor, editor = this.editor; var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y); if (this.$clickSelection) { var cmp = this.$clickSelection.comparePoint(cursor); - if (cmp == -1) { anchor = this.$clickSelection.end; - } else if (cmp == 1) { + } + else if (cmp == 1) { anchor = this.$clickSelection.start; - } else { + } + else { var orientedRange = calcRangeOrientation(this.$clickSelection, cursor); cursor = orientedRange.cursor; anchor = orientedRange.anchor; @@ -20967,27 +20589,28 @@ function DefaultHandlers(mouseHandler) { editor.selection.selectToPosition(cursor); editor.renderer.scrollCursorIntoView(); }; - - this.extendSelectionBy = function(unitName) { + DefaultHandlers.prototype.extendSelectionBy = function (unitName) { var anchor, editor = this.editor; var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y); var range = editor.selection[unitName](cursor.row, cursor.column); if (this.$clickSelection) { var cmpStart = this.$clickSelection.comparePoint(range.start); var cmpEnd = this.$clickSelection.comparePoint(range.end); - if (cmpStart == -1 && cmpEnd <= 0) { anchor = this.$clickSelection.end; if (range.end.row != cursor.row || range.end.column != cursor.column) cursor = range.start; - } else if (cmpEnd == 1 && cmpStart >= 0) { + } + else if (cmpEnd == 1 && cmpStart >= 0) { anchor = this.$clickSelection.start; if (range.start.row != cursor.row || range.start.column != cursor.column) cursor = range.end; - } else if (cmpStart == -1 && cmpEnd == 1) { + } + else if (cmpStart == -1 && cmpEnd == 1) { cursor = range.end; anchor = range.start; - } else { + } + else { var orientedRange = calcRangeOrientation(this.$clickSelection, cursor); cursor = orientedRange.cursor; anchor = orientedRange.anchor; @@ -20997,31 +20620,20 @@ function DefaultHandlers(mouseHandler) { editor.selection.selectToPosition(cursor); editor.renderer.scrollCursorIntoView(); }; - - this.selectEnd = - this.selectAllEnd = - this.selectByWordsEnd = - this.selectByLinesEnd = function() { + DefaultHandlers.prototype.selectByLinesEnd = function () { this.$clickSelection = null; this.editor.unsetStyle("ace_selecting"); - if (this.editor.renderer.scroller.releaseCapture) { - this.editor.renderer.scroller.releaseCapture(); - } }; - - this.focusWait = function() { + DefaultHandlers.prototype.focusWait = function () { var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); var time = Date.now(); - if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimeout) this.startSelect(this.mousedownEvent.getDocumentPosition()); }; - - this.onDoubleClick = function(ev) { + DefaultHandlers.prototype.onDoubleClick = function (ev) { var pos = ev.getDocumentPosition(); var editor = this.editor; var session = editor.session; - var range = session.getBracketRange(pos); if (range) { if (range.isEmpty()) { @@ -21029,50 +20641,44 @@ function DefaultHandlers(mouseHandler) { range.end.column++; } this.setState("select"); - } else { + } + else { range = editor.selection.getWordRange(pos.row, pos.column); this.setState("selectByWords"); } this.$clickSelection = range; this.select(); }; - - this.onTripleClick = function(ev) { + DefaultHandlers.prototype.onTripleClick = function (ev) { var pos = ev.getDocumentPosition(); var editor = this.editor; - this.setState("selectByLines"); var range = editor.getSelectionRange(); if (range.isMultiLine() && range.contains(pos.row, pos.column)) { this.$clickSelection = editor.selection.getLineRange(range.start.row); this.$clickSelection.end = editor.selection.getLineRange(range.end.row).end; - } else { + } + else { this.$clickSelection = editor.selection.getLineRange(pos.row); } this.select(); }; - - this.onQuadClick = function(ev) { + DefaultHandlers.prototype.onQuadClick = function (ev) { var editor = this.editor; - editor.selectAll(); this.$clickSelection = editor.getSelectionRange(); this.setState("selectAll"); }; - - this.onMouseWheel = function(ev) { + DefaultHandlers.prototype.onMouseWheel = function (ev) { if (ev.getAccelKey()) return; if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) { ev.wheelX = ev.wheelY; ev.wheelY = 0; } - var editor = this.editor; - if (!this.$lastScroll) this.$lastScroll = { t: 0, vx: 0, vy: 0, allowed: 0 }; - var prevScroll = this.$lastScroll; var t = ev.domEvent.timeStamp; var dt = t - prevScroll.t; @@ -21082,18 +20688,16 @@ function DefaultHandlers(mouseHandler) { vx = (vx + prevScroll.vx) / 2; vy = (vy + prevScroll.vy) / 2; } - var direction = Math.abs(vx / vy); - var canScroll = false; if (direction >= 1 && editor.renderer.isScrollableBy(ev.wheelX * ev.speed, 0)) canScroll = true; if (direction <= 1 && editor.renderer.isScrollableBy(0, ev.wheelY * ev.speed)) canScroll = true; - if (canScroll) { prevScroll.allowed = t; - } else if (t - prevScroll.allowed < SCROLL_COOLDOWN_T) { + } + else if (t - prevScroll.allowed < SCROLL_COOLDOWN_T) { var isSlower = Math.abs(vx) <= 1.5 * Math.abs(prevScroll.vx) && Math.abs(vy) <= 1.5 * Math.abs(prevScroll.vy); if (isSlower) { @@ -21104,25 +20708,23 @@ function DefaultHandlers(mouseHandler) { prevScroll.allowed = 0; } } - prevScroll.t = t; prevScroll.vx = vx; prevScroll.vy = vy; - if (canScroll) { editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed); return ev.stop(); } }; - -}).call(DefaultHandlers.prototype); - + return DefaultHandlers; +}()); +DefaultHandlers.prototype.selectEnd = DefaultHandlers.prototype.selectByLinesEnd; +DefaultHandlers.prototype.selectAllEnd = DefaultHandlers.prototype.selectByLinesEnd; +DefaultHandlers.prototype.selectByWordsEnd = DefaultHandlers.prototype.selectByLinesEnd; exports.DefaultHandlers = DefaultHandlers; - function calcDistance(ax, ay, bx, by) { return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); } - function calcRangeOrientation(range, cursor) { if (range.start.row == range.end.row) var cmp = 2 * cursor.column - range.start.column - range.end.column; @@ -21130,51 +20732,91 @@ function calcRangeOrientation(range, cursor) { var cmp = cursor.column - 4; else var cmp = 2 * cursor.row - range.start.row - range.end.row; - if (cmp < 0) - return {cursor: range.start, anchor: range.end}; + return { cursor: range.start, anchor: range.end }; else - return {cursor: range.end, anchor: range.start}; + return { cursor: range.end, anchor: range.start }; } }); -ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"], function(require, exports, module) { -"use strict"; +ace.define("ace/lib/scroll",["require","exports","module"], function(require, exports, module){exports.preventParentScroll = function preventParentScroll(event) { + event.stopPropagation(); + var target = event.currentTarget; + var contentOverflows = target.scrollHeight > target.clientHeight; + if (!contentOverflows) { + event.preventDefault(); + } +}; -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -function Tooltip (parentNode) { - this.isOpen = false; - this.$element = null; - this.$parentNode = parentNode; -} +}); -(function() { - this.$init = function() { +ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"], function(require, exports, module){"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var dom = require("./lib/dom"); +var event = require("./lib/event"); +var Range = require("./range").Range; +var preventParentScroll = require("./lib/scroll").preventParentScroll; +var CLASSNAME = "ace_tooltip"; +var Tooltip = /** @class */ (function () { + function Tooltip(parentNode) { + this.isOpen = false; + this.$element = null; + this.$parentNode = parentNode; + } + Tooltip.prototype.$init = function () { this.$element = dom.createElement("div"); - this.$element.className = "ace_tooltip"; + this.$element.className = CLASSNAME; this.$element.style.display = "none"; this.$parentNode.appendChild(this.$element); return this.$element; }; - this.getElement = function() { + Tooltip.prototype.getElement = function () { return this.$element || this.$init(); }; - this.setText = function(text) { + Tooltip.prototype.setText = function (text) { this.getElement().textContent = text; }; - this.setHtml = function(html) { + Tooltip.prototype.setHtml = function (html) { this.getElement().innerHTML = html; }; - this.setPosition = function(x, y) { + Tooltip.prototype.setPosition = function (x, y) { this.getElement().style.left = x + "px"; this.getElement().style.top = y + "px"; }; - this.setClassName = function(className) { + Tooltip.prototype.setClassName = function (className) { dom.addCssClass(this.getElement(), className); }; - this.show = function(text, x, y) { + Tooltip.prototype.setTheme = function (theme) { + this.$element.className = CLASSNAME + " " + + (theme.isDark ? "ace_dark " : "") + (theme.cssClass || ""); + }; + Tooltip.prototype.show = function (text, x, y) { if (text != null) this.setText(text); if (x != null && y != null) @@ -21184,55 +20826,315 @@ function Tooltip (parentNode) { this.isOpen = true; } }; - - this.hide = function() { + Tooltip.prototype.hide = function (e) { if (this.isOpen) { this.getElement().style.display = "none"; + this.getElement().className = CLASSNAME; this.isOpen = false; } }; - this.getHeight = function() { + Tooltip.prototype.getHeight = function () { return this.getElement().offsetHeight; }; - this.getWidth = function() { + Tooltip.prototype.getWidth = function () { return this.getElement().offsetWidth; }; - - this.destroy = function() { + Tooltip.prototype.destroy = function () { this.isOpen = false; if (this.$element && this.$element.parentNode) { this.$element.parentNode.removeChild(this.$element); } }; - -}).call(Tooltip.prototype); - + return Tooltip; +}()); +var PopupManager = /** @class */ (function () { + function PopupManager() { + this.popups = []; + } + PopupManager.prototype.addPopup = function (popup) { + this.popups.push(popup); + this.updatePopups(); + }; + PopupManager.prototype.removePopup = function (popup) { + var index = this.popups.indexOf(popup); + if (index !== -1) { + this.popups.splice(index, 1); + this.updatePopups(); + } + }; + PopupManager.prototype.updatePopups = function () { + var e_1, _a, e_2, _b; + this.popups.sort(function (a, b) { return b.priority - a.priority; }); + var visiblepopups = []; + try { + for (var _c = __values(this.popups), _d = _c.next(); !_d.done; _d = _c.next()) { + var popup = _d.value; + var shouldDisplay = true; + try { + for (var visiblepopups_1 = (e_2 = void 0, __values(visiblepopups)), visiblepopups_1_1 = visiblepopups_1.next(); !visiblepopups_1_1.done; visiblepopups_1_1 = visiblepopups_1.next()) { + var visiblePopup = visiblepopups_1_1.value; + if (this.doPopupsOverlap(visiblePopup, popup)) { + shouldDisplay = false; + break; + } + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (visiblepopups_1_1 && !visiblepopups_1_1.done && (_b = visiblepopups_1.return)) _b.call(visiblepopups_1); + } + finally { if (e_2) throw e_2.error; } + } + if (shouldDisplay) { + visiblepopups.push(popup); + } + else { + popup.hide(); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_d && !_d.done && (_a = _c.return)) _a.call(_c); + } + finally { if (e_1) throw e_1.error; } + } + }; + PopupManager.prototype.doPopupsOverlap = function (popupA, popupB) { + var rectA = popupA.getElement().getBoundingClientRect(); + var rectB = popupB.getElement().getBoundingClientRect(); + return (rectA.left < rectB.right && rectA.right > rectB.left && rectA.top < rectB.bottom && rectA.bottom + > rectB.top); + }; + return PopupManager; +}()); +var popupManager = new PopupManager(); +exports.popupManager = popupManager; exports.Tooltip = Tooltip; +var HoverTooltip = /** @class */ (function (_super) { + __extends(HoverTooltip, _super); + function HoverTooltip(parentNode) { + if (parentNode === void 0) { parentNode = document.body; } + var _this = _super.call(this, parentNode) || this; + _this.timeout = undefined; + _this.lastT = 0; + _this.idleTime = 350; + _this.lastEvent = undefined; + _this.onMouseOut = _this.onMouseOut.bind(_this); + _this.onMouseMove = _this.onMouseMove.bind(_this); + _this.waitForHover = _this.waitForHover.bind(_this); + _this.hide = _this.hide.bind(_this); + var el = _this.getElement(); + el.style.whiteSpace = "pre-wrap"; + el.style.pointerEvents = "auto"; + el.addEventListener("mouseout", _this.onMouseOut); + el.tabIndex = -1; + el.addEventListener("blur", function () { + if (!el.contains(document.activeElement)) + this.hide(); + }.bind(_this)); + el.addEventListener("wheel", preventParentScroll); + return _this; + } + HoverTooltip.prototype.addToEditor = function (editor) { + editor.on("mousemove", this.onMouseMove); + editor.on("mousedown", this.hide); + editor.renderer.getMouseEventTarget().addEventListener("mouseout", this.onMouseOut, true); + }; + HoverTooltip.prototype.removeFromEditor = function (editor) { + editor.off("mousemove", this.onMouseMove); + editor.off("mousedown", this.hide); + editor.renderer.getMouseEventTarget().removeEventListener("mouseout", this.onMouseOut, true); + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + }; + HoverTooltip.prototype.onMouseMove = function (e, editor) { + this.lastEvent = e; + this.lastT = Date.now(); + var isMousePressed = editor.$mouseHandler.isMousePressed; + if (this.isOpen) { + var pos = this.lastEvent && this.lastEvent.getDocumentPosition(); + if (!this.range + || !this.range.contains(pos.row, pos.column) + || isMousePressed + || this.isOutsideOfText(this.lastEvent)) { + this.hide(); + } + } + if (this.timeout || isMousePressed) + return; + this.lastEvent = e; + this.timeout = setTimeout(this.waitForHover, this.idleTime); + }; + HoverTooltip.prototype.waitForHover = function () { + if (this.timeout) + clearTimeout(this.timeout); + var dt = Date.now() - this.lastT; + if (this.idleTime - dt > 10) { + this.timeout = setTimeout(this.waitForHover, this.idleTime - dt); + return; + } + this.timeout = null; + if (this.lastEvent && !this.isOutsideOfText(this.lastEvent)) { + this.$gatherData(this.lastEvent, this.lastEvent.editor); + } + }; + HoverTooltip.prototype.isOutsideOfText = function (e) { + var editor = e.editor; + var docPos = e.getDocumentPosition(); + var line = editor.session.getLine(docPos.row); + if (docPos.column == line.length) { + var screenPos = editor.renderer.pixelToScreenCoordinates(e.clientX, e.clientY); + var clippedPos = editor.session.documentToScreenPosition(docPos.row, docPos.column); + if (clippedPos.column != screenPos.column + || clippedPos.row != screenPos.row) { + return true; + } + } + return false; + }; + HoverTooltip.prototype.setDataProvider = function (value) { + this.$gatherData = value; + }; + HoverTooltip.prototype.showForRange = function (editor, range, domNode, startingEvent) { + var MARGIN = 10; + if (startingEvent && startingEvent != this.lastEvent) + return; + if (this.isOpen && document.activeElement == this.getElement()) + return; + var renderer = editor.renderer; + if (!this.isOpen) { + popupManager.addPopup(this); + this.$registerCloseEvents(); + this.setTheme(renderer.theme); + } + this.isOpen = true; + this.addMarker(range, editor.session); + this.range = Range.fromPoints(range.start, range.end); + var position = renderer.textToScreenCoordinates(range.start.row, range.start.column); + var rect = renderer.scroller.getBoundingClientRect(); + if (position.pageX < rect.left) + position.pageX = rect.left; + var element = this.getElement(); + element.innerHTML = ""; + element.appendChild(domNode); + element.style.maxHeight = ""; + element.style.display = "block"; + var labelHeight = element.clientHeight; + var labelWidth = element.clientWidth; + var spaceBelow = window.innerHeight - position.pageY - renderer.lineHeight; + var isAbove = true; + if (position.pageY - labelHeight < 0 && position.pageY < spaceBelow) { + isAbove = false; + } + element.style.maxHeight = (isAbove ? position.pageY : spaceBelow) - MARGIN + "px"; + element.style.top = isAbove ? "" : position.pageY + renderer.lineHeight + "px"; + element.style.bottom = isAbove ? window.innerHeight - position.pageY + "px" : ""; + element.style.left = Math.min(position.pageX, window.innerWidth - labelWidth - MARGIN) + "px"; + }; + HoverTooltip.prototype.addMarker = function (range, session) { + if (this.marker) { + this.$markerSession.removeMarker(this.marker); + } + this.$markerSession = session; + this.marker = session && session.addMarker(range, "ace_highlight-marker", "text"); + }; + HoverTooltip.prototype.hide = function (e) { + if (!e && document.activeElement == this.getElement()) + return; + if (e && e.target && (e.type != "keydown" || e.ctrlKey || e.metaKey) && this.$element.contains(e.target)) + return; + this.lastEvent = null; + if (this.timeout) + clearTimeout(this.timeout); + this.timeout = null; + this.addMarker(null); + if (this.isOpen) { + this.$removeCloseEvents(); + this.getElement().style.display = "none"; + this.isOpen = false; + popupManager.removePopup(this); + } + }; + HoverTooltip.prototype.$registerCloseEvents = function () { + window.addEventListener("keydown", this.hide, true); + window.addEventListener("wheel", this.hide, true); + window.addEventListener("mousedown", this.hide, true); + }; + HoverTooltip.prototype.$removeCloseEvents = function () { + window.removeEventListener("keydown", this.hide, true); + window.removeEventListener("wheel", this.hide, true); + window.removeEventListener("mousedown", this.hide, true); + }; + HoverTooltip.prototype.onMouseOut = function (e) { + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.lastEvent = null; + if (!this.isOpen) + return; + if (!e.relatedTarget || this.getElement().contains(e.relatedTarget)) + return; + if (e && e.currentTarget.contains(e.relatedTarget)) + return; + if (!e.relatedTarget.classList.contains("ace_content")) + this.hide(); + }; + return HoverTooltip; +}(Tooltip)); +exports.HoverTooltip = HoverTooltip; + }); -ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"], function(require, exports, module) { -"use strict"; +ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"], function(require, exports, module){"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; var dom = require("../lib/dom"); -var oop = require("../lib/oop"); var event = require("../lib/event"); var Tooltip = require("../tooltip").Tooltip; - +var nls = require("../config").nls; +var lang = require("../lib/lang"); function GutterHandler(mouseHandler) { var editor = mouseHandler.editor; var gutter = editor.renderer.$gutterLayer; - var tooltip = new GutterTooltip(editor.container); - - mouseHandler.editor.setDefaultHandler("guttermousedown", function(e) { + var tooltip = new GutterTooltip(editor); + mouseHandler.editor.setDefaultHandler("guttermousedown", function (e) { if (!editor.isFocused() || e.getButton() != 0) return; var gutterRegion = gutter.getRegion(e); - if (gutterRegion == "foldWidgets") return; - var row = e.getDocumentPosition().row; var selection = editor.session.selection; - if (e.getShiftKey()) selection.selectTo(row, 0); else { @@ -21246,16 +21148,9 @@ function GutterHandler(mouseHandler) { mouseHandler.captureMouse(e); return e.preventDefault(); }); - - - var tooltipTimeout, mouseEvent, tooltipAnnotation; - + var tooltipTimeout, mouseEvent; function showTooltip() { var row = mouseEvent.getDocumentPosition().row; - var annotation = gutter.$annotations[row]; - if (!annotation) - return hideTooltip(); - var maxRow = editor.session.getLength(); if (row == maxRow) { var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row; @@ -21263,54 +21158,49 @@ function GutterHandler(mouseHandler) { if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column)) return hideTooltip(); } - - if (tooltipAnnotation == annotation) + tooltip.showTooltip(row); + if (!tooltip.isOpen) return; - tooltipAnnotation = annotation.text.join("
"); - - tooltip.setHtml(tooltipAnnotation); - tooltip.show(); - editor._signal("showGutterTooltip", tooltip); editor.on("mousewheel", hideTooltip); - if (mouseHandler.$tooltipFollowsMouse) { moveTooltip(mouseEvent); - } else { - var gutterElement = mouseEvent.domEvent.target; - var rect = gutterElement.getBoundingClientRect(); - var style = tooltip.getElement().style; - style.left = rect.right + "px"; - style.top = rect.bottom + "px"; + } + else { + var gutterRow = mouseEvent.getGutterRow(); + var gutterCell = gutter.$lines.get(gutterRow); + if (gutterCell) { + var gutterElement = gutterCell.element.querySelector(".ace_gutter_annotation"); + var rect = gutterElement.getBoundingClientRect(); + var style = tooltip.getElement().style; + style.left = rect.right + "px"; + style.top = rect.bottom + "px"; + } + else { + moveTooltip(mouseEvent); + } } } - function hideTooltip() { if (tooltipTimeout) tooltipTimeout = clearTimeout(tooltipTimeout); - if (tooltipAnnotation) { - tooltip.hide(); - tooltipAnnotation = null; - editor._signal("hideGutterTooltip", tooltip); + if (tooltip.isOpen) { + tooltip.hideTooltip(); editor.off("mousewheel", hideTooltip); } } - function moveTooltip(e) { tooltip.setPosition(e.x, e.y); } - - mouseHandler.editor.setDefaultHandler("guttermousemove", function(e) { + mouseHandler.editor.setDefaultHandler("guttermousemove", function (e) { var target = e.domEvent.target || e.domEvent.srcElement; if (dom.hasCssClass(target, "ace_fold-widget")) return hideTooltip(); - - if (tooltipAnnotation && mouseHandler.$tooltipFollowsMouse) + if (tooltip.isOpen && mouseHandler.$tooltipFollowsMouse) moveTooltip(e); - mouseEvent = e; if (tooltipTimeout) return; - tooltipTimeout = setTimeout(function() { + tooltipTimeout = setTimeout(function () { tooltipTimeout = null; if (mouseEvent && !mouseHandler.isMousePressed) showTooltip(); @@ -21318,29 +21208,27 @@ function GutterHandler(mouseHandler) { hideTooltip(); }, 50); }); - - event.addListener(editor.renderer.$gutter, "mouseout", function(e) { + event.addListener(editor.renderer.$gutter, "mouseout", function (e) { mouseEvent = null; - if (!tooltipAnnotation || tooltipTimeout) + if (!tooltip.isOpen || tooltipTimeout) return; - - tooltipTimeout = setTimeout(function() { + tooltipTimeout = setTimeout(function () { tooltipTimeout = null; hideTooltip(); }, 50); }, editor); - editor.on("changeSession", hideTooltip); + editor.on("input", hideTooltip); } - -function GutterTooltip(parentNode) { - Tooltip.call(this, parentNode); -} - -oop.inherits(GutterTooltip, Tooltip); - -(function(){ - this.setPosition = function(x, y) { +exports.GutterHandler = GutterHandler; +var GutterTooltip = /** @class */ (function (_super) { + __extends(GutterTooltip, _super); + function GutterTooltip(editor) { + var _this = _super.call(this, editor.container) || this; + _this.editor = editor; + return _this; + } + GutterTooltip.prototype.setPosition = function (x, y) { var windowWidth = window.innerWidth || document.documentElement.clientWidth; var windowHeight = window.innerHeight || document.documentElement.clientHeight; var width = this.getWidth(); @@ -21355,64 +21243,175 @@ oop.inherits(GutterTooltip, Tooltip); } Tooltip.prototype.setPosition.call(this, x, y); }; - -}).call(GutterTooltip.prototype); - - - -exports.GutterHandler = GutterHandler; - -}); - -ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"], function(require, exports, module) { -"use strict"; - -var event = require("../lib/event"); -var useragent = require("../lib/useragent"); -var MouseEvent = exports.MouseEvent = function(domEvent, editor) { - this.domEvent = domEvent; - this.editor = editor; - - this.x = this.clientX = domEvent.clientX; - this.y = this.clientY = domEvent.clientY; - - this.$pos = null; - this.$inSelection = null; - - this.propagationStopped = false; - this.defaultPrevented = false; -}; - -(function() { - - this.stopPropagation = function() { + Object.defineProperty(GutterTooltip, "annotationLabels", { + get: function () { + return { + error: { + singular: nls("gutter-tooltip.aria-label.error.singular", "error"), + plural: nls("gutter-tooltip.aria-label.error.plural", "errors") + }, + security: { + singular: nls("gutter-tooltip.aria-label.security.singular", "security finding"), + plural: nls("gutter-tooltip.aria-label.security.plural", "security findings") + }, + warning: { + singular: nls("gutter-tooltip.aria-label.warning.singular", "warning"), + plural: nls("gutter-tooltip.aria-label.warning.plural", "warnings") + }, + info: { + singular: nls("gutter-tooltip.aria-label.info.singular", "information message"), + plural: nls("gutter-tooltip.aria-label.info.plural", "information messages") + }, + hint: { + singular: nls("gutter-tooltip.aria-label.hint.singular", "suggestion"), + plural: nls("gutter-tooltip.aria-label.hint.plural", "suggestions") + } + }; + }, + enumerable: false, + configurable: true + }); + GutterTooltip.prototype.showTooltip = function (row) { + var _a; + var gutter = this.editor.renderer.$gutterLayer; + var annotationsInRow = gutter.$annotations[row]; + var annotation; + if (annotationsInRow) + annotation = { + displayText: Array.from(annotationsInRow.displayText), + type: Array.from(annotationsInRow.type) + }; + else + annotation = { displayText: [], type: [] }; + var fold = gutter.session.getFoldLine(row); + if (fold && gutter.$showFoldedAnnotations) { + var annotationsInFold = { error: [], security: [], warning: [], info: [], hint: [] }; + var severityRank = { error: 1, security: 2, warning: 3, info: 4, hint: 5 }; + var mostSevereAnnotationTypeInFold; + for (var i = row + 1; i <= fold.end.row; i++) { + if (!gutter.$annotations[i]) + continue; + for (var j = 0; j < gutter.$annotations[i].text.length; j++) { + var annotationType = gutter.$annotations[i].type[j]; + annotationsInFold[annotationType].push(gutter.$annotations[i].text[j]); + if (!mostSevereAnnotationTypeInFold || + severityRank[annotationType] < severityRank[mostSevereAnnotationTypeInFold]) { + mostSevereAnnotationTypeInFold = annotationType; + } + } + } + if (["error", "security", "warning"].includes(mostSevereAnnotationTypeInFold)) { + var summaryFoldedAnnotations = "".concat(GutterTooltip.annotationsToSummaryString(annotationsInFold), " in folded code."); + annotation.displayText.push(summaryFoldedAnnotations); + annotation.type.push(mostSevereAnnotationTypeInFold + "_fold"); + } + } + if (annotation.displayText.length === 0) + return this.hide(); + var annotationMessages = { error: [], security: [], warning: [], info: [], hint: [] }; + var iconClassName = gutter.$useSvgGutterIcons ? "ace_icon_svg" : "ace_icon"; + for (var i = 0; i < annotation.displayText.length; i++) { + var lineElement = dom.createElement("span"); + var iconElement = dom.createElement("span"); + (_a = iconElement.classList).add.apply(_a, ["ace_".concat(annotation.type[i]), iconClassName]); + iconElement.setAttribute("aria-label", "".concat(GutterTooltip.annotationLabels[annotation.type[i].replace("_fold", "")].singular)); + iconElement.setAttribute("role", "img"); + iconElement.appendChild(dom.createTextNode(" ")); + lineElement.appendChild(iconElement); + lineElement.appendChild(dom.createTextNode(annotation.displayText[i])); + lineElement.appendChild(dom.createElement("br")); + annotationMessages[annotation.type[i].replace("_fold", "")].push(lineElement); + } + var tooltipElement = this.getElement(); + dom.removeChildren(tooltipElement); + annotationMessages.error.forEach(function (el) { return tooltipElement.appendChild(el); }); + annotationMessages.security.forEach(function (el) { return tooltipElement.appendChild(el); }); + annotationMessages.warning.forEach(function (el) { return tooltipElement.appendChild(el); }); + annotationMessages.info.forEach(function (el) { return tooltipElement.appendChild(el); }); + annotationMessages.hint.forEach(function (el) { return tooltipElement.appendChild(el); }); + tooltipElement.setAttribute("aria-live", "polite"); + if (!this.isOpen) { + this.setTheme(this.editor.renderer.theme); + this.setClassName("ace_gutter-tooltip"); + } + this.show(); + this.editor._signal("showGutterTooltip", this); + }; + GutterTooltip.prototype.hideTooltip = function () { + this.$element.removeAttribute("aria-live"); + this.hide(); + this.editor._signal("hideGutterTooltip", this); + }; + GutterTooltip.annotationsToSummaryString = function (annotations) { + var e_1, _a; + var summary = []; + var annotationTypes = ["error", "security", "warning", "info", "hint"]; + try { + for (var annotationTypes_1 = __values(annotationTypes), annotationTypes_1_1 = annotationTypes_1.next(); !annotationTypes_1_1.done; annotationTypes_1_1 = annotationTypes_1.next()) { + var annotationType = annotationTypes_1_1.value; + if (!annotations[annotationType].length) + continue; + var label = annotations[annotationType].length === 1 ? GutterTooltip.annotationLabels[annotationType].singular : GutterTooltip.annotationLabels[annotationType].plural; + summary.push("".concat(annotations[annotationType].length, " ").concat(label)); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (annotationTypes_1_1 && !annotationTypes_1_1.done && (_a = annotationTypes_1.return)) _a.call(annotationTypes_1); + } + finally { if (e_1) throw e_1.error; } + } + return summary.join(", "); + }; + return GutterTooltip; +}(Tooltip)); +exports.GutterTooltip = GutterTooltip; + +}); + +ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"], function(require, exports, module){"use strict"; +var event = require("../lib/event"); +var useragent = require("../lib/useragent"); +var MouseEvent = /** @class */ (function () { + function MouseEvent(domEvent, editor) { this.speed; this.wheelX; this.wheelY; + this.domEvent = domEvent; + this.editor = editor; + this.x = this.clientX = domEvent.clientX; + this.y = this.clientY = domEvent.clientY; + this.$pos = null; + this.$inSelection = null; + this.propagationStopped = false; + this.defaultPrevented = false; + } + MouseEvent.prototype.stopPropagation = function () { event.stopPropagation(this.domEvent); this.propagationStopped = true; }; - - this.preventDefault = function() { + MouseEvent.prototype.preventDefault = function () { event.preventDefault(this.domEvent); this.defaultPrevented = true; }; - - this.stop = function() { + MouseEvent.prototype.stop = function () { this.stopPropagation(); this.preventDefault(); }; - this.getDocumentPosition = function() { + MouseEvent.prototype.getDocumentPosition = function () { if (this.$pos) return this.$pos; - this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY); return this.$pos; }; - this.inSelection = function() { + MouseEvent.prototype.getGutterRow = function () { + var documentRow = this.getDocumentPosition().row; + var screenRow = this.editor.session.documentToScreenRow(documentRow, 0); + var screenTopRow = this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row, 0); + return screenRow - screenTopRow; + }; + MouseEvent.prototype.inSelection = function () { if (this.$inSelection !== null) return this.$inSelection; - var editor = this.editor; - - var selectionRange = editor.getSelectionRange(); if (selectionRange.isEmpty()) this.$inSelection = false; @@ -21420,52 +21419,40 @@ var MouseEvent = exports.MouseEvent = function(domEvent, editor) { var pos = this.getDocumentPosition(); this.$inSelection = selectionRange.contains(pos.row, pos.column); } - return this.$inSelection; }; - this.getButton = function() { + MouseEvent.prototype.getButton = function () { return event.getButton(this.domEvent); }; - this.getShiftKey = function() { + MouseEvent.prototype.getShiftKey = function () { return this.domEvent.shiftKey; }; - - this.getAccelKey = useragent.isMac - ? function() { return this.domEvent.metaKey; } - : function() { return this.domEvent.ctrlKey; }; - -}).call(MouseEvent.prototype); + MouseEvent.prototype.getAccelKey = function () { + return useragent.isMac ? this.domEvent.metaKey : this.domEvent.ctrlKey; + }; + return MouseEvent; +}()); +exports.MouseEvent = MouseEvent; }); -ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"], function(require, exports, module) { -"use strict"; - +ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"], function(require, exports, module){"use strict"; var dom = require("../lib/dom"); var event = require("../lib/event"); var useragent = require("../lib/useragent"); - var AUTOSCROLL_DELAY = 200; var SCROLL_CURSOR_DELAY = 200; var SCROLL_CURSOR_HYSTERESIS = 5; - function DragdropHandler(mouseHandler) { - var editor = mouseHandler.editor; - - var blankImage = dom.createElement("img"); - blankImage.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (useragent.isOpera) - blankImage.style.cssText = "width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"; - + var dragImage = dom.createElement("div"); + dragImage.style.cssText = "top:-100px;position:absolute;z-index:2147483647;opacity:0.5"; + dragImage.textContent = "\xa0"; var exports = ["dragWait", "dragWaitEnd", "startDrag", "dragReadyEnd", "onMouseDrag"]; - - exports.forEach(function(x) { - mouseHandler[x] = this[x]; + exports.forEach(function (x) { + mouseHandler[x] = this[x]; }, this); editor.on("mousedown", this.onMouseDown.bind(mouseHandler)); - - var mouseTarget = editor.container; var dragSelectionMarker, x, y; var timerId, range; @@ -21475,36 +21462,29 @@ function DragdropHandler(mouseHandler) { var autoScrollStartTime; var cursorMovedTime; var cursorPointOnCaretMoved; - - this.onDragStart = function(e) { + this.onDragStart = function (e) { if (this.cancelDrag || !mouseTarget.draggable) { var self = this; - setTimeout(function(){ + setTimeout(function () { self.startSelect(); self.captureMouse(e); }, 0); return e.preventDefault(); } range = editor.getSelectionRange(); - var dataTransfer = e.dataTransfer; dataTransfer.effectAllowed = editor.getReadOnly() ? "copy" : "copyMove"; - if (useragent.isOpera) { - editor.container.appendChild(blankImage); - blankImage.scrollTop = 0; - } - dataTransfer.setDragImage && dataTransfer.setDragImage(blankImage, 0, 0); - if (useragent.isOpera) { - editor.container.removeChild(blankImage); - } + editor.container.appendChild(dragImage); + dataTransfer.setDragImage && dataTransfer.setDragImage(dragImage, 0, 0); + setTimeout(function () { + editor.container.removeChild(dragImage); + }); dataTransfer.clearData(); dataTransfer.setData("Text", editor.session.getTextRange()); - isInternal = true; this.setState("drag"); }; - - this.onDragEnd = function(e) { + this.onDragEnd = function (e) { mouseTarget.draggable = false; isInternal = false; this.setState(null); @@ -21517,8 +21497,7 @@ function DragdropHandler(mouseHandler) { this.editor.unsetStyle("ace_dragging"); this.editor.renderer.setCursorStyle(""); }; - - this.onDragEnter = function(e) { + this.onDragEnter = function (e) { if (editor.getReadOnly() || !canAccept(e.dataTransfer)) return; x = e.clientX; @@ -21529,8 +21508,7 @@ function DragdropHandler(mouseHandler) { e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); return event.preventDefault(e); }; - - this.onDragOver = function(e) { + this.onDragOver = function (e) { if (editor.getReadOnly() || !canAccept(e.dataTransfer)) return; x = e.clientX; @@ -21541,12 +21519,10 @@ function DragdropHandler(mouseHandler) { } if (onMouseMoveTimer !== null) onMouseMoveTimer = null; - e.dataTransfer.dropEffect = dragOperation = getDropEffect(e); return event.preventDefault(e); }; - - this.onDragLeave = function(e) { + this.onDragLeave = function (e) { counter--; if (counter <= 0 && dragSelectionMarker) { clearDragMarker(); @@ -21554,8 +21530,7 @@ function DragdropHandler(mouseHandler) { return event.preventDefault(e); } }; - - this.onDrop = function(e) { + this.onDrop = function (e) { if (!dragCursor) return; var dataTransfer = e.dataTransfer; @@ -21567,7 +21542,8 @@ function DragdropHandler(mouseHandler) { start: dragCursor, end: dragCursor }; - } else { + } + else { range = editor.moveText(range, dragCursor); } break; @@ -21575,7 +21551,8 @@ function DragdropHandler(mouseHandler) { range = editor.moveText(range, dragCursor, true); break; } - } else { + } + else { var dropData = dataTransfer.getData('Text'); range = { start: dragCursor, @@ -21587,14 +21564,12 @@ function DragdropHandler(mouseHandler) { clearDragMarker(); return event.preventDefault(e); }; - event.addListener(mouseTarget, "dragstart", this.onDragStart.bind(mouseHandler), editor); event.addListener(mouseTarget, "dragend", this.onDragEnd.bind(mouseHandler), editor); event.addListener(mouseTarget, "dragenter", this.onDragEnter.bind(mouseHandler), editor); event.addListener(mouseTarget, "dragover", this.onDragOver.bind(mouseHandler), editor); event.addListener(mouseTarget, "dragleave", this.onDragLeave.bind(mouseHandler), editor); event.addListener(mouseTarget, "drop", this.onDrop.bind(mouseHandler), editor); - function scrollCursorIntoView(cursor, prevCursor) { var now = Date.now(); var vMovement = !prevCursor || cursor.row != prevCursor.row; @@ -21602,36 +21577,37 @@ function DragdropHandler(mouseHandler) { if (!cursorMovedTime || vMovement || hMovement) { editor.moveCursorToPosition(cursor); cursorMovedTime = now; - cursorPointOnCaretMoved = {x: x, y: y}; - } else { + cursorPointOnCaretMoved = { x: x, y: y }; + } + else { var distance = calcDistance(cursorPointOnCaretMoved.x, cursorPointOnCaretMoved.y, x, y); if (distance > SCROLL_CURSOR_HYSTERESIS) { cursorMovedTime = null; - } else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) { + } + else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) { editor.renderer.scrollCursorIntoView(); cursorMovedTime = null; } } } - function autoScroll(cursor, prevCursor) { var now = Date.now(); var lineHeight = editor.renderer.layerConfig.lineHeight; var characterWidth = editor.renderer.layerConfig.characterWidth; var editorRect = editor.renderer.scroller.getBoundingClientRect(); var offsets = { - x: { - left: x - editorRect.left, - right: editorRect.right - x - }, - y: { - top: y - editorRect.top, - bottom: editorRect.bottom - y - } + x: { + left: x - editorRect.left, + right: editorRect.right - x + }, + y: { + top: y - editorRect.top, + bottom: editorRect.bottom - y + } }; var nearestXOffset = Math.min(offsets.x.left, offsets.x.right); var nearestYOffset = Math.min(offsets.y.top, offsets.y.bottom); - var scrollCursor = {row: cursor.row, column: cursor.column}; + var scrollCursor = { row: cursor.row, column: cursor.column }; if (nearestXOffset / characterWidth <= 2) { scrollCursor.column += (offsets.x.left < offsets.x.right ? -3 : +2); } @@ -21646,18 +21622,17 @@ function DragdropHandler(mouseHandler) { autoScrollStartTime = now; else if (now - autoScrollStartTime >= AUTOSCROLL_DELAY) editor.renderer.scrollCursorIntoView(scrollCursor); - } else { + } + else { autoScrollStartTime = null; } } - function onDragInterval() { var prevCursor = dragCursor; dragCursor = editor.renderer.screenToTextCoordinates(x, y); scrollCursorIntoView(dragCursor, prevCursor); autoScroll(dragCursor, prevCursor); } - function addDragMarker() { range = editor.selection.toOrientedRange(); dragSelectionMarker = editor.session.addMarker(range, "ace_selection", editor.getSelectionStyle()); @@ -21670,7 +21645,6 @@ function DragdropHandler(mouseHandler) { counter = 0; event.addListener(document, "mousemove", onMouseMove); } - function clearDragMarker() { clearInterval(timerId); editor.session.removeMarker(dragSelectionMarker); @@ -21688,65 +21662,56 @@ function DragdropHandler(mouseHandler) { var onMouseMoveTimer = null; function onMouseMove() { if (onMouseMoveTimer == null) { - onMouseMoveTimer = setTimeout(function() { + onMouseMoveTimer = setTimeout(function () { if (onMouseMoveTimer != null && dragSelectionMarker) clearDragMarker(); }, 20); } } - function canAccept(dataTransfer) { var types = dataTransfer.types; - return !types || Array.prototype.some.call(types, function(type) { + return !types || Array.prototype.some.call(types, function (type) { return type == 'text/plain' || type == 'Text'; }); } - function getDropEffect(e) { var copyAllowed = ['copy', 'copymove', 'all', 'uninitialized']; var moveAllowed = ['move', 'copymove', 'linkmove', 'all', 'uninitialized']; - var copyModifierState = useragent.isMac ? e.altKey : e.ctrlKey; var effectAllowed = "uninitialized"; try { effectAllowed = e.dataTransfer.effectAllowed.toLowerCase(); - } catch (e) {} + } + catch (e) { } var dropEffect = "none"; - if (copyModifierState && copyAllowed.indexOf(effectAllowed) >= 0) dropEffect = "copy"; else if (moveAllowed.indexOf(effectAllowed) >= 0) dropEffect = "move"; else if (copyAllowed.indexOf(effectAllowed) >= 0) dropEffect = "copy"; - return dropEffect; } } - -(function() { - - this.dragWait = function() { +(function () { + this.dragWait = function () { var interval = Date.now() - this.mousedownEvent.time; if (interval > this.editor.getDragDelay()) this.startDrag(); }; - - this.dragWaitEnd = function() { + this.dragWaitEnd = function () { var target = this.editor.container; target.draggable = false; this.startSelect(this.mousedownEvent.getDocumentPosition()); this.selectEnd(); }; - - this.dragReadyEnd = function(e) { + this.dragReadyEnd = function (e) { this.editor.$resetCursorStyle(); this.editor.unsetStyle("ace_dragging"); this.editor.renderer.setCursorStyle(""); this.dragWaitEnd(); }; - - this.startDrag = function(){ + this.startDrag = function () { this.cancelDrag = false; var editor = this.editor; var target = editor.container; @@ -21757,8 +21722,7 @@ function DragdropHandler(mouseHandler) { editor.renderer.setCursorStyle(cursorStyle); this.setState("dragReady"); }; - - this.onMouseDrag = function(e) { + this.onMouseDrag = function (e) { var target = this.editor.container; if (useragent.isIE && this.state == "dragReady") { var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y); @@ -21773,13 +21737,11 @@ function DragdropHandler(mouseHandler) { } } }; - - this.onMouseDown = function(e) { + this.onMouseDown = function (e) { if (!this.$dragEnabled) return; this.mousedownEvent = e; var editor = this.editor; - var inSelection = e.inSelection(); var button = e.getButton(); var clickCount = e.domEvent.detail || 1; @@ -21797,33 +21759,27 @@ function DragdropHandler(mouseHandler) { mouseTarget.draggable = true; } this.setState("dragWait"); - } else { + } + else { this.startDrag(); } this.captureMouse(e, this.onMouseDrag.bind(this)); e.defaultPrevented = true; } }; - }).call(DragdropHandler.prototype); - - function calcDistance(ax, ay, bx, by) { return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2)); } - exports.DragdropHandler = DragdropHandler; }); -ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"], function(require, exports, module) { -"use strict"; - +ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"], function(require, exports, module){"use strict"; var MouseEvent = require("./mouse_event").MouseEvent; var event = require("../lib/event"); var dom = require("../lib/dom"); - -exports.addTouchListeners = function(el, editor) { +exports.addTouchListeners = function (el, editor) { var mode = "scroll"; var startX; var startY; @@ -21838,29 +21794,27 @@ exports.addTouchListeners = function(el, editor) { var vY = 0; var pressed; var contextMenu; - function createContextMenu() { var clipboard = window.navigator && window.navigator.clipboard; var isOpen = false; - var updateMenu = function() { + var updateMenu = function () { var selected = editor.getCopyText(); var hasUndo = editor.session.getUndoManager().hasUndo(); - contextMenu.replaceChild( - dom.buildDom(isOpen ? ["span", - !selected && ["span", { class: "ace_mobile-button", action: "selectall" }, "Select All"], - selected && ["span", { class: "ace_mobile-button", action: "copy" }, "Copy"], - selected && ["span", { class: "ace_mobile-button", action: "cut" }, "Cut"], - clipboard && ["span", { class: "ace_mobile-button", action: "paste" }, "Paste"], - hasUndo && ["span", { class: "ace_mobile-button", action: "undo" }, "Undo"], - ["span", { class: "ace_mobile-button", action: "find" }, "Find"], - ["span", { class: "ace_mobile-button", action: "openCommandPallete" }, "Pallete"] - ] : ["span"]), - contextMenu.firstChild - ); + contextMenu.replaceChild(dom.buildDom(isOpen ? ["span", + !selected && canExecuteCommand("selectall") && ["span", { class: "ace_mobile-button", action: "selectall" }, "Select All"], + selected && canExecuteCommand("copy") && ["span", { class: "ace_mobile-button", action: "copy" }, "Copy"], + selected && canExecuteCommand("cut") && ["span", { class: "ace_mobile-button", action: "cut" }, "Cut"], + clipboard && canExecuteCommand("paste") && ["span", { class: "ace_mobile-button", action: "paste" }, "Paste"], + hasUndo && canExecuteCommand("undo") && ["span", { class: "ace_mobile-button", action: "undo" }, "Undo"], + canExecuteCommand("find") && ["span", { class: "ace_mobile-button", action: "find" }, "Find"], + canExecuteCommand("openCommandPalette") && ["span", { class: "ace_mobile-button", action: "openCommandPalette" }, "Palette"] + ] : ["span"]), contextMenu.firstChild); + }; + var canExecuteCommand = function (/** @type {string} */ cmd) { + return editor.commands.canExecute(cmd, editor); }; - var handleClick = function(e) { + var handleClick = function (e) { var action = e.target.getAttribute("action"); - if (action == "more" || !isOpen) { isOpen = !isOpen; return updateMenu(); @@ -21881,19 +21835,19 @@ exports.addTouchListeners = function(el, editor) { } contextMenu.firstChild.style.display = "none"; isOpen = false; - if (action != "openCommandPallete") + if (action != "openCommandPalette") editor.focus(); }; contextMenu = dom.buildDom(["div", { class: "ace_mobile-menu", - ontouchstart: function(e) { + ontouchstart: function (e) { mode = "menu"; e.stopPropagation(); e.preventDefault(); editor.textInput.focus(); }, - ontouchend: function(e) { + ontouchend: function (e) { e.stopPropagation(); e.preventDefault(); handleClick(e); @@ -21905,7 +21859,14 @@ exports.addTouchListeners = function(el, editor) { ], editor.container); } function showContextMenu() { - if (!contextMenu) createContextMenu(); + if (!editor.getOption("enableMobileMenu")) { + if (contextMenu) { + hideContextMenu(); + } + return; + } + if (!contextMenu) + createContextMenu(); var cursor = editor.selection.cursor; var pagePos = editor.renderer.textToScreenCoordinates(cursor.row, cursor.column); var leftOffset = editor.renderer.textToScreenCoordinates(0, 0).pageX; @@ -21915,7 +21876,8 @@ exports.addTouchListeners = function(el, editor) { if (pagePos.pageX - rect.left < rect.width - 70) { contextMenu.style.left = ""; contextMenu.style.right = "10px"; - } else { + } + else { contextMenu.style.right = ""; contextMenu.style.left = leftOffset + scrollLeft - rect.left + "px"; } @@ -21928,7 +21890,6 @@ exports.addTouchListeners = function(el, editor) { contextMenu.style.display = "none"; editor.off("input", hideContextMenu); } - function handleLongTap() { longTouchTimer = null; clearTimeout(longTouchTimer); @@ -21950,13 +21911,15 @@ exports.addTouchListeners = function(el, editor) { : editor.session.getBracketRange(pos); if (range && !range.isEmpty()) { editor.selection.setRange(range); - } else { + } + else { editor.selection.selectWord(); } mode = "wait"; } - event.addListener(el, "contextmenu", function(e) { - if (!pressed) return; + event.addListener(el, "contextmenu", function (e) { + if (!pressed) + return; var textarea = editor.textInput.getElement(); textarea.focus(); }, editor); @@ -21969,7 +21932,6 @@ exports.addTouchListeners = function(el, editor) { mode = "zoom"; return; } - pressed = editor.$mouseHandler.isMousePressed = true; var h = editor.renderer.layerConfig.lineHeight; var w = editor.renderer.layerConfig.lineHeight; @@ -21980,51 +21942,39 @@ exports.addTouchListeners = function(el, editor) { var y = touchObj.clientY; if (Math.abs(startX - x) + Math.abs(startY - y) > h) touchStartT = -1; - startX = e.clientX = x; startY = e.clientY = y; vX = vY = 0; - var ev = new MouseEvent(e, editor); pos = ev.getDocumentPosition(); - if (t - touchStartT < 500 && touches.length == 1 && !animationSteps) { clickCount++; e.preventDefault(); e.button = 0; switchToSelectionMode(); - } else { + } + else { clickCount = 0; var cursor = editor.selection.cursor; var anchor = editor.selection.isEmpty() ? cursor : editor.selection.anchor; - var cursorPos = editor.renderer.$cursorLayer.getPixelPosition(cursor, true); var anchorPos = editor.renderer.$cursorLayer.getPixelPosition(anchor, true); var rect = editor.renderer.scroller.getBoundingClientRect(); var offsetTop = editor.renderer.layerConfig.offset; var offsetLeft = editor.renderer.scrollLeft; - var weightedDistance = function(x, y) { + var weightedDistance = function (x, y) { x = x / w; y = y / h - 0.75; return x * x + y * y; }; - if (e.clientX < rect.left) { mode = "zoom"; return; } - - var diff1 = weightedDistance( - e.clientX - rect.left - cursorPos.left + offsetLeft, - e.clientY - rect.top - cursorPos.top + offsetTop - ); - var diff2 = weightedDistance( - e.clientX - rect.left - anchorPos.left + offsetLeft, - e.clientY - rect.top - anchorPos.top + offsetTop - ); + var diff1 = weightedDistance(e.clientX - rect.left - cursorPos.left + offsetLeft, e.clientY - rect.top - cursorPos.top + offsetTop); + var diff2 = weightedDistance(e.clientX - rect.left - anchorPos.left + offsetLeft, e.clientY - rect.top - anchorPos.top + offsetTop); if (diff1 < 3.5 && diff2 < 3.5) mode = diff1 > diff2 ? "cursor" : "anchor"; - if (diff2 < 3.5) mode = "anchor"; else if (diff1 < 3.5) @@ -22035,21 +21985,24 @@ exports.addTouchListeners = function(el, editor) { } touchStartT = t; }, editor); - event.addListener(el, "touchend", function (e) { pressed = editor.$mouseHandler.isMousePressed = false; - if (animationTimer) clearInterval(animationTimer); + if (animationTimer) + clearInterval(animationTimer); if (mode == "zoom") { mode = ""; animationSteps = 0; - } else if (longTouchTimer) { + } + else if (longTouchTimer) { editor.selection.moveToPosition(pos); animationSteps = 0; showContextMenu(); - } else if (mode == "scroll") { + } + else if (mode == "scroll") { animate(); hideContextMenu(); - } else { + } + else { showContextMenu(); } clearTimeout(longTouchTimer); @@ -22061,26 +22014,21 @@ exports.addTouchListeners = function(el, editor) { longTouchTimer = null; } var touches = e.touches; - if (touches.length > 1 || mode == "zoom") return; - + if (touches.length > 1 || mode == "zoom") + return; var touchObj = touches[0]; - var wheelX = startX - touchObj.clientX; var wheelY = startY - touchObj.clientY; - if (mode == "wait") { if (wheelX * wheelX + wheelY * wheelY > 4) mode = "cursor"; else return e.preventDefault(); } - startX = touchObj.clientX; startY = touchObj.clientY; - e.clientX = touchObj.clientX; e.clientY = touchObj.clientY; - var t = e.timeStamp; var dt = t - lastT; lastT = t; @@ -22089,8 +22037,10 @@ exports.addTouchListeners = function(el, editor) { mouseEvent.speed = 1; mouseEvent.wheelX = wheelX; mouseEvent.wheelY = wheelY; - if (10 * Math.abs(wheelX) < Math.abs(wheelY)) wheelX = 0; - if (10 * Math.abs(wheelY) < Math.abs(wheelX)) wheelY = 0; + if (10 * Math.abs(wheelX) < Math.abs(wheelY)) + wheelX = 0; + if (10 * Math.abs(wheelY) < Math.abs(wheelX)) + wheelY = 0; if (dt != 0) { vX = wheelX / dt; vY = wheelY / dt; @@ -22111,18 +22061,21 @@ exports.addTouchListeners = function(el, editor) { e.preventDefault(); } }, editor); - function animate() { animationSteps += 60; - animationTimer = setInterval(function() { + animationTimer = setInterval(function () { if (animationSteps-- <= 0) { clearInterval(animationTimer); animationTimer = null; } - if (Math.abs(vX) < 0.01) vX = 0; - if (Math.abs(vY) < 0.01) vY = 0; - if (animationSteps < 20) vX = 0.9 * vX; - if (animationSteps < 20) vY = 0.9 * vY; + if (Math.abs(vX) < 0.01) + vX = 0; + if (Math.abs(vY) < 0.01) + vY = 0; + if (animationSteps < 20) + vX = 0.9 * vX; + if (animationSteps < 20) + vY = 0.9 * vY; var oldScrollTop = editor.session.getScrollTop(); editor.renderer.scrollBy(10 * vX, 10 * vY); if (oldScrollTop == editor.session.getScrollTop()) @@ -22133,1235 +22086,679 @@ exports.addTouchListeners = function(el, editor) { }); -ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"], function(require, exports, module) { -"use strict"; -var dom = require("./dom"); - -exports.get = function (url, callback) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - callback(xhr.responseText); +ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"], function(require, exports, module){"use strict"; +var event = require("../lib/event"); +var useragent = require("../lib/useragent"); +var DefaultHandlers = require("./default_handlers").DefaultHandlers; +var DefaultGutterHandler = require("./default_gutter_handler").GutterHandler; +var MouseEvent = require("./mouse_event").MouseEvent; +var DragdropHandler = require("./dragdrop_handler").DragdropHandler; +var addTouchListeners = require("./touch_handler").addTouchListeners; +var config = require("../config"); +var MouseHandler = /** @class */ (function () { + function MouseHandler(editor) { this.$dragDelay; this.$dragEnabled; this.$mouseMoved; this.mouseEvent; this.$focusTimeout; + var _self = this; + this.editor = editor; + new DefaultHandlers(this); + new DefaultGutterHandler(this); + new DragdropHandler(this); + var focusEditor = function (e) { + var windowBlurred = !document.hasFocus || !document.hasFocus() + || !editor.isFocused() && document.activeElement == (editor.textInput && editor.textInput.getElement()); + if (windowBlurred) + window.focus(); + editor.focus(); + setTimeout(function () { + if (!editor.isFocused()) + editor.focus(); + }); + }; + var mouseTarget = editor.renderer.getMouseEventTarget(); + event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click"), editor); + event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove"), editor); + event.addMultiMouseDownListener([ + mouseTarget, + editor.renderer.scrollBarV && editor.renderer.scrollBarV.inner, + editor.renderer.scrollBarH && editor.renderer.scrollBarH.inner, + editor.textInput && editor.textInput.getElement() + ].filter(Boolean), [400, 300, 250], this, "onMouseEvent", editor); + event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, "mousewheel"), editor); + addTouchListeners(editor.container, editor); + var gutterEl = editor.renderer.$gutter; + event.addListener(gutterEl, "mousedown", this.onMouseEvent.bind(this, "guttermousedown"), editor); + event.addListener(gutterEl, "click", this.onMouseEvent.bind(this, "gutterclick"), editor); + event.addListener(gutterEl, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick"), editor); + event.addListener(gutterEl, "mousemove", this.onMouseEvent.bind(this, "guttermousemove"), editor); + event.addListener(mouseTarget, "mousedown", focusEditor, editor); + event.addListener(gutterEl, "mousedown", focusEditor, editor); + if (useragent.isIE && editor.renderer.scrollBarV) { + event.addListener(editor.renderer.scrollBarV.element, "mousedown", focusEditor, editor); + event.addListener(editor.renderer.scrollBarH.element, "mousedown", focusEditor, editor); + } + editor.on("mousemove", function (e) { + if (_self.state || _self.$dragDelay || !_self.$dragEnabled) + return; + var character = editor.renderer.screenToTextCoordinates(e.x, e.y); + var range = editor.session.selection.getRange(); + var renderer = editor.renderer; + if (!range.isEmpty() && range.insideStart(character.row, character.column)) { + renderer.setCursorStyle("default"); + } + else { + renderer.setCursorStyle(""); + } + }, //@ts-expect-error TODO: seems mistyping - should be boolean + editor); + } + MouseHandler.prototype.onMouseEvent = function (name, e) { + if (!this.editor.session) + return; + this.editor._emit(name, new MouseEvent(e, this.editor)); + }; + MouseHandler.prototype.onMouseMove = function (name, e) { + var listeners = this.editor._eventRegistry && this.editor._eventRegistry.mousemove; + if (!listeners || !listeners.length) + return; + this.editor._emit(name, new MouseEvent(e, this.editor)); + }; + MouseHandler.prototype.onMouseWheel = function (name, e) { + var mouseEvent = new MouseEvent(e, this.editor); + mouseEvent.speed = this.$scrollSpeed * 2; + mouseEvent.wheelX = e.wheelX; + mouseEvent.wheelY = e.wheelY; + this.editor._emit(name, mouseEvent); + }; + MouseHandler.prototype.setState = function (state) { + this.state = state; + }; + MouseHandler.prototype.captureMouse = function (ev, mouseMoveHandler) { + this.x = ev.x; + this.y = ev.y; + this.isMousePressed = true; + var editor = this.editor; + var renderer = this.editor.renderer; + renderer.$isMousePressed = true; + var self = this; + var onMouseMove = function (e) { + if (!e) + return; + if (useragent.isWebKit && !e.which && self.releaseMouse) + return self.releaseMouse(); + self.x = e.clientX; + self.y = e.clientY; + mouseMoveHandler && mouseMoveHandler(e); + self.mouseEvent = new MouseEvent(e, self.editor); + self.$mouseMoved = true; + }; + var onCaptureEnd = function (e) { + editor.off("beforeEndOperation", onOperationEnd); + clearInterval(timerId); + if (editor.session) + onCaptureInterval(); + self[self.state + "End"] && self[self.state + "End"](e); + self.state = ""; + self.isMousePressed = renderer.$isMousePressed = false; + if (renderer.$keepTextAreaAtCursor) + renderer.$moveTextAreaToCursor(); + self.$onCaptureMouseMove = self.releaseMouse = null; + e && self.onMouseEvent("mouseup", e); + editor.endOperation(); + }; + var onCaptureInterval = function () { + self[self.state] && self[self.state](); + self.$mouseMoved = false; + }; + if (useragent.isOldIE && ev.domEvent.type == "dblclick") { + return setTimeout(function () { onCaptureEnd(ev); }); } + var onOperationEnd = function (e) { + if (!self.releaseMouse) + return; + if (editor.curOp.command.name && editor.curOp.selectionChanged) { + self[self.state + "End"] && self[self.state + "End"](); + self.state = ""; + self.releaseMouse(); + } + }; + editor.on("beforeEndOperation", onOperationEnd); + editor.startOperation({ command: { name: "mouse" } }); + self.$onCaptureMouseMove = onMouseMove; + self.releaseMouse = event.capture(this.editor.container, onMouseMove, onCaptureEnd); + var timerId = setInterval(onCaptureInterval, 20); }; - xhr.send(null); -}; + MouseHandler.prototype.cancelContextMenu = function () { + var stop = function (e) { + if (e && e.domEvent && e.domEvent.type != "contextmenu") + return; + this.editor.off("nativecontextmenu", stop); + if (e && e.domEvent) + event.stopEvent(e.domEvent); + }.bind(this); + setTimeout(stop, 10); + this.editor.on("nativecontextmenu", stop); + }; + MouseHandler.prototype.destroy = function () { + if (this.releaseMouse) + this.releaseMouse(); + }; + return MouseHandler; +}()); +MouseHandler.prototype.releaseMouse = null; +config.defineOptions(MouseHandler.prototype, "mouseHandler", { + scrollSpeed: { initialValue: 2 }, + dragDelay: { initialValue: (useragent.isMac ? 150 : 0) }, + dragEnabled: { initialValue: true }, + focusTimeout: { initialValue: 0 }, + tooltipFollowsMouse: { initialValue: true } +}); +exports.MouseHandler = MouseHandler; -exports.loadScript = function(path, callback) { - var head = dom.getDocumentHead(); - var s = document.createElement('script'); +}); - s.src = path; - head.appendChild(s); +ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"], function(require, exports, module){"use strict"; +var dom = require("../lib/dom"); +var FoldHandler = /** @class */ (function () { + function FoldHandler(editor) { + editor.on("click", function (e) { + var position = e.getDocumentPosition(); + var session = editor.session; + var fold = session.getFoldAt(position.row, position.column, 1); + if (fold) { + if (e.getAccelKey()) + session.removeFold(fold); + else + session.expandFold(fold); + e.stop(); + } + var target = e.domEvent && e.domEvent.target; + if (target && dom.hasCssClass(target, "ace_inline_button")) { + if (dom.hasCssClass(target, "ace_toggle_wrap")) { + session.setOption("wrap", !session.getUseWrapMode()); + editor.renderer.scrollCursorIntoView(); + } + } + }); + editor.on("gutterclick", function (e) { + var gutterRegion = editor.renderer.$gutterLayer.getRegion(e); + if (gutterRegion == "foldWidgets") { + var row = e.getDocumentPosition().row; + var session = editor.session; + if (session.foldWidgets && session.foldWidgets[row]) + editor.session.onFoldWidgetClick(row, e); + if (!editor.isFocused()) + editor.focus(); + e.stop(); + } + }); + editor.on("gutterdblclick", function (e) { + var gutterRegion = editor.renderer.$gutterLayer.getRegion(e); + if (gutterRegion == "foldWidgets") { + var row = e.getDocumentPosition().row; + var session = editor.session; + var data = session.getParentFoldRangeData(row, true); + var range = data.range || data.firstRange; + if (range) { + row = range.start.row; + var fold = session.getFoldAt(row, session.getLine(row).length, 1); + if (fold) { + session.removeFold(fold); + } + else { + session.addFold("...", range); + editor.renderer.scrollCursorIntoView({ row: range.start.row, column: 0 }); + } + } + e.stop(); + } + }); + } + return FoldHandler; +}()); +exports.FoldHandler = FoldHandler; - s.onload = s.onreadystatechange = function(_, isAbort) { - if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") { - s = s.onload = s.onreadystatechange = null; - if (!isAbort) - callback(); +}); + +ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"], function(require, exports, module){"use strict"; +var keyUtil = require("../lib/keys"); +var event = require("../lib/event"); +var KeyBinding = /** @class */ (function () { + function KeyBinding(editor) { + this.$editor = editor; + this.$data = { editor: editor }; + this.$handlers = []; + this.setDefaultHandler(editor.commands); + } + KeyBinding.prototype.setDefaultHandler = function (kb) { + this.removeKeyboardHandler(this.$defaultHandler); + this.$defaultHandler = kb; + this.addKeyboardHandler(kb, 0); + }; + KeyBinding.prototype.setKeyboardHandler = function (kb) { + var h = this.$handlers; + if (h[h.length - 1] == kb) + return; + while (h[h.length - 1] && h[h.length - 1] != this.$defaultHandler) + this.removeKeyboardHandler(h[h.length - 1]); + this.addKeyboardHandler(kb, 1); + }; + KeyBinding.prototype.addKeyboardHandler = function (kb, pos) { + if (!kb) + return; + if (typeof kb == "function" && !kb.handleKeyboard) + kb.handleKeyboard = kb; + var i = this.$handlers.indexOf(kb); + if (i != -1) + this.$handlers.splice(i, 1); + if (pos == undefined) + this.$handlers.push(kb); + else + this.$handlers.splice(pos, 0, kb); + if (i == -1 && kb.attach) + kb.attach(this.$editor); + }; + KeyBinding.prototype.removeKeyboardHandler = function (kb) { + var i = this.$handlers.indexOf(kb); + if (i == -1) + return false; + this.$handlers.splice(i, 1); + kb.detach && kb.detach(this.$editor); + return true; + }; + KeyBinding.prototype.getKeyboardHandler = function () { + return this.$handlers[this.$handlers.length - 1]; + }; + KeyBinding.prototype.getStatusText = function () { + var data = this.$data; + var editor = data.editor; + return this.$handlers.map(function (h) { + return h.getStatusText && h.getStatusText(editor, data) || ""; + }).filter(Boolean).join(" "); + }; + KeyBinding.prototype.$callKeyboardHandlers = function (hashId, keyString, keyCode, e) { + var toExecute; + var success = false; + var commands = this.$editor.commands; + for (var i = this.$handlers.length; i--;) { + toExecute = this.$handlers[i].handleKeyboard( + this.$data, hashId, keyString, keyCode, e); + if (!toExecute || !toExecute.command) + continue; + if (toExecute.command == "null") { + success = true; + } + else { + success = commands.exec(toExecute.command, this.$editor, toExecute.args, e); + } + if (success && e && hashId != -1 && + toExecute["passEvent"] != true && toExecute.command["passEvent"] != true) { + event.stopEvent(e); + } + if (success) + break; + } + if (!success && hashId == -1) { + toExecute = { command: "insertstring" }; + success = commands.exec("insertstring", this.$editor, keyString); } + if (success && this.$editor._signal) + this.$editor._signal("keyboardActivity", toExecute); + return success; }; -}; -exports.qualifyURL = function(url) { - var a = document.createElement('a'); - a.href = url; - return a.href; -}; + KeyBinding.prototype.onCommandKey = function (e, hashId, keyCode) { + var keyString = keyUtil.keyCodeToString(keyCode); + return this.$callKeyboardHandlers(hashId, keyString, keyCode, e); + }; + KeyBinding.prototype.onTextInput = function (text) { + return this.$callKeyboardHandlers(-1, text); + }; + return KeyBinding; +}()); +exports.KeyBinding = KeyBinding; }); -ace.define("ace/lib/event_emitter",["require","exports","module"], function(require, exports, module) { -"use strict"; - -var EventEmitter = {}; -var stopPropagation = function() { this.propagationStopped = true; }; -var preventDefault = function() { this.defaultPrevented = true; }; - -EventEmitter._emit = -EventEmitter._dispatchEvent = function(eventName, e) { - this._eventRegistry || (this._eventRegistry = {}); - this._defaultHandlers || (this._defaultHandlers = {}); - - var listeners = this._eventRegistry[eventName] || []; - var defaultHandler = this._defaultHandlers[eventName]; - if (!listeners.length && !defaultHandler) +ace.define("ace/lib/bidiutil",["require","exports","module"], function(require, exports, module){"use strict"; +var ArabicAlefBetIntervalsBegine = ['\u0621', '\u0641']; +var ArabicAlefBetIntervalsEnd = ['\u063A', '\u064a']; +var dir = 0, hiLevel = 0; +var lastArabic = false, hasUBAT_AL = false, hasUBAT_B = false, hasUBAT_S = false, hasBlockSep = false, hasSegSep = false; +var impTab_LTR = [ [0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 0x11, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 0x15, 0x15, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0] +]; +var impTab_RTL = [ [2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 0x21, 3, 1, 1] +]; +var LTR = 0, RTL = 1; +var L = 0; +var R = 1; +var EN = 2; +var AN = 3; +var ON = 4; +var B = 5; +var S = 6; +var AL = 7; +var WS = 8; +var CS = 9; +var ES = 10; +var ET = 11; +var NSM = 12; +var LRE = 13; +var RLE = 14; +var PDF = 15; +var LRO = 16; +var RLO = 17; +var BN = 18; +var UnicodeTBL00 = [ + BN, BN, BN, BN, BN, BN, BN, BN, BN, S, B, S, WS, B, BN, BN, + BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, B, B, B, S, + WS, ON, ON, ET, ET, ET, ON, ON, ON, ON, ON, ES, CS, ES, CS, CS, + EN, EN, EN, EN, EN, EN, EN, EN, EN, EN, CS, ON, ON, ON, ON, ON, + ON, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, + L, L, L, L, L, L, L, L, L, L, L, ON, ON, ON, ON, ON, + ON, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, + L, L, L, L, L, L, L, L, L, L, L, ON, ON, ON, ON, BN, + BN, BN, BN, BN, BN, B, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, + BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, BN, + CS, ON, ET, ET, ET, ET, ON, ON, ON, ON, L, ON, ON, BN, ON, ON, + ET, ET, EN, EN, ON, L, ON, ON, ON, EN, L, ON, ON, ON, ON, ON +]; +var UnicodeTBL20 = [ + WS, WS, WS, WS, WS, WS, WS, WS, WS, WS, WS, BN, BN, BN, L, R, + ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, + ON, ON, ON, ON, ON, ON, ON, ON, WS, B, LRE, RLE, PDF, LRO, RLO, CS, + ET, ET, ET, ET, ET, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, + ON, ON, ON, ON, CS, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, + ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, ON, WS +]; +function _computeLevels(chars, levels, len, charTypes) { + var impTab = dir ? impTab_RTL : impTab_LTR, prevState = null, newClass = null, newLevel = null, newState = 0, action = null, cond = null, condPos = -1, i = null, ix = null, classes = []; + if (!charTypes) { + for (i = 0, charTypes = []; i < len; i++) { + charTypes[i] = _getCharacterType(chars[i]); + } + } + hiLevel = dir; + lastArabic = false; + hasUBAT_AL = false; + hasUBAT_B = false; + hasUBAT_S = false; + for (ix = 0; ix < len; ix++) { + prevState = newState; + classes[ix] = newClass = _getCharClass(chars, charTypes, classes, ix); + newState = impTab[prevState][newClass]; + action = newState & 0xF0; + newState &= 0x0F; + levels[ix] = newLevel = impTab[newState][5]; + if (action > 0) { + if (action == 0x10) { + for (i = condPos; i < ix; i++) { + levels[i] = 1; + } + condPos = -1; + } + else { + condPos = -1; + } + } + cond = impTab[newState][6]; + if (cond) { + if (condPos == -1) { + condPos = ix; + } + } + else { + if (condPos > -1) { + for (i = condPos; i < ix; i++) { + levels[i] = newLevel; + } + condPos = -1; + } + } + if (charTypes[ix] == B) { + levels[ix] = 0; + } + hiLevel |= newLevel; + } + if (hasUBAT_S) { + for (i = 0; i < len; i++) { + if (charTypes[i] == S) { + levels[i] = dir; + for (var j = i - 1; j >= 0; j--) { + if (charTypes[j] == WS) { + levels[j] = dir; + } + else { + break; + } + } + } + } + } +} +function _invertLevel(lev, levels, _array) { + if (hiLevel < lev) { return; - - if (typeof e != "object" || !e) - e = {}; - - if (!e.type) - e.type = eventName; - if (!e.stopPropagation) - e.stopPropagation = stopPropagation; - if (!e.preventDefault) - e.preventDefault = preventDefault; - - listeners = listeners.slice(); - for (var i=0; i= lev) { + end = start + 1; + while (end < len && levels[end] >= lev) { + end++; + } + for (lo = start, hi = end - 1; lo < hi; lo++, hi--) { + tmp = _array[lo]; + _array[lo] = _array[hi]; + _array[hi] = tmp; + } + start = end; + } + start++; + } +} +function _getCharClass(chars, types, classes, ix) { + var cType = types[ix], wType, nType, len, i; + switch (cType) { + case L: + case R: + lastArabic = false; + case ON: + case AN: + return cType; + case EN: + return lastArabic ? AN : EN; + case AL: + lastArabic = true; + hasUBAT_AL = true; + return R; + case WS: + return ON; + case CS: + if (ix < 1 || (ix + 1) >= types.length || + ((wType = classes[ix - 1]) != EN && wType != AN) || + ((nType = types[ix + 1]) != EN && nType != AN)) { + return ON; + } + if (lastArabic) { + nType = AN; + } + return nType == wType ? nType : ON; + case ES: + wType = ix > 0 ? classes[ix - 1] : B; + if (wType == EN && (ix + 1) < types.length && types[ix + 1] == EN) { + return EN; + } + return ON; + case ET: + if (ix > 0 && classes[ix - 1] == EN) { + return EN; + } + if (lastArabic) { + return ON; + } + i = ix + 1; + len = types.length; + while (i < len && types[i] == ET) { + i++; + } + if (i < len && types[i] == EN) { + return EN; + } + return ON; + case NSM: + len = types.length; + i = ix + 1; + while (i < len && types[i] == NSM) { + i++; + } + if (i < len) { + var c = chars[ix], rtlCandidate = (c >= 0x0591 && c <= 0x08FF) || c == 0xFB1E; + wType = types[i]; + if (rtlCandidate && (wType == R || wType == AL)) { + return R; + } + } + if (ix < 1 || (wType = types[ix - 1]) == B) { + return ON; + } + return classes[ix - 1]; + case B: + lastArabic = false; + hasUBAT_B = true; + return dir; + case S: + hasUBAT_S = true; + return ON; + case LRE: + case RLE: + case LRO: + case RLO: + case PDF: + lastArabic = false; + case BN: + return ON; + } +} +function _getCharacterType(ch) { + var uc = ch.charCodeAt(0), hi = uc >> 8; + if (hi == 0) { + return ((uc > 0x00BF) ? L : UnicodeTBL00[uc]); + } + else if (hi == 5) { + return (/[\u0591-\u05f4]/.test(ch) ? R : L); + } + else if (hi == 6) { + if (/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(ch)) + return NSM; + else if (/[\u0660-\u0669\u066b-\u066c]/.test(ch)) + return AN; + else if (uc == 0x066A) + return ET; + else if (/[\u06f0-\u06f9]/.test(ch)) + return EN; + else + return AL; + } + else if (hi == 0x20 && uc <= 0x205F) { + return UnicodeTBL20[uc & 0xFF]; + } + else if (hi == 0xFE) { + return (uc >= 0xFE70 ? AL : ON); + } + return ON; +} +function _isArabicDiacritics(ch) { + return (ch >= '\u064b' && ch <= '\u0655'); +} +exports.L = L; +exports.R = R; +exports.EN = EN; +exports.ON_R = 3; +exports.AN = 4; +exports.R_H = 5; +exports.B = 6; +exports.RLE = 7; +exports.DOT = "\xB7"; +exports.doBidiReorder = function (text, textCharTypes, isRtl) { + if (text.length < 2) + return {}; + var chars = text.split(""), logicalFromVisual = new Array(chars.length), bidiLevels = new Array(chars.length), levels = []; + dir = isRtl ? RTL : LTR; + _computeLevels(chars, levels, chars.length, textCharTypes); + for (var i = 0; i < logicalFromVisual.length; logicalFromVisual[i] = i, i++) + ; + _invertLevel(2, levels, logicalFromVisual); + _invertLevel(1, levels, logicalFromVisual); + for (var i = 0; i < logicalFromVisual.length - 1; i++) { //fix levels to reflect character width + if (textCharTypes[i] === AN) { + levels[i] = exports.AN; + } + else if (levels[i] === R && ((textCharTypes[i] > AL && textCharTypes[i] < LRE) + || textCharTypes[i] === ON || textCharTypes[i] === BN)) { + levels[i] = exports.ON_R; + } + else if ((i > 0 && chars[i - 1] === '\u0644') && /\u0622|\u0623|\u0625|\u0627/.test(chars[i])) { + levels[i - 1] = levels[i] = exports.R_H; + i++; + } + } + if (chars[chars.length - 1] === exports.DOT) + levels[chars.length - 1] = exports.B; + if (chars[0] === '\u202B') + levels[0] = exports.RLE; + for (var i = 0; i < logicalFromVisual.length; i++) { + bidiLevels[i] = levels[logicalFromVisual[i]]; + } + return { 'logicalFromVisual': logicalFromVisual, 'bidiLevels': bidiLevels }; }; - - -EventEmitter.setDefaultHandler = function(eventName, callback) { - var handlers = this._defaultHandlers; - if (!handlers) - handlers = this._defaultHandlers = {_disabled_: {}}; - - if (handlers[eventName]) { - var old = handlers[eventName]; - var disabled = handlers._disabled_[eventName]; - if (!disabled) - handlers._disabled_[eventName] = disabled = []; - disabled.push(old); - var i = disabled.indexOf(callback); - if (i != -1) - disabled.splice(i, 1); +exports.hasBidiCharacters = function (text, textCharTypes) { + var ret = false; + for (var i = 0; i < text.length; i++) { + textCharTypes[i] = _getCharacterType(text.charAt(i)); + if (!ret && (textCharTypes[i] == R || textCharTypes[i] == AL || textCharTypes[i] == AN)) + ret = true; } - handlers[eventName] = callback; + return ret; }; -EventEmitter.removeDefaultHandler = function(eventName, callback) { - var handlers = this._defaultHandlers; - if (!handlers) - return; - var disabled = handlers._disabled_[eventName]; - - if (handlers[eventName] == callback) { - if (disabled) - this.setDefaultHandler(eventName, disabled.pop()); - } else if (disabled) { - var i = disabled.indexOf(callback); - if (i != -1) - disabled.splice(i, 1); +exports.getVisualFromLogicalIdx = function (logIdx, rowMap) { + for (var i = 0; i < rowMap.logicalFromVisual.length; i++) { + if (rowMap.logicalFromVisual[i] == logIdx) + return i; } + return 0; }; -EventEmitter.on = -EventEmitter.addEventListener = function(eventName, callback, capturing) { - this._eventRegistry = this._eventRegistry || {}; - - var listeners = this._eventRegistry[eventName]; - if (!listeners) - listeners = this._eventRegistry[eventName] = []; - - if (listeners.indexOf(callback) == -1) - listeners[capturing ? "unshift" : "push"](callback); - return callback; -}; - -EventEmitter.off = -EventEmitter.removeListener = -EventEmitter.removeEventListener = function(eventName, callback) { - this._eventRegistry = this._eventRegistry || {}; - - var listeners = this._eventRegistry[eventName]; - if (!listeners) - return; - - var index = listeners.indexOf(callback); - if (index !== -1) - listeners.splice(index, 1); -}; - -EventEmitter.removeAllListeners = function(eventName) { - if (!eventName) this._eventRegistry = this._defaultHandlers = undefined; - if (this._eventRegistry) this._eventRegistry[eventName] = undefined; - if (this._defaultHandlers) this._defaultHandlers[eventName] = undefined; -}; - -exports.EventEmitter = EventEmitter; - -}); - -ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module) { -"no use strict"; - -var oop = require("./oop"); -var EventEmitter = require("./event_emitter").EventEmitter; - -var optionsProvider = { - setOptions: function(optList) { - Object.keys(optList).forEach(function(key) { - this.setOption(key, optList[key]); - }, this); - }, - getOptions: function(optionNames) { - var result = {}; - if (!optionNames) { - var options = this.$options; - optionNames = Object.keys(options).filter(function(key) { - return !options[key].hidden; - }); - } else if (!Array.isArray(optionNames)) { - result = optionNames; - optionNames = Object.keys(result); - } - optionNames.forEach(function(key) { - result[key] = this.getOption(key); - }, this); - return result; - }, - setOption: function(name, value) { - if (this["$" + name] === value) - return; - var opt = this.$options[name]; - if (!opt) { - return warn('misspelled option "' + name + '"'); - } - if (opt.forwardTo) - return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value); - - if (!opt.handlesSet) - this["$" + name] = value; - if (opt && opt.set) - opt.set.call(this, value); - }, - getOption: function(name) { - var opt = this.$options[name]; - if (!opt) { - return warn('misspelled option "' + name + '"'); - } - if (opt.forwardTo) - return this[opt.forwardTo] && this[opt.forwardTo].getOption(name); - return opt && opt.get ? opt.get.call(this) : this["$" + name]; - } -}; - -function warn(message) { - if (typeof console != "undefined" && console.warn) - console.warn.apply(console, arguments); -} - -function reportError(msg, data) { - var e = new Error(msg); - e.data = data; - if (typeof console == "object" && console.error) - console.error(e); - setTimeout(function() { throw e; }); -} - -var AppConfig = function() { - this.$defaultOptions = {}; -}; - -(function() { - oop.implement(this, EventEmitter); - this.defineOptions = function(obj, path, options) { - if (!obj.$options) - this.$defaultOptions[path] = obj.$options = {}; - - Object.keys(options).forEach(function(key) { - var opt = options[key]; - if (typeof opt == "string") - opt = {forwardTo: opt}; - - opt.name || (opt.name = key); - obj.$options[opt.name] = opt; - if ("initialValue" in opt) - obj["$" + opt.name] = opt.initialValue; - }); - oop.implement(obj, optionsProvider); - - return this; - }; - - this.resetOptions = function(obj) { - Object.keys(obj.$options).forEach(function(key) { - var opt = obj.$options[key]; - if ("value" in opt) - obj.setOption(key, opt.value); - }); - }; - - this.setDefaultValue = function(path, name, value) { - if (!path) { - for (path in this.$defaultOptions) - if (this.$defaultOptions[path][name]) - break; - if (!this.$defaultOptions[path][name]) - return false; - } - var opts = this.$defaultOptions[path] || (this.$defaultOptions[path] = {}); - if (opts[name]) { - if (opts.forwardTo) - this.setDefaultValue(opts.forwardTo, name, value); - else - opts[name].value = value; - } - }; - - this.setDefaultValues = function(path, optionHash) { - Object.keys(optionHash).forEach(function(key) { - this.setDefaultValue(path, key, optionHash[key]); - }, this); - }; - - this.warn = warn; - this.reportError = reportError; - -}).call(AppConfig.prototype); - -exports.AppConfig = AppConfig; - -}); - -ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"], function(require, exports, module) { -"no use strict"; - -var lang = require("./lib/lang"); -var oop = require("./lib/oop"); -var net = require("./lib/net"); -var AppConfig = require("./lib/app_config").AppConfig; - -module.exports = exports = new AppConfig(); - -var global = (function() { - return this || typeof window != "undefined" && window; -})(); - -var options = { - packaged: false, - workerPath: null, - modePath: null, - themePath: null, - basePath: "", - suffix: ".js", - $moduleUrls: {}, - loadWorkerFromBlob: true, - sharedPopups: false -}; - -exports.get = function(key) { - if (!options.hasOwnProperty(key)) - throw new Error("Unknown config key: " + key); - - return options[key]; -}; - -exports.set = function(key, value) { - if (options.hasOwnProperty(key)) - options[key] = value; - else if (this.setDefaultValue("", key, value) == false) - throw new Error("Unknown config key: " + key); -}; - -exports.all = function() { - return lang.copyObject(options); -}; - -exports.$modes = {}; -exports.moduleUrl = function(name, component) { - if (options.$moduleUrls[name]) - return options.$moduleUrls[name]; - - var parts = name.split("/"); - component = component || parts[parts.length - 2] || ""; - var sep = component == "snippets" ? "/" : "-"; - var base = parts[parts.length - 1]; - if (component == "worker" && sep == "-") { - var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g"); - base = base.replace(re, ""); - } - - if ((!base || base == component) && parts.length > 1) - base = parts[parts.length - 2]; - var path = options[component + "Path"]; - if (path == null) { - path = options.basePath; - } else if (sep == "/") { - component = sep = ""; - } - if (path && path.slice(-1) != "/") - path += "/"; - return path + component + sep + base + this.get("suffix"); -}; - -exports.setModuleUrl = function(name, subst) { - return options.$moduleUrls[name] = subst; -}; - -exports.$loading = {}; -exports.loadModule = function(moduleName, onLoad) { - var module, moduleType; - if (Array.isArray(moduleName)) { - moduleType = moduleName[0]; - moduleName = moduleName[1]; - } - - try { - module = require(moduleName); - } catch (e) {} - if (module && !exports.$loading[moduleName]) - return onLoad && onLoad(module); - - if (!exports.$loading[moduleName]) - exports.$loading[moduleName] = []; - - exports.$loading[moduleName].push(onLoad); - - if (exports.$loading[moduleName].length > 1) - return; - - var afterLoad = function() { - require([moduleName], function(module) { - exports._emit("load.module", {name: moduleName, module: module}); - var listeners = exports.$loading[moduleName]; - exports.$loading[moduleName] = null; - listeners.forEach(function(onLoad) { - onLoad && onLoad(module); - }); - }); - }; - - if (!exports.get("packaged")) - return afterLoad(); - - net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad); - reportErrorIfPathIsNotConfigured(); -}; - -var reportErrorIfPathIsNotConfigured = function() { - if ( - !options.basePath && !options.workerPath - && !options.modePath && !options.themePath - && !Object.keys(options.$moduleUrls).length - ) { - console.error( - "Unable to infer path to ace from script src,", - "use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes", - "or with webpack use ace/webpack-resolver" - ); - reportErrorIfPathIsNotConfigured = function() {}; - } -}; -init(true);function init(packaged) { - - if (!global || !global.document) - return; - - options.packaged = packaged || require.packaged || module.packaged || (global.define && __webpack_require__.amdD.packaged); - - var scriptOptions = {}; - var scriptUrl = ""; - var currentScript = (document.currentScript || document._currentScript ); // native or polyfill - var currentDocument = currentScript && currentScript.ownerDocument || document; - - var scripts = currentDocument.getElementsByTagName("script"); - for (var i=0; i 0){ - if (action == 0x10){ - for(i = condPos; i < ix; i++){ - levels[i] = 1; - } - condPos = -1; - } else { - condPos = -1; - } - } - cond = impTab[newState][6]; - if (cond){ - if(condPos == -1){ - condPos = ix; - } - }else{ - if (condPos > -1){ - for(i = condPos; i < ix; i++){ - levels[i] = newLevel; - } - condPos = -1; - } - } - if (charTypes[ix] == B){ - levels[ix] = 0; - } - hiLevel |= newLevel; - } - if (hasUBAT_S){ - for(i = 0; i < len; i++){ - if(charTypes[i] == S){ - levels[i] = dir; - for(var j = i - 1; j >= 0; j--){ - if(charTypes[j] == WS){ - levels[j] = dir; - }else{ - break; - } - } - } - } - } -} - -function _invertLevel(lev, levels, _array) { - if (hiLevel < lev){ - return; - } - if (lev == 1 && dir == RTL && !hasUBAT_B){ - _array.reverse(); - return; - } - var len = _array.length, start = 0, end, lo, hi, tmp; - while(start < len){ - if (levels[start] >= lev){ - end = start + 1; - while(end < len && levels[end] >= lev){ - end++; - } - for(lo = start, hi = end - 1 ; lo < hi; lo++, hi--){ - tmp = _array[lo]; - _array[lo] = _array[hi]; - _array[hi] = tmp; - } - start = end; - } - start++; - } -} - -function _getCharClass(chars, types, classes, ix) { - var cType = types[ix], wType, nType, len, i; - switch(cType){ - case L: - case R: - lastArabic = false; - case ON: - case AN: - return cType; - case EN: - return lastArabic ? AN : EN; - case AL: - lastArabic = true; - hasUBAT_AL = true; - return R; - case WS: - return ON; - case CS: - if (ix < 1 || (ix + 1) >= types.length || - ((wType = classes[ix - 1]) != EN && wType != AN) || - ((nType = types[ix + 1]) != EN && nType != AN)){ - return ON; - } - if (lastArabic){nType = AN;} - return nType == wType ? nType : ON; - case ES: - wType = ix > 0 ? classes[ix - 1] : B; - if (wType == EN && (ix + 1) < types.length && types[ix + 1] == EN){ - return EN; - } - return ON; - case ET: - if (ix > 0 && classes[ix - 1] == EN){ - return EN; - } - if (lastArabic){ - return ON; - } - i = ix + 1; - len = types.length; - while (i < len && types[i] == ET){ - i++; - } - if (i < len && types[i] == EN){ - return EN; - } - return ON; - case NSM: - len = types.length; - i = ix + 1; - while (i < len && types[i] == NSM){ - i++; - } - if (i < len){ - var c = chars[ix], rtlCandidate = (c >= 0x0591 && c <= 0x08FF) || c == 0xFB1E; - - wType = types[i]; - if (rtlCandidate && (wType == R || wType == AL)){ - return R; - } - } - - if (ix < 1 || (wType = types[ix - 1]) == B){ - return ON; - } - return classes[ix - 1]; - case B: - lastArabic = false; - hasUBAT_B = true; - return dir; - case S: - hasUBAT_S = true; - return ON; - case LRE: - case RLE: - case LRO: - case RLO: - case PDF: - lastArabic = false; - case BN: - return ON; - } -} - -function _getCharacterType( ch ) { - var uc = ch.charCodeAt(0), hi = uc >> 8; - - if (hi == 0) { - return ((uc > 0x00BF) ? L : UnicodeTBL00[uc]); - } else if (hi == 5) { - return (/[\u0591-\u05f4]/.test(ch) ? R : L); - } else if (hi == 6) { - if (/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(ch)) - return NSM; - else if (/[\u0660-\u0669\u066b-\u066c]/.test(ch)) - return AN; - else if (uc == 0x066A) - return ET; - else if (/[\u06f0-\u06f9]/.test(ch)) - return EN; - else - return AL; - } else if (hi == 0x20 && uc <= 0x205F) { - return UnicodeTBL20[uc & 0xFF]; - } else if (hi == 0xFE) { - return (uc >= 0xFE70 ? AL : ON); - } - return ON; -} - -function _isArabicDiacritics( ch ) { - return (ch >= '\u064b' && ch <= '\u0655'); -} -exports.L = L; -exports.R = R; -exports.EN = EN; -exports.ON_R = 3; -exports.AN = 4; -exports.R_H = 5; -exports.B = 6; -exports.RLE = 7; - -exports.DOT = "\xB7"; -exports.doBidiReorder = function(text, textCharTypes, isRtl) { - if (text.length < 2) - return {}; - - var chars = text.split(""), logicalFromVisual = new Array(chars.length), - bidiLevels = new Array(chars.length), levels = []; - - dir = isRtl ? RTL : LTR; - - _computeLevels(chars, levels, chars.length, textCharTypes); - - for (var i = 0; i < logicalFromVisual.length; logicalFromVisual[i] = i, i++); - - _invertLevel(2, levels, logicalFromVisual); - _invertLevel(1, levels, logicalFromVisual); - - for (var i = 0; i < logicalFromVisual.length - 1; i++) { //fix levels to reflect character width - if (textCharTypes[i] === AN) { - levels[i] = exports.AN; - } else if (levels[i] === R && ((textCharTypes[i] > AL && textCharTypes[i] < LRE) - || textCharTypes[i] === ON || textCharTypes[i] === BN)) { - levels[i] = exports.ON_R; - } else if ((i > 0 && chars[i - 1] === '\u0644') && /\u0622|\u0623|\u0625|\u0627/.test(chars[i])) { - levels[i - 1] = levels[i] = exports.R_H; - i++; - } - } - if (chars[chars.length - 1] === exports.DOT) - levels[chars.length - 1] = exports.B; - - if (chars[0] === '\u202B') - levels[0] = exports.RLE; - - for (var i = 0; i < logicalFromVisual.length; i++) { - bidiLevels[i] = levels[logicalFromVisual[i]]; - } - - return {'logicalFromVisual': logicalFromVisual, 'bidiLevels': bidiLevels}; -}; -exports.hasBidiCharacters = function(text, textCharTypes){ - var ret = false; - for (var i = 0; i < text.length; i++){ - textCharTypes[i] = _getCharacterType(text.charAt(i)); - if (!ret && (textCharTypes[i] == R || textCharTypes[i] == AL || textCharTypes[i] == AN)) - ret = true; - } - return ret; -}; -exports.getVisualFromLogicalIdx = function(logIdx, rowMap) { - for (var i = 0; i < rowMap.logicalFromVisual.length; i++) { - if (rowMap.logicalFromVisual[i] == logIdx) - return i; - } - return 0; -}; - -}); - -ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"], function(require, exports, module){"use strict"; var bidiUtil = require("./lib/bidiutil"); var lang = require("./lib/lang"); var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/; -var BidiHandler = function(session) { - this.session = session; - this.bidiMap = {}; - this.currentRow = null; - this.bidiUtil = bidiUtil; - this.charWidths = []; - this.EOL = "\xAC"; - this.showInvisibles = true; - this.isRtlDir = false; - this.$isRtl = false; - this.line = ""; - this.wrapIndent = 0; - this.EOF = "\xB6"; - this.RLE = "\u202B"; - this.contentWidth = 0; - this.fontMetrics = null; - this.rtlLineOffset = 0; - this.wrapOffset = 0; - this.isMoveLeftOperation = false; - this.seenBidi = bidiRE.test(session.getValue()); -}; - -(function() { - this.isBidiRow = function(screenRow, docRow, splitIndex) { +var BidiHandler = /** @class */ (function () { + function BidiHandler(session) { + this.session = session; + this.bidiMap = {}; + this.currentRow = null; + this.bidiUtil = bidiUtil; + this.charWidths = []; + this.EOL = "\xAC"; + this.showInvisibles = true; + this.isRtlDir = false; + this.$isRtl = false; + this.line = ""; + this.wrapIndent = 0; + this.EOF = "\xB6"; + this.RLE = "\u202B"; + this.contentWidth = 0; + this.fontMetrics = null; + this.rtlLineOffset = 0; + this.wrapOffset = 0; + this.isMoveLeftOperation = false; + this.seenBidi = bidiRE.test(session.getValue()); + } + BidiHandler.prototype.isBidiRow = function (screenRow, docRow, splitIndex) { if (!this.seenBidi) return false; if (screenRow !== this.currentRow) { @@ -23371,8 +22768,7 @@ var BidiHandler = function(session) { } return this.bidiMap.bidiLevels; }; - - this.onChange = function(delta) { + BidiHandler.prototype.onChange = function (delta) { if (!this.seenBidi) { if (delta.action == "insert" && bidiRE.test(delta.lines.join("\n"))) { this.seenBidi = true; @@ -23383,8 +22779,7 @@ var BidiHandler = function(session) { this.currentRow = null; } }; - - this.getDocumentRow = function() { + BidiHandler.prototype.getDocumentRow = function () { var docRow = 0; var rowCache = this.session.$screenRowCache; if (rowCache.length) { @@ -23392,11 +22787,9 @@ var BidiHandler = function(session) { if (index >= 0) docRow = this.session.$docRowCache[index]; } - return docRow; }; - - this.getSplitIndex = function() { + BidiHandler.prototype.getSplitIndex = function () { var splitIndex = 0; var rowCache = this.session.$screenRowCache; if (rowCache.length) { @@ -23405,24 +22798,19 @@ var BidiHandler = function(session) { currentIndex = this.session.$getRowCacheIndex(rowCache, this.currentRow - splitIndex - 1); if (currentIndex !== prevIndex) break; - prevIndex = currentIndex; splitIndex++; } - } else { + } + else { splitIndex = this.currentRow; } - return splitIndex; }; - - this.updateRowLine = function(docRow, splitIndex) { + BidiHandler.prototype.updateRowLine = function (docRow, splitIndex) { if (docRow === undefined) docRow = this.getDocumentRow(); - - var isLastRow = (docRow === this.session.getLength() - 1), - endOfLine = isLastRow ? this.EOF : this.EOL; - + var isLastRow = (docRow === this.session.getLength() - 1), endOfLine = isLastRow ? this.EOF : this.EOL; this.wrapIndent = 0; this.line = this.session.getLine(docRow); this.isRtlDir = this.$isRtl || this.line.charAt(0) === this.RLE; @@ -23431,24 +22819,26 @@ var BidiHandler = function(session) { if (splits) { if (splitIndex === undefined) splitIndex = this.getSplitIndex(); - - if(splitIndex > 0 && splits.length) { + if (splitIndex > 0 && splits.length) { this.wrapIndent = splits.indent; this.wrapOffset = this.wrapIndent * this.charWidths[bidiUtil.L]; this.line = (splitIndex < splits.length) ? this.line.substring(splits[splitIndex - 1], splits[splitIndex]) : - this.line.substring(splits[splits.length - 1]); - } else { + this.line.substring(splits[splits.length - 1]); + } + else { this.line = this.line.substring(0, splits[splitIndex]); } + if (splitIndex == splits.length) { + this.line += (this.showInvisibles) ? endOfLine : bidiUtil.DOT; + } } - if (splitIndex == splits.length) - this.line += (this.showInvisibles) ? endOfLine : bidiUtil.DOT; - } else { + } + else { this.line += this.showInvisibles ? endOfLine : bidiUtil.DOT; } var session = this.session, shift = 0, size; - this.line = this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g, function(ch, i){ + this.line = this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g, function (ch, i) { if (ch === '\t' || session.isFullWidth(ch.charCodeAt(0))) { size = (ch === '\t') ? session.getScreenTabSize(i + shift) : 2; shift += size - 1; @@ -23456,272 +22846,229 @@ var BidiHandler = function(session) { } return ch; }); - if (this.isRtlDir) { this.fontMetrics.$main.textContent = (this.line.charAt(this.line.length - 1) == bidiUtil.DOT) ? this.line.substr(0, this.line.length - 1) : this.line; this.rtlLineOffset = this.contentWidth - this.fontMetrics.$main.getBoundingClientRect().width; } }; - - this.updateBidiMap = function() { + BidiHandler.prototype.updateBidiMap = function () { var textCharTypes = []; if (bidiUtil.hasBidiCharacters(this.line, textCharTypes) || this.isRtlDir) { - this.bidiMap = bidiUtil.doBidiReorder(this.line, textCharTypes, this.isRtlDir); - } else { + this.bidiMap = bidiUtil.doBidiReorder(this.line, textCharTypes, this.isRtlDir); + } + else { this.bidiMap = {}; } }; - this.markAsDirty = function() { + BidiHandler.prototype.markAsDirty = function () { this.currentRow = null; }; - this.updateCharacterWidths = function(fontMetrics) { + BidiHandler.prototype.updateCharacterWidths = function (fontMetrics) { if (this.characterWidth === fontMetrics.$characterSize.width) return; - this.fontMetrics = fontMetrics; var characterWidth = this.characterWidth = fontMetrics.$characterSize.width; var bidiCharWidth = fontMetrics.$measureCharWidth("\u05d4"); - this.charWidths[bidiUtil.L] = this.charWidths[bidiUtil.EN] = this.charWidths[bidiUtil.ON_R] = characterWidth; this.charWidths[bidiUtil.R] = this.charWidths[bidiUtil.AN] = bidiCharWidth; this.charWidths[bidiUtil.R_H] = bidiCharWidth * 0.45; this.charWidths[bidiUtil.B] = this.charWidths[bidiUtil.RLE] = 0; - this.currentRow = null; }; - - this.setShowInvisibles = function(showInvisibles) { + BidiHandler.prototype.setShowInvisibles = function (showInvisibles) { this.showInvisibles = showInvisibles; this.currentRow = null; }; - - this.setEolChar = function(eolChar) { + BidiHandler.prototype.setEolChar = function (eolChar) { this.EOL = eolChar; }; - - this.setContentWidth = function(width) { + BidiHandler.prototype.setContentWidth = function (width) { this.contentWidth = width; }; - - this.isRtlLine = function(row) { - if (this.$isRtl) return true; + BidiHandler.prototype.isRtlLine = function (row) { + if (this.$isRtl) + return true; if (row != undefined) return (this.session.getLine(row).charAt(0) == this.RLE); else return this.isRtlDir; }; - - this.setRtlDirection = function(editor, isRtlDir) { + BidiHandler.prototype.setRtlDirection = function (editor, isRtlDir) { var cursor = editor.getCursorPosition(); for (var row = editor.selection.getSelectionAnchor().row; row <= cursor.row; row++) { if (!isRtlDir && editor.session.getLine(row).charAt(0) === editor.session.$bidiHandler.RLE) editor.session.doc.removeInLine(row, 0, 1); else if (isRtlDir && editor.session.getLine(row).charAt(0) !== editor.session.$bidiHandler.RLE) - editor.session.doc.insert({column: 0, row: row}, editor.session.$bidiHandler.RLE); + editor.session.doc.insert({ column: 0, row: row }, editor.session.$bidiHandler.RLE); } }; - this.getPosLeft = function(col) { + BidiHandler.prototype.getPosLeft = function (col) { col -= this.wrapIndent; var leftBoundary = (this.line.charAt(0) === this.RLE) ? 1 : 0; var logicalIdx = (col > leftBoundary) ? (this.session.getOverwrite() ? col : col - 1) : leftBoundary; - var visualIdx = bidiUtil.getVisualFromLogicalIdx(logicalIdx, this.bidiMap), - levels = this.bidiMap.bidiLevels, left = 0; - + var visualIdx = bidiUtil.getVisualFromLogicalIdx(logicalIdx, this.bidiMap), levels = this.bidiMap.bidiLevels, left = 0; if (!this.session.getOverwrite() && col <= leftBoundary && levels[visualIdx] % 2 !== 0) visualIdx++; - for (var i = 0; i < visualIdx; i++) { left += this.charWidths[levels[i]]; } - if (!this.session.getOverwrite() && (col > leftBoundary) && (levels[visualIdx] % 2 === 0)) left += this.charWidths[levels[visualIdx]]; - if (this.wrapIndent) left += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset; - if (this.isRtlDir) left += this.rtlLineOffset; - return left; }; - this.getSelections = function(startCol, endCol) { - var map = this.bidiMap, levels = map.bidiLevels, level, selections = [], offset = 0, - selColMin = Math.min(startCol, endCol) - this.wrapIndent, selColMax = Math.max(startCol, endCol) - this.wrapIndent, - isSelected = false, isSelectedPrev = false, selectionStart = 0; - + BidiHandler.prototype.getSelections = function (startCol, endCol) { + var map = this.bidiMap, levels = map.bidiLevels, level, selections = [], offset = 0, selColMin = Math.min(startCol, endCol) - this.wrapIndent, selColMax = Math.max(startCol, endCol) - this.wrapIndent, isSelected = false, isSelectedPrev = false, selectionStart = 0; if (this.wrapIndent) offset += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset; - for (var logIdx, visIdx = 0; visIdx < levels.length; visIdx++) { logIdx = map.logicalFromVisual[visIdx]; level = levels[visIdx]; isSelected = (logIdx >= selColMin) && (logIdx < selColMax); if (isSelected && !isSelectedPrev) { selectionStart = offset; - } else if (!isSelected && isSelectedPrev) { - selections.push({left: selectionStart, width: offset - selectionStart}); + } + else if (!isSelected && isSelectedPrev) { + selections.push({ left: selectionStart, width: offset - selectionStart }); } offset += this.charWidths[level]; isSelectedPrev = isSelected; } - if (isSelected && (visIdx === levels.length)) { - selections.push({left: selectionStart, width: offset - selectionStart}); + selections.push({ left: selectionStart, width: offset - selectionStart }); } - - if(this.isRtlDir) { + if (this.isRtlDir) { for (var i = 0; i < selections.length; i++) { selections[i].left += this.rtlLineOffset; } } return selections; }; - this.offsetToCol = function(posX) { - if(this.isRtlDir) + BidiHandler.prototype.offsetToCol = function (posX) { + if (this.isRtlDir) posX -= this.rtlLineOffset; - - var logicalIdx = 0, posX = Math.max(posX, 0), - offset = 0, visualIdx = 0, levels = this.bidiMap.bidiLevels, - charWidth = this.charWidths[levels[visualIdx]]; - + var logicalIdx = 0, posX = Math.max(posX, 0), offset = 0, visualIdx = 0, levels = this.bidiMap.bidiLevels, charWidth = this.charWidths[levels[visualIdx]]; if (this.wrapIndent) - posX -= this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset; - - while(posX > offset + charWidth/2) { + posX -= this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset; + while (posX > offset + charWidth / 2) { offset += charWidth; - if(visualIdx === levels.length - 1) { + if (visualIdx === levels.length - 1) { charWidth = 0; break; } charWidth = this.charWidths[levels[++visualIdx]]; } - - if (visualIdx > 0 && (levels[visualIdx - 1] % 2 !== 0) && (levels[visualIdx] % 2 === 0)){ - if(posX < offset) + if (visualIdx > 0 && (levels[visualIdx - 1] % 2 !== 0) && (levels[visualIdx] % 2 === 0)) { + if (posX < offset) visualIdx--; logicalIdx = this.bidiMap.logicalFromVisual[visualIdx]; - - } else if (visualIdx > 0 && (levels[visualIdx - 1] % 2 === 0) && (levels[visualIdx] % 2 !== 0)){ + } + else if (visualIdx > 0 && (levels[visualIdx - 1] % 2 === 0) && (levels[visualIdx] % 2 !== 0)) { logicalIdx = 1 + ((posX > offset) ? this.bidiMap.logicalFromVisual[visualIdx] - : this.bidiMap.logicalFromVisual[visualIdx - 1]); - - } else if ((this.isRtlDir && visualIdx === levels.length - 1 && charWidth === 0 && (levels[visualIdx - 1] % 2 === 0)) - || (!this.isRtlDir && visualIdx === 0 && (levels[visualIdx] % 2 !== 0))){ + : this.bidiMap.logicalFromVisual[visualIdx - 1]); + } + else if ((this.isRtlDir && visualIdx === levels.length - 1 && charWidth === 0 && (levels[visualIdx - 1] % 2 === 0)) + || (!this.isRtlDir && visualIdx === 0 && (levels[visualIdx] % 2 !== 0))) { logicalIdx = 1 + this.bidiMap.logicalFromVisual[visualIdx]; - } else { + } + else { if (visualIdx > 0 && (levels[visualIdx - 1] % 2 !== 0) && charWidth !== 0) visualIdx--; logicalIdx = this.bidiMap.logicalFromVisual[visualIdx]; } - if (logicalIdx === 0 && this.isRtlDir) logicalIdx++; - return (logicalIdx + this.wrapIndent); }; - -}).call(BidiHandler.prototype); - + return BidiHandler; +}()); exports.BidiHandler = BidiHandler; -}); -ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"], function(require, exports, module){"use strict"; var oop = require("./lib/oop"); var lang = require("./lib/lang"); var EventEmitter = require("./lib/event_emitter").EventEmitter; var Range = require("./range").Range; -var Selection = function(session) { - this.session = session; - this.doc = session.getDocument(); - - this.clearSelection(); - this.cursor = this.lead = this.doc.createAnchor(0, 0); - this.anchor = this.doc.createAnchor(0, 0); - this.$silent = false; - - var self = this; - this.cursor.on("change", function(e) { - self.$cursorChanged = true; - if (!self.$silent) - self._emit("changeCursor"); - if (!self.$isEmpty && !self.$silent) - self._emit("changeSelection"); - if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column) - self.$desiredColumn = null; - }); - - this.anchor.on("change", function() { - self.$anchorChanged = true; - if (!self.$isEmpty && !self.$silent) - self._emit("changeSelection"); - }); -}; - -(function() { - - oop.implement(this, EventEmitter); - this.isEmpty = function() { - return this.$isEmpty || ( - this.anchor.row == this.lead.row && - this.anchor.column == this.lead.column - ); +var Selection = /** @class */ (function () { + function Selection(session) { + this.session = session; + this.doc = session.getDocument(); + this.clearSelection(); + this.cursor = this.lead = this.doc.createAnchor(0, 0); + this.anchor = this.doc.createAnchor(0, 0); + this.$silent = false; + var self = this; + this.cursor.on("change", function (e) { + self.$cursorChanged = true; + if (!self.$silent) + self._emit("changeCursor"); + if (!self.$isEmpty && !self.$silent) + self._emit("changeSelection"); + if (!self.$keepDesiredColumnOnChange && e.old.column != e.value.column) + self.$desiredColumn = null; + }); + this.anchor.on("change", function () { + self.$anchorChanged = true; + if (!self.$isEmpty && !self.$silent) + self._emit("changeSelection"); + }); + } + Selection.prototype.isEmpty = function () { + return this.$isEmpty || (this.anchor.row == this.lead.row && + this.anchor.column == this.lead.column); }; - this.isMultiLine = function() { + Selection.prototype.isMultiLine = function () { return !this.$isEmpty && this.anchor.row != this.cursor.row; }; - this.getCursor = function() { + Selection.prototype.getCursor = function () { return this.lead.getPosition(); }; - this.setSelectionAnchor = function(row, column) { + Selection.prototype.setAnchor = function (row, column) { this.$isEmpty = false; this.anchor.setPosition(row, column); }; - this.getAnchor = - this.getSelectionAnchor = function() { + Selection.prototype.getAnchor = function () { if (this.$isEmpty) return this.getSelectionLead(); - return this.anchor.getPosition(); }; - this.getSelectionLead = function() { + Selection.prototype.getSelectionLead = function () { return this.lead.getPosition(); }; - this.isBackwards = function() { + Selection.prototype.isBackwards = function () { var anchor = this.anchor; var lead = this.lead; return (anchor.row > lead.row || (anchor.row == lead.row && anchor.column > lead.column)); }; - this.getRange = function() { + Selection.prototype.getRange = function () { var anchor = this.anchor; var lead = this.lead; - if (this.$isEmpty) return Range.fromPoints(lead, lead); - return this.isBackwards() ? Range.fromPoints(lead, anchor) : Range.fromPoints(anchor, lead); }; - this.clearSelection = function() { + Selection.prototype.clearSelection = function () { if (!this.$isEmpty) { this.$isEmpty = true; this._emit("changeSelection"); } }; - this.selectAll = function() { + Selection.prototype.selectAll = function () { this.$setSelection(0, 0, Number.MAX_VALUE, Number.MAX_VALUE); }; - this.setRange = - this.setSelectionRange = function(range, reverse) { + Selection.prototype.setRange = function (range, reverse) { var start = reverse ? range.end : range.start; var end = reverse ? range.start : range.end; this.$setSelection(start.row, start.column, end.row, end.column); }; - - this.$setSelection = function(anchorRow, anchorColumn, cursorRow, cursorColumn) { + Selection.prototype.$setSelection = function (anchorRow, anchorColumn, cursorRow, cursorColumn) { if (this.$silent) return; var wasEmpty = this.$isEmpty; @@ -23737,63 +23084,61 @@ var Selection = function(session) { if (this.$cursorChanged || this.$anchorChanged || wasEmpty != this.$isEmpty || wasMultiselect) this._emit("changeSelection"); }; - - this.$moveSelection = function(mover) { + Selection.prototype.$moveSelection = function (mover) { var lead = this.lead; if (this.$isEmpty) this.setSelectionAnchor(lead.row, lead.column); - mover.call(this); }; - this.selectTo = function(row, column) { - this.$moveSelection(function() { + Selection.prototype.selectTo = function (row, column) { + this.$moveSelection(function () { this.moveCursorTo(row, column); }); }; - this.selectToPosition = function(pos) { - this.$moveSelection(function() { + Selection.prototype.selectToPosition = function (pos) { + this.$moveSelection(function () { this.moveCursorToPosition(pos); }); }; - this.moveTo = function(row, column) { + Selection.prototype.moveTo = function (row, column) { this.clearSelection(); this.moveCursorTo(row, column); }; - this.moveToPosition = function(pos) { + Selection.prototype.moveToPosition = function (pos) { this.clearSelection(); this.moveCursorToPosition(pos); }; - this.selectUp = function() { + Selection.prototype.selectUp = function () { this.$moveSelection(this.moveCursorUp); }; - this.selectDown = function() { + Selection.prototype.selectDown = function () { this.$moveSelection(this.moveCursorDown); }; - this.selectRight = function() { + Selection.prototype.selectRight = function () { this.$moveSelection(this.moveCursorRight); }; - this.selectLeft = function() { + Selection.prototype.selectLeft = function () { this.$moveSelection(this.moveCursorLeft); }; - this.selectLineStart = function() { + Selection.prototype.selectLineStart = function () { this.$moveSelection(this.moveCursorLineStart); }; - this.selectLineEnd = function() { + Selection.prototype.selectLineEnd = function () { this.$moveSelection(this.moveCursorLineEnd); }; - this.selectFileEnd = function() { + Selection.prototype.selectFileEnd = function () { this.$moveSelection(this.moveCursorFileEnd); }; - this.selectFileStart = function() { + Selection.prototype.selectFileStart = function () { this.$moveSelection(this.moveCursorFileStart); }; - this.selectWordRight = function() { + Selection.prototype.selectWordRight = function () { this.$moveSelection(this.moveCursorWordRight); }; - this.selectWordLeft = function() { + Selection.prototype.selectWordLeft = function () { this.$moveSelection(this.moveCursorWordLeft); }; - this.getWordRange = function(row, column) { + Selection.prototype.getWordRange = function (row, column) { if (typeof column == "undefined") { var cursor = row || this.lead; row = cursor.row; @@ -23801,24 +23146,23 @@ var Selection = function(session) { } return this.session.getWordRange(row, column); }; - this.selectWord = function() { + Selection.prototype.selectWord = function () { this.setSelectionRange(this.getWordRange()); }; - this.selectAWord = function() { + Selection.prototype.selectAWord = function () { var cursor = this.getCursor(); var range = this.session.getAWordRange(cursor.row, cursor.column); this.setSelectionRange(range); }; - - this.getLineRange = function(row, excludeLastChar) { + Selection.prototype.getLineRange = function (row, excludeLastChar) { var rowStart = typeof row == "number" ? row : this.lead.row; var rowEnd; - var foldLine = this.session.getFoldLine(rowStart); if (foldLine) { rowStart = foldLine.start.row; rowEnd = foldLine.end.row; - } else { + } + else { rowEnd = rowStart; } if (excludeLastChar === true) @@ -23826,32 +23170,30 @@ var Selection = function(session) { else return new Range(rowStart, 0, rowEnd + 1, 0); }; - this.selectLine = function() { + Selection.prototype.selectLine = function () { this.setSelectionRange(this.getLineRange()); }; - this.moveCursorUp = function() { + Selection.prototype.moveCursorUp = function () { this.moveCursorBy(-1, 0); }; - this.moveCursorDown = function() { + Selection.prototype.moveCursorDown = function () { this.moveCursorBy(1, 0); }; - this.wouldMoveIntoSoftTab = function(cursor, tabSize, direction) { + Selection.prototype.wouldMoveIntoSoftTab = function (cursor, tabSize, direction) { var start = cursor.column; var end = cursor.column + tabSize; - if (direction < 0) { start = cursor.column - tabSize; end = cursor.column; } - return this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(start, end).split(" ").length-1 == tabSize; + return this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(start, end).split(" ").length - 1 == tabSize; }; - this.moveCursorLeft = function() { - var cursor = this.lead.getPosition(), - fold; - + Selection.prototype.moveCursorLeft = function () { + var cursor = this.lead.getPosition(), fold; if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) { this.moveCursorTo(fold.start.row, fold.start.column); - } else if (cursor.column === 0) { + } + else if (cursor.column === 0) { if (cursor.row > 0) { this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length); } @@ -23860,14 +23202,14 @@ var Selection = function(session) { var tabSize = this.session.getTabSize(); if (this.wouldMoveIntoSoftTab(cursor, tabSize, -1) && !this.session.getNavigateWithinSoftTabs()) { this.moveCursorBy(0, -tabSize); - } else { + } + else { this.moveCursorBy(0, -1); } } }; - this.moveCursorRight = function() { - var cursor = this.lead.getPosition(), - fold; + Selection.prototype.moveCursorRight = function () { + var cursor = this.lead.getPosition(), fold; if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) { this.moveCursorTo(fold.end.row, fold.end.column); } @@ -23881,27 +23223,24 @@ var Selection = function(session) { var cursor = this.lead; if (this.wouldMoveIntoSoftTab(cursor, tabSize, 1) && !this.session.getNavigateWithinSoftTabs()) { this.moveCursorBy(0, tabSize); - } else { + } + else { this.moveCursorBy(0, 1); } } }; - this.moveCursorLineStart = function() { + Selection.prototype.moveCursorLineStart = function () { var row = this.lead.row; var column = this.lead.column; var screenRow = this.session.documentToScreenRow(row, column); var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0); - var beforeCursor = this.session.getDisplayLine( - row, null, firstColumnPosition.row, - firstColumnPosition.column - ); - + var beforeCursor = this.session.getDisplayLine(row, null, firstColumnPosition.row, firstColumnPosition.column); var leadingSpace = beforeCursor.match(/^\s*/); if (leadingSpace[0].length != column && !this.session.$useEmacsStyleLineStart) firstColumnPosition.column += leadingSpace[0].length; this.moveCursorToPosition(firstColumnPosition); }; - this.moveCursorLineEnd = function() { + Selection.prototype.moveCursorLineEnd = function () { var lead = this.lead; var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column); if (this.lead.column == lineEnd.column) { @@ -23912,23 +23251,21 @@ var Selection = function(session) { lineEnd.column = textEnd; } } - this.moveCursorTo(lineEnd.row, lineEnd.column); }; - this.moveCursorFileEnd = function() { + Selection.prototype.moveCursorFileEnd = function () { var row = this.doc.getLength() - 1; var column = this.doc.getLine(row).length; this.moveCursorTo(row, column); }; - this.moveCursorFileStart = function() { + Selection.prototype.moveCursorFileStart = function () { this.moveCursorTo(0, 0); }; - this.moveCursorLongWordRight = function() { + Selection.prototype.moveCursorLongWordRight = function () { var row = this.lead.row; var column = this.lead.column; var line = this.doc.getLine(row); var rightOfCursor = line.substring(column); - this.session.nonTokenRe.lastIndex = 0; this.session.tokenRe.lastIndex = 0; var fold = this.session.getFoldAt(row, column, 1); @@ -23952,10 +23289,9 @@ var Selection = function(session) { column += this.session.tokenRe.lastIndex; this.session.tokenRe.lastIndex = 0; } - this.moveCursorTo(row, column); }; - this.moveCursorLongWordLeft = function() { + Selection.prototype.moveCursorLongWordLeft = function () { var row = this.lead.row; var column = this.lead.column; var fold; @@ -23963,12 +23299,10 @@ var Selection = function(session) { this.moveCursorTo(fold.start.row, fold.start.column); return; } - var str = this.session.getFoldStringAt(row, column, -1); if (str == null) { str = this.doc.getLine(row).substring(0, column); } - var leftOfCursor = lang.stringReverse(str); this.session.nonTokenRe.lastIndex = 0; this.session.tokenRe.lastIndex = 0; @@ -23988,34 +23322,32 @@ var Selection = function(session) { column -= this.session.tokenRe.lastIndex; this.session.tokenRe.lastIndex = 0; } - this.moveCursorTo(row, column); }; - - this.$shortWordEndIndex = function(rightOfCursor) { + Selection.prototype.$shortWordEndIndex = function (rightOfCursor) { var index = 0, ch; var whitespaceRe = /\s/; var tokenRe = this.session.tokenRe; - tokenRe.lastIndex = 0; if (this.session.tokenRe.exec(rightOfCursor)) { index = this.session.tokenRe.lastIndex; - } else { + } + else { while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) - index ++; - + index++; if (index < 1) { tokenRe.lastIndex = 0; - while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { + while ((ch = rightOfCursor[index]) && !tokenRe.test(ch)) { tokenRe.lastIndex = 0; - index ++; + index++; if (whitespaceRe.test(ch)) { if (index > 2) { index--; break; - } else { + } + else { while ((ch = rightOfCursor[index]) && whitespaceRe.test(ch)) - index ++; + index++; if (index > 2) break; } @@ -24024,100 +23356,79 @@ var Selection = function(session) { } } tokenRe.lastIndex = 0; - return index; }; - - this.moveCursorShortWordRight = function() { + Selection.prototype.moveCursorShortWordRight = function () { var row = this.lead.row; var column = this.lead.column; var line = this.doc.getLine(row); var rightOfCursor = line.substring(column); - var fold = this.session.getFoldAt(row, column, 1); if (fold) return this.moveCursorTo(fold.end.row, fold.end.column); - if (column == line.length) { var l = this.doc.getLength(); do { row++; rightOfCursor = this.doc.getLine(row); } while (row < l && /^\s*$/.test(rightOfCursor)); - if (!/^\s+/.test(rightOfCursor)) rightOfCursor = ""; column = 0; } - var index = this.$shortWordEndIndex(rightOfCursor); - this.moveCursorTo(row, column + index); }; - - this.moveCursorShortWordLeft = function() { + Selection.prototype.moveCursorShortWordLeft = function () { var row = this.lead.row; var column = this.lead.column; - var fold; if (fold = this.session.getFoldAt(row, column, -1)) return this.moveCursorTo(fold.start.row, fold.start.column); - var line = this.session.getLine(row).substring(0, column); if (column === 0) { do { row--; line = this.doc.getLine(row); } while (row > 0 && /^\s*$/.test(line)); - column = line.length; if (!/\s+$/.test(line)) line = ""; } - var leftOfCursor = lang.stringReverse(line); var index = this.$shortWordEndIndex(leftOfCursor); - return this.moveCursorTo(row, column - index); }; - - this.moveCursorWordRight = function() { + Selection.prototype.moveCursorWordRight = function () { if (this.session.$selectLongWords) this.moveCursorLongWordRight(); else this.moveCursorShortWordRight(); }; - - this.moveCursorWordLeft = function() { + Selection.prototype.moveCursorWordLeft = function () { if (this.session.$selectLongWords) this.moveCursorLongWordLeft(); else this.moveCursorShortWordLeft(); }; - this.moveCursorBy = function(rows, chars) { - var screenPos = this.session.documentToScreenPosition( - this.lead.row, - this.lead.column - ); - + Selection.prototype.moveCursorBy = function (rows, chars) { + var screenPos = this.session.documentToScreenPosition(this.lead.row, this.lead.column); var offsetX; - if (chars === 0) { if (rows !== 0) { if (this.session.$bidiHandler.isBidiRow(screenPos.row, this.lead.row)) { offsetX = this.session.$bidiHandler.getPosLeft(screenPos.column); screenPos.column = Math.round(offsetX / this.session.$bidiHandler.charWidths[0]); - } else { + } + else { offsetX = screenPos.column * this.session.$bidiHandler.charWidths[0]; } } - if (this.$desiredColumn) screenPos.column = this.$desiredColumn; else this.$desiredColumn = screenPos.column; } - if (rows != 0 && this.session.lineWidgets && this.session.lineWidgets[this.lead.row]) { var widget = this.session.lineWidgets[this.lead.row]; if (rows < 0) @@ -24125,24 +23436,20 @@ var Selection = function(session) { else if (rows > 0) rows += widget.rowCount - (widget.rowsAbove || 0); } - var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column, offsetX); - if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column) { - } this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0); }; - this.moveCursorToPosition = function(position) { + Selection.prototype.moveCursorToPosition = function (position) { this.moveCursorTo(position.row, position.column); }; - this.moveCursorTo = function(row, column, keepDesiredColumn) { + Selection.prototype.moveCursorTo = function (row, column, keepDesiredColumn) { var fold = this.session.getFoldAt(row, column, 1); if (fold) { row = fold.start.row; column = fold.start.column; } - this.$keepDesiredColumnOnChange = true; var line = this.session.getLine(row); if (/[\uDC00-\uDFFF]/.test(line.charAt(column)) && line.charAt(column - 1)) { @@ -24153,79 +23460,75 @@ var Selection = function(session) { } this.lead.setPosition(row, column); this.$keepDesiredColumnOnChange = false; - if (!keepDesiredColumn) this.$desiredColumn = null; }; - this.moveCursorToScreen = function(row, column, keepDesiredColumn) { + Selection.prototype.moveCursorToScreen = function (row, column, keepDesiredColumn) { var pos = this.session.screenToDocumentPosition(row, column); this.moveCursorTo(pos.row, pos.column, keepDesiredColumn); }; - this.detach = function() { + Selection.prototype.detach = function () { this.lead.detach(); this.anchor.detach(); - this.session = this.doc = null; }; - - this.fromOrientedRange = function(range) { + Selection.prototype.fromOrientedRange = function (range) { this.setSelectionRange(range, range.cursor == range.start); this.$desiredColumn = range.desiredColumn || this.$desiredColumn; }; - - this.toOrientedRange = function(range) { + Selection.prototype.toOrientedRange = function (range) { var r = this.getRange(); if (range) { range.start.column = r.start.column; range.start.row = r.start.row; range.end.column = r.end.column; range.end.row = r.end.row; - } else { + } + else { range = r; } - range.cursor = this.isBackwards() ? range.start : range.end; range.desiredColumn = this.$desiredColumn; return range; }; - this.getRangeOfMovements = function(func) { + Selection.prototype.getRangeOfMovements = function (func) { var start = this.getCursor(); try { func(this); var end = this.getCursor(); return Range.fromPoints(start, end); - } catch(e) { + } + catch (e) { return Range.fromPoints(start, start); - } finally { + } + finally { this.moveCursorToPosition(start); } }; - - this.toJSON = function() { - if (this.rangeCount) { - var data = this.ranges.map(function(r) { + Selection.prototype.toJSON = function () { + if (this.rangeCount) { var data = this.ranges.map(function (r) { var r1 = r.clone(); r1.isBackwards = r.cursor == r.start; return r1; }); - } else { - var data = this.getRange(); + } + else { var data = this.getRange(); data.isBackwards = this.isBackwards(); } return data; }; - - this.fromJSON = function(data) { + Selection.prototype.fromJSON = function (data) { if (data.start == undefined) { if (this.rangeList && data.length > 1) { this.toSingleRange(data[0]); - for (var i = data.length; i--; ) { + for (var i = data.length; i--;) { var r = Range.fromPoints(data[i].start, data[i].end); if (data[i].isBackwards) r.cursor = r.start; this.addRange(r, true); } return; - } else { + } + else { data = data[0]; } } @@ -24233,122 +23536,117 @@ var Selection = function(session) { this.toSingleRange(data); this.setSelectionRange(data, data.isBackwards); }; - - this.isEqual = function(data) { + Selection.prototype.isEqual = function (data) { if ((data.length || this.rangeCount) && data.length != this.rangeCount) return false; if (!data.length || !this.ranges) return this.getRange().isEqual(data); - - for (var i = this.ranges.length; i--; ) { + for (var i = this.ranges.length; i--;) { if (!this.ranges[i].isEqual(data[i])) return false; } return true; }; - -}).call(Selection.prototype); - + return Selection; +}()); +Selection.prototype.setSelectionAnchor = Selection.prototype.setAnchor; +Selection.prototype.getSelectionAnchor = Selection.prototype.getAnchor; +Selection.prototype.setSelectionRange = Selection.prototype.setRange; +oop.implement(Selection.prototype, EventEmitter); exports.Selection = Selection; -}); -ace.define("ace/tokenizer",["require","exports","module","ace/config"], function(require, exports, module) { -"use strict"; +}); -var config = require("./config"); +ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"], function(require, exports, module){"use strict"; +var reportError = require("./lib/report_error").reportError; var MAX_TOKEN_COUNT = 2000; -var Tokenizer = function(rules) { - this.states = rules; - - this.regExps = {}; - this.matchMappings = {}; - for (var key in this.states) { - var state = this.states[key]; - var ruleRegExps = []; - var matchTotal = 0; - var mapping = this.matchMappings[key] = {defaultToken: "text"}; - var flag = "g"; - - var splitterRurles = []; - for (var i = 0; i < state.length; i++) { - var rule = state[i]; - if (rule.defaultToken) - mapping.defaultToken = rule.defaultToken; - if (rule.caseInsensitive) - flag = "gi"; - if (rule.regex == null) - continue; - - if (rule.regex instanceof RegExp) - rule.regex = rule.regex.toString().slice(1, -1); - var adjustedregex = rule.regex; - var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; - if (Array.isArray(rule.token)) { - if (rule.token.length == 1 || matchcount == 1) { - rule.token = rule.token[0]; - } else if (matchcount - 1 != rule.token.length) { - this.reportError("number of classes and regexp groups doesn't match", { - rule: rule, - groupCount: matchcount - 1 - }); - rule.token = rule.token[0]; - } else { - rule.tokenArray = rule.token; - rule.token = null; - rule.onMatch = this.$arrayTokens; +var Tokenizer = /** @class */ (function () { + function Tokenizer(rules) { + this.splitRegex; + this.states = rules; + this.regExps = {}; + this.matchMappings = {}; + for (var key in this.states) { + var state = this.states[key]; + var ruleRegExps = []; + var matchTotal = 0; + var mapping = this.matchMappings[key] = { defaultToken: "text" }; + var flag = "g"; + var splitterRurles = []; + for (var i = 0; i < state.length; i++) { + var rule = state[i]; + if (rule.defaultToken) + mapping.defaultToken = rule.defaultToken; + if (rule.caseInsensitive && flag.indexOf("i") === -1) + flag += "i"; + if (rule.unicode && flag.indexOf("u") === -1) + flag += "u"; + if (rule.regex == null) + continue; + if (rule.regex instanceof RegExp) + rule.regex = rule.regex.toString().slice(1, -1); + var adjustedregex = rule.regex; + var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; + if (Array.isArray(rule.token)) { + if (rule.token.length == 1 || matchcount == 1) { + rule.token = rule.token[0]; + } + else if (matchcount - 1 != rule.token.length) { + this.reportError("number of classes and regexp groups doesn't match", { + rule: rule, + groupCount: matchcount - 1 + }); + rule.token = rule.token[0]; + } + else { + rule.tokenArray = rule.token; + rule.token = null; + rule.onMatch = this.$arrayTokens; + } } - } else if (typeof rule.token == "function" && !rule.onMatch) { - if (matchcount > 1) - rule.onMatch = this.$applyToken; - else - rule.onMatch = rule.token; - } - - if (matchcount > 1) { - if (/\\\d/.test(rule.regex)) { - adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) { - return "\\" + (parseInt(digit, 10) + matchTotal + 1); - }); - } else { - matchcount = 1; - adjustedregex = this.removeCapturingGroups(rule.regex); + else if (typeof rule.token == "function" && !rule.onMatch) { + if (matchcount > 1) + rule.onMatch = this.$applyToken; + else + rule.onMatch = rule.token; } - if (!rule.splitRegex && typeof rule.token != "string") - splitterRurles.push(rule); // flag will be known only at the very end - } - - mapping[matchTotal] = i; - matchTotal += matchcount; - - ruleRegExps.push(adjustedregex); - if (!rule.onMatch) - rule.onMatch = null; - } - - if (!ruleRegExps.length) { - mapping[0] = 0; - ruleRegExps.push("$"); + if (matchcount > 1) { + if (/\\\d/.test(rule.regex)) { + adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function (match, digit) { + return "\\" + (parseInt(digit, 10) + matchTotal + 1); + }); + } + else { + matchcount = 1; + adjustedregex = this.removeCapturingGroups(rule.regex); + } + if (!rule.splitRegex && typeof rule.token != "string") + splitterRurles.push(rule); // flag will be known only at the very end + } + mapping[matchTotal] = i; + matchTotal += matchcount; + ruleRegExps.push(adjustedregex); + if (!rule.onMatch) + rule.onMatch = null; + } + if (!ruleRegExps.length) { + mapping[0] = 0; + ruleRegExps.push("$"); + } + splitterRurles.forEach(function (rule) { + rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); + }, this); + this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); } - - splitterRurles.forEach(function(rule) { - rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); - }, this); - - this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); } -}; - -(function() { - this.$setMaxTokenCount = function(m) { + Tokenizer.prototype.$setMaxTokenCount = function (m) { MAX_TOKEN_COUNT = m | 0; }; - - this.$applyToken = function(str) { + Tokenizer.prototype.$applyToken = function (str) { var values = this.splitRegex.exec(str).slice(1); var types = this.token.apply(this, values); if (typeof types === "string") - return [{type: types, value: str}]; - + return [{ type: types, value: str }]; var tokens = []; for (var i = 0, l = types.length; i < l; i++) { if (values[i]) @@ -24359,8 +23657,7 @@ var Tokenizer = function(rules) { } return tokens; }; - - this.$arrayTokens = function(str) { + Tokenizer.prototype.$arrayTokens = function (str) { if (!str) return []; var values = this.splitRegex.exec(str); @@ -24377,34 +23674,30 @@ var Tokenizer = function(rules) { } return tokens; }; - - this.removeCapturingGroups = function(src) { - var r = src.replace( - /\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g, - function(x, y) {return y ? "(?:" : x;} - ); + Tokenizer.prototype.removeCapturingGroups = function (src) { + var r = src.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g, function (x, y) { return y ? "(?:" : x; }); return r; }; - - this.createSplitterRegexp = function(src, flag) { + Tokenizer.prototype.createSplitterRegexp = function (src, flag) { if (src.indexOf("(?=") != -1) { var stack = 0; var inChClass = false; var lastCapture = {}; - src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function( - m, esc, parenOpen, parenClose, square, index - ) { + src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function (m, esc, parenOpen, parenClose, square, index) { if (inChClass) { inChClass = square != "]"; - } else if (square) { + } + else if (square) { inChClass = true; - } else if (parenClose) { + } + else if (parenClose) { if (stack == lastCapture.stack) { - lastCapture.end = index+1; + lastCapture.end = index + 1; lastCapture.stack = -1; } stack--; - } else if (parenOpen) { + } + else if (parenOpen) { stack++; if (parenOpen.length != 1) { lastCapture.stack = stack; @@ -24413,16 +23706,16 @@ var Tokenizer = function(rules) { } return m; }); - if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end))) src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end); } - if (src.charAt(0) != "^") src = "^" + src; - if (src.charAt(src.length - 1) != "$") src += "$"; - - return new RegExp(src, (flag||"").replace("g", "")); + if (src.charAt(0) != "^") + src = "^" + src; + if (src.charAt(src.length - 1) != "$") + src += "$"; + return new RegExp(src, (flag || "").replace("g", "")); }; - this.getLineTokens = function(line, startState) { + Tokenizer.prototype.getLineTokens = function (line, startState) { if (startState && typeof startState != "string") { var stack = startState.slice(0); startState = stack[0]; @@ -24430,10 +23723,10 @@ var Tokenizer = function(rules) { stack.shift(); startState = stack.shift(); } - } else + } + else var stack = []; - - var currentState = startState || "start"; + var currentState = /**@type{string}*/ (startState) || "start"; var state = this.states[currentState]; if (!state) { currentState = "start"; @@ -24442,48 +23735,41 @@ var Tokenizer = function(rules) { var mapping = this.matchMappings[currentState]; var re = this.regExps[currentState]; re.lastIndex = 0; - var match, tokens = []; var lastIndex = 0; var matchAttempts = 0; - - var token = {type: null, value: ""}; - + var token = { type: null, value: "" }; while (match = re.exec(line)) { var type = mapping.defaultToken; var rule = null; var value = match[0]; var index = re.lastIndex; - if (index - value.length > lastIndex) { var skipped = line.substring(lastIndex, index - value.length); if (token.type == type) { token.value += skipped; - } else { + } + else { if (token.type) tokens.push(token); - token = {type: type, value: skipped}; + token = { type: type, value: skipped }; } } - - for (var i = 0; i < match.length-2; i++) { + for (var i = 0; i < match.length - 2; i++) { if (match[i + 1] === undefined) continue; - rule = state[mapping[i]]; - if (rule.onMatch) type = rule.onMatch(value, currentState, stack, line); else type = rule.token; - if (rule.next) { if (typeof rule.next == "string") { currentState = rule.next; - } else { + } + else { currentState = rule.next(currentState, stack); } - state = this.states[currentState]; if (!state) { this.reportError("state doesn't exist", currentState); @@ -24499,30 +23785,28 @@ var Tokenizer = function(rules) { lastIndex = index; break; } - if (value) { if (typeof type === "string") { if ((!rule || rule.merge !== false) && token.type === type) { token.value += value; - } else { + } + else { if (token.type) tokens.push(token); - token = {type: type, value: value}; + token = { type: type, value: value }; } - } else if (type) { + } + else if (type) { if (token.type) tokens.push(token); - token = {type: null, value: ""}; + token = { type: null, value: "" }; for (var i = 0; i < type.length; i++) tokens.push(type[i]); } } - if (lastIndex == line.length) break; - lastIndex = index; - if (matchAttempts++ > MAX_TOKEN_COUNT) { if (matchAttempts > 2 * line.length) { this.reportError("infinite loop with in ace tokenizer", { @@ -24543,47 +23827,39 @@ var Tokenizer = function(rules) { break; } } - if (token.type) tokens.push(token); - if (stack.length > 1) { if (stack[0] !== currentState) stack.unshift("#tmp", currentState); } return { - tokens : tokens, - state : stack.length ? stack : currentState + tokens: tokens, + state: stack.length ? stack : currentState }; }; - - this.reportError = config.reportError; - -}).call(Tokenizer.prototype); - + return Tokenizer; +}()); +Tokenizer.prototype.reportError = reportError; exports.Tokenizer = Tokenizer; -}); -ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"], function(require, exports, module) { -"use strict"; - -var lang = require("../lib/lang"); - -var TextHighlightRules = function() { +}); +ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"], function(require, exports, module){"use strict"; +var deepCopy = require("../lib/deep_copy").deepCopy; +var TextHighlightRules; +TextHighlightRules = function () { this.$rules = { - "start" : [{ - token : "empty_line", - regex : '^$' - }, { - defaultToken : "text" - }] + "start": [{ + token: "empty_line", + regex: '^$' + }, { + defaultToken: "text" + }] }; }; - -(function() { - - this.addRules = function(rules, prefix) { +(function () { + this.addRules = function (rules, prefix) { if (!prefix) { for (var key in rules) this.$rules[key] = rules[key]; @@ -24605,11 +23881,9 @@ var TextHighlightRules = function() { this.$rules[prefix + key] = state; } }; - - this.getRules = function() { + this.getRules = function () { return this.$rules; }; - this.embedRules = function (HighlightRules, prefix, escapeRules, states, append) { var embedRules = typeof HighlightRules == "function" ? new HighlightRules().getRules() @@ -24617,45 +23891,40 @@ var TextHighlightRules = function() { if (states) { for (var i = 0; i < states.length; i++) states[i] = prefix + states[i]; - } else { + } + else { states = []; for (var key in embedRules) states.push(prefix + key); } - this.addRules(embedRules, prefix); - if (escapeRules) { var addRules = Array.prototype[append ? "push" : "unshift"]; for (var i = 0; i < states.length; i++) - addRules.apply(this.$rules[states[i]], lang.deepCopy(escapeRules)); + addRules.apply(this.$rules[states[i]], deepCopy(escapeRules)); } - if (!this.$embeds) this.$embeds = []; this.$embeds.push(prefix); }; - - this.getEmbeds = function() { + this.getEmbeds = function () { return this.$embeds; }; - - var pushState = function(currentState, stack) { + var pushState = function (currentState, stack) { if (currentState != "start" || stack.length) stack.unshift(this.nextState, currentState); return this.nextState; }; - var popState = function(currentState, stack) { + var popState = function (currentState, stack) { stack.shift(); return stack.shift() || "start"; }; - - this.normalizeRules = function() { + this.normalizeRules = function () { var id = 0; var rules = this.$rules; function processState(key) { var state = rules[key]; - state.processed = true; + state["processed"] = true; for (var i = 0; i < state.length; i++) { var rule = state[i]; var toInsert = null; @@ -24680,7 +23949,7 @@ var TextHighlightRules = function() { var next = rule.next || rule.push; if (next && Array.isArray(next)) { var stateName = rule.stateName; - if (!stateName) { + if (!stateName) { stateName = rule.token; if (typeof stateName != "string") stateName = stateName[0] || ""; @@ -24690,60 +23959,57 @@ var TextHighlightRules = function() { rules[stateName] = next; rule.next = stateName; processState(stateName); - } else if (next == "pop") { + } + else if (next == "pop") { rule.next = popState; } - if (rule.push) { rule.nextState = rule.next || rule.push; rule.next = pushState; delete rule.push; } - if (rule.rules) { for (var r in rule.rules) { if (rules[r]) { if (rules[r].push) rules[r].push.apply(rules[r], rule.rules[r]); - } else { + } + else { rules[r] = rule.rules[r]; } } } var includeName = typeof rule == "string" ? rule : rule.include; if (includeName) { + if (includeName === "$self") + includeName = "start"; if (Array.isArray(includeName)) - toInsert = includeName.map(function(x) { return rules[x]; }); + toInsert = includeName.map(function (x) { return rules[x]; }); else toInsert = rules[includeName]; } - if (toInsert) { var args = [i, 1].concat(toInsert); if (rule.noEscape) - args = args.filter(function(x) {return !x.next;}); + args = args.filter(function (x) { return !x.next; }); state.splice.apply(state, args); i--; } - if (rule.keywordMap) { - rule.token = this.createKeywordMapper( - rule.keywordMap, rule.defaultToken || "text", rule.caseInsensitive - ); + rule.token = this.createKeywordMapper(rule.keywordMap, rule.defaultToken || "text", rule.caseInsensitive); delete rule.defaultToken; } } } Object.keys(rules).forEach(processState, this); }; - - this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) { + this.createKeywordMapper = function (map, defaultToken, ignoreCase, splitChar) { var keywords = Object.create(null); this.$keywordList = []; - Object.keys(map).forEach(function(className) { + Object.keys(map).forEach(function (className) { var a = map[className]; var list = a.split(splitChar || "|"); - for (var i = list.length; i--; ) { + for (var i = list.length; i--;) { var word = list[i]; this.$keywordList.push(word); if (ignoreCase) @@ -24753,38 +24019,32 @@ var TextHighlightRules = function() { }, this); map = null; return ignoreCase - ? function(value) {return keywords[value.toLowerCase()] || defaultToken; } - : function(value) {return keywords[value] || defaultToken; }; + ? function (value) { return keywords[value.toLowerCase()] || defaultToken; } + : function (value) { return keywords[value] || defaultToken; }; }; - - this.getKeywords = function() { + this.getKeywords = function () { return this.$keywords; }; - }).call(TextHighlightRules.prototype); - exports.TextHighlightRules = TextHighlightRules; -}); -ace.define("ace/mode/behaviour",["require","exports","module"], function(require, exports, module) { -"use strict"; +}); -var Behaviour = function() { - this.$behaviours = {}; +ace.define("ace/mode/behaviour",["require","exports","module"], function(require, exports, module){"use strict"; +var Behaviour; +Behaviour = function () { + this.$behaviours = {}; }; - (function () { - this.add = function (name, action, callback) { switch (undefined) { - case this.$behaviours: - this.$behaviours = {}; - case this.$behaviours[name]: - this.$behaviours[name] = {}; + case this.$behaviours: + this.$behaviours = {}; + case this.$behaviours[name]: + this.$behaviours[name] = {}; } this.$behaviours[name][action] = callback; }; - this.addBehaviours = function (behaviours) { for (var key in behaviours) { for (var action in behaviours[key]) { @@ -24792,26 +24052,25 @@ var Behaviour = function() { } } }; - this.remove = function (name) { if (this.$behaviours && this.$behaviours[name]) { delete this.$behaviours[name]; } }; - this.inherit = function (mode, filter) { if (typeof mode === "function") { var behaviours = new mode().getBehaviours(filter); - } else { + } + else { var behaviours = mode.getBehaviours(filter); } this.addBehaviours(behaviours); }; - this.getBehaviours = function (filter) { if (!filter) { return this.$behaviours; - } else { + } + else { var ret = {}; for (var i = 0; i < filter.length; i++) { if (this.$behaviours[filter[i]]) { @@ -24821,43 +24080,35 @@ var Behaviour = function() { return ret; } }; - }).call(Behaviour.prototype); - exports.Behaviour = Behaviour; -}); -ace.define("ace/token_iterator",["require","exports","module","ace/range"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/token_iterator",["require","exports","module","ace/range"], function(require, exports, module){"use strict"; var Range = require("./range").Range; -var TokenIterator = function(session, initialRow, initialColumn) { - this.$session = session; - this.$row = initialRow; - this.$rowTokens = session.getTokens(initialRow); - - var token = session.getTokenAt(initialRow, initialColumn); - this.$tokenIndex = token ? token.index : -1; -}; - -(function() { - this.stepBackward = function() { +var TokenIterator = /** @class */ (function () { + function TokenIterator(session, initialRow, initialColumn) { + this.$session = session; + this.$row = initialRow; + this.$rowTokens = session.getTokens(initialRow); + var token = session.getTokenAt(initialRow, initialColumn); + this.$tokenIndex = token ? token.index : -1; + } + TokenIterator.prototype.stepBackward = function () { this.$tokenIndex -= 1; - while (this.$tokenIndex < 0) { this.$row -= 1; if (this.$row < 0) { this.$row = 0; return null; } - this.$rowTokens = this.$session.getTokens(this.$row); this.$tokenIndex = this.$rowTokens.length - 1; } - return this.$rowTokens[this.$tokenIndex]; }; - this.stepForward = function() { + TokenIterator.prototype.stepForward = function () { this.$tokenIndex += 1; var rowCount; while (this.$tokenIndex >= this.$rowTokens.length) { @@ -24868,71 +24119,60 @@ var TokenIterator = function(session, initialRow, initialColumn) { this.$row = rowCount - 1; return null; } - this.$rowTokens = this.$session.getTokens(this.$row); this.$tokenIndex = 0; } - return this.$rowTokens[this.$tokenIndex]; }; - this.getCurrentToken = function () { + TokenIterator.prototype.getCurrentToken = function () { return this.$rowTokens[this.$tokenIndex]; }; - this.getCurrentTokenRow = function () { + TokenIterator.prototype.getCurrentTokenRow = function () { return this.$row; }; - this.getCurrentTokenColumn = function() { + TokenIterator.prototype.getCurrentTokenColumn = function () { var rowTokens = this.$rowTokens; var tokenIndex = this.$tokenIndex; var column = rowTokens[tokenIndex].start; if (column !== undefined) return column; - column = 0; while (tokenIndex > 0) { tokenIndex -= 1; column += rowTokens[tokenIndex].value.length; } - return column; }; - this.getCurrentTokenPosition = function() { - return {row: this.$row, column: this.getCurrentTokenColumn()}; + TokenIterator.prototype.getCurrentTokenPosition = function () { + return { row: this.$row, column: this.getCurrentTokenColumn() }; }; - this.getCurrentTokenRange = function() { + TokenIterator.prototype.getCurrentTokenRange = function () { var token = this.$rowTokens[this.$tokenIndex]; var column = this.getCurrentTokenColumn(); return new Range(this.$row, column, this.$row, column + token.value.length); }; - -}).call(TokenIterator.prototype); - + return TokenIterator; +}()); exports.TokenIterator = TokenIterator; -}); -ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict"; var oop = require("../../lib/oop"); var Behaviour = require("../behaviour").Behaviour; var TokenIterator = require("../../token_iterator").TokenIterator; var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "rparen", "paren", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "rparen", "paren", "punctuation.operator", "comment"]; - +var SAFE_INSERT_IN_TOKENS = ["text", "paren.rparen", "rparen", "paren", "punctuation.operator"]; +var SAFE_INSERT_BEFORE_TOKENS = ["text", "paren.rparen", "rparen", "paren", "punctuation.operator", "comment"]; var context; var contextCache = {}; -var defaultQuotes = {'"' : '"', "'" : "'"}; - -var initContext = function(editor) { +var defaultQuotes = { '"': '"', "'": "'" }; +var initContext = function (editor) { var id = -1; if (editor.multiSelect) { id = editor.selection.index; if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; + contextCache = { rangeCount: editor.multiSelect.rangeCount }; } if (contextCache[id]) return context = contextCache[id]; @@ -24946,38 +24186,54 @@ var initContext = function(editor) { maybeInsertedLineEnd: "" }; }; - -var getWrapped = function(selection, selected, opening, closing) { +var getWrapped = function (selection, selected, opening, closing) { var rowDiff = selection.end.row - selection.start.row; return { text: opening + selected + closing, selection: [ - 0, - selection.start.column + 1, - rowDiff, - selection.end.column + (rowDiff ? 0 : 1) - ] + 0, + selection.start.column + 1, + rowDiff, + selection.end.column + (rowDiff ? 0 : 1) + ] }; }; - -var CstyleBehaviour = function(options) { - this.add("braces", "insertion", function(state, action, editor, session, text) { +var CstyleBehaviour; +CstyleBehaviour = function (options) { + options = options || {}; + this.add("braces", "insertion", function (state, action, editor, session, text) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); if (text == '{') { initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); + var token = session.getTokenAt(cursor.row, cursor.column); if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { return getWrapped(selection, selected, '{', '}'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode || options && options.braces) { + } + else if (token && /(?:string)\.quasi|\.xml/.test(token.type)) { + var excludeTokens = [ + /tag\-(?:open|name)/, /attribute\-name/ + ]; + if (excludeTokens.some(function (el) { return el.test(token.type); }) || /(string)\.quasi/.test(token.type) + && token.value[cursor.column - token.start - 1] !== '$') + return; + CstyleBehaviour.recordAutoInsert(editor, session, "}"); + return { + text: '{}', + selection: [1, 1] + }; + } + else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode || options.braces) { CstyleBehaviour.recordAutoInsert(editor, session, "}"); return { text: '{}', selection: [1, 1] }; - } else { + } + else { CstyleBehaviour.recordMaybeInsert(editor, session, "{"); return { text: '{', @@ -24985,11 +24241,12 @@ var CstyleBehaviour = function(options) { }; } } - } else if (text == '}') { + } + else if (text == '}') { initContext(editor); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); + var matching = session.$findOpeningBracket('}', { column: cursor.column + 1, row: cursor.row }); if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { CstyleBehaviour.popAutoInsertedClosing(); return { @@ -24998,7 +24255,8 @@ var CstyleBehaviour = function(options) { }; } } - } else if (text == "\n" || text == "\r\n") { + } + else if (text == "\n" || text == "\r\n") { initContext(editor); var closing = ""; if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { @@ -25007,28 +24265,29 @@ var CstyleBehaviour = function(options) { } var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); + var openBracePos = session.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 }, '}'); if (!openBracePos) - return null; + return null; var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { + } + else if (closing) { var next_indent = this.$getIndent(line); - } else { + } + else { CstyleBehaviour.clearMaybeInsertedClosing(); return; } var indent = next_indent + session.getTabString(); - return { text: '\n' + indent + '\n' + next_indent + closing, selection: [1, indent.length, 1, indent.length] }; - } else { + } + else { CstyleBehaviour.clearMaybeInsertedClosing(); } }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { + this.add("braces", "deletion", function (state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && selected == '{') { initContext(editor); @@ -25037,33 +24296,35 @@ var CstyleBehaviour = function(options) { if (rightChar == '}') { range.end.column++; return range; - } else { + } + else { context.maybeInsertedBrackets--; } } }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { + this.add("parens", "insertion", function (state, action, editor, session, text) { if (text == '(') { initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); if (selected !== "" && editor.getWrapBehavioursEnabled()) { return getWrapped(selection, selected, '(', ')'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + } + else if (CstyleBehaviour.isSaneInsertion(editor, session)) { CstyleBehaviour.recordAutoInsert(editor, session, ")"); return { text: '()', selection: [1, 1] }; } - } else if (text == ')') { + } + else if (text == ')') { initContext(editor); var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); + var matching = session.$findOpeningBracket(')', { column: cursor.column + 1, row: cursor.row }); if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { CstyleBehaviour.popAutoInsertedClosing(); return { @@ -25074,8 +24335,7 @@ var CstyleBehaviour = function(options) { } } }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { + this.add("parens", "deletion", function (state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && selected == '(') { initContext(editor); @@ -25087,28 +24347,29 @@ var CstyleBehaviour = function(options) { } } }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { + this.add("brackets", "insertion", function (state, action, editor, session, text) { if (text == '[') { initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); if (selected !== "" && editor.getWrapBehavioursEnabled()) { return getWrapped(selection, selected, '[', ']'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + } + else if (CstyleBehaviour.isSaneInsertion(editor, session)) { CstyleBehaviour.recordAutoInsert(editor, session, "]"); return { text: '[]', selection: [1, 1] }; } - } else if (text == ']') { + } + else if (text == ']') { initContext(editor); var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); + var matching = session.$findOpeningBracket(']', { column: cursor.column + 1, row: cursor.row }); if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { CstyleBehaviour.popAutoInsertedClosing(); return { @@ -25119,8 +24380,7 @@ var CstyleBehaviour = function(options) { } } }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { + this.add("brackets", "deletion", function (state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && selected == '[') { initContext(editor); @@ -25132,8 +24392,7 @@ var CstyleBehaviour = function(options) { } } }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { var quotes = session.$mode.$quotes || defaultQuotes; if (text.length == 1 && quotes[text]) { if (this.lineCommentStart && this.lineCommentStart.indexOf(text) != -1) @@ -25144,26 +24403,25 @@ var CstyleBehaviour = function(options) { var selected = session.doc.getTextRange(selection); if (selected !== "" && (selected.length != 1 || !quotes[selected]) && editor.getWrapBehavioursEnabled()) { return getWrapped(selection, selected, quote, quote); - } else if (!selected) { + } + else if (!selected) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); + var leftChar = line.substring(cursor.column - 1, cursor.column); var rightChar = line.substring(cursor.column, cursor.column + 1); - var token = session.getTokenAt(cursor.row, cursor.column); var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); if (leftChar == "\\" && token && /escape/.test(token.type)) return null; - var stringBefore = token && /string|escape/.test(token.type); var stringAfter = !rightToken || /string|escape/.test(rightToken.type); - var pair; if (rightChar == quote) { pair = stringBefore !== stringAfter; if (pair && /string\.end/.test(rightToken.type)) pair = false; - } else { + } + else { if (stringBefore && !stringAfter) return null; // wrap string with different quote if (stringBefore && stringAfter) @@ -25172,27 +24430,27 @@ var CstyleBehaviour = function(options) { wordRe.lastIndex = 0; var isWordBefore = wordRe.test(leftChar); wordRe.lastIndex = 0; - var isWordAfter = wordRe.test(leftChar); - if (isWordBefore || isWordAfter) + var isWordAfter = wordRe.test(rightChar); + var pairQuotesAfter = session.$mode.$pairQuotesAfter; + var shouldPairQuotes = pairQuotesAfter && pairQuotesAfter[quote] && pairQuotesAfter[quote].test(leftChar); + if ((!shouldPairQuotes && isWordBefore) || isWordAfter) return null; // before or after alphanumeric if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) return null; // there is rightChar and it isn't closing var charBefore = line[cursor.column - 2]; - if (leftChar == quote && (charBefore == quote || wordRe.test(charBefore))) + if (leftChar == quote && (charBefore == quote || wordRe.test(charBefore))) return null; pair = true; } return { text: pair ? quote + quote : "", - selection: [1,1] + selection: [1, 1] }; } } }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + this.add("string_dquotes", "deletion", function (state, action, editor, session, range) { var quotes = session.$mode.$quotes || defaultQuotes; - var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && quotes.hasOwnProperty(selected)) { initContext(editor); @@ -25204,11 +24462,71 @@ var CstyleBehaviour = function(options) { } } }); - + if (options.closeDocComment !== false) { + this.add("doc comment end", "insertion", function (state, action, editor, session, text) { + if (state === "doc-start" && (text === "\n" || text === "\r\n") && editor.selection.isEmpty()) { + var cursor = editor.getCursorPosition(); + if (cursor.column === 0) { + return; + } + var line = session.doc.getLine(cursor.row); + var nextLine = session.doc.getLine(cursor.row + 1); + var tokens = session.getTokens(cursor.row); + var index = 0; + for (var i = 0; i < tokens.length; i++) { + index += tokens[i].value.length; + var currentToken = tokens[i]; + if (index >= cursor.column) { + if (index === cursor.column) { + if (!/\.doc/.test(currentToken.type)) { + return; + } + if (/\*\//.test(currentToken.value)) { + var nextToken = tokens[i + 1]; + if (!nextToken || !/\.doc/.test(nextToken.type)) { + return; + } + } + } + var cursorPosInToken = cursor.column - (index - currentToken.value.length); + var closeDocPos = currentToken.value.indexOf("*/"); + var openDocPos = currentToken.value.indexOf("/**", closeDocPos > -1 ? closeDocPos + 2 : 0); + if (openDocPos !== -1 && cursorPosInToken > openDocPos && cursorPosInToken < openDocPos + 3) { + return; + } + if (closeDocPos !== -1 && openDocPos !== -1 && cursorPosInToken >= closeDocPos + && cursorPosInToken <= openDocPos || !/\.doc/.test(currentToken.type)) { + return; + } + break; + } + } + var indent = this.$getIndent(line); + if (/\s*\*/.test(nextLine)) { + if (/^\s*\*/.test(line)) { + return { + text: text + indent + "* ", + selection: [1, 2 + indent.length, 1, 2 + indent.length] + }; + } + else { + return { + text: text + indent + " * ", + selection: [1, 3 + indent.length, 1, 3 + indent.length] + }; + } + } + if (/\/\*\*/.test(line.substring(0, cursor.column))) { + return { + text: text + indent + " * " + text + " " + indent + "*/", + selection: [1, 4 + indent.length, 1, 4 + indent.length] + }; + } + } + }); + } }; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { +CstyleBehaviour.isSaneInsertion = function (editor, session) { var cursor = editor.getCursorPosition(); var iterator = new TokenIterator(session, cursor.row, cursor.column); if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { @@ -25222,69 +24540,57 @@ CstyleBehaviour.isSaneInsertion = function(editor, session) { return iterator.getCurrentTokenRow() !== cursor.row || this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); }; - -CstyleBehaviour.$matchTokenType = function(token, types) { +CstyleBehaviour["$matchTokenType"] = function (token, types) { return types.indexOf(token.type || token) > -1; }; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { +CstyleBehaviour["recordAutoInsert"] = function (editor, session, bracket) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) + if (!this["isAutoInsertedClosing"](cursor, line, context.autoInsertedLineEnd[0])) context.autoInsertedBrackets = 0; context.autoInsertedRow = cursor.row; context.autoInsertedLineEnd = bracket + line.substr(cursor.column); context.autoInsertedBrackets++; }; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { +CstyleBehaviour["recordMaybeInsert"] = function (editor, session, bracket) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) + if (!this["isMaybeInsertedClosing"](cursor, line)) context.maybeInsertedBrackets = 0; context.maybeInsertedRow = cursor.row; context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; context.maybeInsertedLineEnd = line.substr(cursor.column); context.maybeInsertedBrackets++; }; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { +CstyleBehaviour["isAutoInsertedClosing"] = function (cursor, line, bracket) { return context.autoInsertedBrackets > 0 && cursor.row === context.autoInsertedRow && bracket === context.autoInsertedLineEnd[0] && line.substr(cursor.column) === context.autoInsertedLineEnd; }; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { +CstyleBehaviour["isMaybeInsertedClosing"] = function (cursor, line) { return context.maybeInsertedBrackets > 0 && cursor.row === context.maybeInsertedRow && line.substr(cursor.column) === context.maybeInsertedLineEnd && line.substr(0, cursor.column) == context.maybeInsertedLineStart; }; - -CstyleBehaviour.popAutoInsertedClosing = function() { +CstyleBehaviour["popAutoInsertedClosing"] = function () { context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); context.autoInsertedBrackets--; }; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { +CstyleBehaviour["clearMaybeInsertedClosing"] = function () { if (context) { context.maybeInsertedBrackets = 0; context.maybeInsertedRow = -1; } }; - - - oop.inherits(CstyleBehaviour, Behaviour); - exports.CstyleBehaviour = CstyleBehaviour; -}); -ace.define("ace/unicode",["require","exports","module"], function(require, exports, module) { -"use strict"; -var wordChars = [48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2]; +}); +ace.define("ace/unicode",["require","exports","module"], function(require, exports, module){"use strict"; +var wordChars = [48, 9, 8, 25, 5, 0, 2, 25, 48, 0, 11, 0, 5, 0, 6, 22, 2, 30, 2, 457, 5, 11, 15, 4, 8, 0, 2, 0, 18, 116, 2, 1, 3, 3, 9, 0, 2, 2, 2, 0, 2, 19, 2, 82, 2, 138, 2, 4, 3, 155, 12, 37, 3, 0, 8, 38, 10, 44, 2, 0, 2, 1, 2, 1, 2, 0, 9, 26, 6, 2, 30, 10, 7, 61, 2, 9, 5, 101, 2, 7, 3, 9, 2, 18, 3, 0, 17, 58, 3, 100, 15, 53, 5, 0, 6, 45, 211, 57, 3, 18, 2, 5, 3, 11, 3, 9, 2, 1, 7, 6, 2, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 0, 4, 3, 3, 8, 3, 1, 3, 3, 9, 0, 5, 1, 2, 4, 3, 11, 16, 2, 2, 5, 5, 1, 3, 21, 2, 6, 2, 1, 2, 1, 2, 1, 3, 0, 2, 4, 5, 1, 3, 2, 4, 0, 8, 3, 2, 0, 8, 15, 12, 2, 2, 8, 2, 2, 2, 21, 2, 6, 2, 1, 2, 4, 3, 9, 2, 2, 2, 2, 3, 0, 16, 3, 3, 9, 18, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 3, 8, 3, 1, 3, 2, 9, 1, 5, 1, 2, 4, 3, 9, 2, 0, 17, 1, 2, 5, 4, 2, 2, 3, 4, 1, 2, 0, 2, 1, 4, 1, 4, 2, 4, 11, 5, 4, 4, 2, 2, 3, 3, 0, 7, 0, 15, 9, 18, 2, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 4, 7, 2, 2, 2, 3, 8, 1, 2, 1, 7, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 3, 8, 2, 2, 2, 3, 8, 1, 8, 0, 2, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 15, 4, 7, 2, 2, 2, 3, 10, 0, 9, 3, 3, 9, 11, 5, 3, 1, 2, 17, 4, 23, 2, 8, 2, 0, 3, 6, 4, 0, 5, 5, 2, 0, 2, 7, 19, 1, 14, 57, 6, 14, 2, 9, 40, 1, 2, 0, 3, 1, 2, 0, 3, 0, 7, 3, 2, 6, 2, 2, 2, 0, 2, 0, 3, 1, 2, 12, 2, 2, 3, 4, 2, 0, 2, 5, 3, 9, 3, 1, 35, 0, 24, 1, 7, 9, 12, 0, 2, 0, 2, 0, 5, 9, 2, 35, 5, 19, 2, 5, 5, 7, 2, 35, 10, 0, 58, 73, 7, 77, 3, 37, 11, 42, 2, 0, 4, 328, 2, 3, 3, 6, 2, 0, 2, 3, 3, 40, 2, 3, 3, 32, 2, 3, 3, 6, 2, 0, 2, 3, 3, 14, 2, 56, 2, 3, 3, 66, 5, 0, 33, 15, 17, 84, 13, 619, 3, 16, 2, 25, 6, 74, 22, 12, 2, 6, 12, 20, 12, 19, 13, 12, 2, 2, 2, 1, 13, 51, 3, 29, 4, 0, 5, 1, 3, 9, 34, 2, 3, 9, 7, 87, 9, 42, 6, 69, 11, 28, 4, 11, 5, 11, 11, 39, 3, 4, 12, 43, 5, 25, 7, 10, 38, 27, 5, 62, 2, 28, 3, 10, 7, 9, 14, 0, 89, 75, 5, 9, 18, 8, 13, 42, 4, 11, 71, 55, 9, 9, 4, 48, 83, 2, 2, 30, 14, 230, 23, 280, 3, 5, 3, 37, 3, 5, 3, 7, 2, 0, 2, 0, 2, 0, 2, 30, 3, 52, 2, 6, 2, 0, 4, 2, 2, 6, 4, 3, 3, 5, 5, 12, 6, 2, 2, 6, 67, 1, 20, 0, 29, 0, 14, 0, 17, 4, 60, 12, 5, 0, 4, 11, 18, 0, 5, 0, 3, 9, 2, 0, 4, 4, 7, 0, 2, 0, 2, 0, 2, 3, 2, 10, 3, 3, 6, 4, 5, 0, 53, 1, 2684, 46, 2, 46, 2, 132, 7, 6, 15, 37, 11, 53, 10, 0, 17, 22, 10, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 31, 48, 0, 470, 1, 36, 5, 2, 4, 6, 1, 5, 85, 3, 1, 3, 2, 2, 89, 2, 3, 6, 40, 4, 93, 18, 23, 57, 15, 513, 6581, 75, 20939, 53, 1164, 68, 45, 3, 268, 4, 27, 21, 31, 3, 13, 13, 1, 2, 24, 9, 69, 11, 1, 38, 8, 3, 102, 3, 1, 111, 44, 25, 51, 13, 68, 12, 9, 7, 23, 4, 0, 5, 45, 3, 35, 13, 28, 4, 64, 15, 10, 39, 54, 10, 13, 3, 9, 7, 22, 4, 1, 5, 66, 25, 2, 227, 42, 2, 1, 3, 9, 7, 11171, 13, 22, 5, 48, 8453, 301, 3, 61, 3, 105, 39, 6, 13, 4, 6, 11, 2, 12, 2, 4, 2, 0, 2, 1, 2, 1, 2, 107, 34, 362, 19, 63, 3, 53, 41, 11, 5, 15, 17, 6, 13, 1, 25, 2, 33, 4, 2, 134, 20, 9, 8, 25, 5, 0, 2, 25, 12, 88, 4, 5, 3, 5, 3, 5, 3, 2]; var code = 0; var str = []; for (var i = 0; i < wordChars.length; i += 2) { @@ -25292,15 +24598,12 @@ for (var i = 0; i < wordChars.length; i += 2) { if (wordChars[i + 1]) str.push(45, code += wordChars[i + 1]); } - exports.wordChars = String.fromCharCode.apply(null, str); }); -ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"], function(require, exports, module) { -"use strict"; +ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"], function(require, exports, module){"use strict"; var config = require("../config"); - var Tokenizer = require("../tokenizer").Tokenizer; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; @@ -25308,38 +24611,30 @@ var unicode = require("../unicode"); var lang = require("../lib/lang"); var TokenIterator = require("../token_iterator").TokenIterator; var Range = require("../range").Range; - -var Mode = function() { +var Mode; +Mode = function () { this.HighlightRules = TextHighlightRules; }; - -(function() { +(function () { this.$defaultBehaviour = new CstyleBehaviour(); - this.tokenRe = new RegExp("^[" + unicode.wordChars + "\\$_]+", "g"); - this.nonTokenRe = new RegExp("^(?:[^" + unicode.wordChars + "\\$_]|\\s])+", "g"); - - this.getTokenizer = function() { + this.getTokenizer = function () { if (!this.$tokenizer) { this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig); this.$tokenizer = new Tokenizer(this.$highlightRules.getRules()); } return this.$tokenizer; }; - this.lineCommentStart = ""; this.blockComment = ""; - - this.toggleCommentLines = function(state, session, startRow, endRow) { + this.toggleCommentLines = function (state, session, startRow, endRow) { var doc = session.doc; - var ignoreBlankLines = true; var shouldRemove = true; var minIndent = Infinity; var tabSize = session.getTabSize(); var insertAtTabStop = false; - if (!this.lineCommentStart) { if (!this.blockComment) return false; @@ -25347,25 +24642,22 @@ var Mode = function() { var lineCommentEnd = this.blockComment.end; var regexpStart = new RegExp("^(\\s*)(?:" + lang.escapeRegExp(lineCommentStart) + ")"); var regexpEnd = new RegExp("(?:" + lang.escapeRegExp(lineCommentEnd) + ")\\s*$"); - - var comment = function(line, i) { + var comment = function (line, i) { if (testRemove(line, i)) return; if (!ignoreBlankLines || /\S/.test(line)) { - doc.insertInLine({row: i, column: line.length}, lineCommentEnd); - doc.insertInLine({row: i, column: minIndent}, lineCommentStart); + doc.insertInLine({ row: i, column: line.length }, lineCommentEnd); + doc.insertInLine({ row: i, column: minIndent }, lineCommentStart); } }; - - var uncomment = function(line, i) { + var uncomment = function (line, i) { var m; if (m = line.match(regexpEnd)) doc.removeInLine(i, line.length - m[0].length, line.length); if (m = line.match(regexpStart)) doc.removeInLine(i, m[1].length, m[0].length); }; - - var testRemove = function(line, row) { + var testRemove = function (line, row) { if (regexpStart.test(line)) return true; var tokens = session.getTokens(row); @@ -25374,40 +24666,40 @@ var Mode = function() { return true; } }; - } else { + } + else { if (Array.isArray(this.lineCommentStart)) { var regexpStart = this.lineCommentStart.map(lang.escapeRegExp).join("|"); var lineCommentStart = this.lineCommentStart[0]; - } else { + } + else { var regexpStart = lang.escapeRegExp(this.lineCommentStart); var lineCommentStart = this.lineCommentStart; } regexpStart = new RegExp("^(\\s*)(?:" + regexpStart + ") ?"); - insertAtTabStop = session.getUseSoftTabs(); - - var uncomment = function(line, i) { + var uncomment = function (line, i) { var m = line.match(regexpStart); - if (!m) return; + if (!m) + return; var start = m[1].length, end = m[0].length; if (!shouldInsertSpace(line, start, end) && m[0][end - 1] == " ") end--; doc.removeInLine(i, start, end); }; var commentWithSpace = lineCommentStart + " "; - var comment = function(line, i) { + var comment = function (line, i) { if (!ignoreBlankLines || /\S/.test(line)) { if (shouldInsertSpace(line, minIndent, minIndent)) - doc.insertInLine({row: i, column: minIndent}, commentWithSpace); + doc.insertInLine({ row: i, column: minIndent }, commentWithSpace); else - doc.insertInLine({row: i, column: minIndent}, lineCommentStart); + doc.insertInLine({ row: i, column: minIndent }, lineCommentStart); } }; - var testRemove = function(line, i) { + var testRemove = function (line, i) { return regexpStart.test(line); }; - - var shouldInsertSpace = function(line, before, after) { + var shouldInsertSpace = function (line, before, after) { var spaces = 0; while (before-- && line.charAt(before) == " ") spaces++; @@ -25422,52 +24714,43 @@ var Mode = function() { return spaces % tabSize == 0; }; } - function iter(fun) { for (var i = startRow; i <= endRow; i++) fun(doc.getLine(i), i); } - - var minEmptyLength = Infinity; - iter(function(line, i) { + iter(function (line, i) { var indent = line.search(/\S/); if (indent !== -1) { if (indent < minIndent) minIndent = indent; if (shouldRemove && !testRemove(line, i)) shouldRemove = false; - } else if (minEmptyLength > line.length) { + } + else if (minEmptyLength > line.length) { minEmptyLength = line.length; } }); - if (minIndent == Infinity) { minIndent = minEmptyLength; ignoreBlankLines = false; shouldRemove = false; } - if (insertAtTabStop && minIndent % tabSize != 0) minIndent = Math.floor(minIndent / tabSize) * tabSize; - iter(shouldRemove ? uncomment : comment); }; - - this.toggleBlockComment = function(state, session, range, cursor) { + this.toggleBlockComment = function (state, session, range, cursor) { var comment = this.blockComment; if (!comment) return; if (!comment.start && comment[0]) comment = comment[0]; - var iterator = new TokenIterator(session, cursor.row, cursor.column); var token = iterator.getCurrentToken(); - var sel = session.selection; var initialRange = session.selection.toOrientedRange(); var startRow, colDiff; - if (token && /comment/.test(token.type)) { var startRange, endRange; while (token && /comment/.test(token.type)) { @@ -25480,7 +24763,6 @@ var Mode = function() { } token = iterator.stepBackward(); } - var iterator = new TokenIterator(session, cursor.row, cursor.column); var token = iterator.getCurrentToken(); while (token && /comment/.test(token.type)) { @@ -25500,7 +24782,8 @@ var Mode = function() { startRow = startRange.start.row; colDiff = -comment.start.length; } - } else { + } + else { colDiff = comment.start.length; startRow = range.start.row; session.insert(range.end, comment.end); @@ -25512,26 +24795,20 @@ var Mode = function() { initialRange.end.column += colDiff; session.selection.fromOrientedRange(initialRange); }; - - this.getNextLineIndent = function(state, line, tab) { + this.getNextLineIndent = function (state, line, tab) { return this.$getIndent(line); }; - - this.checkOutdent = function(state, line, input) { + this.checkOutdent = function (state, line, input) { return false; }; - - this.autoOutdent = function(state, doc, row) { + this.autoOutdent = function (state, doc, row) { }; - - this.$getIndent = function(line) { + this.$getIndent = function (line) { return line.match(/^\s*/)[0]; }; - - this.createWorker = function(session) { + this.createWorker = function (session) { return null; }; - this.createModeDelegates = function (mapping) { this.$embeds = []; this.$modes = {}; @@ -25548,22 +24825,24 @@ var Mode = function() { this.$modes[i] = mode; } } - var delegations = ["toggleBlockComment", "toggleCommentLines", "getNextLineIndent", "checkOutdent", "autoOutdent", "transformAction", "getCompletions"]; - + var _loop_1 = function (i) { + (function (scope) { + var functionName = delegations[i]; + var defaultHandler = scope[functionName]; + scope[delegations[i]] = + function () { + return this.$delegator(functionName, arguments, defaultHandler); + }; + }(this_1)); + }; + var this_1 = this; for (var i = 0; i < delegations.length; i++) { - (function(scope) { - var functionName = delegations[i]; - var defaultHandler = scope[functionName]; - scope[delegations[i]] = function() { - return this.$delegator(functionName, arguments, defaultHandler); - }; - }(this)); + _loop_1(i); } }; - - this.$delegator = function(method, args, defaultHandler) { + this.$delegator = function (method, args, defaultHandler) { var state = args[0] || "start"; if (typeof state != "string") { if (Array.isArray(state[2])) { @@ -25574,10 +24853,9 @@ var Mode = function() { } state = state[0] || "start"; } - for (var i = 0; i < this.$embeds.length; i++) { - if (!this.$modes[this.$embeds[i]]) continue; - + if (!this.$modes[this.$embeds[i]]) + continue; var split = state.split(this.$embeds[i]); if (!split[0] && split[1]) { args[0] = split[1]; @@ -25588,8 +24866,7 @@ var Mode = function() { var ret = defaultHandler.apply(this, args); return defaultHandler ? ret : undefined; }; - - this.transformAction = function(state, action, editor, session, param) { + this.transformAction = function (state, action, editor, session, param) { if (this.$behaviour) { var behaviours = this.$behaviour.getBehaviours(); for (var key in behaviours) { @@ -25602,10 +24879,9 @@ var Mode = function() { } } }; - - this.getKeywords = function(append) { + this.getKeywords = function (append) { if (!this.completionKeywords) { - var rules = this.$tokenizer.rules; + var rules = this.$tokenizer["rules"]; var completionKeywords = []; for (var rule in rules) { var ruleItr = rules[rule]; @@ -25630,16 +24906,14 @@ var Mode = function() { return this.$keywordList; return completionKeywords.concat(this.$keywordList || []); }; - - this.$createKeywordList = function() { + this.$createKeywordList = function () { if (!this.$highlightRules) this.getTokenizer(); return this.$keywordList = this.$highlightRules.$keywordList || []; }; - - this.getCompletions = function(state, session, pos, prefix) { + this.getCompletions = function (state, session, pos, prefix) { var keywords = this.$keywordList || this.$createKeywordList(); - return keywords.map(function(word) { + return keywords.map(function (word) { return { name: word, value: word, @@ -25648,33 +24922,28 @@ var Mode = function() { }; }); }; - this.$id = "ace/mode/text"; }).call(Mode.prototype); - exports.Mode = Mode; -}); -ace.define("ace/apply_delta",["require","exports","module"], function(require, exports, module) { -"use strict"; +}); -function throwDeltaError(delta, errorText){ +ace.define("ace/apply_delta",["require","exports","module"], function(require, exports, module){"use strict"; +function throwDeltaError(delta, errorText) { console.log("Invalid Delta:", delta); throw "Invalid Delta: " + errorText; } - function positionInDocument(docLines, position) { - return position.row >= 0 && position.row < docLines.length && - position.column >= 0 && position.column <= docLines[position.row].length; + return position.row >= 0 && position.row < docLines.length && + position.column >= 0 && position.column <= docLines[position.row].length; } - function validateDelta(docLines, delta) { if (delta.action != "insert" && delta.action != "remove") throwDeltaError(delta, "delta.action must be 'insert' or 'remove'"); if (!(delta.lines instanceof Array)) throwDeltaError(delta, "delta.lines must be an Array"); if (!delta.start || !delta.end) - throwDeltaError(delta, "delta.start/end must be an present"); + throwDeltaError(delta, "delta.start/end must be an present"); var start = delta.start; if (!positionInDocument(docLines, delta.start)) throwDeltaError(delta, "delta.start must be contained in document"); @@ -25686,9 +24955,7 @@ function validateDelta(docLines, delta) { if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars) throwDeltaError(delta, "delta.range must match delta lines"); } - -exports.applyDelta = function(docLines, delta, doNotValidate) { - +exports.applyDelta = function (docLines, delta, doNotValidate) { var row = delta.start.row; var startColumn = delta.start.column; var line = docLines[row] || ""; @@ -25697,7 +24964,8 @@ exports.applyDelta = function(docLines, delta, doNotValidate) { var lines = delta.lines; if (lines.length === 1) { docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn); - } else { + } + else { var args = [row, 1].concat(delta.lines); docLines.splice.apply(docLines, args); docLines[row] = line.substring(0, startColumn) + docLines[row]; @@ -25709,102 +24977,59 @@ exports.applyDelta = function(docLines, delta, doNotValidate) { var endRow = delta.end.row; if (row === endRow) { docLines[row] = line.substring(0, startColumn) + line.substring(endColumn); - } else { - docLines.splice( - row, endRow - row + 1, - line.substring(0, startColumn) + docLines[endRow].substring(endColumn) - ); + } + else { + docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn)); } break; } }; -}); -ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module){"use strict"; var oop = require("./lib/oop"); var EventEmitter = require("./lib/event_emitter").EventEmitter; - -var Anchor = exports.Anchor = function(doc, row, column) { - this.$onChange = this.onChange.bind(this); - this.attach(doc); - - if (typeof column == "undefined") - this.setPosition(row.row, row.column); - else - this.setPosition(row, column); -}; - -(function() { - - oop.implement(this, EventEmitter); - this.getPosition = function() { +var Anchor = /** @class */ (function () { + function Anchor(doc, row, column) { + this.$onChange = this.onChange.bind(this); + this.attach(doc); + if (typeof row != "number") + this.setPosition(row.row, row.column); + else + this.setPosition(row, column); + } + Anchor.prototype.getPosition = function () { return this.$clipPositionToDocument(this.row, this.column); }; - this.getDocument = function() { + Anchor.prototype.getDocument = function () { return this.document; }; - this.$insertRight = false; - this.onChange = function(delta) { + Anchor.prototype.onChange = function (delta) { if (delta.start.row == delta.end.row && delta.start.row != this.row) return; - if (delta.start.row > this.row) return; - - var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight); + var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight); this.setPosition(point.row, point.column, true); }; - - function $pointsInOrder(point1, point2, equalPointsInOrder) { - var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column; - return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter); - } - - function $getTransformedPoint(delta, point, moveIfEqual) { - var deltaIsInsert = delta.action == "insert"; - var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row); - var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column); - var deltaStart = delta.start; - var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range. - if ($pointsInOrder(point, deltaStart, moveIfEqual)) { - return { - row: point.row, - column: point.column - }; - } - if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) { - return { - row: point.row + deltaRowShift, - column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0) - }; - } - - return { - row: deltaStart.row, - column: deltaStart.column - }; - } - this.setPosition = function(row, column, noClip) { + Anchor.prototype.setPosition = function (row, column, noClip) { var pos; if (noClip) { pos = { row: row, column: column }; - } else { + } + else { pos = this.$clipPositionToDocument(row, column); } - if (this.row == pos.row && this.column == pos.column) return; - var old = { row: this.row, column: this.column }; - this.row = pos.row; this.column = pos.column; this._signal("change", { @@ -25812,16 +25037,15 @@ var Anchor = exports.Anchor = function(doc, row, column) { value: pos }); }; - this.detach = function() { + Anchor.prototype.detach = function () { this.document.off("change", this.$onChange); }; - this.attach = function(doc) { + Anchor.prototype.attach = function (doc) { this.document = doc || this.document; this.document.on("change", this.$onChange); }; - this.$clipPositionToDocument = function(row, column) { + Anchor.prototype.$clipPositionToDocument = function (row, column) { var pos = {}; - if (row >= this.document.getLength()) { pos.row = Math.max(0, this.document.getLength() - 1); pos.column = this.document.getLine(pos.row).length; @@ -25834,113 +25058,123 @@ var Anchor = exports.Anchor = function(doc, row, column) { pos.row = row; pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); } - if (column < 0) pos.column = 0; - return pos; }; - -}).call(Anchor.prototype); + return Anchor; +}()); +Anchor.prototype.$insertRight = false; +oop.implement(Anchor.prototype, EventEmitter); +function $pointsInOrder(point1, point2, equalPointsInOrder) { + var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column; + return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter); +} +function $getTransformedPoint(delta, point, moveIfEqual) { + var deltaIsInsert = delta.action == "insert"; + var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row); + var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column); + var deltaStart = delta.start; + var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range. + if ($pointsInOrder(point, deltaStart, moveIfEqual)) { + return { + row: point.row, + column: point.column + }; + } + if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) { + return { + row: point.row + deltaRowShift, + column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0) + }; + } + return { + row: deltaStart.row, + column: deltaStart.column + }; +} +exports.Anchor = Anchor; }); -ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"], function(require, exports, module) { -"use strict"; - +ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"], function(require, exports, module){"use strict"; var oop = require("./lib/oop"); var applyDelta = require("./apply_delta").applyDelta; var EventEmitter = require("./lib/event_emitter").EventEmitter; var Range = require("./range").Range; var Anchor = require("./anchor").Anchor; - -var Document = function(textOrLines) { - this.$lines = [""]; - if (textOrLines.length === 0) { +var Document = /** @class */ (function () { + function Document(textOrLines) { this.$lines = [""]; - } else if (Array.isArray(textOrLines)) { - this.insertMergedLines({row: 0, column: 0}, textOrLines); - } else { - this.insert({row: 0, column:0}, textOrLines); + if (textOrLines.length === 0) { + this.$lines = [""]; + } + else if (Array.isArray(textOrLines)) { + this.insertMergedLines({ row: 0, column: 0 }, textOrLines); + } + else { + this.insert({ row: 0, column: 0 }, textOrLines); + } } -}; - -(function() { - - oop.implement(this, EventEmitter); - this.setValue = function(text) { + Document.prototype.setValue = function (text) { var len = this.getLength() - 1; this.remove(new Range(0, 0, len, this.getLine(len).length)); - this.insert({row: 0, column: 0}, text); + this.insert({ row: 0, column: 0 }, text || ""); }; - this.getValue = function() { + Document.prototype.getValue = function () { return this.getAllLines().join(this.getNewLineCharacter()); }; - this.createAnchor = function(row, column) { + Document.prototype.createAnchor = function (row, column) { return new Anchor(this, row, column); }; - if ("aaa".split(/a/).length === 0) { - this.$split = function(text) { - return text.replace(/\r\n|\r/g, "\n").split("\n"); - }; - } else { - this.$split = function(text) { - return text.split(/\r\n|\r|\n/); - }; - } - - - this.$detectNewLine = function(text) { + Document.prototype.$detectNewLine = function (text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); this.$autoNewLine = match ? match[1] : "\n"; this._signal("changeNewLineMode"); }; - this.getNewLineCharacter = function() { + Document.prototype.getNewLineCharacter = function () { switch (this.$newLineMode) { - case "windows": - return "\r\n"; - case "unix": - return "\n"; - default: - return this.$autoNewLine || "\n"; + case "windows": + return "\r\n"; + case "unix": + return "\n"; + default: + return this.$autoNewLine || "\n"; } }; - - this.$autoNewLine = ""; - this.$newLineMode = "auto"; - this.setNewLineMode = function(newLineMode) { + Document.prototype.setNewLineMode = function (newLineMode) { if (this.$newLineMode === newLineMode) return; - this.$newLineMode = newLineMode; this._signal("changeNewLineMode"); }; - this.getNewLineMode = function() { + Document.prototype.getNewLineMode = function () { return this.$newLineMode; }; - this.isNewLine = function(text) { + Document.prototype.isNewLine = function (text) { return (text == "\r\n" || text == "\r" || text == "\n"); }; - this.getLine = function(row) { + Document.prototype.getLine = function (row) { return this.$lines[row] || ""; }; - this.getLines = function(firstRow, lastRow) { + Document.prototype.getLines = function (firstRow, lastRow) { return this.$lines.slice(firstRow, lastRow + 1); }; - this.getAllLines = function() { + Document.prototype.getAllLines = function () { return this.getLines(0, this.getLength()); }; - this.getLength = function() { + Document.prototype.getLength = function () { return this.$lines.length; }; - this.getTextRange = function(range) { + Document.prototype.getTextRange = function (range) { return this.getLinesForRange(range).join(this.getNewLineCharacter()); }; - this.getLinesForRange = function(range) { + Document.prototype.getLinesForRange = function (range) { var lines; if (range.start.row === range.end.row) { lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)]; - } else { + } + else { lines = this.getLines(range.start.row, range.end.row); lines[0] = (lines[0] || "").substring(range.start.column); var l = lines.length - 1; @@ -25949,45 +25183,43 @@ var Document = function(textOrLines) { } return lines; }; - this.insertLines = function(row, lines) { + Document.prototype.insertLines = function (row, lines) { console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."); return this.insertFullLines(row, lines); }; - this.removeLines = function(firstRow, lastRow) { + Document.prototype.removeLines = function (firstRow, lastRow) { console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."); return this.removeFullLines(firstRow, lastRow); }; - this.insertNewLine = function(position) { + Document.prototype.insertNewLine = function (position) { console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."); return this.insertMergedLines(position, ["", ""]); }; - this.insert = function(position, text) { + Document.prototype.insert = function (position, text) { if (this.getLength() <= 1) this.$detectNewLine(text); - return this.insertMergedLines(position, this.$split(text)); }; - this.insertInLine = function(position, text) { + Document.prototype.insertInLine = function (position, text) { var start = this.clippedPos(position.row, position.column); var end = this.pos(position.row, position.column + text.length); - this.applyDelta({ start: start, end: end, action: "insert", lines: [text] }, true); - return this.clonePos(end); }; - - this.clippedPos = function(row, column) { + Document.prototype.clippedPos = function (row, column) { var length = this.getLength(); if (row === undefined) { row = length; - } else if (row < 0) { + } + else if (row < 0) { row = 0; - } else if (row >= length) { + } + else if (row >= length) { row = length - 1; column = undefined; } @@ -25995,93 +25227,87 @@ var Document = function(textOrLines) { if (column == undefined) column = line.length; column = Math.min(Math.max(column, 0), line.length); - return {row: row, column: column}; + return { row: row, column: column }; }; - - this.clonePos = function(pos) { - return {row: pos.row, column: pos.column}; + Document.prototype.clonePos = function (pos) { + return { row: pos.row, column: pos.column }; }; - - this.pos = function(row, column) { - return {row: row, column: column}; + Document.prototype.pos = function (row, column) { + return { row: row, column: column }; }; - - this.$clipPosition = function(position) { + Document.prototype.$clipPosition = function (position) { var length = this.getLength(); if (position.row >= length) { position.row = Math.max(0, length - 1); position.column = this.getLine(length - 1).length; - } else { + } + else { position.row = Math.max(0, position.row); position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length); } return position; }; - this.insertFullLines = function(row, lines) { + Document.prototype.insertFullLines = function (row, lines) { row = Math.min(Math.max(row, 0), this.getLength()); var column = 0; if (row < this.getLength()) { lines = lines.concat([""]); column = 0; - } else { + } + else { lines = [""].concat(lines); row--; column = this.$lines[row].length; } - this.insertMergedLines({row: row, column: column}, lines); + this.insertMergedLines({ row: row, column: column }, lines); }; - this.insertMergedLines = function(position, lines) { + Document.prototype.insertMergedLines = function (position, lines) { var start = this.clippedPos(position.row, position.column); var end = { row: start.row + lines.length - 1, column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length }; - this.applyDelta({ start: start, end: end, action: "insert", lines: lines }); - return this.clonePos(end); }; - this.remove = function(range) { + Document.prototype.remove = function (range) { var start = this.clippedPos(range.start.row, range.start.column); var end = this.clippedPos(range.end.row, range.end.column); this.applyDelta({ start: start, end: end, action: "remove", - lines: this.getLinesForRange({start: start, end: end}) + lines: this.getLinesForRange({ start: start, end: end }) }); return this.clonePos(start); }; - this.removeInLine = function(row, startColumn, endColumn) { + Document.prototype.removeInLine = function (row, startColumn, endColumn) { var start = this.clippedPos(row, startColumn); var end = this.clippedPos(row, endColumn); - this.applyDelta({ start: start, end: end, action: "remove", - lines: this.getLinesForRange({start: start, end: end}) + lines: this.getLinesForRange({ start: start, end: end }) }, true); - return this.clonePos(start); }; - this.removeFullLines = function(firstRow, lastRow) { + Document.prototype.removeFullLines = function (firstRow, lastRow) { firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1); - lastRow = Math.min(Math.max(0, lastRow ), this.getLength() - 1); + lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1); var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0; - var deleteLastNewLine = lastRow < this.getLength() - 1; - var startRow = ( deleteFirstNewLine ? firstRow - 1 : firstRow ); - var startCol = ( deleteFirstNewLine ? this.getLine(startRow).length : 0 ); - var endRow = ( deleteLastNewLine ? lastRow + 1 : lastRow ); - var endCol = ( deleteLastNewLine ? 0 : this.getLine(endRow).length ); + var deleteLastNewLine = lastRow < this.getLength() - 1; + var startRow = (deleteFirstNewLine ? firstRow - 1 : firstRow); + var startCol = (deleteFirstNewLine ? this.getLine(startRow).length : 0); + var endRow = (deleteLastNewLine ? lastRow + 1 : lastRow); + var endCol = (deleteLastNewLine ? 0 : this.getLine(endRow).length); var range = new Range(startRow, startCol, endRow, endCol); var deletedLines = this.$lines.slice(firstRow, lastRow + 1); - this.applyDelta({ start: range.start, end: range.end, @@ -26090,7 +25316,7 @@ var Document = function(textOrLines) { }); return deletedLines; }; - this.removeNewLine = function(row) { + Document.prototype.removeNewLine = function (row) { if (row < this.getLength() - 1 && row >= 0) { this.applyDelta({ start: this.pos(row, this.getLine(row).length), @@ -26099,403 +25325,856 @@ var Document = function(textOrLines) { lines: ["", ""] }); } - }; - this.replace = function(range, text) { - if (!(range instanceof Range)) - range = Range.fromPoints(range.start, range.end); - if (text.length === 0 && range.isEmpty()) - return range.start; - if (text == this.getTextRange(range)) - return range.end; - - this.remove(range); - var end; - if (text) { - end = this.insert(range.start, text); + }; + Document.prototype.replace = function (range, text) { + if (!(range instanceof Range)) + range = Range.fromPoints(range.start, range.end); + if (text.length === 0 && range.isEmpty()) + return range.start; + if (text == this.getTextRange(range)) + return range.end; + this.remove(range); + var end; + if (text) { + end = this.insert(range.start, text); + } + else { + end = range.start; + } + return end; + }; + Document.prototype.applyDeltas = function (deltas) { + for (var i = 0; i < deltas.length; i++) { + this.applyDelta(deltas[i]); + } + }; + Document.prototype.revertDeltas = function (deltas) { + for (var i = deltas.length - 1; i >= 0; i--) { + this.revertDelta(deltas[i]); + } + }; + Document.prototype.applyDelta = function (delta, doNotValidate) { + var isInsert = delta.action == "insert"; + if (isInsert ? delta.lines.length <= 1 && !delta.lines[0] + : !Range.comparePoints(delta.start, delta.end)) { + return; + } + if (isInsert && delta.lines.length > 20000) { + this.$splitAndapplyLargeDelta(delta, 20000); + } + else { + applyDelta(this.$lines, delta, doNotValidate); + this._signal("change", delta); + } + }; + Document.prototype.$safeApplyDelta = function (delta) { + var docLength = this.$lines.length; + if (delta.action == "remove" && delta.start.row < docLength && delta.end.row < docLength + || delta.action == "insert" && delta.start.row <= docLength) { + this.applyDelta(delta); + } + }; + Document.prototype.$splitAndapplyLargeDelta = function (delta, MAX) { + var lines = delta.lines; + var l = lines.length - MAX + 1; + var row = delta.start.row; + var column = delta.start.column; + for (var from = 0, to = 0; from < l; from = to) { + to += MAX - 1; + var chunk = lines.slice(from, to); + chunk.push(""); + this.applyDelta({ + start: this.pos(row + from, column), + end: this.pos(row + to, column = 0), + action: delta.action, + lines: chunk + }, true); + } + delta.lines = lines.slice(from); + delta.start.row = row + from; + delta.start.column = column; + this.applyDelta(delta, true); + }; + Document.prototype.revertDelta = function (delta) { + this.$safeApplyDelta({ + start: this.clonePos(delta.start), + end: this.clonePos(delta.end), + action: (delta.action == "insert" ? "remove" : "insert"), + lines: delta.lines.slice() + }); + }; + Document.prototype.indexToPosition = function (index, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + for (var i = startRow || 0, l = lines.length; i < l; i++) { + index -= lines[i].length + newlineLength; + if (index < 0) + return { row: i, column: index + lines[i].length + newlineLength }; + } + return { row: l - 1, column: index + lines[l - 1].length + newlineLength }; + }; + Document.prototype.positionToIndex = function (pos, startRow) { + var lines = this.$lines || this.getAllLines(); + var newlineLength = this.getNewLineCharacter().length; + var index = 0; + var row = Math.min(pos.row, lines.length); + for (var i = startRow || 0; i < row; ++i) + index += lines[i].length + newlineLength; + return index + pos.column; + }; + Document.prototype.$split = function (text) { + return text.split(/\r\n|\r|\n/); + }; + return Document; +}()); +Document.prototype.$autoNewLine = ""; +Document.prototype.$newLineMode = "auto"; +oop.implement(Document.prototype, EventEmitter); +exports.Document = Document; + +}); + +ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module){"use strict"; +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var BackgroundTokenizer = /** @class */ (function () { + function BackgroundTokenizer(tokenizer, session) { + this.running = false; + this.lines = []; + this.states = []; + this.currentLine = 0; + this.tokenizer = tokenizer; + var self = this; + this.$worker = function () { + if (!self.running) { + return; + } + var workerStart = new Date(); + var currentLine = self.currentLine; + var endLine = -1; + var doc = self.doc; + var startLine = currentLine; + while (self.lines[currentLine]) + currentLine++; + var len = doc.getLength(); + var processedLines = 0; + self.running = false; + while (currentLine < len) { + self.$tokenizeRow(currentLine); + endLine = currentLine; + do { + currentLine++; + } while (self.lines[currentLine]); + processedLines++; + if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) { + self.running = setTimeout(self.$worker, 20); + break; + } + } + self.currentLine = currentLine; + if (endLine == -1) + endLine = currentLine; + if (startLine <= endLine) + self.fireUpdateEvent(startLine, endLine); + }; + } + BackgroundTokenizer.prototype.setTokenizer = function (tokenizer) { + this.tokenizer = tokenizer; + this.lines = []; + this.states = []; + this.start(0); + }; + BackgroundTokenizer.prototype.setDocument = function (doc) { + this.doc = doc; + this.lines = []; + this.states = []; + this.stop(); + }; + BackgroundTokenizer.prototype.fireUpdateEvent = function (firstRow, lastRow) { + var data = { + first: firstRow, + last: lastRow + }; + this._signal("update", { data: data }); + }; + BackgroundTokenizer.prototype.start = function (startRow) { + this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength()); + this.lines.splice(this.currentLine, this.lines.length); + this.states.splice(this.currentLine, this.states.length); + this.stop(); + this.running = setTimeout(this.$worker, 700); + }; + BackgroundTokenizer.prototype.scheduleStart = function () { + if (!this.running) + this.running = setTimeout(this.$worker, 700); + }; + BackgroundTokenizer.prototype.$updateOnChange = function (delta) { + var startRow = delta.start.row; + var len = delta.end.row - startRow; + if (len === 0) { + this.lines[startRow] = null; + } + else if (delta.action == "remove") { + this.lines.splice(startRow, len + 1, null); + this.states.splice(startRow, len + 1, null); + } + else { + var args = Array(len + 1); + args.unshift(startRow, 1); + this.lines.splice.apply(this.lines, args); + this.states.splice.apply(this.states, args); + } + this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength()); + this.stop(); + }; + BackgroundTokenizer.prototype.stop = function () { + if (this.running) + clearTimeout(this.running); + this.running = false; + }; + BackgroundTokenizer.prototype.getTokens = function (row) { + return this.lines[row] || this.$tokenizeRow(row); + }; + BackgroundTokenizer.prototype.getState = function (row) { + if (this.currentLine == row) + this.$tokenizeRow(row); + return this.states[row] || "start"; + }; + BackgroundTokenizer.prototype.$tokenizeRow = function (row) { + var line = this.doc.getLine(row); + var state = this.states[row - 1]; + var data = this.tokenizer.getLineTokens(line, state, row); + if (this.states[row] + "" !== data.state + "") { + this.states[row] = data.state; + this.lines[row + 1] = null; + if (this.currentLine > row + 1) + this.currentLine = row + 1; + } + else if (this.currentLine == row) { + this.currentLine = row + 1; + } + return this.lines[row] = data.tokens; + }; + BackgroundTokenizer.prototype.cleanup = function () { + this.running = false; + this.lines = []; + this.states = []; + this.currentLine = 0; + this.removeAllListeners(); + }; + return BackgroundTokenizer; +}()); +oop.implement(BackgroundTokenizer.prototype, EventEmitter); +exports.BackgroundTokenizer = BackgroundTokenizer; + +}); + +ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"], function(require, exports, module){"use strict"; +var lang = require("./lib/lang"); +var Range = require("./range").Range; +var SearchHighlight = /** @class */ (function () { + function SearchHighlight(regExp, clazz, type) { + if (type === void 0) { type = "text"; } + this.setRegexp(regExp); + this.clazz = clazz; + this.type = type; + } + SearchHighlight.prototype.setRegexp = function (regExp) { + if (this.regExp + "" == regExp + "") + return; + this.regExp = regExp; + this.cache = []; + }; + SearchHighlight.prototype.update = function (html, markerLayer, session, config) { + if (!this.regExp) + return; + var start = config.firstRow, end = config.lastRow; + var renderedMarkerRanges = {}; + for (var i = start; i <= end; i++) { + var ranges = this.cache[i]; + if (ranges == null) { + ranges = lang.getMatchOffsets(session.getLine(i), this.regExp); + if (ranges.length > this.MAX_RANGES) + ranges = ranges.slice(0, this.MAX_RANGES); + ranges = ranges.map(function (match) { + return new Range(i, match.offset, i, match.offset + match.length); + }); + this.cache[i] = ranges.length ? ranges : ""; + } + for (var j = ranges.length; j--;) { + var rangeToAddMarkerTo = ranges[j].toScreenRange(session); + var rangeAsString = rangeToAddMarkerTo.toString(); + if (renderedMarkerRanges[rangeAsString]) + continue; + renderedMarkerRanges[rangeAsString] = true; + markerLayer.drawSingleLineMarker(html, rangeToAddMarkerTo, this.clazz, config); + } + } + }; + return SearchHighlight; +}()); +SearchHighlight.prototype.MAX_RANGES = 500; +exports.SearchHighlight = SearchHighlight; + +}); + +ace.define("ace/undomanager",["require","exports","module","ace/range"], function(require, exports, module){"use strict"; +var UndoManager = /** @class */ (function () { + function UndoManager() { + this.$keepRedoStack; + this.$maxRev = 0; + this.$fromUndo = false; + this.$undoDepth = Infinity; + this.reset(); + } + UndoManager.prototype.addSession = function (session) { + this.$session = session; + }; + UndoManager.prototype.add = function (delta, allowMerge, session) { + if (this.$fromUndo) + return; + if (delta == this.$lastDelta) + return; + if (!this.$keepRedoStack) + this.$redoStack.length = 0; + if (allowMerge === false || !this.lastDeltas) { + this.lastDeltas = []; + var undoStackLength = this.$undoStack.length; + if (undoStackLength > this.$undoDepth - 1) { + this.$undoStack.splice(0, undoStackLength - this.$undoDepth + 1); + } + this.$undoStack.push(this.lastDeltas); + delta.id = this.$rev = ++this.$maxRev; + } + if (delta.action == "remove" || delta.action == "insert") + this.$lastDelta = delta; + this.lastDeltas.push(delta); + }; + UndoManager.prototype.addSelection = function (selection, rev) { + this.selections.push({ + value: selection, + rev: rev || this.$rev + }); + }; + UndoManager.prototype.startNewGroup = function () { + this.lastDeltas = null; + return this.$rev; + }; + UndoManager.prototype.markIgnored = function (from, to) { + if (to == null) + to = this.$rev + 1; + var stack = this.$undoStack; + for (var i = stack.length; i--;) { + var delta = stack[i][0]; + if (delta.id <= from) + break; + if (delta.id < to) + delta.ignore = true; + } + this.lastDeltas = null; + }; + UndoManager.prototype.getSelection = function (rev, after) { + var stack = this.selections; + for (var i = stack.length; i--;) { + var selection = stack[i]; + if (selection.rev < rev) { + if (after) + selection = stack[i + 1]; + return selection; + } + } + }; + UndoManager.prototype.getRevision = function () { + return this.$rev; + }; + UndoManager.prototype.getDeltas = function (from, to) { + if (to == null) + to = this.$rev + 1; + var stack = this.$undoStack; + var end = null, start = 0; + for (var i = stack.length; i--;) { + var delta = stack[i][0]; + if (delta.id < to && !end) + end = i + 1; + if (delta.id <= from) { + start = i + 1; + break; + } + } + return stack.slice(start, end); + }; + UndoManager.prototype.getChangedRanges = function (from, to) { + if (to == null) + to = this.$rev + 1; + }; + UndoManager.prototype.getChangedLines = function (from, to) { + if (to == null) + to = this.$rev + 1; + }; + UndoManager.prototype.undo = function (session, dontSelect) { + this.lastDeltas = null; + var stack = this.$undoStack; + if (!rearrangeUndoStack(stack, stack.length)) + return; + if (!session) + session = this.$session; + if (this.$redoStackBaseRev !== this.$rev && this.$redoStack.length) + this.$redoStack = []; + this.$fromUndo = true; + var deltaSet = stack.pop(); + var undoSelectionRange = null; + if (deltaSet) { + undoSelectionRange = session.undoChanges(deltaSet, dontSelect); + this.$redoStack.push(deltaSet); + this.$syncRev(); + } + this.$fromUndo = false; + return undoSelectionRange; + }; + UndoManager.prototype.redo = function (session, dontSelect) { + this.lastDeltas = null; + if (!session) + session = this.$session; + this.$fromUndo = true; + if (this.$redoStackBaseRev != this.$rev) { + var diff = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1); + rebaseRedoStack(this.$redoStack, diff); + this.$redoStackBaseRev = this.$rev; + this.$redoStack.forEach(function (x) { + x[0].id = ++this.$maxRev; + }, this); + } + var deltaSet = this.$redoStack.pop(); + var redoSelectionRange = null; + if (deltaSet) { + redoSelectionRange = session.redoChanges(deltaSet, dontSelect); + this.$undoStack.push(deltaSet); + this.$syncRev(); + } + this.$fromUndo = false; + return redoSelectionRange; + }; + UndoManager.prototype.$syncRev = function () { + var stack = this.$undoStack; + var nextDelta = stack[stack.length - 1]; + var id = nextDelta && nextDelta[0].id || 0; + this.$redoStackBaseRev = id; + this.$rev = id; + }; + UndoManager.prototype.reset = function () { + this.lastDeltas = null; + this.$lastDelta = null; + this.$undoStack = []; + this.$redoStack = []; + this.$rev = 0; + this.mark = 0; + this.$redoStackBaseRev = this.$rev; + this.selections = []; + }; + UndoManager.prototype.canUndo = function () { + return this.$undoStack.length > 0; + }; + UndoManager.prototype.canRedo = function () { + return this.$redoStack.length > 0; + }; + UndoManager.prototype.bookmark = function (rev) { + if (rev == undefined) + rev = this.$rev; + this.mark = rev; + }; + UndoManager.prototype.isAtBookmark = function () { + return this.$rev === this.mark; + }; + UndoManager.prototype.toJSON = function () { + return { + $redoStack: this.$redoStack, + $undoStack: this.$undoStack + }; + }; + UndoManager.prototype.fromJSON = function (json) { + this.reset(); + this.$undoStack = json.$undoStack; + this.$redoStack = json.$redoStack; + }; + UndoManager.prototype.$prettyPrint = function (delta) { + if (delta) + return stringifyDelta(delta); + return stringifyDelta(this.$undoStack) + "\n---\n" + stringifyDelta(this.$redoStack); + }; + return UndoManager; +}()); +UndoManager.prototype.hasUndo = UndoManager.prototype.canUndo; +UndoManager.prototype.hasRedo = UndoManager.prototype.canRedo; +UndoManager.prototype.isClean = UndoManager.prototype.isAtBookmark; +UndoManager.prototype.markClean = UndoManager.prototype.bookmark; +function rearrangeUndoStack(stack, pos) { + for (var i = pos; i--;) { + var deltaSet = stack[i]; + if (deltaSet && !deltaSet[0].ignore) { + while (i < pos - 1) { + var swapped = swapGroups(stack[i], stack[i + 1]); + stack[i] = swapped[0]; + stack[i + 1] = swapped[1]; + i++; + } + return true; + } + } +} +var Range = require("./range").Range; +var cmp = Range.comparePoints; +var comparePoints = Range.comparePoints; +function $updateMarkers(delta) { + var isInsert = delta.action == "insert"; + var start = delta.start; + var end = delta.end; + var rowShift = (end.row - start.row) * (isInsert ? 1 : -1); + var colShift = (end.column - start.column) * (isInsert ? 1 : -1); + if (isInsert) + end = start; + for (var i in this.marks) { + var point = this.marks[i]; + var cmp = comparePoints(point, start); + if (cmp < 0) { + continue; // delta starts after the range + } + if (cmp === 0) { + if (isInsert) { + if (point.bias == 1) { + cmp = 1; + } + else { + point.bias == -1; + continue; + } + } + } + var cmp2 = isInsert ? cmp : comparePoints(point, end); + if (cmp2 > 0) { + point.row += rowShift; + point.column += point.row == end.row ? colShift : 0; + continue; + } + if (!isInsert && cmp2 <= 0) { + point.row = start.row; + point.column = start.column; + if (cmp2 === 0) + point.bias = 1; + } + } +} +function clonePos(pos) { + return { row: pos.row, column: pos.column }; +} +function cloneDelta(d) { + return { + start: clonePos(d.start), + end: clonePos(d.end), + action: d.action, + lines: d.lines.slice() + }; +} +function stringifyDelta(d) { + d = d || this; + if (Array.isArray(d)) { + return d.map(stringifyDelta).join("\n"); + } + var type = ""; + if (d.action) { + type = d.action == "insert" ? "+" : "-"; + type += "[" + d.lines + "]"; + } + else if (d.value) { + if (Array.isArray(d.value)) { + type = d.value.map(stringifyRange).join("\n"); + } + else { + type = stringifyRange(d.value); + } + } + if (d.start) { + type += stringifyRange(d); + } + if (d.id || d.rev) { + type += "\t(" + (d.id || d.rev) + ")"; + } + return type; +} +function stringifyRange(r) { + return r.start.row + ":" + r.start.column + + "=>" + r.end.row + ":" + r.end.column; +} +function swap(d1, d2) { + var i1 = d1.action == "insert"; + var i2 = d2.action == "insert"; + if (i1 && i2) { + if (cmp(d2.start, d1.end) >= 0) { + shift(d2, d1, -1); + } + else if (cmp(d2.start, d1.start) <= 0) { + shift(d1, d2, +1); } else { - end = range.start; + return null; } - - return end; - }; - this.applyDeltas = function(deltas) { - for (var i=0; i= 0) { + shift(d2, d1, -1); } - }; - this.revertDeltas = function(deltas) { - for (var i=deltas.length-1; i>=0; i--) { - this.revertDelta(deltas[i]); + else if (cmp(d2.end, d1.start) <= 0) { + shift(d1, d2, -1); } - }; - this.applyDelta = function(delta, doNotValidate) { - var isInsert = delta.action == "insert"; - if (isInsert ? delta.lines.length <= 1 && !delta.lines[0] - : !Range.comparePoints(delta.start, delta.end)) { - return; + else { + return null; } - - if (isInsert && delta.lines.length > 20000) { - this.$splitAndapplyLargeDelta(delta, 20000); + } + else if (!i1 && i2) { + if (cmp(d2.start, d1.start) >= 0) { + shift(d2, d1, +1); + } + else if (cmp(d2.start, d1.start) <= 0) { + shift(d1, d2, +1); } else { - applyDelta(this.$lines, delta, doNotValidate); - this._signal("change", delta); + return null; } - }; - - this.$safeApplyDelta = function(delta) { - var docLength = this.$lines.length; - if ( - delta.action == "remove" && delta.start.row < docLength && delta.end.row < docLength - || delta.action == "insert" && delta.start.row <= docLength - ) { - this.applyDelta(delta); + } + else if (!i1 && !i2) { + if (cmp(d2.start, d1.start) >= 0) { + shift(d2, d1, +1); } - }; - - this.$splitAndapplyLargeDelta = function(delta, MAX) { - var lines = delta.lines; - var l = lines.length - MAX + 1; - var row = delta.start.row; - var column = delta.start.column; - for (var from = 0, to = 0; from < l; from = to) { - to += MAX - 1; - var chunk = lines.slice(from, to); - chunk.push(""); - this.applyDelta({ - start: this.pos(row + from, column), - end: this.pos(row + to, column = 0), - action: delta.action, - lines: chunk - }, true); + else if (cmp(d2.end, d1.start) <= 0) { + shift(d1, d2, -1); } - delta.lines = lines.slice(from); - delta.start.row = row + from; - delta.start.column = column; - this.applyDelta(delta, true); - }; - this.revertDelta = function(delta) { - this.$safeApplyDelta({ - start: this.clonePos(delta.start), - end: this.clonePos(delta.end), - action: (delta.action == "insert" ? "remove" : "insert"), - lines: delta.lines.slice() - }); - }; - this.indexToPosition = function(index, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - for (var i = startRow || 0, l = lines.length; i < l; i++) { - index -= lines[i].length + newlineLength; - if (index < 0) - return {row: i, column: index + lines[i].length + newlineLength}; + else { + return null; } - return {row: l-1, column: index + lines[l-1].length + newlineLength}; - }; - this.positionToIndex = function(pos, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - var index = 0; - var row = Math.min(pos.row, lines.length); - for (var i = startRow || 0; i < row; ++i) - index += lines[i].length + newlineLength; - - return index + pos.column; - }; - -}).call(Document.prototype); - -exports.Document = Document; -}); - -ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - -var BackgroundTokenizer = function(tokenizer, editor) { - this.running = false; - this.lines = []; - this.states = []; - this.currentLine = 0; - this.tokenizer = tokenizer; - - var self = this; - - this.$worker = function() { - if (!self.running) { return; } - - var workerStart = new Date(); - var currentLine = self.currentLine; - var endLine = -1; - var doc = self.doc; - - var startLine = currentLine; - while (self.lines[currentLine]) - currentLine++; - - var len = doc.getLength(); - var processedLines = 0; - self.running = false; - while (currentLine < len) { - self.$tokenizeRow(currentLine); - endLine = currentLine; - do { - currentLine++; - } while (self.lines[currentLine]); - processedLines ++; - if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) { - self.running = setTimeout(self.$worker, 20); - break; + } + return [d2, d1]; +} +function swapGroups(ds1, ds2) { + for (var i = ds1.length; i--;) { + for (var j = 0; j < ds2.length; j++) { + if (!swap(ds1[i], ds2[j])) { + while (i < ds1.length) { + while (j--) { + swap(ds2[j], ds1[i]); + } + j = ds2.length; + i++; + } + return [ds1, ds2]; } } - self.currentLine = currentLine; - - if (endLine == -1) - endLine = currentLine; - - if (startLine <= endLine) - self.fireUpdateEvent(startLine, endLine); - }; -}; - -(function(){ - - oop.implement(this, EventEmitter); - this.setTokenizer = function(tokenizer) { - this.tokenizer = tokenizer; - this.lines = []; - this.states = []; - - this.start(0); - }; - this.setDocument = function(doc) { - this.doc = doc; - this.lines = []; - this.states = []; - - this.stop(); - }; - this.fireUpdateEvent = function(firstRow, lastRow) { - var data = { - first: firstRow, - last: lastRow - }; - this._signal("update", {data: data}); - }; - this.start = function(startRow) { - this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength()); - this.lines.splice(this.currentLine, this.lines.length); - this.states.splice(this.currentLine, this.states.length); - - this.stop(); - this.running = setTimeout(this.$worker, 700); - }; - - this.scheduleStart = function() { - if (!this.running) - this.running = setTimeout(this.$worker, 700); - }; - - this.$updateOnChange = function(delta) { - var startRow = delta.start.row; - var len = delta.end.row - startRow; - - if (len === 0) { - this.lines[startRow] = null; - } else if (delta.action == "remove") { - this.lines.splice(startRow, len + 1, null); - this.states.splice(startRow, len + 1, null); - } else { - var args = Array(len + 1); - args.unshift(startRow, 1); - this.lines.splice.apply(this.lines, args); - this.states.splice.apply(this.states, args); + } + ds1.selectionBefore = ds2.selectionBefore = + ds1.selectionAfter = ds2.selectionAfter = null; + return [ds2, ds1]; +} +function xform(d1, c1) { + var i1 = d1.action == "insert"; + var i2 = c1.action == "insert"; + if (i1 && i2) { + if (cmp(d1.start, c1.start) < 0) { + shift(c1, d1, 1); } - - this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength()); - - this.stop(); - }; - this.stop = function() { - if (this.running) - clearTimeout(this.running); - this.running = false; - }; - this.getTokens = function(row) { - return this.lines[row] || this.$tokenizeRow(row); - }; - this.getState = function(row) { - if (this.currentLine == row) - this.$tokenizeRow(row); - return this.states[row] || "start"; - }; - - this.$tokenizeRow = function(row) { - var line = this.doc.getLine(row); - var state = this.states[row - 1]; - - var data = this.tokenizer.getLineTokens(line, state, row); - - if (this.states[row] + "" !== data.state + "") { - this.states[row] = data.state; - this.lines[row + 1] = null; - if (this.currentLine > row + 1) - this.currentLine = row + 1; - } else if (this.currentLine == row) { - this.currentLine = row + 1; + else { + shift(d1, c1, 1); } - - return this.lines[row] = data.tokens; - }; - -}).call(BackgroundTokenizer.prototype); - -exports.BackgroundTokenizer = BackgroundTokenizer; -}); - -ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"], function(require, exports, module) { -"use strict"; - -var lang = require("./lib/lang"); -var oop = require("./lib/oop"); -var Range = require("./range").Range; - -var SearchHighlight = function(regExp, clazz, type) { - this.setRegexp(regExp); - this.clazz = clazz; - this.type = type || "text"; -}; - -(function() { - this.MAX_RANGES = 500; - - this.setRegexp = function(regExp) { - if (this.regExp+"" == regExp+"") - return; - this.regExp = regExp; - this.cache = []; - }; - - this.update = function(html, markerLayer, session, config) { - if (!this.regExp) - return; - var start = config.firstRow, end = config.lastRow; - - for (var i = start; i <= end; i++) { - var ranges = this.cache[i]; - if (ranges == null) { - ranges = lang.getMatchOffsets(session.getLine(i), this.regExp); - if (ranges.length > this.MAX_RANGES) - ranges = ranges.slice(0, this.MAX_RANGES); - ranges = ranges.map(function(match) { - return new Range(i, match.offset, i, match.offset + match.length); - }); - this.cache[i] = ranges.length ? ranges : ""; + } + else if (i1 && !i2) { + if (cmp(d1.start, c1.end) >= 0) { + shift(d1, c1, -1); + } + else if (cmp(d1.start, c1.start) <= 0) { + shift(c1, d1, +1); + } + else { + shift(d1, Range.fromPoints(c1.start, d1.start), -1); + shift(c1, d1, +1); + } + } + else if (!i1 && i2) { + if (cmp(c1.start, d1.end) >= 0) { + shift(c1, d1, -1); + } + else if (cmp(c1.start, d1.start) <= 0) { + shift(d1, c1, +1); + } + else { + shift(c1, Range.fromPoints(d1.start, c1.start), -1); + shift(d1, c1, +1); + } + } + else if (!i1 && !i2) { + if (cmp(c1.start, d1.end) >= 0) { + shift(c1, d1, -1); + } + else if (cmp(c1.end, d1.start) <= 0) { + shift(d1, c1, -1); + } + else { + var before, after; + if (cmp(d1.start, c1.start) < 0) { + before = d1; + d1 = splitDelta(d1, c1.start); } - - for (var j = ranges.length; j --; ) { - markerLayer.drawSingleLineMarker( - html, ranges[j].toScreenRange(session), this.clazz, config); + if (cmp(d1.end, c1.end) > 0) { + after = splitDelta(d1, c1.end); + } + shiftPos(c1.end, d1.start, d1.end, -1); + if (after && !before) { + d1.lines = after.lines; + d1.start = after.start; + d1.end = after.end; + after = d1; } + return [c1, before, after].filter(Boolean); } + } + return [c1, d1]; +} +function shift(d1, d2, dir) { + shiftPos(d1.start, d2.start, d2.end, dir); + shiftPos(d1.end, d2.start, d2.end, dir); +} +function shiftPos(pos, start, end, dir) { + if (pos.row == (dir == 1 ? start : end).row) { + pos.column += dir * (end.column - start.column); + } + pos.row += dir * (end.row - start.row); +} +function splitDelta(c, pos) { + var lines = c.lines; + var end = c.end; + c.end = clonePos(pos); + var rowsBefore = c.end.row - c.start.row; + var otherLines = lines.splice(rowsBefore, lines.length); + var col = rowsBefore ? pos.column : pos.column - c.start.column; + lines.push(otherLines[0].substring(0, col)); + otherLines[0] = otherLines[0].substr(col); + var rest = { + start: clonePos(pos), + end: end, + lines: otherLines, + action: c.action }; + return rest; +} +function moveDeltasByOne(redoStack, d) { + d = cloneDelta(d); + for (var j = redoStack.length; j--;) { + var deltaSet = redoStack[j]; + for (var i = 0; i < deltaSet.length; i++) { + var x = deltaSet[i]; + var xformed = xform(x, d); + d = xformed[0]; + if (xformed.length != 2) { + if (xformed[2]) { + deltaSet.splice(i + 1, 1, xformed[1], xformed[2]); + i++; + } + else if (!xformed[1]) { + deltaSet.splice(i, 1); + i--; + } + } + } + if (!deltaSet.length) { + redoStack.splice(j, 1); + } + } + return redoStack; +} +function rebaseRedoStack(redoStack, deltaSets) { + for (var i = 0; i < deltaSets.length; i++) { + var deltas = deltaSets[i]; + for (var j = 0; j < deltas.length; j++) { + moveDeltasByOne(redoStack, deltas[j]); + } + } +} +exports.UndoManager = UndoManager; -}).call(SearchHighlight.prototype); - -exports.SearchHighlight = SearchHighlight; }); -ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"], function(require, exports, module) { -"use strict"; - +ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"], function(require, exports, module){"use strict"; var Range = require("../range").Range; -function FoldLine(foldData, folds) { - this.foldData = foldData; - if (Array.isArray(folds)) { - this.folds = folds; - } else { - folds = this.folds = [ folds ]; +var FoldLine = /** @class */ (function () { + function FoldLine(foldData, folds) { + this.foldData = foldData; + if (Array.isArray(folds)) { + this.folds = folds; + } + else { + folds = this.folds = [folds]; + } + var last = folds[folds.length - 1]; + this.range = new Range(folds[0].start.row, folds[0].start.column, last.end.row, last.end.column); + this.start = this.range.start; + this.end = this.range.end; + this.folds.forEach(function (fold) { + fold.setFoldLine(this); + }, this); } - - var last = folds[folds.length - 1]; - this.range = new Range(folds[0].start.row, folds[0].start.column, - last.end.row, last.end.column); - this.start = this.range.start; - this.end = this.range.end; - - this.folds.forEach(function(fold) { - fold.setFoldLine(this); - }, this); -} - -(function() { - this.shiftRow = function(shift) { + FoldLine.prototype.shiftRow = function (shift) { this.start.row += shift; this.end.row += shift; - this.folds.forEach(function(fold) { + this.folds.forEach(function (fold) { fold.start.row += shift; fold.end.row += shift; }); }; - - this.addFold = function(fold) { + FoldLine.prototype.addFold = function (fold) { if (fold.sameRow) { if (fold.start.row < this.startRow || fold.endRow > this.endRow) { throw new Error("Can't add a fold to this FoldLine as it has no connection"); } this.folds.push(fold); - this.folds.sort(function(a, b) { + this.folds.sort(function (a, b) { return -a.range.compareEnd(b.start.row, b.start.column); }); if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) { this.end.row = fold.end.row; - this.end.column = fold.end.column; - } else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) { + this.end.column = fold.end.column; + } + else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) { this.start.row = fold.start.row; this.start.column = fold.start.column; } - } else if (fold.start.row == this.end.row) { + } + else if (fold.start.row == this.end.row) { this.folds.push(fold); this.end.row = fold.end.row; this.end.column = fold.end.column; - } else if (fold.end.row == this.start.row) { + } + else if (fold.end.row == this.start.row) { this.folds.unshift(fold); this.start.row = fold.start.row; this.start.column = fold.start.column; - } else { + } + else { throw new Error("Trying to add fold to FoldRow that doesn't have a matching row"); } fold.foldLine = this; }; - - this.containsRow = function(row) { + FoldLine.prototype.containsRow = function (row) { return row >= this.start.row && row <= this.end.row; }; - - this.walk = function(callback, endRow, endColumn) { - var lastEnd = 0, - folds = this.folds, - fold, - cmp, stop, isNewRow = true; - + FoldLine.prototype.walk = function (callback, endRow, endColumn) { + var lastEnd = 0, folds = this.folds, fold, cmp, stop, isNewRow = true; if (endRow == null) { endRow = this.end.row; endColumn = this.end.column; } - for (var i = 0; i < folds.length; i++) { fold = folds[i]; - cmp = fold.range.compareStart(endRow, endColumn); if (cmp == -1) { callback(null, endRow, endColumn, lastEnd, isNewRow); return; } - stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow); stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd); if (stop || cmp === 0) { @@ -26506,8 +26185,7 @@ function FoldLine(foldData, folds) { } callback(null, endRow, endColumn, lastEnd, isNewRow); }; - - this.getNextFoldTo = function(row, column) { + FoldLine.prototype.getNextFoldTo = function (row, column) { var fold, cmp; for (var i = 0; i < this.folds.length; i++) { fold = this.folds[i]; @@ -26517,7 +26195,8 @@ function FoldLine(foldData, folds) { fold: fold, kind: "after" }; - } else if (cmp === 0) { + } + else if (cmp === 0) { return { fold: fold, kind: "inside" @@ -26526,18 +26205,16 @@ function FoldLine(foldData, folds) { } return null; }; - - this.addRemoveChars = function(row, column, len) { - var ret = this.getNextFoldTo(row, column), - fold, folds; + FoldLine.prototype.addRemoveChars = function (row, column, len) { + var ret = this.getNextFoldTo(row, column), fold, folds; if (ret) { fold = ret.fold; if (ret.kind == "inside" && fold.start.column != column - && fold.start.row != row) - { + && fold.start.row != row) { window.console && window.console.log(row, column, fold); - } else if (fold.start.row == row) { + } + else if (fold.start.row == row) { folds = this.folds; var i = folds.indexOf(fold); if (i === 0) { @@ -26555,29 +26232,23 @@ function FoldLine(foldData, folds) { } } }; - - this.split = function(row, column) { + FoldLine.prototype.split = function (row, column) { var pos = this.getNextFoldTo(row, column); - if (!pos || pos.kind == "inside") return null; - var fold = pos.fold; var folds = this.folds; var foldData = this.foldData; - var i = folds.indexOf(fold); var foldBefore = folds[i - 1]; this.end.row = foldBefore.end.row; this.end.column = foldBefore.end.column; folds = folds.splice(i, folds.length - i); - var newFoldLine = new FoldLine(foldData, folds); foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine); return newFoldLine; }; - - this.merge = function(foldLineNext) { + FoldLine.prototype.merge = function (foldLineNext) { var folds = foldLineNext.folds; for (var i = 0; i < folds.length; i++) { this.addFold(folds[i]); @@ -26585,23 +26256,18 @@ function FoldLine(foldData, folds) { var foldData = this.foldData; foldData.splice(foldData.indexOf(foldLineNext), 1); }; - - this.toString = function() { - var ret = [this.range.toString() + ": [" ]; - - this.folds.forEach(function(fold) { + FoldLine.prototype.toString = function () { + var ret = [this.range.toString() + ": ["]; + this.folds.forEach(function (fold) { ret.push(" " + fold.toString()); }); ret.push("]"); return ret.join("\n"); }; - - this.idxToPosition = function(idx) { + FoldLine.prototype.idxToPosition = function (idx) { var lastFoldEndColumn = 0; - for (var i = 0; i < this.folds.length; i++) { var fold = this.folds[i]; - idx -= fold.start.column - lastFoldEndColumn; if (idx < 0) { return { @@ -26609,41 +26275,33 @@ function FoldLine(foldData, folds) { column: fold.start.column + idx }; } - idx -= fold.placeholder.length; if (idx < 0) { return fold.start; } - lastFoldEndColumn = fold.end.column; } - return { row: this.end.row, column: this.end.column + idx }; }; -}).call(FoldLine.prototype); - + return FoldLine; +}()); exports.FoldLine = FoldLine; + }); -ace.define("ace/range_list",["require","exports","module","ace/range"], function(require, exports, module) { -"use strict"; +ace.define("ace/range_list",["require","exports","module","ace/range"], function(require, exports, module){"use strict"; var Range = require("./range").Range; var comparePoints = Range.comparePoints; - -var RangeList = function() { - this.ranges = []; - this.$bias = 1; -}; - -(function() { - this.comparePoints = comparePoints; - - this.pointIndex = function(pos, excludeEdges, startIndex) { +var RangeList = /** @class */ (function () { + function RangeList() { + this.ranges = []; + this.$bias = 1; + } + RangeList.prototype.pointIndex = function (pos, excludeEdges, startIndex) { var list = this.ranges; - for (var i = startIndex || 0; i < list.length; i++) { var range = list[i]; var cmpEnd = comparePoints(pos, range.end); @@ -26651,52 +26309,43 @@ var RangeList = function() { continue; var cmpStart = comparePoints(pos, range.start); if (cmpEnd === 0) - return excludeEdges && cmpStart !== 0 ? -i-2 : i; + return excludeEdges && cmpStart !== 0 ? -i - 2 : i; if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges)) return i; - - return -i-1; + return -i - 1; } return -i - 1; }; - - this.add = function(range) { + RangeList.prototype.add = function (range) { var excludeEdges = !range.isEmpty(); var startIndex = this.pointIndex(range.start, excludeEdges); if (startIndex < 0) startIndex = -startIndex - 1; - var endIndex = this.pointIndex(range.end, excludeEdges, startIndex); - if (endIndex < 0) endIndex = -endIndex - 1; else endIndex++; return this.ranges.splice(startIndex, endIndex - startIndex, range); }; - - this.addList = function(list) { + RangeList.prototype.addList = function (list) { var removed = []; - for (var i = list.length; i--; ) { + for (var i = list.length; i--;) { removed.push.apply(removed, this.add(list[i])); } return removed; }; - - this.substractPoint = function(pos) { + RangeList.prototype.substractPoint = function (pos) { var i = this.pointIndex(pos); - if (i >= 0) return this.ranges.splice(i, 1); }; - this.merge = function() { + RangeList.prototype.merge = function () { var removed = []; var list = this.ranges; - - list = list.sort(function(a, b) { + list = list.sort(function (a, b) { return comparePoints(a.start, b.start); }); - var next = list[0], range; for (var i = 1; i < list.length; i++) { range = next; @@ -26704,82 +26353,64 @@ var RangeList = function() { var cmp = comparePoints(range.end, next.start); if (cmp < 0) continue; - if (cmp == 0 && !range.isEmpty() && !next.isEmpty()) continue; - if (comparePoints(range.end, next.end) < 0) { range.end.row = next.end.row; range.end.column = next.end.column; } - list.splice(i, 1); removed.push(next); next = range; i--; } - this.ranges = list; - return removed; }; - - this.contains = function(row, column) { - return this.pointIndex({row: row, column: column}) >= 0; + RangeList.prototype.contains = function (row, column) { + return this.pointIndex({ row: row, column: column }) >= 0; }; - - this.containsPoint = function(pos) { + RangeList.prototype.containsPoint = function (pos) { return this.pointIndex(pos) >= 0; }; - - this.rangeAtPoint = function(pos) { + RangeList.prototype.rangeAtPoint = function (pos) { var i = this.pointIndex(pos); if (i >= 0) return this.ranges[i]; }; - - - this.clipRows = function(startRow, endRow) { + RangeList.prototype.clipRows = function (startRow, endRow) { var list = this.ranges; if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow) return []; - - var startIndex = this.pointIndex({row: startRow, column: 0}); + var startIndex = this.pointIndex({ row: startRow, column: 0 }); if (startIndex < 0) startIndex = -startIndex - 1; - var endIndex = this.pointIndex({row: endRow, column: 0}, startIndex); + var endIndex = this.pointIndex({ row: endRow, column: 0 }, startIndex); if (endIndex < 0) endIndex = -endIndex - 1; - var clipped = []; for (var i = startIndex; i < endIndex; i++) { clipped.push(list[i]); } return clipped; }; - - this.removeAll = function() { + RangeList.prototype.removeAll = function () { return this.ranges.splice(0, this.ranges.length); }; - - this.attach = function(session) { + RangeList.prototype.attach = function (session) { if (this.session) this.detach(); - this.session = session; this.onChange = this.$onChange.bind(this); - this.session.on('change', this.onChange); }; - - this.detach = function() { + RangeList.prototype.detach = function () { if (!this.session) return; this.session.removeListener('change', this.onChange); this.session = null; }; - - this.$onChange = function(delta) { + RangeList.prototype.$onChange = function (delta) { var start = delta.start; var end = delta.end; var startRow = start.row; @@ -26790,7 +26421,6 @@ var RangeList = function() { if (r.end.row >= startRow) break; } - if (delta.action == "insert") { var lineDif = endRow - startRow; var colDiff = -start.column + end.column; @@ -26798,10 +26428,10 @@ var RangeList = function() { var r = ranges[i]; if (r.start.row > startRow) break; - if (r.start.row == startRow && r.start.column >= start.column) { if (r.start.column == start.column && this.$bias <= 0) { - } else { + } + else { r.start.column += colDiff; r.start.row += lineDif; } @@ -26811,28 +26441,24 @@ var RangeList = function() { continue; } if (r.end.column == start.column && colDiff > 0 && i < n - 1) { - if (r.end.column > r.start.column && r.end.column == ranges[i+1].start.column) + if (r.end.column > r.start.column && r.end.column == ranges[i + 1].start.column) r.end.column -= colDiff; } r.end.column += colDiff; r.end.row += lineDif; } } - } else { + } + else { var lineDif = startRow - endRow; var colDiff = start.column - end.column; for (; i < n; i++) { var r = ranges[i]; - if (r.start.row > endRow) break; - if (r.end.row < endRow - && ( - startRow < r.end.row - || startRow == r.end.row && start.column < r.end.column - ) - ) { + && (startRow < r.end.row + || startRow == r.end.row && start.column < r.end.column)) { r.end.row = startRow; r.end.column = start.column; } @@ -26851,13 +26477,9 @@ var RangeList = function() { else if (r.end.row > endRow) { r.end.row += lineDif; } - if (r.start.row < endRow - && ( - startRow < r.start.row - || startRow == r.start.row && start.column < r.start.column - ) - ) { + && (startRow < r.start.row + || startRow == r.start.row && start.column < r.start.column)) { r.start.row = startRow; r.start.column = start.column; } @@ -26878,7 +26500,6 @@ var RangeList = function() { } } } - if (lineDif != 0 && i < n) { for (; i < n; i++) { var r = ranges[i]; @@ -26887,58 +26508,65 @@ var RangeList = function() { } } }; - -}).call(RangeList.prototype); - + return RangeList; +}()); +RangeList.prototype.comparePoints = comparePoints; exports.RangeList = RangeList; -}); -ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list","ace/lib/oop"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"], function(require, exports, module){"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var RangeList = require("../range_list").RangeList; -var oop = require("../lib/oop"); -var Fold = exports.Fold = function(range, placeholder) { - this.foldLine = null; - this.placeholder = placeholder; - this.range = range; - this.start = range.start; - this.end = range.end; - - this.sameRow = range.start.row == range.end.row; - this.subFolds = this.ranges = []; -}; - -oop.inherits(Fold, RangeList); - -(function() { - - this.toString = function() { +var Fold = /** @class */ (function (_super) { + __extends(Fold, _super); + function Fold(range, placeholder) { + var _this = _super.call(this) || this; + _this.foldLine = null; + _this.placeholder = placeholder; + _this.range = range; + _this.start = range.start; + _this.end = range.end; + _this.sameRow = range.start.row == range.end.row; + _this.subFolds = _this.ranges = []; + return _this; + } + Fold.prototype.toString = function () { return '"' + this.placeholder + '" ' + this.range.toString(); }; - - this.setFoldLine = function(foldLine) { + Fold.prototype.setFoldLine = function (foldLine) { this.foldLine = foldLine; - this.subFolds.forEach(function(fold) { + this.subFolds.forEach(function (fold) { fold.setFoldLine(foldLine); }); }; - - this.clone = function() { + Fold.prototype.clone = function () { var range = this.range.clone(); var fold = new Fold(range, this.placeholder); - this.subFolds.forEach(function(subFold) { + this.subFolds.forEach(function (subFold) { fold.subFolds.push(subFold.clone()); }); fold.collapseChildren = this.collapseChildren; return fold; }; - - this.addSubFold = function(fold) { + Fold.prototype.addSubFold = function (fold) { if (this.range.isEqual(fold)) return; consumeRange(fold, this.start); - var row = fold.start.row, column = fold.start.column; for (var i = 0, cmp = -1; i < this.subFolds.length; i++) { cmp = this.subFolds[i].range.compare(row, column); @@ -26947,7 +26575,6 @@ oop.inherits(Fold, RangeList); } var afterStart = this.subFolds[i]; var firstConsumed = 0; - if (cmp == 0) { if (afterStart.range.containsRange(fold)) return afterStart.addSubFold(fold); @@ -26960,23 +26587,21 @@ oop.inherits(Fold, RangeList); if (cmp != 1) break; } - if (cmp == 0) j++; + if (cmp == 0) + j++; var consumedFolds = this.subFolds.splice(i, j - i, fold); var last = cmp == 0 ? consumedFolds.length - 1 : consumedFolds.length; for (var k = firstConsumed; k < last; k++) { fold.addSubFold(consumedFolds[k]); } fold.setFoldLine(this.foldLine); - return fold; }; - - this.restoreRange = function(range) { + Fold.prototype.restoreRange = function (range) { return restoreRange(range, this.start); }; - -}).call(Fold.prototype); - + return Fold; +}(RangeList)); function consumePoint(point, anchor) { point.row -= anchor.row; if (point.row == 0) @@ -26995,45 +26620,43 @@ function restoreRange(range, anchor) { restorePoint(range.start, anchor); restorePoint(range.end, anchor); } +exports.Fold = Fold; }); -ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"], function(require, exports, module) { +ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"], function(require, exports, module){// @ts-nocheck "use strict"; - var Range = require("../range").Range; var FoldLine = require("./fold_line").FoldLine; var Fold = require("./fold").Fold; var TokenIterator = require("../token_iterator").TokenIterator; - +var MouseEvent = require("../mouse/mouse_event").MouseEvent; function Folding() { - this.getFoldAt = function(row, column, side) { + this.getFoldAt = function (row, column, side) { var foldLine = this.getFoldLine(row); if (!foldLine) return null; - var folds = foldLine.folds; for (var i = 0; i < folds.length; i++) { var range = folds[i].range; if (range.contains(row, column)) { if (side == 1 && range.isEnd(row, column) && !range.isEmpty()) { continue; - } else if (side == -1 && range.isStart(row, column) && !range.isEmpty()) { + } + else if (side == -1 && range.isStart(row, column) && !range.isEmpty()) { continue; } return folds[i]; } } }; - this.getFoldsInRange = function(range) { + this.getFoldsInRange = function (range) { var start = range.start; var end = range.end; var foldLines = this.$foldData; var foundFolds = []; - start.column += 1; end.column -= 1; - for (var i = 0; i < foldLines.length; i++) { var cmp = foldLines[i].range.compareRange(range); if (cmp == 2) { @@ -27042,16 +26665,17 @@ function Folding() { else if (cmp == -2) { break; } - var folds = foldLines[i].folds; for (var j = 0; j < folds.length; j++) { var fold = folds[j]; cmp = fold.range.compareRange(range); if (cmp == -2) { break; - } else if (cmp == 2) { + } + else if (cmp == 2) { continue; - } else + } + else if (cmp == 42) { break; } @@ -27060,36 +26684,32 @@ function Folding() { } start.column -= 1; end.column += 1; - return foundFolds; }; - - this.getFoldsInRangeList = function(ranges) { + this.getFoldsInRangeList = function (ranges) { if (Array.isArray(ranges)) { var folds = []; - ranges.forEach(function(range) { + ranges.forEach(function (range) { folds = folds.concat(this.getFoldsInRange(range)); }, this); - } else { + } + else { var folds = this.getFoldsInRange(ranges); } return folds; }; - this.getAllFolds = function() { + this.getAllFolds = function () { var folds = []; var foldLines = this.$foldData; - for (var i = 0; i < foldLines.length; i++) for (var j = 0; j < foldLines[i].folds.length; j++) folds.push(foldLines[i].folds[j]); - return folds; }; - this.getFoldStringAt = function(row, column, trim, foldLine) { + this.getFoldStringAt = function (row, column, trim, foldLine) { foldLine = foldLine || this.getFoldLine(row); if (!foldLine) return null; - var lastFold = { end: { column: 0 } }; @@ -27110,7 +26730,6 @@ function Folding() { } if (!str) str = this.getLine(fold.start.row).substring(lastFold.end.column); - if (trim == -1) return str.substring(0, column - lastFold.end.column); else if (trim == 1) @@ -27118,8 +26737,7 @@ function Folding() { else return str; }; - - this.getFoldLine = function(docRow, startFoldLine) { + this.getFoldLine = function (docRow, startFoldLine) { var foldData = this.$foldData; var i = 0; if (startFoldLine) @@ -27130,13 +26748,14 @@ function Folding() { var foldLine = foldData[i]; if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) { return foldLine; - } else if (foldLine.end.row > docRow) { + } + else if (foldLine.end.row > docRow) { return null; } } return null; }; - this.getNextFoldLine = function(docRow, startFoldLine) { + this.getNextFoldLine = function (docRow, startFoldLine) { var foldData = this.$foldData; var i = 0; if (startFoldLine) @@ -27151,43 +26770,39 @@ function Folding() { } return null; }; - - this.getFoldedRowCount = function(first, last) { - var foldData = this.$foldData, rowCount = last-first+1; + this.getFoldedRowCount = function (first, last) { + var foldData = this.$foldData, rowCount = last - first + 1; for (var i = 0; i < foldData.length; i++) { - var foldLine = foldData[i], - end = foldLine.end.row, - start = foldLine.start.row; + var foldLine = foldData[i], end = foldLine.end.row, start = foldLine.start.row; if (end >= last) { if (start < last) { if (start >= first) - rowCount -= last-start; + rowCount -= last - start; else rowCount = 0; // in one fold } break; - } else if (end >= first){ + } + else if (end >= first) { if (start >= first) // fold inside range - rowCount -= end-start; + rowCount -= end - start; else - rowCount -= end-first+1; + rowCount -= end - first + 1; } } return rowCount; }; - - this.$addFoldLine = function(foldLine) { + this.$addFoldLine = function (foldLine) { this.$foldData.push(foldLine); - this.$foldData.sort(function(a, b) { + this.$foldData.sort(function (a, b) { return a.start.row - b.start.row; }); return foldLine; }; - this.addFold = function(placeholder, range) { + this.addFold = function (placeholder, range) { var foldData = this.$foldData; var added = false; var fold; - if (placeholder instanceof Fold) fold = placeholder; else { @@ -27195,39 +26810,35 @@ function Folding() { fold.collapseChildren = range.collapseChildren; } this.$clipRangeToDocument(fold.range); - var startRow = fold.start.row; var startColumn = fold.start.column; var endRow = fold.end.row; var endColumn = fold.end.column; - var startFold = this.getFoldAt(startRow, startColumn, 1); var endFold = this.getFoldAt(endRow, endColumn, -1); if (startFold && endFold == startFold) return startFold.addSubFold(fold); - if (startFold && !startFold.range.isStart(startRow, startColumn)) this.removeFold(startFold); - if (endFold && !endFold.range.isEnd(endRow, endColumn)) this.removeFold(endFold); var folds = this.getFoldsInRange(fold.range); if (folds.length > 0) { this.removeFolds(folds); if (!fold.collapseChildren) { - folds.forEach(function(subFold) { + folds.forEach(function (subFold) { fold.addSubFold(subFold); }); } } - for (var i = 0; i < foldData.length; i++) { var foldLine = foldData[i]; if (endRow == foldLine.start.row) { foldLine.addFold(fold); added = true; break; - } else if (startRow == foldLine.end.row) { + } + else if (startRow == foldLine.end.row) { foldLine.addFold(fold); added = true; if (!fold.sameRow) { @@ -27238,53 +26849,52 @@ function Folding() { } } break; - } else if (endRow <= foldLine.start.row) { + } + else if (endRow <= foldLine.start.row) { break; } } - if (!added) foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold)); - if (this.$useWrapMode) this.$updateWrapData(foldLine.start.row, foldLine.start.row); else this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row); this.$modified = true; this._signal("changeFold", { data: fold, action: "add" }); - return fold; }; - - this.addFolds = function(folds) { - folds.forEach(function(fold) { + this.addFolds = function (folds) { + folds.forEach(function (fold) { this.addFold(fold); }, this); }; - - this.removeFold = function(fold) { + this.removeFold = function (fold) { var foldLine = fold.foldLine; var startRow = foldLine.start.row; var endRow = foldLine.end.row; - var foldLines = this.$foldData; var folds = foldLine.folds; if (folds.length == 1) { foldLines.splice(foldLines.indexOf(foldLine), 1); - } else + } + else if (foldLine.range.isEnd(fold.end.row, fold.end.column)) { folds.pop(); foldLine.end.row = folds[folds.length - 1].end.row; foldLine.end.column = folds[folds.length - 1].end.column; - } else + } + else if (foldLine.range.isStart(fold.start.row, fold.start.column)) { folds.shift(); foldLine.start.row = folds[0].start.row; foldLine.start.column = folds[0].start.column; - } else + } + else if (fold.sameRow) { folds.splice(folds.indexOf(fold), 1); - } else + } + else { var newFoldLine = foldLine.split(fold.start.row, fold.start.column); folds = newFoldLine.folds; @@ -27292,7 +26902,6 @@ function Folding() { newFoldLine.start.row = folds[0].start.row; newFoldLine.start.column = folds[0].start.column; } - if (!this.$updating) { if (this.$useWrapMode) this.$updateWrapData(startRow, endRow); @@ -27302,73 +26911,84 @@ function Folding() { this.$modified = true; this._signal("changeFold", { data: fold, action: "remove" }); }; - - this.removeFolds = function(folds) { + this.removeFolds = function (folds) { var cloneFolds = []; for (var i = 0; i < folds.length; i++) { cloneFolds.push(folds[i]); } - - cloneFolds.forEach(function(fold) { + cloneFolds.forEach(function (fold) { this.removeFold(fold); }, this); this.$modified = true; }; - - this.expandFold = function(fold) { + this.expandFold = function (fold) { this.removeFold(fold); - fold.subFolds.forEach(function(subFold) { + fold.subFolds.forEach(function (subFold) { fold.restoreRange(subFold); this.addFold(subFold); }, this); if (fold.collapseChildren > 0) { - this.foldAll(fold.start.row+1, fold.end.row, fold.collapseChildren-1); + this.foldAll(fold.start.row + 1, fold.end.row, fold.collapseChildren - 1); } fold.subFolds = []; }; - - this.expandFolds = function(folds) { - folds.forEach(function(fold) { + this.expandFolds = function (folds) { + folds.forEach(function (fold) { this.expandFold(fold); }, this); }; - - this.unfold = function(location, expandInner) { + this.unfold = function (location, expandInner) { var range, folds; if (location == null) { range = new Range(0, 0, this.getLength(), 0); - if (expandInner == null) expandInner = true; - } else if (typeof location == "number") + if (expandInner == null) + expandInner = true; + } + else if (typeof location == "number") { range = new Range(location, 0, location, this.getLine(location).length); - else if ("row" in location) + } + else if ("row" in location) { range = Range.fromPoints(location, location); - else + } + else if (Array.isArray(location)) { + folds = []; + location.forEach(function (range) { + folds = folds.concat(this.unfold(range)); + }, this); + return folds; + } + else { range = location; - + } folds = this.getFoldsInRangeList(range); + var outermostFolds = folds; + while (folds.length == 1 + && Range.comparePoints(folds[0].start, range.start) < 0 + && Range.comparePoints(folds[0].end, range.end) > 0) { + this.expandFolds(folds); + folds = this.getFoldsInRangeList(range); + } if (expandInner != false) { this.removeFolds(folds); - } else { + } + else { this.expandFolds(folds); } - if (folds.length) - return folds; + if (outermostFolds.length) + return outermostFolds; }; - this.isRowFolded = function(docRow, startFoldRow) { + this.isRowFolded = function (docRow, startFoldRow) { return !!this.getFoldLine(docRow, startFoldRow); }; - - this.getRowFoldEnd = function(docRow, startFoldRow) { + this.getRowFoldEnd = function (docRow, startFoldRow) { var foldLine = this.getFoldLine(docRow, startFoldRow); return foldLine ? foldLine.end.row : docRow; }; - - this.getRowFoldStart = function(docRow, startFoldRow) { + this.getRowFoldStart = function (docRow, startFoldRow) { var foldLine = this.getFoldLine(docRow, startFoldRow); return foldLine ? foldLine.start.row : docRow; }; - - this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) { + this.getFoldDisplayLine = function (foldLine, endRow, endColumn, startRow, startColumn) { if (startRow == null) startRow = foldLine.start.row; if (startColumn == null) @@ -27379,8 +26999,7 @@ function Folding() { endColumn = this.getLine(endRow).length; var doc = this.doc; var textLine = ""; - - foldLine.walk(function(placeholder, row, column, lastColumn) { + foldLine.walk(function (placeholder, row, column, lastColumn) { if (row < startRow) return; if (row == startRow) { @@ -27388,90 +27007,85 @@ function Folding() { return; lastColumn = Math.max(startColumn, lastColumn); } - if (placeholder != null) { textLine += placeholder; - } else { + } + else { textLine += doc.getLine(row).substring(lastColumn, column); } }, endRow, endColumn); return textLine; }; - - this.getDisplayLine = function(row, endColumn, startRow, startColumn) { + this.getDisplayLine = function (row, endColumn, startRow, startColumn) { var foldLine = this.getFoldLine(row); - if (!foldLine) { var line; line = this.doc.getLine(row); return line.substring(startColumn || 0, endColumn || line.length); - } else { - return this.getFoldDisplayLine( - foldLine, row, endColumn, startRow, startColumn); + } + else { + return this.getFoldDisplayLine(foldLine, row, endColumn, startRow, startColumn); } }; - - this.$cloneFoldData = function() { + this.$cloneFoldData = function () { var fd = []; - fd = this.$foldData.map(function(foldLine) { - var folds = foldLine.folds.map(function(fold) { + fd = this.$foldData.map(function (foldLine) { + var folds = foldLine.folds.map(function (fold) { return fold.clone(); }); return new FoldLine(fd, folds); }); - return fd; }; - - this.toggleFold = function(tryToUnfold) { + this.toggleFold = function (tryToUnfold) { var selection = this.selection; var range = selection.getRange(); var fold; var bracketPos; - if (range.isEmpty()) { var cursor = range.start; fold = this.getFoldAt(cursor.row, cursor.column); - if (fold) { this.expandFold(fold); return; - } else if (bracketPos = this.findMatchingBracket(cursor)) { + } + else if (bracketPos = this.findMatchingBracket(cursor)) { if (range.comparePoint(bracketPos) == 1) { range.end = bracketPos; - } else { + } + else { range.start = bracketPos; range.start.column++; range.end.column--; } - } else if (bracketPos = this.findMatchingBracket({row: cursor.row, column: cursor.column + 1})) { + } + else if (bracketPos = this.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 })) { if (range.comparePoint(bracketPos) == 1) range.end = bracketPos; else range.start = bracketPos; - range.start.column++; - } else { + } + else { range = this.getCommentFoldRange(cursor.row, cursor.column) || range; } - } else { + } + else { var folds = this.getFoldsInRange(range); if (tryToUnfold && folds.length) { this.expandFolds(folds); return; - } else if (folds.length == 1 ) { + } + else if (folds.length == 1) { fold = folds[0]; } } - if (!fold) fold = this.getFoldAt(range.start.row, range.start.column); - if (fold && fold.range.toString() == range.toString()) { this.expandFold(fold); return; } - var placeholder = "..."; if (!range.isMultiLine()) { placeholder = this.getTextRange(range); @@ -27479,55 +27093,51 @@ function Folding() { return; placeholder = placeholder.trim().substring(0, 2) + ".."; } - this.addFold(placeholder, range); }; - - this.getCommentFoldRange = function(row, column, dir) { + this.getCommentFoldRange = function (row, column, dir) { var iterator = new TokenIterator(this, row, column); var token = iterator.getCurrentToken(); var type = token && token.type; if (token && /^comment|string/.test(type)) { type = type.match(/comment|string/)[0]; if (type == "comment") - type += "|doc-start"; + type += "|doc-start|\\.doc"; var re = new RegExp(type); var range = new Range(); if (dir != 1) { do { token = iterator.stepBackward(); } while (token && re.test(token.type)); - iterator.stepForward(); + token = iterator.stepForward(); } - range.start.row = iterator.getCurrentTokenRow(); - range.start.column = iterator.getCurrentTokenColumn() + 2; - + range.start.column = iterator.getCurrentTokenColumn() + token.value.length; iterator = new TokenIterator(this, row, column); - + var initState = this.getState(iterator.$row); if (dir != -1) { var lastRow = -1; do { token = iterator.stepForward(); if (lastRow == -1) { var state = this.getState(iterator.$row); - if (!re.test(state)) + if (initState.toString() !== state.toString()) lastRow = iterator.$row; - } else if (iterator.$row > lastRow) { + } + else if (iterator.$row > lastRow) { break; } } while (token && re.test(token.type)); token = iterator.stepBackward(); - } else + } + else token = iterator.getCurrentToken(); - range.end.row = iterator.getCurrentTokenRow(); - range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 2; + range.end.column = iterator.getCurrentTokenColumn(); return range; } }; - - this.foldAll = function(startRow, endRow, depth, test) { + this.foldAll = function (startRow, endRow, depth, test) { if (depth == undefined) depth = 100000; // JSON.stringify doesn't hanle Infinity var foldWidgets = this.foldWidgets; @@ -27540,30 +27150,26 @@ function Folding() { foldWidgets[row] = this.getFoldWidget(row); if (foldWidgets[row] != "start") continue; - - if (test && !test(row)) continue; - + if (test && !test(row)) + continue; var range = this.getFoldWidgetRange(row); if (range && range.isMultiLine() && range.end.row <= endRow - && range.start.row >= startRow - ) { + && range.start.row >= startRow) { row = range.end.row; range.collapseChildren = depth; this.addFold("...", range); } } }; - - this.foldToLevel = function(level) { + this.foldToLevel = function (level) { this.foldAll(); while (level-- > 0) this.unfold(null, false); }; - - this.foldAllComments = function() { + this.foldAllComments = function () { var session = this; - this.foldAll(null, null, null, function(row) { + this.foldAll(null, null, null, function (row) { var tokens = session.getTokens(row); for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; @@ -27581,58 +27187,46 @@ function Folding() { "markbeginend": 1 }; this.$foldStyle = "markbegin"; - this.setFoldStyle = function(style) { + this.setFoldStyle = function (style) { if (!this.$foldStyles[style]) throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]"); - if (this.$foldStyle == style) return; - this.$foldStyle = style; - if (style == "manual") this.unfold(); var mode = this.$foldMode; this.$setFolding(null); this.$setFolding(mode); }; - - this.$setFolding = function(foldMode) { + this.$setFolding = function (foldMode) { if (this.$foldMode == foldMode) return; - this.$foldMode = foldMode; - this.off('change', this.$updateFoldWidgets); this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); this._signal("changeAnnotation"); - if (!foldMode || this.$foldStyle == "manual") { this.foldWidgets = null; return; } - this.foldWidgets = []; this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle); this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle); - this.$updateFoldWidgets = this.updateFoldWidgets.bind(this); this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this); this.on('change', this.$updateFoldWidgets); this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); }; - this.getParentFoldRangeData = function (row, ignoreCurrent) { var fw = this.foldWidgets; if (!fw || (ignoreCurrent && fw[row])) return {}; - var i = row - 1, firstRange; while (i >= 0) { var c = fw[i]; if (c == null) c = fw[i] = this.getFoldWidget(i); - if (c == "start") { var range = this.getFoldWidgetRange(i); if (!firstRange) @@ -27642,21 +27236,19 @@ function Folding() { } i--; } - return { range: i !== -1 && range, firstRange: firstRange }; }; - - this.onFoldWidgetClick = function(row, e) { - e = e.domEvent; + this.onFoldWidgetClick = function (row, e) { + if (e instanceof MouseEvent) + e = e.domEvent; var options = { children: e.shiftKey, all: e.ctrlKey || e.metaKey, siblings: e.altKey }; - var range = this.$toggleFoldWidget(row, options); if (!range) { var el = (e.target || e.srcElement); @@ -27664,16 +27256,13 @@ function Folding() { el.className += " ace_invalid"; } }; - - this.$toggleFoldWidget = function(row, options) { + this.$toggleFoldWidget = function (row, options) { if (!this.getFoldWidget) return; var type = this.getFoldWidget(row); var line = this.getLine(row); - var dir = type === "end" ? -1 : 1; var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir); - if (fold) { if (options.children || options.all) this.removeFold(fold); @@ -27681,7 +27270,6 @@ function Folding() { this.expandFold(fold); return fold; } - var range = this.getFoldWidgetRange(row, true); if (range && !range.isMultiLine()) { fold = this.getFoldAt(range.start.row, range.start.column, 1); @@ -27690,7 +27278,6 @@ function Folding() { return fold; } } - if (options.siblings) { var data = this.getParentFoldRangeData(row); if (data.range) { @@ -27698,57 +27285,53 @@ function Folding() { var endRow = data.range.end.row; } this.foldAll(startRow, endRow, options.all ? 10000 : 0); - } else if (options.children) { + } + else if (options.children) { endRow = range ? range.end.row : this.getLength(); this.foldAll(row + 1, endRow, options.all ? 10000 : 0); - } else if (range) { + } + else if (range) { if (options.all) range.collapseChildren = 10000; this.addFold("...", range); } - return range; }; - - - - this.toggleFoldWidget = function(toggleParent) { + this.toggleFoldWidget = function (toggleParent) { var row = this.selection.getCursor().row; row = this.getRowFoldStart(row); var range = this.$toggleFoldWidget(row, {}); - if (range) return; var data = this.getParentFoldRangeData(row, true); range = data.range || data.firstRange; - if (range) { row = range.start.row; var fold = this.getFoldAt(row, this.getLine(row).length, 1); - if (fold) { this.removeFold(fold); - } else { + } + else { this.addFold("...", range); } } }; - - this.updateFoldWidgets = function(delta) { + this.updateFoldWidgets = function (delta) { var firstRow = delta.start.row; var len = delta.end.row - firstRow; - if (len === 0) { this.foldWidgets[firstRow] = null; - } else if (delta.action == 'remove') { + } + else if (delta.action == 'remove') { this.foldWidgets.splice(firstRow, len + 1, null); - } else { + } + else { var args = Array(len + 1); args.unshift(firstRow, 1); this.foldWidgets.splice.apply(this.foldWidgets, args); } }; - this.tokenizerUpdateFoldWidgets = function(e) { + this.tokenizerUpdateFoldWidgets = function (e) { var rows = e.data; if (rows.first != rows.last) { if (this.foldWidgets.length > rows.first) @@ -27756,51 +27339,41 @@ function Folding() { } }; } - exports.Folding = Folding; }); -ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"], function(require, exports, module) { -"use strict"; - +ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"], function(require, exports, module){"use strict"; var TokenIterator = require("../token_iterator").TokenIterator; var Range = require("../range").Range; - - function BracketMatch() { - - this.findMatchingBracket = function(position, chr) { - if (position.column == 0) return null; - - var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column-1); - if (charBeforeCursor == "") return null; - + this.findMatchingBracket = function (position, chr) { + if (position.column == 0) + return null; + var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column - 1); + if (charBeforeCursor == "") + return null; var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/); if (!match) return null; - if (match[1]) return this.$findClosingBracket(match[1], position); else return this.$findOpeningBracket(match[2], position); }; - - this.getBracketRange = function(pos) { + this.getBracketRange = function (pos) { var line = this.getLine(pos.row); var before = true, range; - var chr = line.charAt(pos.column - 1); var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); if (!match) { chr = line.charAt(pos.column); - pos = {row: pos.row, column: pos.column + 1}; + pos = { row: pos.row, column: pos.column + 1 }; match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); before = false; } if (!match) return null; - if (match[1]) { var bracketPos = this.$findClosingBracket(match[1], pos); if (!bracketPos) @@ -27811,7 +27384,8 @@ function BracketMatch() { range.start.column--; } range.cursor = range.end; - } else { + } + else { var bracketPos = this.$findOpeningBracket(match[2], pos); if (!bracketPos) return null; @@ -27822,33 +27396,31 @@ function BracketMatch() { } range.cursor = range.start; } - return range; }; - this.getMatchingBracketRanges = function(pos) { + this.getMatchingBracketRanges = function (pos, isBackwards) { var line = this.getLine(pos.row); - - var chr = line.charAt(pos.column - 1); - var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); + var bracketsRegExp = /([\(\[\{])|([\)\]\}])/; + var chr = !isBackwards && line.charAt(pos.column - 1); + var match = chr && chr.match(bracketsRegExp); if (!match) { - chr = line.charAt(pos.column); - pos = {row: pos.row, column: pos.column + 1}; - match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); + chr = (isBackwards === undefined || isBackwards) && line.charAt(pos.column); + pos = { + row: pos.row, + column: pos.column + 1 + }; + match = chr && chr.match(bracketsRegExp); } - if (!match) return null; - var startRange = new Range(pos.row, pos.column - 1, pos.row, pos.column); var bracketPos = match[1] ? this.$findClosingBracket(match[1], pos) : this.$findOpeningBracket(match[2], pos); if (!bracketPos) return [startRange]; var endRange = new Range(bracketPos.row, bracketPos.column, bracketPos.row, bracketPos.column + 1); - return [startRange, endRange]; }; - this.$brackets = { ")": "(", "(": ")", @@ -27859,38 +27431,32 @@ function BracketMatch() { "<": ">", ">": "<" }; - - this.$findOpeningBracket = function(bracket, position, typeRe) { + this.$findOpeningBracket = function (bracket, position, typeRe) { var openBracket = this.$brackets[bracket]; var depth = 1; - var iterator = new TokenIterator(this, position.row, position.column); var token = iterator.getCurrentToken(); if (!token) token = iterator.stepForward(); if (!token) return; - - if (!typeRe){ - typeRe = new RegExp( - "(\\.?" + + if (!typeRe) { + typeRe = new RegExp("(\\.?" + token.type.replace(".", "\\.").replace("rparen", ".paren") .replace(/\b(?:end)\b/, "(?:start|begin|end)") - + ")+" - ); + .replace(/-close\b/, "-(close|open)") + + ")+"); } var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2; var value = token.value; - while (true) { - while (valueIndex >= 0) { var chr = value.charAt(valueIndex); if (chr == openBracket) { depth -= 1; if (depth == 0) { - return {row: iterator.getCurrentTokenRow(), - column: valueIndex + iterator.getCurrentTokenColumn()}; + return { row: iterator.getCurrentTokenRow(), + column: valueIndex + iterator.getCurrentTokenColumn() }; } } else if (chr == bracket) { @@ -27901,40 +27467,31 @@ function BracketMatch() { do { token = iterator.stepBackward(); } while (token && !typeRe.test(token.type)); - if (token == null) break; - value = token.value; valueIndex = value.length - 1; } - return null; }; - - this.$findClosingBracket = function(bracket, position, typeRe) { + this.$findClosingBracket = function (bracket, position, typeRe) { var closingBracket = this.$brackets[bracket]; var depth = 1; - var iterator = new TokenIterator(this, position.row, position.column); var token = iterator.getCurrentToken(); if (!token) token = iterator.stepForward(); if (!token) return; - - if (!typeRe){ - typeRe = new RegExp( - "(\\.?" + + if (!typeRe) { + typeRe = new RegExp("(\\.?" + token.type.replace(".", "\\.").replace("lparen", ".paren") .replace(/\b(?:start|begin)\b/, "(?:start|begin|end)") - + ")+" - ); + .replace(/-open\b/, "-(close|open)") + + ")+"); } var valueIndex = position.column - iterator.getCurrentTokenColumn(); - while (true) { - var value = token.value; var valueLength = value.length; while (valueIndex < valueLength) { @@ -27942,8 +27499,8 @@ function BracketMatch() { if (chr == closingBracket) { depth -= 1; if (depth == 0) { - return {row: iterator.getCurrentTokenRow(), - column: valueIndex + iterator.getCurrentTokenColumn()}; + return { row: iterator.getCurrentTokenRow(), + column: valueIndex + iterator.getCurrentTokenColumn() }; } } else if (chr == bracket) { @@ -27954,23 +27511,192 @@ function BracketMatch() { do { token = iterator.stepForward(); } while (token && !typeRe.test(token.type)); - if (token == null) break; - valueIndex = 0; } - return null; }; + this.getMatchingTags = function (pos) { + var iterator = new TokenIterator(this, pos.row, pos.column); + var token = this.$findTagName(iterator); + if (!token) + return; + var prevToken = iterator.stepBackward(); + if (prevToken.value === '<') { + return this.$findClosingTag(iterator, token); + } + else { + return this.$findOpeningTag(iterator, token); + } + }; + this.$findTagName = function (iterator) { + var token = iterator.getCurrentToken(); + var found = false; + var backward = false; + if (token && token.type.indexOf('tag-name') === -1) { + do { + if (backward) + token = iterator.stepBackward(); + else + token = iterator.stepForward(); + if (token) { + if (token.value === "/>") { + backward = true; + } + else if (token.type.indexOf('tag-name') !== -1) { + found = true; + } + } + } while (token && !found); + } + return token; + }; + this.$findClosingTag = function (iterator, token) { + var prevToken; + var currentTag = token.value; + var tag = token.value; + var depth = 0; + var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); + token = iterator.stepForward(); + var openTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length); + var foundOpenTagEnd = false; + do { + prevToken = token; + if (prevToken.type.indexOf('tag-close') !== -1 && !foundOpenTagEnd) { + var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for `>` + foundOpenTagEnd = true; + } + token = iterator.stepForward(); + if (token) { + if (token.value === '>' && !foundOpenTagEnd) { + var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for `>` + foundOpenTagEnd = true; + } + if (token.type.indexOf('tag-name') !== -1) { + currentTag = token.value; + if (tag === currentTag) { + if (prevToken.value === '<') { + depth++; + } + else if (prevToken.value === '') { + var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for > + } + else { + return; + } + } + } + } + } + else if (tag === currentTag && token.value === '/>') { // self-closing tag + depth--; + if (depth < 0) { //found self-closing tag end + var closeTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2); + var closeTagName = closeTagStart; + var closeTagEnd = closeTagName; + var openTagEnd = new Range(openTagName.end.row, openTagName.end.column, openTagName.end.row, openTagName.end.column + 1); + } + } + } + } while (token && depth >= 0); + if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) { + return { + openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column), + closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column), + openTagName: openTagName, + closeTagName: closeTagName + }; + } + }; + this.$findOpeningTag = function (iterator, token) { + var prevToken = iterator.getCurrentToken(); + var tag = token.value; + var depth = 0; + var startRow = iterator.getCurrentTokenRow(); + var startColumn = iterator.getCurrentTokenColumn(); + var endColumn = startColumn + 2; + var closeTagStart = new Range(startRow, startColumn, startRow, endColumn); //Range for ") + return; + var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for > + iterator.stepBackward(); + iterator.stepBackward(); + do { + token = prevToken; + startRow = iterator.getCurrentTokenRow(); + startColumn = iterator.getCurrentTokenColumn(); + endColumn = startColumn + token.value.length; + prevToken = iterator.stepBackward(); + if (token) { + if (token.type.indexOf('tag-name') !== -1) { + if (tag === token.value) { + if (prevToken.value === '<') { + depth++; + if (depth > 0) { //found opening tag + var openTagName = new Range(startRow, startColumn, startRow, endColumn); + var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for < + do { + token = iterator.stepForward(); + } while (token && token.value !== '>'); + var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for > + } + } + else if (prevToken.value === '') { // self-closing tag + var stepCount = 0; + var tmpToken = prevToken; + while (tmpToken) { + if (tmpToken.type.indexOf('tag-name') !== -1 && tmpToken.value === tag) { + depth--; + break; + } + else if (tmpToken.value === '<') { + break; + } + tmpToken = iterator.stepBackward(); + stepCount++; + } + for (var i = 0; i < stepCount; i++) { + iterator.stepForward(); + } + } + } + } while (prevToken && depth <= 0); + if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) { + return { + openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column), + closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column), + openTagName: openTagName, + closeTagName: closeTagName + }; + } + }; } exports.BracketMatch = BracketMatch; }); -ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"], function(require, exports, module) { -"use strict"; - +ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"], function(require, exports, module){"use strict"; var oop = require("./lib/oop"); var lang = require("./lib/lang"); var BidiHandler = require("./bidihandler").BidiHandler; @@ -27982,57 +27708,111 @@ var Range = require("./range").Range; var Document = require("./document").Document; var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer; var SearchHighlight = require("./search_highlight").SearchHighlight; - -var EditSession = function(text, mode) { - this.$breakpoints = []; - this.$decorations = []; - this.$frontMarkers = {}; - this.$backMarkers = {}; - this.$markerId = 1; - this.$undoSelect = true; - - this.$foldData = []; - this.id = "session" + (++EditSession.$uid); - this.$foldData.toString = function() { - return this.join("\n"); +var UndoManager = require("./undomanager").UndoManager; +var EditSession = /** @class */ (function () { + function EditSession(text, mode) { this.doc; + this.$breakpoints = []; + this.$decorations = []; + this.$frontMarkers = {}; + this.$backMarkers = {}; + this.$markerId = 1; + this.$undoSelect = true; + this.prevOp = {}; + this.$foldData = []; + this.id = "session" + (++EditSession.$uid); + this.$foldData.toString = function () { + return this.join("\n"); + }; + this.bgTokenizer = new BackgroundTokenizer((new TextMode()).getTokenizer(), this); + var _self = this; + this.bgTokenizer.on("update", function (e) { + _self._signal("tokenizerUpdate", e); + }); + this.on("changeFold", this.onChangeFold.bind(this)); + this.$onChange = this.onChange.bind(this); + if (typeof text != "object" || !text.getLine) + text = new Document(/**@type{string}*/ (text)); + this.setDocument(text); + this.selection = new Selection(this); + this.$onSelectionChange = this.onSelectionChange.bind(this); + this.selection.on("changeSelection", this.$onSelectionChange); + this.selection.on("changeCursor", this.$onSelectionChange); + this.$bidiHandler = new BidiHandler(this); + config.resetOptions(this); + this.setMode(mode); + config._signal("session", this); + this.destroyed = false; + this.$initOperationListeners(); + } + EditSession.prototype.$initOperationListeners = function () { + var _this = this; + this.curOp = null; + this.on("change", function () { + if (!_this.curOp) { + _this.startOperation(); + _this.curOp.selectionBefore = _this.$lastSel; + } + _this.curOp.docChanged = true; + }, true); + this.on("changeSelection", function () { + if (!_this.curOp) { + _this.startOperation(); + _this.curOp.selectionBefore = _this.$lastSel; + } + _this.curOp.selectionChanged = true; + }, true); + this.$operationResetTimer = lang.delayedCall(this.endOperation.bind(this, true)); }; - this.on("changeFold", this.onChangeFold.bind(this)); - this.$onChange = this.onChange.bind(this); - - if (typeof text != "object" || !text.getLine) - text = new Document(text); - - this.setDocument(text); - this.selection = new Selection(this); - this.$bidiHandler = new BidiHandler(this); - - config.resetOptions(this); - this.setMode(mode); - config._signal("session", this); -}; - - -EditSession.$uid = 0; - -(function() { - - oop.implement(this, EventEmitter); - this.setDocument = function(doc) { + EditSession.prototype.startOperation = function (commandEvent) { + if (this.curOp) { + if (!commandEvent || this.curOp.command) { + return; + } + this.prevOp = this.curOp; + } + if (!commandEvent) { + commandEvent = {}; + } + this.$operationResetTimer.schedule(); + this.curOp = { + command: commandEvent.command || {}, + args: commandEvent.args + }; + this.curOp.selectionBefore = this.selection.toJSON(); + this._signal("startOperation", commandEvent); + }; + EditSession.prototype.endOperation = function (e) { + if (this.curOp) { + if (e && e.returnValue === false) { + this.curOp = null; + this._signal("endOperation", e); + return; + } + if (e == true && this.curOp.command && this.curOp.command.name == "mouse") { + return; + } + var currentSelection = this.selection.toJSON(); + this.curOp.selectionAfter = currentSelection; + this.$lastSel = this.selection.toJSON(); + this.getUndoManager().addSelection(currentSelection); + this._signal("beforeEndOperation"); + this.prevOp = this.curOp; + this.curOp = null; + this._signal("endOperation", e); + } + }; + EditSession.prototype.setDocument = function (doc) { if (this.doc) - this.doc.removeListener("change", this.$onChange); - + this.doc.off("change", this.$onChange); this.doc = doc; - doc.on("change", this.$onChange); - - if (this.bgTokenizer) - this.bgTokenizer.setDocument(this.getDocument()); - + doc.on("change", this.$onChange, true); + this.bgTokenizer.setDocument(this.getDocument()); this.resetCaches(); }; - this.getDocument = function() { + EditSession.prototype.getDocument = function () { return this.doc; }; - this.$resetRowCache = function(docRow) { + EditSession.prototype.$resetRowCache = function (docRow) { if (!docRow) { this.$docRowCache = []; this.$screenRowCache = []; @@ -28045,15 +27825,12 @@ EditSession.$uid = 0; this.$screenRowCache.splice(i, l); } }; - - this.$getRowCacheIndex = function(cacheArray, val) { + EditSession.prototype.$getRowCacheIndex = function (cacheArray, val) { var low = 0; var hi = cacheArray.length - 1; - while (low <= hi) { var mid = (low + hi) >> 1; var c = cacheArray[mid]; - if (val > c) low = mid + 1; else if (val < c) @@ -28061,75 +27838,106 @@ EditSession.$uid = 0; else return mid; } - - return low -1; + return low - 1; }; - - this.resetCaches = function() { + EditSession.prototype.resetCaches = function () { this.$modified = true; this.$wrapData = []; this.$rowLengthCache = []; this.$resetRowCache(0); - if (this.bgTokenizer) + if (!this.destroyed) this.bgTokenizer.start(0); }; - - this.onChangeFold = function(e) { + EditSession.prototype.onChangeFold = function (e) { var fold = e.data; this.$resetRowCache(fold.start.row); }; - - this.onChange = function(delta) { + EditSession.prototype.onChange = function (delta) { this.$modified = true; this.$bidiHandler.onChange(delta); this.$resetRowCache(delta.start.row); - var removedFolds = this.$updateInternalDataOnChange(delta); if (!this.$fromUndo && this.$undoManager) { if (removedFolds && removedFolds.length) { this.$undoManager.add({ action: "removeFolds", - folds: removedFolds + folds: removedFolds }, this.mergeUndoDeltas); this.mergeUndoDeltas = true; } this.$undoManager.add(delta, this.mergeUndoDeltas); this.mergeUndoDeltas = true; - this.$informUndoManager.schedule(); } - - this.bgTokenizer && this.bgTokenizer.$updateOnChange(delta); + this.bgTokenizer.$updateOnChange(delta); this._signal("change", delta); }; - this.setValue = function(text) { + EditSession.prototype.onSelectionChange = function () { + this._signal("changeSelection"); + }; + EditSession.prototype.setValue = function (text) { this.doc.setValue(text); this.selection.moveTo(0, 0); - this.$resetRowCache(0); this.setUndoManager(this.$undoManager); this.getUndoManager().reset(); }; - this.getValue = - this.toString = function() { + EditSession.fromJSON = function (session) { + if (typeof session == "string") + session = JSON.parse(session); + var undoManager = new UndoManager(); + undoManager.$undoStack = session.history.undo; + undoManager.$redoStack = session.history.redo; + undoManager.mark = session.history.mark; + undoManager.$rev = session.history.rev; + var editSession = new EditSession(session.value); + session.folds.forEach(function (fold) { + editSession.addFold("...", Range.fromPoints(fold.start, fold.end)); + }); + editSession.setAnnotations(session.annotations); + editSession.setBreakpoints(session.breakpoints); + editSession.setMode(session.mode); + editSession.setScrollLeft(session.scrollLeft); + editSession.setScrollTop(session.scrollTop); + editSession.setUndoManager(undoManager); + editSession.selection.fromJSON(session.selection); + return editSession; + }; + EditSession.prototype.toJSON = function () { + return { + annotations: this.$annotations, + breakpoints: this.$breakpoints, + folds: this.getAllFolds().map(function (fold) { + return fold.range; + }), + history: this.getUndoManager(), + mode: this.$mode.$id, + scrollLeft: this.$scrollLeft, + scrollTop: this.$scrollTop, + selection: this.selection.toJSON(), + value: this.doc.getValue() + }; + }; + EditSession.prototype.toString = function () { return this.doc.getValue(); }; - this.getSelection = function() { + EditSession.prototype.getSelection = function () { return this.selection; }; - this.getState = function(row) { + EditSession.prototype.getState = function (row) { return this.bgTokenizer.getState(row); }; - this.getTokens = function(row) { + EditSession.prototype.getTokens = function (row) { return this.bgTokenizer.getTokens(row); }; - this.getTokenAt = function(row, column) { + EditSession.prototype.getTokenAt = function (row, column) { var tokens = this.bgTokenizer.getTokens(row); var token, c = 0; if (column == null) { var i = tokens.length - 1; c = this.getLine(row).length; - } else { + } + else { for (var i = 0; i < tokens.length; i++) { c += tokens[i].value.length; if (c >= column) @@ -28143,107 +27951,93 @@ EditSession.$uid = 0; token.start = c - token.value.length; return token; }; - this.setUndoManager = function(undoManager) { + EditSession.prototype.setUndoManager = function (undoManager) { this.$undoManager = undoManager; - if (this.$informUndoManager) this.$informUndoManager.cancel(); - if (undoManager) { var self = this; undoManager.addSession(this); - this.$syncInformUndoManager = function() { + this.$syncInformUndoManager = function () { self.$informUndoManager.cancel(); self.mergeUndoDeltas = false; }; this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager); - } else { - this.$syncInformUndoManager = function() {}; + } + else { + this.$syncInformUndoManager = function () { }; } }; - this.markUndoGroup = function() { + EditSession.prototype.markUndoGroup = function () { if (this.$syncInformUndoManager) this.$syncInformUndoManager(); }; - - this.$defaultUndoManager = { - undo: function() {}, - redo: function() {}, - hasUndo: function() {}, - hasRedo: function() {}, - reset: function() {}, - add: function() {}, - addSelection: function() {}, - startNewGroup: function() {}, - addSession: function() {} - }; - this.getUndoManager = function() { + EditSession.prototype.getUndoManager = function () { return this.$undoManager || this.$defaultUndoManager; }; - this.getTabString = function() { + EditSession.prototype.getTabString = function () { if (this.getUseSoftTabs()) { return lang.stringRepeat(" ", this.getTabSize()); - } else { + } + else { return "\t"; } }; - this.setUseSoftTabs = function(val) { + EditSession.prototype.setUseSoftTabs = function (val) { this.setOption("useSoftTabs", val); }; - this.getUseSoftTabs = function() { + EditSession.prototype.getUseSoftTabs = function () { return this.$useSoftTabs && !this.$mode.$indentWithTabs; }; - this.setTabSize = function(tabSize) { + EditSession.prototype.setTabSize = function (tabSize) { this.setOption("tabSize", tabSize); }; - this.getTabSize = function() { + EditSession.prototype.getTabSize = function () { return this.$tabSize; }; - this.isTabStop = function(position) { + EditSession.prototype.isTabStop = function (position) { return this.$useSoftTabs && (position.column % this.$tabSize === 0); }; - this.setNavigateWithinSoftTabs = function (navigateWithinSoftTabs) { + EditSession.prototype.setNavigateWithinSoftTabs = function (navigateWithinSoftTabs) { this.setOption("navigateWithinSoftTabs", navigateWithinSoftTabs); }; - this.getNavigateWithinSoftTabs = function() { + EditSession.prototype.getNavigateWithinSoftTabs = function () { return this.$navigateWithinSoftTabs; }; - - this.$overwrite = false; - this.setOverwrite = function(overwrite) { + EditSession.prototype.setOverwrite = function (overwrite) { this.setOption("overwrite", overwrite); }; - this.getOverwrite = function() { + EditSession.prototype.getOverwrite = function () { return this.$overwrite; }; - this.toggleOverwrite = function() { + EditSession.prototype.toggleOverwrite = function () { this.setOverwrite(!this.$overwrite); }; - this.addGutterDecoration = function(row, className) { + EditSession.prototype.addGutterDecoration = function (row, className) { if (!this.$decorations[row]) this.$decorations[row] = ""; this.$decorations[row] += " " + className; this._signal("changeBreakpoint", {}); }; - this.removeGutterDecoration = function(row, className) { + EditSession.prototype.removeGutterDecoration = function (row, className) { this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, ""); this._signal("changeBreakpoint", {}); }; - this.getBreakpoints = function() { + EditSession.prototype.getBreakpoints = function () { return this.$breakpoints; }; - this.setBreakpoints = function(rows) { + EditSession.prototype.setBreakpoints = function (rows) { this.$breakpoints = []; - for (var i=0; i 0) inToken = !!line.charAt(column - 1).match(this.tokenRe); - if (!inToken) inToken = !!line.charAt(column).match(this.tokenRe); - if (inToken) var re = this.tokenRe; - else if (/^\s+$/.test(line.slice(column-1, column+1))) + else if (/^\s+$/.test(line.slice(column - 1, column + 1))) var re = /\s/; else var re = this.nonTokenRe; - var start = column; if (start > 0) { do { start--; - } - while (start >= 0 && line.charAt(start).match(re)); + } while (start >= 0 && line.charAt(start).match(re)); start++; } - var end = column; while (end < line.length && line.charAt(end).match(re)) { end++; } - return new Range(row, start, row, end); }; - this.getAWordRange = function(row, column) { + EditSession.prototype.getAWordRange = function (row, column) { var wordRange = this.getWordRange(row, column); var line = this.getLine(wordRange.end.row); - while (line.charAt(wordRange.end.column).match(/[ \t]/)) { wordRange.end.column += 1; } return wordRange; }; - this.setNewLineMode = function(newLineMode) { + EditSession.prototype.setNewLineMode = function (newLineMode) { this.doc.setNewLineMode(newLineMode); }; - this.getNewLineMode = function() { + EditSession.prototype.getNewLineMode = function () { return this.doc.getNewLineMode(); }; - this.setUseWorker = function(useWorker) { this.setOption("useWorker", useWorker); }; - this.getUseWorker = function() { return this.$useWorker; }; - this.onReloadTokenizer = function(e) { + EditSession.prototype.setUseWorker = function (useWorker) { this.setOption("useWorker", useWorker); }; + EditSession.prototype.getUseWorker = function () { return this.$useWorker; }; + EditSession.prototype.onReloadTokenizer = function (e) { var rows = e.data; this.bgTokenizer.start(rows.first); this._signal("tokenizerUpdate", e); }; - - this.$modes = config.$modes; - this.$mode = null; - this.$modeId = null; - this.setMode = function(mode, cb) { + EditSession.prototype.setMode = function (mode, cb) { if (mode && typeof mode === "object") { if (mode.getTokenizer) return this.$onChangeMode(mode); var options = mode; var path = options.path; - } else { - path = mode || "ace/mode/text"; + } + else { + path = /**@type{string}*/ (mode) || "ace/mode/text"; } if (!this.$modes["ace/mode/text"]) this.$modes["ace/mode/text"] = new TextMode(); - if (this.$modes[path] && !options) { this.$onChangeMode(this.$modes[path]); cb && cb(); return; } this.$modeId = path; - config.loadModule(["mode", path], function(m) { + config.loadModule(["mode", path], function (m) { if (this.$modeId !== path) return cb && cb(); if (this.$modes[path] && !options) { this.$onChangeMode(this.$modes[path]); - } else if (m && m.Mode) { + } + else if (m && m.Mode) { m = new m.Mode(options); if (!options) { this.$modes[path] = m; @@ -28440,120 +28218,91 @@ EditSession.$uid = 0; if (!this.$mode) this.$onChangeMode(this.$modes["ace/mode/text"], true); }; - - this.$onChangeMode = function(mode, $isPlaceholder) { + EditSession.prototype.$onChangeMode = function (mode, $isPlaceholder) { if (!$isPlaceholder) this.$modeId = mode.$id; if (this.$mode === mode) return; - var oldMode = this.$mode; this.$mode = mode; - this.$stopWorker(); - if (this.$useWorker) this.$startWorker(); - var tokenizer = mode.getTokenizer(); - - if(tokenizer.on !== undefined) { + if (tokenizer.on !== undefined) { var onReloadTokenizer = this.onReloadTokenizer.bind(this); tokenizer.on("update", onReloadTokenizer); } - - if (!this.bgTokenizer) { - this.bgTokenizer = new BackgroundTokenizer(tokenizer); - var _self = this; - this.bgTokenizer.on("update", function(e) { - _self._signal("tokenizerUpdate", e); - }); - } else { - this.bgTokenizer.setTokenizer(tokenizer); - } - + this.bgTokenizer.setTokenizer(tokenizer); this.bgTokenizer.setDocument(this.getDocument()); - this.tokenRe = mode.tokenRe; this.nonTokenRe = mode.nonTokenRe; - - if (!$isPlaceholder) { if (mode.attachToSession) mode.attachToSession(this); this.$options.wrapMethod.set.call(this, this.$wrapMethod); this.$setFolding(mode.foldingRules); this.bgTokenizer.start(0); - this._emit("changeMode", {oldMode: oldMode, mode: mode}); + this._emit("changeMode", { oldMode: oldMode, mode: mode }); } }; - - this.$stopWorker = function() { + EditSession.prototype.$stopWorker = function () { if (this.$worker) { this.$worker.terminate(); this.$worker = null; } }; - - this.$startWorker = function() { + EditSession.prototype.$startWorker = function () { try { this.$worker = this.$mode.createWorker(this); - } catch (e) { + } + catch (e) { config.warn("Could not load worker", e); this.$worker = null; } }; - this.getMode = function() { + EditSession.prototype.getMode = function () { return this.$mode; }; - - this.$scrollTop = 0; - this.setScrollTop = function(scrollTop) { + EditSession.prototype.setScrollTop = function (scrollTop) { if (this.$scrollTop === scrollTop || isNaN(scrollTop)) return; - this.$scrollTop = scrollTop; this._signal("changeScrollTop", scrollTop); }; - this.getScrollTop = function() { + EditSession.prototype.getScrollTop = function () { return this.$scrollTop; }; - - this.$scrollLeft = 0; - this.setScrollLeft = function(scrollLeft) { + EditSession.prototype.setScrollLeft = function (scrollLeft) { if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft)) return; - this.$scrollLeft = scrollLeft; this._signal("changeScrollLeft", scrollLeft); }; - this.getScrollLeft = function() { + EditSession.prototype.getScrollLeft = function () { return this.$scrollLeft; }; - this.getScreenWidth = function() { + EditSession.prototype.getScreenWidth = function () { this.$computeWidth(); if (this.lineWidgets) return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth); return this.screenWidth; }; - - this.getLineWidgetMaxWidth = function() { - if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth; + EditSession.prototype.getLineWidgetMaxWidth = function () { + if (this.lineWidgetsWidth != null) + return this.lineWidgetsWidth; var width = 0; - this.lineWidgets.forEach(function(w) { + this.lineWidgets.forEach(function (w) { if (w && w.screenWidth > width) width = w.screenWidth; }); return this.lineWidgetWidth = width; }; - - this.$computeWidth = function(force) { + EditSession.prototype.$computeWidth = function (force) { if (this.$modified || force) { this.$modified = false; - if (this.$useWrapMode) return this.screenWidth = this.$wrapLimit; - var lines = this.doc.getAllLines(); var cache = this.$rowLengthCache; var longestScreenLine = 0; @@ -28561,7 +28310,6 @@ EditSession.$uid = 0; var foldLine = this.$foldData[foldIndex]; var foldStart = foldLine ? foldLine.start.row : Infinity; var len = lines.length; - for (var i = 0; i < len; i++) { if (i > foldStart) { i = foldLine.end.row + 1; @@ -28570,47 +28318,45 @@ EditSession.$uid = 0; foldLine = this.$foldData[foldIndex++]; foldStart = foldLine ? foldLine.start.row : Infinity; } - if (cache[i] == null) cache[i] = this.$getStringScreenWidth(lines[i])[0]; - if (cache[i] > longestScreenLine) longestScreenLine = cache[i]; } this.screenWidth = longestScreenLine; } }; - this.getLine = function(row) { + EditSession.prototype.getLine = function (row) { return this.doc.getLine(row); }; - this.getLines = function(firstRow, lastRow) { + EditSession.prototype.getLines = function (firstRow, lastRow) { return this.doc.getLines(firstRow, lastRow); }; - this.getLength = function() { + EditSession.prototype.getLength = function () { return this.doc.getLength(); }; - this.getTextRange = function(range) { + EditSession.prototype.getTextRange = function (range) { return this.doc.getTextRange(range || this.selection.getRange()); }; - this.insert = function(position, text) { + EditSession.prototype.insert = function (position, text) { return this.doc.insert(position, text); }; - this.remove = function(range) { + EditSession.prototype.remove = function (range) { return this.doc.remove(range); }; - this.removeFullLines = function(firstRow, lastRow){ + EditSession.prototype.removeFullLines = function (firstRow, lastRow) { return this.doc.removeFullLines(firstRow, lastRow); }; - this.undoChanges = function(deltas, dontSelect) { + EditSession.prototype.undoChanges = function (deltas, dontSelect) { if (!deltas.length) return; - this.$fromUndo = true; for (var i = deltas.length - 1; i != -1; i--) { var delta = deltas[i]; if (delta.action == "insert" || delta.action == "remove") { this.doc.revertDelta(delta); - } else if (delta.folds) { + } + else if (delta.folds) { this.addFolds(delta.folds); } } @@ -28622,10 +28368,9 @@ EditSession.$uid = 0; } this.$fromUndo = false; }; - this.redoChanges = function(deltas, dontSelect) { + EditSession.prototype.redoChanges = function (deltas, dontSelect) { if (!deltas.length) return; - this.$fromUndo = true; for (var i = 0; i < deltas.length; i++) { var delta = deltas[i]; @@ -28633,7 +28378,6 @@ EditSession.$uid = 0; this.doc.$safeApplyDelta(delta); } } - if (!dontSelect && this.$undoSelect) { if (deltas.selectionAfter) this.selection.fromJSON(deltas.selectionAfter); @@ -28642,29 +28386,27 @@ EditSession.$uid = 0; } this.$fromUndo = false; }; - this.setUndoSelect = function(enable) { + EditSession.prototype.setUndoSelect = function (enable) { this.$undoSelect = enable; }; - - this.$getUndoSelection = function(deltas, isUndo) { + EditSession.prototype.$getUndoSelection = function (deltas, isUndo) { function isInsert(delta) { return isUndo ? delta.action !== "insert" : delta.action === "insert"; } - var range, point; - for (var i = 0; i < deltas.length; i++) { var delta = deltas[i]; - if (!delta.start) continue; // skip folds + if (!delta.start) + continue; // skip folds if (!range) { if (isInsert(delta)) { range = Range.fromPoints(delta.start, delta.end); - } else { + } + else { range = Range.fromPoints(delta.start, delta.start); } continue; } - if (isInsert(delta)) { point = delta.start; if (range.compare(point.row, point.column) == -1) { @@ -28674,7 +28416,8 @@ EditSession.$uid = 0; if (range.compare(point.row, point.column) == 1) { range.setEnd(point); } - } else { + } + else { point = delta.start; if (range.compare(point.row, point.column) == -1) { range = Range.fromPoints(delta.start, delta.start); @@ -28683,13 +28426,12 @@ EditSession.$uid = 0; } return range; }; - this.replace = function(range, text) { + EditSession.prototype.replace = function (range, text) { return this.doc.replace(range, text); }; - this.moveText = function(fromRange, toPosition, copy) { + EditSession.prototype.moveText = function (fromRange, toPosition, copy) { var text = this.getTextRange(fromRange); var folds = this.getFoldsInRange(fromRange); - var toRange = Range.fromPoints(toPosition, toPosition); if (!copy) { this.remove(fromRange); @@ -28706,14 +28448,13 @@ EditSession.$uid = 0; toRange.end.row += rowDiff; } } - toRange.end = this.insert(toRange.start, text); if (folds.length) { var oldStart = fromRange.start; var newStart = toRange.start; var rowDiff = newStart.row - oldStart.row; var collDiff = newStart.column - oldStart.column; - this.addFolds(folds.map(function(x) { + this.addFolds(folds.map(function (x) { x = x.clone(); if (x.start.row == oldStart.row) x.start.column += collDiff; @@ -28724,22 +28465,19 @@ EditSession.$uid = 0; return x; })); } - return toRange; }; - this.indentRows = function(startRow, endRow, indentString) { + EditSession.prototype.indentRows = function (startRow, endRow, indentString) { indentString = indentString.replace(/\t/g, this.getTabString()); - for (var row=startRow; row<=endRow; row++) - this.doc.insertInLine({row: row, column: 0}, indentString); + for (var row = startRow; row <= endRow; row++) + this.doc.insertInLine({ row: row, column: 0 }, indentString); }; - this.outdentRows = function (range) { + EditSession.prototype.outdentRows = function (range) { var rowRange = range.collapseRows(); var deleteRange = new Range(0, 0, 0, 0); var size = this.getTabSize(); - for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) { var line = this.getLine(i); - deleteRange.start.row = i; deleteRange.end.row = i; for (var j = 0; j < size; ++j) @@ -28748,120 +28486,105 @@ EditSession.$uid = 0; if (j < size && line.charAt(j) == '\t') { deleteRange.start.column = j; deleteRange.end.column = j + 1; - } else { + } + else { deleteRange.start.column = 0; deleteRange.end.column = j; } this.remove(deleteRange); } }; - - this.$moveLines = function(firstRow, lastRow, dir) { + EditSession.prototype.$moveLines = function (firstRow, lastRow, dir) { firstRow = this.getRowFoldStart(firstRow); lastRow = this.getRowFoldEnd(lastRow); if (dir < 0) { var row = this.getRowFoldStart(firstRow + dir); - if (row < 0) return 0; - var diff = row-firstRow; - } else if (dir > 0) { + if (row < 0) + return 0; + var diff = row - firstRow; + } + else if (dir > 0) { var row = this.getRowFoldEnd(lastRow + dir); - if (row > this.doc.getLength()-1) return 0; - var diff = row-lastRow; - } else { + if (row > this.doc.getLength() - 1) + return 0; + var diff = row - lastRow; + } + else { firstRow = this.$clipRowToDocument(firstRow); lastRow = this.$clipRowToDocument(lastRow); var diff = lastRow - firstRow + 1; } - var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE); - var folds = this.getFoldsInRange(range).map(function(x){ + var folds = this.getFoldsInRange(range).map(function (x) { x = x.clone(); x.start.row += diff; x.end.row += diff; return x; }); - var lines = dir == 0 ? this.doc.getLines(firstRow, lastRow) : this.doc.removeFullLines(firstRow, lastRow); - this.doc.insertFullLines(firstRow+diff, lines); + this.doc.insertFullLines(firstRow + diff, lines); folds.length && this.addFolds(folds); return diff; }; - this.moveLinesUp = function(firstRow, lastRow) { + EditSession.prototype.moveLinesUp = function (firstRow, lastRow) { return this.$moveLines(firstRow, lastRow, -1); }; - this.moveLinesDown = function(firstRow, lastRow) { + EditSession.prototype.moveLinesDown = function (firstRow, lastRow) { return this.$moveLines(firstRow, lastRow, 1); }; - this.duplicateLines = function(firstRow, lastRow) { + EditSession.prototype.duplicateLines = function (firstRow, lastRow) { return this.$moveLines(firstRow, lastRow, 0); }; - - - this.$clipRowToDocument = function(row) { - return Math.max(0, Math.min(row, this.doc.getLength()-1)); + EditSession.prototype.$clipRowToDocument = function (row) { + return Math.max(0, Math.min(row, this.doc.getLength() - 1)); }; - - this.$clipColumnToRow = function(row, column) { + EditSession.prototype.$clipColumnToRow = function (row, column) { if (column < 0) return 0; return Math.min(this.doc.getLine(row).length, column); }; - - - this.$clipPositionToDocument = function(row, column) { + EditSession.prototype.$clipPositionToDocument = function (row, column) { column = Math.max(0, column); - if (row < 0) { row = 0; column = 0; - } else { + } + else { var len = this.doc.getLength(); if (row >= len) { row = len - 1; - column = this.doc.getLine(len-1).length; - } else { + column = this.doc.getLine(len - 1).length; + } + else { column = Math.min(this.doc.getLine(row).length, column); } } - return { row: row, column: column }; }; - - this.$clipRangeToDocument = function(range) { + EditSession.prototype.$clipRangeToDocument = function (range) { if (range.start.row < 0) { range.start.row = 0; range.start.column = 0; - } else { - range.start.column = this.$clipColumnToRow( - range.start.row, - range.start.column - ); } - + else { + range.start.column = this.$clipColumnToRow(range.start.row, range.start.column); + } var len = this.doc.getLength() - 1; if (range.end.row > len) { range.end.row = len; range.end.column = this.doc.getLine(len).length; - } else { - range.end.column = this.$clipColumnToRow( - range.end.row, - range.end.column - ); + } + else { + range.end.column = this.$clipColumnToRow(range.end.row, range.end.column); } return range; }; - this.$wrapLimit = 80; - this.$useWrapMode = false; - this.$wrapLimitRange = { - min : null, - max : null - }; - this.setUseWrapMode = function(useWrapMode) { + EditSession.prototype.setUseWrapMode = function (useWrapMode) { if (useWrapMode != this.$useWrapMode) { this.$useWrapMode = useWrapMode; this.$modified = true; @@ -28871,14 +28594,13 @@ EditSession.$uid = 0; this.$wrapData = Array(len); this.$updateWrapData(0, len - 1); } - this._signal("changeWrapMode"); } }; - this.getUseWrapMode = function() { + EditSession.prototype.getUseWrapMode = function () { return this.$useWrapMode; }; - this.setWrapLimitRange = function(min, max) { + EditSession.prototype.setWrapLimitRange = function (min, max) { if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { this.$wrapLimitRange = { min: min, max: max }; this.$modified = true; @@ -28887,10 +28609,10 @@ EditSession.$uid = 0; this._signal("changeWrapMode"); } }; - this.adjustWrapLimit = function(desiredLimit, $printMargin) { + EditSession.prototype.adjustWrapLimit = function (desiredLimit, $printMargin) { var limits = this.$wrapLimitRange; if (limits.max < 0) - limits = {min: $printMargin, max: $printMargin}; + limits = { min: $printMargin, max: $printMargin }; var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max); if (wrapLimit != this.$wrapLimit && wrapLimit > 1) { this.$wrapLimit = wrapLimit; @@ -28904,30 +28626,26 @@ EditSession.$uid = 0; } return false; }; - - this.$constrainWrapLimit = function(wrapLimit, min, max) { + EditSession.prototype.$constrainWrapLimit = function (wrapLimit, min, max) { if (min) wrapLimit = Math.max(min, wrapLimit); - if (max) wrapLimit = Math.min(max, wrapLimit); - return wrapLimit; }; - this.getWrapLimit = function() { + EditSession.prototype.getWrapLimit = function () { return this.$wrapLimit; }; - this.setWrapLimit = function (limit) { + EditSession.prototype.setWrapLimit = function (limit) { this.setWrapLimitRange(limit, limit); }; - this.getWrapLimitRange = function() { + EditSession.prototype.getWrapLimitRange = function () { return { - min : this.$wrapLimitRange.min, - max : this.$wrapLimitRange.max + min: this.$wrapLimitRange.min, + max: this.$wrapLimitRange.max }; }; - - this.$updateInternalDataOnChange = function(delta) { + EditSession.prototype.$updateInternalDataOnChange = function (delta) { var useWrapMode = this.$useWrapMode; var action = delta.action; var start = delta.start; @@ -28936,22 +28654,18 @@ EditSession.$uid = 0; var lastRow = end.row; var len = lastRow - firstRow; var removedFolds = null; - this.$updating = true; if (len != 0) { if (action === "remove") { this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len); - var foldLines = this.$foldData; removedFolds = this.getFoldsInRange(delta); this.removeFolds(removedFolds); - var foldLine = this.getFoldLine(end.row); var idx = 0; if (foldLine) { foldLine.addRemoveChars(end.row, end.column, start.column - end.column); foldLine.shiftRow(-len); - var foldLineBefore = this.getFoldLine(firstRow); if (foldLineBefore && foldLineBefore !== foldLine) { foldLineBefore.merge(foldLine); @@ -28959,16 +28673,15 @@ EditSession.$uid = 0; } idx = foldLines.indexOf(foldLine) + 1; } - for (idx; idx < foldLines.length; idx++) { var foldLine = foldLines[idx]; if (foldLine.start.row >= end.row) { foldLine.shiftRow(-len); } } - lastRow = firstRow; - } else { + } + else { var args = Array(len); args.unshift(firstRow, 0); var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache; @@ -28984,14 +28697,14 @@ EditSession.$uid = 0; foldLine.shiftRow(len); foldLine.addRemoveChars(lastRow, 0, end.column - start.column); } - } else + } + else if (cmp == -1) { foldLine.addRemoveChars(firstRow, 0, end.column - start.column); foldLine.shiftRow(len); } idx = foldLines.indexOf(foldLine) + 1; } - for (idx; idx < foldLines.length; idx++) { var foldLine = foldLines[idx]; if (foldLine.start.row >= firstRow) { @@ -28999,12 +28712,12 @@ EditSession.$uid = 0; } } } - } else { + } + else { len = Math.abs(delta.start.column - delta.end.column); if (action === "remove") { removedFolds = this.getFoldsInRange(delta); this.removeFolds(removedFolds); - len = -len; } var foldLine = this.getFoldLine(firstRow); @@ -29012,33 +28725,27 @@ EditSession.$uid = 0; foldLine.addRemoveChars(firstRow, start.column, len); } } - if (useWrapMode && this.$wrapData.length != this.doc.getLength()) { console.error("doc.getLength() and $wrapData.length have to be the same!"); } this.$updating = false; - if (useWrapMode) this.$updateWrapData(firstRow, lastRow); else this.$updateRowLengthCache(firstRow, lastRow); - return removedFolds; }; - - this.$updateRowLengthCache = function(firstRow, lastRow, b) { + EditSession.prototype.$updateRowLengthCache = function (firstRow, lastRow) { this.$rowLengthCache[firstRow] = null; this.$rowLengthCache[lastRow] = null; }; - - this.$updateWrapData = function(firstRow, lastRow) { + EditSession.prototype.$updateWrapData = function (firstRow, lastRow) { var lines = this.doc.getAllLines(); var tabSize = this.getTabSize(); var wrapData = this.$wrapData; var wrapLimit = this.$wrapLimit; var tokens; var foldLine; - var row = firstRow; lastRow = Math.min(lastRow, lines.length - 1); while (row <= lastRow) { @@ -29046,59 +28753,40 @@ EditSession.$uid = 0; if (!foldLine) { tokens = this.$getDisplayTokens(lines[row]); wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); - row ++; - } else { + row++; + } + else { tokens = []; - foldLine.walk(function(placeholder, row, column, lastColumn) { - var walkTokens; - if (placeholder != null) { - walkTokens = this.$getDisplayTokens( - placeholder, tokens.length); - walkTokens[0] = PLACEHOLDER_START; - for (var i = 1; i < walkTokens.length; i++) { - walkTokens[i] = PLACEHOLDER_BODY; - } - } else { - walkTokens = this.$getDisplayTokens( - lines[row].substring(lastColumn, column), - tokens.length); + foldLine.walk(function (placeholder, row, column, lastColumn) { + var walkTokens; + if (placeholder != null) { + walkTokens = this.$getDisplayTokens(placeholder, tokens.length); + walkTokens[0] = PLACEHOLDER_START; + for (var i = 1; i < walkTokens.length; i++) { + walkTokens[i] = PLACEHOLDER_BODY; } - tokens = tokens.concat(walkTokens); - }.bind(this), - foldLine.end.row, - lines[foldLine.end.row].length + 1 - ); - + } + else { + walkTokens = this.$getDisplayTokens(lines[row].substring(lastColumn, column), tokens.length); + } + tokens = tokens.concat(walkTokens); + }.bind(this), foldLine.end.row, lines[foldLine.end.row].length + 1); wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); row = foldLine.end.row + 1; } } }; - var CHAR = 1, - CHAR_EXT = 2, - PLACEHOLDER_START = 3, - PLACEHOLDER_BODY = 4, - PUNCTUATION = 9, - SPACE = 10, - TAB = 11, - TAB_SPACE = 12; - - - this.$computeWrapSplits = function(tokens, wrapLimit, tabSize) { + EditSession.prototype.$computeWrapSplits = function (tokens, wrapLimit, tabSize) { if (tokens.length == 0) { return []; } - var splits = []; var displayLength = tokens.length; var lastSplit = 0, lastDocSplit = 0; - var isCode = this.$wrapAsCode; - var indentedSoftWrap = this.$indentedSoftWrap; var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8) || indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2); - function getWrapIndent() { var indentation = 0; if (maxIndent === 0) @@ -29124,9 +28812,9 @@ EditSession.$uid = 0; var len = screenPos - lastSplit; for (var i = lastSplit; i < screenPos; i++) { var ch = tokens[i]; - if (ch === 12 || ch === 2) len -= 1; + if (ch === 12 || ch === 2) + len -= 1; } - if (!splits.length) { indent = getWrapIndent(); splits.indent = indent; @@ -29159,25 +28847,26 @@ EditSession.$uid = 0; } } if (split == tokens.length) { - break; // Breaks the while-loop. + break; // Breaks the while-loop. } addSplit(split); continue; } - var minSplit = Math.max(split - (wrapLimit -(wrapLimit>>2)), lastSplit - 1); + var minSplit = Math.max(split - (wrapLimit - (wrapLimit >> 2)), lastSplit - 1); while (split > minSplit && tokens[split] < PLACEHOLDER_START) { - split --; + split--; } if (isCode) { while (split > minSplit && tokens[split] < PLACEHOLDER_START) { - split --; + split--; } while (split > minSplit && tokens[split] == PUNCTUATION) { - split --; + split--; } - } else { + } + else { while (split > minSplit && tokens[split] < SPACE) { - split --; + split--; } } if (split > minSplit) { @@ -29191,11 +28880,10 @@ EditSession.$uid = 0; } return splits; }; - this.$getDisplayTokens = function(str, offset) { + EditSession.prototype.$getDisplayTokens = function (str, offset) { var arr = []; var tabSize; offset = offset || 0; - for (var i = 0; i < str.length; i++) { var c = str.charCodeAt(i); if (c == 9) { @@ -29207,24 +28895,25 @@ EditSession.$uid = 0; } else if (c == 32) { arr.push(SPACE); - } else if((c > 39 && c < 48) || (c > 57 && c < 64)) { + } + else if ((c > 39 && c < 48) || (c > 57 && c < 64)) { arr.push(PUNCTUATION); } else if (c >= 0x1100 && isFullWidth(c)) { arr.push(CHAR, CHAR_EXT); - } else { + } + else { arr.push(CHAR); } } return arr; }; - this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { + EditSession.prototype.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) { if (maxScreenColumn == 0) return [0, 0]; if (maxScreenColumn == null) maxScreenColumn = Infinity; screenColumn = screenColumn || 0; - var c, column; for (column = 0; column < str.length; column++) { c = str.charCodeAt(column); @@ -29233,88 +28922,81 @@ EditSession.$uid = 0; } else if (c >= 0x1100 && isFullWidth(c)) { screenColumn += 2; - } else { + } + else { screenColumn += 1; } if (screenColumn > maxScreenColumn) { break; } } - return [screenColumn, column]; }; - - this.lineWidgets = null; - this.getRowLength = function(row) { + EditSession.prototype.getRowLength = function (row) { var h = 1; if (this.lineWidgets) h += this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; - if (!this.$useWrapMode || !this.$wrapData[row]) return h; else return this.$wrapData[row].length + h; }; - this.getRowLineCount = function(row) { + EditSession.prototype.getRowLineCount = function (row) { if (!this.$useWrapMode || !this.$wrapData[row]) { return 1; - } else { + } + else { return this.$wrapData[row].length + 1; } }; - - this.getRowWrapIndent = function(screenRow) { + EditSession.prototype.getRowWrapIndent = function (screenRow) { if (this.$useWrapMode) { var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); var splits = this.$wrapData[pos.row]; return splits.length && splits[0] < pos.column ? splits.indent : 0; - } else { + } + else { return 0; } }; - this.getScreenLastRowColumn = function(screenRow) { + EditSession.prototype.getScreenLastRowColumn = function (screenRow) { var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); return this.documentToScreenColumn(pos.row, pos.column); }; - this.getDocumentLastRowColumn = function(docRow, docColumn) { + EditSession.prototype.getDocumentLastRowColumn = function (docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.getScreenLastRowColumn(screenRow); }; - this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { + EditSession.prototype.getDocumentLastRowColumnPosition = function (docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); }; - this.getRowSplitData = function(row) { + EditSession.prototype.getRowSplitData = function (row) { if (!this.$useWrapMode) { return undefined; - } else { + } + else { return this.$wrapData[row]; } }; - this.getScreenTabSize = function(screenColumn) { + EditSession.prototype.getScreenTabSize = function (screenColumn) { return this.$tabSize - (screenColumn % this.$tabSize | 0); }; - - - this.screenToDocumentRow = function(screenRow, screenColumn) { + EditSession.prototype.screenToDocumentRow = function (screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).row; }; - - - this.screenToDocumentColumn = function(screenRow, screenColumn) { + EditSession.prototype.screenToDocumentColumn = function (screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).column; }; - this.screenToDocumentPosition = function(screenRow, screenColumn, offsetX) { + EditSession.prototype.screenToDocumentPosition = function (screenRow, screenColumn, offsetX) { if (screenRow < 0) - return {row: 0, column: 0}; - + return { row: 0, column: 0 }; var line; var docRow = 0; var docColumn = 0; var column; var row = 0; var rowLength = 0; - var rowCache = this.$screenRowCache; var i = this.$getRowCacheIndex(rowCache, screenRow); var l = rowCache.length; @@ -29322,43 +29004,43 @@ EditSession.$uid = 0; var row = rowCache[i]; var docRow = this.$docRowCache[i]; var doCache = screenRow > rowCache[l - 1]; - } else { + } + else { var doCache = !l; } - var maxRow = this.getLength() - 1; var foldLine = this.getNextFoldLine(docRow); var foldStart = foldLine ? foldLine.start.row : Infinity; - while (row <= screenRow) { rowLength = this.getRowLength(docRow); if (row + rowLength > screenRow || docRow >= maxRow) { break; - } else { + } + else { row += rowLength; docRow++; if (docRow > foldStart) { - docRow = foldLine.end.row+1; + docRow = foldLine.end.row + 1; foldLine = this.getNextFoldLine(docRow, foldLine); foldStart = foldLine ? foldLine.start.row : Infinity; } } - if (doCache) { this.$docRowCache.push(docRow); this.$screenRowCache.push(row); } } - if (foldLine && foldLine.start.row <= docRow) { line = this.getFoldDisplayLine(foldLine); docRow = foldLine.start.row; - } else if (row + rowLength <= screenRow || docRow > maxRow) { + } + else if (row + rowLength <= screenRow || docRow > maxRow) { return { row: maxRow, column: this.getLine(maxRow).length }; - } else { + } + else { line = this.getLine(docRow); foldLine = null; } @@ -29367,35 +29049,29 @@ EditSession.$uid = 0; var splits = this.$wrapData[docRow]; if (splits) { column = splits[splitIndex]; - if(splitIndex > 0 && splits.length) { + if (splitIndex > 0 && splits.length) { wrapIndent = splits.indent; docColumn = splits[splitIndex - 1] || splits[splits.length - 1]; line = line.substring(docColumn); } } } - if (offsetX !== undefined && this.$bidiHandler.isBidiRow(row + splitIndex, docRow, splitIndex)) screenColumn = this.$bidiHandler.offsetToCol(offsetX); - docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1]; if (this.$useWrapMode && docColumn >= column) docColumn = column - 1; - if (foldLine) return foldLine.idxToPosition(docColumn); - - return {row: docRow, column: docColumn}; + return { row: docRow, column: docColumn }; }; - this.documentToScreenPosition = function(docRow, docColumn) { + EditSession.prototype.documentToScreenPosition = function (docRow, docColumn) { if (typeof docColumn === "undefined") - var pos = this.$clipPositionToDocument(docRow.row, docRow.column); + var pos = this.$clipPositionToDocument(/**@type{Point}*/ (docRow).row, /**@type{Point}*/ (docRow).column); else - pos = this.$clipPositionToDocument(docRow, docColumn); - + pos = this.$clipPositionToDocument(/**@type{number}*/ (docRow), docColumn); docRow = pos.row; docColumn = pos.column; - var screenRow = 0; var foldStartRow = null; var fold = null; @@ -29404,10 +29080,7 @@ EditSession.$uid = 0; docRow = fold.start.row; docColumn = fold.start.column; } - var rowEnd, row = 0; - - var rowCache = this.$docRowCache; var i = this.$getRowCacheIndex(rowCache, docRow); var l = rowCache.length; @@ -29415,28 +29088,25 @@ EditSession.$uid = 0; var row = rowCache[i]; var screenRow = this.$screenRowCache[i]; var doCache = docRow > rowCache[l - 1]; - } else { + } + else { var doCache = !l; } - var foldLine = this.getNextFoldLine(row); - var foldStart = foldLine ?foldLine.start.row :Infinity; - + var foldStart = foldLine ? foldLine.start.row : Infinity; while (row < docRow) { if (row >= foldStart) { rowEnd = foldLine.end.row + 1; if (rowEnd > docRow) break; foldLine = this.getNextFoldLine(rowEnd, foldLine); - foldStart = foldLine ?foldLine.start.row :Infinity; + foldStart = foldLine ? foldLine.start.row : Infinity; } else { rowEnd = row + 1; } - screenRow += this.getRowLength(row); row = rowEnd; - if (doCache) { this.$docRowCache.push(row); this.$screenRowCache.push(screenRow); @@ -29446,7 +29116,8 @@ EditSession.$uid = 0; if (foldLine && row >= foldStart) { textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn); foldStartRow = foldLine.start.row; - } else { + } + else { textLine = this.getLine(docRow).substring(0, docColumn); foldStartRow = docRow; } @@ -29456,1757 +29127,2504 @@ EditSession.$uid = 0; if (wrapRow) { var screenRowOffset = 0; while (textLine.length >= wrapRow[screenRowOffset]) { - screenRow ++; + screenRow++; screenRowOffset++; } - textLine = textLine.substring( - wrapRow[screenRowOffset - 1] || 0, textLine.length - ); + textLine = textLine.substring(wrapRow[screenRowOffset - 1] || 0, textLine.length); wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0; } } - if (this.lineWidgets && this.lineWidgets[row] && this.lineWidgets[row].rowsAbove) screenRow += this.lineWidgets[row].rowsAbove; - return { row: screenRow, column: wrapIndent + this.$getStringScreenWidth(textLine)[0] }; }; - this.documentToScreenColumn = function(row, docColumn) { - return this.documentToScreenPosition(row, docColumn).column; + EditSession.prototype.documentToScreenColumn = function (row, docColumn) { + return this.documentToScreenPosition(row, docColumn).column; + }; + EditSession.prototype.documentToScreenRow = function (docRow, docColumn) { + return this.documentToScreenPosition(docRow, docColumn).row; + }; + EditSession.prototype.getScreenLength = function () { + var screenRows = 0; + var fold = null; + if (!this.$useWrapMode) { + screenRows = this.getLength(); + var foldData = this.$foldData; + for (var i = 0; i < foldData.length; i++) { + fold = foldData[i]; + screenRows -= fold.end.row - fold.start.row; + } + } + else { + var lastRow = this.$wrapData.length; + var row = 0, i = 0; + var fold = this.$foldData[i++]; + var foldStart = fold ? fold.start.row : Infinity; + while (row < lastRow) { + var splits = this.$wrapData[row]; + screenRows += splits ? splits.length + 1 : 1; + row++; + if (row > foldStart) { + row = fold.end.row + 1; + fold = this.$foldData[i++]; + foldStart = fold ? fold.start.row : Infinity; + } + } + } + if (this.lineWidgets) + screenRows += this.$getWidgetScreenLength(); + return screenRows; + }; + EditSession.prototype.$setFontMetrics = function (fm) { + if (!this.$enableVarChar) + return; + this.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) { + if (maxScreenColumn === 0) + return [0, 0]; + if (!maxScreenColumn) + maxScreenColumn = Infinity; + screenColumn = screenColumn || 0; + var c, column; + for (column = 0; column < str.length; column++) { + c = str.charAt(column); + if (c === "\t") { + screenColumn += this.getScreenTabSize(screenColumn); + } + else { + screenColumn += fm.getCharacterWidth(c); + } + if (screenColumn > maxScreenColumn) { + break; + } + } + return [screenColumn, column]; + }; + }; + EditSession.prototype.getPrecedingCharacter = function () { + var pos = this.selection.getCursor(); + if (pos.column === 0) { + return pos.row === 0 ? "" : this.doc.getNewLineCharacter(); + } + var currentLine = this.getLine(pos.row); + return currentLine[pos.column - 1]; + }; + EditSession.prototype.destroy = function () { + if (!this.destroyed) { + this.bgTokenizer.setDocument(null); + this.bgTokenizer.cleanup(); + this.destroyed = true; + } + this.endOperation(); + this.$stopWorker(); + this.removeAllListeners(); + if (this.doc) { + this.doc.off("change", this.$onChange); + } + if (this.selection) { + this.selection.off("changeCursor", this.$onSelectionChange); + this.selection.off("changeSelection", this.$onSelectionChange); + } + this.selection.detach(); + }; + return EditSession; +}()); +EditSession.$uid = 0; +EditSession.prototype.$modes = config.$modes; +EditSession.prototype.getValue = EditSession.prototype.toString; +EditSession.prototype.$defaultUndoManager = { + undo: function () { }, + redo: function () { }, + hasUndo: function () { }, + hasRedo: function () { }, + reset: function () { }, + add: function () { }, + addSelection: function () { }, + startNewGroup: function () { }, + addSession: function () { } +}; +EditSession.prototype.$overwrite = false; +EditSession.prototype.$mode = null; +EditSession.prototype.$modeId = null; +EditSession.prototype.$scrollTop = 0; +EditSession.prototype.$scrollLeft = 0; +EditSession.prototype.$wrapLimit = 80; +EditSession.prototype.$useWrapMode = false; +EditSession.prototype.$wrapLimitRange = { + min: null, + max: null +}; +EditSession.prototype.lineWidgets = null; +EditSession.prototype.isFullWidth = isFullWidth; +oop.implement(EditSession.prototype, EventEmitter); +var CHAR = 1, CHAR_EXT = 2, PLACEHOLDER_START = 3, PLACEHOLDER_BODY = 4, PUNCTUATION = 9, SPACE = 10, TAB = 11, TAB_SPACE = 12; +function isFullWidth(c) { + if (c < 0x1100) + return false; + return c >= 0x1100 && c <= 0x115F || + c >= 0x11A3 && c <= 0x11A7 || + c >= 0x11FA && c <= 0x11FF || + c >= 0x2329 && c <= 0x232A || + c >= 0x2E80 && c <= 0x2E99 || + c >= 0x2E9B && c <= 0x2EF3 || + c >= 0x2F00 && c <= 0x2FD5 || + c >= 0x2FF0 && c <= 0x2FFB || + c >= 0x3000 && c <= 0x303E || + c >= 0x3041 && c <= 0x3096 || + c >= 0x3099 && c <= 0x30FF || + c >= 0x3105 && c <= 0x312D || + c >= 0x3131 && c <= 0x318E || + c >= 0x3190 && c <= 0x31BA || + c >= 0x31C0 && c <= 0x31E3 || + c >= 0x31F0 && c <= 0x321E || + c >= 0x3220 && c <= 0x3247 || + c >= 0x3250 && c <= 0x32FE || + c >= 0x3300 && c <= 0x4DBF || + c >= 0x4E00 && c <= 0xA48C || + c >= 0xA490 && c <= 0xA4C6 || + c >= 0xA960 && c <= 0xA97C || + c >= 0xAC00 && c <= 0xD7A3 || + c >= 0xD7B0 && c <= 0xD7C6 || + c >= 0xD7CB && c <= 0xD7FB || + c >= 0xF900 && c <= 0xFAFF || + c >= 0xFE10 && c <= 0xFE19 || + c >= 0xFE30 && c <= 0xFE52 || + c >= 0xFE54 && c <= 0xFE66 || + c >= 0xFE68 && c <= 0xFE6B || + c >= 0xFF01 && c <= 0xFF60 || + c >= 0xFFE0 && c <= 0xFFE6; +} +require("./edit_session/folding").Folding.call(EditSession.prototype); +require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype); +config.defineOptions(EditSession.prototype, "session", { + wrap: { + set: function (value) { + if (!value || value == "off") + value = false; + else if (value == "free") + value = true; + else if (value == "printMargin") + value = -1; + else if (typeof value == "string") + value = parseInt(value, 10) || false; + if (this.$wrap == value) + return; + this.$wrap = value; + if (!value) { + this.setUseWrapMode(false); + } + else { + var col = typeof value == "number" ? value : null; + this.setWrapLimitRange(col, col); + this.setUseWrapMode(true); + } + }, + get: function () { + if (this.getUseWrapMode()) { + if (this.$wrap == -1) + return "printMargin"; + if (!this.getWrapLimitRange().min) + return "free"; + return this.$wrap; + } + return "off"; + }, + handlesSet: true + }, + wrapMethod: { + set: function (val) { + val = val == "auto" + ? this.$mode.type != "text" + : val != "text"; + if (val != this.$wrapAsCode) { + this.$wrapAsCode = val; + if (this.$useWrapMode) { + this.$useWrapMode = false; + this.setUseWrapMode(true); + } + } + }, + initialValue: "auto" + }, + indentedSoftWrap: { + set: function () { + if (this.$useWrapMode) { + this.$useWrapMode = false; + this.setUseWrapMode(true); + } + }, + initialValue: true + }, + firstLineNumber: { + set: function () { this._signal("changeBreakpoint"); }, + initialValue: 1 + }, + useWorker: { + set: function (useWorker) { + this.$useWorker = useWorker; + this.$stopWorker(); + if (useWorker) + this.$startWorker(); + }, + initialValue: true + }, + useSoftTabs: { initialValue: true }, + tabSize: { + set: function (tabSize) { + tabSize = parseInt(tabSize); + if (tabSize > 0 && this.$tabSize !== tabSize) { + this.$modified = true; + this.$rowLengthCache = []; + this.$tabSize = tabSize; + this._signal("changeTabSize"); + } + }, + initialValue: 4, + handlesSet: true + }, + navigateWithinSoftTabs: { initialValue: false }, + foldStyle: { + set: function (val) { this.setFoldStyle(val); }, + handlesSet: true + }, + overwrite: { + set: function (val) { this._signal("changeOverwrite"); }, + initialValue: false + }, + newLineMode: { + set: function (val) { this.doc.setNewLineMode(val); }, + get: function () { return this.doc.getNewLineMode(); }, + handlesSet: true + }, + mode: { + set: function (val) { this.setMode(val); }, + get: function () { return this.$modeId; }, + handlesSet: true + } +}); +exports.EditSession = EditSession; + +}); + +ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"], function(require, exports, module){"use strict"; +var lang = require("./lib/lang"); +var oop = require("./lib/oop"); +var Range = require("./range").Range; +var Search = /** @class */ (function () { + function Search() { + this.$options = {}; + } + Search.prototype.set = function (options) { + oop.mixin(this.$options, options); + return this; + }; + Search.prototype.getOptions = function () { + return lang.copyObject(this.$options); + }; + Search.prototype.setOptions = function (options) { + this.$options = options; + }; + Search.prototype.find = function (session) { + var options = this.$options; + var iterator = this.$matchIterator(session, options); + if (!iterator) + return false; + var firstRange = null; + iterator.forEach(function (sr, sc, er, ec) { + firstRange = new Range(sr, sc, er, ec); + if (sc == ec && options.start && /**@type{Range}*/ (options.start).start + && options.skipCurrent != false && firstRange.isEqual(/**@type{Range}*/ (options.start))) { + firstRange = null; + return false; + } + return true; + }); + return firstRange; + }; + Search.prototype.findAll = function (session) { + var options = this.$options; + if (!options.needle) + return []; + this.$assembleRegExp(options); + var range = options.range; + var lines = range + ? session.getLines(range.start.row, range.end.row) + : session.doc.getAllLines(); + var ranges = []; + var re = options.re; + if (options.$isMultiLine) { + var len = re.length; + var maxRow = lines.length - len; + var prevRange; + outer: for (var row = re.offset || 0; row <= maxRow; row++) { + for (var j = 0; j < len; j++) + if (lines[row + j].search(re[j]) == -1) + continue outer; + var startLine = lines[row]; + var line = lines[row + len - 1]; + var startIndex = startLine.length - startLine.match(re[0])[0].length; + var endIndex = line.match(re[len - 1])[0].length; + if (prevRange && prevRange.end.row === row && + prevRange.end.column > startIndex) { + continue; + } + ranges.push(prevRange = new Range(row, startIndex, row + len - 1, endIndex)); + if (len > 2) + row = row + len - 2; + } + } + else { + for (var i = 0; i < lines.length; i++) { + var matches = lang.getMatchOffsets(lines[i], re); + for (var j = 0; j < matches.length; j++) { + var match = matches[j]; + ranges.push(new Range(i, match.offset, i, match.offset + match.length)); + } + } + } + if (range) { + var startColumn = range.start.column; + var endColumn = range.end.column; + var i = 0, j = ranges.length - 1; + while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == 0) + i++; + var endRow = range.end.row - range.start.row; + while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == endRow) + j--; + ranges = ranges.slice(i, j + 1); + for (i = 0, j = ranges.length; i < j; i++) { + ranges[i].start.row += range.start.row; + ranges[i].end.row += range.start.row; + } + } + return ranges; + }; + Search.prototype.replace = function (input, replacement) { + var options = this.$options; + var re = this.$assembleRegExp(options); + if (options.$isMultiLine) + return replacement; + if (!re) + return; + var match = re.exec(input); + if (!match || match[0].length != input.length) + return null; + if (!options.regExp) { + replacement = replacement.replace(/\$/g, "$$$$"); + } + replacement = input.replace(re, replacement); + if (options.preserveCase) { + replacement = replacement.split(""); + for (var i = Math.min(input.length, input.length); i--;) { + var ch = input[i]; + if (ch && ch.toLowerCase() != ch) + replacement[i] = replacement[i].toUpperCase(); + else + replacement[i] = replacement[i].toLowerCase(); + } + replacement = replacement.join(""); + } + return replacement; + }; + Search.prototype.$assembleRegExp = function (options, $disableFakeMultiline) { + if (options.needle instanceof RegExp) + return options.re = options.needle; + var needle = options.needle; + if (!options.needle) + return options.re = false; + if (!options.regExp) + needle = lang.escapeRegExp(needle); + var modifier = options.caseSensitive ? "gm" : "gmi"; + try { + new RegExp(needle, "u"); + options.$supportsUnicodeFlag = true; + modifier += "u"; + } + catch (e) { + options.$supportsUnicodeFlag = false; //left for backward compatibility with previous versions for cases like /ab\{2}/gu + } + if (options.wholeWord) + needle = addWordBoundary(needle, options); + options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle); + if (options.$isMultiLine) + return options.re = this.$assembleMultilineRegExp(needle, modifier); + try { + var re = new RegExp(needle, modifier); + } + catch (e) { + re = false; + } + return options.re = re; + }; + Search.prototype.$assembleMultilineRegExp = function (needle, modifier) { + var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n"); + var re = []; + for (var i = 0; i < parts.length; i++) + try { + re.push(new RegExp(parts[i], modifier)); + } + catch (e) { + return false; + } + return re; + }; + Search.prototype.$matchIterator = function (session, options) { + var re = this.$assembleRegExp(options); + if (!re) + return false; + var backwards = options.backwards == true; + var skipCurrent = options.skipCurrent != false; + var supportsUnicodeFlag = re.unicode; + var range = options.range; + var start = options.start; + if (!start) + start = range ? range[backwards ? "end" : "start"] : session.selection.getRange(); + if (start.start) + start = start[skipCurrent != backwards ? "end" : "start"]; + var firstRow = range ? range.start.row : 0; + var lastRow = range ? range.end.row : session.getLength() - 1; + if (backwards) { + var forEach = function (callback) { + var row = start.row; + if (forEachInLine(row, start.column, callback)) + return; + for (row--; row >= firstRow; row--) + if (forEachInLine(row, Number.MAX_VALUE, callback)) + return; + if (options.wrap == false) + return; + for (row = lastRow, firstRow = start.row; row >= firstRow; row--) + if (forEachInLine(row, Number.MAX_VALUE, callback)) + return; + }; + } + else { + var forEach = function (callback) { + var row = start.row; + if (forEachInLine(row, start.column, callback)) + return; + for (row = row + 1; row <= lastRow; row++) + if (forEachInLine(row, 0, callback)) + return; + if (options.wrap == false) + return; + for (row = firstRow, lastRow = start.row; row <= lastRow; row++) + if (forEachInLine(row, 0, callback)) + return; + }; + } + if (options.$isMultiLine) { + var len = re.length; + var forEachInLine = function (row, offset, callback) { + var startRow = backwards ? row - len + 1 : row; + if (startRow < 0 || startRow + len > session.getLength()) + return; + var line = session.getLine(startRow); + var startIndex = line.search(re[0]); + if (!backwards && startIndex < offset || startIndex === -1) + return; + for (var i = 1; i < len; i++) { + line = session.getLine(startRow + i); + if (line.search(re[i]) == -1) + return; + } + var endIndex = line.match(re[len - 1])[0].length; + if (backwards && endIndex > offset) + return; + if (callback(startRow, startIndex, startRow + len - 1, endIndex)) + return true; + }; + } + else if (backwards) { + var forEachInLine = function (row, endIndex, callback) { + var line = session.getLine(row); + var matches = []; + var m, last = 0; + re.lastIndex = 0; + while ((m = re.exec(line))) { + var length = m[0].length; + last = m.index; + if (!length) { + if (last >= line.length) + break; + re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag); + } + if (m.index + length > endIndex) + break; + matches.push(m.index, length); + } + for (var i = matches.length - 1; i >= 0; i -= 2) { + var column = matches[i - 1]; + var length = matches[i]; + if (callback(row, column, row, column + length)) + return true; + } + }; + } + else { + var forEachInLine = function (row, startIndex, callback) { + var line = session.getLine(row); + var last; + var m; + re.lastIndex = startIndex; + while ((m = re.exec(line))) { + var length = m[0].length; + last = m.index; + if (callback(row, last, row, last + length)) + return true; + if (!length) { + re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag); + if (last >= line.length) + return false; + } + } + }; + } + return { forEach: forEach }; + }; + return Search; +}()); +function addWordBoundary(needle, options) { + var supportsLookbehind = lang.supportsLookbehind(); + function wordBoundary(c, firstChar) { + if (firstChar === void 0) { firstChar = true; } + var wordRegExp = supportsLookbehind && options.$supportsUnicodeFlag ? new RegExp("[\\p{L}\\p{N}_]", "u") : new RegExp("\\w"); + if (wordRegExp.test(c) || options.regExp) { + if (supportsLookbehind && options.$supportsUnicodeFlag) { + if (firstChar) + return "(?<=^|[^\\p{L}\\p{N}_])"; + return "(?=[^\\p{L}\\p{N}_]|$)"; + } + return "\\b"; + } + return ""; + } + var needleArray = Array.from(needle); + var firstChar = needleArray[0]; + var lastChar = needleArray[needleArray.length - 1]; + return wordBoundary(firstChar) + needle + wordBoundary(lastChar, false); +} +exports.Search = Search; + +}); + +ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(require, exports, module){"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var keyUtil = require("../lib/keys"); +var useragent = require("../lib/useragent"); +var KEY_MODS = keyUtil.KEY_MODS; +var MultiHashHandler = /** @class */ (function () { + function MultiHashHandler(config, platform) { + this.$init(config, platform, false); + } + MultiHashHandler.prototype.$init = function (config, platform, $singleCommand) { + this.platform = platform || (useragent.isMac ? "mac" : "win"); + this.commands = {}; + this.commandKeyBinding = {}; + this.addCommands(config); + this.$singleCommand = $singleCommand; + }; + MultiHashHandler.prototype.addCommand = function (command) { + if (this.commands[command.name]) + this.removeCommand(command); + this.commands[command.name] = command; + if (command.bindKey) + this._buildKeyHash(command); + }; + MultiHashHandler.prototype.removeCommand = function (command, keepCommand) { + var name = command && (typeof command === 'string' ? command : command.name); + command = this.commands[name]; + if (!keepCommand) + delete this.commands[name]; + var ckb = this.commandKeyBinding; + for (var keyId in ckb) { + var cmdGroup = ckb[keyId]; + if (cmdGroup == command) { + delete ckb[keyId]; + } + else if (Array.isArray(cmdGroup)) { + var i = cmdGroup.indexOf(command); + if (i != -1) { + cmdGroup.splice(i, 1); + if (cmdGroup.length == 1) + ckb[keyId] = cmdGroup[0]; + } + } + } + }; + MultiHashHandler.prototype.bindKey = function (key, command, position) { + if (typeof key == "object" && key) { + if (position == undefined) + position = key.position; + key = key[this.platform]; + } + if (!key) + return; + if (typeof command == "function") + return this.addCommand({ exec: command, bindKey: key, name: command.name || /**@type{string}*/ (key) }); (key).split("|").forEach(function (keyPart) { + var chain = ""; + if (keyPart.indexOf(" ") != -1) { + var parts = keyPart.split(/\s+/); + keyPart = parts.pop(); + parts.forEach(function (keyPart) { + var binding = this.parseKeys(keyPart); + var id = KEY_MODS[binding.hashId] + binding.key; + chain += (chain ? " " : "") + id; + this._addCommandToBinding(chain, "chainKeys"); + }, this); + chain += " "; + } + var binding = this.parseKeys(keyPart); + var id = KEY_MODS[binding.hashId] + binding.key; + this._addCommandToBinding(chain + id, command, position); + }, this); + }; + MultiHashHandler.prototype._addCommandToBinding = function (keyId, command, position) { + var ckb = this.commandKeyBinding, i; + if (!command) { + delete ckb[keyId]; + } + else if (!ckb[keyId] || this.$singleCommand) { + ckb[keyId] = command; + } + else { + if (!Array.isArray(ckb[keyId])) { + ckb[keyId] = [ckb[keyId]]; + } + else if ((i = ckb[keyId].indexOf(command)) != -1) { + ckb[keyId].splice(i, 1); + } + if (typeof position != "number") { + position = getPosition(command); + } + var commands = ckb[keyId]; + for (i = 0; i < commands.length; i++) { + var other = commands[i]; + var otherPos = getPosition(other); + if (otherPos > position) + break; + } + commands.splice(i, 0, command); + } + }; + MultiHashHandler.prototype.addCommands = function (commands) { + commands && Object.keys(commands).forEach(function (name) { + var command = commands[name]; + if (!command) + return; + if (typeof command === "string") + return this.bindKey(command, name); + if (typeof command === "function") + command = { exec: command }; + if (typeof command !== "object") + return; + if (!command.name) + command.name = name; + this.addCommand(command); + }, this); + }; + MultiHashHandler.prototype.removeCommands = function (commands) { + Object.keys(commands).forEach(function (name) { + this.removeCommand(commands[name]); + }, this); }; - this.documentToScreenRow = function(docRow, docColumn) { - return this.documentToScreenPosition(docRow, docColumn).row; + MultiHashHandler.prototype.bindKeys = function (keyList) { + Object.keys(keyList).forEach(function (key) { + this.bindKey(key, keyList[key]); + }, this); }; - this.getScreenLength = function() { - var screenRows = 0; - var fold = null; - if (!this.$useWrapMode) { - screenRows = this.getLength(); - var foldData = this.$foldData; - for (var i = 0; i < foldData.length; i++) { - fold = foldData[i]; - screenRows -= fold.end.row - fold.start.row; + MultiHashHandler.prototype._buildKeyHash = function (command) { + this.bindKey(command.bindKey, command); + }; + MultiHashHandler.prototype.parseKeys = function (keys) { + var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function (x) { return x; }); + var key = parts.pop(); + var keyCode = keyUtil[key]; + if (keyUtil.FUNCTION_KEYS[keyCode]) + key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase(); + else if (!parts.length) + return { key: key, hashId: -1 }; + else if (parts.length == 1 && parts[0] == "shift") + return { key: key.toUpperCase(), hashId: -1 }; + var hashId = 0; + for (var i = parts.length; i--;) { + var modifier = keyUtil.KEY_MODS[parts[i]]; + if (modifier == null) { + if (typeof console != "undefined") + console.error("invalid modifier " + parts[i] + " in " + keys); + return false; } - } else { - var lastRow = this.$wrapData.length; - var row = 0, i = 0; - var fold = this.$foldData[i++]; - var foldStart = fold ? fold.start.row :Infinity; - - while (row < lastRow) { - var splits = this.$wrapData[row]; - screenRows += splits ? splits.length + 1 : 1; - row ++; - if (row > foldStart) { - row = fold.end.row+1; - fold = this.$foldData[i++]; - foldStart = fold ?fold.start.row :Infinity; - } + hashId |= modifier; + } + return { key: key, hashId: hashId }; + }; + MultiHashHandler.prototype.findKeyCommand = function (hashId, keyString) { + var key = KEY_MODS[hashId] + keyString; + return this.commandKeyBinding[key]; + }; + MultiHashHandler.prototype.handleKeyboard = function (data, hashId, keyString, keyCode) { + if (keyCode < 0) + return; + var key = KEY_MODS[hashId] + keyString; + var command = this.commandKeyBinding[key]; + if (data.$keyChain) { + data.$keyChain += " " + key; + command = this.commandKeyBinding[data.$keyChain] || command; + } + if (command) { + if (command == "chainKeys" || command[command.length - 1] == "chainKeys") { + data.$keyChain = data.$keyChain || key; + return { command: "null" }; } } - if (this.lineWidgets) - screenRows += this.$getWidgetScreenLength(); - - return screenRows; + if (data.$keyChain) { + if ((!hashId || hashId == 4) && keyString.length == 1) + data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input + else if (hashId == -1 || keyCode > 0) + data.$keyChain = ""; // reset keyChain + } + return { command: command }; }; - this.$setFontMetrics = function(fm) { - if (!this.$enableVarChar) return; - this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { - if (maxScreenColumn === 0) - return [0, 0]; - if (!maxScreenColumn) - maxScreenColumn = Infinity; - screenColumn = screenColumn || 0; + MultiHashHandler.prototype.getStatusText = function (editor, data) { + return data.$keyChain || ""; + }; + return MultiHashHandler; +}()); +function getPosition(command) { + return typeof command == "object" && command.bindKey + && command.bindKey.position + || (command.isDefault ? -100 : 0); +} +var HashHandler = /** @class */ (function (_super) { + __extends(HashHandler, _super); + function HashHandler(config, platform) { + var _this = _super.call(this, config, platform) || this; + _this.$singleCommand = true; + return _this; + } + return HashHandler; +}(MultiHashHandler)); +HashHandler.call = function (thisArg, config, platform) { + MultiHashHandler.prototype.$init.call(thisArg, config, platform, true); +}; +MultiHashHandler.call = function (thisArg, config, platform) { + MultiHashHandler.prototype.$init.call(thisArg, config, platform, false); +}; +exports.HashHandler = HashHandler; +exports.MultiHashHandler = MultiHashHandler; - var c, column; - for (column = 0; column < str.length; column++) { - c = str.charAt(column); - if (c === "\t") { - screenColumn += this.getScreenTabSize(screenColumn); - } else { - screenColumn += fm.getCharacterWidth(c); - } - if (screenColumn > maxScreenColumn) { - break; - } - } +}); - return [screenColumn, column]; - }; +ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"], function(require, exports, module){"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - - this.destroy = function() { - if (this.bgTokenizer) { - this.bgTokenizer.setDocument(null); - this.bgTokenizer = null; +})(); +var oop = require("../lib/oop"); +var MultiHashHandler = require("../keyboard/hash_handler").MultiHashHandler; +var EventEmitter = require("../lib/event_emitter").EventEmitter; +var CommandManager = /** @class */ (function (_super) { + __extends(CommandManager, _super); + function CommandManager(platform, commands) { + var _this = _super.call(this, commands, platform) || this; + _this.byName = _this.commands; + _this.setDefaultHandler("exec", function (e) { + if (!e.args) { + return e.command.exec(e.editor, {}, e.event, true); + } + return e.command.exec(e.editor, e.args, e.event, false); + }); + return _this; + } + CommandManager.prototype.exec = function (command, editor, args) { + if (Array.isArray(command)) { + for (var i = command.length; i--;) { + if (this.exec(command[i], editor, args)) + return true; + } + return false; } - this.$stopWorker(); - this.removeAllListeners(); - this.selection.detach(); + if (typeof command === "string") + command = this.commands[command]; + if (!this.canExecute(command, editor)) { + return false; + } + var e = { editor: editor, command: command, args: args }; + e.returnValue = this._emit("exec", e); + this._signal("afterExec", e); + return e.returnValue === false ? false : true; }; - - this.isFullWidth = isFullWidth; - function isFullWidth(c) { - if (c < 0x1100) + CommandManager.prototype.canExecute = function (command, editor) { + if (typeof command === "string") + command = this.commands[command]; + if (!command) return false; - return c >= 0x1100 && c <= 0x115F || - c >= 0x11A3 && c <= 0x11A7 || - c >= 0x11FA && c <= 0x11FF || - c >= 0x2329 && c <= 0x232A || - c >= 0x2E80 && c <= 0x2E99 || - c >= 0x2E9B && c <= 0x2EF3 || - c >= 0x2F00 && c <= 0x2FD5 || - c >= 0x2FF0 && c <= 0x2FFB || - c >= 0x3000 && c <= 0x303E || - c >= 0x3041 && c <= 0x3096 || - c >= 0x3099 && c <= 0x30FF || - c >= 0x3105 && c <= 0x312D || - c >= 0x3131 && c <= 0x318E || - c >= 0x3190 && c <= 0x31BA || - c >= 0x31C0 && c <= 0x31E3 || - c >= 0x31F0 && c <= 0x321E || - c >= 0x3220 && c <= 0x3247 || - c >= 0x3250 && c <= 0x32FE || - c >= 0x3300 && c <= 0x4DBF || - c >= 0x4E00 && c <= 0xA48C || - c >= 0xA490 && c <= 0xA4C6 || - c >= 0xA960 && c <= 0xA97C || - c >= 0xAC00 && c <= 0xD7A3 || - c >= 0xD7B0 && c <= 0xD7C6 || - c >= 0xD7CB && c <= 0xD7FB || - c >= 0xF900 && c <= 0xFAFF || - c >= 0xFE10 && c <= 0xFE19 || - c >= 0xFE30 && c <= 0xFE52 || - c >= 0xFE54 && c <= 0xFE66 || - c >= 0xFE68 && c <= 0xFE6B || - c >= 0xFF01 && c <= 0xFF60 || - c >= 0xFFE0 && c <= 0xFFE6; - } - -}).call(EditSession.prototype); - -require("./edit_session/folding").Folding.call(EditSession.prototype); -require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype); - + if (editor && editor.$readOnly && !command.readOnly) + return false; + if (this.$checkCommandState != false && command.isAvailable && !command.isAvailable(editor)) + return false; + return true; + }; + CommandManager.prototype.toggleRecording = function (editor) { + if (this.$inReplay) + return; + editor && editor._emit("changeStatus"); + if (this.recording) { + this.macro.pop(); + this.off("exec", this.$addCommandToMacro); + if (!this.macro.length) + this.macro = this.oldMacro; + return this.recording = false; + } + if (!this.$addCommandToMacro) { + this.$addCommandToMacro = function (e) { + this.macro.push([e.command, e.args]); + }.bind(this); + } + this.oldMacro = this.macro; + this.macro = []; + this.on("exec", this.$addCommandToMacro); + return this.recording = true; + }; + CommandManager.prototype.replay = function (editor) { + if (this.$inReplay || !this.macro) + return; + if (this.recording) + return this.toggleRecording(editor); + try { + this.$inReplay = true; + this.macro.forEach(function (x) { + if (typeof x == "string") + this.exec(x, editor); + else + this.exec(x[0], editor, x[1]); + }, this); + } + finally { + this.$inReplay = false; + } + }; + CommandManager.prototype.trimMacro = function (m) { + return m.map(function (x) { + if (typeof x[0] != "string") + x[0] = x[0].name; + if (!x[1]) + x = x[0]; + return x; + }); + }; + return CommandManager; +}(MultiHashHandler)); +oop.implement(CommandManager.prototype, EventEmitter); +exports.CommandManager = CommandManager; -config.defineOptions(EditSession.prototype, "session", { - wrap: { - set: function(value) { - if (!value || value == "off") - value = false; - else if (value == "free") - value = true; - else if (value == "printMargin") - value = -1; - else if (typeof value == "string") - value = parseInt(value, 10) || false; +}); - if (this.$wrap == value) - return; - this.$wrap = value; - if (!value) { - this.setUseWrapMode(false); - } else { - var col = typeof value == "number" ? value : null; - this.setWrapLimitRange(col, col); - this.setUseWrapMode(true); - } +ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"], function(require, exports, module){"use strict"; +var lang = require("../lib/lang"); +var config = require("../config"); +var Range = require("../range").Range; +function bindKey(win, mac) { + return { win: win, mac: mac }; +} +exports.commands = [{ + name: "showSettingsMenu", + description: "Show settings menu", + bindKey: bindKey("Ctrl-,", "Command-,"), + exec: function (editor) { + config.loadModule("ace/ext/settings_menu", function (module) { + module.init(editor); + editor.showSettingsMenu(); + }); }, - get: function() { - if (this.getUseWrapMode()) { - if (this.$wrap == -1) - return "printMargin"; - if (!this.getWrapLimitRange().min) - return "free"; - return this.$wrap; - } - return "off"; + readOnly: true + }, { + name: "goToNextError", + description: "Go to next error", + bindKey: bindKey("Alt-E", "F4"), + exec: function (editor) { + config.loadModule("ace/ext/error_marker", function (module) { + module.showErrorMarker(editor, 1); + }); }, - handlesSet: true + scrollIntoView: "animate", + readOnly: true + }, { + name: "goToPreviousError", + description: "Go to previous error", + bindKey: bindKey("Alt-Shift-E", "Shift-F4"), + exec: function (editor) { + config.loadModule("ace/ext/error_marker", function (module) { + module.showErrorMarker(editor, -1); + }); + }, + scrollIntoView: "animate", + readOnly: true + }, { + name: "selectall", + description: "Select all", + bindKey: bindKey("Ctrl-A", "Command-A"), + exec: function (editor) { editor.selectAll(); }, + readOnly: true + }, { + name: "centerselection", + description: "Center selection", + bindKey: bindKey(null, "Ctrl-L"), + exec: function (editor) { editor.centerSelection(); }, + readOnly: true + }, { + name: "gotoline", + description: "Go to line...", + bindKey: bindKey("Ctrl-L", "Command-L"), + exec: function (editor, line) { + if (typeof line === "number" && !isNaN(line)) + editor.gotoLine(line); + editor.prompt({ $type: "gotoLine" }); + }, + readOnly: true + }, { + name: "fold", + bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"), + exec: function (editor) { editor.session.toggleFold(false); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "unfold", + bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"), + exec: function (editor) { editor.session.toggleFold(true); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "toggleFoldWidget", + description: "Toggle fold widget", + bindKey: bindKey("F2", "F2"), + exec: function (editor) { editor.session.toggleFoldWidget(); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "toggleParentFoldWidget", + description: "Toggle parent fold widget", + bindKey: bindKey("Alt-F2", "Alt-F2"), + exec: function (editor) { editor.session.toggleFoldWidget(true); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "foldall", + description: "Fold all", + bindKey: bindKey(null, "Ctrl-Command-Option-0"), + exec: function (editor) { editor.session.foldAll(); }, + scrollIntoView: "center", + readOnly: true + }, { + name: "foldAllComments", + description: "Fold all comments", + bindKey: bindKey(null, "Ctrl-Command-Option-0"), + exec: function (editor) { editor.session.foldAllComments(); }, + scrollIntoView: "center", + readOnly: true + }, { + name: "foldOther", + description: "Fold other", + bindKey: bindKey("Alt-0", "Command-Option-0"), + exec: function (editor) { + editor.session.foldAll(); + editor.session.unfold(editor.selection.getAllRanges()); + }, + scrollIntoView: "center", + readOnly: true + }, { + name: "unfoldall", + description: "Unfold all", + bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"), + exec: function (editor) { editor.session.unfold(); }, + scrollIntoView: "center", + readOnly: true + }, { + name: "findnext", + description: "Find next", + bindKey: bindKey("Ctrl-K", "Command-G"), + exec: function (editor) { editor.findNext(); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "findprevious", + description: "Find previous", + bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), + exec: function (editor) { editor.findPrevious(); }, + multiSelectAction: "forEach", + scrollIntoView: "center", + readOnly: true + }, { + name: "selectOrFindNext", + description: "Select or find next", + bindKey: bindKey("Alt-K", "Ctrl-G"), + exec: function (editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findNext(); + }, + readOnly: true + }, { + name: "selectOrFindPrevious", + description: "Select or find previous", + bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"), + exec: function (editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findPrevious(); + }, + readOnly: true + }, { + name: "find", + description: "Find", + bindKey: bindKey("Ctrl-F", "Command-F"), + exec: function (editor) { + config.loadModule("ace/ext/searchbox", function (e) { e.Search(editor); }); + }, + readOnly: true + }, { + name: "overwrite", + description: "Overwrite", + bindKey: "Insert", + exec: function (editor) { editor.toggleOverwrite(); }, + readOnly: true + }, { + name: "selecttostart", + description: "Select to start", + bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"), + exec: function (editor) { editor.getSelection().selectFileStart(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" + }, { + name: "gotostart", + description: "Go to start", + bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"), + exec: function (editor) { editor.navigateFileStart(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" + }, { + name: "selectup", + description: "Select up", + bindKey: bindKey("Shift-Up", "Shift-Up|Ctrl-Shift-P"), + exec: function (editor) { editor.getSelection().selectUp(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "golineup", + description: "Go line up", + bindKey: bindKey("Up", "Up|Ctrl-P"), + exec: function (editor, args) { editor.navigateUp(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selecttoend", + description: "Select to end", + bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"), + exec: function (editor) { editor.getSelection().selectFileEnd(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" + }, { + name: "gotoend", + description: "Go to end", + bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"), + exec: function (editor) { editor.navigateFileEnd(); }, + multiSelectAction: "forEach", + readOnly: true, + scrollIntoView: "animate", + aceCommandGroup: "fileJump" + }, { + name: "selectdown", + description: "Select down", + bindKey: bindKey("Shift-Down", "Shift-Down|Ctrl-Shift-N"), + exec: function (editor) { editor.getSelection().selectDown(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "golinedown", + description: "Go line down", + bindKey: bindKey("Down", "Down|Ctrl-N"), + exec: function (editor, args) { editor.navigateDown(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectwordleft", + description: "Select word left", + bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"), + exec: function (editor) { editor.getSelection().selectWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotowordleft", + description: "Go to word left", + bindKey: bindKey("Ctrl-Left", "Option-Left"), + exec: function (editor) { editor.navigateWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selecttolinestart", + description: "Select to line start", + bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"), + exec: function (editor) { editor.getSelection().selectLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotolinestart", + description: "Go to line start", + bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), + exec: function (editor) { editor.navigateLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectleft", + description: "Select left", + bindKey: bindKey("Shift-Left", "Shift-Left|Ctrl-Shift-B"), + exec: function (editor) { editor.getSelection().selectLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotoleft", + description: "Go to left", + bindKey: bindKey("Left", "Left|Ctrl-B"), + exec: function (editor, args) { editor.navigateLeft(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectwordright", + description: "Select word right", + bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"), + exec: function (editor) { editor.getSelection().selectWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotowordright", + description: "Go to word right", + bindKey: bindKey("Ctrl-Right", "Option-Right"), + exec: function (editor) { editor.navigateWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selecttolineend", + description: "Select to line end", + bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"), + exec: function (editor) { editor.getSelection().selectLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotolineend", + description: "Go to line end", + bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"), + exec: function (editor) { editor.navigateLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectright", + description: "Select right", + bindKey: bindKey("Shift-Right", "Shift-Right"), + exec: function (editor) { editor.getSelection().selectRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "gotoright", + description: "Go to right", + bindKey: bindKey("Right", "Right|Ctrl-F"), + exec: function (editor, args) { editor.navigateRight(args.times); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectpagedown", + description: "Select page down", + bindKey: "Shift-PageDown", + exec: function (editor) { editor.selectPageDown(); }, + readOnly: true + }, { + name: "pagedown", + description: "Page down", + bindKey: bindKey(null, "Option-PageDown"), + exec: function (editor) { editor.scrollPageDown(); }, + readOnly: true + }, { + name: "gotopagedown", + description: "Go to page down", + bindKey: bindKey("PageDown", "PageDown|Ctrl-V"), + exec: function (editor) { editor.gotoPageDown(); }, + readOnly: true + }, { + name: "selectpageup", + description: "Select page up", + bindKey: "Shift-PageUp", + exec: function (editor) { editor.selectPageUp(); }, + readOnly: true + }, { + name: "pageup", + description: "Page up", + bindKey: bindKey(null, "Option-PageUp"), + exec: function (editor) { editor.scrollPageUp(); }, + readOnly: true + }, { + name: "gotopageup", + description: "Go to page up", + bindKey: "PageUp", + exec: function (editor) { editor.gotoPageUp(); }, + readOnly: true + }, { + name: "scrollup", + description: "Scroll up", + bindKey: bindKey("Ctrl-Up", null), + exec: function (e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); }, + readOnly: true + }, { + name: "scrolldown", + description: "Scroll down", + bindKey: bindKey("Ctrl-Down", null), + exec: function (e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); }, + readOnly: true + }, { + name: "selectlinestart", + description: "Select line start", + bindKey: "Shift-Home", + exec: function (editor) { editor.getSelection().selectLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectlineend", + description: "Select line end", + bindKey: "Shift-End", + exec: function (editor) { editor.getSelection().selectLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "togglerecording", + description: "Toggle recording", + bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"), + exec: function (editor) { editor.commands.toggleRecording(editor); }, + readOnly: true + }, { + name: "replaymacro", + description: "Replay macro", + bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"), + exec: function (editor) { editor.commands.replay(editor); }, + readOnly: true + }, { + name: "jumptomatching", + description: "Jump to matching", + bindKey: bindKey("Ctrl-\\|Ctrl-P", "Command-\\"), + exec: function (editor) { editor.jumpToMatching(); }, + multiSelectAction: "forEach", + scrollIntoView: "animate", + readOnly: true + }, { + name: "selecttomatching", + description: "Select to matching", + bindKey: bindKey("Ctrl-Shift-\\|Ctrl-Shift-P", "Command-Shift-\\"), + exec: function (editor) { editor.jumpToMatching(true); }, + multiSelectAction: "forEach", + scrollIntoView: "animate", + readOnly: true + }, { + name: "expandToMatching", + description: "Expand to matching", + bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"), + exec: function (editor) { editor.jumpToMatching(true, true); }, + multiSelectAction: "forEach", + scrollIntoView: "animate", + readOnly: true + }, { + name: "passKeysToBrowser", + description: "Pass keys to browser", + bindKey: bindKey(null, null), + exec: function () { }, + passEvent: true, + readOnly: true + }, { + name: "copy", + description: "Copy", + exec: function (editor) { + }, + readOnly: true }, - wrapMethod: { - set: function(val) { - val = val == "auto" - ? this.$mode.type != "text" - : val != "text"; - if (val != this.$wrapAsCode) { - this.$wrapAsCode = val; - if (this.$useWrapMode) { - this.$useWrapMode = false; - this.setUseWrapMode(true); + { + name: "cut", + description: "Cut", + exec: function (editor) { + var cutLine = editor.$copyWithEmptySelection && editor.selection.isEmpty(); + var range = cutLine ? editor.selection.getLineRange() : editor.selection.getRange(); + editor._emit("cut", range); + if (!range.isEmpty()) + editor.session.remove(range); + editor.clearSelection(); + }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" + }, { + name: "paste", + description: "Paste", + exec: function (editor, args) { + editor.$handlePaste(args); + }, + scrollIntoView: "cursor" + }, { + name: "removeline", + description: "Remove line", + bindKey: bindKey("Ctrl-D", "Command-D"), + exec: function (editor) { editor.removeLines(); }, + scrollIntoView: "cursor", + multiSelectAction: "forEachLine" + }, { + name: "duplicateSelection", + description: "Duplicate selection", + bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"), + exec: function (editor) { editor.duplicateSelection(); }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" + }, { + name: "sortlines", + description: "Sort lines", + bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"), + exec: function (editor) { editor.sortLines(); }, + scrollIntoView: "selection", + multiSelectAction: "forEachLine" + }, { + name: "togglecomment", + description: "Toggle comment", + bindKey: bindKey("Ctrl-/", "Command-/"), + exec: function (editor) { editor.toggleCommentLines(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" + }, { + name: "toggleBlockComment", + description: "Toggle block comment", + bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"), + exec: function (editor) { editor.toggleBlockComment(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" + }, { + name: "modifyNumberUp", + description: "Modify number up", + bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"), + exec: function (editor) { editor.modifyNumber(1); }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" + }, { + name: "modifyNumberDown", + description: "Modify number down", + bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"), + exec: function (editor) { editor.modifyNumber(-1); }, + scrollIntoView: "cursor", + multiSelectAction: "forEach" + }, { + name: "replace", + description: "Replace", + bindKey: bindKey("Ctrl-H", "Command-Option-F"), + exec: function (editor) { + config.loadModule("ace/ext/searchbox", function (e) { e.Search(editor, true); }); + } + }, { + name: "undo", + description: "Undo", + bindKey: bindKey("Ctrl-Z", "Command-Z"), + exec: function (editor) { editor.undo(); } + }, { + name: "redo", + description: "Redo", + bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"), + exec: function (editor) { editor.redo(); } + }, { + name: "copylinesup", + description: "Copy lines up", + bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"), + exec: function (editor) { editor.copyLinesUp(); }, + scrollIntoView: "cursor" + }, { + name: "movelinesup", + description: "Move lines up", + bindKey: bindKey("Alt-Up", "Option-Up"), + exec: function (editor) { editor.moveLinesUp(); }, + scrollIntoView: "cursor" + }, { + name: "copylinesdown", + description: "Copy lines down", + bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"), + exec: function (editor) { editor.copyLinesDown(); }, + scrollIntoView: "cursor" + }, { + name: "movelinesdown", + description: "Move lines down", + bindKey: bindKey("Alt-Down", "Option-Down"), + exec: function (editor) { editor.moveLinesDown(); }, + scrollIntoView: "cursor" + }, { + name: "del", + description: "Delete", + bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"), + exec: function (editor) { editor.remove("right"); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "backspace", + description: "Backspace", + bindKey: bindKey("Shift-Backspace|Backspace", "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"), + exec: function (editor) { editor.remove("left"); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "cut_or_delete", + description: "Cut or delete", + bindKey: bindKey("Shift-Delete", null), + exec: function (editor) { + if (editor.selection.isEmpty()) { + editor.remove("left"); + } + else { + return false; + } + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removetolinestart", + description: "Remove to line start", + bindKey: bindKey("Alt-Backspace", "Command-Backspace"), + exec: function (editor) { editor.removeToLineStart(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removetolineend", + description: "Remove to line end", + bindKey: bindKey("Alt-Delete", "Ctrl-K|Command-Delete"), + exec: function (editor) { editor.removeToLineEnd(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removetolinestarthard", + description: "Remove to line start hard", + bindKey: bindKey("Ctrl-Shift-Backspace", null), + exec: function (editor) { + var range = editor.selection.getRange(); + range.start.column = 0; + editor.session.remove(range); + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removetolineendhard", + description: "Remove to line end hard", + bindKey: bindKey("Ctrl-Shift-Delete", null), + exec: function (editor) { + var range = editor.selection.getRange(); + range.end.column = Number.MAX_VALUE; + editor.session.remove(range); + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removewordleft", + description: "Remove word left", + bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"), + exec: function (editor) { editor.removeWordLeft(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "removewordright", + description: "Remove word right", + bindKey: bindKey("Ctrl-Delete", "Alt-Delete"), + exec: function (editor) { editor.removeWordRight(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "outdent", + description: "Outdent", + bindKey: bindKey("Shift-Tab", "Shift-Tab"), + exec: function (editor) { editor.blockOutdent(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" + }, { + name: "indent", + description: "Indent", + bindKey: bindKey("Tab", "Tab"), + exec: function (editor) { editor.indent(); }, + multiSelectAction: "forEach", + scrollIntoView: "selectionPart" + }, { + name: "blockoutdent", + description: "Block outdent", + bindKey: bindKey("Ctrl-[", "Ctrl-["), + exec: function (editor) { editor.blockOutdent(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" + }, { + name: "blockindent", + description: "Block indent", + bindKey: bindKey("Ctrl-]", "Ctrl-]"), + exec: function (editor) { editor.blockIndent(); }, + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" + }, { + name: "insertstring", + description: "Insert string", + exec: function (editor, str) { editor.insert(str); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "inserttext", + description: "Insert text", + exec: function (editor, args) { + editor.insert(lang.stringRepeat(args.text || "", args.times || 1)); + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "splitline", + description: "Split line", + bindKey: bindKey(null, "Ctrl-O"), + exec: function (editor) { editor.splitLine(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "transposeletters", + description: "Transpose letters", + bindKey: bindKey("Alt-Shift-X", "Ctrl-T"), + exec: function (editor) { editor.transposeLetters(); }, + multiSelectAction: function (editor) { editor.transposeSelections(1); }, + scrollIntoView: "cursor" + }, { + name: "touppercase", + description: "To uppercase", + bindKey: bindKey("Ctrl-U", "Ctrl-U"), + exec: function (editor) { editor.toUpperCase(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "tolowercase", + description: "To lowercase", + bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"), + exec: function (editor) { editor.toLowerCase(); }, + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "autoindent", + description: "Auto Indent", + bindKey: bindKey(null, null), + exec: function (editor) { editor.autoIndent(); }, + scrollIntoView: "animate" + }, { + name: "expandtoline", + description: "Expand to line", + bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"), + exec: function (editor) { + var range = editor.selection.getRange(); + range.start.column = range.end.column = 0; + range.end.row++; + editor.selection.setRange(range, false); + }, + multiSelectAction: "forEach", + scrollIntoView: "cursor", + readOnly: true + }, { + name: "openlink", + bindKey: bindKey("Ctrl+F3", "F3"), + exec: function (editor) { editor.openLink(); } + }, { + name: "joinlines", + description: "Join lines", + bindKey: bindKey(null, null), + exec: function (editor) { + var isBackwards = editor.selection.isBackwards(); + var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor(); + var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead(); + var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length; + var selectedText = editor.session.doc.getTextRange(editor.selection.getRange()); + var selectedCount = selectedText.replace(/\n\s*/, " ").length; + var insertLine = editor.session.doc.getLine(selectionStart.row); + for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) { + var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i))); + if (curLine.length !== 0) { + curLine = " " + curLine; } + insertLine += curLine; + } + if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) { + insertLine += editor.session.doc.getNewLineCharacter(); + } + editor.clearSelection(); + editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine); + if (selectedCount > 0) { + editor.selection.moveCursorTo(selectionStart.row, selectionStart.column); + editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount); + } + else { + firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol; + editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol); } }, - initialValue: "auto" - }, - indentedSoftWrap: { - set: function() { - if (this.$useWrapMode) { - this.$useWrapMode = false; - this.setUseWrapMode(true); + multiSelectAction: "forEach", + readOnly: true + }, { + name: "invertSelection", + description: "Invert selection", + bindKey: bindKey(null, null), + exec: function (editor) { + var endRow = editor.session.doc.getLength() - 1; + var endCol = editor.session.doc.getLine(endRow).length; + var ranges = editor.selection.rangeList.ranges; + var newRanges = []; + if (ranges.length < 1) { + ranges = [editor.selection.getRange()]; + } + for (var i = 0; i < ranges.length; i++) { + if (i == (ranges.length - 1)) { + if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) { + newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol)); + } + } + if (i === 0) { + if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) { + newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column)); + } + } + else { + newRanges.push(new Range(ranges[i - 1].end.row, ranges[i - 1].end.column, ranges[i].start.row, ranges[i].start.column)); + } + } + editor.exitMultiSelectMode(); + editor.clearSelection(); + for (var i = 0; i < newRanges.length; i++) { + editor.selection.addRange(newRanges[i], false); } }, - initialValue: true - }, - firstLineNumber: { - set: function() {this._signal("changeBreakpoint");}, - initialValue: 1 - }, - useWorker: { - set: function(useWorker) { - this.$useWorker = useWorker; - - this.$stopWorker(); - if (useWorker) - this.$startWorker(); + readOnly: true, + scrollIntoView: "none" + }, { + name: "addLineAfter", + description: "Add new line after the current line", + exec: function (editor) { + editor.selection.clearSelection(); + editor.navigateLineEnd(); + editor.insert("\n"); }, - initialValue: true - }, - useSoftTabs: {initialValue: true}, - tabSize: { - set: function(tabSize) { - tabSize = parseInt(tabSize); - if (tabSize > 0 && this.$tabSize !== tabSize) { - this.$modified = true; - this.$rowLengthCache = []; - this.$tabSize = tabSize; - this._signal("changeTabSize"); - } + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "addLineBefore", + description: "Add new line before the current line", + exec: function (editor) { + editor.selection.clearSelection(); + var cursor = editor.getCursorPosition(); + editor.selection.moveTo(cursor.row - 1, Number.MAX_VALUE); + editor.insert("\n"); + if (cursor.row === 0) + editor.navigateUp(); }, - initialValue: 4, - handlesSet: true - }, - navigateWithinSoftTabs: {initialValue: false}, - foldStyle: { - set: function(val) {this.setFoldStyle(val);}, - handlesSet: true - }, - overwrite: { - set: function(val) {this._signal("changeOverwrite");}, - initialValue: false - }, - newLineMode: { - set: function(val) {this.doc.setNewLineMode(val);}, - get: function() {return this.doc.getNewLineMode();}, - handlesSet: true - }, - mode: { - set: function(val) { this.setMode(val); }, - get: function() { return this.$modeId; }, - handlesSet: true - } -}); + multiSelectAction: "forEach", + scrollIntoView: "cursor" + }, { + name: "openCommandPallete", + exec: function (editor) { + console.warn("This is an obsolete command. Please use `openCommandPalette` instead."); + editor.prompt({ $type: "commands" }); + }, + readOnly: true + }, { + name: "openCommandPalette", + description: "Open command palette", + bindKey: bindKey("F1", "F1"), + exec: function (editor) { + editor.prompt({ $type: "commands" }); + }, + readOnly: true + }, { + name: "modeSelect", + description: "Change language mode...", + bindKey: bindKey(null, null), + exec: function (editor) { + editor.prompt({ $type: "modes" }); + }, + readOnly: true + }]; +for (var i = 1; i < 9; i++) { + exports.commands.push({ + name: "foldToLevel" + i, + description: "Fold To Level " + i, + level: i, + exec: function (editor) { editor.session.foldToLevel(this.level); }, + scrollIntoView: "center", + readOnly: true + }); +} -exports.EditSession = EditSession; }); -ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"], function(require, exports, module) { -"use strict"; - -var lang = require("./lib/lang"); -var oop = require("./lib/oop"); -var Range = require("./range").Range; - -var Search = function() { - this.$options = {}; -}; - -(function() { - this.set = function(options) { - oop.mixin(this.$options, options); - return this; +ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"], function(require, exports, module){"use strict"; +var dom = require("./lib/dom"); +var LineWidgets = /** @class */ (function () { + function LineWidgets(session) { + this.session = session; + this.session.widgetManager = this; + this.session.getRowLength = this.getRowLength; + this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; + this.updateOnChange = this.updateOnChange.bind(this); + this.renderWidgets = this.renderWidgets.bind(this); + this.measureWidgets = this.measureWidgets.bind(this); + this.session._changedWidgets = []; + this.$onChangeEditor = this.$onChangeEditor.bind(this); + this.session.on("change", this.updateOnChange); + this.session.on("changeFold", this.updateOnFold); + this.session.on("changeEditor", this.$onChangeEditor); + } + LineWidgets.prototype.getRowLength = function (row) { + var h; + if (this.lineWidgets) + h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; + else + h = 0; + if (!this["$useWrapMode"] || !this["$wrapData"][row]) { + return 1 + h; + } + else { + return this["$wrapData"][row].length + 1 + h; + } }; - this.getOptions = function() { - return lang.copyObject(this.$options); + LineWidgets.prototype.$getWidgetScreenLength = function () { + var screenRows = 0; + this.lineWidgets.forEach(function (w) { + if (w && w.rowCount && !w.hidden) + screenRows += w.rowCount; + }); + return screenRows; }; - this.setOptions = function(options) { - this.$options = options; + LineWidgets.prototype.$onChangeEditor = function (e) { + this.attach(e.editor); }; - this.find = function(session) { - var options = this.$options; - var iterator = this.$matchIterator(session, options); - if (!iterator) - return false; - - var firstRange = null; - iterator.forEach(function(sr, sc, er, ec) { - firstRange = new Range(sr, sc, er, ec); - if (sc == ec && options.start && options.start.start - && options.skipCurrent != false && firstRange.isEqual(options.start) - ) { - firstRange = null; - return false; + LineWidgets.prototype.attach = function (editor) { + if (editor && editor.widgetManager && editor.widgetManager != this) + editor.widgetManager.detach(); + if (this.editor == editor) + return; + this.detach(); + this.editor = editor; + if (editor) { + editor.widgetManager = this; + editor.renderer.on("beforeRender", this.measureWidgets); + editor.renderer.on("afterRender", this.renderWidgets); + } + }; + LineWidgets.prototype.detach = function (e) { + var editor = this.editor; + if (!editor) + return; + this.editor = null; + editor.widgetManager = null; + editor.renderer.off("beforeRender", this.measureWidgets); + editor.renderer.off("afterRender", this.renderWidgets); + var lineWidgets = this.session.lineWidgets; + lineWidgets && lineWidgets.forEach(function (w) { + if (w && w.el && w.el.parentNode) { + w._inDocument = false; + w.el.parentNode.removeChild(w.el); } - - return true; }); - - return firstRange; }; - this.findAll = function(session) { - var options = this.$options; - if (!options.needle) - return []; - this.$assembleRegExp(options); - - var range = options.range; - var lines = range - ? session.getLines(range.start.row, range.end.row) - : session.doc.getAllLines(); - - var ranges = []; - var re = options.re; - if (options.$isMultiLine) { - var len = re.length; - var maxRow = lines.length - len; - var prevRange; - outer: for (var row = re.offset || 0; row <= maxRow; row++) { - for (var j = 0; j < len; j++) - if (lines[row + j].search(re[j]) == -1) - continue outer; - - var startLine = lines[row]; - var line = lines[row + len - 1]; - var startIndex = startLine.length - startLine.match(re[0])[0].length; - var endIndex = line.match(re[len - 1])[0].length; - - if (prevRange && prevRange.end.row === row && - prevRange.end.column > startIndex - ) { - continue; - } - ranges.push(prevRange = new Range( - row, startIndex, row + len - 1, endIndex - )); - if (len > 2) - row = row + len - 2; + LineWidgets.prototype.updateOnFold = function (e, session) { + var lineWidgets = session.lineWidgets; + if (!lineWidgets || !e.action) + return; + var fold = e.data; + var start = fold.start.row; + var end = fold.end.row; + var hide = e.action == "add"; + for (var i = start + 1; i < end; i++) { + if (lineWidgets[i]) + lineWidgets[i].hidden = hide; + } + if (lineWidgets[end]) { + if (hide) { + if (!lineWidgets[start]) + lineWidgets[start] = lineWidgets[end]; + else + lineWidgets[end].hidden = hide; } - } else { - for (var i = 0; i < lines.length; i++) { - var matches = lang.getMatchOffsets(lines[i], re); - for (var j = 0; j < matches.length; j++) { - var match = matches[j]; - ranges.push(new Range(i, match.offset, i, match.offset + match.length)); - } + else { + if (lineWidgets[start] == lineWidgets[end]) + lineWidgets[start] = undefined; + lineWidgets[end].hidden = hide; } } - - if (range) { - var startColumn = range.start.column; - var endColumn = range.start.column; - var i = 0, j = ranges.length - 1; - while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == range.start.row) - i++; - - while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == range.end.row) - j--; - - ranges = ranges.slice(i, j + 1); - for (i = 0, j = ranges.length; i < j; i++) { - ranges[i].start.row += range.start.row; - ranges[i].end.row += range.start.row; + }; + LineWidgets.prototype.updateOnChange = function (delta) { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) + return; + var startRow = delta.start.row; + var len = delta.end.row - startRow; + if (len === 0) { + } + else if (delta.action == "remove") { + var removed = lineWidgets.splice(startRow + 1, len); + if (!lineWidgets[startRow] && removed[removed.length - 1]) { + lineWidgets[startRow] = removed.pop(); } + removed.forEach(function (w) { + w && this.removeLineWidget(w); + }, this); + this.$updateRows(); + } + else { + var args = new Array(len); + if (lineWidgets[startRow] && lineWidgets[startRow].column != null) { + if (delta.start.column > lineWidgets[startRow].column) + startRow++; + } + args.unshift(startRow, 0); + lineWidgets.splice.apply(lineWidgets, args); + this.$updateRows(); } - - return ranges; }; - this.replace = function(input, replacement) { - var options = this.$options; - - var re = this.$assembleRegExp(options); - if (options.$isMultiLine) - return replacement; - - if (!re) + LineWidgets.prototype.$updateRows = function () { + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) return; - - var match = re.exec(input); - if (!match || match[0].length != input.length) - return null; - - replacement = input.replace(re, replacement); - if (options.preserveCase) { - replacement = replacement.split(""); - for (var i = Math.min(input.length, input.length); i--; ) { - var ch = input[i]; - if (ch && ch.toLowerCase() != ch) - replacement[i] = replacement[i].toUpperCase(); - else - replacement[i] = replacement[i].toLowerCase(); + var noWidgets = true; + lineWidgets.forEach(function (w, i) { + if (w) { + noWidgets = false; + w.row = i; + while (w.$oldWidget) { + w.$oldWidget.row = i; + w = w.$oldWidget; + } } - replacement = replacement.join(""); - } - - return replacement; + }); + if (noWidgets) + this.session.lineWidgets = null; }; - - this.$assembleRegExp = function(options, $disableFakeMultiline) { - if (options.needle instanceof RegExp) - return options.re = options.needle; - - var needle = options.needle; - - if (!options.needle) - return options.re = false; - - if (!options.regExp) - needle = lang.escapeRegExp(needle); - - if (options.wholeWord) - needle = addWordBoundary(needle, options); - - var modifier = options.caseSensitive ? "gm" : "gmi"; - - options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle); - if (options.$isMultiLine) - return options.re = this.$assembleMultilineRegExp(needle, modifier); - - try { - var re = new RegExp(needle, modifier); - } catch(e) { - re = false; + LineWidgets.prototype.$registerLineWidget = function (w) { + if (!this.session.lineWidgets) + this.session.lineWidgets = new Array(this.session.getLength()); + var old = this.session.lineWidgets[w.row]; + if (old) { + w.$oldWidget = old; + if (old.el && old.el.parentNode) { + old.el.parentNode.removeChild(old.el); + old._inDocument = false; + } } - return options.re = re; + this.session.lineWidgets[w.row] = w; + return w; }; - - this.$assembleMultilineRegExp = function(needle, modifier) { - var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n"); - var re = []; - for (var i = 0; i < parts.length; i++) try { - re.push(new RegExp(parts[i], modifier)); - } catch(e) { - return false; + LineWidgets.prototype.addLineWidget = function (w) { + this.$registerLineWidget(w); + w.session = this.session; + if (!this.editor) + return w; + var renderer = this.editor.renderer; + if (w.html && !w.el) { + w.el = dom.createElement("div"); + w.el.innerHTML = w.html; } - return re; - }; - - this.$matchIterator = function(session, options) { - var re = this.$assembleRegExp(options); - if (!re) - return false; - var backwards = options.backwards == true; - var skipCurrent = options.skipCurrent != false; - - var range = options.range; - var start = options.start; - if (!start) - start = range ? range[backwards ? "end" : "start"] : session.selection.getRange(); - - if (start.start) - start = start[skipCurrent != backwards ? "end" : "start"]; - - var firstRow = range ? range.start.row : 0; - var lastRow = range ? range.end.row : session.getLength() - 1; - - if (backwards) { - var forEach = function(callback) { - var row = start.row; - if (forEachInLine(row, start.column, callback)) - return; - for (row--; row >= firstRow; row--) - if (forEachInLine(row, Number.MAX_VALUE, callback)) - return; - if (options.wrap == false) - return; - for (row = lastRow, firstRow = start.row; row >= firstRow; row--) - if (forEachInLine(row, Number.MAX_VALUE, callback)) - return; - }; + if (w.text && !w.el) { + w.el = dom.createElement("div"); + w.el.textContent = w.text; } - else { - var forEach = function(callback) { - var row = start.row; - if (forEachInLine(row, start.column, callback)) - return; - for (row = row + 1; row <= lastRow; row++) - if (forEachInLine(row, 0, callback)) - return; - if (options.wrap == false) - return; - for (row = firstRow, lastRow = start.row; row <= lastRow; row++) - if (forEachInLine(row, 0, callback)) - return; - }; + if (w.el) { + dom.addCssClass(w.el, "ace_lineWidgetContainer"); + if (w.className) { + dom.addCssClass(w.el, w.className); + } + w.el.style.position = "absolute"; + w.el.style.zIndex = "5"; + renderer.container.appendChild(w.el); + w._inDocument = true; + if (!w.coverGutter) { + w.el.style.zIndex = "3"; + } + if (w.pixelHeight == null) { + w.pixelHeight = w.el.offsetHeight; + } } - - if (options.$isMultiLine) { - var len = re.length; - var forEachInLine = function(row, offset, callback) { - var startRow = backwards ? row - len + 1 : row; - if (startRow < 0) return; - var line = session.getLine(startRow); - var startIndex = line.search(re[0]); - if (!backwards && startIndex < offset || startIndex === -1) return; - for (var i = 1; i < len; i++) { - line = session.getLine(startRow + i); - if (line.search(re[i]) == -1) - return; - } - var endIndex = line.match(re[len - 1])[0].length; - if (backwards && endIndex > offset) return; - if (callback(startRow, startIndex, startRow + len - 1, endIndex)) - return true; - }; + if (w.rowCount == null) { + w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; } - else if (backwards) { - var forEachInLine = function(row, endIndex, callback) { - var line = session.getLine(row); - var matches = []; - var m, last = 0; - re.lastIndex = 0; - while((m = re.exec(line))) { - var length = m[0].length; - last = m.index; - if (!length) { - if (last >= line.length) break; - re.lastIndex = last += 1; - } - if (m.index + length > endIndex) - break; - matches.push(m.index, length); - } - for (var i = matches.length - 1; i >= 0; i -= 2) { - var column = matches[i - 1]; - var length = matches[i]; - if (callback(row, column, row, column + length)) - return true; - } - }; + var fold = this.session.getFoldAt(w.row, 0); + w.$fold = fold; + if (fold) { + var lineWidgets = this.session.lineWidgets; + if (w.row == fold.end.row && !lineWidgets[fold.start.row]) + lineWidgets[fold.start.row] = w; + else + w.hidden = true; } - else { - var forEachInLine = function(row, startIndex, callback) { - var line = session.getLine(row); - var last; - var m; - re.lastIndex = startIndex; - while((m = re.exec(line))) { - var length = m[0].length; - last = m.index; - if (callback(row, last, row,last + length)) - return true; - if (!length) { - re.lastIndex = last += 1; - if (last >= line.length) return false; + this.session._emit("changeFold", { data: { start: { row: w.row } } }); + this.$updateRows(); + this.renderWidgets(null, renderer); + this.onWidgetChanged(w); + return w; + }; + LineWidgets.prototype.removeLineWidget = function (w) { + w._inDocument = false; + w.session = null; + if (w.el && w.el.parentNode) + w.el.parentNode.removeChild(w.el); + if (w.editor && w.editor.destroy) + try { + w.editor.destroy(); + } + catch (e) { } + if (this.session.lineWidgets) { + var w1 = this.session.lineWidgets[w.row]; + if (w1 == w) { + this.session.lineWidgets[w.row] = w.$oldWidget; + if (w.$oldWidget) + this.onWidgetChanged(w.$oldWidget); + } + else { + while (w1) { + if (w1.$oldWidget == w) { + w1.$oldWidget = w.$oldWidget; + break; } + w1 = w1.$oldWidget; } - }; + } + } + this.session._emit("changeFold", { data: { start: { row: w.row } } }); + this.$updateRows(); + }; + LineWidgets.prototype.getWidgetsAtRow = function (row) { + var lineWidgets = this.session.lineWidgets; + var w = lineWidgets && lineWidgets[row]; + var list = []; + while (w) { + list.push(w); + w = w.$oldWidget; } - return {forEach: forEach}; + return list; }; + LineWidgets.prototype.onWidgetChanged = function (w) { + this.session._changedWidgets.push(w); + this.editor && this.editor.renderer.updateFull(); + }; + LineWidgets.prototype.measureWidgets = function (e, renderer) { + var changedWidgets = this.session._changedWidgets; + var config = renderer.layerConfig; + if (!changedWidgets || !changedWidgets.length) + return; + var min = Infinity; + for (var i = 0; i < changedWidgets.length; i++) { + var w = changedWidgets[i]; + if (!w || !w.el) + continue; + if (w.session != this.session) + continue; + if (!w._inDocument) { + if (this.session.lineWidgets[w.row] != w) + continue; + w._inDocument = true; + renderer.container.appendChild(w.el); + } + w.h = w.el.offsetHeight; + if (!w.fixedWidth) { + w.w = w.el.offsetWidth; + w.screenWidth = Math.ceil(w.w / config.characterWidth); + } + var rowCount = w.h / config.lineHeight; + if (w.coverLine) { + rowCount -= this.session.getRowLineCount(w.row); + if (rowCount < 0) + rowCount = 0; + } + if (w.rowCount != rowCount) { + w.rowCount = rowCount; + if (w.row < min) + min = w.row; + } + } + if (min != Infinity) { + this.session._emit("changeFold", { data: { start: { row: min } } }); + this.session.lineWidgetWidth = null; + } + this.session._changedWidgets = []; + }; + LineWidgets.prototype.renderWidgets = function (e, renderer) { + var config = renderer.layerConfig; + var lineWidgets = this.session.lineWidgets; + if (!lineWidgets) + return; + var first = Math.min(this.firstRow, config.firstRow); + var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); + while (first > 0 && !lineWidgets[first]) + first--; + this.firstRow = config.firstRow; + this.lastRow = config.lastRow; + renderer.$cursorLayer.config = config; + for (var i = first; i <= last; i++) { + var w = lineWidgets[i]; + if (!w || !w.el) + continue; + if (w.hidden) { + w.el.style.top = -100 - (w.pixelHeight || 0) + "px"; + continue; + } + if (!w._inDocument) { + w._inDocument = true; + renderer.container.appendChild(w.el); + } + var top = renderer.$cursorLayer.getPixelPosition({ row: i, column: 0 }, true).top; + if (!w.coverLine) + top += config.lineHeight * this.session.getRowLineCount(w.row); + w.el.style.top = top - config.offset + "px"; + var left = w.coverGutter ? 0 : renderer.gutterWidth; + if (!w.fixedWidth) + left -= renderer.scrollLeft; + w.el.style.left = left + "px"; + if (w.fullWidth && w.screenWidth) { + w.el.style.minWidth = config.width + 2 * config.padding + "px"; + } + if (w.fixedWidth) { + w.el.style.right = renderer.scrollBar.getWidth() + "px"; + } + else { + w.el.style.right = ""; + } + } + }; + return LineWidgets; +}()); +exports.LineWidgets = LineWidgets; -}).call(Search.prototype); - -function addWordBoundary(needle, options) { - function wordBoundary(c) { - if (/\w/.test(c) || options.regExp) return "\\b"; - return ""; - } - return wordBoundary(needle[0]) + needle - + wordBoundary(needle[needle.length - 1]); -} - -exports.Search = Search; }); -ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(require, exports, module) { -"use strict"; - -var keyUtil = require("../lib/keys"); -var useragent = require("../lib/useragent"); -var KEY_MODS = keyUtil.KEY_MODS; - -function HashHandler(config, platform) { - this.platform = platform || (useragent.isMac ? "mac" : "win"); - this.commands = {}; - this.commandKeyBinding = {}; - this.addCommands(config); - this.$singleCommand = true; -} - -function MultiHashHandler(config, platform) { - HashHandler.call(this, config, platform); - this.$singleCommand = false; -} - -MultiHashHandler.prototype = HashHandler.prototype; - -(function() { - - - this.addCommand = function(command) { - if (this.commands[command.name]) - this.removeCommand(command); - - this.commands[command.name] = command; - - if (command.bindKey) - this._buildKeyHash(command); - }; - - this.removeCommand = function(command, keepCommand) { - var name = command && (typeof command === 'string' ? command : command.name); - command = this.commands[name]; - if (!keepCommand) - delete this.commands[name]; - var ckb = this.commandKeyBinding; - for (var keyId in ckb) { - var cmdGroup = ckb[keyId]; - if (cmdGroup == command) { - delete ckb[keyId]; - } else if (Array.isArray(cmdGroup)) { - var i = cmdGroup.indexOf(command); - if (i != -1) { - cmdGroup.splice(i, 1); - if (cmdGroup.length == 1) - ckb[keyId] = cmdGroup[0]; +ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"], function(require, exports, module){"use strict"; +var keys = require('../lib/keys'); +var GutterTooltip = require("../mouse/default_gutter_handler").GutterTooltip; +var GutterKeyboardHandler = /** @class */ (function () { + function GutterKeyboardHandler(editor) { + this.editor = editor; + this.gutterLayer = editor.renderer.$gutterLayer; + this.element = editor.renderer.$gutter; + this.lines = editor.renderer.$gutterLayer.$lines; + this.activeRowIndex = null; + this.activeLane = null; + this.annotationTooltip = new GutterTooltip(this.editor); + } + GutterKeyboardHandler.prototype.addListener = function () { + this.element.addEventListener("keydown", this.$onGutterKeyDown.bind(this)); + this.element.addEventListener("focusout", this.$blurGutter.bind(this)); + this.editor.on("mousewheel", this.$blurGutter.bind(this)); + }; + GutterKeyboardHandler.prototype.removeListener = function () { + this.element.removeEventListener("keydown", this.$onGutterKeyDown.bind(this)); + this.element.removeEventListener("focusout", this.$blurGutter.bind(this)); + this.editor.off("mousewheel", this.$blurGutter.bind(this)); + }; + GutterKeyboardHandler.prototype.$onGutterKeyDown = function (e) { + if (this.annotationTooltip.isOpen) { + e.preventDefault(); + if (e.keyCode === keys["escape"]) + this.annotationTooltip.hideTooltip(); + return; + } + if (e.target === this.element) { + if (e.keyCode != keys["enter"]) { + return; + } + e.preventDefault(); + var row = this.editor.getCursorPosition().row; + if (!this.editor.isRowVisible(row)) + this.editor.scrollToLine(row, true, true); + setTimeout( + function () { + var index = this.$rowToRowIndex(this.gutterLayer.$cursorCell.row); + var nearestFoldIndex = this.$findNearestFoldWidget(index); + var nearestAnnotationIndex = this.$findNearestAnnotation(index); + if (nearestFoldIndex === null && nearestAnnotationIndex === null) + return; + if (nearestFoldIndex === null && nearestAnnotationIndex !== null) { + this.activeRowIndex = nearestAnnotationIndex; + this.activeLane = "annotation"; + this.$focusAnnotation(this.activeRowIndex); + return; + } + if (nearestFoldIndex !== null && nearestAnnotationIndex === null) { + this.activeRowIndex = nearestFoldIndex; + this.activeLane = "fold"; + this.$focusFoldWidget(this.activeRowIndex); + return; } - } + if (Math.abs(nearestAnnotationIndex - index) < Math.abs(nearestFoldIndex - index)) { + this.activeRowIndex = nearestAnnotationIndex; + this.activeLane = "annotation"; + this.$focusAnnotation(this.activeRowIndex); + return; + } + else { + this.activeRowIndex = nearestFoldIndex; + this.activeLane = "fold"; + this.$focusFoldWidget(this.activeRowIndex); + return; + } + }.bind(this), 10); + return; } + this.$handleGutterKeyboardInteraction(e); + setTimeout(function () { + this.editor._signal("gutterkeydown", new GutterKeyboardEvent(e, this)); + }.bind(this), 10); }; - - this.bindKey = function(key, command, position) { - if (typeof key == "object" && key) { - if (position == undefined) - position = key.position; - key = key[this.platform]; + GutterKeyboardHandler.prototype.$handleGutterKeyboardInteraction = function (e) { + if (e.keyCode === keys["tab"]) { + e.preventDefault(); + return; } - if (!key) + if (e.keyCode === keys["escape"]) { + e.preventDefault(); + this.$blurGutter(); + this.element.focus(); + this.lane = null; return; - if (typeof command == "function") - return this.addCommand({exec: command, bindKey: key, name: command.name || key}); - - key.split("|").forEach(function(keyPart) { - var chain = ""; - if (keyPart.indexOf(" ") != -1) { - var parts = keyPart.split(/\s+/); - keyPart = parts.pop(); - parts.forEach(function(keyPart) { - var binding = this.parseKeys(keyPart); - var id = KEY_MODS[binding.hashId] + binding.key; - chain += (chain ? " " : "") + id; - this._addCommandToBinding(chain, "chainKeys"); - }, this); - chain += " "; + } + if (e.keyCode === keys["up"]) { + e.preventDefault(); + switch (this.activeLane) { + case "fold": + this.$moveFoldWidgetUp(); + break; + case "annotation": + this.$moveAnnotationUp(); + break; } - var binding = this.parseKeys(keyPart); - var id = KEY_MODS[binding.hashId] + binding.key; - this._addCommandToBinding(chain + id, command, position); - }, this); - }; - - function getPosition(command) { - return typeof command == "object" && command.bindKey - && command.bindKey.position - || (command.isDefault ? -100 : 0); - } - this._addCommandToBinding = function(keyId, command, position) { - var ckb = this.commandKeyBinding, i; - if (!command) { - delete ckb[keyId]; - } else if (!ckb[keyId] || this.$singleCommand) { - ckb[keyId] = command; - } else { - if (!Array.isArray(ckb[keyId])) { - ckb[keyId] = [ckb[keyId]]; - } else if ((i = ckb[keyId].indexOf(command)) != -1) { - ckb[keyId].splice(i, 1); + return; + } + if (e.keyCode === keys["down"]) { + e.preventDefault(); + switch (this.activeLane) { + case "fold": + this.$moveFoldWidgetDown(); + break; + case "annotation": + this.$moveAnnotationDown(); + break; } - - if (typeof position != "number") { - position = getPosition(command); + return; + } + if (e.keyCode === keys["left"]) { + e.preventDefault(); + this.$switchLane("annotation"); + return; + } + if (e.keyCode === keys["right"]) { + e.preventDefault(); + this.$switchLane("fold"); + return; + } + if (e.keyCode === keys["enter"] || e.keyCode === keys["space"]) { + e.preventDefault(); + switch (this.activeLane) { + case "fold": + if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === 'start') { + var rowFoldingWidget = this.$rowIndexToRow(this.activeRowIndex); + this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex), e); + setTimeout( + function () { + if (this.$rowIndexToRow(this.activeRowIndex) !== rowFoldingWidget) { + this.$blurFoldWidget(this.activeRowIndex); + this.activeRowIndex = this.$rowToRowIndex(rowFoldingWidget); + this.$focusFoldWidget(this.activeRowIndex); + } + }.bind(this), 10); + break; + } + else if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === 'end') { + break; + } + return; + case "annotation": + var gutterElement = this.lines.cells[this.activeRowIndex].element.childNodes[2]; + var rect = gutterElement.getBoundingClientRect(); + var style = this.annotationTooltip.getElement().style; + style.left = rect.right + "px"; + style.top = rect.bottom + "px"; + this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex)); + break; } - - var commands = ckb[keyId]; - for (i = 0; i < commands.length; i++) { - var other = commands[i]; - var otherPos = getPosition(other); - if (otherPos > position) + return; + } + }; + GutterKeyboardHandler.prototype.$blurGutter = function () { + if (this.activeRowIndex !== null) { + switch (this.activeLane) { + case "fold": + this.$blurFoldWidget(this.activeRowIndex); + break; + case "annotation": + this.$blurAnnotation(this.activeRowIndex); break; } - commands.splice(i, 0, command); } + if (this.annotationTooltip.isOpen) + this.annotationTooltip.hideTooltip(); + return; }; - - this.addCommands = function(commands) { - commands && Object.keys(commands).forEach(function(name) { - var command = commands[name]; - if (!command) - return; - - if (typeof command === "string") - return this.bindKey(command, name); - - if (typeof command === "function") - command = { exec: command }; - - if (typeof command !== "object") - return; - - if (!command.name) - command.name = name; - - this.addCommand(command); - }, this); + GutterKeyboardHandler.prototype.$isFoldWidgetVisible = function (index) { + var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index)); + var isIconVisible = this.$getFoldWidget(index).style.display !== "none"; + return isRowFullyVisible && isIconVisible; }; - - this.removeCommands = function(commands) { - Object.keys(commands).forEach(function(name) { - this.removeCommand(commands[name]); - }, this); + GutterKeyboardHandler.prototype.$isAnnotationVisible = function (index) { + var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index)); + var isIconVisible = this.$getAnnotation(index).style.display !== "none"; + return isRowFullyVisible && isIconVisible; }; - - this.bindKeys = function(keyList) { - Object.keys(keyList).forEach(function(key) { - this.bindKey(key, keyList[key]); - }, this); + GutterKeyboardHandler.prototype.$getFoldWidget = function (index) { + var cell = this.lines.get(index); + var element = cell.element; + return element.childNodes[1]; }; - - this._buildKeyHash = function(command) { - this.bindKey(command.bindKey, command); + GutterKeyboardHandler.prototype.$getAnnotation = function (index) { + var cell = this.lines.get(index); + var element = cell.element; + return element.childNodes[2]; }; - this.parseKeys = function(keys) { - var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x;}); - var key = parts.pop(); - - var keyCode = keyUtil[key]; - if (keyUtil.FUNCTION_KEYS[keyCode]) - key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase(); - else if (!parts.length) - return {key: key, hashId: -1}; - else if (parts.length == 1 && parts[0] == "shift") - return {key: key.toUpperCase(), hashId: -1}; - - var hashId = 0; - for (var i = parts.length; i--;) { - var modifier = keyUtil.KEY_MODS[parts[i]]; - if (modifier == null) { - if (typeof console != "undefined") - console.error("invalid modifier " + parts[i] + " in " + keys); - return false; - } - hashId |= modifier; + GutterKeyboardHandler.prototype.$findNearestFoldWidget = function (index) { + if (this.$isFoldWidgetVisible(index)) + return index; + var i = 0; + while (index - i > 0 || index + i < this.lines.getLength() - 1) { + i++; + if (index - i >= 0 && this.$isFoldWidgetVisible(index - i)) + return index - i; + if (index + i <= this.lines.getLength() - 1 && this.$isFoldWidgetVisible(index + i)) + return index + i; } - return {key: key, hashId: hashId}; - }; - - this.findKeyCommand = function findKeyCommand(hashId, keyString) { - var key = KEY_MODS[hashId] + keyString; - return this.commandKeyBinding[key]; + return null; }; - - this.handleKeyboard = function(data, hashId, keyString, keyCode) { - if (keyCode < 0) return; - var key = KEY_MODS[hashId] + keyString; - var command = this.commandKeyBinding[key]; - if (data.$keyChain) { - data.$keyChain += " " + key; - command = this.commandKeyBinding[data.$keyChain] || command; - } - - if (command) { - if (command == "chainKeys" || command[command.length - 1] == "chainKeys") { - data.$keyChain = data.$keyChain || key; - return {command: "null"}; - } - } - - if (data.$keyChain) { - if ((!hashId || hashId == 4) && keyString.length == 1) - data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input - else if (hashId == -1 || keyCode > 0) - data.$keyChain = ""; // reset keyChain + GutterKeyboardHandler.prototype.$findNearestAnnotation = function (index) { + if (this.$isAnnotationVisible(index)) + return index; + var i = 0; + while (index - i > 0 || index + i < this.lines.getLength() - 1) { + i++; + if (index - i >= 0 && this.$isAnnotationVisible(index - i)) + return index - i; + if (index + i <= this.lines.getLength() - 1 && this.$isAnnotationVisible(index + i)) + return index + i; } - return {command: command}; + return null; }; - - this.getStatusText = function(editor, data) { - return data.$keyChain || ""; + GutterKeyboardHandler.prototype.$focusFoldWidget = function (index) { + if (index == null) + return; + var foldWidget = this.$getFoldWidget(index); + foldWidget.classList.add(this.editor.renderer.keyboardFocusClassName); + foldWidget.focus(); }; - -}).call(HashHandler.prototype); - -exports.HashHandler = HashHandler; -exports.MultiHashHandler = MultiHashHandler; -}); - -ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"], function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var MultiHashHandler = require("../keyboard/hash_handler").MultiHashHandler; -var EventEmitter = require("../lib/event_emitter").EventEmitter; - -var CommandManager = function(platform, commands) { - MultiHashHandler.call(this, commands, platform); - this.byName = this.commands; - this.setDefaultHandler("exec", function(e) { - return e.command.exec(e.editor, e.args || {}); - }); -}; - -oop.inherits(CommandManager, MultiHashHandler); - -(function() { - - oop.implement(this, EventEmitter); - - this.exec = function(command, editor, args) { - if (Array.isArray(command)) { - for (var i = command.length; i--; ) { - if (this.exec(command[i], editor, args)) return true; + GutterKeyboardHandler.prototype.$focusAnnotation = function (index) { + if (index == null) + return; + var annotation = this.$getAnnotation(index); + annotation.classList.add(this.editor.renderer.keyboardFocusClassName); + annotation.focus(); + }; + GutterKeyboardHandler.prototype.$blurFoldWidget = function (index) { + var foldWidget = this.$getFoldWidget(index); + foldWidget.classList.remove(this.editor.renderer.keyboardFocusClassName); + foldWidget.blur(); + }; + GutterKeyboardHandler.prototype.$blurAnnotation = function (index) { + var annotation = this.$getAnnotation(index); + annotation.classList.remove(this.editor.renderer.keyboardFocusClassName); + annotation.blur(); + }; + GutterKeyboardHandler.prototype.$moveFoldWidgetUp = function () { + var index = this.activeRowIndex; + while (index > 0) { + index--; + if (this.$isFoldWidgetVisible(index)) { + this.$blurFoldWidget(this.activeRowIndex); + this.activeRowIndex = index; + this.$focusFoldWidget(this.activeRowIndex); + return; } - return false; } - - if (typeof command === "string") - command = this.commands[command]; - - if (!command) - return false; - - if (editor && editor.$readOnly && !command.readOnly) - return false; - - if (this.$checkCommandState != false && command.isAvailable && !command.isAvailable(editor)) - return false; - - var e = {editor: editor, command: command, args: args}; - e.returnValue = this._emit("exec", e); - this._signal("afterExec", e); - - return e.returnValue === false ? false : true; + return; }; - - this.toggleRecording = function(editor) { - if (this.$inReplay) - return; - - editor && editor._emit("changeStatus"); - if (this.recording) { - this.macro.pop(); - this.off("exec", this.$addCommandToMacro); - - if (!this.macro.length) - this.macro = this.oldMacro; - - return this.recording = false; - } - if (!this.$addCommandToMacro) { - this.$addCommandToMacro = function(e) { - this.macro.push([e.command, e.args]); - }.bind(this); + GutterKeyboardHandler.prototype.$moveFoldWidgetDown = function () { + var index = this.activeRowIndex; + while (index < this.lines.getLength() - 1) { + index++; + if (this.$isFoldWidgetVisible(index)) { + this.$blurFoldWidget(this.activeRowIndex); + this.activeRowIndex = index; + this.$focusFoldWidget(this.activeRowIndex); + return; + } } - - this.oldMacro = this.macro; - this.macro = []; - this.on("exec", this.$addCommandToMacro); - return this.recording = true; + return; }; - - this.replay = function(editor) { - if (this.$inReplay || !this.macro) - return; - - if (this.recording) - return this.toggleRecording(editor); - - try { - this.$inReplay = true; - this.macro.forEach(function(x) { - if (typeof x == "string") - this.exec(x, editor); - else - this.exec(x[0], editor, x[1]); - }, this); - } finally { - this.$inReplay = false; + GutterKeyboardHandler.prototype.$moveAnnotationUp = function () { + var index = this.activeRowIndex; + while (index > 0) { + index--; + if (this.$isAnnotationVisible(index)) { + this.$blurAnnotation(this.activeRowIndex); + this.activeRowIndex = index; + this.$focusAnnotation(this.activeRowIndex); + return; + } } + return; }; - - this.trimMacro = function(m) { - return m.map(function(x){ - if (typeof x[0] != "string") - x[0] = x[0].name; - if (!x[1]) - x = x[0]; - return x; - }); - }; - -}).call(CommandManager.prototype); - -exports.CommandManager = CommandManager; - -}); - -ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"], function(require, exports, module) { -"use strict"; - -var lang = require("../lib/lang"); -var config = require("../config"); -var Range = require("../range").Range; - -function bindKey(win, mac) { - return {win: win, mac: mac}; -} -exports.commands = [{ - name: "showSettingsMenu", - bindKey: bindKey("Ctrl-,", "Command-,"), - exec: function(editor) { - config.loadModule("ace/ext/settings_menu", function(module) { - module.init(editor); - editor.showSettingsMenu(); - }); - }, - readOnly: true -}, { - name: "goToNextError", - bindKey: bindKey("Alt-E", "F4"), - exec: function(editor) { - config.loadModule("./ext/error_marker", function(module) { - module.showErrorMarker(editor, 1); - }); - }, - scrollIntoView: "animate", - readOnly: true -}, { - name: "goToPreviousError", - bindKey: bindKey("Alt-Shift-E", "Shift-F4"), - exec: function(editor) { - config.loadModule("./ext/error_marker", function(module) { - module.showErrorMarker(editor, -1); - }); - }, - scrollIntoView: "animate", - readOnly: true -}, { - name: "selectall", - description: "Select all", - bindKey: bindKey("Ctrl-A", "Command-A"), - exec: function(editor) { editor.selectAll(); }, - readOnly: true -}, { - name: "centerselection", - description: "Center selection", - bindKey: bindKey(null, "Ctrl-L"), - exec: function(editor) { editor.centerSelection(); }, - readOnly: true -}, { - name: "gotoline", - description: "Go to line...", - bindKey: bindKey("Ctrl-L", "Command-L"), - exec: function(editor, line) { - if (typeof line === "number" && !isNaN(line)) - editor.gotoLine(line); - editor.prompt({ $type: "gotoLine" }); - }, - readOnly: true -}, { - name: "fold", - bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"), - exec: function(editor) { editor.session.toggleFold(false); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "unfold", - bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"), - exec: function(editor) { editor.session.toggleFold(true); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "toggleFoldWidget", - bindKey: bindKey("F2", "F2"), - exec: function(editor) { editor.session.toggleFoldWidget(); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "toggleParentFoldWidget", - bindKey: bindKey("Alt-F2", "Alt-F2"), - exec: function(editor) { editor.session.toggleFoldWidget(true); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "foldall", - description: "Fold all", - bindKey: bindKey(null, "Ctrl-Command-Option-0"), - exec: function(editor) { editor.session.foldAll(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "foldAllComments", - description: "Fold all comments", - bindKey: bindKey(null, "Ctrl-Command-Option-0"), - exec: function(editor) { editor.session.foldAllComments(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "foldOther", - description: "Fold other", - bindKey: bindKey("Alt-0", "Command-Option-0"), - exec: function(editor) { - editor.session.foldAll(); - editor.session.unfold(editor.selection.getAllRanges()); - }, - scrollIntoView: "center", - readOnly: true -}, { - name: "unfoldall", - description: "Unfold all", - bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"), - exec: function(editor) { editor.session.unfold(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "findnext", - description: "Find next", - bindKey: bindKey("Ctrl-K", "Command-G"), - exec: function(editor) { editor.findNext(); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "findprevious", - description: "Find previous", - bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), - exec: function(editor) { editor.findPrevious(); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "selectOrFindNext", - description: "Select or find next", - bindKey: bindKey("Alt-K", "Ctrl-G"), - exec: function(editor) { - if (editor.selection.isEmpty()) - editor.selection.selectWord(); - else - editor.findNext(); - }, - readOnly: true -}, { - name: "selectOrFindPrevious", - description: "Select or find previous", - bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"), - exec: function(editor) { - if (editor.selection.isEmpty()) - editor.selection.selectWord(); - else - editor.findPrevious(); - }, - readOnly: true -}, { - name: "find", - description: "Find", - bindKey: bindKey("Ctrl-F", "Command-F"), - exec: function(editor) { - config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor);}); - }, - readOnly: true -}, { - name: "overwrite", - description: "Overwrite", - bindKey: "Insert", - exec: function(editor) { editor.toggleOverwrite(); }, - readOnly: true -}, { - name: "selecttostart", - description: "Select to start", - bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"), - exec: function(editor) { editor.getSelection().selectFileStart(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "gotostart", - description: "Go to start", - bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"), - exec: function(editor) { editor.navigateFileStart(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "selectup", - description: "Select up", - bindKey: bindKey("Shift-Up", "Shift-Up|Ctrl-Shift-P"), - exec: function(editor) { editor.getSelection().selectUp(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "golineup", - description: "Go line up", - bindKey: bindKey("Up", "Up|Ctrl-P"), - exec: function(editor, args) { editor.navigateUp(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selecttoend", - description: "Select to end", - bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"), - exec: function(editor) { editor.getSelection().selectFileEnd(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "gotoend", - description: "Go to end", - bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"), - exec: function(editor) { editor.navigateFileEnd(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "selectdown", - description: "Select down", - bindKey: bindKey("Shift-Down", "Shift-Down|Ctrl-Shift-N"), - exec: function(editor) { editor.getSelection().selectDown(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "golinedown", - description: "Go line down", - bindKey: bindKey("Down", "Down|Ctrl-N"), - exec: function(editor, args) { editor.navigateDown(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectwordleft", - description: "Select word left", - bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"), - exec: function(editor) { editor.getSelection().selectWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotowordleft", - description: "Go to word left", - bindKey: bindKey("Ctrl-Left", "Option-Left"), - exec: function(editor) { editor.navigateWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selecttolinestart", - description: "Select to line start", - bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"), - exec: function(editor) { editor.getSelection().selectLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotolinestart", - description: "Go to line start", - bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), - exec: function(editor) { editor.navigateLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectleft", - description: "Select left", - bindKey: bindKey("Shift-Left", "Shift-Left|Ctrl-Shift-B"), - exec: function(editor) { editor.getSelection().selectLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotoleft", - description: "Go to left", - bindKey: bindKey("Left", "Left|Ctrl-B"), - exec: function(editor, args) { editor.navigateLeft(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectwordright", - description: "Select word right", - bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"), - exec: function(editor) { editor.getSelection().selectWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotowordright", - description: "Go to word right", - bindKey: bindKey("Ctrl-Right", "Option-Right"), - exec: function(editor) { editor.navigateWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selecttolineend", - description: "Select to line end", - bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"), - exec: function(editor) { editor.getSelection().selectLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotolineend", - description: "Go to line end", - bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"), - exec: function(editor) { editor.navigateLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectright", - description: "Select right", - bindKey: bindKey("Shift-Right", "Shift-Right"), - exec: function(editor) { editor.getSelection().selectRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotoright", - description: "Go to right", - bindKey: bindKey("Right", "Right|Ctrl-F"), - exec: function(editor, args) { editor.navigateRight(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectpagedown", - description: "Select page down", - bindKey: "Shift-PageDown", - exec: function(editor) { editor.selectPageDown(); }, - readOnly: true -}, { - name: "pagedown", - description: "Page down", - bindKey: bindKey(null, "Option-PageDown"), - exec: function(editor) { editor.scrollPageDown(); }, - readOnly: true -}, { - name: "gotopagedown", - description: "Go to page down", - bindKey: bindKey("PageDown", "PageDown|Ctrl-V"), - exec: function(editor) { editor.gotoPageDown(); }, - readOnly: true -}, { - name: "selectpageup", - description: "Select page up", - bindKey: "Shift-PageUp", - exec: function(editor) { editor.selectPageUp(); }, - readOnly: true -}, { - name: "pageup", - description: "Page up", - bindKey: bindKey(null, "Option-PageUp"), - exec: function(editor) { editor.scrollPageUp(); }, - readOnly: true -}, { - name: "gotopageup", - description: "Go to page up", - bindKey: "PageUp", - exec: function(editor) { editor.gotoPageUp(); }, - readOnly: true -}, { - name: "scrollup", - description: "Scroll up", - bindKey: bindKey("Ctrl-Up", null), - exec: function(e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); }, - readOnly: true -}, { - name: "scrolldown", - description: "Scroll down", - bindKey: bindKey("Ctrl-Down", null), - exec: function(e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); }, - readOnly: true -}, { - name: "selectlinestart", - description: "Select line start", - bindKey: "Shift-Home", - exec: function(editor) { editor.getSelection().selectLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectlineend", - description: "Select line end", - bindKey: "Shift-End", - exec: function(editor) { editor.getSelection().selectLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "togglerecording", - description: "Toggle recording", - bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"), - exec: function(editor) { editor.commands.toggleRecording(editor); }, - readOnly: true -}, { - name: "replaymacro", - description: "Replay macro", - bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"), - exec: function(editor) { editor.commands.replay(editor); }, - readOnly: true -}, { - name: "jumptomatching", - description: "Jump to matching", - bindKey: bindKey("Ctrl-\\|Ctrl-P", "Command-\\"), - exec: function(editor) { editor.jumpToMatching(); }, - multiSelectAction: "forEach", - scrollIntoView: "animate", - readOnly: true -}, { - name: "selecttomatching", - description: "Select to matching", - bindKey: bindKey("Ctrl-Shift-\\|Ctrl-Shift-P", "Command-Shift-\\"), - exec: function(editor) { editor.jumpToMatching(true); }, - multiSelectAction: "forEach", - scrollIntoView: "animate", - readOnly: true -}, { - name: "expandToMatching", - description: "Expand to matching", - bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"), - exec: function(editor) { editor.jumpToMatching(true, true); }, - multiSelectAction: "forEach", - scrollIntoView: "animate", - readOnly: true -}, { - name: "passKeysToBrowser", - description: "Pass keys to browser", - bindKey: bindKey(null, null), - exec: function() {}, - passEvent: true, - readOnly: true -}, { - name: "copy", - description: "Copy", - exec: function(editor) { - }, - readOnly: true -}, -{ - name: "cut", - description: "Cut", - exec: function(editor) { - var cutLine = editor.$copyWithEmptySelection && editor.selection.isEmpty(); - var range = cutLine ? editor.selection.getLineRange() : editor.selection.getRange(); - editor._emit("cut", range); - - if (!range.isEmpty()) - editor.session.remove(range); - editor.clearSelection(); - }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "paste", - description: "Paste", - exec: function(editor, args) { - editor.$handlePaste(args); - }, - scrollIntoView: "cursor" -}, { - name: "removeline", - description: "Remove line", - bindKey: bindKey("Ctrl-D", "Command-D"), - exec: function(editor) { editor.removeLines(); }, - scrollIntoView: "cursor", - multiSelectAction: "forEachLine" -}, { - name: "duplicateSelection", - description: "Duplicate selection", - bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"), - exec: function(editor) { editor.duplicateSelection(); }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "sortlines", - description: "Sort lines", - bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"), - exec: function(editor) { editor.sortLines(); }, - scrollIntoView: "selection", - multiSelectAction: "forEachLine" -}, { - name: "togglecomment", - description: "Toggle comment", - bindKey: bindKey("Ctrl-/", "Command-/"), - exec: function(editor) { editor.toggleCommentLines(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "toggleBlockComment", - description: "Toggle block comment", - bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"), - exec: function(editor) { editor.toggleBlockComment(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "modifyNumberUp", - description: "Modify number up", - bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"), - exec: function(editor) { editor.modifyNumber(1); }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "modifyNumberDown", - description: "Modify number down", - bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"), - exec: function(editor) { editor.modifyNumber(-1); }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "replace", - description: "Replace", - bindKey: bindKey("Ctrl-H", "Command-Option-F"), - exec: function(editor) { - config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor, true);}); - } -}, { - name: "undo", - description: "Undo", - bindKey: bindKey("Ctrl-Z", "Command-Z"), - exec: function(editor) { editor.undo(); } -}, { - name: "redo", - description: "Redo", - bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"), - exec: function(editor) { editor.redo(); } -}, { - name: "copylinesup", - description: "Copy lines up", - bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"), - exec: function(editor) { editor.copyLinesUp(); }, - scrollIntoView: "cursor" -}, { - name: "movelinesup", - description: "Move lines up", - bindKey: bindKey("Alt-Up", "Option-Up"), - exec: function(editor) { editor.moveLinesUp(); }, - scrollIntoView: "cursor" -}, { - name: "copylinesdown", - description: "Copy lines down", - bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"), - exec: function(editor) { editor.copyLinesDown(); }, - scrollIntoView: "cursor" -}, { - name: "movelinesdown", - description: "Move lines down", - bindKey: bindKey("Alt-Down", "Option-Down"), - exec: function(editor) { editor.moveLinesDown(); }, - scrollIntoView: "cursor" -}, { - name: "del", - description: "Delete", - bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"), - exec: function(editor) { editor.remove("right"); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "backspace", - description: "Backspace", - bindKey: bindKey( - "Shift-Backspace|Backspace", - "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H" - ), - exec: function(editor) { editor.remove("left"); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "cut_or_delete", - description: "Cut or delete", - bindKey: bindKey("Shift-Delete", null), - exec: function(editor) { - if (editor.selection.isEmpty()) { - editor.remove("left"); - } else { - return false; - } - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removetolinestart", - description: "Remove to line start", - bindKey: bindKey("Alt-Backspace", "Command-Backspace"), - exec: function(editor) { editor.removeToLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removetolineend", - description: "Remove to line end", - bindKey: bindKey("Alt-Delete", "Ctrl-K|Command-Delete"), - exec: function(editor) { editor.removeToLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removetolinestarthard", - description: "Remove to line start hard", - bindKey: bindKey("Ctrl-Shift-Backspace", null), - exec: function(editor) { - var range = editor.selection.getRange(); - range.start.column = 0; - editor.session.remove(range); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removetolineendhard", - description: "Remove to line end hard", - bindKey: bindKey("Ctrl-Shift-Delete", null), - exec: function(editor) { - var range = editor.selection.getRange(); - range.end.column = Number.MAX_VALUE; - editor.session.remove(range); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removewordleft", - description: "Remove word left", - bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"), - exec: function(editor) { editor.removeWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removewordright", - description: "Remove word right", - bindKey: bindKey("Ctrl-Delete", "Alt-Delete"), - exec: function(editor) { editor.removeWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "outdent", - description: "Outdent", - bindKey: bindKey("Shift-Tab", "Shift-Tab"), - exec: function(editor) { editor.blockOutdent(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "indent", - description: "Indent", - bindKey: bindKey("Tab", "Tab"), - exec: function(editor) { editor.indent(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "blockoutdent", - description: "Block outdent", - bindKey: bindKey("Ctrl-[", "Ctrl-["), - exec: function(editor) { editor.blockOutdent(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "blockindent", - description: "Block indent", - bindKey: bindKey("Ctrl-]", "Ctrl-]"), - exec: function(editor) { editor.blockIndent(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "insertstring", - description: "Insert string", - exec: function(editor, str) { editor.insert(str); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "inserttext", - description: "Insert text", - exec: function(editor, args) { - editor.insert(lang.stringRepeat(args.text || "", args.times || 1)); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "splitline", - description: "Split line", - bindKey: bindKey(null, "Ctrl-O"), - exec: function(editor) { editor.splitLine(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "transposeletters", - description: "Transpose letters", - bindKey: bindKey("Alt-Shift-X", "Ctrl-T"), - exec: function(editor) { editor.transposeLetters(); }, - multiSelectAction: function(editor) {editor.transposeSelections(1); }, - scrollIntoView: "cursor" -}, { - name: "touppercase", - description: "To uppercase", - bindKey: bindKey("Ctrl-U", "Ctrl-U"), - exec: function(editor) { editor.toUpperCase(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "tolowercase", - description: "To lowercase", - bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"), - exec: function(editor) { editor.toLowerCase(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "autoindent", - description: "Auto Indent", - bindKey: bindKey(null, null), - exec: function(editor) { editor.autoIndent(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "animate" -}, { - name: "expandtoline", - description: "Expand to line", - bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"), - exec: function(editor) { - var range = editor.selection.getRange(); - - range.start.column = range.end.column = 0; - range.end.row++; - editor.selection.setRange(range, false); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "joinlines", - description: "Join lines", - bindKey: bindKey(null, null), - exec: function(editor) { - var isBackwards = editor.selection.isBackwards(); - var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor(); - var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead(); - var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length; - var selectedText = editor.session.doc.getTextRange(editor.selection.getRange()); - var selectedCount = selectedText.replace(/\n\s*/, " ").length; - var insertLine = editor.session.doc.getLine(selectionStart.row); - - for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) { - var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i))); - if (curLine.length !== 0) { - curLine = " " + curLine; + GutterKeyboardHandler.prototype.$moveAnnotationDown = function () { + var index = this.activeRowIndex; + while (index < this.lines.getLength() - 1) { + index++; + if (this.$isAnnotationVisible(index)) { + this.$blurAnnotation(this.activeRowIndex); + this.activeRowIndex = index; + this.$focusAnnotation(this.activeRowIndex); + return; } - insertLine += curLine; - } - - if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) { - insertLine += editor.session.doc.getNewLineCharacter(); - } - - editor.clearSelection(); - editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine); - - if (selectedCount > 0) { - editor.selection.moveCursorTo(selectionStart.row, selectionStart.column); - editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount); - } else { - firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol; - editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol); - } - }, - multiSelectAction: "forEach", - readOnly: true -}, { - name: "invertSelection", - description: "Invert selection", - bindKey: bindKey(null, null), - exec: function(editor) { - var endRow = editor.session.doc.getLength() - 1; - var endCol = editor.session.doc.getLine(endRow).length; - var ranges = editor.selection.rangeList.ranges; - var newRanges = []; - if (ranges.length < 1) { - ranges = [editor.selection.getRange()]; } - - for (var i = 0; i < ranges.length; i++) { - if (i == (ranges.length - 1)) { - if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) { - newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol)); + return; + }; + GutterKeyboardHandler.prototype.$switchLane = function (desinationLane) { + switch (desinationLane) { + case "annotation": + if (this.activeLane === "annotation") { + break; } - } - - if (i === 0) { - if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) { - newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column)); + var annotationIndex = this.$findNearestAnnotation(this.activeRowIndex); + if (annotationIndex == null) { + break; } - } else { - newRanges.push(new Range(ranges[i-1].end.row, ranges[i-1].end.column, ranges[i].start.row, ranges[i].start.column)); - } + this.activeLane = "annotation"; + this.$blurFoldWidget(this.activeRowIndex); + this.activeRowIndex = annotationIndex; + this.$focusAnnotation(this.activeRowIndex); + break; + case "fold": + if (this.activeLane === "fold") { + break; + } + var foldWidgetIndex = this.$findNearestFoldWidget(this.activeRowIndex); + if (foldWidgetIndex == null) { + break; + } + this.activeLane = "fold"; + this.$blurAnnotation(this.activeRowIndex); + this.activeRowIndex = foldWidgetIndex; + this.$focusFoldWidget(this.activeRowIndex); + break; } - - editor.exitMultiSelectMode(); - editor.clearSelection(); - - for(var i = 0; i < newRanges.length; i++) { - editor.selection.addRange(newRanges[i], false); + return; + }; + GutterKeyboardHandler.prototype.$rowIndexToRow = function (index) { + var cell = this.lines.get(index); + if (cell) + return cell.row; + return null; + }; + GutterKeyboardHandler.prototype.$rowToRowIndex = function (row) { + for (var i = 0; i < this.lines.getLength(); i++) { + var cell = this.lines.get(i); + if (cell.row == row) + return i; } - }, - readOnly: true, - scrollIntoView: "none" -}, { - name: "addLineAfter", - exec: function(editor) { - editor.selection.clearSelection(); - editor.navigateLineEnd(); - editor.insert("\n"); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "addLineBefore", - exec: function(editor) { - editor.selection.clearSelection(); - var cursor = editor.getCursorPosition(); - editor.selection.moveTo(cursor.row - 1, Number.MAX_VALUE); - editor.insert("\n"); - if (cursor.row === 0) editor.navigateUp(); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "openCommandPallete", - description: "Open command pallete", - bindKey: bindKey("F1", "F1"), - exec: function(editor) { - editor.prompt({ $type: "commands" }); - }, - readOnly: true -}, { - name: "modeSelect", - description: "Change language mode...", - bindKey: bindKey(null, null), - exec: function(editor) { - editor.prompt({ $type: "modes" }); - }, - readOnly: true -}]; - -for (var i = 1; i < 9; i++) { - exports.commands.push({ - name: "foldToLevel" + i, - description: "Fold To Level " + i, - level: i, - exec: function(editor) { editor.session.foldToLevel(this.level); }, - scrollIntoView: "center", - readOnly: true - }); -} + return null; + }; + return GutterKeyboardHandler; +}()); +exports.GutterKeyboardHandler = GutterKeyboardHandler; +var GutterKeyboardEvent = /** @class */ (function () { + function GutterKeyboardEvent(domEvent, gutterKeyboardHandler) { + this.gutterKeyboardHandler = gutterKeyboardHandler; + this.domEvent = domEvent; + } + GutterKeyboardEvent.prototype.getKey = function () { + return keys.keyCodeToString(this.domEvent.keyCode); + }; + GutterKeyboardEvent.prototype.getRow = function () { + return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex); + }; + GutterKeyboardEvent.prototype.isInAnnotationLane = function () { + return this.gutterKeyboardHandler.activeLane === "annotation"; + }; + GutterKeyboardEvent.prototype.isInFoldLane = function () { + return this.gutterKeyboardHandler.activeLane === "fold"; + }; + return GutterKeyboardEvent; +}()); +exports.GutterKeyboardEvent = GutterKeyboardEvent; }); -ace.define("ace/editor",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/clipboard"], function(require, exports, module) { -"use strict"; - -require("./lib/fixoldbrowsers"); - +ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"], function(require, exports, module){"use strict"; +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; var oop = require("./lib/oop"); var dom = require("./lib/dom"); var lang = require("./lib/lang"); @@ -31223,109 +31641,73 @@ var CommandManager = require("./commands/command_manager").CommandManager; var defaultCommands = require("./commands/default_commands").commands; var config = require("./config"); var TokenIterator = require("./token_iterator").TokenIterator; - +var LineWidgets = require("./line_widgets").LineWidgets; +var GutterKeyboardHandler = require("./keyboard/gutter_handler").GutterKeyboardHandler; +var nls = require("./config").nls; var clipboard = require("./clipboard"); -var Editor = function(renderer, session, options) { - this.$toDestroy = []; - var container = renderer.getContainerElement(); - this.container = container; - this.renderer = renderer; - this.id = "editor" + (++Editor.$uid); - - this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); - if (typeof document == "object") { - this.textInput = new TextInput(renderer.getTextAreaContainer(), this); - this.renderer.textarea = this.textInput.getElement(); - this.$mouseHandler = new MouseHandler(this); - new FoldHandler(this); +var keys = require('./lib/keys'); +var Editor = /** @class */ (function () { + function Editor(renderer, session, options) { this.session; + this.$toDestroy = []; + var container = renderer.getContainerElement(); + this.container = container; + this.renderer = renderer; + this.id = "editor" + (++Editor.$uid); + this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); + if (typeof document == "object") { + this.textInput = new TextInput(renderer.getTextAreaContainer(), this); + this.renderer.textarea = this.textInput.getElement(); + this.$mouseHandler = new MouseHandler(this); + new FoldHandler(this); + } + this.keyBinding = new KeyBinding(this); + this.$search = new Search().set({ + wrap: true + }); + this.$historyTracker = this.$historyTracker.bind(this); + this.commands.on("exec", this.$historyTracker); + this.$initOperationListeners(); + this._$emitInputEvent = lang.delayedCall(function () { + this._signal("input", {}); + if (this.session && !this.session.destroyed) + this.session.bgTokenizer.scheduleStart(); + }.bind(this)); + this.on("change", function (_, _self) { + _self._$emitInputEvent.schedule(31); + }); + this.setSession(session || options && options.session || new EditSession("")); + config.resetOptions(this); + if (options) + this.setOptions(options); + config._signal("editor", this); } - - this.keyBinding = new KeyBinding(this); - - this.$search = new Search().set({ - wrap: true - }); - - this.$historyTracker = this.$historyTracker.bind(this); - this.commands.on("exec", this.$historyTracker); - - this.$initOperationListeners(); - - this._$emitInputEvent = lang.delayedCall(function() { - this._signal("input", {}); - if (this.session && this.session.bgTokenizer) - this.session.bgTokenizer.scheduleStart(); - }.bind(this)); - - this.on("change", function(_, _self) { - _self._$emitInputEvent.schedule(31); - }); - - this.setSession(session || options && options.session || new EditSession("")); - config.resetOptions(this); - if (options) - this.setOptions(options); - config._signal("editor", this); -}; - -Editor.$uid = 0; - -(function(){ - - oop.implement(this, EventEmitter); - - this.$initOperationListeners = function() { + Editor.prototype.$initOperationListeners = function () { this.commands.on("exec", this.startOperation.bind(this), true); this.commands.on("afterExec", this.endOperation.bind(this), true); - - this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this, true)); - this.on("change", function() { - if (!this.curOp) { - this.startOperation(); - this.curOp.selectionBefore = this.$lastSel; - } - this.curOp.docChanged = true; - }.bind(this), true); - - this.on("changeSelection", function() { - if (!this.curOp) { - this.startOperation(); - this.curOp.selectionBefore = this.$lastSel; - } - this.curOp.selectionChanged = true; - }.bind(this), true); }; - - this.curOp = null; - this.prevOp = {}; - this.startOperation = function(commandEvent) { - if (this.curOp) { - if (!commandEvent || this.curOp.command) - return; - this.prevOp = this.curOp; - } + Editor.prototype.startOperation = function (commandEvent) { + this.session.startOperation(commandEvent); + }; + Editor.prototype.endOperation = function (e) { + this.session.endOperation(e); + }; + Editor.prototype.onStartOperation = function (commandEvent) { + this.curOp = this.session.curOp; + this.curOp.scrollTop = this.renderer.scrollTop; + this.prevOp = this.session.prevOp; if (!commandEvent) { this.previousCommand = null; - commandEvent = {}; } - - this.$opResetTimer.schedule(); - this.curOp = this.session.curOp = { - command: commandEvent.command || {}, - args: commandEvent.args, - scrollTop: this.renderer.scrollTop - }; - this.curOp.selectionBefore = this.selection.toJSON(); }; - - this.endOperation = function(e) { + Editor.prototype.onEndOperation = function (e) { if (this.curOp && this.session) { - if (e && e.returnValue === false || !this.session) - return (this.curOp = null); - if (e == true && this.curOp.command && this.curOp.command.name == "mouse") + if (e && e.returnValue === false) { + this.curOp = null; return; + } this._signal("beforeEndOperation"); - if (!this.curOp) return; + if (!this.curOp) + return; var command = this.curOp.command; var scrollIntoView = command && command.scrollIntoView; if (scrollIntoView) { @@ -31352,19 +31734,14 @@ Editor.$uid = 0; if (scrollIntoView == "animate") this.renderer.animateScrolling(this.curOp.scrollTop); } - var sel = this.selection.toJSON(); - this.curOp.selectionAfter = sel; - this.$lastSel = this.selection.toJSON(); - this.session.getUndoManager().addSelection(sel); + this.$lastSel = this.session.selection.toJSON(); this.prevOp = this.curOp; this.curOp = null; } }; - this.$mergeableCommands = ["backspace", "del", "insertstring"]; - this.$historyTracker = function(e) { + Editor.prototype.$historyTracker = function (e) { if (!this.$mergeUndoDeltas) return; - var prev = this.prevOp; var mergeableCommands = this.$mergeableCommands; var shouldMerge = prev.command && (e.command.name == prev.command.name); @@ -31372,53 +31749,49 @@ Editor.$uid = 0; var text = e.args; if (this.mergeNextCommand === undefined) this.mergeNextCommand = true; - shouldMerge = shouldMerge && this.mergeNextCommand // previous command allows to coalesce with && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same type - this.mergeNextCommand = true; - } else { + } + else { shouldMerge = shouldMerge && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable } - - if ( - this.$mergeUndoDeltas != "always" - && Date.now() - this.sequenceStartTime > 2000 - ) { + if (this.$mergeUndoDeltas != "always" + && Date.now() - this.sequenceStartTime > 2000) { shouldMerge = false; // the sequence is too long } - if (shouldMerge) this.session.mergeUndoDeltas = true; else if (mergeableCommands.indexOf(e.command.name) !== -1) this.sequenceStartTime = Date.now(); }; - this.setKeyboardHandler = function(keyboardHandler, cb) { + Editor.prototype.setKeyboardHandler = function (keyboardHandler, cb) { if (keyboardHandler && typeof keyboardHandler === "string" && keyboardHandler != "ace") { this.$keybindingId = keyboardHandler; var _self = this; - config.loadModule(["keybinding", keyboardHandler], function(module) { + config.loadModule(["keybinding", keyboardHandler], function (module) { if (_self.$keybindingId == keyboardHandler) _self.keyBinding.setKeyboardHandler(module && module.handler); cb && cb(); }); - } else { + } + else { this.$keybindingId = null; this.keyBinding.setKeyboardHandler(keyboardHandler); cb && cb(); } }; - this.getKeyboardHandler = function() { + Editor.prototype.getKeyboardHandler = function () { return this.keyBinding.getKeyboardHandler(); }; - this.setSession = function(session) { + Editor.prototype.setSession = function (session) { if (this.session == session) return; - if (this.curOp) this.endOperation(); + if (this.curOp) + this.endOperation(); this.curOp = {}; - var oldSession = this.session; if (oldSession) { this.session.off("change", this.$onDocumentChange); @@ -31435,67 +31808,53 @@ Editor.$uid = 0; this.session.off("changeOverwrite", this.$onCursorChange); this.session.off("changeScrollTop", this.$onScrollTopChange); this.session.off("changeScrollLeft", this.$onScrollLeftChange); - + this.session.off("startOperation", this.$onStartOperation); + this.session.off("endOperation", this.$onEndOperation); var selection = this.session.getSelection(); selection.off("changeCursor", this.$onCursorChange); selection.off("changeSelection", this.$onSelectionChange); } - this.session = session; if (session) { this.$onDocumentChange = this.onDocumentChange.bind(this); session.on("change", this.$onDocumentChange); this.renderer.setSession(session); - this.$onChangeMode = this.onChangeMode.bind(this); session.on("changeMode", this.$onChangeMode); - this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this); session.on("tokenizerUpdate", this.$onTokenizerUpdate); - this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer); session.on("changeTabSize", this.$onChangeTabSize); - this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this); session.on("changeWrapLimit", this.$onChangeWrapLimit); - this.$onChangeWrapMode = this.onChangeWrapMode.bind(this); session.on("changeWrapMode", this.$onChangeWrapMode); - this.$onChangeFold = this.onChangeFold.bind(this); session.on("changeFold", this.$onChangeFold); - this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this); this.session.on("changeFrontMarker", this.$onChangeFrontMarker); - this.$onChangeBackMarker = this.onChangeBackMarker.bind(this); this.session.on("changeBackMarker", this.$onChangeBackMarker); - this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this); this.session.on("changeBreakpoint", this.$onChangeBreakpoint); - this.$onChangeAnnotation = this.onChangeAnnotation.bind(this); this.session.on("changeAnnotation", this.$onChangeAnnotation); - this.$onCursorChange = this.onCursorChange.bind(this); this.session.on("changeOverwrite", this.$onCursorChange); - this.$onScrollTopChange = this.onScrollTopChange.bind(this); this.session.on("changeScrollTop", this.$onScrollTopChange); - this.$onScrollLeftChange = this.onScrollLeftChange.bind(this); this.session.on("changeScrollLeft", this.$onScrollLeftChange); - this.selection = session.getSelection(); this.selection.on("changeCursor", this.$onCursorChange); - this.$onSelectionChange = this.onSelectionChange.bind(this); this.selection.on("changeSelection", this.$onSelectionChange); - + this.$onStartOperation = this.onStartOperation.bind(this); + this.session.on("startOperation", this.$onStartOperation); + this.$onEndOperation = this.onEndOperation.bind(this); + this.session.on("endOperation", this.$onEndOperation); this.onChangeMode(); - this.onCursorChange(); - this.onScrollTopChange(); this.onScrollLeftChange(); this.onSelectionChange(); @@ -31505,69 +31864,63 @@ Editor.$uid = 0; this.onChangeAnnotation(); this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(); this.renderer.updateFull(); - } else { + } + else { this.selection = null; this.renderer.setSession(session); } - this._signal("changeSession", { session: session, oldSession: oldSession }); - this.curOp = null; - - oldSession && oldSession._signal("changeEditor", {oldEditor: this}); - session && session._signal("changeEditor", {editor: this}); - - if (session && session.bgTokenizer) + oldSession && oldSession._signal("changeEditor", { oldEditor: this }); + session && session._signal("changeEditor", { editor: this }); + if (session && !session.destroyed) session.bgTokenizer.scheduleStart(); }; - this.getSession = function() { + Editor.prototype.getSession = function () { return this.session; }; - this.setValue = function(val, cursorPos) { + Editor.prototype.setValue = function (val, cursorPos) { this.session.doc.setValue(val); - if (!cursorPos) this.selectAll(); else if (cursorPos == 1) this.navigateFileEnd(); else if (cursorPos == -1) this.navigateFileStart(); - return val; }; - this.getValue = function() { + Editor.prototype.getValue = function () { return this.session.getValue(); }; - this.getSelection = function() { + Editor.prototype.getSelection = function () { return this.selection; }; - this.resize = function(force) { + Editor.prototype.resize = function (force) { this.renderer.onResize(force); }; - this.setTheme = function(theme, cb) { + Editor.prototype.setTheme = function (theme, cb) { this.renderer.setTheme(theme, cb); }; - this.getTheme = function() { + Editor.prototype.getTheme = function () { return this.renderer.getTheme(); }; - this.setStyle = function(style) { + Editor.prototype.setStyle = function (style) { this.renderer.setStyle(style); }; - this.unsetStyle = function(style) { + Editor.prototype.unsetStyle = function (style) { this.renderer.unsetStyle(style); }; - this.getFontSize = function () { + Editor.prototype.getFontSize = function () { return this.getOption("fontSize") || - dom.computedStyle(this.container).fontSize; + dom.computedStyle(this.container).fontSize; }; - this.setFontSize = function(size) { + Editor.prototype.setFontSize = function (size) { this.setOption("fontSize", size); }; - - this.$highlightBrackets = function() { + Editor.prototype.$highlightBrackets = function () { if (this.$highlightPending) { return; } @@ -31576,23 +31929,43 @@ Editor.$uid = 0; setTimeout(function () { self.$highlightPending = false; var session = self.session; - if (!session || !session.bgTokenizer) return; + if (!session || session.destroyed) + return; if (session.$bracketHighlight) { - session.$bracketHighlight.markerIds.forEach(function(id) { + session.$bracketHighlight.markerIds.forEach(function (id) { session.removeMarker(id); }); session.$bracketHighlight = null; } - var ranges = session.getMatchingBracketRanges(self.getCursorPosition()); + var pos = self.getCursorPosition(); + var handler = self.getKeyboardHandler(); + var isBackwards = handler && handler.$getDirectionForHighlight && handler.$getDirectionForHighlight(self); + var ranges = session.getMatchingBracketRanges(pos, isBackwards); + if (!ranges) { + var iterator = new TokenIterator(session, pos.row, pos.column); + var token = iterator.getCurrentToken(); + if (token && /\b(?:tag-open|tag-name)/.test(token.type)) { + var tagNamesRanges = session.getMatchingTags(pos); + if (tagNamesRanges) { + ranges = [ + tagNamesRanges.openTagName.isEmpty() ? tagNamesRanges.openTag : tagNamesRanges.openTagName, + tagNamesRanges.closeTagName.isEmpty() ? tagNamesRanges.closeTag : tagNamesRanges.closeTagName + ]; + } + } + } if (!ranges && session.$mode.getMatching) ranges = session.$mode.getMatching(self.session); - if (!ranges) + if (!ranges) { + if (self.getHighlightIndentGuides()) + self.renderer.$textLayer.$highlightIndentGuide(); return; - + } var markerType = "ace_bracket"; if (!Array.isArray(ranges)) { ranges = [ranges]; - } else if (ranges.length == 1) { + } + else if (ranges.length == 1) { markerType = "ace_error_bracket"; } if (ranges.length == 2) { @@ -31601,138 +31974,26 @@ Editor.$uid = 0; else if (Range.comparePoints(ranges[0].start, ranges[1].end) == 0) ranges = [Range.fromPoints(ranges[1].start, ranges[0].end)]; } - session.$bracketHighlight = { ranges: ranges, - markerIds: ranges.map(function(range) { + markerIds: ranges.map(function (range) { return session.addMarker(range, markerType, "text"); }) }; + if (self.getHighlightIndentGuides()) + self.renderer.$textLayer.$highlightIndentGuide(); }, 50); }; - this.$highlightTags = function() { - if (this.$highlightTagPending) - return; - var self = this; - this.$highlightTagPending = true; - setTimeout(function() { - self.$highlightTagPending = false; - - var session = self.session; - if (!session || !session.bgTokenizer) return; - - var pos = self.getCursorPosition(); - var iterator = new TokenIterator(self.session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - - if (!token || !/\b(?:tag-open|tag-name)/.test(token.type)) { - session.removeMarker(session.$tagHighlight); - session.$tagHighlight = null; - return; - } - - if (token.type.indexOf("tag-open") !== -1) { - token = iterator.stepForward(); - if (!token) - return; - } - - var tag = token.value; - var currentTag = token.value; - var depth = 0; - var prevToken = iterator.stepBackward(); - - if (prevToken.value === '<'){ - do { - prevToken = token; - token = iterator.stepForward(); - - if (token) { - if (token.type.indexOf('tag-name') !== -1) { - currentTag = token.value; - if (tag === currentTag) { - if (prevToken.value === '<') { - depth++; - } else if (prevToken.value === '') { // self closing tag - depth--; - } - } - - } while (token && depth >= 0); - } else { - do { - token = prevToken; - prevToken = iterator.stepBackward(); - - if (token) { - if (token.type.indexOf('tag-name') !== -1) { - if (tag === token.value) { - if (prevToken.value === '<') { - depth++; - } else if (prevToken.value === '') { // self closing tag - var stepCount = 0; - var tmpToken = prevToken; - while (tmpToken) { - if (tmpToken.type.indexOf('tag-name') !== -1 && tmpToken.value === tag) { - depth--; - break; - } else if (tmpToken.value === '<') { - break; - } - tmpToken = iterator.stepBackward(); - stepCount++; - } - for (var i = 0; i < stepCount; i++) { - iterator.stepForward(); - } - } - } - } while (prevToken && depth <= 0); - iterator.stepForward(); - } - - if (!token) { - session.removeMarker(session.$tagHighlight); - session.$tagHighlight = null; - return; - } - - var row = iterator.getCurrentTokenRow(); - var column = iterator.getCurrentTokenColumn(); - var range = new Range(row, column, row, column+token.value.length); - var sbm = session.$backMarkers[session.$tagHighlight]; - if (session.$tagHighlight && sbm != undefined && range.compareRange(sbm.range) !== 0) { - session.removeMarker(session.$tagHighlight); - session.$tagHighlight = null; - } - - if (!session.$tagHighlight) - session.$tagHighlight = session.addMarker(range, "ace_bracket", "text"); - }, 50); - }; - this.focus = function() { - var _self = this; - setTimeout(function() { - if (!_self.isFocused()) - _self.textInput.focus(); - }); + Editor.prototype.focus = function () { this.textInput.focus(); }; - this.isFocused = function() { + Editor.prototype.isFocused = function () { return this.textInput.isFocused(); }; - this.blur = function() { + Editor.prototype.blur = function () { this.textInput.blur(); }; - this.onFocus = function(e) { + Editor.prototype.onFocus = function (e) { if (this.$isFocused) return; this.$isFocused = true; @@ -31740,7 +32001,7 @@ Editor.$uid = 0; this.renderer.visualizeFocus(); this._emit("focus", e); }; - this.onBlur = function(e) { + Editor.prototype.onBlur = function (e) { if (!this.$isFocused) return; this.$isFocused = false; @@ -31748,43 +32009,34 @@ Editor.$uid = 0; this.renderer.visualizeBlur(); this._emit("blur", e); }; - - this.$cursorChange = function() { + Editor.prototype.$cursorChange = function () { this.renderer.updateCursor(); this.$highlightBrackets(); - this.$highlightTags(); this.$updateHighlightActiveLine(); }; - this.onDocumentChange = function(delta) { + Editor.prototype.onDocumentChange = function (delta) { var wrap = this.session.$useWrapMode; var lastRow = (delta.start.row == delta.end.row ? delta.end.row : Infinity); this.renderer.updateLines(delta.start.row, lastRow, wrap); - this._signal("change", delta); this.$cursorChange(); }; - - this.onTokenizerUpdate = function(e) { + Editor.prototype.onTokenizerUpdate = function (e) { var rows = e.data; this.renderer.updateLines(rows.first, rows.last); }; - - - this.onScrollTopChange = function() { + Editor.prototype.onScrollTopChange = function () { this.renderer.scrollToY(this.session.getScrollTop()); }; - - this.onScrollLeftChange = function() { + Editor.prototype.onScrollLeftChange = function () { this.renderer.scrollToX(this.session.getScrollLeft()); }; - this.onCursorChange = function() { + Editor.prototype.onCursorChange = function () { this.$cursorChange(); this._signal("changeSelection"); }; - - this.$updateHighlightActiveLine = function() { + Editor.prototype.$updateHighlightActiveLine = function () { var session = this.getSession(); - var highlight; if (this.$highlightActiveLine) { if (this.$selectionStyle != "line" || !this.selection.isMultiLine()) @@ -31794,117 +32046,94 @@ Editor.$uid = 0; if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1)) highlight = false; } - if (session.$highlightLineMarker && !highlight) { session.removeMarker(session.$highlightLineMarker.id); session.$highlightLineMarker = null; - } else if (!session.$highlightLineMarker && highlight) { + } + else if (!session.$highlightLineMarker && highlight) { var range = new Range(highlight.row, highlight.column, highlight.row, Infinity); range.id = session.addMarker(range, "ace_active-line", "screenLine"); session.$highlightLineMarker = range; - } else if (highlight) { + } + else if (highlight) { session.$highlightLineMarker.start.row = highlight.row; session.$highlightLineMarker.end.row = highlight.row; session.$highlightLineMarker.start.column = highlight.column; session._signal("changeBackMarker"); } }; - - this.onSelectionChange = function(e) { + Editor.prototype.onSelectionChange = function (e) { var session = this.session; - if (session.$selectionMarker) { session.removeMarker(session.$selectionMarker); } session.$selectionMarker = null; - if (!this.selection.isEmpty()) { var range = this.selection.getRange(); var style = this.getSelectionStyle(); session.$selectionMarker = session.addMarker(range, "ace_selection", style); - } else { + } + else { this.$updateHighlightActiveLine(); } - var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp(); this.session.highlight(re); - this._signal("changeSelection"); }; - - this.$getSelectionHighLightRegexp = function() { + Editor.prototype.$getSelectionHighLightRegexp = function () { var session = this.session; - var selection = this.getSelectionRange(); if (selection.isEmpty() || selection.isMultiLine()) return; - var startColumn = selection.start.column; var endColumn = selection.end.column; var line = session.getLine(selection.start.row); - var needle = line.substring(startColumn, endColumn); if (needle.length > 5000 || !/[\w\d]/.test(needle)) return; - var re = this.$search.$assembleRegExp({ wholeWord: true, caseSensitive: true, needle: needle }); - var wordWithBoundary = line.substring(startColumn - 1, endColumn + 1); if (!re.test(wordWithBoundary)) return; - return re; }; - - - this.onChangeFrontMarker = function() { + Editor.prototype.onChangeFrontMarker = function () { this.renderer.updateFrontMarkers(); }; - - this.onChangeBackMarker = function() { + Editor.prototype.onChangeBackMarker = function () { this.renderer.updateBackMarkers(); }; - - - this.onChangeBreakpoint = function() { + Editor.prototype.onChangeBreakpoint = function () { this.renderer.updateBreakpoints(); }; - - this.onChangeAnnotation = function() { + Editor.prototype.onChangeAnnotation = function () { this.renderer.setAnnotations(this.session.getAnnotations()); }; - - - this.onChangeMode = function(e) { + Editor.prototype.onChangeMode = function (e) { this.renderer.updateText(); this._emit("changeMode", e); }; - - - this.onChangeWrapLimit = function() { + Editor.prototype.onChangeWrapLimit = function () { this.renderer.updateFull(); }; - - this.onChangeWrapMode = function() { + Editor.prototype.onChangeWrapMode = function () { this.renderer.onResize(true); }; - - - this.onChangeFold = function() { + Editor.prototype.onChangeFold = function () { this.$updateHighlightActiveLine(); this.renderer.updateFull(); }; - this.getSelectedText = function() { + Editor.prototype.getSelectedText = function () { return this.session.getTextRange(this.getSelectionRange()); }; - this.getCopyText = function() { + Editor.prototype.getCopyText = function () { var text = this.getSelectedText(); var nl = this.session.doc.getNewLineCharacter(); - var copyLine= false; + var copyLine = false; if (!text && this.$copyWithEmptySelection) { copyLine = true; var ranges = this.selection.getAllRanges(); @@ -31915,65 +32144,60 @@ Editor.$uid = 0; text += this.session.getLine(range.start.row) + nl; } } - var e = {text: text}; + var e = { text: text }; this._signal("copy", e); - clipboard.lineMode = copyLine ? e.text : ""; + clipboard.lineMode = copyLine ? e.text : false; return e.text; }; - this.onCopy = function() { + Editor.prototype.onCopy = function () { this.commands.exec("copy", this); }; - this.onCut = function() { + Editor.prototype.onCut = function () { this.commands.exec("cut", this); }; - this.onPaste = function(text, event) { - var e = {text: text, event: event}; + Editor.prototype.onPaste = function (text, event) { + var e = { text: text, event: event }; this.commands.exec("paste", this, e); }; - - this.$handlePaste = function(e) { + Editor.prototype.$handlePaste = function (e) { if (typeof e == "string") - e = {text: e}; + e = { text: e }; this._signal("paste", e); var text = e.text; - - var lineMode = text == clipboard.lineMode; + var lineMode = text === clipboard.lineMode; var session = this.session; if (!this.inMultiSelectMode || this.inVirtualSelectionMode) { if (lineMode) session.insert({ row: this.selection.lead.row, column: 0 }, text); else this.insert(text); - } else if (lineMode) { - this.selection.rangeList.ranges.forEach(function(range) { + } + else if (lineMode) { + this.selection.rangeList.ranges.forEach(function (range) { session.insert({ row: range.start.row, column: 0 }, text); }); - } else { + } + else { var lines = text.split(/\r\n|\r|\n/); var ranges = this.selection.rangeList.ranges; - var isFullLine = lines.length == 2 && (!lines[0] || !lines[1]); if (lines.length != ranges.length || isFullLine) return this.commands.exec("insertstring", this, text); - for (var i = ranges.length; i--;) { var range = ranges[i]; if (!range.isEmpty()) session.remove(range); - session.insert(range.start, lines[i]); } } }; - - this.execCommand = function(command, args) { + Editor.prototype.execCommand = function (command, args) { return this.commands.exec(command, this, args); }; - this.insert = function(text, pasted) { + Editor.prototype.insert = function (text, pasted) { var session = this.session; var mode = session.getMode(); var cursor = this.getCursorPosition(); - if (this.getBehavioursEnabled() && !pasted) { var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text); if (transform) { @@ -31984,10 +32208,8 @@ Editor.$uid = 0; } } text = transform.text; - } } - if (text == "\t") text = this.session.getTabString(); if (!this.selection.isEmpty()) { @@ -31996,11 +32218,10 @@ Editor.$uid = 0; this.clearSelection(); } else if (this.session.getOverwrite() && text.indexOf("\n") == -1) { - var range = new Range.fromPoints(cursor, cursor); + var range = Range.fromPoints(cursor, cursor); range.end.column += text.length; this.session.remove(range); } - if (text == "\n" || text == "\r\n") { var line = session.getLine(cursor.row); if (cursor.column > line.search(/\S|$/)) { @@ -32009,87 +32230,66 @@ Editor.$uid = 0; } } this.clearSelection(); - var start = cursor.column; var lineState = session.getState(cursor.row); var line = session.getLine(cursor.row); var shouldOutdent = mode.checkOutdent(lineState, line, text); session.insert(cursor, text); - if (transform && transform.selection) { if (transform.selection.length == 2) { // Transform relative to the current column - this.selection.setSelectionRange( - new Range(cursor.row, start + transform.selection[0], - cursor.row, start + transform.selection[1])); - } else { // Transform relative to the current row. - this.selection.setSelectionRange( - new Range(cursor.row + transform.selection[0], - transform.selection[1], - cursor.row + transform.selection[2], - transform.selection[3])); + this.selection.setSelectionRange(new Range(cursor.row, start + transform.selection[0], cursor.row, start + transform.selection[1])); + } + else { // Transform relative to the current row. + this.selection.setSelectionRange(new Range(cursor.row + transform.selection[0], transform.selection[1], cursor.row + transform.selection[2], transform.selection[3])); } } if (this.$enableAutoIndent) { if (session.getDocument().isNewLine(text)) { var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); - - session.insert({row: cursor.row+1, column: 0}, lineIndent); + session.insert({ row: cursor.row + 1, column: 0 }, lineIndent); } if (shouldOutdent) mode.autoOutdent(lineState, session, cursor.row); } }; - - this.autoIndent = function () { + Editor.prototype.autoIndent = function () { var session = this.session; var mode = session.getMode(); - - var startRow, endRow; - if (this.selection.isEmpty()) { - startRow = 0; - endRow = session.doc.getLength() - 1; - } else { - var selectedRange = this.getSelectionRange(); - - startRow = selectedRange.start.row; - endRow = selectedRange.end.row; - } - + var ranges = this.selection.isEmpty() + ? [new Range(0, 0, session.doc.getLength() - 1, 0)] + : this.selection.getAllRanges(); var prevLineState = ""; var prevLine = ""; var lineIndent = ""; - var line, currIndent, range; var tab = session.getTabString(); - - for (var row = startRow; row <= endRow; row++) { - if (row > 0) { - prevLineState = session.getState(row - 1); - prevLine = session.getLine(row - 1); - lineIndent = mode.getNextLineIndent(prevLineState, prevLine, tab); - } - - line = session.getLine(row); - currIndent = mode.$getIndent(line); - if (lineIndent !== currIndent) { - if (currIndent.length > 0) { - range = new Range(row, 0, row, currIndent.length); - session.remove(range); + for (var i = 0; i < ranges.length; i++) { + var startRow = ranges[i].start.row; + var endRow = ranges[i].end.row; + for (var row = startRow; row <= endRow; row++) { + if (row > 0) { + prevLineState = session.getState(row - 1); + prevLine = session.getLine(row - 1); + lineIndent = mode.getNextLineIndent(prevLineState, prevLine, tab); } - if (lineIndent.length > 0) { - session.insert({row: row, column: 0}, lineIndent); + var line = session.getLine(row); + var currIndent = mode.$getIndent(line); + if (lineIndent !== currIndent) { + if (currIndent.length > 0) { + var range = new Range(row, 0, row, currIndent.length); + session.remove(range); + } + if (lineIndent.length > 0) { + session.insert({ row: row, column: 0 }, lineIndent); + } } + mode.autoOutdent(prevLineState, session, row); } - - mode.autoOutdent(prevLineState, session, row); } }; - - - this.onTextInput = function(text, composition) { + Editor.prototype.onTextInput = function (text, composition) { if (!composition) return this.keyBinding.onTextInput(text); - - this.startOperation({command: { name: "insertstring" }}); + this.startOperation({ command: { name: "insertstring" } }); var applyComposition = this.applyComposition.bind(this, text, composition); if (this.selection.rangeCount) this.forEachSelection(applyComposition); @@ -32097,8 +32297,7 @@ Editor.$uid = 0; applyComposition(); this.endOperation(); }; - - this.applyComposition = function(text, composition) { + Editor.prototype.applyComposition = function (text, composition) { if (composition.extendLeft || composition.extendRight) { var r = this.selection.getRange(); r.start.column -= composition.extendLeft; @@ -32120,137 +32319,132 @@ Editor.$uid = 0; this.selection.setRange(r); } }; - - this.onCommandKey = function(e, hashId, keyCode) { + Editor.prototype.onCommandKey = function (e, hashId, keyCode) { return this.keyBinding.onCommandKey(e, hashId, keyCode); }; - this.setOverwrite = function(overwrite) { + Editor.prototype.setOverwrite = function (overwrite) { this.session.setOverwrite(overwrite); }; - this.getOverwrite = function() { + Editor.prototype.getOverwrite = function () { return this.session.getOverwrite(); }; - this.toggleOverwrite = function() { + Editor.prototype.toggleOverwrite = function () { this.session.toggleOverwrite(); }; - this.setScrollSpeed = function(speed) { + Editor.prototype.setScrollSpeed = function (speed) { this.setOption("scrollSpeed", speed); }; - this.getScrollSpeed = function() { + Editor.prototype.getScrollSpeed = function () { return this.getOption("scrollSpeed"); }; - this.setDragDelay = function(dragDelay) { + Editor.prototype.setDragDelay = function (dragDelay) { this.setOption("dragDelay", dragDelay); }; - this.getDragDelay = function() { + Editor.prototype.getDragDelay = function () { return this.getOption("dragDelay"); }; - this.setSelectionStyle = function(val) { + Editor.prototype.setSelectionStyle = function (val) { this.setOption("selectionStyle", val); }; - this.getSelectionStyle = function() { + Editor.prototype.getSelectionStyle = function () { return this.getOption("selectionStyle"); }; - this.setHighlightActiveLine = function(shouldHighlight) { + Editor.prototype.setHighlightActiveLine = function (shouldHighlight) { this.setOption("highlightActiveLine", shouldHighlight); }; - this.getHighlightActiveLine = function() { + Editor.prototype.getHighlightActiveLine = function () { return this.getOption("highlightActiveLine"); }; - this.setHighlightGutterLine = function(shouldHighlight) { + Editor.prototype.setHighlightGutterLine = function (shouldHighlight) { this.setOption("highlightGutterLine", shouldHighlight); }; - - this.getHighlightGutterLine = function() { + Editor.prototype.getHighlightGutterLine = function () { return this.getOption("highlightGutterLine"); }; - this.setHighlightSelectedWord = function(shouldHighlight) { + Editor.prototype.setHighlightSelectedWord = function (shouldHighlight) { this.setOption("highlightSelectedWord", shouldHighlight); }; - this.getHighlightSelectedWord = function() { + Editor.prototype.getHighlightSelectedWord = function () { return this.$highlightSelectedWord; }; - - this.setAnimatedScroll = function(shouldAnimate){ + Editor.prototype.setAnimatedScroll = function (shouldAnimate) { this.renderer.setAnimatedScroll(shouldAnimate); }; - - this.getAnimatedScroll = function(){ + Editor.prototype.getAnimatedScroll = function () { return this.renderer.getAnimatedScroll(); }; - this.setShowInvisibles = function(showInvisibles) { + Editor.prototype.setShowInvisibles = function (showInvisibles) { this.renderer.setShowInvisibles(showInvisibles); }; - this.getShowInvisibles = function() { + Editor.prototype.getShowInvisibles = function () { return this.renderer.getShowInvisibles(); }; - - this.setDisplayIndentGuides = function(display) { + Editor.prototype.setDisplayIndentGuides = function (display) { this.renderer.setDisplayIndentGuides(display); }; - - this.getDisplayIndentGuides = function() { + Editor.prototype.getDisplayIndentGuides = function () { return this.renderer.getDisplayIndentGuides(); }; - this.setShowPrintMargin = function(showPrintMargin) { + Editor.prototype.setHighlightIndentGuides = function (highlight) { + this.renderer.setHighlightIndentGuides(highlight); + }; + Editor.prototype.getHighlightIndentGuides = function () { + return this.renderer.getHighlightIndentGuides(); + }; + Editor.prototype.setShowPrintMargin = function (showPrintMargin) { this.renderer.setShowPrintMargin(showPrintMargin); }; - this.getShowPrintMargin = function() { + Editor.prototype.getShowPrintMargin = function () { return this.renderer.getShowPrintMargin(); }; - this.setPrintMarginColumn = function(showPrintMargin) { + Editor.prototype.setPrintMarginColumn = function (showPrintMargin) { this.renderer.setPrintMarginColumn(showPrintMargin); }; - this.getPrintMarginColumn = function() { + Editor.prototype.getPrintMarginColumn = function () { return this.renderer.getPrintMarginColumn(); }; - this.setReadOnly = function(readOnly) { + Editor.prototype.setReadOnly = function (readOnly) { this.setOption("readOnly", readOnly); }; - this.getReadOnly = function() { + Editor.prototype.getReadOnly = function () { return this.getOption("readOnly"); }; - this.setBehavioursEnabled = function (enabled) { + Editor.prototype.setBehavioursEnabled = function (enabled) { this.setOption("behavioursEnabled", enabled); }; - this.getBehavioursEnabled = function () { + Editor.prototype.getBehavioursEnabled = function () { return this.getOption("behavioursEnabled"); }; - this.setWrapBehavioursEnabled = function (enabled) { + Editor.prototype.setWrapBehavioursEnabled = function (enabled) { this.setOption("wrapBehavioursEnabled", enabled); }; - this.getWrapBehavioursEnabled = function () { + Editor.prototype.getWrapBehavioursEnabled = function () { return this.getOption("wrapBehavioursEnabled"); }; - this.setShowFoldWidgets = function(show) { + Editor.prototype.setShowFoldWidgets = function (show) { this.setOption("showFoldWidgets", show); - }; - this.getShowFoldWidgets = function() { + Editor.prototype.getShowFoldWidgets = function () { return this.getOption("showFoldWidgets"); }; - - this.setFadeFoldWidgets = function(fade) { + Editor.prototype.setFadeFoldWidgets = function (fade) { this.setOption("fadeFoldWidgets", fade); }; - - this.getFadeFoldWidgets = function() { + Editor.prototype.getFadeFoldWidgets = function () { return this.getOption("fadeFoldWidgets"); }; - this.remove = function(dir) { - if (this.selection.isEmpty()){ + Editor.prototype.remove = function (dir) { + if (this.selection.isEmpty()) { if (dir == "left") this.selection.selectLeft(); else this.selection.selectRight(); } - var range = this.getSelectionRange(); if (this.getBehavioursEnabled()) { var session = this.session; var state = session.getState(range.start.row); var new_range = session.getMode().transformAction(state, 'deletion', this, session, range); - if (range.end.column === 0) { var text = session.getTextRange(range); if (text[text.length - 1] == "\n") { @@ -32263,25 +32457,22 @@ Editor.$uid = 0; if (new_range) range = new_range; } - this.session.remove(range); this.clearSelection(); }; - this.removeWordRight = function() { + Editor.prototype.removeWordRight = function () { if (this.selection.isEmpty()) this.selection.selectWordRight(); - this.session.remove(this.getSelectionRange()); this.clearSelection(); }; - this.removeWordLeft = function() { + Editor.prototype.removeWordLeft = function () { if (this.selection.isEmpty()) this.selection.selectWordLeft(); - this.session.remove(this.getSelectionRange()); this.clearSelection(); }; - this.removeToLineStart = function() { + Editor.prototype.removeToLineStart = function () { if (this.selection.isEmpty()) this.selection.selectLineStart(); if (this.selection.isEmpty()) @@ -32289,83 +32480,88 @@ Editor.$uid = 0; this.session.remove(this.getSelectionRange()); this.clearSelection(); }; - this.removeToLineEnd = function() { + Editor.prototype.removeToLineEnd = function () { if (this.selection.isEmpty()) this.selection.selectLineEnd(); - var range = this.getSelectionRange(); if (range.start.column == range.end.column && range.start.row == range.end.row) { range.end.column = 0; range.end.row++; } - this.session.remove(range); this.clearSelection(); }; - this.splitLine = function() { + Editor.prototype.splitLine = function () { if (!this.selection.isEmpty()) { this.session.remove(this.getSelectionRange()); this.clearSelection(); } - var cursor = this.getCursorPosition(); this.insert("\n"); this.moveCursorToPosition(cursor); }; - this.transposeLetters = function() { + Editor.prototype.setGhostText = function (text, position) { + if (!this.session.widgetManager) { + this.session.widgetManager = new LineWidgets(this.session); + this.session.widgetManager.attach(this); + } + this.renderer.setGhostText(text, position); + }; + Editor.prototype.removeGhostText = function () { + if (!this.session.widgetManager) + return; + this.renderer.removeGhostText(); + }; + Editor.prototype.transposeLetters = function () { if (!this.selection.isEmpty()) { return; } - var cursor = this.getCursorPosition(); var column = cursor.column; if (column === 0) return; - var line = this.session.getLine(cursor.row); var swap, range; if (column < line.length) { - swap = line.charAt(column) + line.charAt(column-1); - range = new Range(cursor.row, column-1, cursor.row, column+1); + swap = line.charAt(column) + line.charAt(column - 1); + range = new Range(cursor.row, column - 1, cursor.row, column + 1); } else { - swap = line.charAt(column-1) + line.charAt(column-2); - range = new Range(cursor.row, column-2, cursor.row, column); + swap = line.charAt(column - 1) + line.charAt(column - 2); + range = new Range(cursor.row, column - 2, cursor.row, column); } this.session.replace(range, swap); this.session.selection.moveToPosition(range.end); }; - this.toLowerCase = function() { + Editor.prototype.toLowerCase = function () { var originalRange = this.getSelectionRange(); if (this.selection.isEmpty()) { this.selection.selectWord(); } - var range = this.getSelectionRange(); var text = this.session.getTextRange(range); this.session.replace(range, text.toLowerCase()); this.selection.setSelectionRange(originalRange); }; - this.toUpperCase = function() { + Editor.prototype.toUpperCase = function () { var originalRange = this.getSelectionRange(); if (this.selection.isEmpty()) { this.selection.selectWord(); } - var range = this.getSelectionRange(); var text = this.session.getTextRange(range); this.session.replace(range, text.toUpperCase()); this.selection.setSelectionRange(originalRange); }; - this.indent = function() { + Editor.prototype.indent = function () { var session = this.session; var range = this.getSelectionRange(); - if (range.start.row < range.end.row) { var rows = this.$getSelectedRows(); session.indentRows(rows.first, rows.last, "\t"); return; - } else if (range.start.column < range.end.column) { + } + else if (range.start.column < range.end.column) { var text = session.getTextRange(range); if (!/^\s+$/.test(text)) { var rows = this.$getSelectedRows(); @@ -32373,16 +32569,15 @@ Editor.$uid = 0; return; } } - var line = session.getLine(range.start.row); var position = range.start; var size = session.getTabSize(); var column = session.documentToScreenColumn(position.row, position.column); - if (this.session.getUseSoftTabs()) { var count = (size - column % size); var indentString = lang.stringRepeat(" ", count); - } else { + } + else { var count = column % size; while (line[range.start.column - 1] == " " && count) { range.start.column--; @@ -32393,129 +32588,95 @@ Editor.$uid = 0; } return this.insert(indentString); }; - this.blockIndent = function() { + Editor.prototype.blockIndent = function () { var rows = this.$getSelectedRows(); this.session.indentRows(rows.first, rows.last, "\t"); }; - this.blockOutdent = function() { + Editor.prototype.blockOutdent = function () { var selection = this.session.getSelection(); this.session.outdentRows(selection.getRange()); }; - this.sortLines = function() { + Editor.prototype.sortLines = function () { var rows = this.$getSelectedRows(); var session = this.session; - var lines = []; for (var i = rows.first; i <= rows.last; i++) lines.push(session.getLine(i)); - - lines.sort(function(a, b) { - if (a.toLowerCase() < b.toLowerCase()) return -1; - if (a.toLowerCase() > b.toLowerCase()) return 1; + lines.sort(function (a, b) { + if (a.toLowerCase() < b.toLowerCase()) + return -1; + if (a.toLowerCase() > b.toLowerCase()) + return 1; return 0; }); - var deleteRange = new Range(0, 0, 0, 0); for (var i = rows.first; i <= rows.last; i++) { var line = session.getLine(i); deleteRange.start.row = i; deleteRange.end.row = i; deleteRange.end.column = line.length; - session.replace(deleteRange, lines[i-rows.first]); + session.replace(deleteRange, lines[i - rows.first]); } }; - this.toggleCommentLines = function() { + Editor.prototype.toggleCommentLines = function () { var state = this.session.getState(this.getCursorPosition().row); var rows = this.$getSelectedRows(); this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last); }; - - this.toggleBlockComment = function() { + Editor.prototype.toggleBlockComment = function () { var cursor = this.getCursorPosition(); var state = this.session.getState(cursor.row); var range = this.getSelectionRange(); this.session.getMode().toggleBlockComment(state, this.session, range, cursor); }; - this.getNumberAt = function(row, column) { + Editor.prototype.getNumberAt = function (row, column) { var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g; _numberRx.lastIndex = 0; - var s = this.session.getLine(row); while (_numberRx.lastIndex < column) { var m = _numberRx.exec(s); - if(m.index <= column && m.index+m[0].length >= column){ + if (m.index <= column && m.index + m[0].length >= column) { var number = { value: m[0], start: m.index, - end: m.index+m[0].length + end: m.index + m[0].length }; return number; } } return null; }; - this.modifyNumber = function(amount) { + Editor.prototype.modifyNumber = function (amount) { var row = this.selection.getCursor().row; var column = this.selection.getCursor().column; - var charRange = new Range(row, column-1, row, column); - + var charRange = new Range(row, column - 1, row, column); var c = this.session.getTextRange(charRange); if (!isNaN(parseFloat(c)) && isFinite(c)) { var nr = this.getNumberAt(row, column); if (nr) { var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end; var decimals = nr.start + nr.value.length - fp; - var t = parseFloat(nr.value); t *= Math.pow(10, decimals); - - - if(fp !== nr.end && column < fp){ + if (fp !== nr.end && column < fp) { amount *= Math.pow(10, nr.end - column - 1); - } else { + } + else { amount *= Math.pow(10, nr.end - column); } - t += amount; t /= Math.pow(10, decimals); var nnr = t.toFixed(decimals); var replaceRange = new Range(row, nr.start, row, nr.end); this.session.replace(replaceRange, nnr); - this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length)); - + this.moveCursorTo(row, Math.max(nr.start + 1, column + nnr.length - nr.value.length)); } - } else { + } + else { this.toggleWord(); } }; - - this.$toggleWordPairs = [ - ["first", "last"], - ["true", "false"], - ["yes", "no"], - ["width", "height"], - ["top", "bottom"], - ["right", "left"], - ["on", "off"], - ["x", "y"], - ["get", "set"], - ["max", "min"], - ["horizontal", "vertical"], - ["show", "hide"], - ["add", "remove"], - ["up", "down"], - ["before", "after"], - ["even", "odd"], - ["in", "out"], - ["inside", "outside"], - ["next", "previous"], - ["increase", "decrease"], - ["attach", "detach"], - ["&&", "||"], - ["==", "!="] - ]; - - this.toggleWord = function () { + Editor.prototype.toggleWord = function () { var row = this.selection.getCursor().row; var column = this.selection.getCursor().column; this.selection.selectWord(); @@ -32523,7 +32684,8 @@ Editor.$uid = 0; var currWordStart = this.selection.getWordRange().start.column; var wordParts = currentState.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g, '$1 ').split(/\s/); var delta = column - currWordStart - 1; - if (delta < 0) delta = 0; + if (delta < 0) + delta = 0; var curLength = 0, itLength = 0; var that = this; if (currentState.match(/[A-Za-z0-9_]+/)) { @@ -32538,7 +32700,6 @@ Editor.$uid = 0; curLength = itLength; }); } - var wordPairs = this.$toggleWordPairs; var reg; for (var i = 0; i < wordPairs.length; i++) { @@ -32553,7 +32714,8 @@ Editor.$uid = 0; var res = item[negate]; if (result.toUpperCase() == result) { res = res.toUpperCase(); - } else if (result.charAt(0).toUpperCase() == result.charAt(0)) { + } + else if (result.charAt(0).toUpperCase() == result.charAt(0)) { res = res.substr(0, 0) + item[negate].charAt(0).toUpperCase() + res.substr(1); } return res; @@ -32565,13 +32727,49 @@ Editor.$uid = 0; } } }; - this.removeLines = function() { + Editor.prototype.findLinkAt = function (row, column) { + var e_1, _a; + var line = this.session.getLine(row); + var wordParts = line.split(/((?:https?|ftp):\/\/[\S]+)/); + var columnPosition = column; + if (columnPosition < 0) + columnPosition = 0; + var previousPosition = 0, currentPosition = 0, match; + try { + for (var wordParts_1 = __values(wordParts), wordParts_1_1 = wordParts_1.next(); !wordParts_1_1.done; wordParts_1_1 = wordParts_1.next()) { + var item = wordParts_1_1.value; + currentPosition = previousPosition + item.length; + if (columnPosition >= previousPosition && columnPosition <= currentPosition) { + if (item.match(/((?:https?|ftp):\/\/[\S]+)/)) { + match = item.replace(/[\s:.,'";}\]]+$/, ""); + break; + } + } + previousPosition = currentPosition; + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (wordParts_1_1 && !wordParts_1_1.done && (_a = wordParts_1.return)) _a.call(wordParts_1); + } + finally { if (e_1) throw e_1.error; } + } + return match; + }; + Editor.prototype.openLink = function () { + var cursor = this.selection.getCursor(); + var url = this.findLinkAt(cursor.row, cursor.column); + if (url) + window.open(url, '_blank'); + return url != null; + }; + Editor.prototype.removeLines = function () { var rows = this.$getSelectedRows(); this.session.removeFullLines(rows.first, rows.last); this.clearSelection(); }; - - this.duplicateSelection = function() { + Editor.prototype.duplicateSelection = function () { var sel = this.selection; var doc = this.session; var range = sel.getRange(); @@ -32579,45 +32777,46 @@ Editor.$uid = 0; if (range.isEmpty()) { var row = range.start.row; doc.duplicateLines(row, row); - } else { + } + else { var point = reverse ? range.start : range.end; - var endPoint = doc.insert(point, doc.getTextRange(range), false); + var endPoint = doc.insert(point, doc.getTextRange(range)); range.start = point; range.end = endPoint; - sel.setSelectionRange(range, reverse); } }; - this.moveLinesDown = function() { + Editor.prototype.moveLinesDown = function () { this.$moveLines(1, false); }; - this.moveLinesUp = function() { + Editor.prototype.moveLinesUp = function () { this.$moveLines(-1, false); }; - this.moveText = function(range, toPosition, copy) { + Editor.prototype.moveText = function (range, toPosition, copy) { return this.session.moveText(range, toPosition, copy); }; - this.copyLinesUp = function() { + Editor.prototype.copyLinesUp = function () { this.$moveLines(-1, true); }; - this.copyLinesDown = function() { + Editor.prototype.copyLinesDown = function () { this.$moveLines(1, true); }; - this.$moveLines = function(dir, copy) { + Editor.prototype.$moveLines = function (dir, copy) { var rows, moved; var selection = this.selection; if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) { var range = selection.toOrientedRange(); rows = this.$getSelectedRows(range); moved = this.session.$moveLines(rows.first, rows.last, copy ? 0 : dir); - if (copy && dir == -1) moved = 0; + if (copy && dir == -1) + moved = 0; range.moveBy(moved, 0); selection.fromOrientedRange(range); - } else { + } + else { var ranges = selection.rangeList.ranges; selection.rangeList.detach(this.session); this.inVirtualSelectionMode = true; - var diff = 0; var totalDiff = 0; var l = ranges.length; @@ -32628,7 +32827,8 @@ Editor.$uid = 0; var first = rows.first; var last = rows.last; while (++i < l) { - if (totalDiff) ranges[i].moveBy(totalDiff, 0); + if (totalDiff) + ranges[i].moveBy(totalDiff, 0); var subRows = this.$getSelectedRows(ranges[i]); if (copy && subRows.first != last) break; @@ -32638,103 +32838,96 @@ Editor.$uid = 0; } i--; diff = this.session.$moveLines(first, last, copy ? 0 : dir); - if (copy && dir == -1) rangeIndex = i + 1; + if (copy && dir == -1) + rangeIndex = i + 1; while (rangeIndex <= i) { ranges[rangeIndex].moveBy(diff, 0); rangeIndex++; } - if (!copy) diff = 0; + if (!copy) + diff = 0; totalDiff += diff; } - selection.fromOrientedRange(selection.ranges[0]); selection.rangeList.attach(this.session); this.inVirtualSelectionMode = false; } }; - this.$getSelectedRows = function(range) { + Editor.prototype.$getSelectedRows = function (range) { range = (range || this.getSelectionRange()).collapseRows(); - return { first: this.session.getRowFoldStart(range.start.row), last: this.session.getRowFoldEnd(range.end.row) }; }; - - this.onCompositionStart = function(compositionState) { + Editor.prototype.onCompositionStart = function (compositionState) { this.renderer.showComposition(compositionState); }; - - this.onCompositionUpdate = function(text) { + Editor.prototype.onCompositionUpdate = function (text) { this.renderer.setCompositionText(text); }; - - this.onCompositionEnd = function() { + Editor.prototype.onCompositionEnd = function () { this.renderer.hideComposition(); }; - this.getFirstVisibleRow = function() { + Editor.prototype.getFirstVisibleRow = function () { return this.renderer.getFirstVisibleRow(); }; - this.getLastVisibleRow = function() { + Editor.prototype.getLastVisibleRow = function () { return this.renderer.getLastVisibleRow(); }; - this.isRowVisible = function(row) { + Editor.prototype.isRowVisible = function (row) { return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow()); }; - this.isRowFullyVisible = function(row) { + Editor.prototype.isRowFullyVisible = function (row) { return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow()); }; - this.$getVisibleRowCount = function() { + Editor.prototype.$getVisibleRowCount = function () { return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; }; - - this.$moveByPage = function(dir, select) { + Editor.prototype.$moveByPage = function (dir, select) { var renderer = this.renderer; var config = this.renderer.layerConfig; var rows = dir * Math.floor(config.height / config.lineHeight); - if (select === true) { - this.selection.$moveSelection(function(){ + this.selection.$moveSelection(function () { this.moveCursorBy(rows, 0); }); - } else if (select === false) { + } + else if (select === false) { this.selection.moveCursorBy(rows, 0); this.selection.clearSelection(); } - var scrollTop = renderer.scrollTop; - renderer.scrollBy(0, rows * config.lineHeight); if (select != null) renderer.scrollCursorIntoView(null, 0.5); - renderer.animateScrolling(scrollTop); }; - this.selectPageDown = function() { + Editor.prototype.selectPageDown = function () { this.$moveByPage(1, true); }; - this.selectPageUp = function() { + Editor.prototype.selectPageUp = function () { this.$moveByPage(-1, true); }; - this.gotoPageDown = function() { - this.$moveByPage(1, false); + Editor.prototype.gotoPageDown = function () { + this.$moveByPage(1, false); }; - this.gotoPageUp = function() { + Editor.prototype.gotoPageUp = function () { this.$moveByPage(-1, false); }; - this.scrollPageDown = function() { + Editor.prototype.scrollPageDown = function () { this.$moveByPage(1); }; - this.scrollPageUp = function() { + Editor.prototype.scrollPageUp = function () { this.$moveByPage(-1); }; - this.scrollToRow = function(row) { + Editor.prototype.scrollToRow = function (row) { this.renderer.scrollToRow(row); }; - this.scrollToLine = function(line, center, animate, callback) { + Editor.prototype.scrollToLine = function (line, center, animate, callback) { this.renderer.scrollToLine(line, center, animate, callback); }; - this.centerSelection = function() { + Editor.prototype.centerSelection = function () { var range = this.getSelectionRange(); var pos = { row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2), @@ -32742,34 +32935,38 @@ Editor.$uid = 0; }; this.renderer.alignCursor(pos, 0.5); }; - this.getCursorPosition = function() { + Editor.prototype.getCursorPosition = function () { return this.selection.getCursor(); }; - this.getCursorPositionScreen = function() { + Editor.prototype.getCursorPositionScreen = function () { return this.session.documentToScreenPosition(this.getCursorPosition()); }; - this.getSelectionRange = function() { + Editor.prototype.getSelectionRange = function () { return this.selection.getRange(); }; - this.selectAll = function() { + Editor.prototype.selectAll = function () { this.selection.selectAll(); }; - this.clearSelection = function() { + Editor.prototype.clearSelection = function () { this.selection.clearSelection(); }; - this.moveCursorTo = function(row, column) { + Editor.prototype.moveCursorTo = function (row, column) { this.selection.moveCursorTo(row, column); }; - this.moveCursorToPosition = function(pos) { + Editor.prototype.moveCursorToPosition = function (pos) { this.selection.moveCursorToPosition(pos); }; - this.jumpToMatching = function(select, expand) { + Editor.prototype.jumpToMatching = function (select, expand) { var cursor = this.getCursorPosition(); var iterator = new TokenIterator(this.session, cursor.row, cursor.column); var prevToken = iterator.getCurrentToken(); + var tokenCount = 0; + if (prevToken && prevToken.type.indexOf('tag-name') !== -1) { + prevToken = iterator.stepBackward(); + } var token = prevToken || iterator.stepForward(); - - if (!token) return; + if (!token) + return; var matchType; var found = false; var depth = {}; @@ -32783,20 +32980,16 @@ Editor.$uid = 0; "{": "{", "}": "{" }; - do { if (token.value.match(/[{}()\[\]]/g)) { for (; i < token.value.length && !found; i++) { if (!brackets[token.value[i]]) { continue; } - bracketType = brackets[token.value[i]] + '.' + token.type.replace("rparen", "lparen"); - if (isNaN(depth[bracketType])) { depth[bracketType] = 0; } - switch (token.value[i]) { case '(': case '[': @@ -32807,12 +33000,11 @@ Editor.$uid = 0; case ']': case '}': depth[bracketType]--; - if (depth[bracketType] === -1) { matchType = 'bracket'; found = true; } - break; + break; } } } @@ -32820,116 +33012,90 @@ Editor.$uid = 0; if (isNaN(depth[token.value])) { depth[token.value] = 0; } - - if (prevToken.value === '<') { + if (prevToken.value === '<' && tokenCount > 1) { depth[token.value]++; } else if (prevToken.value === '= 0; --i) { - if(this.$tryReplace(ranges[i], replacement)) { + if (this.$tryReplace(ranges[i], replacement)) { replaced++; } } - this.selection.setSelectionRange(selection); - return replaced; }; - - this.$tryReplace = function(range, replacement) { + Editor.prototype.$tryReplace = function (range, replacement) { var input = this.session.getTextRange(range); replacement = this.$search.replace(input, replacement); if (replacement !== null) { range.end = this.session.replace(range, replacement); return range; - } else { + } + else { return null; } }; - this.getLastSearchOptions = function() { + Editor.prototype.getLastSearchOptions = function () { return this.$search.getOptions(); }; - this.find = function(needle, options, animate) { + Editor.prototype.find = function (needle, options, animate) { if (!options) options = {}; - if (typeof needle == "string" || needle instanceof RegExp) options.needle = needle; else if (typeof needle == "object") oop.mixin(options, needle); - var range = this.selection.getRange(); if (options.needle == null) { needle = this.session.getTextRange(range) @@ -33067,13 +33222,11 @@ Editor.$uid = 0; range = this.session.getWordRange(range.start.row, range.start.column); needle = this.session.getTextRange(range); } - this.$search.set({needle: needle}); + this.$search.set({ needle: needle }); } - this.$search.set(options); if (!options.start) - this.$search.set({start: range}); - + this.$search.set({ start: range }); var newRange = this.$search.find(this.session); if (options.preventScroll) return newRange; @@ -33087,33 +33240,31 @@ Editor.$uid = 0; range.end = range.start; this.selection.setRange(range); }; - this.findNext = function(options, animate) { - this.find({skipCurrent: true, backwards: false}, options, animate); + Editor.prototype.findNext = function (options, animate) { + this.find({ skipCurrent: true, backwards: false }, options, animate); }; - this.findPrevious = function(options, animate) { - this.find(options, {skipCurrent: true, backwards: true}, animate); + Editor.prototype.findPrevious = function (options, animate) { + this.find(options, { skipCurrent: true, backwards: true }, animate); }; - - this.revealRange = function(range, animate) { + Editor.prototype.revealRange = function (range, animate) { this.session.unfold(range); this.selection.setSelectionRange(range); - var scrollTop = this.renderer.scrollTop; this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); if (animate !== false) this.renderer.animateScrolling(scrollTop); }; - this.undo = function() { + Editor.prototype.undo = function () { this.session.getUndoManager().undo(this.session); this.renderer.scrollCursorIntoView(null, 0.5); }; - this.redo = function() { + Editor.prototype.redo = function () { this.session.getUndoManager().redo(this.session); this.renderer.scrollCursorIntoView(null, 0.5); }; - this.destroy = function() { + Editor.prototype.destroy = function () { if (this.$toDestroy) { - this.$toDestroy.forEach(function(el) { + this.$toDestroy.forEach(function (el) { el.destroy(); }); this.$toDestroy = null; @@ -33128,7 +33279,7 @@ Editor.$uid = 0; this._$emitInputEvent.cancel(); this.removeAllListeners(); }; - this.setAutoScrollEditorIntoView = function(enable) { + Editor.prototype.setAutoScrollEditorIntoView = function (enable) { if (!enable) return; var rect; @@ -33139,842 +33290,444 @@ Editor.$uid = 0; var scrollAnchor = this.$scrollAnchor; scrollAnchor.style.cssText = "position:absolute"; this.container.insertBefore(scrollAnchor, this.container.firstChild); - var onChangeSelection = this.on("changeSelection", function() { + var onChangeSelection = this.on("changeSelection", function () { shouldScroll = true; }); - var onBeforeRender = this.renderer.on("beforeRender", function() { + var onBeforeRender = this.renderer.on("beforeRender", function () { if (shouldScroll) rect = self.renderer.container.getBoundingClientRect(); }); - var onAfterRender = this.renderer.on("afterRender", function() { + var onAfterRender = this.renderer.on("afterRender", function () { if (shouldScroll && rect && (self.isFocused() - || self.searchBox && self.searchBox.isFocused()) - ) { - var renderer = self.renderer; - var pos = renderer.$cursorLayer.$pixelPos; - var config = renderer.layerConfig; - var top = pos.top - config.offset; - if (pos.top >= 0 && top + rect.top < 0) { - shouldScroll = true; - } else if (pos.top < config.height && - pos.top + rect.top + config.lineHeight > window.innerHeight) { - shouldScroll = false; - } else { - shouldScroll = null; - } - if (shouldScroll != null) { - scrollAnchor.style.top = top + "px"; - scrollAnchor.style.left = pos.left + "px"; - scrollAnchor.style.height = config.lineHeight + "px"; - scrollAnchor.scrollIntoView(shouldScroll); - } - shouldScroll = rect = null; - } - }); - this.setAutoScrollEditorIntoView = function(enable) { - if (enable) - return; - delete this.setAutoScrollEditorIntoView; - this.off("changeSelection", onChangeSelection); - this.renderer.off("afterRender", onAfterRender); - this.renderer.off("beforeRender", onBeforeRender); - }; - }; - - - this.$resetCursorStyle = function() { - var style = this.$cursorStyle || "ace"; - var cursorLayer = this.renderer.$cursorLayer; - if (!cursorLayer) - return; - cursorLayer.setSmoothBlinking(/smooth/.test(style)); - cursorLayer.isBlinking = !this.$readOnly && style != "wide"; - dom.setCssClass(cursorLayer.element, "ace_slim-cursors", /slim/.test(style)); - }; - this.prompt = function(message, options, callback) { - var editor = this; - config.loadModule("./ext/prompt", function (module) { - module.prompt(editor, message, options, callback); - }); - }; - -}).call(Editor.prototype); - - - -config.defineOptions(Editor.prototype, "editor", { - selectionStyle: { - set: function(style) { - this.onSelectionChange(); - this._signal("changeSelectionStyle", {data: style}); - }, - initialValue: "line" - }, - highlightActiveLine: { - set: function() {this.$updateHighlightActiveLine();}, - initialValue: true - }, - highlightSelectedWord: { - set: function(shouldHighlight) {this.$onSelectionChange();}, - initialValue: true - }, - readOnly: { - set: function(readOnly) { - this.textInput.setReadOnly(readOnly); - this.$resetCursorStyle(); - }, - initialValue: false - }, - copyWithEmptySelection: { - set: function(value) { - this.textInput.setCopyWithEmptySelection(value); - }, - initialValue: false - }, - cursorStyle: { - set: function(val) { this.$resetCursorStyle(); }, - values: ["ace", "slim", "smooth", "wide"], - initialValue: "ace" - }, - mergeUndoDeltas: { - values: [false, true, "always"], - initialValue: true - }, - behavioursEnabled: {initialValue: true}, - wrapBehavioursEnabled: {initialValue: true}, - enableAutoIndent: {initialValue: true}, - autoScrollEditorIntoView: { - set: function(val) {this.setAutoScrollEditorIntoView(val);} - }, - keyboardHandler: { - set: function(val) { this.setKeyboardHandler(val); }, - get: function() { return this.$keybindingId; }, - handlesSet: true - }, - value: { - set: function(val) { this.session.setValue(val); }, - get: function() { return this.getValue(); }, - handlesSet: true, - hidden: true - }, - session: { - set: function(val) { this.setSession(val); }, - get: function() { return this.session; }, - handlesSet: true, - hidden: true - }, - - showLineNumbers: { - set: function(show) { - this.renderer.$gutterLayer.setShowLineNumbers(show); - this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER); - if (show && this.$relativeLineNumbers) - relativeNumberRenderer.attach(this); - else - relativeNumberRenderer.detach(this); - }, - initialValue: true - }, - relativeLineNumbers: { - set: function(value) { - if (this.$showLineNumbers && value) - relativeNumberRenderer.attach(this); - else - relativeNumberRenderer.detach(this); - } - }, - placeholder: { - set: function(message) { - if (!this.$updatePlaceholder) { - this.$updatePlaceholder = function() { - var value = this.session && (this.renderer.$composition || this.getValue()); - if (value && this.renderer.placeholderNode) { - this.renderer.off("afterRender", this.$updatePlaceholder); - dom.removeCssClass(this.container, "ace_hasPlaceholder"); - this.renderer.placeholderNode.remove(); - this.renderer.placeholderNode = null; - } else if (!value && !this.renderer.placeholderNode) { - this.renderer.on("afterRender", this.$updatePlaceholder); - dom.addCssClass(this.container, "ace_hasPlaceholder"); - var el = dom.createElement("div"); - el.className = "ace_placeholder"; - el.textContent = this.$placeholder || ""; - this.renderer.placeholderNode = el; - this.renderer.content.appendChild(this.renderer.placeholderNode); - } else if (!value && this.renderer.placeholderNode) { - this.renderer.placeholderNode.textContent = this.$placeholder || ""; - } - }.bind(this); - this.on("input", this.$updatePlaceholder); - } - this.$updatePlaceholder(); - } - }, - - hScrollBarAlwaysVisible: "renderer", - vScrollBarAlwaysVisible: "renderer", - highlightGutterLine: "renderer", - animatedScroll: "renderer", - showInvisibles: "renderer", - showPrintMargin: "renderer", - printMarginColumn: "renderer", - printMargin: "renderer", - fadeFoldWidgets: "renderer", - showFoldWidgets: "renderer", - displayIndentGuides: "renderer", - showGutter: "renderer", - fontSize: "renderer", - fontFamily: "renderer", - maxLines: "renderer", - minLines: "renderer", - scrollPastEnd: "renderer", - fixedWidthGutter: "renderer", - theme: "renderer", - hasCssTransforms: "renderer", - maxPixelHeight: "renderer", - useTextareaForIME: "renderer", - - scrollSpeed: "$mouseHandler", - dragDelay: "$mouseHandler", - dragEnabled: "$mouseHandler", - focusTimeout: "$mouseHandler", - tooltipFollowsMouse: "$mouseHandler", - - firstLineNumber: "session", - overwrite: "session", - newLineMode: "session", - useWorker: "session", - useSoftTabs: "session", - navigateWithinSoftTabs: "session", - tabSize: "session", - wrap: "session", - indentedSoftWrap: "session", - foldStyle: "session", - mode: "session" -}); - - -var relativeNumberRenderer = { - getText: function(session, row) { - return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9 ? "\xb7" : ""))) + ""; - }, - getWidth: function(session, lastLineNumber, config) { - return Math.max( - lastLineNumber.toString().length, - (config.lastRow + 1).toString().length, - 2 - ) * config.characterWidth; - }, - update: function(e, editor) { - editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER); - }, - attach: function(editor) { - editor.renderer.$gutterLayer.$renderer = this; - editor.on("changeSelection", this.update); - this.update(null, editor); - }, - detach: function(editor) { - if (editor.renderer.$gutterLayer.$renderer == this) - editor.renderer.$gutterLayer.$renderer = null; - editor.off("changeSelection", this.update); - this.update(null, editor); - } -}; - -exports.Editor = Editor; -}); - -ace.define("ace/undomanager",["require","exports","module","ace/range"], function(require, exports, module) { -"use strict"; -var UndoManager = function() { - this.$maxRev = 0; - this.$fromUndo = false; - this.reset(); -}; - -(function() { - - this.addSession = function(session) { - this.$session = session; - }; - this.add = function(delta, allowMerge, session) { - if (this.$fromUndo) return; - if (delta == this.$lastDelta) return; - if (!this.$keepRedoStack) this.$redoStack.length = 0; - if (allowMerge === false || !this.lastDeltas) { - this.lastDeltas = []; - this.$undoStack.push(this.lastDeltas); - delta.id = this.$rev = ++this.$maxRev; - } - if (delta.action == "remove" || delta.action == "insert") - this.$lastDelta = delta; - this.lastDeltas.push(delta); - }; - - this.addSelection = function(selection, rev) { - this.selections.push({ - value: selection, - rev: rev || this.$rev - }); - }; - - this.startNewGroup = function() { - this.lastDeltas = null; - return this.$rev; - }; - - this.markIgnored = function(from, to) { - if (to == null) to = this.$rev + 1; - var stack = this.$undoStack; - for (var i = stack.length; i--;) { - var delta = stack[i][0]; - if (delta.id <= from) - break; - if (delta.id < to) - delta.ignore = true; - } - this.lastDeltas = null; - }; - - this.getSelection = function(rev, after) { - var stack = this.selections; - for (var i = stack.length; i--;) { - var selection = stack[i]; - if (selection.rev < rev) { - if (after) - selection = stack[i + 1]; - return selection; - } - } - }; - - this.getRevision = function() { - return this.$rev; - }; - - this.getDeltas = function(from, to) { - if (to == null) to = this.$rev + 1; - var stack = this.$undoStack; - var end = null, start = 0; - for (var i = stack.length; i--;) { - var delta = stack[i][0]; - if (delta.id < to && !end) - end = i+1; - if (delta.id <= from) { - start = i + 1; - break; - } - } - return stack.slice(start, end); - }; - - this.getChangedRanges = function(from, to) { - if (to == null) to = this.$rev + 1; - - }; - - this.getChangedLines = function(from, to) { - if (to == null) to = this.$rev + 1; - - }; - this.undo = function(session, dontSelect) { - this.lastDeltas = null; - var stack = this.$undoStack; - - if (!rearrangeUndoStack(stack, stack.length)) - return; - - if (!session) - session = this.$session; - - if (this.$redoStackBaseRev !== this.$rev && this.$redoStack.length) - this.$redoStack = []; - - this.$fromUndo = true; - - var deltaSet = stack.pop(); - var undoSelectionRange = null; - if (deltaSet) { - undoSelectionRange = session.undoChanges(deltaSet, dontSelect); - this.$redoStack.push(deltaSet); - this.$syncRev(); - } - - this.$fromUndo = false; - - return undoSelectionRange; - }; - this.redo = function(session, dontSelect) { - this.lastDeltas = null; - - if (!session) - session = this.$session; - - this.$fromUndo = true; - if (this.$redoStackBaseRev != this.$rev) { - var diff = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1); - rebaseRedoStack(this.$redoStack, diff); - this.$redoStackBaseRev = this.$rev; - this.$redoStack.forEach(function(x) { - x[0].id = ++this.$maxRev; - }, this); - } - var deltaSet = this.$redoStack.pop(); - var redoSelectionRange = null; - - if (deltaSet) { - redoSelectionRange = session.redoChanges(deltaSet, dontSelect); - this.$undoStack.push(deltaSet); - this.$syncRev(); - } - this.$fromUndo = false; - - return redoSelectionRange; - }; - - this.$syncRev = function() { - var stack = this.$undoStack; - var nextDelta = stack[stack.length - 1]; - var id = nextDelta && nextDelta[0].id || 0; - this.$redoStackBaseRev = id; - this.$rev = id; - }; - this.reset = function() { - this.lastDeltas = null; - this.$lastDelta = null; - this.$undoStack = []; - this.$redoStack = []; - this.$rev = 0; - this.mark = 0; - this.$redoStackBaseRev = this.$rev; - this.selections = []; - }; - this.canUndo = function() { - return this.$undoStack.length > 0; - }; - this.canRedo = function() { - return this.$redoStack.length > 0; - }; - this.bookmark = function(rev) { - if (rev == undefined) - rev = this.$rev; - this.mark = rev; - }; - this.isAtBookmark = function() { - return this.$rev === this.mark; - }; - - this.toJSON = function() { - - }; - - this.fromJSON = function() { - - }; - - this.hasUndo = this.canUndo; - this.hasRedo = this.canRedo; - this.isClean = this.isAtBookmark; - this.markClean = this.bookmark; - - this.$prettyPrint = function(delta) { - if (delta) return stringifyDelta(delta); - return stringifyDelta(this.$undoStack) + "\n---\n" + stringifyDelta(this.$redoStack); - }; -}).call(UndoManager.prototype); - -function rearrangeUndoStack(stack, pos) { - for (var i = pos; i--; ) { - var deltaSet = stack[i]; - if (deltaSet && !deltaSet[0].ignore) { - while(i < pos - 1) { - var swapped = swapGroups(stack[i], stack[i + 1]); - stack[i] = swapped[0]; - stack[i + 1] = swapped[1]; - i++; - } - return true; - } - } -} - -var Range = require("./range").Range; -var cmp = Range.comparePoints; -var comparePoints = Range.comparePoints; - -function $updateMarkers(delta) { - var isInsert = delta.action == "insert"; - var start = delta.start; - var end = delta.end; - var rowShift = (end.row - start.row) * (isInsert ? 1 : -1); - var colShift = (end.column - start.column) * (isInsert ? 1 : -1); - if (isInsert) end = start; - - for (var i in this.marks) { - var point = this.marks[i]; - var cmp = comparePoints(point, start); - if (cmp < 0) { - continue; // delta starts after the range - } - if (cmp === 0) { - if (isInsert) { - if (point.bias == 1) { - cmp = 1; - } - else { - point.bias == -1; - continue; - } - } - } - var cmp2 = isInsert ? cmp : comparePoints(point, end); - if (cmp2 > 0) { - point.row += rowShift; - point.column += point.row == end.row ? colShift : 0; - continue; - } - if (!isInsert && cmp2 <= 0) { - point.row = start.row; - point.column = start.column; - if (cmp2 === 0) - point.bias = 1; - } - } -} - - - -function clonePos(pos) { - return {row: pos.row,column: pos.column}; -} -function cloneDelta(d) { - return { - start: clonePos(d.start), - end: clonePos(d.end), - action: d.action, - lines: d.lines.slice() - }; -} -function stringifyDelta(d) { - d = d || this; - if (Array.isArray(d)) { - return d.map(stringifyDelta).join("\n"); - } - var type = ""; - if (d.action) { - type = d.action == "insert" ? "+" : "-"; - type += "[" + d.lines + "]"; - } else if (d.value) { - if (Array.isArray(d.value)) { - type = d.value.map(stringifyRange).join("\n"); - } else { - type = stringifyRange(d.value); - } - } - if (d.start) { - type += stringifyRange(d); - } - if (d.id || d.rev) { - type += "\t(" + (d.id || d.rev) + ")"; - } - return type; -} -function stringifyRange(r) { - return r.start.row + ":" + r.start.column - + "=>" + r.end.row + ":" + r.end.column; -} - -function swap(d1, d2) { - var i1 = d1.action == "insert"; - var i2 = d2.action == "insert"; - - if (i1 && i2) { - if (cmp(d2.start, d1.end) >= 0) { - shift(d2, d1, -1); - } else if (cmp(d2.start, d1.start) <= 0) { - shift(d1, d2, +1); - } else { - return null; - } - } else if (i1 && !i2) { - if (cmp(d2.start, d1.end) >= 0) { - shift(d2, d1, -1); - } else if (cmp(d2.end, d1.start) <= 0) { - shift(d1, d2, -1); - } else { - return null; - } - } else if (!i1 && i2) { - if (cmp(d2.start, d1.start) >= 0) { - shift(d2, d1, +1); - } else if (cmp(d2.start, d1.start) <= 0) { - shift(d1, d2, +1); - } else { - return null; - } - } else if (!i1 && !i2) { - if (cmp(d2.start, d1.start) >= 0) { - shift(d2, d1, +1); - } else if (cmp(d2.end, d1.start) <= 0) { - shift(d1, d2, -1); - } else { - return null; - } - } - return [d2, d1]; -} -function swapGroups(ds1, ds2) { - for (var i = ds1.length; i--; ) { - for (var j = 0; j < ds2.length; j++) { - if (!swap(ds1[i], ds2[j])) { - while (i < ds1.length) { - while (j--) { - swap(ds2[j], ds1[i]); - } - j = ds2.length; - i++; + || self.searchBox && self.searchBox.isFocused())) { + var renderer = self.renderer; + var pos = renderer.$cursorLayer.$pixelPos; + var config = renderer.layerConfig; + var top = pos.top - config.offset; + if (pos.top >= 0 && top + rect.top < 0) { + shouldScroll = true; } - return [ds1, ds2]; + else if (pos.top < config.height && + pos.top + rect.top + config.lineHeight > window.innerHeight) { + shouldScroll = false; + } + else { + shouldScroll = null; + } + if (shouldScroll != null) { + scrollAnchor.style.top = top + "px"; + scrollAnchor.style.left = pos.left + "px"; + scrollAnchor.style.height = config.lineHeight + "px"; + scrollAnchor.scrollIntoView(shouldScroll); + } + shouldScroll = rect = null; } + }); + this.setAutoScrollEditorIntoView = function (enable) { + if (enable) + return; + delete this.setAutoScrollEditorIntoView; + this.off("changeSelection", onChangeSelection); + this.renderer.off("afterRender", onAfterRender); + this.renderer.off("beforeRender", onBeforeRender); + }; + }; + Editor.prototype.$resetCursorStyle = function () { + var style = this.$cursorStyle || "ace"; + var cursorLayer = this.renderer.$cursorLayer; + if (!cursorLayer) + return; + cursorLayer.setSmoothBlinking(/smooth/.test(style)); + cursorLayer.isBlinking = !this.$readOnly && style != "wide"; + dom.setCssClass(cursorLayer.element, "ace_slim-cursors", /slim/.test(style)); + }; + Editor.prototype.prompt = function (message, options, callback) { + var editor = this; + config.loadModule("ace/ext/prompt", function (module) { + module.prompt(editor, message, options, callback); + }); + }; + return Editor; +}()); +Editor.$uid = 0; +Editor.prototype.curOp = null; +Editor.prototype.prevOp = {}; +Editor.prototype.$mergeableCommands = ["backspace", "del", "insertstring"]; +Editor.prototype.$toggleWordPairs = [ + ["first", "last"], + ["true", "false"], + ["yes", "no"], + ["width", "height"], + ["top", "bottom"], + ["right", "left"], + ["on", "off"], + ["x", "y"], + ["get", "set"], + ["max", "min"], + ["horizontal", "vertical"], + ["show", "hide"], + ["add", "remove"], + ["up", "down"], + ["before", "after"], + ["even", "odd"], + ["in", "out"], + ["inside", "outside"], + ["next", "previous"], + ["increase", "decrease"], + ["attach", "detach"], + ["&&", "||"], + ["==", "!="] +]; +oop.implement(Editor.prototype, EventEmitter); +config.defineOptions(Editor.prototype, "editor", { + selectionStyle: { + set: function (style) { + this.onSelectionChange(); + this._signal("changeSelectionStyle", { data: style }); + }, + initialValue: "line" + }, + highlightActiveLine: { + set: function () { this.$updateHighlightActiveLine(); }, + initialValue: true + }, + highlightSelectedWord: { + set: function (shouldHighlight) { this.$onSelectionChange(); }, + initialValue: true + }, + readOnly: { + set: function (readOnly) { + this.textInput.setReadOnly(readOnly); + this.$resetCursorStyle(); + }, + initialValue: false + }, + copyWithEmptySelection: { + set: function (value) { + this.textInput.setCopyWithEmptySelection(value); + }, + initialValue: false + }, + cursorStyle: { + set: function (val) { this.$resetCursorStyle(); }, + values: ["ace", "slim", "smooth", "wide"], + initialValue: "ace" + }, + mergeUndoDeltas: { + values: [false, true, "always"], + initialValue: true + }, + behavioursEnabled: { initialValue: true }, + wrapBehavioursEnabled: { initialValue: true }, + enableAutoIndent: { initialValue: true }, + autoScrollEditorIntoView: { + set: function (val) { this.setAutoScrollEditorIntoView(val); } + }, + keyboardHandler: { + set: function (val) { this.setKeyboardHandler(val); }, + get: function () { return this.$keybindingId; }, + handlesSet: true + }, + value: { + set: function (val) { this.session.setValue(val); }, + get: function () { return this.getValue(); }, + handlesSet: true, + hidden: true + }, + session: { + set: function (val) { this.setSession(val); }, + get: function () { return this.session; }, + handlesSet: true, + hidden: true + }, + showLineNumbers: { + set: function (show) { + this.renderer.$gutterLayer.setShowLineNumbers(show); + this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER); + if (show && this.$relativeLineNumbers) + relativeNumberRenderer.attach(this); + else + relativeNumberRenderer.detach(this); + }, + initialValue: true + }, + relativeLineNumbers: { + set: function (value) { + if (this.$showLineNumbers && value) + relativeNumberRenderer.attach(this); + else + relativeNumberRenderer.detach(this); } - } - ds1.selectionBefore = ds2.selectionBefore = - ds1.selectionAfter = ds2.selectionAfter = null; - return [ds2, ds1]; -} -function xform(d1, c1) { - var i1 = d1.action == "insert"; - var i2 = c1.action == "insert"; - - if (i1 && i2) { - if (cmp(d1.start, c1.start) < 0) { - shift(c1, d1, 1); - } else { - shift(d1, c1, 1); - } - } else if (i1 && !i2) { - if (cmp(d1.start, c1.end) >= 0) { - shift(d1, c1, -1); - } else if (cmp(d1.start, c1.start) <= 0) { - shift(c1, d1, +1); - } else { - shift(d1, Range.fromPoints(c1.start, d1.start), -1); - shift(c1, d1, +1); - } - } else if (!i1 && i2) { - if (cmp(c1.start, d1.end) >= 0) { - shift(c1, d1, -1); - } else if (cmp(c1.start, d1.start) <= 0) { - shift(d1, c1, +1); - } else { - shift(c1, Range.fromPoints(d1.start, c1.start), -1); - shift(d1, c1, +1); - } - } else if (!i1 && !i2) { - if (cmp(c1.start, d1.end) >= 0) { - shift(c1, d1, -1); - } else if (cmp(c1.end, d1.start) <= 0) { - shift(d1, c1, -1); - } else { - var before, after; - if (cmp(d1.start, c1.start) < 0) { - before = d1; - d1 = splitDelta(d1, c1.start); - } - if (cmp(d1.end, c1.end) > 0) { - after = splitDelta(d1, c1.end); - } - - shiftPos(c1.end, d1.start, d1.end, -1); - if (after && !before) { - d1.lines = after.lines; - d1.start = after.start; - d1.end = after.end; - after = d1; + }, + placeholder: { + set: function (message) { + if (!this.$updatePlaceholder) { + this.$updatePlaceholder = function () { + var hasValue = this.session && (this.renderer.$composition || + this.session.getLength() > 1 || this.session.getLine(0).length > 0); + if (hasValue && this.renderer.placeholderNode) { + this.renderer.off("afterRender", this.$updatePlaceholder); + dom.removeCssClass(this.container, "ace_hasPlaceholder"); + this.renderer.placeholderNode.remove(); + this.renderer.placeholderNode = null; + } + else if (!hasValue && !this.renderer.placeholderNode) { + this.renderer.on("afterRender", this.$updatePlaceholder); + dom.addCssClass(this.container, "ace_hasPlaceholder"); + var el = dom.createElement("div"); + el.className = "ace_placeholder"; + el.textContent = this.$placeholder || ""; + this.renderer.placeholderNode = el; + this.renderer.content.appendChild(this.renderer.placeholderNode); + } + else if (!hasValue && this.renderer.placeholderNode) { + this.renderer.placeholderNode.textContent = this.$placeholder || ""; + } + }.bind(this); + this.on("input", this.$updatePlaceholder); } - - return [c1, before, after].filter(Boolean); + this.$updatePlaceholder(); } - } - return [c1, d1]; -} - -function shift(d1, d2, dir) { - shiftPos(d1.start, d2.start, d2.end, dir); - shiftPos(d1.end, d2.start, d2.end, dir); -} -function shiftPos(pos, start, end, dir) { - if (pos.row == (dir == 1 ? start : end).row) { - pos.column += dir * (end.column - start.column); - } - pos.row += dir * (end.row - start.row); -} -function splitDelta(c, pos) { - var lines = c.lines; - var end = c.end; - c.end = clonePos(pos); - var rowsBefore = c.end.row - c.start.row; - var otherLines = lines.splice(rowsBefore, lines.length); - - var col = rowsBefore ? pos.column : pos.column - c.start.column; - lines.push(otherLines[0].substring(0, col)); - otherLines[0] = otherLines[0].substr(col) ; - var rest = { - start: clonePos(pos), - end: end, - lines: otherLines, - action: c.action - }; - return rest; -} - -function moveDeltasByOne(redoStack, d) { - d = cloneDelta(d); - for (var j = redoStack.length; j--;) { - var deltaSet = redoStack[j]; - for (var i = 0; i < deltaSet.length; i++) { - var x = deltaSet[i]; - var xformed = xform(x, d); - d = xformed[0]; - if (xformed.length != 2) { - if (xformed[2]) { - deltaSet.splice(i + 1, 1, xformed[1], xformed[2]); - i++; - } else if (!xformed[1]) { - deltaSet.splice(i, 1); - i--; + }, + enableKeyboardAccessibility: { + set: function (value) { + var blurCommand = { + name: "blurTextInput", + description: "Set focus to the editor content div to allow tabbing through the page", + bindKey: "Esc", + exec: function (editor) { + editor.blur(); + editor.renderer.scroller.focus(); + }, + readOnly: true + }; + var focusOnEnterKeyup = function (e) { + if (e.target == this.renderer.scroller && e.keyCode === keys['enter']) { + e.preventDefault(); + var row = this.getCursorPosition().row; + if (!this.isRowVisible(row)) + this.scrollToLine(row, true, true); + this.focus(); } + }; + var gutterKeyboardHandler; + if (value) { + this.renderer.enableKeyboardAccessibility = true; + this.renderer.keyboardFocusClassName = "ace_keyboard-focus"; + this.textInput.getElement().setAttribute("tabindex", -1); + this.textInput.setNumberOfExtraLines(useragent.isWin ? 3 : 0); + this.renderer.scroller.setAttribute("tabindex", 0); + this.renderer.scroller.setAttribute("role", "group"); + this.renderer.scroller.setAttribute("aria-roledescription", nls("editor.scroller.aria-roledescription", "editor")); + this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName); + this.renderer.scroller.setAttribute("aria-label", nls("editor.scroller.aria-label", "Editor content, press Enter to start editing, press Escape to exit")); + this.renderer.scroller.addEventListener("keyup", focusOnEnterKeyup.bind(this)); + this.commands.addCommand(blurCommand); + this.renderer.$gutter.setAttribute("tabindex", 0); + this.renderer.$gutter.setAttribute("aria-hidden", false); + this.renderer.$gutter.setAttribute("role", "group"); + this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor.gutter.aria-roledescription", "editor")); + this.renderer.$gutter.setAttribute("aria-label", nls("editor.gutter.aria-label", "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")); + this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName); + this.renderer.content.setAttribute("aria-hidden", true); + if (!gutterKeyboardHandler) + gutterKeyboardHandler = new GutterKeyboardHandler(this); + gutterKeyboardHandler.addListener(); + this.textInput.setAriaOptions({ + setLabel: true + }); } - } - if (!deltaSet.length) { - redoStack.splice(j, 1); - } - } - return redoStack; -} -function rebaseRedoStack(redoStack, deltaSets) { - for (var i = 0; i < deltaSets.length; i++) { - var deltas = deltaSets[i]; - for (var j = 0; j < deltas.length; j++) { - moveDeltasByOne(redoStack, deltas[j]); - } + else { + this.renderer.enableKeyboardAccessibility = false; + this.textInput.getElement().setAttribute("tabindex", 0); + this.textInput.setNumberOfExtraLines(0); + this.renderer.scroller.setAttribute("tabindex", -1); + this.renderer.scroller.removeAttribute("role"); + this.renderer.scroller.removeAttribute("aria-roledescription"); + this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName); + this.renderer.scroller.removeAttribute("aria-label"); + this.renderer.scroller.removeEventListener("keyup", focusOnEnterKeyup.bind(this)); + this.commands.removeCommand(blurCommand); + this.renderer.content.removeAttribute("aria-hidden"); + this.renderer.$gutter.setAttribute("tabindex", -1); + this.renderer.$gutter.setAttribute("aria-hidden", true); + this.renderer.$gutter.removeAttribute("role"); + this.renderer.$gutter.removeAttribute("aria-roledescription"); + this.renderer.$gutter.removeAttribute("aria-label"); + this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName); + if (gutterKeyboardHandler) + gutterKeyboardHandler.removeListener(); + } + }, + initialValue: false + }, + textInputAriaLabel: { + set: function (val) { this.$textInputAriaLabel = val; }, + initialValue: "" + }, + enableMobileMenu: { + set: function (val) { this.$enableMobileMenu = val; }, + initialValue: true + }, + customScrollbar: "renderer", + hScrollBarAlwaysVisible: "renderer", + vScrollBarAlwaysVisible: "renderer", + highlightGutterLine: "renderer", + animatedScroll: "renderer", + showInvisibles: "renderer", + showPrintMargin: "renderer", + printMarginColumn: "renderer", + printMargin: "renderer", + fadeFoldWidgets: "renderer", + showFoldWidgets: "renderer", + displayIndentGuides: "renderer", + highlightIndentGuides: "renderer", + showGutter: "renderer", + fontSize: "renderer", + fontFamily: "renderer", + maxLines: "renderer", + minLines: "renderer", + scrollPastEnd: "renderer", + fixedWidthGutter: "renderer", + theme: "renderer", + hasCssTransforms: "renderer", + maxPixelHeight: "renderer", + useTextareaForIME: "renderer", + useResizeObserver: "renderer", + useSvgGutterIcons: "renderer", + showFoldedAnnotations: "renderer", + scrollSpeed: "$mouseHandler", + dragDelay: "$mouseHandler", + dragEnabled: "$mouseHandler", + focusTimeout: "$mouseHandler", + tooltipFollowsMouse: "$mouseHandler", + firstLineNumber: "session", + overwrite: "session", + newLineMode: "session", + useWorker: "session", + useSoftTabs: "session", + navigateWithinSoftTabs: "session", + tabSize: "session", + wrap: "session", + indentedSoftWrap: "session", + foldStyle: "session", + mode: "session" +}); +var relativeNumberRenderer = { + getText: function (/**@type{EditSession}*/ session, /**@type{number}*/ row) { + return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9 ? "\xb7" : ""))) + ""; + }, + getWidth: function (session, /**@type{number}*/ lastLineNumber, config) { + return Math.max(lastLineNumber.toString().length, (config.lastRow + 1).toString().length, 2) * config.characterWidth; + }, + update: function (e, /**@type{Editor}*/ editor) { + editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER); + }, + attach: function (/**@type{Editor}*/ editor) { + editor.renderer.$gutterLayer.$renderer = this; + editor.on("changeSelection", this.update); + this.update(null, editor); + }, + detach: function (/**@type{Editor}*/ editor) { + if (editor.renderer.$gutterLayer.$renderer == this) + editor.renderer.$gutterLayer.$renderer = null; + editor.off("changeSelection", this.update); + this.update(null, editor); } -} - -exports.UndoManager = UndoManager; +}; +exports.Editor = Editor; }); -ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"], function(require, exports, module) { -"use strict"; - +ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"], function(require, exports, module){"use strict"; var dom = require("../lib/dom"); - -var Lines = function(element, canvasHeight) { - this.element = element; - this.canvasHeight = canvasHeight || 500000; - this.element.style.height = (this.canvasHeight * 2) + "px"; - - this.cells = []; - this.cellCache = []; - this.$offsetCoefficient = 0; -}; - -(function() { - - this.moveContainer = function(config) { +var Lines = /** @class */ (function () { + function Lines(element, canvasHeight) { + this.element = element; + this.canvasHeight = canvasHeight || 500000; + this.element.style.height = (this.canvasHeight * 2) + "px"; + this.cells = []; + this.cellCache = []; + this.$offsetCoefficient = 0; + } + Lines.prototype.moveContainer = function (config) { dom.translate(this.element, 0, -((config.firstRowScreen * config.lineHeight) % this.canvasHeight) - config.offset * this.$offsetCoefficient); }; - - this.pageChanged = function(oldConfig, newConfig) { - return ( - Math.floor((oldConfig.firstRowScreen * oldConfig.lineHeight) / this.canvasHeight) !== - Math.floor((newConfig.firstRowScreen * newConfig.lineHeight) / this.canvasHeight) - ); + Lines.prototype.pageChanged = function (oldConfig, newConfig) { + return (Math.floor((oldConfig.firstRowScreen * oldConfig.lineHeight) / this.canvasHeight) !== + Math.floor((newConfig.firstRowScreen * newConfig.lineHeight) / this.canvasHeight)); }; - - this.computeLineTop = function(row, config, session) { + Lines.prototype.computeLineTop = function (row, config, session) { var screenTop = config.firstRowScreen * config.lineHeight; var screenPage = Math.floor(screenTop / this.canvasHeight); var lineTop = session.documentToScreenRow(row, 0) * config.lineHeight; return lineTop - (screenPage * this.canvasHeight); }; - - this.computeLineHeight = function(row, config, session) { + Lines.prototype.computeLineHeight = function (row, config, session) { return config.lineHeight * session.getRowLineCount(row); }; - - this.getLength = function() { + Lines.prototype.getLength = function () { return this.cells.length; }; - - this.get = function(index) { + Lines.prototype.get = function (index) { return this.cells[index]; }; - - this.shift = function() { + Lines.prototype.shift = function () { this.$cacheCell(this.cells.shift()); }; - - this.pop = function() { + Lines.prototype.pop = function () { this.$cacheCell(this.cells.pop()); }; - - this.push = function(cell) { + Lines.prototype.push = function (cell) { if (Array.isArray(cell)) { this.cells.push.apply(this.cells, cell); var fragment = dom.createFragment(this.element); - for (var i=0; i foldStart) { row = fold.end.row + 1; @@ -34110,68 +33858,53 @@ var Gutter = function(parentEl) { if (row > lastRow) { while (this.$lines.getLength() > index + 1) this.$lines.pop(); - break; } - cell = this.$lines.get(++index); if (cell) { cell.row = row; - } else { + } + else { cell = this.$lines.createCell(row, config, this.session, onCreateCell); this.$lines.push(cell); } - this.$renderCell(cell, config, fold, row); row++; } - this._signal("afterRender"); this.$updateGutterWidth(config); }; - - this.$updateGutterWidth = function(config) { + Gutter.prototype.$updateGutterWidth = function (config) { var session = this.session; - var gutterRenderer = session.gutterRenderer || this.$renderer; - var firstLineNumber = session.$firstLineNumber; var lastLineText = this.$lines.last() ? this.$lines.last().text : ""; - if (this.$fixedWidth || session.$useWrapMode) lastLineText = session.getLength() + firstLineNumber - 1; - var gutterWidth = gutterRenderer ? gutterRenderer.getWidth(session, lastLineText, config) : lastLineText.toString().length * config.characterWidth; - var padding = this.$padding || this.$computePadding(); gutterWidth += padding.left + padding.right; if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) { - this.gutterWidth = gutterWidth; - this.element.parentNode.style.width = - this.element.style.width = Math.ceil(this.gutterWidth) + "px"; + this.gutterWidth = gutterWidth; (this.element.parentNode).style.width = + this.element.style.width = Math.ceil(this.gutterWidth) + "px"; this._signal("changeGutterWidth", gutterWidth); } }; - - this.$updateCursorRow = function() { + Gutter.prototype.$updateCursorRow = function () { if (!this.$highlightGutterLine) return; - var position = this.session.selection.getCursor(); if (this.$cursorRow === position.row) return; - this.$cursorRow = position.row; }; - - this.updateLineHighlight = function() { + Gutter.prototype.updateLineHighlight = function () { if (!this.$highlightGutterLine) return; var row = this.session.selection.cursor.row; this.$cursorRow = row; - if (this.$cursorCell && this.$cursorCell.row == row) return; if (this.$cursorCell) @@ -34194,93 +33927,78 @@ var Gutter = function(parentEl) { } } }; - - this.scrollLines = function(config) { + Gutter.prototype.scrollLines = function (config) { var oldConfig = this.config; this.config = config; - this.$updateCursorRow(); if (this.$lines.pageChanged(oldConfig, config)) return this.update(config); - this.$lines.moveContainer(config); - - var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar - this.session.getLength() - 1); + var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar + this.session.getLength() - 1); var oldLastRow = this.oldLastRow; this.oldLastRow = lastRow; - if (!oldConfig || oldLastRow < config.firstRow) return this.update(config); - if (lastRow < oldConfig.firstRow) return this.update(config); - if (oldConfig.firstRow < config.firstRow) - for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--) + for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row > 0; row--) this.$lines.shift(); - if (oldLastRow > lastRow) - for (var row=this.session.getFoldedRowCount(lastRow + 1, oldLastRow); row>0; row--) + for (var row = this.session.getFoldedRowCount(lastRow + 1, oldLastRow); row > 0; row--) this.$lines.pop(); - if (config.firstRow < oldConfig.firstRow) { this.$lines.unshift(this.$renderLines(config, config.firstRow, oldConfig.firstRow - 1)); } - if (lastRow > oldLastRow) { this.$lines.push(this.$renderLines(config, oldLastRow + 1, lastRow)); } - this.updateLineHighlight(); - this._signal("afterRender"); this.$updateGutterWidth(config); }; - - this.$renderLines = function(config, firstRow, lastRow) { + Gutter.prototype.$renderLines = function (config, firstRow, lastRow) { var fragment = []; var row = firstRow; var foldLine = this.session.getNextFoldLine(row); var foldStart = foldLine ? foldLine.start.row : Infinity; - while (true) { if (row > foldStart) { - row = foldLine.end.row+1; + row = foldLine.end.row + 1; foldLine = this.session.getNextFoldLine(row, foldLine); foldStart = foldLine ? foldLine.start.row : Infinity; } if (row > lastRow) break; - var cell = this.$lines.createCell(row, config, this.session, onCreateCell); this.$renderCell(cell, config, foldLine, row); fragment.push(cell); - row++; } return fragment; }; - - this.$renderCell = function(cell, config, fold, row) { + Gutter.prototype.$renderCell = function (cell, config, fold, row) { var element = cell.element; - var session = this.session; - var textNode = element.childNodes[0]; var foldWidget = element.childNodes[1]; - + var annotationNode = element.childNodes[2]; + var annotationIconNode = annotationNode.firstChild; var firstLineNumber = session.$firstLineNumber; - var breakpoints = session.$breakpoints; var decorations = session.$decorations; var gutterRenderer = session.gutterRenderer || this.$renderer; var foldWidgets = this.$showFoldWidgets && session.foldWidgets; var foldStart = fold ? fold.start.row : Number.MAX_VALUE; - - var className = "ace_gutter-cell "; + var lineHeight = config.lineHeight + "px"; + var className = this.$useSvgGutterIcons ? "ace_gutter-cell_svg-icons " : "ace_gutter-cell "; + var iconClassName = this.$useSvgGutterIcons ? "ace_icon_svg" : "ace_icon"; + var rowText = (gutterRenderer + ? gutterRenderer.getText(session, row) + : row + firstLineNumber).toString(); if (this.$highlightGutterLine) { - if (row == this.$cursorRow || (fold && row < this.$cursorRow && row >= foldStart && this.$cursorRow <= fold.end.row)) { + if (row == this.$cursorRow || (fold && row < this.$cursorRow && row >= foldStart && this.$cursorRow <= fold.end.row)) { className += "ace_gutter-active-line "; if (this.$cursorCell != cell) { if (this.$cursorCell) @@ -34289,95 +34007,186 @@ var Gutter = function(parentEl) { } } } - if (breakpoints[row]) className += breakpoints[row]; if (decorations[row]) className += decorations[row]; - if (this.$annotations[row]) + if (this.$annotations[row] && row !== foldStart) className += this.$annotations[row].className; - if (element.className != className) - element.className = className; - if (foldWidgets) { var c = foldWidgets[row]; if (c == null) c = foldWidgets[row] = session.getFoldWidget(row); } - if (c) { - var className = "ace_fold-widget ace_" + c; - if (c == "start" && row == foldStart && row < fold.end.row) - className += " ace_closed"; + var foldClass = "ace_fold-widget ace_" + c; + var isClosedFold = c == "start" && row == foldStart && row < fold.end.row; + if (isClosedFold) { + foldClass += " ace_closed"; + var foldAnnotationClass = ""; + var annotationInFold = false; + for (var i = row + 1; i <= fold.end.row; i++) { + if (!this.$annotations[i]) + continue; + if (this.$annotations[i].className === " ace_error") { + annotationInFold = true; + foldAnnotationClass = " ace_error_fold"; + break; + } + if (this.$annotations[i].className === " ace_security") { + annotationInFold = true; + foldAnnotationClass = " ace_security_fold"; + } + else if (this.$annotations[i].className === " ace_warning" && + foldAnnotationClass !== " ace_security_fold") { + annotationInFold = true; + foldAnnotationClass = " ace_warning_fold"; + } + } + className += foldAnnotationClass; + } else - className += " ace_open"; - if (foldWidget.className != className) - foldWidget.className = className; - - var foldHeight = config.lineHeight + "px"; - dom.setStyle(foldWidget.style, "height", foldHeight); + foldClass += " ace_open"; + if (foldWidget.className != foldClass) + foldWidget.className = foldClass; + dom.setStyle(foldWidget.style, "height", lineHeight); dom.setStyle(foldWidget.style, "display", "inline-block"); - } else { + foldWidget.setAttribute("role", "button"); + foldWidget.setAttribute("tabindex", "-1"); + var foldRange = session.getFoldWidgetRange(row); + if (foldRange) + foldWidget.setAttribute("aria-label", nls("gutter.code-folding.range.aria-label", "Toggle code folding, rows $0 through $1", [ + foldRange.start.row + 1, + foldRange.end.row + 1 + ])); + else { + if (fold) + foldWidget.setAttribute("aria-label", nls("gutter.code-folding.closed.aria-label", "Toggle code folding, rows $0 through $1", [ + fold.start.row + 1, + fold.end.row + 1 + ])); + else + foldWidget.setAttribute("aria-label", nls("gutter.code-folding.open.aria-label", "Toggle code folding, row $0", [row + 1])); + } + if (isClosedFold) { + foldWidget.setAttribute("aria-expanded", "false"); + foldWidget.setAttribute("title", nls("gutter.code-folding.closed.title", "Unfold code")); + } + else { + foldWidget.setAttribute("aria-expanded", "true"); + foldWidget.setAttribute("title", nls("gutter.code-folding.open.title", "Fold code")); + } + } + else { if (foldWidget) { dom.setStyle(foldWidget.style, "display", "none"); + foldWidget.setAttribute("tabindex", "0"); + foldWidget.removeAttribute("role"); + foldWidget.removeAttribute("aria-label"); + } + } + if (annotationInFold && this.$showFoldedAnnotations) { + annotationNode.className = "ace_gutter_annotation"; + annotationIconNode.className = iconClassName; + annotationIconNode.className += foldAnnotationClass; + dom.setStyle(annotationIconNode.style, "height", lineHeight); + dom.setStyle(annotationNode.style, "display", "block"); + dom.setStyle(annotationNode.style, "height", lineHeight); + var ariaLabel; + switch (foldAnnotationClass) { + case " ace_error_fold": + ariaLabel = nls("gutter.annotation.aria-label.error", "Error, read annotations row $0", [rowText]); + break; + case " ace_security_fold": + ariaLabel = nls("gutter.annotation.aria-label.security", "Security finding, read annotations row $0", [rowText]); + break; + case " ace_warning_fold": + ariaLabel = nls("gutter.annotation.aria-label.warning", "Warning, read annotations row $0", [rowText]); + break; } + annotationNode.setAttribute("aria-label", ariaLabel); + annotationNode.setAttribute("tabindex", "-1"); + annotationNode.setAttribute("role", "button"); } - - var text = (gutterRenderer - ? gutterRenderer.getText(session, row) - : row + firstLineNumber).toString(); - - if (text !== textNode.data) { - textNode.data = text; + else if (this.$annotations[row]) { + annotationNode.className = "ace_gutter_annotation"; + annotationIconNode.className = iconClassName; + if (this.$useSvgGutterIcons) + annotationIconNode.className += this.$annotations[row].className; + else + element.classList.add(this.$annotations[row].className.replace(" ", "")); + dom.setStyle(annotationIconNode.style, "height", lineHeight); + dom.setStyle(annotationNode.style, "display", "block"); + dom.setStyle(annotationNode.style, "height", lineHeight); + var ariaLabel; + switch (this.$annotations[row].className) { + case " ace_error": + ariaLabel = nls("gutter.annotation.aria-label.error", "Error, read annotations row $0", [rowText]); + break; + case " ace_security": + ariaLabel = nls("gutter.annotation.aria-label.security", "Security finding, read annotations row $0", [rowText]); + break; + case " ace_warning": + ariaLabel = nls("gutter.annotation.aria-label.warning", "Warning, read annotations row $0", [rowText]); + break; + case " ace_info": + ariaLabel = nls("gutter.annotation.aria-label.info", "Info, read annotations row $0", [rowText]); + break; + case " ace_hint": + ariaLabel = nls("gutter.annotation.aria-label.hint", "Suggestion, read annotations row $0", [rowText]); + break; + } + annotationNode.setAttribute("aria-label", ariaLabel); + annotationNode.setAttribute("tabindex", "-1"); + annotationNode.setAttribute("role", "button"); } - + else { + dom.setStyle(annotationNode.style, "display", "none"); + annotationNode.removeAttribute("aria-label"); + annotationNode.removeAttribute("role"); + annotationNode.setAttribute("tabindex", "0"); + } + if (rowText !== textNode.data) { + textNode.data = rowText; + } + if (element.className != className) + element.className = className; dom.setStyle(cell.element.style, "height", this.$lines.computeLineHeight(row, config, session) + "px"); dom.setStyle(cell.element.style, "top", this.$lines.computeLineTop(row, config, session) + "px"); - - cell.text = text; + cell.text = rowText; + if (annotationNode.style.display === "none" && foldWidget.style.display === "none") + cell.element.setAttribute("aria-hidden", true); + else + cell.element.setAttribute("aria-hidden", false); return cell; }; - - this.$fixedWidth = false; - - this.$highlightGutterLine = true; - this.$renderer = ""; - this.setHighlightGutterLine = function(highlightGutterLine) { + Gutter.prototype.setHighlightGutterLine = function (highlightGutterLine) { this.$highlightGutterLine = highlightGutterLine; }; - - this.$showLineNumbers = true; - this.$renderer = ""; - this.setShowLineNumbers = function(show) { + Gutter.prototype.setShowLineNumbers = function (show) { this.$renderer = !show && { - getWidth: function() {return 0;}, - getText: function() {return "";} + getWidth: function () { return 0; }, + getText: function () { return ""; } }; }; - - this.getShowLineNumbers = function() { + Gutter.prototype.getShowLineNumbers = function () { return this.$showLineNumbers; }; - - this.$showFoldWidgets = true; - this.setShowFoldWidgets = function(show) { + Gutter.prototype.setShowFoldWidgets = function (show) { if (show) dom.addCssClass(this.element, "ace_folding-enabled"); else dom.removeCssClass(this.element, "ace_folding-enabled"); - this.$showFoldWidgets = show; this.$padding = null; }; - - this.getShowFoldWidgets = function() { + Gutter.prototype.getShowFoldWidgets = function () { return this.$showFoldWidgets; }; - - this.$computePadding = function() { + Gutter.prototype.$computePadding = function () { if (!this.element.firstChild) - return {left: 0, right: 0}; - var style = dom.computedStyle(this.element.firstChild); + return { left: 0, right: 0 }; + var style = dom.computedStyle(/**@type{Element}*/ (this.element.firstChild)); this.$padding = {}; this.$padding.left = (parseInt(style.borderLeftWidth) || 0) + (parseInt(style.paddingLeft) || 0) + 1; @@ -34385,8 +34194,7 @@ var Gutter = function(parentEl) { + (parseInt(style.paddingRight) || 0); return this.$padding; }; - - this.getRegion = function(point) { + Gutter.prototype.getRegion = function (point) { var padding = this.$padding || this.$computePadding(); var rect = this.element.getBoundingClientRect(); if (point.x < padding.left + rect.left) @@ -34394,113 +34202,106 @@ var Gutter = function(parentEl) { if (this.$showFoldWidgets && point.x > rect.right - padding.right) return "foldWidgets"; }; - -}).call(Gutter.prototype); - + return Gutter; +}()); +Gutter.prototype.$fixedWidth = false; +Gutter.prototype.$highlightGutterLine = true; +Gutter.prototype.$renderer = ""; +Gutter.prototype.$showLineNumbers = true; +Gutter.prototype.$showFoldWidgets = true; +oop.implement(Gutter.prototype, EventEmitter); function onCreateCell(element) { var textNode = document.createTextNode(''); element.appendChild(textNode); - var foldWidget = dom.createElement("span"); element.appendChild(foldWidget); - + var annotationNode = dom.createElement("span"); + element.appendChild(annotationNode); + var annotationIconNode = dom.createElement("span"); + annotationNode.appendChild(annotationIconNode); return element; } - exports.Gutter = Gutter; }); -ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"], function(require, exports, module) { -"use strict"; - +ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"], function(require, exports, module){"use strict"; var Range = require("../range").Range; var dom = require("../lib/dom"); - -var Marker = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_marker-layer"; - parentEl.appendChild(this.element); -}; - -(function() { - - this.$padding = 0; - - this.setPadding = function(padding) { +var Marker = /** @class */ (function () { + function Marker(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_marker-layer"; + parentEl.appendChild(this.element); + } + Marker.prototype.setPadding = function (padding) { this.$padding = padding; }; - this.setSession = function(session) { + Marker.prototype.setSession = function (session) { this.session = session; }; - - this.setMarkers = function(markers) { + Marker.prototype.setMarkers = function (markers) { this.markers = markers; }; - - this.elt = function(className, css) { + Marker.prototype.elt = function (className, css) { var x = this.i != -1 && this.element.childNodes[this.i]; if (!x) { x = document.createElement("div"); this.element.appendChild(x); this.i = -1; - } else { + } + else { this.i++; } x.style.cssText = css; x.className = className; }; - - this.update = function(config) { - if (!config) return; - + Marker.prototype.update = function (config) { + if (!config) + return; this.config = config; - this.i = 0; var html; for (var key in this.markers) { var marker = this.markers[key]; - if (!marker.range) { marker.update(html, this, this.session, config); continue; } - var range = marker.range.clipRows(config.firstRow, config.lastRow); - if (range.isEmpty()) continue; - + if (range.isEmpty()) + continue; range = range.toScreenRange(this.session); if (marker.renderer) { var top = this.$getTop(range.start.row, config); var left = this.$padding + range.start.column * config.characterWidth; marker.renderer(html, range, left, top, config); - } else if (marker.type == "fullLine") { + } + else if (marker.type == "fullLine") { this.drawFullLineMarker(html, range, marker.clazz, config); - } else if (marker.type == "screenLine") { + } + else if (marker.type == "screenLine") { this.drawScreenLineMarker(html, range, marker.clazz, config); - } else if (range.isMultiLine()) { + } + else if (range.isMultiLine()) { if (marker.type == "text") this.drawTextMarker(html, range, marker.clazz, config); else this.drawMultiLineMarker(html, range, marker.clazz, config); - } else { + } + else { this.drawSingleLineMarker(html, range, marker.clazz + " ace_start" + " ace_br15", config); } } - if (this.i !=-1) { + if (this.i != -1) { while (this.i < this.element.childElementCount) this.element.removeChild(this.element.lastChild); } }; - - this.$getTop = function(row, layerConfig) { + Marker.prototype.$getTop = function (row, layerConfig) { return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; }; - - function getBorderClass(tl, tr, br, bl) { - return (tl ? 1 : 0) | (tr ? 2 : 0) | (br ? 4 : 0) | (bl ? 8 : 0); - } - this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig, extraStyle) { + Marker.prototype.drawTextMarker = function (stringBuilder, range, clazz, layerConfig, extraStyle) { var session = this.session; var start = range.start.row; var end = range.end.row; @@ -34516,158 +34317,123 @@ var Marker = function(parentEl) { prev = curr; curr = next; next = row + 1 < end ? session.getScreenLastRowColumn(row + 1) : row == end ? 0 : range.end.column; - this.drawSingleLineMarker(stringBuilder, lineRange, - clazz + (row == start ? " ace_start" : "") + " ace_br" - + getBorderClass(row == start || row == start + 1 && range.start.column, prev < curr, curr > next, row == end), - layerConfig, row == end ? 0 : 1, extraStyle); + this.drawSingleLineMarker(stringBuilder, lineRange, clazz + (row == start ? " ace_start" : "") + " ace_br" + + getBorderClass(row == start || row == start + 1 && range.start.column, prev < curr, curr > next, row == end), layerConfig, row == end ? 0 : 1, extraStyle); } }; - this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + Marker.prototype.drawMultiLineMarker = function (stringBuilder, range, clazz, config, extraStyle) { var padding = this.$padding; var height = config.lineHeight; var top = this.$getTop(range.start.row, config); var left = padding + range.start.column * config.characterWidth; extraStyle = extraStyle || ""; - if (this.session.$bidiHandler.isBidiRow(range.start.row)) { - var range1 = range.clone(); - range1.end.row = range1.start.row; - range1.end.column = this.session.getLine(range1.start.row).length; - this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + " ace_br1 ace_start", config, null, extraStyle); - } else { - this.elt( - clazz + " ace_br1 ace_start", - "height:"+ height+ "px;"+ "right:0;"+ "top:"+top+ "px;left:"+ left+ "px;" + (extraStyle || "") - ); + var range1 = range.clone(); + range1.end.row = range1.start.row; + range1.end.column = this.session.getLine(range1.start.row).length; + this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + " ace_br1 ace_start", config, null, extraStyle); + } + else { + this.elt(clazz + " ace_br1 ace_start", "height:" + height + "px;" + "right:" + padding + "px;" + "top:" + top + "px;left:" + left + "px;" + (extraStyle || "")); } if (this.session.$bidiHandler.isBidiRow(range.end.row)) { - var range1 = range.clone(); - range1.start.row = range1.end.row; - range1.start.column = 0; - this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + " ace_br12", config, null, extraStyle); - } else { + var range1 = range.clone(); + range1.start.row = range1.end.row; + range1.start.column = 0; + this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + " ace_br12", config, null, extraStyle); + } + else { top = this.$getTop(range.end.row, config); var width = range.end.column * config.characterWidth; - - this.elt( - clazz + " ace_br12", - "height:"+ height+ "px;"+ - "width:"+ width+ "px;"+ - "top:"+ top+ "px;"+ - "left:"+ padding+ "px;"+ (extraStyle || "") - ); + this.elt(clazz + " ace_br12", "height:" + height + "px;" + + "width:" + width + "px;" + + "top:" + top + "px;" + + "left:" + padding + "px;" + (extraStyle || "")); } height = (range.end.row - range.start.row - 1) * config.lineHeight; if (height <= 0) return; top = this.$getTop(range.start.row + 1, config); - var radiusClass = (range.start.column ? 1 : 0) | (range.end.column ? 0 : 8); - - this.elt( - clazz + (radiusClass ? " ace_br" + radiusClass : ""), - "height:"+ height+ "px;"+ - "right:0;"+ - "top:"+ top+ "px;"+ - "left:"+ padding+ "px;"+ (extraStyle || "") - ); + this.elt(clazz + (radiusClass ? " ace_br" + radiusClass : ""), "height:" + height + "px;" + + "right:" + padding + "px;" + + "top:" + top + "px;" + + "left:" + padding + "px;" + (extraStyle || "")); }; - this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) { + Marker.prototype.drawSingleLineMarker = function (stringBuilder, range, clazz, config, extraLength, extraStyle) { if (this.session.$bidiHandler.isBidiRow(range.start.row)) return this.drawBidiSingleLineMarker(stringBuilder, range, clazz, config, extraLength, extraStyle); var height = config.lineHeight; var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth; - var top = this.$getTop(range.start.row, config); var left = this.$padding + range.start.column * config.characterWidth; - - this.elt( - clazz, - "height:"+ height+ "px;"+ - "width:"+ width+ "px;"+ - "top:"+ top+ "px;"+ - "left:"+ left+ "px;"+ (extraStyle || "") - ); + this.elt(clazz, "height:" + height + "px;" + + "width:" + width + "px;" + + "top:" + top + "px;" + + "left:" + left + "px;" + (extraStyle || "")); }; - this.drawBidiSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) { + Marker.prototype.drawBidiSingleLineMarker = function (stringBuilder, range, clazz, config, extraLength, extraStyle) { var height = config.lineHeight, top = this.$getTop(range.start.row, config), padding = this.$padding; var selections = this.session.$bidiHandler.getSelections(range.start.column, range.end.column); - - selections.forEach(function(selection) { - this.elt( - clazz, - "height:" + height + "px;" + - "width:" + selection.width + (extraLength || 0) + "px;" + + selections.forEach(function (selection) { + this.elt(clazz, "height:" + height + "px;" + + "width:" + (selection.width + (extraLength || 0)) + "px;" + "top:" + top + "px;" + - "left:" + (padding + selection.left) + "px;" + (extraStyle || "") - ); + "left:" + (padding + selection.left) + "px;" + (extraStyle || "")); }, this); }; - - this.drawFullLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + Marker.prototype.drawFullLineMarker = function (stringBuilder, range, clazz, config, extraStyle) { var top = this.$getTop(range.start.row, config); var height = config.lineHeight; if (range.start.row != range.end.row) height += this.$getTop(range.end.row, config) - top; - - this.elt( - clazz, - "height:"+ height+ "px;"+ - "top:"+ top+ "px;"+ - "left:0;right:0;"+ (extraStyle || "") - ); + this.elt(clazz, "height:" + height + "px;" + + "top:" + top + "px;" + + "left:0;right:0;" + (extraStyle || "")); }; - - this.drawScreenLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + Marker.prototype.drawScreenLineMarker = function (stringBuilder, range, clazz, config, extraStyle) { var top = this.$getTop(range.start.row, config); var height = config.lineHeight; - - this.elt( - clazz, - "height:"+ height+ "px;"+ - "top:"+ top+ "px;"+ - "left:0;right:0;"+ (extraStyle || "") - ); + this.elt(clazz, "height:" + height + "px;" + + "top:" + top + "px;" + + "left:0;right:0;" + (extraStyle || "")); }; - -}).call(Marker.prototype); - + return Marker; +}()); +Marker.prototype.$padding = 0; +function getBorderClass(tl, tr, br, bl) { + return (tl ? 1 : 0) | (tr ? 2 : 0) | (br ? 4 : 0) | (bl ? 8 : 0); +} exports.Marker = Marker; }); -ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"], function(require, exports, module) { -"use strict"; +ace.define("ace/layer/text_util",["require","exports","module"], function(require, exports, module){// Tokens for which Ace just uses a simple TextNode and does not add any special className. +var textTokens = new Set(["text", "rparen", "lparen"]); +exports.isTextToken = function (tokenType) { + return textTokens.has(tokenType); +}; +}); + +ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"], function(require, exports, module){"use strict"; var oop = require("../lib/oop"); var dom = require("../lib/dom"); var lang = require("../lib/lang"); var Lines = require("./lines").Lines; var EventEmitter = require("../lib/event_emitter").EventEmitter; - -var Text = function(parentEl) { - this.dom = dom; - this.element = this.dom.createElement("div"); - this.element.className = "ace_layer ace_text-layer"; - parentEl.appendChild(this.element); - this.$updateEolChar = this.$updateEolChar.bind(this); - this.$lines = new Lines(this.element); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.EOF_CHAR = "\xB6"; - this.EOL_CHAR_LF = "\xAC"; - this.EOL_CHAR_CRLF = "\xa4"; - this.EOL_CHAR = this.EOL_CHAR_LF; - this.TAB_CHAR = "\u2014"; //"\u21E5"; - this.SPACE_CHAR = "\xB7"; - this.$padding = 0; - this.MAX_LINE_LENGTH = 10000; - - this.$updateEolChar = function() { +var nls = require("../config").nls; +var isTextToken = require("./text_util").isTextToken; +var Text = /** @class */ (function () { + function Text(parentEl) { + this.dom = dom; + this.element = this.dom.createElement("div"); + this.element.className = "ace_layer ace_text-layer"; + parentEl.appendChild(this.element); + this.$updateEolChar = this.$updateEolChar.bind(this); + this.$lines = new Lines(this.element); + } + Text.prototype.$updateEolChar = function () { var doc = this.session.doc; var unixMode = doc.getNewLineCharacter() == "\n" && doc.getNewLineMode() != "windows"; var EOL_CHAR = unixMode ? this.EOL_CHAR_LF : this.EOL_CHAR_CRLF; @@ -34676,162 +34442,138 @@ var Text = function(parentEl) { return true; } }; - - this.setPadding = function(padding) { + Text.prototype.setPadding = function (padding) { this.$padding = padding; this.element.style.margin = "0 " + padding + "px"; }; - - this.getLineHeight = function() { + Text.prototype.getLineHeight = function () { return this.$fontMetrics.$characterSize.height || 0; }; - - this.getCharacterWidth = function() { + Text.prototype.getCharacterWidth = function () { return this.$fontMetrics.$characterSize.width || 0; }; - - this.$setFontMetrics = function(measure) { + Text.prototype.$setFontMetrics = function (measure) { this.$fontMetrics = measure; - this.$fontMetrics.on("changeCharacterSize", function(e) { + this.$fontMetrics.on("changeCharacterSize", + function (e) { this._signal("changeCharacterSize", e); }.bind(this)); this.$pollSizeChanges(); }; - - this.checkForSizeChanges = function() { + Text.prototype.checkForSizeChanges = function () { this.$fontMetrics.checkForSizeChanges(); }; - this.$pollSizeChanges = function() { + Text.prototype.$pollSizeChanges = function () { return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges(); }; - this.setSession = function(session) { + Text.prototype.setSession = function (session) { this.session = session; if (session) this.$computeTabString(); }; - - this.showInvisibles = false; - this.showSpaces = false; - this.showTabs = false; - this.showEOL = false; - this.setShowInvisibles = function(showInvisibles) { + Text.prototype.setShowInvisibles = function (showInvisibles) { if (this.showInvisibles == showInvisibles) return false; - this.showInvisibles = showInvisibles; if (typeof showInvisibles == "string") { this.showSpaces = /tab/i.test(showInvisibles); this.showTabs = /space/i.test(showInvisibles); this.showEOL = /eol/i.test(showInvisibles); - } else { + } + else { this.showSpaces = this.showTabs = this.showEOL = showInvisibles; } this.$computeTabString(); return true; }; - - this.displayIndentGuides = true; - this.setDisplayIndentGuides = function(display) { + Text.prototype.setDisplayIndentGuides = function (display) { if (this.displayIndentGuides == display) return false; - this.displayIndentGuides = display; this.$computeTabString(); return true; }; - - this.$tabStrings = []; - this.onChangeTabSize = - this.$computeTabString = function() { + Text.prototype.setHighlightIndentGuides = function (highlight) { + if (this.$highlightIndentGuides === highlight) + return false; + this.$highlightIndentGuides = highlight; + return highlight; + }; + Text.prototype.$computeTabString = function () { var tabSize = this.session.getTabSize(); - this.tabSize = tabSize; - var tabStr = this.$tabStrings = [0]; + this.tabSize = tabSize; var tabStr = this.$tabStrings = [0]; for (var i = 1; i < tabSize + 1; i++) { if (this.showTabs) { var span = this.dom.createElement("span"); span.className = "ace_invisible ace_invisible_tab"; span.textContent = lang.stringRepeat(this.TAB_CHAR, i); tabStr.push(span); - } else { + } + else { tabStr.push(this.dom.createTextNode(lang.stringRepeat(" ", i), this.element)); } } if (this.displayIndentGuides) { - this.$indentGuideRe = /\s\S| \t|\t |\s$/; + this.$indentGuideRe = /\s\S| \t|\t |\s$/; var className = "ace_indent-guide"; var spaceClass = this.showSpaces ? " ace_invisible ace_invisible_space" : ""; var spaceContent = this.showSpaces ? lang.stringRepeat(this.SPACE_CHAR, this.tabSize) : lang.stringRepeat(" ", this.tabSize); - var tabClass = this.showTabs ? " ace_invisible ace_invisible_tab" : ""; var tabContent = this.showTabs ? lang.stringRepeat(this.TAB_CHAR, this.tabSize) : spaceContent; - var span = this.dom.createElement("span"); span.className = className + spaceClass; span.textContent = spaceContent; this.$tabStrings[" "] = span; - var span = this.dom.createElement("span"); span.className = className + tabClass; span.textContent = tabContent; this.$tabStrings["\t"] = span; } }; - - this.updateLines = function(config, firstRow, lastRow) { + Text.prototype.updateLines = function (config, firstRow, lastRow) { if (this.config.lastRow != config.lastRow || this.config.firstRow != config.firstRow) { return this.update(config); } - this.config = config; - var first = Math.max(firstRow, config.firstRow); var last = Math.min(lastRow, config.lastRow); - var lineElements = this.element.childNodes; var lineElementsIdx = 0; - for (var row = config.firstRow; row < first; row++) { var foldLine = this.session.getFoldLine(row); if (foldLine) { if (foldLine.containsRow(first)) { first = foldLine.start.row; break; - } else { + } + else { row = foldLine.end.row; } } - lineElementsIdx ++; + lineElementsIdx++; } - var heightChanged = false; var row = first; var foldLine = this.session.getNextFoldLine(row); var foldStart = foldLine ? foldLine.start.row : Infinity; - while (true) { if (row > foldStart) { - row = foldLine.end.row+1; + row = foldLine.end.row + 1; foldLine = this.session.getNextFoldLine(row, foldLine); - foldStart = foldLine ? foldLine.start.row :Infinity; + foldStart = foldLine ? foldLine.start.row : Infinity; } if (row > last) - break; - - var lineElement = lineElements[lineElementsIdx++]; + break; var lineElement = lineElements[lineElementsIdx++]; if (lineElement) { this.dom.removeChildren(lineElement); - this.$renderLine( - lineElement, row, row == foldStart ? foldLine : false - ); - + this.$renderLine(lineElement, row, row == foldStart ? foldLine : false); if (heightChanged) lineElement.style.top = this.$lines.computeLineTop(row, config, this.session) + "px"; - var height = (config.lineHeight * this.session.getRowLength(row)) + "px"; if (lineElement.style.height != height) { heightChanged = true; @@ -34847,110 +34589,80 @@ var Text = function(parentEl) { } } }; - - this.scrollLines = function(config) { + Text.prototype.scrollLines = function (config) { var oldConfig = this.config; this.config = config; - if (this.$lines.pageChanged(oldConfig, config)) return this.update(config); - this.$lines.moveContainer(config); - var lastRow = config.lastRow; var oldLastRow = oldConfig ? oldConfig.lastRow : -1; - if (!oldConfig || oldLastRow < config.firstRow) return this.update(config); - if (lastRow < oldConfig.firstRow) return this.update(config); - if (!oldConfig || oldConfig.lastRow < config.firstRow) return this.update(config); - if (config.lastRow < oldConfig.firstRow) return this.update(config); - if (oldConfig.firstRow < config.firstRow) - for (var row=this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row>0; row--) + for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config.firstRow - 1); row > 0; row--) this.$lines.shift(); - if (oldConfig.lastRow > config.lastRow) - for (var row=this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row>0; row--) + for (var row = this.session.getFoldedRowCount(config.lastRow + 1, oldConfig.lastRow); row > 0; row--) this.$lines.pop(); - if (config.firstRow < oldConfig.firstRow) { this.$lines.unshift(this.$renderLinesFragment(config, config.firstRow, oldConfig.firstRow - 1)); } - if (config.lastRow > oldConfig.lastRow) { this.$lines.push(this.$renderLinesFragment(config, oldConfig.lastRow + 1, config.lastRow)); } + this.$highlightIndentGuide(); }; - - this.$renderLinesFragment = function(config, firstRow, lastRow) { + Text.prototype.$renderLinesFragment = function (config, firstRow, lastRow) { var fragment = []; var row = firstRow; var foldLine = this.session.getNextFoldLine(row); var foldStart = foldLine ? foldLine.start.row : Infinity; - while (true) { if (row > foldStart) { - row = foldLine.end.row+1; + row = foldLine.end.row + 1; foldLine = this.session.getNextFoldLine(row, foldLine); foldStart = foldLine ? foldLine.start.row : Infinity; } if (row > lastRow) break; - var line = this.$lines.createCell(row, config, this.session); - var lineEl = line.element; this.dom.removeChildren(lineEl); dom.setStyle(lineEl.style, "height", this.$lines.computeLineHeight(row, config, this.session) + "px"); dom.setStyle(lineEl.style, "top", this.$lines.computeLineTop(row, config, this.session) + "px"); this.$renderLine(lineEl, row, row == foldStart ? foldLine : false); - if (this.$useLineGroups()) { lineEl.className = "ace_line_group"; - } else { + } + else { lineEl.className = "ace_line"; } fragment.push(line); - row++; } return fragment; }; - - this.update = function(config) { + Text.prototype.update = function (config) { this.$lines.moveContainer(config); - this.config = config; - var firstRow = config.firstRow; var lastRow = config.lastRow; - var lines = this.$lines; while (lines.getLength()) lines.pop(); - lines.push(this.$renderLinesFragment(config, firstRow, lastRow)); }; - - this.$textToken = { - "text": true, - "rparen": true, - "lparen": true - }; - - this.$renderToken = function(parent, screenColumn, token, value) { + Text.prototype.$renderToken = function (parent, screenColumn, token, value) { var self = this; - var re = /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g; - + var re = /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g; var valueFragment = this.dom.createFragment(this.element); - var m; var i = 0; while (m = re.exec(value)) { @@ -34959,45 +34671,44 @@ var Text = function(parentEl) { var controlCharacter = m[3]; var cjkSpace = m[4]; var cjk = m[5]; - if (!self.showSpaces && simpleSpace) continue; - var before = i != m.index ? value.slice(i, m.index) : ""; - i = m.index + m[0].length; - if (before) { valueFragment.appendChild(this.dom.createTextNode(before, this.element)); } - if (tab) { var tabSize = self.session.getScreenTabSize(screenColumn + m.index); valueFragment.appendChild(self.$tabStrings[tabSize].cloneNode(true)); screenColumn += tabSize - 1; - } else if (simpleSpace) { + } + else if (simpleSpace) { if (self.showSpaces) { var span = this.dom.createElement("span"); span.className = "ace_invisible ace_invisible_space"; span.textContent = lang.stringRepeat(self.SPACE_CHAR, simpleSpace.length); valueFragment.appendChild(span); - } else { - valueFragment.appendChild(this.com.createTextNode(simpleSpace, this.element)); } - } else if (controlCharacter) { + else { + valueFragment.appendChild(this.dom.createTextNode(simpleSpace, this.element)); + } + } + else if (controlCharacter) { var span = this.dom.createElement("span"); span.className = "ace_invisible ace_invisible_space ace_invalid"; span.textContent = lang.stringRepeat(self.SPACE_CHAR, controlCharacter.length); valueFragment.appendChild(span); - } else if (cjkSpace) { + } + else if (cjkSpace) { screenColumn += 1; - var span = this.dom.createElement("span"); span.style.width = (self.config.characterWidth * 2) + "px"; span.className = self.showSpaces ? "ace_cjk ace_invisible ace_invisible_space" : "ace_cjk"; span.textContent = self.showSpaces ? self.SPACE_CHAR : cjkSpace; valueFragment.appendChild(span); - } else if (cjk) { + } + else if (cjk) { screenColumn += 1; var span = this.dom.createElement("span"); span.style.width = (self.config.characterWidth * 2) + "px"; @@ -35006,64 +34717,166 @@ var Text = function(parentEl) { valueFragment.appendChild(span); } } - valueFragment.appendChild(this.dom.createTextNode(i ? value.slice(i) : value, this.element)); - - if (!this.$textToken[token.type]) { + if (!isTextToken(token.type)) { var classes = "ace_" + token.type.replace(/\./g, " ace_"); var span = this.dom.createElement("span"); - if (token.type == "fold") + if (token.type == "fold") { span.style.width = (token.value.length * this.config.characterWidth) + "px"; - + span.setAttribute("title", nls("inline-fold.closed.title", "Unfold code")); + } span.className = classes; span.appendChild(valueFragment); - parent.appendChild(span); } else { parent.appendChild(valueFragment); } - return screenColumn + value.length; }; - - this.renderIndentGuide = function(parent, value, max) { + Text.prototype.renderIndentGuide = function (parent, value, max) { var cols = value.search(this.$indentGuideRe); if (cols <= 0 || cols >= max) return value; if (value[0] == " ") { cols -= cols % this.tabSize; - var count = cols/this.tabSize; - for (var i=0; i ranges[i].start.row) { + this.$highlightIndentGuideMarker.dir = -1; + } + else { + this.$highlightIndentGuideMarker.dir = 1; + } + break; + } + } + } + if (!this.$highlightIndentGuideMarker.end) { + if (lines[cursor.row] !== '' && cursor.column === lines[cursor.row].length) { + this.$highlightIndentGuideMarker.dir = 1; + for (var i = cursor.row + 1; i < lines.length; i++) { + var line = lines[i]; + var currentIndent = /^\s*/.exec(line)[0].length; + if (line !== '') { + this.$highlightIndentGuideMarker.end = i; + if (currentIndent <= initialIndent) + break; + } + } + } + } + this.$renderHighlightIndentGuide(); + }; + Text.prototype.$clearActiveIndentGuide = function () { + var cells = this.$lines.cells; + for (var i = 0; i < cells.length; i++) { + var cell = cells[i]; + var childNodes = cell.element.childNodes; + if (childNodes.length > 0) { + for (var j = 0; j < childNodes.length; j++) { + if (childNodes[j].classList && childNodes[j].classList.contains("ace_indent-guide-active")) { + childNodes[j].classList.remove("ace_indent-guide-active"); + break; + } + } + } + } + }; + Text.prototype.$setIndentGuideActive = function (cell, indentLevel) { + var line = this.session.doc.getLine(cell.row); + if (line !== "") { + var childNodes = cell.element.childNodes; + if (childNodes) { + var node = childNodes[indentLevel - 1]; + if (node && node.classList && node.classList.contains("ace_indent-guide")) + node.classList.add("ace_indent-guide-active"); + } + } + }; + Text.prototype.$renderHighlightIndentGuide = function () { + if (!this.$lines) + return; + var cells = this.$lines.cells; + this.$clearActiveIndentGuide(); + var indentLevel = this.$highlightIndentGuideMarker.indentLevel; + if (indentLevel !== 0) { + if (this.$highlightIndentGuideMarker.dir === 1) { + for (var i = 0; i < cells.length; i++) { + var cell = cells[i]; + if (this.$highlightIndentGuideMarker.end && cell.row >= this.$highlightIndentGuideMarker.start + + 1) { + if (cell.row >= this.$highlightIndentGuideMarker.end) + break; + this.$setIndentGuideActive(cell, indentLevel); + } + } + } + else { + for (var i = cells.length - 1; i >= 0; i--) { + var cell = cells[i]; + if (this.$highlightIndentGuideMarker.end && cell.row < this.$highlightIndentGuideMarker.start) { + if (cell.row <= this.$highlightIndentGuideMarker.end) + break; + this.$setIndentGuideActive(cell, indentLevel); + } + } + } + } + }; + Text.prototype.$createLineElement = function (parent) { var lineEl = this.dom.createElement("div"); lineEl.className = "ace_line"; lineEl.style.height = this.config.lineHeight + "px"; - return lineEl; }; - - this.$renderWrappedLine = function(parent, tokens, splits) { + Text.prototype.$renderWrappedLine = function (parent, tokens, splits) { var chars = 0; var split = 0; var splitChars = splits[0]; var screenColumn = 0; - var lineEl = this.$createLineElement(); parent.appendChild(lineEl); - for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; var value = token.value; @@ -35074,84 +34887,68 @@ var Text = function(parentEl) { continue; chars -= value.length; } - if (chars + value.length < splitChars) { screenColumn = this.$renderToken(lineEl, screenColumn, token, value); chars += value.length; - } else { + } + else { while (chars + value.length >= splitChars) { - screenColumn = this.$renderToken( - lineEl, screenColumn, - token, value.substring(0, splitChars - chars) - ); + screenColumn = this.$renderToken(lineEl, screenColumn, token, value.substring(0, splitChars - chars)); value = value.substring(splitChars - chars); chars = splitChars; - lineEl = this.$createLineElement(); parent.appendChild(lineEl); - lineEl.appendChild(this.dom.createTextNode(lang.stringRepeat("\xa0", splits.indent), this.element)); - - split ++; + split++; screenColumn = 0; splitChars = splits[split] || Number.MAX_VALUE; } if (value.length != 0) { chars += value.length; - screenColumn = this.$renderToken( - lineEl, screenColumn, token, value - ); + screenColumn = this.$renderToken(lineEl, screenColumn, token, value); } } } - if (splits[splits.length - 1] > this.MAX_LINE_LENGTH) this.$renderOverflowMessage(lineEl, screenColumn, null, "", true); }; - - this.$renderSimpleLine = function(parent, tokens) { + Text.prototype.$renderSimpleLine = function (parent, tokens) { var screenColumn = 0; - var token = tokens[0]; - var value = token.value; - if (this.displayIndentGuides) - value = this.renderIndentGuide(parent, value); - if (value) - screenColumn = this.$renderToken(parent, screenColumn, token, value); - for (var i = 1; i < tokens.length; i++) { - token = tokens[i]; - value = token.value; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + var value = token.value; + if (i == 0 && this.displayIndentGuides) { + value = this.renderIndentGuide(parent, value); + if (!value) + continue; + } if (screenColumn + value.length > this.MAX_LINE_LENGTH) return this.$renderOverflowMessage(parent, screenColumn, token, value); screenColumn = this.$renderToken(parent, screenColumn, token, value); } }; - - this.$renderOverflowMessage = function(parent, screenColumn, token, value, hide) { - token && this.$renderToken(parent, screenColumn, token, - value.slice(0, this.MAX_LINE_LENGTH - screenColumn)); - + Text.prototype.$renderOverflowMessage = function (parent, screenColumn, token, value, hide) { + token && this.$renderToken(parent, screenColumn, token, value.slice(0, this.MAX_LINE_LENGTH - screenColumn)); var overflowEl = this.dom.createElement("span"); overflowEl.className = "ace_inline_button ace_keyword ace_toggle_wrap"; overflowEl.textContent = hide ? "" : ""; - parent.appendChild(overflowEl); }; - this.$renderLine = function(parent, row, foldLine) { + Text.prototype.$renderLine = function (parent, row, foldLine) { if (!foldLine && foldLine != false) foldLine = this.session.getFoldLine(row); - if (foldLine) var tokens = this.$getFoldLineTokens(row, foldLine); else var tokens = this.session.getTokens(row); - var lastLineEl = parent; if (tokens.length) { var splits = this.session.getRowSplitData(row); if (splits && splits.length) { this.$renderWrappedLine(parent, tokens, splits); var lastLineEl = parent.lastChild; - } else { + } + else { var lastLineEl = parent; if (this.$useLineGroups()) { lastLineEl = this.$createLineElement(); @@ -35159,33 +34956,28 @@ var Text = function(parentEl) { } this.$renderSimpleLine(lastLineEl, tokens); } - } else if (this.$useLineGroups()) { + } + else if (this.$useLineGroups()) { lastLineEl = this.$createLineElement(); parent.appendChild(lastLineEl); } - if (this.showEOL && lastLineEl) { if (foldLine) row = foldLine.end.row; - var invisibleEl = this.dom.createElement("span"); invisibleEl.className = "ace_invisible ace_invisible_eol"; invisibleEl.textContent = row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR; - lastLineEl.appendChild(invisibleEl); } }; - - this.$getFoldLineTokens = function(row, foldLine) { + Text.prototype.$getFoldLineTokens = function (row, foldLine) { var session = this.session; var renderTokens = []; - function addTokens(tokens, from, to) { var idx = 0, col = 0; while ((col + tokens[idx].value.length) < from) { col += tokens[idx].value.length; idx++; - if (idx == tokens.length) return; } @@ -35193,16 +34985,13 @@ var Text = function(parentEl) { var value = tokens[idx].value.substring(from - col); if (value.length > (to - from)) value = value.substring(0, to - from); - renderTokens.push({ type: tokens[idx].type, value: value }); - col = from + value.length; idx += 1; } - while (col < to && idx < tokens.length) { var value = tokens[idx].value; if (value.length + col > to) { @@ -35210,110 +34999,112 @@ var Text = function(parentEl) { type: tokens[idx].type, value: value.substring(0, to - col) }); - } else + } + else renderTokens.push(tokens[idx]); col += value.length; idx += 1; } } - var tokens = session.getTokens(row); - foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { + foldLine.walk(function (placeholder, row, column, lastColumn, isNewRow) { if (placeholder != null) { renderTokens.push({ type: "fold", value: placeholder }); - } else { + } + else { if (isNewRow) tokens = session.getTokens(row); - if (tokens.length) addTokens(tokens, lastColumn, column); } }, foldLine.end.row, this.session.getLine(foldLine.end.row).length); - return renderTokens; }; - - this.$useLineGroups = function() { + Text.prototype.$useLineGroups = function () { return this.session.getUseWrapMode(); }; - - this.destroy = function() {}; -}).call(Text.prototype); - + return Text; +}()); +Text.prototype.EOF_CHAR = "\xB6"; +Text.prototype.EOL_CHAR_LF = "\xAC"; +Text.prototype.EOL_CHAR_CRLF = "\xa4"; +Text.prototype.EOL_CHAR = Text.prototype.EOL_CHAR_LF; +Text.prototype.TAB_CHAR = "\u2014"; //"\u21E5"; +Text.prototype.SPACE_CHAR = "\xB7"; +Text.prototype.$padding = 0; +Text.prototype.MAX_LINE_LENGTH = 10000; +Text.prototype.showInvisibles = false; +Text.prototype.showSpaces = false; +Text.prototype.showTabs = false; +Text.prototype.showEOL = false; +Text.prototype.displayIndentGuides = true; +Text.prototype.$highlightIndentGuides = true; +Text.prototype.$tabStrings = []; +Text.prototype.destroy = {}; +Text.prototype.onChangeTabSize = Text.prototype.$computeTabString; +oop.implement(Text.prototype, EventEmitter); exports.Text = Text; }); -ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"], function(require, exports, module) { -"use strict"; - +ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"], function(require, exports, module){"use strict"; var dom = require("../lib/dom"); - -var Cursor = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_cursor-layer"; - parentEl.appendChild(this.element); - - this.isVisible = false; - this.isBlinking = true; - this.blinkInterval = 1000; - this.smoothBlinking = false; - - this.cursors = []; - this.cursor = this.addCursor(); - dom.addCssClass(this.element, "ace_hidden-cursors"); - this.$updateCursors = this.$updateOpacity.bind(this); -}; - -(function() { - - this.$updateOpacity = function(val) { +var Cursor = /** @class */ (function () { + function Cursor(parentEl) { + this.element = dom.createElement("div"); + this.element.className = "ace_layer ace_cursor-layer"; + parentEl.appendChild(this.element); + this.isVisible = false; + this.isBlinking = true; + this.blinkInterval = 1000; + this.smoothBlinking = false; + this.cursors = []; + this.cursor = this.addCursor(); + dom.addCssClass(this.element, "ace_hidden-cursors"); + this.$updateCursors = this.$updateOpacity.bind(this); + } + Cursor.prototype.$updateOpacity = function (val) { var cursors = this.cursors; - for (var i = cursors.length; i--; ) + for (var i = cursors.length; i--;) dom.setStyle(cursors[i].style, "opacity", val ? "" : "0"); }; - - this.$startCssAnimation = function() { + Cursor.prototype.$startCssAnimation = function () { var cursors = this.cursors; - for (var i = cursors.length; i--; ) + for (var i = cursors.length; i--;) cursors[i].style.animationDuration = this.blinkInterval + "ms"; - - setTimeout(function() { - dom.addCssClass(this.element, "ace_animate-blinking"); + this.$isAnimating = true; + setTimeout(function () { + if (this.$isAnimating) { + dom.addCssClass(this.element, "ace_animate-blinking"); + } }.bind(this)); }; - - this.$stopCssAnimation = function() { + Cursor.prototype.$stopCssAnimation = function () { + this.$isAnimating = false; dom.removeCssClass(this.element, "ace_animate-blinking"); }; - - this.$padding = 0; - this.setPadding = function(padding) { + Cursor.prototype.setPadding = function (padding) { this.$padding = padding; }; - - this.setSession = function(session) { + Cursor.prototype.setSession = function (session) { this.session = session; }; - - this.setBlinking = function(blinking) { + Cursor.prototype.setBlinking = function (blinking) { if (blinking != this.isBlinking) { this.isBlinking = blinking; this.restartTimer(); } }; - - this.setBlinkInterval = function(blinkInterval) { + Cursor.prototype.setBlinkInterval = function (blinkInterval) { if (blinkInterval != this.blinkInterval) { this.blinkInterval = blinkInterval; this.restartTimer(); } }; - - this.setSmoothBlinking = function(smoothBlinking) { + Cursor.prototype.setSmoothBlinking = function (smoothBlinking) { if (smoothBlinking != this.smoothBlinking) { this.smoothBlinking = smoothBlinking; dom.setCssClass(this.element, "ace_smooth-blinking", smoothBlinking); @@ -35321,141 +35112,122 @@ var Cursor = function(parentEl) { this.restartTimer(); } }; - - this.addCursor = function() { + Cursor.prototype.addCursor = function () { var el = dom.createElement("div"); el.className = "ace_cursor"; this.element.appendChild(el); this.cursors.push(el); return el; }; - - this.removeCursor = function() { + Cursor.prototype.removeCursor = function () { if (this.cursors.length > 1) { var el = this.cursors.pop(); el.parentNode.removeChild(el); return el; } }; - - this.hideCursor = function() { + Cursor.prototype.hideCursor = function () { this.isVisible = false; dom.addCssClass(this.element, "ace_hidden-cursors"); this.restartTimer(); }; - - this.showCursor = function() { + Cursor.prototype.showCursor = function () { this.isVisible = true; dom.removeCssClass(this.element, "ace_hidden-cursors"); this.restartTimer(); }; - - this.restartTimer = function() { + Cursor.prototype.restartTimer = function () { var update = this.$updateCursors; clearInterval(this.intervalId); clearTimeout(this.timeoutId); this.$stopCssAnimation(); - if (this.smoothBlinking) { + this.$isSmoothBlinking = false; dom.removeCssClass(this.element, "ace_smooth-blinking"); } - update(true); - if (!this.isBlinking || !this.blinkInterval || !this.isVisible) { this.$stopCssAnimation(); return; } - if (this.smoothBlinking) { - setTimeout(function(){ - dom.addCssClass(this.element, "ace_smooth-blinking"); + this.$isSmoothBlinking = true; + setTimeout(function () { + if (this.$isSmoothBlinking) { + dom.addCssClass(this.element, "ace_smooth-blinking"); + } }.bind(this)); } - if (dom.HAS_CSS_ANIMATION) { this.$startCssAnimation(); - } else { - var blink = function(){ - this.timeoutId = setTimeout(function() { + } + else { + var blink = /**@this{Cursor}*/ function () { + this.timeoutId = setTimeout(function () { update(false); }, 0.6 * this.blinkInterval); }.bind(this); - - this.intervalId = setInterval(function() { + this.intervalId = setInterval(function () { update(true); blink(); }, this.blinkInterval); blink(); } }; - - this.getPixelPosition = function(position, onScreen) { + Cursor.prototype.getPixelPosition = function (position, onScreen) { if (!this.config || !this.session) - return {left : 0, top : 0}; - + return { left: 0, top: 0 }; if (!position) position = this.session.selection.getCursor(); var pos = this.session.documentToScreenPosition(position); var cursorLeft = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, position.row) ? this.session.$bidiHandler.getPosLeft(pos.column) : pos.column * this.config.characterWidth); - var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * this.config.lineHeight; - - return {left : cursorLeft, top : cursorTop}; + return { left: cursorLeft, top: cursorTop }; }; - - this.isCursorInView = function(pixelPos, config) { + Cursor.prototype.isCursorInView = function (pixelPos, config) { return pixelPos.top >= 0 && pixelPos.top < config.maxHeight; }; - - this.update = function(config) { + Cursor.prototype.update = function (config) { this.config = config; - var selections = this.session.$selectionMarkers; var i = 0, cursorIndex = 0; - - if (selections === undefined || selections.length === 0){ - selections = [{cursor: null}]; + if (selections === undefined || selections.length === 0) { + selections = [{ cursor: null }]; } - for (var i = 0, n = selections.length; i < n; i++) { var pixelPos = this.getPixelPosition(selections[i].cursor, true); if ((pixelPos.top > config.height + config.offset || - pixelPos.top < 0) && i > 1) { + pixelPos.top < 0) && i > 1) { continue; } - var element = this.cursors[cursorIndex++] || this.addCursor(); var style = element.style; - if (!this.drawCursor) { if (!this.isCursorInView(pixelPos, config)) { dom.setStyle(style, "display", "none"); - } else { + } + else { dom.setStyle(style, "display", "block"); dom.translate(element, pixelPos.left, pixelPos.top); dom.setStyle(style, "width", Math.round(config.characterWidth) + "px"); dom.setStyle(style, "height", config.lineHeight + "px"); } - } else { + } + else { this.drawCursor(element, pixelPos, config, selections[i], this.session); } } while (this.cursors.length > cursorIndex) this.removeCursor(); - var overwrite = this.session.getOverwrite(); this.$setOverwrite(overwrite); this.$pixelPos = pixelPos; this.restartTimer(); }; - - this.drawCursor = null; - - this.$setOverwrite = function(overwrite) { + Cursor.prototype.$setOverwrite = function (overwrite) { if (overwrite != this.overwrite) { this.overwrite = overwrite; if (overwrite) @@ -35464,270 +35236,484 @@ var Cursor = function(parentEl) { dom.removeCssClass(this.element, "ace_overwrite-cursors"); } }; - - this.destroy = function() { + Cursor.prototype.destroy = function () { clearInterval(this.intervalId); clearTimeout(this.timeoutId); }; - -}).call(Cursor.prototype); - + return Cursor; +}()); +Cursor.prototype.$padding = 0; +Cursor.prototype.drawCursor = null; exports.Cursor = Cursor; }); -ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"], function(require, exports, module) { -"use strict"; - +ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"], function(require, exports, module){"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var oop = require("./lib/oop"); var dom = require("./lib/dom"); var event = require("./lib/event"); var EventEmitter = require("./lib/event_emitter").EventEmitter; var MAX_SCROLL_H = 0x8000; -var ScrollBar = function(parent) { - this.element = dom.createElement("div"); - this.element.className = "ace_scrollbar ace_scrollbar" + this.classSuffix; - - this.inner = dom.createElement("div"); - this.inner.className = "ace_scrollbar-inner"; - this.inner.textContent = "\xa0"; - this.element.appendChild(this.inner); - - parent.appendChild(this.element); - - this.setVisible(false); - this.skipEvent = false; - - event.addListener(this.element, "scroll", this.onScroll.bind(this)); - event.addListener(this.element, "mousedown", event.preventDefault); -}; - -(function() { - oop.implement(this, EventEmitter); - - this.setVisible = function(isVisible) { +var Scrollbar = /** @class */ (function () { + function Scrollbar(parent, classSuffix) { + this.element = dom.createElement("div"); + this.element.className = "ace_scrollbar ace_scrollbar" + classSuffix; + this.inner = dom.createElement("div"); + this.inner.className = "ace_scrollbar-inner"; + this.inner.textContent = "\xa0"; + this.element.appendChild(this.inner); + parent.appendChild(this.element); + this.setVisible(false); + this.skipEvent = false; + event.addListener(this.element, "scroll", this.onScroll.bind(this)); + event.addListener(this.element, "mousedown", event.preventDefault); + } + Scrollbar.prototype.setVisible = function (isVisible) { this.element.style.display = isVisible ? "" : "none"; this.isVisible = isVisible; this.coeff = 1; }; -}).call(ScrollBar.prototype); -var VScrollBar = function(parent, renderer) { - ScrollBar.call(this, parent); - this.scrollTop = 0; - this.scrollHeight = 0; - renderer.$scrollbarWidth = - this.width = dom.scrollbarWidth(parent.ownerDocument); - this.inner.style.width = - this.element.style.width = (this.width || 15) + 5 + "px"; - this.$minWidth = 0; -}; - -oop.inherits(VScrollBar, ScrollBar); - -(function() { - - this.classSuffix = '-v'; - this.onScroll = function() { + return Scrollbar; +}()); +oop.implement(Scrollbar.prototype, EventEmitter); +var VScrollBar = /** @class */ (function (_super) { + __extends(VScrollBar, _super); + function VScrollBar(parent, renderer) { + var _this = _super.call(this, parent, '-v') || this; + _this.scrollTop = 0; + _this.scrollHeight = 0; + renderer.$scrollbarWidth = + _this.width = dom.scrollbarWidth(parent.ownerDocument); + _this.inner.style.width = + _this.element.style.width = (_this.width || 15) + 5 + "px"; + _this.$minWidth = 0; + return _this; + } + VScrollBar.prototype.onScroll = function () { if (!this.skipEvent) { this.scrollTop = this.element.scrollTop; if (this.coeff != 1) { var h = this.element.clientHeight / this.scrollHeight; this.scrollTop = this.scrollTop * (1 - h) / (this.coeff - h); } - this._emit("scroll", {data: this.scrollTop}); + this._emit("scroll", { data: this.scrollTop }); } this.skipEvent = false; }; - this.getWidth = function() { + VScrollBar.prototype.getWidth = function () { return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0); }; - this.setHeight = function(height) { + VScrollBar.prototype.setHeight = function (height) { this.element.style.height = height + "px"; }; - this.setInnerHeight = - this.setScrollHeight = function(height) { + VScrollBar.prototype.setScrollHeight = function (height) { this.scrollHeight = height; if (height > MAX_SCROLL_H) { this.coeff = MAX_SCROLL_H / height; height = MAX_SCROLL_H; - } else if (this.coeff != 1) { + } + else if (this.coeff != 1) { this.coeff = 1; } this.inner.style.height = height + "px"; }; - this.setScrollTop = function(scrollTop) { + VScrollBar.prototype.setScrollTop = function (scrollTop) { if (this.scrollTop != scrollTop) { this.skipEvent = true; this.scrollTop = scrollTop; this.element.scrollTop = scrollTop * this.coeff; } }; - -}).call(VScrollBar.prototype); -var HScrollBar = function(parent, renderer) { - ScrollBar.call(this, parent); - this.scrollLeft = 0; - this.height = renderer.$scrollbarWidth; - this.inner.style.height = - this.element.style.height = (this.height || 15) + 5 + "px"; -}; - -oop.inherits(HScrollBar, ScrollBar); - -(function() { - - this.classSuffix = '-h'; - this.onScroll = function() { + return VScrollBar; +}(Scrollbar)); +VScrollBar.prototype.setInnerHeight = VScrollBar.prototype.setScrollHeight; +var HScrollBar = /** @class */ (function (_super) { + __extends(HScrollBar, _super); + function HScrollBar(parent, renderer) { + var _this = _super.call(this, parent, '-h') || this; + _this.scrollLeft = 0; + _this.height = renderer.$scrollbarWidth; + _this.inner.style.height = + _this.element.style.height = (_this.height || 15) + 5 + "px"; + return _this; + } + HScrollBar.prototype.onScroll = function () { if (!this.skipEvent) { this.scrollLeft = this.element.scrollLeft; - this._emit("scroll", {data: this.scrollLeft}); + this._emit("scroll", { data: this.scrollLeft }); + } + this.skipEvent = false; + }; + HScrollBar.prototype.getHeight = function () { + return this.isVisible ? this.height : 0; + }; + HScrollBar.prototype.setWidth = function (width) { + this.element.style.width = width + "px"; + }; + HScrollBar.prototype.setInnerWidth = function (width) { + this.inner.style.width = width + "px"; + }; + HScrollBar.prototype.setScrollWidth = function (width) { + this.inner.style.width = width + "px"; + }; + HScrollBar.prototype.setScrollLeft = function (scrollLeft) { + if (this.scrollLeft != scrollLeft) { + this.skipEvent = true; + this.scrollLeft = this.element.scrollLeft = scrollLeft; + } + }; + return HScrollBar; +}(Scrollbar)); +exports.ScrollBar = VScrollBar; // backward compatibility +exports.ScrollBarV = VScrollBar; // backward compatibility +exports.ScrollBarH = HScrollBar; // backward compatibility +exports.VScrollBar = VScrollBar; +exports.HScrollBar = HScrollBar; + +}); + +ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"], function(require, exports, module){"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var oop = require("./lib/oop"); +var dom = require("./lib/dom"); +var event = require("./lib/event"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +dom.importCssString(".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n position: absolute;\n background: rgba(128, 128, 128, 0.6);\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n border: 1px solid #bbb;\n border-radius: 2px;\n z-index: 8;\n}\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n position: absolute;\n z-index: 6;\n background: none;\n overflow: hidden!important;\n}\n.ace_editor>.ace_sb-v {\n z-index: 6;\n right: 0;\n top: 0;\n width: 12px;\n}\n.ace_editor>.ace_sb-v div {\n z-index: 8;\n right: 0;\n width: 100%;\n}\n.ace_editor>.ace_sb-h {\n bottom: 0;\n left: 0;\n height: 12px;\n}\n.ace_editor>.ace_sb-h div {\n bottom: 0;\n height: 100%;\n}\n.ace_editor>.ace_sb_grabbed {\n z-index: 8;\n background: #000;\n}", "ace_scrollbar.css", false); +var ScrollBar = /** @class */ (function () { + function ScrollBar(parent, classSuffix) { + this.element = dom.createElement("div"); + this.element.className = "ace_sb" + classSuffix; + this.inner = dom.createElement("div"); + this.inner.className = ""; + this.element.appendChild(this.inner); + this.VScrollWidth = 12; + this.HScrollHeight = 12; + parent.appendChild(this.element); + this.setVisible(false); + this.skipEvent = false; + event.addMultiMouseDownListener(this.element, [500, 300, 300], this, "onMouseDown"); + } + ScrollBar.prototype.setVisible = function (isVisible) { + this.element.style.display = isVisible ? "" : "none"; + this.isVisible = isVisible; + this.coeff = 1; + }; + return ScrollBar; +}()); +oop.implement(ScrollBar.prototype, EventEmitter); +var VScrollBar = /** @class */ (function (_super) { + __extends(VScrollBar, _super); + function VScrollBar(parent, renderer) { + var _this = _super.call(this, parent, '-v') || this; + _this.scrollTop = 0; + _this.scrollHeight = 0; + _this.parent = parent; + _this.width = _this.VScrollWidth; + _this.renderer = renderer; + _this.inner.style.width = _this.element.style.width = (_this.width || 15) + "px"; + _this.$minWidth = 0; + return _this; + } + VScrollBar.prototype.onMouseDown = function (eType, e) { + if (eType !== "mousedown") + return; + if (event.getButton(e) !== 0 || e.detail === 2) { + return; + } + if (e.target === this.inner) { + var self = this; + var mousePageY = e.clientY; + var onMouseMove = function (e) { + mousePageY = e.clientY; + }; + var onMouseUp = function () { + clearInterval(timerId); + }; + var startY = e.clientY; + var startTop = this.thumbTop; + var onScrollInterval = function () { + if (mousePageY === undefined) + return; + var scrollTop = self.scrollTopFromThumbTop(startTop + mousePageY - startY); + if (scrollTop === self.scrollTop) + return; + self._emit("scroll", { data: scrollTop }); + }; + event.capture(this.inner, onMouseMove, onMouseUp); + var timerId = setInterval(onScrollInterval, 20); + return event.preventDefault(e); + } + var top = e.clientY - this.element.getBoundingClientRect().top - this.thumbHeight / 2; + this._emit("scroll", { data: this.scrollTopFromThumbTop(top) }); + return event.preventDefault(e); + }; + VScrollBar.prototype.getHeight = function () { + return this.height; + }; + VScrollBar.prototype.scrollTopFromThumbTop = function (thumbTop) { + var scrollTop = thumbTop * (this.pageHeight - this.viewHeight) / (this.slideHeight - this.thumbHeight); + scrollTop = scrollTop >> 0; + if (scrollTop < 0) { + scrollTop = 0; + } + else if (scrollTop > this.pageHeight - this.viewHeight) { + scrollTop = this.pageHeight - this.viewHeight; + } + return scrollTop; + }; + VScrollBar.prototype.getWidth = function () { + return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0); + }; + VScrollBar.prototype.setHeight = function (height) { + this.height = Math.max(0, height); + this.slideHeight = this.height; + this.viewHeight = this.height; + this.setScrollHeight(this.pageHeight, true); + }; + VScrollBar.prototype.setScrollHeight = function (height, force) { + if (this.pageHeight === height && !force) + return; + this.pageHeight = height; + this.thumbHeight = this.slideHeight * this.viewHeight / this.pageHeight; + if (this.thumbHeight > this.slideHeight) + this.thumbHeight = this.slideHeight; + if (this.thumbHeight < 15) + this.thumbHeight = 15; + this.inner.style.height = this.thumbHeight + "px"; + if (this.scrollTop > (this.pageHeight - this.viewHeight)) { + this.scrollTop = (this.pageHeight - this.viewHeight); + if (this.scrollTop < 0) + this.scrollTop = 0; + this._emit("scroll", { data: this.scrollTop }); + } + }; + VScrollBar.prototype.setScrollTop = function (scrollTop) { + this.scrollTop = scrollTop; + if (scrollTop < 0) + scrollTop = 0; + this.thumbTop = scrollTop * (this.slideHeight - this.thumbHeight) / (this.pageHeight - this.viewHeight); + this.inner.style.top = this.thumbTop + "px"; + }; + return VScrollBar; +}(ScrollBar)); +VScrollBar.prototype.setInnerHeight = VScrollBar.prototype.setScrollHeight; +var HScrollBar = /** @class */ (function (_super) { + __extends(HScrollBar, _super); + function HScrollBar(parent, renderer) { + var _this = _super.call(this, parent, '-h') || this; + _this.scrollLeft = 0; + _this.scrollWidth = 0; + _this.height = _this.HScrollHeight; + _this.inner.style.height = _this.element.style.height = (_this.height || 12) + "px"; + _this.renderer = renderer; + return _this; + } + HScrollBar.prototype.onMouseDown = function (eType, e) { + if (eType !== "mousedown") + return; + if (event.getButton(e) !== 0 || e.detail === 2) { + return; } - this.skipEvent = false; + if (e.target === this.inner) { + var self = this; + var mousePageX = e.clientX; + var onMouseMove = function (e) { + mousePageX = e.clientX; + }; + var onMouseUp = function () { + clearInterval(timerId); + }; + var startX = e.clientX; + var startLeft = this.thumbLeft; + var onScrollInterval = function () { + if (mousePageX === undefined) + return; + var scrollLeft = self.scrollLeftFromThumbLeft(startLeft + mousePageX - startX); + if (scrollLeft === self.scrollLeft) + return; + self._emit("scroll", { data: scrollLeft }); + }; + event.capture(this.inner, onMouseMove, onMouseUp); + var timerId = setInterval(onScrollInterval, 20); + return event.preventDefault(e); + } + var left = e.clientX - this.element.getBoundingClientRect().left - this.thumbWidth / 2; + this._emit("scroll", { data: this.scrollLeftFromThumbLeft(left) }); + return event.preventDefault(e); }; - this.getHeight = function() { + HScrollBar.prototype.getHeight = function () { return this.isVisible ? this.height : 0; }; - this.setWidth = function(width) { - this.element.style.width = width + "px"; - }; - this.setInnerWidth = function(width) { - this.inner.style.width = width + "px"; - }; - this.setScrollWidth = function(width) { - this.inner.style.width = width + "px"; - }; - this.setScrollLeft = function(scrollLeft) { - if (this.scrollLeft != scrollLeft) { - this.skipEvent = true; - this.scrollLeft = this.element.scrollLeft = scrollLeft; + HScrollBar.prototype.scrollLeftFromThumbLeft = function (thumbLeft) { + var scrollLeft = thumbLeft * (this.pageWidth - this.viewWidth) / (this.slideWidth - this.thumbWidth); + scrollLeft = scrollLeft >> 0; + if (scrollLeft < 0) { + scrollLeft = 0; + } + else if (scrollLeft > this.pageWidth - this.viewWidth) { + scrollLeft = this.pageWidth - this.viewWidth; } + return scrollLeft; }; - -}).call(HScrollBar.prototype); - - + HScrollBar.prototype.setWidth = function (width) { + this.width = Math.max(0, width); + this.element.style.width = this.width + "px"; + this.slideWidth = this.width; + this.viewWidth = this.width; + this.setScrollWidth(this.pageWidth, true); + }; + HScrollBar.prototype.setScrollWidth = function (width, force) { + if (this.pageWidth === width && !force) + return; + this.pageWidth = width; + this.thumbWidth = this.slideWidth * this.viewWidth / this.pageWidth; + if (this.thumbWidth > this.slideWidth) + this.thumbWidth = this.slideWidth; + if (this.thumbWidth < 15) + this.thumbWidth = 15; + this.inner.style.width = this.thumbWidth + "px"; + if (this.scrollLeft > (this.pageWidth - this.viewWidth)) { + this.scrollLeft = (this.pageWidth - this.viewWidth); + if (this.scrollLeft < 0) + this.scrollLeft = 0; + this._emit("scroll", { data: this.scrollLeft }); + } + }; + HScrollBar.prototype.setScrollLeft = function (scrollLeft) { + this.scrollLeft = scrollLeft; + if (scrollLeft < 0) + scrollLeft = 0; + this.thumbLeft = scrollLeft * (this.slideWidth - this.thumbWidth) / (this.pageWidth - this.viewWidth); + this.inner.style.left = (this.thumbLeft) + "px"; + }; + return HScrollBar; +}(ScrollBar)); +HScrollBar.prototype.setInnerWidth = HScrollBar.prototype.setScrollWidth; exports.ScrollBar = VScrollBar; // backward compatibility exports.ScrollBarV = VScrollBar; // backward compatibility exports.ScrollBarH = HScrollBar; // backward compatibility - exports.VScrollBar = VScrollBar; exports.HScrollBar = HScrollBar; -}); -ace.define("ace/renderloop",["require","exports","module","ace/lib/event"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/renderloop",["require","exports","module","ace/lib/event"], function(require, exports, module){"use strict"; var event = require("./lib/event"); - - -var RenderLoop = function(onRender, win) { - this.onRender = onRender; - this.pending = false; - this.changes = 0; - this.$recursionLimit = 2; - this.window = win || window; - var _self = this; - this._flush = function(ts) { - _self.pending = false; - var changes = _self.changes; - - if (changes) { - event.blockIdle(100); - _self.changes = 0; - _self.onRender(changes); - } - - if (_self.changes) { - if (_self.$recursionLimit-- < 0) return; - _self.schedule(); - } else { - _self.$recursionLimit = 2; - } - }; -}; - -(function() { - - this.schedule = function(change) { +var RenderLoop = /** @class */ (function () { + function RenderLoop(onRender, win) { + this.onRender = onRender; + this.pending = false; + this.changes = 0; + this.$recursionLimit = 2; + this.window = win || window; + var _self = this; + this._flush = function (ts) { + _self.pending = false; + var changes = _self.changes; + if (changes) { + event.blockIdle(100); + _self.changes = 0; + _self.onRender(changes); + } + if (_self.changes) { + if (_self.$recursionLimit-- < 0) + return; + _self.schedule(); + } + else { + _self.$recursionLimit = 2; + } + }; + } + RenderLoop.prototype.schedule = function (change) { this.changes = this.changes | change; if (this.changes && !this.pending) { event.nextFrame(this._flush); this.pending = true; } }; - - this.clear = function(change) { + RenderLoop.prototype.clear = function (change) { var changes = this.changes; this.changes = 0; return changes; }; - -}).call(RenderLoop.prototype); - + return RenderLoop; +}()); exports.RenderLoop = RenderLoop; -}); -ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"], function(require, exports, module) { +}); -var oop = require("../lib/oop"); +ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"], function(require, exports, module){var oop = require("../lib/oop"); var dom = require("../lib/dom"); var lang = require("../lib/lang"); var event = require("../lib/event"); var useragent = require("../lib/useragent"); var EventEmitter = require("../lib/event_emitter").EventEmitter; - -var CHAR_COUNT = 256; +var CHAR_COUNT = 512; var USE_OBSERVER = typeof ResizeObserver == "function"; var L = 200; - -var FontMetrics = exports.FontMetrics = function(parentEl) { - this.el = dom.createElement("div"); - this.$setMeasureNodeStyles(this.el.style, true); - - this.$main = dom.createElement("div"); - this.$setMeasureNodeStyles(this.$main.style); - - this.$measureNode = dom.createElement("div"); - this.$setMeasureNodeStyles(this.$measureNode.style); - - - this.el.appendChild(this.$main); - this.el.appendChild(this.$measureNode); - parentEl.appendChild(this.el); - - this.$measureNode.textContent = lang.stringRepeat("X", CHAR_COUNT); - - this.$characterSize = {width: 0, height: 0}; - - - if (USE_OBSERVER) - this.$addObserver(); - else - this.checkForSizeChanges(); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.$characterSize = {width: 0, height: 0}; - - this.$setMeasureNodeStyles = function(style, isRoot) { +var FontMetrics = /** @class */ (function () { + function FontMetrics(parentEl) { + this.el = dom.createElement("div"); + this.$setMeasureNodeStyles(this.el.style, true); + this.$main = dom.createElement("div"); + this.$setMeasureNodeStyles(this.$main.style); + this.$measureNode = dom.createElement("div"); + this.$setMeasureNodeStyles(this.$measureNode.style); + this.el.appendChild(this.$main); + this.el.appendChild(this.$measureNode); + parentEl.appendChild(this.el); + this.$measureNode.textContent = lang.stringRepeat("X", CHAR_COUNT); + this.$characterSize = { width: 0, height: 0 }; + if (USE_OBSERVER) + this.$addObserver(); + else + this.checkForSizeChanges(); + } + FontMetrics.prototype.$setMeasureNodeStyles = function (style, isRoot) { style.width = style.height = "auto"; style.left = style.top = "0px"; style.visibility = "hidden"; style.position = "absolute"; style.whiteSpace = "pre"; - if (useragent.isIE < 8) { style["font-family"] = "inherit"; - } else { + } + else { style.font = "inherit"; } style.overflow = isRoot ? "hidden" : "visible"; }; - - this.checkForSizeChanges = function(size) { + FontMetrics.prototype.checkForSizeChanges = function (size) { if (size === undefined) size = this.$measureSizes(); if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) { @@ -35737,39 +35723,35 @@ var FontMetrics = exports.FontMetrics = function(parentEl) { this.$characterSize = size; this.charSizes = Object.create(null); this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height; - this._emit("changeCharacterSize", {data: size}); + this._emit("changeCharacterSize", { data: size }); } }; - - this.$addObserver = function() { + FontMetrics.prototype.$addObserver = function () { var self = this; - this.$observer = new window.ResizeObserver(function(e) { + this.$observer = new window.ResizeObserver(function (e) { self.checkForSizeChanges(); }); this.$observer.observe(this.$measureNode); }; - - this.$pollSizeChanges = function() { + FontMetrics.prototype.$pollSizeChanges = function () { if (this.$pollSizeChangesTimer || this.$observer) return this.$pollSizeChangesTimer; var self = this; - return this.$pollSizeChangesTimer = event.onIdle(function cb() { self.checkForSizeChanges(); event.onIdle(cb, 500); }, 500); }; - - this.setPolling = function(val) { + FontMetrics.prototype.setPolling = function (val) { if (val) { this.$pollSizeChanges(); - } else if (this.$pollSizeChangesTimer) { + } + else if (this.$pollSizeChangesTimer) { clearInterval(this.$pollSizeChangesTimer); this.$pollSizeChangesTimer = 0; } }; - - this.$measureSizes = function(node) { + FontMetrics.prototype.$measureSizes = function (node) { var size = { height: (node || this.$measureNode).clientHeight, width: (node || this.$measureNode).clientWidth / CHAR_COUNT @@ -35778,43 +35760,39 @@ var FontMetrics = exports.FontMetrics = function(parentEl) { return null; return size; }; - - this.$measureCharWidth = function(ch) { + FontMetrics.prototype.$measureCharWidth = function (ch) { this.$main.textContent = lang.stringRepeat(ch, CHAR_COUNT); var rect = this.$main.getBoundingClientRect(); return rect.width / CHAR_COUNT; }; - - this.getCharacterWidth = function(ch) { + FontMetrics.prototype.getCharacterWidth = function (ch) { var w = this.charSizes[ch]; if (w === undefined) { w = this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width; } return w; }; - - this.destroy = function() { + FontMetrics.prototype.destroy = function () { clearInterval(this.$pollSizeChangesTimer); if (this.$observer) this.$observer.disconnect(); if (this.el && this.el.parentNode) this.el.parentNode.removeChild(this.el); }; - - - this.$getZoom = function getZoom(element) { - if (!element || !element.parentElement) return 1; - return (window.getComputedStyle(element).zoom || 1) * getZoom(element.parentElement); + FontMetrics.prototype.$getZoom = function (element) { + if (!element || !element.parentElement) + return 1; + return (Number(window.getComputedStyle(element)["zoom"]) || 1) * this.$getZoom(element.parentElement); }; - this.$initTransformMeasureNodes = function() { - var t = function(t, l) { + FontMetrics.prototype.$initTransformMeasureNodes = function () { + var t = function (t, l) { return ["div", { - style: "position: absolute;top:" + t + "px;left:" + l + "px;" - }]; + style: "position: absolute;top:" + t + "px;left:" + l + "px;" + }]; }; this.els = dom.buildDom([t(0, 0), t(L, 0), t(0, L), t(L, L)], this.el); }; - this.transformCoordinates = function(clientPos, elPos) { + FontMetrics.prototype.transformCoordinates = function (clientPos, elPos) { if (clientPos) { var zoom = this.$getZoom(this.el); clientPos = mul(1 / zoom, clientPos); @@ -35829,45 +35807,177 @@ var FontMetrics = exports.FontMetrics = function(parentEl) { function sub(a, b) { return [a[0] - b[0], a[1] - b[1]]; } function add(a, b) { return [a[0] + b[0], a[1] + b[1]]; } function mul(a, b) { return [a * b[0], a * b[1]]; } - if (!this.els) this.$initTransformMeasureNodes(); - function p(el) { var r = el.getBoundingClientRect(); return [r.left, r.top]; } - var a = p(this.els[0]); var b = p(this.els[1]); var c = p(this.els[2]); var d = p(this.els[3]); - var h = solve(sub(d, b), sub(d, c), sub(add(b, c), add(d, a))); - var m1 = mul(1 + h[0], sub(b, a)); var m2 = mul(1 + h[1], sub(c, a)); - if (elPos) { var x = elPos; var k = h[0] * x[0] / L + h[1] * x[1] / L + 1; var ut = add(mul(x[0], m1), mul(x[1], m2)); - return add(mul(1 / k / L, ut), a); + return add(mul(1 / k / L, ut), a); } var u = sub(clientPos, a); var f = solve(sub(m1, mul(h[0], u)), sub(m2, mul(h[1], u)), u); return mul(L, f); }; + return FontMetrics; +}()); +FontMetrics.prototype.$characterSize = { width: 0, height: 0 }; +oop.implement(FontMetrics.prototype, EventEmitter); +exports.FontMetrics = FontMetrics; + +}); -}).call(FontMetrics.prototype); +ace.define("ace/css/editor-css",["require","exports","module"], function(require, exports, module){/* +styles = [] +for (var i = 1; i < 16; i++) { + styles.push(".ace_br" + i + "{" + ( + ["top-left", "top-right", "bottom-right", "bottom-left"] + ).map(function(x, j) { + return i & (1< .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n max-width: 100%;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre-wrap;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n overflow: auto;\n max-width: min(60em, 66vw);\n overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n position: relative;\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n z-index: 1;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n}\n\n.ace_ghost_text_container > div {\n white-space: pre;\n}\n\n.ghost_text_line_wrapped::after {\n content: \"\u21A9\";\n position: absolute;\n}\n\n.ace_lineWidgetContainer.ace_ghost_text {\n margin: 0px 4px\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}\n\n.ace_hidden_token {\n display: none;\n}"; }); -ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"], function(require, exports, module) { -"use strict"; +ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module){"use strict"; +var dom = require("../lib/dom"); +var oop = require("../lib/oop"); +var EventEmitter = require("../lib/event_emitter").EventEmitter; +var Decorator = /** @class */ (function () { + function Decorator(parent, renderer) { + this.canvas = dom.createElement("canvas"); + this.renderer = renderer; + this.pixelRatio = 1; + this.maxHeight = renderer.layerConfig.maxHeight; + this.lineHeight = renderer.layerConfig.lineHeight; + this.canvasHeight = parent.parent.scrollHeight; + this.heightRatio = this.canvasHeight / this.maxHeight; + this.canvasWidth = parent.width; + this.minDecorationHeight = (2 * this.pixelRatio) | 0; + this.halfMinDecorationHeight = (this.minDecorationHeight / 2) | 0; + this.canvas.width = this.canvasWidth; + this.canvas.height = this.canvasHeight; + this.canvas.style.top = 0 + "px"; + this.canvas.style.right = 0 + "px"; + this.canvas.style.zIndex = 7 + "px"; + this.canvas.style.position = "absolute"; + this.colors = {}; + this.colors.dark = { + "error": "rgba(255, 18, 18, 1)", + "warning": "rgba(18, 136, 18, 1)", + "info": "rgba(18, 18, 136, 1)" + }; + this.colors.light = { + "error": "rgb(255,51,51)", + "warning": "rgb(32,133,72)", + "info": "rgb(35,68,138)" + }; + parent.element.appendChild(this.canvas); + } + Decorator.prototype.$updateDecorators = function (config) { + var colors = (this.renderer.theme.isDark === true) ? this.colors.dark : this.colors.light; + if (config) { + this.maxHeight = config.maxHeight; + this.lineHeight = config.lineHeight; + this.canvasHeight = config.height; + var allLineHeight = (config.lastRow + 1) * this.lineHeight; + if (allLineHeight < this.canvasHeight) { + this.heightRatio = 1; + } + else { + this.heightRatio = this.canvasHeight / this.maxHeight; + } + } + var ctx = this.canvas.getContext("2d"); + function compare(a, b) { + if (a.priority < b.priority) + return -1; + if (a.priority > b.priority) + return 1; + return 0; + } + var annotations = this.renderer.session.$annotations; + ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); + if (annotations) { + var priorities = { + "info": 1, + "warning": 2, + "error": 3 + }; + annotations.forEach(function (item) { + item.priority = priorities[item.type] || null; + }); + annotations = annotations.sort(compare); + var foldData = this.renderer.session.$foldData; + for (var i = 0; i < annotations.length; i++) { + var row = annotations[i].row; + var compensateFold = this.compensateFoldRows(row, foldData); + var currentY = Math.round((row - compensateFold) * this.lineHeight * this.heightRatio); + var y1 = Math.round(((row - compensateFold) * this.lineHeight * this.heightRatio)); + var y2 = Math.round((((row - compensateFold) * this.lineHeight + this.lineHeight) * this.heightRatio)); + var height = y2 - y1; + if (height < this.minDecorationHeight) { + var yCenter = ((y1 + y2) / 2) | 0; + if (yCenter < this.halfMinDecorationHeight) { + yCenter = this.halfMinDecorationHeight; + } + else if (yCenter + this.halfMinDecorationHeight > this.canvasHeight) { + yCenter = this.canvasHeight - this.halfMinDecorationHeight; + } + y1 = Math.round(yCenter - this.halfMinDecorationHeight); + y2 = Math.round(yCenter + this.halfMinDecorationHeight); + } + ctx.fillStyle = colors[annotations[i].type] || null; + ctx.fillRect(0, currentY, this.canvasWidth, y2 - y1); + } + } + var cursor = this.renderer.session.selection.getCursor(); + if (cursor) { + var compensateFold = this.compensateFoldRows(cursor.row, foldData); + var currentY = Math.round((cursor.row - compensateFold) * this.lineHeight * this.heightRatio); + ctx.fillStyle = "rgba(0, 0, 0, 0.5)"; + ctx.fillRect(0, currentY, this.canvasWidth, 2); + } + }; + Decorator.prototype.compensateFoldRows = function (row, foldData) { + var compensateFold = 0; + if (foldData && foldData.length > 0) { + for (var j = 0; j < foldData.length; j++) { + if (row > foldData[j].start.row && row < foldData[j].end.row) { + compensateFold += row - foldData[j].start.row; + } + else if (row >= foldData[j].end.row) { + compensateFold += foldData[j].end.row - foldData[j].start.row; + } + } + } + return compensateFold; + }; + return Decorator; +}()); +oop.implement(Decorator.prototype, EventEmitter); +exports.Decorator = Decorator; + +}); +ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"], function(require, exports, module){"use strict"; var oop = require("./lib/oop"); var dom = require("./lib/dom"); +var lang = require("./lib/lang"); var config = require("./config"); var GutterLayer = require("./layer/gutter").Gutter; var MarkerLayer = require("./layer/marker").Marker; @@ -35875,661 +35985,133 @@ var TextLayer = require("./layer/text").Text; var CursorLayer = require("./layer/cursor").Cursor; var HScrollBar = require("./scrollbar").HScrollBar; var VScrollBar = require("./scrollbar").VScrollBar; +var HScrollBarCustom = require("./scrollbar_custom").HScrollBar; +var VScrollBarCustom = require("./scrollbar_custom").VScrollBar; var RenderLoop = require("./renderloop").RenderLoop; var FontMetrics = require("./layer/font_metrics").FontMetrics; var EventEmitter = require("./lib/event_emitter").EventEmitter; -var editorCss = "\ -.ace_br1 {border-top-left-radius : 3px;}\ -.ace_br2 {border-top-right-radius : 3px;}\ -.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\ -.ace_br4 {border-bottom-right-radius: 3px;}\ -.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\ -.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\ -.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\ -.ace_br8 {border-bottom-left-radius : 3px;}\ -.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\ -.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\ -.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\ -.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\ -.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\ -.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\ -.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\ -.ace_editor {\ -position: relative;\ -overflow: hidden;\ -padding: 0;\ -font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\ -direction: ltr;\ -text-align: left;\ --webkit-tap-highlight-color: rgba(0, 0, 0, 0);\ -}\ -.ace_scroller {\ -position: absolute;\ -overflow: hidden;\ -top: 0;\ -bottom: 0;\ -background-color: inherit;\ --ms-user-select: none;\ --moz-user-select: none;\ --webkit-user-select: none;\ -user-select: none;\ -cursor: text;\ -}\ -.ace_content {\ -position: absolute;\ -box-sizing: border-box;\ -min-width: 100%;\ -contain: style size layout;\ -font-variant-ligatures: no-common-ligatures;\ -}\ -.ace_dragging .ace_scroller:before{\ -position: absolute;\ -top: 0;\ -left: 0;\ -right: 0;\ -bottom: 0;\ -content: '';\ -background: rgba(250, 250, 250, 0.01);\ -z-index: 1000;\ -}\ -.ace_dragging.ace_dark .ace_scroller:before{\ -background: rgba(0, 0, 0, 0.01);\ -}\ -.ace_selecting, .ace_selecting * {\ -cursor: text !important;\ -}\ -.ace_gutter {\ -position: absolute;\ -overflow : hidden;\ -width: auto;\ -top: 0;\ -bottom: 0;\ -left: 0;\ -cursor: default;\ -z-index: 4;\ --ms-user-select: none;\ --moz-user-select: none;\ --webkit-user-select: none;\ -user-select: none;\ -contain: style size layout;\ -}\ -.ace_gutter-active-line {\ -position: absolute;\ -left: 0;\ -right: 0;\ -}\ -.ace_scroller.ace_scroll-left {\ -box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\ -}\ -.ace_gutter-cell {\ -position: absolute;\ -top: 0;\ -left: 0;\ -right: 0;\ -padding-left: 19px;\ -padding-right: 6px;\ -background-repeat: no-repeat;\ -}\ -.ace_gutter-cell.ace_error {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");\ -background-repeat: no-repeat;\ -background-position: 2px center;\ -}\ -.ace_gutter-cell.ace_warning {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");\ -background-position: 2px center;\ -}\ -.ace_gutter-cell.ace_info {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");\ -background-position: 2px center;\ -}\ -.ace_dark .ace_gutter-cell.ace_info {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");\ -}\ -.ace_scrollbar {\ -contain: strict;\ -position: absolute;\ -right: 0;\ -bottom: 0;\ -z-index: 6;\ -}\ -.ace_scrollbar-inner {\ -position: absolute;\ -cursor: text;\ -left: 0;\ -top: 0;\ -}\ -.ace_scrollbar-v{\ -overflow-x: hidden;\ -overflow-y: scroll;\ -top: 0;\ -}\ -.ace_scrollbar-h {\ -overflow-x: scroll;\ -overflow-y: hidden;\ -left: 0;\ -}\ -.ace_print-margin {\ -position: absolute;\ -height: 100%;\ -}\ -.ace_text-input {\ -position: absolute;\ -z-index: 0;\ -width: 0.5em;\ -height: 1em;\ -opacity: 0;\ -background: transparent;\ --moz-appearance: none;\ -appearance: none;\ -border: none;\ -resize: none;\ -outline: none;\ -overflow: hidden;\ -font: inherit;\ -padding: 0 1px;\ -margin: 0 -1px;\ -contain: strict;\ --ms-user-select: text;\ --moz-user-select: text;\ --webkit-user-select: text;\ -user-select: text;\ -white-space: pre!important;\ -}\ -.ace_text-input.ace_composition {\ -background: transparent;\ -color: inherit;\ -z-index: 1000;\ -opacity: 1;\ -}\ -.ace_composition_placeholder { color: transparent }\ -.ace_composition_marker { \ -border-bottom: 1px solid;\ -position: absolute;\ -border-radius: 0;\ -margin-top: 1px;\ -}\ -[ace_nocontext=true] {\ -transform: none!important;\ -filter: none!important;\ -clip-path: none!important;\ -mask : none!important;\ -contain: none!important;\ -perspective: none!important;\ -mix-blend-mode: initial!important;\ -z-index: auto;\ -}\ -.ace_layer {\ -z-index: 1;\ -position: absolute;\ -overflow: hidden;\ -word-wrap: normal;\ -white-space: pre;\ -height: 100%;\ -width: 100%;\ -box-sizing: border-box;\ -pointer-events: none;\ -}\ -.ace_gutter-layer {\ -position: relative;\ -width: auto;\ -text-align: right;\ -pointer-events: auto;\ -height: 1000000px;\ -contain: style size layout;\ -}\ -.ace_text-layer {\ -font: inherit !important;\ -position: absolute;\ -height: 1000000px;\ -width: 1000000px;\ -contain: style size layout;\ -}\ -.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\ -contain: style size layout;\ -position: absolute;\ -top: 0;\ -left: 0;\ -right: 0;\ -}\ -.ace_hidpi .ace_text-layer,\ -.ace_hidpi .ace_gutter-layer,\ -.ace_hidpi .ace_content,\ -.ace_hidpi .ace_gutter {\ -contain: strict;\ -will-change: transform;\ -}\ -.ace_hidpi .ace_text-layer > .ace_line, \ -.ace_hidpi .ace_text-layer > .ace_line_group {\ -contain: strict;\ -}\ -.ace_cjk {\ -display: inline-block;\ -text-align: center;\ -}\ -.ace_cursor-layer {\ -z-index: 4;\ -}\ -.ace_cursor {\ -z-index: 4;\ -position: absolute;\ -box-sizing: border-box;\ -border-left: 2px solid;\ -transform: translatez(0);\ -}\ -.ace_multiselect .ace_cursor {\ -border-left-width: 1px;\ -}\ -.ace_slim-cursors .ace_cursor {\ -border-left-width: 1px;\ -}\ -.ace_overwrite-cursors .ace_cursor {\ -border-left-width: 0;\ -border-bottom: 1px solid;\ -}\ -.ace_hidden-cursors .ace_cursor {\ -opacity: 0.2;\ -}\ -.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\ -opacity: 0;\ -}\ -.ace_smooth-blinking .ace_cursor {\ -transition: opacity 0.18s;\ -}\ -.ace_animate-blinking .ace_cursor {\ -animation-duration: 1000ms;\ -animation-timing-function: step-end;\ -animation-name: blink-ace-animate;\ -animation-iteration-count: infinite;\ -}\ -.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\ -animation-duration: 1000ms;\ -animation-timing-function: ease-in-out;\ -animation-name: blink-ace-animate-smooth;\ -}\ -@keyframes blink-ace-animate {\ -from, to { opacity: 1; }\ -60% { opacity: 0; }\ -}\ -@keyframes blink-ace-animate-smooth {\ -from, to { opacity: 1; }\ -45% { opacity: 1; }\ -60% { opacity: 0; }\ -85% { opacity: 0; }\ -}\ -.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\ -position: absolute;\ -z-index: 3;\ -}\ -.ace_marker-layer .ace_selection {\ -position: absolute;\ -z-index: 5;\ -}\ -.ace_marker-layer .ace_bracket {\ -position: absolute;\ -z-index: 6;\ -}\ -.ace_marker-layer .ace_error_bracket {\ -position: absolute;\ -border-bottom: 1px solid #DE5555;\ -border-radius: 0;\ -}\ -.ace_marker-layer .ace_active-line {\ -position: absolute;\ -z-index: 2;\ -}\ -.ace_marker-layer .ace_selected-word {\ -position: absolute;\ -z-index: 4;\ -box-sizing: border-box;\ -}\ -.ace_line .ace_fold {\ -box-sizing: border-box;\ -display: inline-block;\ -height: 11px;\ -margin-top: -2px;\ -vertical-align: middle;\ -background-image:\ -url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\ -url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\ -background-repeat: no-repeat, repeat-x;\ -background-position: center center, top left;\ -color: transparent;\ -border: 1px solid black;\ -border-radius: 2px;\ -cursor: pointer;\ -pointer-events: auto;\ -}\ -.ace_dark .ace_fold {\ -}\ -.ace_fold:hover{\ -background-image:\ -url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\ -url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\ -}\ -.ace_tooltip {\ -background-color: #FFF;\ -background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));\ -border: 1px solid gray;\ -border-radius: 1px;\ -box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\ -color: black;\ -max-width: 100%;\ -padding: 3px 4px;\ -position: fixed;\ -z-index: 999999;\ -box-sizing: border-box;\ -cursor: default;\ -white-space: pre;\ -word-wrap: break-word;\ -line-height: normal;\ -font-style: normal;\ -font-weight: normal;\ -letter-spacing: normal;\ -pointer-events: none;\ -}\ -.ace_folding-enabled > .ace_gutter-cell {\ -padding-right: 13px;\ -}\ -.ace_fold-widget {\ -box-sizing: border-box;\ -margin: 0 -12px 0 1px;\ -display: none;\ -width: 11px;\ -vertical-align: top;\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\ -background-repeat: no-repeat;\ -background-position: center;\ -border-radius: 3px;\ -border: 1px solid transparent;\ -cursor: pointer;\ -}\ -.ace_folding-enabled .ace_fold-widget {\ -display: inline-block; \ -}\ -.ace_fold-widget.ace_end {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\ -}\ -.ace_fold-widget.ace_closed {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\ -}\ -.ace_fold-widget:hover {\ -border: 1px solid rgba(0, 0, 0, 0.3);\ -background-color: rgba(255, 255, 255, 0.2);\ -box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\ -}\ -.ace_fold-widget:active {\ -border: 1px solid rgba(0, 0, 0, 0.4);\ -background-color: rgba(0, 0, 0, 0.05);\ -box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\ -}\ -.ace_dark .ace_fold-widget {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\ -}\ -.ace_dark .ace_fold-widget.ace_end {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\ -}\ -.ace_dark .ace_fold-widget.ace_closed {\ -background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\ -}\ -.ace_dark .ace_fold-widget:hover {\ -box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ -background-color: rgba(255, 255, 255, 0.1);\ -}\ -.ace_dark .ace_fold-widget:active {\ -box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\ -}\ -.ace_inline_button {\ -border: 1px solid lightgray;\ -display: inline-block;\ -margin: -1px 8px;\ -padding: 0 5px;\ -pointer-events: auto;\ -cursor: pointer;\ -}\ -.ace_inline_button:hover {\ -border-color: gray;\ -background: rgba(200,200,200,0.2);\ -display: inline-block;\ -pointer-events: auto;\ -}\ -.ace_fold-widget.ace_invalid {\ -background-color: #FFB4B4;\ -border-color: #DE5555;\ -}\ -.ace_fade-fold-widgets .ace_fold-widget {\ -transition: opacity 0.4s ease 0.05s;\ -opacity: 0;\ -}\ -.ace_fade-fold-widgets:hover .ace_fold-widget {\ -transition: opacity 0.05s ease 0.05s;\ -opacity:1;\ -}\ -.ace_underline {\ -text-decoration: underline;\ -}\ -.ace_bold {\ -font-weight: bold;\ -}\ -.ace_nobold .ace_bold {\ -font-weight: normal;\ -}\ -.ace_italic {\ -font-style: italic;\ -}\ -.ace_error-marker {\ -background-color: rgba(255, 0, 0,0.2);\ -position: absolute;\ -z-index: 9;\ -}\ -.ace_highlight-marker {\ -background-color: rgba(255, 255, 0,0.2);\ -position: absolute;\ -z-index: 8;\ -}\ -.ace_mobile-menu {\ -position: absolute;\ -line-height: 1.5;\ -border-radius: 4px;\ --ms-user-select: none;\ --moz-user-select: none;\ --webkit-user-select: none;\ -user-select: none;\ -background: white;\ -box-shadow: 1px 3px 2px grey;\ -border: 1px solid #dcdcdc;\ -color: black;\ -}\ -.ace_dark > .ace_mobile-menu {\ -background: #333;\ -color: #ccc;\ -box-shadow: 1px 3px 2px grey;\ -border: 1px solid #444;\ -}\ -.ace_mobile-button {\ -padding: 2px;\ -cursor: pointer;\ -overflow: hidden;\ -}\ -.ace_mobile-button:hover {\ -background-color: #eee;\ -opacity:1;\ -}\ -.ace_mobile-button:active {\ -background-color: #ddd;\ -}\ -.ace_placeholder {\ -font-family: arial;\ -transform: scale(0.9);\ -transform-origin: left;\ -white-space: pre;\ -opacity: 0.7;\ -margin: 0 10px;\ -}"; - +var editorCss = require("./css/editor-css"); +var Decorator = require("./layer/decorators").Decorator; var useragent = require("./lib/useragent"); -var HIDE_TEXTAREA = useragent.isIE; - -dom.importCssString(editorCss, "ace_editor.css"); - -var VirtualRenderer = function(container, theme) { - var _self = this; - - this.container = container || dom.createElement("div"); - - dom.addCssClass(this.container, "ace_editor"); - if (dom.HI_DPI) dom.addCssClass(this.container, "ace_hidpi"); - - this.setTheme(theme); - - this.$gutter = dom.createElement("div"); - this.$gutter.className = "ace_gutter"; - this.container.appendChild(this.$gutter); - this.$gutter.setAttribute("aria-hidden", true); - - this.scroller = dom.createElement("div"); - this.scroller.className = "ace_scroller"; - - this.container.appendChild(this.scroller); - - this.content = dom.createElement("div"); - this.content.className = "ace_content"; - this.scroller.appendChild(this.content); - - this.$gutterLayer = new GutterLayer(this.$gutter); - this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)); - - this.$markerBack = new MarkerLayer(this.content); - - var textLayer = this.$textLayer = new TextLayer(this.content); - this.canvas = textLayer.element; - - this.$markerFront = new MarkerLayer(this.content); - - this.$cursorLayer = new CursorLayer(this.content); - this.$horizScroll = false; - this.$vScroll = false; - - this.scrollBar = - this.scrollBarV = new VScrollBar(this.container, this); - this.scrollBarH = new HScrollBar(this.container, this); - this.scrollBarV.on("scroll", function(e) { - if (!_self.$scrollAnimation) - _self.session.setScrollTop(e.data - _self.scrollMargin.top); - }); - this.scrollBarH.on("scroll", function(e) { - if (!_self.$scrollAnimation) - _self.session.setScrollLeft(e.data - _self.scrollMargin.left); - }); - - this.scrollTop = 0; - this.scrollLeft = 0; - - this.cursorPos = { - row : 0, - column : 0 - }; - - this.$fontMetrics = new FontMetrics(this.container); - this.$textLayer.$setFontMetrics(this.$fontMetrics); - this.$textLayer.on("changeCharacterSize", function(e) { - _self.updateCharacterSize(); - _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); - _self._signal("changeCharacterSize", e); - }); - - this.$size = { - width: 0, - height: 0, - scrollerHeight: 0, - scrollerWidth: 0, - $dirty: true - }; - - this.layerConfig = { - width : 1, - padding : 0, - firstRow : 0, - firstRowScreen: 0, - lastRow : 0, - lineHeight : 0, - characterWidth : 0, - minHeight : 1, - maxHeight : 1, - offset : 0, - height : 1, - gutterOffset: 1 - }; - - this.scrollMargin = { - left: 0, - right: 0, - top: 0, - bottom: 0, - v: 0, - h: 0 - }; - - this.margin = { - left: 0, - right: 0, - top: 0, - bottom: 0, - v: 0, - h: 0 - }; - - this.$keepTextAreaAtCursor = !useragent.isIOS; - - this.$loop = new RenderLoop( - this.$renderChanges.bind(this), - this.container.ownerDocument.defaultView - ); - this.$loop.schedule(this.CHANGE_FULL); - - this.updateCharacterSize(); - this.setPadding(4); - config.resetOptions(this); - config._signal("renderer", this); -}; - -(function() { - - this.CHANGE_CURSOR = 1; - this.CHANGE_MARKER = 2; - this.CHANGE_GUTTER = 4; - this.CHANGE_SCROLL = 8; - this.CHANGE_LINES = 16; - this.CHANGE_TEXT = 32; - this.CHANGE_SIZE = 64; - this.CHANGE_MARKER_BACK = 128; - this.CHANGE_MARKER_FRONT = 256; - this.CHANGE_FULL = 512; - this.CHANGE_H_SCROLL = 1024; - - oop.implement(this, EventEmitter); - - this.updateCharacterSize = function() { +var isTextToken = require("./layer/text_util").isTextToken; +dom.importCssString(editorCss, "ace_editor.css", false); +var VirtualRenderer = /** @class */ (function () { + function VirtualRenderer(container, theme) { + var _self = this; + this.container = container || dom.createElement("div"); + dom.addCssClass(this.container, "ace_editor"); + if (dom.HI_DPI) + dom.addCssClass(this.container, "ace_hidpi"); + this.setTheme(theme); + if (config.get("useStrictCSP") == null) + config.set("useStrictCSP", false); + this.$gutter = dom.createElement("div"); + this.$gutter.className = "ace_gutter"; + this.container.appendChild(this.$gutter); + this.$gutter.setAttribute("aria-hidden", "true"); + this.scroller = dom.createElement("div"); + this.scroller.className = "ace_scroller"; + this.container.appendChild(this.scroller); + this.content = dom.createElement("div"); + this.content.className = "ace_content"; + this.scroller.appendChild(this.content); + this.$gutterLayer = new GutterLayer(this.$gutter); + this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)); + this.$markerBack = new MarkerLayer(this.content); + var textLayer = this.$textLayer = new TextLayer(this.content); + this.canvas = textLayer.element; + this.$markerFront = new MarkerLayer(this.content); + this.$cursorLayer = new CursorLayer(this.content); + this.$horizScroll = false; + this.$vScroll = false; + this.scrollBar = + this.scrollBarV = new VScrollBar(this.container, this); + this.scrollBarH = new HScrollBar(this.container, this); + this.scrollBarV.on("scroll", function (e) { + if (!_self.$scrollAnimation) + _self.session.setScrollTop(e.data - _self.scrollMargin.top); + }); + this.scrollBarH.on("scroll", function (e) { + if (!_self.$scrollAnimation) + _self.session.setScrollLeft(e.data - _self.scrollMargin.left); + }); + this.scrollTop = 0; + this.scrollLeft = 0; + this.cursorPos = { + row: 0, + column: 0 + }; + this.$fontMetrics = new FontMetrics(this.container); + this.$textLayer.$setFontMetrics(this.$fontMetrics); + this.$textLayer.on("changeCharacterSize", function (e) { + _self.updateCharacterSize(); + _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); + _self._signal("changeCharacterSize", e); + }); + this.$size = { + width: 0, + height: 0, + scrollerHeight: 0, + scrollerWidth: 0, + $dirty: true + }; + this.layerConfig = { + width: 1, + padding: 0, + firstRow: 0, + firstRowScreen: 0, + lastRow: 0, + lineHeight: 0, + characterWidth: 0, + minHeight: 1, + maxHeight: 1, + offset: 0, + height: 1, + gutterOffset: 1 + }; + this.scrollMargin = { + left: 0, + right: 0, + top: 0, + bottom: 0, + v: 0, + h: 0 + }; + this.margin = { + left: 0, + right: 0, + top: 0, + bottom: 0, + v: 0, + h: 0 + }; + this.$keepTextAreaAtCursor = !useragent.isIOS; + this.$loop = new RenderLoop(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView); + this.$loop.schedule(this.CHANGE_FULL); + this.updateCharacterSize(); + this.setPadding(4); + this.$addResizeObserver(); + config.resetOptions(this); + config._signal("renderer", this); + } + VirtualRenderer.prototype.updateCharacterSize = function () { if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) { this.$allowBoldFonts = this.$textLayer.allowBoldFonts; this.setStyle("ace_nobold", !this.$allowBoldFonts); } - this.layerConfig.characterWidth = - this.characterWidth = this.$textLayer.getCharacterWidth(); + this.characterWidth = this.$textLayer.getCharacterWidth(); this.layerConfig.lineHeight = - this.lineHeight = this.$textLayer.getLineHeight(); + this.lineHeight = this.$textLayer.getLineHeight(); this.$updatePrintMargin(); dom.setStyle(this.scroller.style, "line-height", this.lineHeight + "px"); }; - this.setSession = function(session) { + VirtualRenderer.prototype.setSession = function (session) { if (this.session) this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode); - this.session = session; if (session && this.scrollMargin.top && session.getScrollTop() <= 0) session.setScrollTop(-this.scrollMargin.top); - this.$cursorLayer.setSession(session); this.$markerBack.setSession(session); this.$markerFront.setSession(session); @@ -36537,19 +36119,16 @@ var VirtualRenderer = function(container, theme) { this.$textLayer.setSession(session); if (!session) return; - this.$loop.schedule(this.CHANGE_FULL); this.session.$setFontMetrics(this.$fontMetrics); this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null; - this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this); this.onChangeNewLineMode(); this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode); }; - this.updateLines = function(firstRow, lastRow, force) { + VirtualRenderer.prototype.updateLines = function (firstRow, lastRow, force) { if (lastRow === undefined) lastRow = Infinity; - if (!this.$changedLines) { this.$changedLines = { firstRow: firstRow, @@ -36559,7 +36138,6 @@ var VirtualRenderer = function(container, theme) { else { if (this.$changedLines.firstRow > firstRow) this.$changedLines.firstRow = firstRow; - if (this.$changedLines.lastRow < lastRow) this.$changedLines.lastRow = lastRow; } @@ -36573,38 +36151,34 @@ var VirtualRenderer = function(container, theme) { return; this.$loop.schedule(this.CHANGE_LINES); }; - - this.onChangeNewLineMode = function() { + VirtualRenderer.prototype.onChangeNewLineMode = function () { this.$loop.schedule(this.CHANGE_TEXT); this.$textLayer.$updateEolChar(); this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR); }; - - this.onChangeTabSize = function() { + VirtualRenderer.prototype.onChangeTabSize = function () { this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER); this.$textLayer.onChangeTabSize(); }; - this.updateText = function() { + VirtualRenderer.prototype.updateText = function () { this.$loop.schedule(this.CHANGE_TEXT); }; - this.updateFull = function(force) { + VirtualRenderer.prototype.updateFull = function (force) { if (force) this.$renderChanges(this.CHANGE_FULL, true); else this.$loop.schedule(this.CHANGE_FULL); }; - this.updateFontSize = function() { + VirtualRenderer.prototype.updateFontSize = function () { this.$textLayer.checkForSizeChanges(); }; - - this.$changes = 0; - this.$updateSizeAsync = function() { + VirtualRenderer.prototype.$updateSizeAsync = function () { if (this.$loop.pending) this.$size.$dirty = true; else this.onResize(); }; - this.onResize = function(force, gutterWidth, width, height) { + VirtualRenderer.prototype.onResize = function (force, gutterWidth, width, height) { if (this.resizing > 2) return; else if (this.resizing > 0) @@ -36614,28 +36188,33 @@ var VirtualRenderer = function(container, theme) { var el = this.container; if (!height) height = el.clientHeight || el.scrollHeight; + if (!height && this.$maxLines && this.lineHeight > 1) { + if (!el.style.height || el.style.height == "0px") { + el.style.height = "1px"; + height = el.clientHeight || el.scrollHeight; + } + } if (!width) width = el.clientWidth || el.scrollWidth; var changes = this.$updateCachedSize(force, gutterWidth, width, height); - - + if (this.$resizeTimer) + this.$resizeTimer.cancel(); if (!this.$size.scrollerHeight || (!width && !height)) return this.resizing = 0; - if (force) this.$gutterLayer.$padding = null; - if (force) this.$renderChanges(changes | this.$changes, true); else this.$loop.schedule(changes | this.$changes); - if (this.resizing) this.resizing = 0; - this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null; + this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null; + if (this.$customScrollbar) { + this.$updateCustomScrollbar(true); + } }; - - this.$updateCachedSize = function(force, gutterWidth, width, height) { + VirtualRenderer.prototype.$updateCachedSize = function (force, gutterWidth, width, height) { height -= (this.$extraHeight || 0); var changes = 0; var size = this.$size; @@ -36648,124 +36227,114 @@ var VirtualRenderer = function(container, theme) { if (height && (force || size.height != height)) { size.height = height; changes |= this.CHANGE_SIZE; - size.scrollerHeight = size.height; if (this.$horizScroll) size.scrollerHeight -= this.scrollBarH.getHeight(); + this.scrollBarV.setHeight(size.scrollerHeight); this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px"; - changes = changes | this.CHANGE_SCROLL; } - if (width && (force || size.width != width)) { changes |= this.CHANGE_SIZE; size.width = width; - if (gutterWidth == null) gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; - this.gutterWidth = gutterWidth; - dom.setStyle(this.scrollBarH.element.style, "left", gutterWidth + "px"); dom.setStyle(this.scroller.style, "left", gutterWidth + this.margin.left + "px"); size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth() - this.margin.h); dom.setStyle(this.$gutter.style, "left", this.margin.left + "px"); - var right = this.scrollBarV.getWidth() + "px"; dom.setStyle(this.scrollBarH.element.style, "right", right); dom.setStyle(this.scroller.style, "right", right); dom.setStyle(this.scroller.style, "bottom", this.scrollBarH.getHeight()); - + this.scrollBarH.setWidth(size.scrollerWidth); if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) { changes |= this.CHANGE_FULL; } } - size.$dirty = !width || !height; - if (changes) this._signal("resize", oldSize); - return changes; }; - - this.onGutterResize = function(width) { + VirtualRenderer.prototype.onGutterResize = function (width) { var gutterWidth = this.$showGutter ? width : 0; if (gutterWidth != this.gutterWidth) this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height); - if (this.session.getUseWrapMode() && this.adjustWrapLimit()) { this.$loop.schedule(this.CHANGE_FULL); - } else if (this.$size.$dirty) { + } + else if (this.$size.$dirty) { this.$loop.schedule(this.CHANGE_FULL); - } else { + } + else { this.$computeLayerConfig(); } }; - this.adjustWrapLimit = function() { + VirtualRenderer.prototype.adjustWrapLimit = function () { var availableWidth = this.$size.scrollerWidth - this.$padding * 2; var limit = Math.floor(availableWidth / this.characterWidth); return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn); }; - this.setAnimatedScroll = function(shouldAnimate){ + VirtualRenderer.prototype.setAnimatedScroll = function (shouldAnimate) { this.setOption("animatedScroll", shouldAnimate); }; - this.getAnimatedScroll = function() { + VirtualRenderer.prototype.getAnimatedScroll = function () { return this.$animatedScroll; }; - this.setShowInvisibles = function(showInvisibles) { + VirtualRenderer.prototype.setShowInvisibles = function (showInvisibles) { this.setOption("showInvisibles", showInvisibles); this.session.$bidiHandler.setShowInvisibles(showInvisibles); }; - this.getShowInvisibles = function() { + VirtualRenderer.prototype.getShowInvisibles = function () { return this.getOption("showInvisibles"); }; - this.getDisplayIndentGuides = function() { + VirtualRenderer.prototype.getDisplayIndentGuides = function () { return this.getOption("displayIndentGuides"); }; - - this.setDisplayIndentGuides = function(display) { + VirtualRenderer.prototype.setDisplayIndentGuides = function (display) { this.setOption("displayIndentGuides", display); }; - this.setShowPrintMargin = function(showPrintMargin) { + VirtualRenderer.prototype.getHighlightIndentGuides = function () { + return this.getOption("highlightIndentGuides"); + }; + VirtualRenderer.prototype.setHighlightIndentGuides = function (highlight) { + this.setOption("highlightIndentGuides", highlight); + }; + VirtualRenderer.prototype.setShowPrintMargin = function (showPrintMargin) { this.setOption("showPrintMargin", showPrintMargin); }; - this.getShowPrintMargin = function() { + VirtualRenderer.prototype.getShowPrintMargin = function () { return this.getOption("showPrintMargin"); }; - this.setPrintMarginColumn = function(showPrintMargin) { - this.setOption("printMarginColumn", showPrintMargin); + VirtualRenderer.prototype.setPrintMarginColumn = function (printMarginColumn) { + this.setOption("printMarginColumn", printMarginColumn); }; - this.getPrintMarginColumn = function() { + VirtualRenderer.prototype.getPrintMarginColumn = function () { return this.getOption("printMarginColumn"); }; - this.getShowGutter = function(){ + VirtualRenderer.prototype.getShowGutter = function () { return this.getOption("showGutter"); }; - this.setShowGutter = function(show){ + VirtualRenderer.prototype.setShowGutter = function (show) { return this.setOption("showGutter", show); }; - - this.getFadeFoldWidgets = function(){ + VirtualRenderer.prototype.getFadeFoldWidgets = function () { return this.getOption("fadeFoldWidgets"); }; - - this.setFadeFoldWidgets = function(show) { + VirtualRenderer.prototype.setFadeFoldWidgets = function (show) { this.setOption("fadeFoldWidgets", show); }; - - this.setHighlightGutterLine = function(shouldHighlight) { + VirtualRenderer.prototype.setHighlightGutterLine = function (shouldHighlight) { this.setOption("highlightGutterLine", shouldHighlight); }; - - this.getHighlightGutterLine = function() { + VirtualRenderer.prototype.getHighlightGutterLine = function () { return this.getOption("highlightGutterLine"); }; - - this.$updatePrintMargin = function() { + VirtualRenderer.prototype.$updatePrintMargin = function () { if (!this.$showPrintMargin && !this.$printMarginEl) return; - if (!this.$printMarginEl) { var containerEl = dom.createElement("div"); containerEl.className = "ace_layer ace_print-margin-layer"; @@ -36774,25 +36343,24 @@ var VirtualRenderer = function(container, theme) { containerEl.appendChild(this.$printMarginEl); this.content.insertBefore(containerEl, this.content.firstChild); } - var style = this.$printMarginEl.style; style.left = Math.round(this.characterWidth * this.$printMarginColumn + this.$padding) + "px"; style.visibility = this.$showPrintMargin ? "visible" : "hidden"; - if (this.session && this.session.$wrap == -1) this.adjustWrapLimit(); }; - this.getContainerElement = function() { + VirtualRenderer.prototype.getContainerElement = function () { return this.container; }; - this.getMouseEventTarget = function() { + VirtualRenderer.prototype.getMouseEventTarget = function () { return this.scroller; }; - this.getTextAreaContainer = function() { + VirtualRenderer.prototype.getTextAreaContainer = function () { return this.container; }; - this.$moveTextAreaToCursor = function() { - if (this.$isMousePressed) return; + VirtualRenderer.prototype.$moveTextAreaToCursor = function () { + if (this.$isMousePressed) + return; var style = this.textarea.style; var composition = this.$composition; if (!this.$keepTextAreaAtCursor && !composition) { @@ -36804,18 +36372,15 @@ var VirtualRenderer = function(container, theme) { return; if (composition && composition.markerRange) pixelPos = this.$cursorLayer.getPixelPosition(composition.markerRange.start, true); - var config = this.layerConfig; var posTop = pixelPos.top; var posLeft = pixelPos.left; posTop -= config.offset; - - var h = composition && composition.useTextareaForIME ? this.lineHeight : HIDE_TEXTAREA ? 0 : 1; + var h = composition && composition.useTextareaForIME || useragent.isMobile ? this.lineHeight : 1; if (posTop < 0 || posTop > config.height - h) { dom.translate(this.textarea, 0, 0); return; } - var w = 1; var maxTop = this.$size.height - h; if (!composition) { @@ -36830,24 +36395,21 @@ var VirtualRenderer = function(container, theme) { posTop += this.lineHeight + 2; } } - posLeft -= this.scrollLeft; if (posLeft > this.$size.scrollerWidth - w) posLeft = this.$size.scrollerWidth - w; - posLeft += this.gutterWidth + this.margin.left; - dom.setStyle(style, "height", h + "px"); dom.setStyle(style, "width", w + "px"); dom.translate(this.textarea, Math.min(posLeft, this.$size.scrollerWidth - w), Math.min(posTop, maxTop)); }; - this.getFirstVisibleRow = function() { + VirtualRenderer.prototype.getFirstVisibleRow = function () { return this.layerConfig.firstRow; }; - this.getFirstFullyVisibleRow = function() { + VirtualRenderer.prototype.getFirstFullyVisibleRow = function () { return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1); }; - this.getLastFullyVisibleRow = function() { + VirtualRenderer.prototype.getLastFullyVisibleRow = function () { var config = this.layerConfig; var lastRow = config.lastRow; var top = this.session.documentToScreenRow(lastRow, 0) * config.lineHeight; @@ -36855,12 +36417,10 @@ var VirtualRenderer = function(container, theme) { return lastRow - 1; return lastRow; }; - this.getLastVisibleRow = function() { + VirtualRenderer.prototype.getLastVisibleRow = function () { return this.layerConfig.lastRow; }; - - this.$padding = null; - this.setPadding = function(padding) { + VirtualRenderer.prototype.setPadding = function (padding) { this.$padding = padding; this.$textLayer.setPadding(padding); this.$cursorLayer.setPadding(padding); @@ -36869,45 +36429,42 @@ var VirtualRenderer = function(container, theme) { this.$loop.schedule(this.CHANGE_FULL); this.$updatePrintMargin(); }; - - this.setScrollMargin = function(top, bottom, left, right) { + VirtualRenderer.prototype.setScrollMargin = function (top, bottom, left, right) { var sm = this.scrollMargin; - sm.top = top|0; - sm.bottom = bottom|0; - sm.right = right|0; - sm.left = left|0; + sm.top = top | 0; + sm.bottom = bottom | 0; + sm.right = right | 0; + sm.left = left | 0; sm.v = sm.top + sm.bottom; sm.h = sm.left + sm.right; if (sm.top && this.scrollTop <= 0 && this.session) this.session.setScrollTop(-sm.top); this.updateFull(); }; - - this.setMargin = function(top, bottom, left, right) { + VirtualRenderer.prototype.setMargin = function (top, bottom, left, right) { var sm = this.margin; - sm.top = top|0; - sm.bottom = bottom|0; - sm.right = right|0; - sm.left = left|0; + sm.top = top | 0; + sm.bottom = bottom | 0; + sm.right = right | 0; + sm.left = left | 0; sm.v = sm.top + sm.bottom; sm.h = sm.left + sm.right; this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height); this.updateFull(); }; - this.getHScrollBarAlwaysVisible = function() { + VirtualRenderer.prototype.getHScrollBarAlwaysVisible = function () { return this.$hScrollBarAlwaysVisible; }; - this.setHScrollBarAlwaysVisible = function(alwaysVisible) { + VirtualRenderer.prototype.setHScrollBarAlwaysVisible = function (alwaysVisible) { this.setOption("hScrollBarAlwaysVisible", alwaysVisible); }; - this.getVScrollBarAlwaysVisible = function() { + VirtualRenderer.prototype.getVScrollBarAlwaysVisible = function () { return this.$vScrollBarAlwaysVisible; }; - this.setVScrollBarAlwaysVisible = function(alwaysVisible) { + VirtualRenderer.prototype.setVScrollBarAlwaysVisible = function (alwaysVisible) { this.setOption("vScrollBarAlwaysVisible", alwaysVisible); }; - - this.$updateScrollBarV = function() { + VirtualRenderer.prototype.$updateScrollBarV = function () { var scrollHeight = this.layerConfig.maxHeight; var scrollerHeight = this.$size.scrollerHeight; if (!this.$maxLines && this.$scrollPastEnd) { @@ -36920,21 +36477,17 @@ var VirtualRenderer = function(container, theme) { this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v); this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top); }; - this.$updateScrollBarH = function() { + VirtualRenderer.prototype.$updateScrollBarH = function () { this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h); this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left); }; - - this.$frozen = false; - this.freeze = function() { + VirtualRenderer.prototype.freeze = function () { this.$frozen = true; }; - - this.unfreeze = function() { + VirtualRenderer.prototype.unfreeze = function () { this.$frozen = false; }; - - this.$renderChanges = function(changes, force) { + VirtualRenderer.prototype.$renderChanges = function (changes, force) { if (this.$changes) { changes |= this.$changes; this.$changes = 0; @@ -36950,23 +36503,19 @@ var VirtualRenderer = function(container, theme) { if (!this.lineHeight) { this.$textLayer.checkForSizeChanges(); } - this._signal("beforeRender", changes); - if (this.session && this.session.$bidiHandler) this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics); - var config = this.layerConfig; if (changes & this.CHANGE_FULL || changes & this.CHANGE_SIZE || changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES || changes & this.CHANGE_SCROLL || - changes & this.CHANGE_H_SCROLL - ) { + changes & this.CHANGE_H_SCROLL) { changes |= this.$computeLayerConfig() | this.$loop.clear(); if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) { - var st = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight; + var st = this.scrollTop + (config.firstRow - Math.max(this.layerConfig.firstRow, 0)) * this.lineHeight; if (st > 0) { this.scrollTop = st; changes = changes | this.CHANGE_SCROLL; @@ -36977,24 +36526,26 @@ var VirtualRenderer = function(container, theme) { this.$updateScrollBarV(); if (changes & this.CHANGE_H_SCROLL) this.$updateScrollBarH(); - dom.translate(this.content, -this.scrollLeft, -config.offset); - var width = config.width + 2 * this.$padding + "px"; var height = config.minHeight + "px"; - dom.setStyle(this.content.style, "width", width); dom.setStyle(this.content.style, "height", height); } if (changes & this.CHANGE_H_SCROLL) { dom.translate(this.content, -this.scrollLeft, -config.offset); - this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left"; + this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller " : "ace_scroller ace_scroll-left "; + if (this.enableKeyboardAccessibility) + this.scroller.className += this.keyboardFocusClassName; } if (changes & this.CHANGE_FULL) { this.$changedLines = null; this.$textLayer.update(config); if (this.$showGutter) this.$gutterLayer.update(config); + if (this.$customScrollbar) { + this.$scrollDecorator.$updateDecorators(config); + } this.$markerBack.update(config); this.$markerFront.update(config); this.$cursorLayer.update(config); @@ -37008,13 +36559,15 @@ var VirtualRenderer = function(container, theme) { this.$textLayer.update(config); else this.$textLayer.scrollLines(config); - if (this.$showGutter) { if (changes & this.CHANGE_GUTTER || changes & this.CHANGE_LINES) this.$gutterLayer.update(config); else this.$gutterLayer.scrollLines(config); } + if (this.$customScrollbar) { + this.$scrollDecorator.$updateDecorators(config); + } this.$markerBack.update(config); this.$markerFront.update(config); this.$cursorLayer.update(config); @@ -37022,86 +36575,80 @@ var VirtualRenderer = function(container, theme) { this._signal("afterRender", changes); return; } - if (changes & this.CHANGE_TEXT) { this.$changedLines = null; this.$textLayer.update(config); if (this.$showGutter) this.$gutterLayer.update(config); + if (this.$customScrollbar) { + this.$scrollDecorator.$updateDecorators(config); + } } else if (changes & this.CHANGE_LINES) { if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter) this.$gutterLayer.update(config); + if (this.$customScrollbar) { + this.$scrollDecorator.$updateDecorators(config); + } } else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) { if (this.$showGutter) this.$gutterLayer.update(config); + if (this.$customScrollbar) { + this.$scrollDecorator.$updateDecorators(config); + } } else if (changes & this.CHANGE_CURSOR) { if (this.$highlightGutterLine) this.$gutterLayer.updateLineHighlight(config); + if (this.$customScrollbar) { + this.$scrollDecorator.$updateDecorators(config); + } } - if (changes & this.CHANGE_CURSOR) { this.$cursorLayer.update(config); this.$moveTextAreaToCursor(); } - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) { this.$markerFront.update(config); } - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) { this.$markerBack.update(config); } - this._signal("afterRender", changes); }; - - - this.$autosize = function() { + VirtualRenderer.prototype.$autosize = function () { var height = this.session.getScreenLength() * this.lineHeight; var maxHeight = this.$maxLines * this.lineHeight; - var desiredHeight = Math.min(maxHeight, - Math.max((this.$minLines || 1) * this.lineHeight, height) - ) + this.scrollMargin.v + (this.$extraHeight || 0); + var desiredHeight = Math.min(maxHeight, Math.max((this.$minLines || 1) * this.lineHeight, height)) + this.scrollMargin.v + (this.$extraHeight || 0); if (this.$horizScroll) desiredHeight += this.scrollBarH.getHeight(); if (this.$maxPixelHeight && desiredHeight > this.$maxPixelHeight) desiredHeight = this.$maxPixelHeight; - var hideScrollbars = desiredHeight <= 2 * this.lineHeight; var vScroll = !hideScrollbars && height > maxHeight; - if (desiredHeight != this.desiredHeight || this.$size.height != this.desiredHeight || vScroll != this.$vScroll) { if (vScroll != this.$vScroll) { this.$vScroll = vScroll; this.scrollBarV.setVisible(vScroll); } - var w = this.container.clientWidth; this.container.style.height = desiredHeight + "px"; this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight); this.desiredHeight = desiredHeight; - this._signal("autosize"); } }; - - this.$computeLayerConfig = function() { + VirtualRenderer.prototype.$computeLayerConfig = function () { var session = this.session; var size = this.$size; - var hideScrollbars = size.height <= 2 * this.lineHeight; var screenLines = this.session.getScreenLength(); var maxHeight = screenLines * this.lineHeight; - var longestLine = this.$getLongestLine(); - var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible || size.scrollerWidth - longestLine - 2 * this.$padding < 0); - var hScrollChanged = this.$horizScroll !== horizScroll; if (hScrollChanged) { this.$horizScroll = horizScroll; @@ -37110,21 +36657,14 @@ var VirtualRenderer = function(container, theme) { var vScrollBefore = this.$vScroll; // autosize can change vscroll value in which case we need to update longestLine if (this.$maxLines && this.lineHeight > 1) this.$autosize(); - var minHeight = size.scrollerHeight + this.lineHeight; - var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd : 0; maxHeight += scrollPastEnd; - var sm = this.scrollMargin; - this.session.setScrollTop(Math.max(-sm.top, - Math.min(this.scrollTop, maxHeight - size.scrollerHeight + sm.bottom))); - - this.session.setScrollLeft(Math.max(-sm.left, Math.min(this.scrollLeft, - longestLine + 2 * this.$padding - size.scrollerWidth + sm.right))); - + this.session.setScrollTop(Math.max(-sm.top, Math.min(this.scrollTop, maxHeight - size.scrollerHeight + sm.bottom))); + this.session.setScrollLeft(Math.max(-sm.left, Math.min(this.scrollLeft, longestLine + 2 * this.$padding - size.scrollerWidth + sm.right))); var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible || size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop > sm.top); var vScrollChanged = vScrollBefore !== vScroll; @@ -37132,7 +36672,6 @@ var VirtualRenderer = function(container, theme) { this.$vScroll = vScroll; this.scrollBarV.setVisible(vScroll); } - var offset = this.scrollTop % this.lineHeight; var lineCount = Math.ceil(minHeight / this.lineHeight) - 1; var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight)); @@ -37144,16 +36683,12 @@ var VirtualRenderer = function(container, theme) { if (foldLine) { firstRow = foldLine.start.row; } - firstRowScreen = session.documentToScreenRow(firstRow, 0); firstRowHeight = session.getRowLength(firstRow) * lineHeight; - lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1); minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + - firstRowHeight; - + firstRowHeight; offset = this.scrollTop - firstRowScreen * lineHeight; - var changes = 0; if (this.layerConfig.width != longestLine || hScrollChanged) changes = this.CHANGE_H_SCROLL; @@ -37163,38 +36698,37 @@ var VirtualRenderer = function(container, theme) { if (vScrollChanged) longestLine = this.$getLongestLine(); } - this.layerConfig = { - width : longestLine, - padding : this.$padding, - firstRow : firstRow, + width: longestLine, + padding: this.$padding, + firstRow: firstRow, firstRowScreen: firstRowScreen, - lastRow : lastRow, - lineHeight : lineHeight, - characterWidth : this.characterWidth, - minHeight : minHeight, - maxHeight : maxHeight, - offset : offset, - gutterOffset : lineHeight ? Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)) : 0, - height : this.$size.scrollerHeight + lastRow: lastRow, + lineHeight: lineHeight, + characterWidth: this.characterWidth, + minHeight: minHeight, + maxHeight: maxHeight, + offset: offset, + gutterOffset: lineHeight ? Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)) : 0, + height: this.$size.scrollerHeight }; - if (this.session.$bidiHandler) this.session.$bidiHandler.setContentWidth(longestLine - this.$padding); - return changes; }; - - this.$updateLines = function() { - if (!this.$changedLines) return; + VirtualRenderer.prototype.$updateLines = function () { + if (!this.$changedLines) + return; var firstRow = this.$changedLines.firstRow; var lastRow = this.$changedLines.lastRow; this.$changedLines = null; - var layerConfig = this.layerConfig; - - if (firstRow > layerConfig.lastRow + 1) { return; } - if (lastRow < layerConfig.firstRow) { return; } + if (firstRow > layerConfig.lastRow + 1) { + return; + } + if (lastRow < layerConfig.firstRow) { + return; + } if (lastRow === Infinity) { if (this.$showGutter) this.$gutterLayer.update(layerConfig); @@ -37204,154 +36738,144 @@ var VirtualRenderer = function(container, theme) { this.$textLayer.updateLines(layerConfig, firstRow, lastRow); return true; }; - - this.$getLongestLine = function() { + VirtualRenderer.prototype.$getLongestLine = function () { var charCount = this.session.getScreenWidth(); if (this.showInvisibles && !this.session.$useWrapMode) charCount += 1; - if (this.$textLayer && charCount > this.$textLayer.MAX_LINE_LENGTH) charCount = this.$textLayer.MAX_LINE_LENGTH + 30; - return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth)); }; - this.updateFrontMarkers = function() { + VirtualRenderer.prototype.updateFrontMarkers = function () { this.$markerFront.setMarkers(this.session.getMarkers(true)); this.$loop.schedule(this.CHANGE_MARKER_FRONT); }; - this.updateBackMarkers = function() { + VirtualRenderer.prototype.updateBackMarkers = function () { this.$markerBack.setMarkers(this.session.getMarkers()); this.$loop.schedule(this.CHANGE_MARKER_BACK); }; - this.addGutterDecoration = function(row, className){ + VirtualRenderer.prototype.addGutterDecoration = function (row, className) { this.$gutterLayer.addGutterDecoration(row, className); }; - this.removeGutterDecoration = function(row, className){ + VirtualRenderer.prototype.removeGutterDecoration = function (row, className) { this.$gutterLayer.removeGutterDecoration(row, className); }; - this.updateBreakpoints = function(rows) { + VirtualRenderer.prototype.updateBreakpoints = function (rows) { + this._rows = rows; this.$loop.schedule(this.CHANGE_GUTTER); }; - this.setAnnotations = function(annotations) { + VirtualRenderer.prototype.setAnnotations = function (annotations) { this.$gutterLayer.setAnnotations(annotations); this.$loop.schedule(this.CHANGE_GUTTER); }; - this.updateCursor = function() { + VirtualRenderer.prototype.updateCursor = function () { this.$loop.schedule(this.CHANGE_CURSOR); }; - this.hideCursor = function() { + VirtualRenderer.prototype.hideCursor = function () { this.$cursorLayer.hideCursor(); }; - this.showCursor = function() { + VirtualRenderer.prototype.showCursor = function () { this.$cursorLayer.showCursor(); }; - - this.scrollSelectionIntoView = function(anchor, lead, offset) { + VirtualRenderer.prototype.scrollSelectionIntoView = function (anchor, lead, offset) { this.scrollCursorIntoView(anchor, offset); this.scrollCursorIntoView(lead, offset); }; - this.scrollCursorIntoView = function(cursor, offset, $viewMargin) { + VirtualRenderer.prototype.scrollCursorIntoView = function (cursor, offset, $viewMargin) { if (this.$size.scrollerHeight === 0) return; - var pos = this.$cursorLayer.getPixelPosition(cursor); - - var left = pos.left; - var top = pos.top; - + var newLeft = pos.left; + var newTop = pos.top; var topMargin = $viewMargin && $viewMargin.top || 0; var bottomMargin = $viewMargin && $viewMargin.bottom || 0; - - var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop; - - if (scrollTop + topMargin > top) { - if (offset && scrollTop + topMargin > top + this.lineHeight) - top -= offset * this.$size.scrollerHeight; - if (top === 0) - top = -this.scrollMargin.top; - this.session.setScrollTop(top); - } else if (scrollTop + this.$size.scrollerHeight - bottomMargin < top + this.lineHeight) { - if (offset && scrollTop + this.$size.scrollerHeight - bottomMargin < top - this.lineHeight) - top += offset * this.$size.scrollerHeight; - this.session.setScrollTop(top + this.lineHeight + bottomMargin - this.$size.scrollerHeight); + if (this.$scrollAnimation) { + this.$stopAnimation = true; + } + var currentTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop; + if (currentTop + topMargin > newTop) { + if (offset && currentTop + topMargin > newTop + this.lineHeight) + newTop -= offset * this.$size.scrollerHeight; + if (newTop === 0) + newTop = -this.scrollMargin.top; + this.session.setScrollTop(newTop); + } + else if (currentTop + this.$size.scrollerHeight - bottomMargin < newTop + this.lineHeight) { + if (offset && currentTop + this.$size.scrollerHeight - bottomMargin < newTop - this.lineHeight) + newTop += offset * this.$size.scrollerHeight; + this.session.setScrollTop(newTop + this.lineHeight + bottomMargin - this.$size.scrollerHeight); + } + var currentLeft = this.scrollLeft; + var twoCharsWidth = 2 * this.layerConfig.characterWidth; + if (newLeft - twoCharsWidth < currentLeft) { + newLeft -= twoCharsWidth; + if (newLeft < this.$padding + twoCharsWidth) { + newLeft = -this.scrollMargin.left; + } + this.session.setScrollLeft(newLeft); } - - var scrollLeft = this.scrollLeft; - - if (scrollLeft > left) { - if (left < this.$padding + 2 * this.layerConfig.characterWidth) - left = -this.scrollMargin.left; - this.session.setScrollLeft(left); - } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { - this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); - } else if (scrollLeft <= this.$padding && left - scrollLeft < this.characterWidth) { - this.session.setScrollLeft(0); + else { + newLeft += twoCharsWidth; + if (currentLeft + this.$size.scrollerWidth < newLeft + this.characterWidth) { + this.session.setScrollLeft(Math.round(newLeft + this.characterWidth - this.$size.scrollerWidth)); + } + else if (currentLeft <= this.$padding && newLeft - currentLeft < this.characterWidth) { + this.session.setScrollLeft(0); + } } }; - this.getScrollTop = function() { + VirtualRenderer.prototype.getScrollTop = function () { return this.session.getScrollTop(); }; - this.getScrollLeft = function() { + VirtualRenderer.prototype.getScrollLeft = function () { return this.session.getScrollLeft(); }; - this.getScrollTopRow = function() { + VirtualRenderer.prototype.getScrollTopRow = function () { return this.scrollTop / this.lineHeight; }; - this.getScrollBottomRow = function() { + VirtualRenderer.prototype.getScrollBottomRow = function () { return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1); }; - this.scrollToRow = function(row) { + VirtualRenderer.prototype.scrollToRow = function (row) { this.session.setScrollTop(row * this.lineHeight); }; - - this.alignCursor = function(cursor, alignment) { + VirtualRenderer.prototype.alignCursor = function (cursor, alignment) { if (typeof cursor == "number") - cursor = {row: cursor, column: 0}; - + cursor = { row: cursor, column: 0 }; var pos = this.$cursorLayer.getPixelPosition(cursor); var h = this.$size.scrollerHeight - this.lineHeight; var offset = pos.top - h * (alignment || 0); - this.session.setScrollTop(offset); return offset; }; - - this.STEPS = 8; - this.$calcSteps = function(fromValue, toValue){ + VirtualRenderer.prototype.$calcSteps = function (fromValue, toValue) { var i = 0; var l = this.STEPS; var steps = []; - - var func = function(t, x_min, dx) { + var func = function (t, x_min, dx) { return dx * (Math.pow(t - 1, 3) + 1) + x_min; }; - for (i = 0; i < l; ++i) steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); - return steps; }; - this.scrollToLine = function(line, center, animate, callback) { - var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); + VirtualRenderer.prototype.scrollToLine = function (line, center, animate, callback) { + var pos = this.$cursorLayer.getPixelPosition({ row: line, column: 0 }); var offset = pos.top; if (center) offset -= this.$size.scrollerHeight / 2; - var initialScroll = this.scrollTop; this.session.setScrollTop(offset); if (animate !== false) this.animateScrolling(initialScroll, callback); }; - - this.animateScrolling = function(fromValue, callback) { + VirtualRenderer.prototype.animateScrolling = function (fromValue, callback) { var toValue = this.scrollTop; if (!this.$animatedScroll) return; var _self = this; - if (fromValue == toValue) return; - if (this.$scrollAnimation) { var oldSteps = this.$scrollAnimation.steps; if (oldSteps.length) { @@ -37360,130 +36884,128 @@ var VirtualRenderer = function(container, theme) { return; } } - var steps = _self.$calcSteps(fromValue, toValue); - this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps}; - + this.$scrollAnimation = { from: fromValue, to: toValue, steps: steps }; clearInterval(this.$timer); - _self.session.setScrollTop(steps.shift()); _self.session.$scrollTop = toValue; - this.$timer = setInterval(function() { + function endAnimation() { + _self.$timer = clearInterval(_self.$timer); + _self.$scrollAnimation = null; + _self.$stopAnimation = false; + callback && callback(); + } + this.$timer = setInterval(function () { + if (_self.$stopAnimation) { + endAnimation(); + return; + } if (!_self.session) return clearInterval(_self.$timer); if (steps.length) { _self.session.setScrollTop(steps.shift()); _self.session.$scrollTop = toValue; - } else if (toValue != null) { + } + else if (toValue != null) { _self.session.$scrollTop = -1; _self.session.setScrollTop(toValue); toValue = null; - } else { - _self.$timer = clearInterval(_self.$timer); - _self.$scrollAnimation = null; - callback && callback(); + } + else { + endAnimation(); } }, 10); }; - this.scrollToY = function(scrollTop) { + VirtualRenderer.prototype.scrollToY = function (scrollTop) { if (this.scrollTop !== scrollTop) { this.$loop.schedule(this.CHANGE_SCROLL); this.scrollTop = scrollTop; } }; - this.scrollToX = function(scrollLeft) { + VirtualRenderer.prototype.scrollToX = function (scrollLeft) { if (this.scrollLeft !== scrollLeft) this.scrollLeft = scrollLeft; this.$loop.schedule(this.CHANGE_H_SCROLL); }; - this.scrollTo = function(x, y) { + VirtualRenderer.prototype.scrollTo = function (x, y) { this.session.setScrollTop(y); - this.session.setScrollLeft(y); + this.session.setScrollLeft(x); }; - this.scrollBy = function(deltaX, deltaY) { + VirtualRenderer.prototype.scrollBy = function (deltaX, deltaY) { deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY); deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX); }; - this.isScrollableBy = function(deltaX, deltaY) { + VirtualRenderer.prototype.isScrollableBy = function (deltaX, deltaY) { if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) - return true; + return true; if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom) - return true; + return true; if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) return true; if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth - this.layerConfig.width < -1 + this.scrollMargin.right) - return true; + return true; }; - - this.pixelToScreenCoordinates = function(x, y) { + VirtualRenderer.prototype.pixelToScreenCoordinates = function (x, y) { var canvasPos; if (this.$hasCssTransforms) { - canvasPos = {top:0, left: 0}; + canvasPos = { top: 0, left: 0 }; var p = this.$fontMetrics.transformCoordinates([x, y]); x = p[1] - this.gutterWidth - this.margin.left; y = p[0]; - } else { + } + else { canvasPos = this.scroller.getBoundingClientRect(); } - var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding; var offset = offsetX / this.characterWidth; var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight); var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset); - - return {row: row, column: col, side: offset - col > 0 ? 1 : -1, offsetX: offsetX}; + return { row: row, column: col, side: offset - col > 0 ? 1 : -1, offsetX: offsetX }; }; - - this.screenToTextCoordinates = function(x, y) { + VirtualRenderer.prototype.screenToTextCoordinates = function (x, y) { var canvasPos; if (this.$hasCssTransforms) { - canvasPos = {top:0, left: 0}; + canvasPos = { top: 0, left: 0 }; var p = this.$fontMetrics.transformCoordinates([x, y]); x = p[1] - this.gutterWidth - this.margin.left; y = p[0]; - } else { + } + else { canvasPos = this.scroller.getBoundingClientRect(); } - var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding; var offset = offsetX / this.characterWidth; var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset); - var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight); - return this.session.screenToDocumentPosition(row, Math.max(col, 0), offsetX); }; - this.textToScreenCoordinates = function(row, column) { + VirtualRenderer.prototype.textToScreenCoordinates = function (row, column) { var canvasPos = this.scroller.getBoundingClientRect(); var pos = this.session.documentToScreenPosition(row, column); - var x = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, row) - ? this.session.$bidiHandler.getPosLeft(pos.column) - : Math.round(pos.column * this.characterWidth)); - + ? this.session.$bidiHandler.getPosLeft(pos.column) + : Math.round(pos.column * this.characterWidth)); var y = pos.row * this.lineHeight; - return { pageX: canvasPos.left + x - this.scrollLeft, pageY: canvasPos.top + y - this.scrollTop }; }; - this.visualizeFocus = function() { + VirtualRenderer.prototype.visualizeFocus = function () { dom.addCssClass(this.container, "ace_focus"); }; - this.visualizeBlur = function() { + VirtualRenderer.prototype.visualizeBlur = function () { dom.removeCssClass(this.container, "ace_focus"); }; - this.showComposition = function(composition) { + VirtualRenderer.prototype.showComposition = function (composition) { this.$composition = composition; if (!composition.cssText) { composition.cssText = this.textarea.style.cssText; } if (composition.useTextareaForIME == undefined) composition.useTextareaForIME = this.$useTextareaForIME; - if (this.$useTextareaForIME) { dom.addCssClass(this.textarea, "ace_composition"); this.textarea.style.cssText = ""; @@ -37494,18 +37016,16 @@ var VirtualRenderer = function(container, theme) { composition.markerId = this.session.addMarker(composition.markerRange, "ace_composition_marker", "text"); } }; - this.setCompositionText = function(text) { + VirtualRenderer.prototype.setCompositionText = function (text) { var cursor = this.session.selection.cursor; this.addToken(text, "composition_placeholder", cursor.row, cursor.column); this.$moveTextAreaToCursor(); }; - this.hideComposition = function() { + VirtualRenderer.prototype.hideComposition = function () { if (!this.$composition) return; - if (this.$composition.markerId) this.session.removeMarker(this.$composition.markerId); - dom.removeCssClass(this.textarea, "ace_composition"); this.textarea.style.cssText = this.$composition.cssText; var cursor = this.session.selection.cursor; @@ -37513,47 +37033,161 @@ var VirtualRenderer = function(container, theme) { this.$composition = null; this.$cursorLayer.element.style.display = ""; }; - - this.addToken = function(text, type, row, column) { + VirtualRenderer.prototype.setGhostText = function (text, position) { + var cursor = this.session.selection.cursor; + var insertPosition = position || { row: cursor.row, column: cursor.column }; + this.removeGhostText(); + var textChunks = this.$calculateWrappedTextChunks(text, insertPosition); + this.addToken(textChunks[0].text, "ghost_text", insertPosition.row, insertPosition.column); + this.$ghostText = { + text: text, + position: { + row: insertPosition.row, + column: insertPosition.column + } + }; + var widgetDiv = dom.createElement("div"); + if (textChunks.length > 1) { + var hiddenTokens = this.hideTokensAfterPosition(insertPosition.row, insertPosition.column); + var lastLineDiv; + textChunks.slice(1).forEach(function (el) { + var chunkDiv = dom.createElement("div"); + var chunkSpan = dom.createElement("span"); + chunkSpan.className = "ace_ghost_text"; + if (el.wrapped) + chunkDiv.className = "ghost_text_line_wrapped"; + if (el.text.length === 0) + el.text = " "; + chunkSpan.appendChild(dom.createTextNode(el.text)); + chunkDiv.appendChild(chunkSpan); + widgetDiv.appendChild(chunkDiv); + lastLineDiv = chunkDiv; + }); + hiddenTokens.forEach(function (token) { + var element = dom.createElement("span"); + if (!isTextToken(token.type)) + element.className = "ace_" + token.type.replace(/\./g, " ace_"); + element.appendChild(dom.createTextNode(token.value)); + lastLineDiv.appendChild(element); + }); + this.$ghostTextWidget = { + el: widgetDiv, + row: insertPosition.row, + column: insertPosition.column, + className: "ace_ghost_text_container" + }; + this.session.widgetManager.addLineWidget(this.$ghostTextWidget); + var pixelPosition = this.$cursorLayer.getPixelPosition(insertPosition, true); + var el = this.container; + var height = el.getBoundingClientRect().height; + var ghostTextHeight = textChunks.length * this.lineHeight; + var fitsY = ghostTextHeight < (height - pixelPosition.top); + if (fitsY) + return; + if (ghostTextHeight < height) { + this.scrollBy(0, (textChunks.length - 1) * this.lineHeight); + } + else { + this.scrollToRow(insertPosition.row); + } + } + }; + VirtualRenderer.prototype.$calculateWrappedTextChunks = function (text, position) { + var availableWidth = this.$size.scrollerWidth - this.$padding * 2; + var limit = Math.floor(availableWidth / this.characterWidth) - 2; + limit = limit <= 0 ? 60 : limit; // this is a hack to prevent the editor from crashing when the window is too small + var textLines = text.split(/\r?\n/); + var textChunks = []; + for (var i = 0; i < textLines.length; i++) { + var displayTokens = this.session.$getDisplayTokens(textLines[i], position.column); + var wrapSplits = this.session.$computeWrapSplits(displayTokens, limit, this.session.$tabSize); + if (wrapSplits.length > 0) { + var start = 0; + wrapSplits.push(textLines[i].length); + for (var j = 0; j < wrapSplits.length; j++) { + var textSlice = textLines[i].slice(start, wrapSplits[j]); + textChunks.push({ text: textSlice, wrapped: true }); + start = wrapSplits[j]; + } + } + else { + textChunks.push({ text: textLines[i], wrapped: false }); + } + } + return textChunks; + }; + VirtualRenderer.prototype.removeGhostText = function () { + if (!this.$ghostText) + return; + var position = this.$ghostText.position; + this.removeExtraToken(position.row, position.column); + if (this.$ghostTextWidget) { + this.session.widgetManager.removeLineWidget(this.$ghostTextWidget); + this.$ghostTextWidget = null; + } + this.$ghostText = null; + }; + VirtualRenderer.prototype.addToken = function (text, type, row, column) { var session = this.session; session.bgTokenizer.lines[row] = null; - var newToken = {type: type, value: text}; + var newToken = { type: type, value: text }; var tokens = session.getTokens(row); - if (column == null) { + if (column == null || !tokens.length) { tokens.push(newToken); - } else { + } + else { var l = 0; - for (var i =0; i < tokens.length; i++) { + for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; l += token.value.length; if (column <= l) { var diff = token.value.length - (l - column); var before = token.value.slice(0, diff); var after = token.value.slice(diff); - - tokens.splice(i, 1, {type: token.type, value: before}, newToken, {type: token.type, value: after}); + tokens.splice(i, 1, { type: token.type, value: before }, newToken, { type: token.type, value: after }); break; } } } this.updateLines(row, row); }; - - this.removeExtraToken = function(row, column) { + VirtualRenderer.prototype.hideTokensAfterPosition = function (row, column) { + var tokens = this.session.getTokens(row); + var l = 0; + var hasPassedCursor = false; + var hiddenTokens = []; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + l += token.value.length; + if (token.type === "ghost_text") + continue; + if (hasPassedCursor) { + hiddenTokens.push({ type: token.type, value: token.value }); + token.type = "hidden_token"; + continue; + } + if (l === column) { + hasPassedCursor = true; + } + } + this.updateLines(row, row); + return hiddenTokens; + }; + VirtualRenderer.prototype.removeExtraToken = function (row, column) { + this.session.bgTokenizer.lines[row] = null; this.updateLines(row, row); }; - this.setTheme = function(theme, cb) { + VirtualRenderer.prototype.setTheme = function (theme, cb) { var _self = this; this.$themeId = theme; - _self._dispatchEvent('themeChange',{theme:theme}); - + _self._dispatchEvent('themeChange', { theme: theme }); if (!theme || typeof theme == "string") { var moduleName = theme || this.$options.theme.initialValue; config.loadModule(["theme", moduleName], afterLoad); - } else { + } + else { afterLoad(theme); } - function afterLoad(module) { if (_self.$themeId != theme) return cb && cb(); @@ -37561,21 +37195,14 @@ var VirtualRenderer = function(container, theme) { throw new Error("couldn't load module " + theme + " or it didn't call define"); if (module.$id) _self.$themeId = module.$id; - dom.importCssString( - module.cssText, - module.cssClass, - _self.container - ); - + dom.importCssString(module.cssText, module.cssClass, _self.container); if (_self.theme) dom.removeCssClass(_self.container, _self.theme.cssClass); - var padding = "padding" in module ? module.padding : "padding" in (_self.theme || {}) ? 4 : _self.$padding; if (_self.$padding && padding != _self.$padding) _self.setPadding(padding); _self.$theme = module.cssClass; - _self.theme = module; dom.addCssClass(_self.container, module.cssClass); dom.setCssClass(_self.container, "ace_dark", module.isDark); @@ -37583,121 +37210,230 @@ var VirtualRenderer = function(container, theme) { _self.$size.width = 0; _self.$updateSizeAsync(); } - - _self._dispatchEvent('themeLoaded', {theme:module}); + _self._dispatchEvent('themeLoaded', { theme: module }); cb && cb(); + if (useragent.isSafari && _self.scroller) { + _self.scroller.style.background = "red"; + _self.scroller.style.background = ""; + } } }; - this.getTheme = function() { + VirtualRenderer.prototype.getTheme = function () { return this.$themeId; }; - this.setStyle = function(style, include) { + VirtualRenderer.prototype.setStyle = function (style, include) { dom.setCssClass(this.container, style, include !== false); }; - this.unsetStyle = function(style) { + VirtualRenderer.prototype.unsetStyle = function (style) { dom.removeCssClass(this.container, style); }; - - this.setCursorStyle = function(style) { + VirtualRenderer.prototype.setCursorStyle = function (style) { dom.setStyle(this.scroller.style, "cursor", style); }; - this.setMouseCursor = function(cursorStyle) { + VirtualRenderer.prototype.setMouseCursor = function (cursorStyle) { dom.setStyle(this.scroller.style, "cursor", cursorStyle); }; - - this.attachToShadowRoot = function() { + VirtualRenderer.prototype.attachToShadowRoot = function () { dom.importCssString(editorCss, "ace_editor.css", this.container); }; - this.destroy = function() { + VirtualRenderer.prototype.destroy = function () { this.freeze(); this.$fontMetrics.destroy(); this.$cursorLayer.destroy(); this.removeAllListeners(); this.container.textContent = ""; + this.setOption("useResizeObserver", false); }; - -}).call(VirtualRenderer.prototype); - - + VirtualRenderer.prototype.$updateCustomScrollbar = function (val) { + var _self = this; + this.$horizScroll = this.$vScroll = null; + this.scrollBarV.element.remove(); + this.scrollBarH.element.remove(); + if (this.$scrollDecorator) { + delete this.$scrollDecorator; + } + if (val === true) { + this.scrollBarV = new VScrollBarCustom(this.container, this); + this.scrollBarH = new HScrollBarCustom(this.container, this); + this.scrollBarV.setHeight(this.$size.scrollerHeight); + this.scrollBarH.setWidth(this.$size.scrollerWidth); + this.scrollBarV.addEventListener("scroll", function (e) { + if (!_self.$scrollAnimation) + _self.session.setScrollTop(e.data - _self.scrollMargin.top); + }); + this.scrollBarH.addEventListener("scroll", function (e) { + if (!_self.$scrollAnimation) + _self.session.setScrollLeft(e.data - _self.scrollMargin.left); + }); + this.$scrollDecorator = new Decorator(this.scrollBarV, this); + this.$scrollDecorator.$updateDecorators(); + } + else { + this.scrollBarV = new VScrollBar(this.container, this); + this.scrollBarH = new HScrollBar(this.container, this); + this.scrollBarV.addEventListener("scroll", function (e) { + if (!_self.$scrollAnimation) + _self.session.setScrollTop(e.data - _self.scrollMargin.top); + }); + this.scrollBarH.addEventListener("scroll", function (e) { + if (!_self.$scrollAnimation) + _self.session.setScrollLeft(e.data - _self.scrollMargin.left); + }); + } + }; + VirtualRenderer.prototype.$addResizeObserver = function () { + if (!window.ResizeObserver || this.$resizeObserver) + return; + var self = this; + this.$resizeTimer = lang.delayedCall(function () { + if (!self.destroyed) + self.onResize(); + }, 50); + this.$resizeObserver = new window.ResizeObserver(function (e) { + var w = e[0].contentRect.width; + var h = e[0].contentRect.height; + if (Math.abs(self.$size.width - w) > 1 + || Math.abs(self.$size.height - h) > 1) { + self.$resizeTimer.delay(); + } + else { + self.$resizeTimer.cancel(); + } + }); + this.$resizeObserver.observe(this.container); + }; + return VirtualRenderer; +}()); +VirtualRenderer.prototype.CHANGE_CURSOR = 1; +VirtualRenderer.prototype.CHANGE_MARKER = 2; +VirtualRenderer.prototype.CHANGE_GUTTER = 4; +VirtualRenderer.prototype.CHANGE_SCROLL = 8; +VirtualRenderer.prototype.CHANGE_LINES = 16; +VirtualRenderer.prototype.CHANGE_TEXT = 32; +VirtualRenderer.prototype.CHANGE_SIZE = 64; +VirtualRenderer.prototype.CHANGE_MARKER_BACK = 128; +VirtualRenderer.prototype.CHANGE_MARKER_FRONT = 256; +VirtualRenderer.prototype.CHANGE_FULL = 512; +VirtualRenderer.prototype.CHANGE_H_SCROLL = 1024; +VirtualRenderer.prototype.$changes = 0; +VirtualRenderer.prototype.$padding = null; +VirtualRenderer.prototype.$frozen = false; +VirtualRenderer.prototype.STEPS = 8; +oop.implement(VirtualRenderer.prototype, EventEmitter); config.defineOptions(VirtualRenderer.prototype, "renderer", { - animatedScroll: {initialValue: false}, + useResizeObserver: { + set: function (value) { + if (!value && this.$resizeObserver) { + this.$resizeObserver.disconnect(); + this.$resizeTimer.cancel(); + this.$resizeTimer = this.$resizeObserver = null; + } + else if (value && !this.$resizeObserver) { + this.$addResizeObserver(); + } + } + }, + animatedScroll: { initialValue: false }, showInvisibles: { - set: function(value) { + set: function (value) { if (this.$textLayer.setShowInvisibles(value)) this.$loop.schedule(this.CHANGE_TEXT); }, initialValue: false }, showPrintMargin: { - set: function() { this.$updatePrintMargin(); }, + set: function () { this.$updatePrintMargin(); }, initialValue: true }, printMarginColumn: { - set: function() { this.$updatePrintMargin(); }, + set: function () { this.$updatePrintMargin(); }, initialValue: 80 }, printMargin: { - set: function(val) { + set: function (val) { if (typeof val == "number") this.$printMarginColumn = val; this.$showPrintMargin = !!val; this.$updatePrintMargin(); }, - get: function() { + get: function () { return this.$showPrintMargin && this.$printMarginColumn; } }, showGutter: { - set: function(show){ + set: function (show) { this.$gutter.style.display = show ? "block" : "none"; this.$loop.schedule(this.CHANGE_FULL); this.onGutterResize(); }, initialValue: true }, + useSvgGutterIcons: { + set: function (value) { + this.$gutterLayer.$useSvgGutterIcons = value; + }, + initialValue: false + }, + showFoldedAnnotations: { + set: function (value) { + this.$gutterLayer.$showFoldedAnnotations = value; + }, + initialValue: false + }, fadeFoldWidgets: { - set: function(show) { + set: function (show) { dom.setCssClass(this.$gutter, "ace_fade-fold-widgets", show); }, initialValue: false }, showFoldWidgets: { - set: function(show) { + set: function (show) { this.$gutterLayer.setShowFoldWidgets(show); this.$loop.schedule(this.CHANGE_GUTTER); }, initialValue: true }, displayIndentGuides: { - set: function(show) { + set: function (show) { if (this.$textLayer.setDisplayIndentGuides(show)) this.$loop.schedule(this.CHANGE_TEXT); }, initialValue: true }, + highlightIndentGuides: { + set: function (show) { + if (this.$textLayer.setHighlightIndentGuides(show) == true) { + this.$textLayer.$highlightIndentGuide(); + } + else { + this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells); + } + }, + initialValue: true + }, highlightGutterLine: { - set: function(shouldHighlight) { + set: function (shouldHighlight) { this.$gutterLayer.setHighlightGutterLine(shouldHighlight); this.$loop.schedule(this.CHANGE_GUTTER); }, initialValue: true }, hScrollBarAlwaysVisible: { - set: function(val) { + set: function (val) { if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) this.$loop.schedule(this.CHANGE_SCROLL); }, initialValue: false }, vScrollBarAlwaysVisible: { - set: function(val) { + set: function (val) { if (!this.$vScrollBarAlwaysVisible || !this.$vScroll) this.$loop.schedule(this.CHANGE_SCROLL); }, initialValue: false }, fontSize: { - set: function(size) { + set: function (size) { if (typeof size == "number") size = size + "px"; this.container.style.fontSize = size; @@ -37706,31 +37442,31 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", { initialValue: 12 }, fontFamily: { - set: function(name) { + set: function (name) { this.container.style.fontFamily = name; this.updateFontSize(); } }, maxLines: { - set: function(val) { + set: function (val) { this.updateFull(); } }, minLines: { - set: function(val) { + set: function (val) { if (!(this.$minLines < 0x1ffffffffffff)) this.$minLines = 0; this.updateFull(); } }, maxPixelHeight: { - set: function(val) { + set: function (val) { this.updateFull(); }, initialValue: 0 }, scrollPastEnd: { - set: function(val) { + set: function (val) { val = +val || 0; if (this.$scrollPastEnd == val) return; @@ -37741,25 +37477,30 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", { handlesSet: true }, fixedWidthGutter: { - set: function(val) { + set: function (val) { this.$gutterLayer.$fixedWidth = !!val; this.$loop.schedule(this.CHANGE_GUTTER); } }, + customScrollbar: { + set: function (val) { + this.$updateCustomScrollbar(val); + }, + initialValue: false + }, theme: { - set: function(val) { this.setTheme(val); }, - get: function() { return this.$themeId || this.theme; }, + set: function (val) { this.setTheme(val); }, + get: function () { return this.$themeId || this.theme; }, initialValue: "./theme/textmate", handlesSet: true }, - hasCssTransforms: { - }, + hasCssTransforms: {}, useTextareaForIME: { initialValue: !useragent.isMobile && !useragent.isIE } }); - exports.VirtualRenderer = VirtualRenderer; + }); ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"], function(require, exports, module) { @@ -37876,6 +37617,9 @@ var WorkerClient = function(worker) { this._signal("terminate", {}); this.deltaQueue = null; this.$worker.terminate(); + this.$worker.onerror = function(e) { + e.preventDefault(); + }; this.$worker = null; if (this.$doc) this.$doc.off("change", this.changeListener); @@ -37899,7 +37643,7 @@ var WorkerClient = function(worker) { try { if (data.data && data.data.err) data.data.err = {message: data.data.err.message, stack: data.data.err.stack, code: data.data.err.code}; - this.$worker.postMessage({event: event, data: {data: data.data}}); + this.$worker && this.$worker.postMessage({event: event, data: {data: data.data}}); } catch(ex) { console.error(ex.stack); @@ -37912,7 +37656,7 @@ var WorkerClient = function(worker) { this.$doc = doc; this.call("setValue", [doc.getValue()]); - doc.on("change", this.changeListener); + doc.on("change", this.changeListener, true); }; this.changeListener = function(delta) { @@ -37994,57 +37738,46 @@ exports.createWorker = createWorker; }); -ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"], function(require, exports, module) { -"use strict"; - +ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"], function(require, exports, module){"use strict"; var Range = require("./range").Range; var EventEmitter = require("./lib/event_emitter").EventEmitter; var oop = require("./lib/oop"); - -var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) { - var _self = this; - this.length = length; - this.session = session; - this.doc = session.getDocument(); - this.mainClass = mainClass; - this.othersClass = othersClass; - this.$onUpdate = this.onUpdate.bind(this); - this.doc.on("change", this.$onUpdate); - this.$others = others; - - this.$onCursorChange = function() { - setTimeout(function() { - _self.onCursorChange(); - }); - }; - - this.$pos = pos; - var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || {length: -1}; - this.$undoStackDepth = undoStack.length; - this.setup(); - - session.selection.on("changeCursor", this.$onCursorChange); -}; - -(function() { - - oop.implement(this, EventEmitter); - this.setup = function() { +var PlaceHolder = /** @class */ (function () { + function PlaceHolder(session, length, pos, others, mainClass, othersClass) { + var _self = this; + this.length = length; + this.session = session; + this.doc = session.getDocument(); + this.mainClass = mainClass; + this.othersClass = othersClass; + this.$onUpdate = this.onUpdate.bind(this); + this.doc.on("change", this.$onUpdate, true); + this.$others = others; + this.$onCursorChange = function () { + setTimeout(function () { + _self.onCursorChange(); + }); + }; + this.$pos = pos; + var undoStack = session.getUndoManager().$undoStack || session.getUndoManager()["$undostack"] || { length: -1 }; + this.$undoStackDepth = undoStack.length; + this.setup(); + session.selection.on("changeCursor", this.$onCursorChange); + } + PlaceHolder.prototype.setup = function () { var _self = this; var doc = this.doc; var session = this.session; - this.selectionBefore = session.selection.toJSON(); if (session.selection.inMultiSelectMode) session.selection.toSingleRange(); - this.pos = doc.createAnchor(this.$pos.row, this.$pos.column); var pos = this.pos; pos.$insertRight = true; pos.detach(); pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false); this.others = []; - this.$others.forEach(function(other) { + this.$others.forEach(function (other) { var anchor = doc.createAnchor(other.row, other.column); anchor.$insertRight = true; anchor.detach(); @@ -38052,92 +37785,91 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) }); session.setUndoSelect(false); }; - this.showOtherMarkers = function() { - if (this.othersActive) return; + PlaceHolder.prototype.showOtherMarkers = function () { + if (this.othersActive) + return; var session = this.session; var _self = this; this.othersActive = true; - this.others.forEach(function(anchor) { - anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column+_self.length), _self.othersClass, null, false); + this.others.forEach(function (anchor) { + anchor.markerId = session.addMarker(new Range(anchor.row, anchor.column, anchor.row, anchor.column + _self.length), _self.othersClass, null, false); }); }; - this.hideOtherMarkers = function() { - if (!this.othersActive) return; + PlaceHolder.prototype.hideOtherMarkers = function () { + if (!this.othersActive) + return; this.othersActive = false; for (var i = 0; i < this.others.length; i++) { this.session.removeMarker(this.others[i].markerId); } }; - this.onUpdate = function(delta) { + PlaceHolder.prototype.onUpdate = function (delta) { if (this.$updating) return this.updateAnchors(delta); - var range = delta; - if (range.start.row !== range.end.row) return; - if (range.start.row !== this.pos.row) return; + if (range.start.row !== range.end.row) + return; + if (range.start.row !== this.pos.row) + return; this.$updating = true; var lengthDiff = delta.action === "insert" ? range.end.column - range.start.column : range.start.column - range.end.column; var inMainRange = range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1; var distanceFromStart = range.start.column - this.pos.column; - this.updateAnchors(delta); - if (inMainRange) this.length += lengthDiff; - if (inMainRange && !this.session.$fromUndo) { if (delta.action === 'insert') { for (var i = this.others.length - 1; i >= 0; i--) { var otherPos = this.others[i]; - var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; + var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart }; this.doc.insertMergedLines(newPos, delta.lines); } - } else if (delta.action === 'remove') { + } + else if (delta.action === 'remove') { for (var i = this.others.length - 1; i >= 0; i--) { var otherPos = this.others[i]; - var newPos = {row: otherPos.row, column: otherPos.column + distanceFromStart}; + var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart }; this.doc.remove(new Range(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff)); } } } - this.$updating = false; this.updateMarkers(); }; - - this.updateAnchors = function(delta) { + PlaceHolder.prototype.updateAnchors = function (delta) { this.pos.onChange(delta); for (var i = this.others.length; i--;) this.others[i].onChange(delta); this.updateMarkers(); }; - - this.updateMarkers = function() { + PlaceHolder.prototype.updateMarkers = function () { if (this.$updating) return; var _self = this; var session = this.session; - var updateMarker = function(pos, className) { + var updateMarker = function (pos, className) { session.removeMarker(pos.markerId); - pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column+_self.length), className, null, false); + pos.markerId = session.addMarker(new Range(pos.row, pos.column, pos.row, pos.column + _self.length), className, null, false); }; updateMarker(this.pos, this.mainClass); for (var i = this.others.length; i--;) updateMarker(this.others[i], this.othersClass); }; - - this.onCursorChange = function(event) { - if (this.$updating || !this.session) return; + PlaceHolder.prototype.onCursorChange = function (event) { + if (this.$updating || !this.session) + return; var pos = this.session.selection.getCursor(); if (pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) { this.showOtherMarkers(); this._emit("cursorEnter", event); - } else { + } + else { this.hideOtherMarkers(); this._emit("cursorLeave", event); } }; - this.detach = function() { + PlaceHolder.prototype.detach = function () { this.session.removeMarker(this.pos && this.pos.markerId); this.hideOtherMarkers(); this.doc.off("change", this.$onUpdate); @@ -38145,31 +37877,29 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) this.session.setUndoSelect(true); this.session = null; }; - this.cancel = function() { + PlaceHolder.prototype.cancel = function () { if (this.$undoStackDepth === -1) return; var undoManager = this.session.getUndoManager(); - var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth; + var undosRequired = (undoManager.$undoStack || undoManager["$undostack"]).length - this.$undoStackDepth; for (var i = 0; i < undosRequired; i++) { undoManager.undo(this.session, true); } if (this.selectionBefore) this.session.selection.fromJSON(this.selectionBefore); }; -}).call(PlaceHolder.prototype); - - + return PlaceHolder; +}()); +oop.implement(PlaceHolder.prototype, EventEmitter); exports.PlaceHolder = PlaceHolder; -}); -ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"], function(require, exports, module) { +}); -var event = require("../lib/event"); +ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"], function(require, exports, module){var event = require("../lib/event"); var useragent = require("../lib/useragent"); function isSamePoint(p1, p2) { return p1.row == p2.row && p1.column == p2.column; } - function onMouseDown(e) { var ev = e.domEvent; var alt = ev.altKey; @@ -38177,88 +37907,76 @@ function onMouseDown(e) { var ctrl = ev.ctrlKey; var accel = e.getAccelKey(); var button = e.getButton(); - if (ctrl && useragent.isMac) button = ev.button; - if (e.editor.inMultiSelectMode && button == 2) { e.editor.textInput.onContextMenu(e.domEvent); return; } - if (!ctrl && !alt && !accel) { if (button === 0 && e.editor.inMultiSelectMode) e.editor.exitMultiSelectMode(); return; } - if (button !== 0) return; - var editor = e.editor; var selection = editor.selection; var isMultiSelect = editor.inMultiSelectMode; var pos = e.getDocumentPosition(); var cursor = selection.getCursor(); var inSelection = e.inSelection() || (selection.isEmpty() && isSamePoint(pos, cursor)); - var mouseX = e.x, mouseY = e.y; - var onMouseSelection = function(e) { + var onMouseSelection = function (e) { mouseX = e.clientX; mouseY = e.clientY; }; - var session = editor.session; var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); var screenCursor = screenAnchor; - var selectionMode; if (editor.$mouseHandler.$enableJumpToDef) { if (ctrl && alt || accel && alt) selectionMode = shift ? "block" : "add"; else if (alt && editor.$blockSelectEnabled) selectionMode = "block"; - } else { + } + else { if (accel && !alt) { selectionMode = "add"; if (!isMultiSelect && shift) return; - } else if (alt && editor.$blockSelectEnabled) { + } + else if (alt && editor.$blockSelectEnabled) { selectionMode = "block"; } } - if (selectionMode && useragent.isMac && ev.ctrlKey) { editor.$mouseHandler.cancelContextMenu(); } - if (selectionMode == "add") { if (!isMultiSelect && inSelection) return; // dragging - if (!isMultiSelect) { var range = selection.toOrientedRange(); editor.addSelectionMarker(range); } - var oldRange = selection.rangeList.rangeAtPoint(pos); - editor.inVirtualSelectionMode = true; - if (shift) { oldRange = null; range = selection.ranges[0] || range; editor.removeSelectionMarker(range); } - editor.once("mouseup", function() { + editor.once("mouseup", function () { var tmpSel = selection.toOrientedRange(); - if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor)) selection.substractPoint(tmpSel.cursor); else { if (shift) { selection.substractPoint(range.cursor); - } else if (range) { + } + else if (range) { editor.removeSelectionMarker(range); selection.addRange(range); } @@ -38266,23 +37984,20 @@ function onMouseDown(e) { } editor.inVirtualSelectionMode = false; }); - - } else if (selectionMode == "block") { + } + else if (selectionMode == "block") { e.stop(); editor.inVirtualSelectionMode = true; var initialRange; var rectSel = []; - var blockSelect = function() { + var blockSelect = function () { var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY); var cursor = session.screenToDocumentPosition(newCursor.row, newCursor.column, newCursor.offsetX); - if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor, selection.lead)) return; screenCursor = newCursor; - editor.selection.moveToPosition(cursor); editor.renderer.scrollCursorIntoView(); - editor.removeSelectionMarkers(rectSel); rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor); if (editor.$mouseHandler.$clickSelection && rectSel.length == 1 && rectSel[0].isEmpty()) @@ -38292,19 +38007,17 @@ function onMouseDown(e) { }; if (isMultiSelect && !accel) { selection.toSingleRange(); - } else if (!isMultiSelect && accel) { + } + else if (!isMultiSelect && accel) { initialRange = selection.toOrientedRange(); editor.addSelectionMarker(initialRange); } - if (shift) screenAnchor = session.documentToScreenPosition(selection.lead); else selection.moveToPosition(pos); - - screenCursor = {row: -1, column: -1}; - - var onMouseSelectionEnd = function(e) { + screenCursor = { row: -1, column: -1 }; + var onMouseSelectionEnd = function (e) { blockSelect(); clearInterval(timerId); editor.removeSelectionMarkers(rectSel); @@ -38319,125 +38032,125 @@ function onMouseDown(e) { editor.inVirtualSelectionMode = false; editor.$mouseHandler.$clickSelection = null; }; - var onSelectionInterval = blockSelect; - event.capture(editor.container, onMouseSelection, onMouseSelectionEnd); - var timerId = setInterval(function() {onSelectionInterval();}, 20); - + var timerId = setInterval(function () { onSelectionInterval(); }, 20); return e.preventDefault(); } } - - exports.onMouseDown = onMouseDown; }); -ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"], function(require, exports, module) { +ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"], function(require, exports, module){/** + * commands to enter multiselect mode + * @type {import("../../ace-internal").Ace.Command[]} + */ exports.defaultCommands = [{ - name: "addCursorAbove", - description: "Add cursor above", - exec: function(editor) { editor.selectMoreLines(-1); }, - bindKey: {win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up"}, - scrollIntoView: "cursor", - readOnly: true -}, { - name: "addCursorBelow", - description: "Add cursor below", - exec: function(editor) { editor.selectMoreLines(1); }, - bindKey: {win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down"}, - scrollIntoView: "cursor", - readOnly: true -}, { - name: "addCursorAboveSkipCurrent", - description: "Add cursor above (skip current)", - exec: function(editor) { editor.selectMoreLines(-1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up"}, - scrollIntoView: "cursor", - readOnly: true -}, { - name: "addCursorBelowSkipCurrent", - description: "Add cursor below (skip current)", - exec: function(editor) { editor.selectMoreLines(1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down"}, - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectMoreBefore", - description: "Select more before", - exec: function(editor) { editor.selectMore(-1); }, - bindKey: {win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left"}, - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectMoreAfter", - description: "Select more after", - exec: function(editor) { editor.selectMore(1); }, - bindKey: {win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right"}, - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectNextBefore", - description: "Select next before", - exec: function(editor) { editor.selectMore(-1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left"}, - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectNextAfter", - description: "Select next after", - exec: function(editor) { editor.selectMore(1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right"}, - scrollIntoView: "cursor", - readOnly: true -}, { - name: "toggleSplitSelectionIntoLines", - description: "Split into lines", - exec: function(editor) { - if (editor.multiSelect.rangeCount > 1) - editor.multiSelect.joinSelections(); - else - editor.multiSelect.splitIntoLines(); - }, - bindKey: {win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L"}, - readOnly: true -}, { - name: "splitSelectionIntoLines", - description: "Split into lines", - exec: function(editor) { editor.multiSelect.splitIntoLines(); }, - readOnly: true -}, { - name: "alignCursors", - description: "Align cursors", - exec: function(editor) { editor.alignCursors(); }, - bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"}, - scrollIntoView: "cursor" -}, { - name: "findAll", - description: "Find all", - exec: function(editor) { editor.findAll(); }, - bindKey: {win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G"}, - scrollIntoView: "cursor", - readOnly: true -}]; + name: "addCursorAbove", + description: "Add cursor above", + exec: function (editor) { editor.selectMoreLines(-1); }, + bindKey: { win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up" }, + scrollIntoView: "cursor", + readOnly: true + }, { + name: "addCursorBelow", + description: "Add cursor below", + exec: function (editor) { editor.selectMoreLines(1); }, + bindKey: { win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down" }, + scrollIntoView: "cursor", + readOnly: true + }, { + name: "addCursorAboveSkipCurrent", + description: "Add cursor above (skip current)", + exec: function (editor) { editor.selectMoreLines(-1, true); }, + bindKey: { win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up" }, + scrollIntoView: "cursor", + readOnly: true + }, { + name: "addCursorBelowSkipCurrent", + description: "Add cursor below (skip current)", + exec: function (editor) { editor.selectMoreLines(1, true); }, + bindKey: { win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down" }, + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectMoreBefore", + description: "Select more before", + exec: function (editor) { editor.selectMore(-1); }, + bindKey: { win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left" }, + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectMoreAfter", + description: "Select more after", + exec: function (editor) { editor.selectMore(1); }, + bindKey: { win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right" }, + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectNextBefore", + description: "Select next before", + exec: function (editor) { editor.selectMore(-1, true); }, + bindKey: { win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left" }, + scrollIntoView: "cursor", + readOnly: true + }, { + name: "selectNextAfter", + description: "Select next after", + exec: function (editor) { editor.selectMore(1, true); }, + bindKey: { win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right" }, + scrollIntoView: "cursor", + readOnly: true + }, { + name: "toggleSplitSelectionIntoLines", + description: "Split selection into lines", + exec: function (editor) { + if (editor.multiSelect.rangeCount > 1) + editor.multiSelect.joinSelections(); + else + editor.multiSelect.splitIntoLines(); + }, + bindKey: { win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L" }, + readOnly: true + }, { + name: "splitSelectionIntoLines", + description: "Split into lines", + exec: function (editor) { editor.multiSelect.splitIntoLines(); }, + readOnly: true + }, { + name: "alignCursors", + description: "Align cursors", + exec: function (editor) { editor.alignCursors(); }, + bindKey: { win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A" }, + scrollIntoView: "cursor" + }, { + name: "findAll", + description: "Find all", + exec: function (editor) { editor.findAll(); }, + bindKey: { win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G" }, + scrollIntoView: "cursor", + readOnly: true + }]; exports.multiSelectCommands = [{ - name: "singleSelection", - description: "Single selection", - bindKey: "esc", - exec: function(editor) { editor.exitMultiSelectMode(); }, - scrollIntoView: "cursor", - readOnly: true, - isAvailable: function(editor) {return editor && editor.inMultiSelectMode;} -}]; - + name: "singleSelection", + description: "Single selection", + bindKey: "esc", + exec: function (editor) { editor.exitMultiSelectMode(); }, + scrollIntoView: "cursor", + readOnly: true, + isAvailable: function (editor) { return editor && editor.inMultiSelectMode; } + }]; var HashHandler = require("../keyboard/hash_handler").HashHandler; exports.keyboardHandler = new HashHandler(exports.multiSelectCommands); }); -ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"], function(require, exports, module) { - +ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"], function(require, exports, module){/** + * @typedef {import("./anchor").Anchor} Anchor + * @typedef {import("../ace-internal").Ace.Point} Point + * @typedef {import("../ace-internal").Ace.ScreenCoordinates} ScreenCoordinates + */ var RangeList = require("./range_list").RangeList; var Range = require("./range").Range; var Selection = require("./selection").Selection; @@ -38448,7 +38161,6 @@ var commands = require("./commands/multi_select_commands"); exports.commands = commands.defaultCommands.concat(commands.multiSelectCommands); var Search = require("./search").Search; var search = new Search(); - function find(session, needle, dir) { search.$options.wrap = true; search.$options.needle = needle; @@ -38456,18 +38168,17 @@ function find(session, needle, dir) { return search.find(session); } var EditSession = require("./edit_session").EditSession; -(function() { - this.getSelectionMarkers = function() { +(function () { + this.getSelectionMarkers = function () { return this.$selectionMarkers; }; }).call(EditSession.prototype); -(function() { +(function () { this.ranges = null; this.rangeList = null; - this.addRange = function(range, $blockChangeEvents) { + this.addRange = function (range, $blockChangeEvents) { if (!range) return; - if (!this.inMultiSelectMode && this.rangeCount === 0) { var oldRange = this.toOrientedRange(); this.rangeList.add(oldRange); @@ -38480,88 +38191,74 @@ var EditSession = require("./edit_session").EditSession; this.rangeList.add(oldRange); this.$onAddRange(oldRange); } - if (!range.cursor) range.cursor = range.end; - var removed = this.rangeList.add(range); - this.$onAddRange(range); - if (removed.length) this.$onRemoveRange(removed); - if (this.rangeCount > 1 && !this.inMultiSelectMode) { this._signal("multiSelect"); this.inMultiSelectMode = true; this.session.$undoSelect = false; this.rangeList.attach(this.session); } - return $blockChangeEvents || this.fromOrientedRange(range); }; - this.toSingleRange = function(range) { + this.toSingleRange = function (range) { range = range || this.ranges[0]; var removed = this.rangeList.removeAll(); if (removed.length) this.$onRemoveRange(removed); - range && this.fromOrientedRange(range); }; - this.substractPoint = function(pos) { + this.substractPoint = function (pos) { var removed = this.rangeList.substractPoint(pos); if (removed) { this.$onRemoveRange(removed); return removed[0]; } }; - this.mergeOverlappingRanges = function() { + this.mergeOverlappingRanges = function () { var removed = this.rangeList.merge(); if (removed.length) this.$onRemoveRange(removed); }; - - this.$onAddRange = function(range) { + this.$onAddRange = function (range) { this.rangeCount = this.rangeList.ranges.length; this.ranges.unshift(range); - this._signal("addRange", {range: range}); + this._signal("addRange", { range: range }); }; - - this.$onRemoveRange = function(removed) { + this.$onRemoveRange = function (removed) { this.rangeCount = this.rangeList.ranges.length; if (this.rangeCount == 1 && this.inMultiSelectMode) { var lastRange = this.rangeList.ranges.pop(); removed.push(lastRange); this.rangeCount = 0; } - - for (var i = removed.length; i--; ) { + for (var i = removed.length; i--;) { var index = this.ranges.indexOf(removed[i]); this.ranges.splice(index, 1); } - - this._signal("removeRange", {ranges: removed}); - + this._signal("removeRange", { ranges: removed }); if (this.rangeCount === 0 && this.inMultiSelectMode) { this.inMultiSelectMode = false; this._signal("singleSelect"); this.session.$undoSelect = true; this.rangeList.detach(this.session); } - lastRange = lastRange || this.ranges[0]; if (lastRange && !lastRange.isEqual(this.getRange())) this.fromOrientedRange(lastRange); }; - this.$initRangeList = function() { + this.$initRangeList = function () { if (this.rangeList) return; - this.rangeList = new RangeList(); this.ranges = []; this.rangeCount = 0; }; - this.getAllRanges = function() { + this.getAllRanges = function () { return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()]; }; this.splitIntoLines = function () { @@ -38573,7 +38270,8 @@ var EditSession = require("./edit_session").EditSession; var endRow = range.end.row; if (row === endRow) { newRanges.push(range.clone()); - } else { + } + else { newRanges.push(new Range(row, range.start.column, row, this.session.getLine(row).length)); while (++row < endRow) newRanges.push(this.getLineRange(row, true)); @@ -38586,12 +38284,10 @@ var EditSession = require("./edit_session").EditSession; for (var i = newRanges.length; i--;) this.addRange(newRanges[i]); }; - this.joinSelections = function () { var ranges = this.rangeList.ranges; var lastRange = ranges[ranges.length - 1]; var range = Range.fromPoints(ranges[0].start, lastRange.end); - this.toSingleRange(); this.setSelectionRange(range, lastRange.cursor == lastRange.start); }; @@ -38600,1725 +38296,3529 @@ var EditSession = require("./edit_session").EditSession; var ranges = this.rangeList.ranges; var lastRange = ranges[ranges.length - 1]; var range = Range.fromPoints(ranges[0].start, lastRange.end); - this.toSingleRange(); this.setSelectionRange(range, lastRange.cursor == lastRange.start); - } else { + } + else { var cursor = this.session.documentToScreenPosition(this.cursor); var anchor = this.session.documentToScreenPosition(this.anchor); - var rectSel = this.rectangularRangeBlock(cursor, anchor); rectSel.forEach(this.addRange, this); } }; - this.rectangularRangeBlock = function(screenCursor, screenAnchor, includeEmptyLines) { + this.rectangularRangeBlock = function (screenCursor, screenAnchor, includeEmptyLines) { var rectSel = []; - var xBackwards = screenCursor.column < screenAnchor.column; if (xBackwards) { var startColumn = screenCursor.column; var endColumn = screenAnchor.column; var startOffsetX = screenCursor.offsetX; var endOffsetX = screenAnchor.offsetX; - } else { + } + else { var startColumn = screenAnchor.column; var endColumn = screenCursor.column; var startOffsetX = screenAnchor.offsetX; var endOffsetX = screenCursor.offsetX; } - - var yBackwards = screenCursor.row < screenAnchor.row; - if (yBackwards) { - var startRow = screenCursor.row; - var endRow = screenAnchor.row; - } else { - var startRow = screenAnchor.row; - var endRow = screenCursor.row; + var yBackwards = screenCursor.row < screenAnchor.row; + if (yBackwards) { + var startRow = screenCursor.row; + var endRow = screenAnchor.row; + } + else { + var startRow = screenAnchor.row; + var endRow = screenCursor.row; + } + if (startColumn < 0) + startColumn = 0; + if (startRow < 0) + startRow = 0; + if (startRow == endRow) + includeEmptyLines = true; + var docEnd; + for (var row = startRow; row <= endRow; row++) { + var range = Range.fromPoints(this.session.screenToDocumentPosition(row, startColumn, startOffsetX), this.session.screenToDocumentPosition(row, endColumn, endOffsetX)); + if (range.isEmpty()) { + if (docEnd && isSamePoint(range.end, docEnd)) + break; + docEnd = range.end; + } + range.cursor = xBackwards ? range.start : range.end; + rectSel.push(range); + } + if (yBackwards) + rectSel.reverse(); + if (!includeEmptyLines) { + var end = rectSel.length - 1; + while (rectSel[end].isEmpty() && end > 0) + end--; + if (end > 0) { + var start = 0; + while (rectSel[start].isEmpty()) + start++; + } + for (var i = end; i >= start; i--) { + if (rectSel[i].isEmpty()) + rectSel.splice(i, 1); + } + } + return rectSel; + }; +}).call(Selection.prototype); +var Editor = require("./editor").Editor; +(function () { + this.updateSelectionMarkers = function () { + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + this.addSelectionMarker = function (orientedRange) { + if (!orientedRange.cursor) + orientedRange.cursor = orientedRange.end; + var style = this.getSelectionStyle(); + orientedRange.marker = this.session.addMarker(orientedRange, "ace_selection", style); + this.session.$selectionMarkers.push(orientedRange); + this.session.selectionMarkerCount = this.session.$selectionMarkers.length; + return orientedRange; + }; + this.removeSelectionMarker = function (range) { + if (!range.marker) + return; + this.session.removeMarker(range.marker); + var index = this.session.$selectionMarkers.indexOf(range); + if (index != -1) + this.session.$selectionMarkers.splice(index, 1); + this.session.selectionMarkerCount = this.session.$selectionMarkers.length; + }; + this.removeSelectionMarkers = function (ranges) { + var markerList = this.session.$selectionMarkers; + for (var i = ranges.length; i--;) { + var range = ranges[i]; + if (!range.marker) + continue; + this.session.removeMarker(range.marker); + var index = markerList.indexOf(range); + if (index != -1) + markerList.splice(index, 1); + } + this.session.selectionMarkerCount = markerList.length; + }; + this.$onAddRange = function (e) { + this.addSelectionMarker(e.range); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + this.$onRemoveRange = function (e) { + this.removeSelectionMarkers(e.ranges); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + this.$onMultiSelect = function (e) { + if (this.inMultiSelectMode) + return; + this.inMultiSelectMode = true; + this.setStyle("ace_multiselect"); + this.keyBinding.addKeyboardHandler(commands.keyboardHandler); + this.commands.setDefaultHandler("exec", this.$onMultiSelectExec); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + }; + this.$onSingleSelect = function (e) { + if (this.session.multiSelect.inVirtualMode) + return; + this.inMultiSelectMode = false; + this.unsetStyle("ace_multiselect"); + this.keyBinding.removeKeyboardHandler(commands.keyboardHandler); + this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + this._emit("changeSelection"); + }; + this.$onMultiSelectExec = function (e) { + var command = e.command; + var editor = e.editor; + if (!editor.multiSelect) + return; + if (!command.multiSelectAction) { + var result = command.exec(editor, e.args || {}); + editor.multiSelect.addRange(editor.multiSelect.toOrientedRange()); + editor.multiSelect.mergeOverlappingRanges(); + } + else if (command.multiSelectAction == "forEach") { + result = editor.forEachSelection(command, e.args); + } + else if (command.multiSelectAction == "forEachLine") { + result = editor.forEachSelection(command, e.args, true); + } + else if (command.multiSelectAction == "single") { + editor.exitMultiSelectMode(); + result = command.exec(editor, e.args || {}); + } + else { + result = command.multiSelectAction(editor, e.args || {}); + } + return result; + }; + this.forEachSelection = function (cmd, args, options) { + if (this.inVirtualSelectionMode) + return; + var keepOrder = options && options.keepOrder; + var $byLines = options == true || options && options.$byLines; + var session = this.session; + var selection = this.selection; + var rangeList = selection.rangeList; + var ranges = (keepOrder ? selection : rangeList).ranges; + var result; + if (!ranges.length) + return cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {}); + var reg = selection._eventRegistry; + selection._eventRegistry = {}; + var tmpSel = new Selection(session); + this.inVirtualSelectionMode = true; + for (var i = ranges.length; i--;) { + if ($byLines) { + while (i > 0 && ranges[i].start.row == ranges[i - 1].end.row) + i--; + } + tmpSel.fromOrientedRange(ranges[i]); + tmpSel.index = i; + this.selection = session.selection = tmpSel; + var cmdResult = cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {}); + if (!result && cmdResult !== undefined) + result = cmdResult; + tmpSel.toOrientedRange(ranges[i]); + } + tmpSel.detach(); + this.selection = session.selection = selection; + this.inVirtualSelectionMode = false; + selection._eventRegistry = reg; + selection.mergeOverlappingRanges(); + if (selection.ranges[0]) + selection.fromOrientedRange(selection.ranges[0]); + var anim = this.renderer.$scrollAnimation; + this.onCursorChange(); + this.onSelectionChange(); + if (anim && anim.from == anim.to) + this.renderer.animateScrolling(anim.from); + return result; + }; + this.exitMultiSelectMode = function () { + if (!this.inMultiSelectMode || this.inVirtualSelectionMode) + return; + this.multiSelect.toSingleRange(); + }; + this.getSelectedText = function () { + var text = ""; + if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { + var ranges = this.multiSelect.rangeList.ranges; + var buf = []; + for (var i = 0; i < ranges.length; i++) { + buf.push(this.session.getTextRange(ranges[i])); + } + var nl = this.session.getDocument().getNewLineCharacter(); + text = buf.join(nl); + if (text.length == (buf.length - 1) * nl.length) + text = ""; + } + else if (!this.selection.isEmpty()) { + text = this.session.getTextRange(this.getSelectionRange()); + } + return text; + }; + this.$checkMultiselectChange = function (e, anchor) { + if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { + var range = this.multiSelect.ranges[0]; + if (this.multiSelect.isEmpty() && anchor == this.multiSelect.anchor) + return; + var pos = anchor == this.multiSelect.anchor + ? range.cursor == range.start ? range.end : range.start + : range.cursor; + if (pos.row != anchor.row + || this.session.$clipPositionToDocument(pos.row, pos.column).column != anchor.column) + this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()); + else + this.multiSelect.mergeOverlappingRanges(); + } + }; + this.findAll = function (needle, options, additive) { + options = options || {}; + options.needle = needle || options.needle; + if (options.needle == undefined) { + var range = this.selection.isEmpty() + ? this.selection.getWordRange() + : this.selection.getRange(); + options.needle = this.session.getTextRange(range); + } + this.$search.set(options); + var ranges = this.$search.findAll(this.session); + if (!ranges.length) + return 0; + var selection = this.multiSelect; + if (!additive) + selection.toSingleRange(ranges[0]); + for (var i = ranges.length; i--;) + selection.addRange(ranges[i], true); + if (range && selection.rangeList.rangeAtPoint(range.start)) + selection.addRange(range, true); + return ranges.length; + }; + this.selectMoreLines = function (dir, skip) { + var range = this.selection.toOrientedRange(); + var isBackwards = range.cursor == range.end; + var screenLead = this.session.documentToScreenPosition(range.cursor); + if (this.selection.$desiredColumn) + screenLead.column = this.selection.$desiredColumn; + var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column); + if (!range.isEmpty()) { + var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start); + var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column); + } + else { + var anchor = lead; + } + if (isBackwards) { + var newRange = Range.fromPoints(lead, anchor); + newRange.cursor = newRange.start; + } + else { + var newRange = Range.fromPoints(anchor, lead); + newRange.cursor = newRange.end; + } + newRange.desiredColumn = screenLead.column; + if (!this.selection.inMultiSelectMode) { + this.selection.addRange(range); + } + else { + if (skip) + var toRemove = range.cursor; + } + this.selection.addRange(newRange); + if (toRemove) + this.selection.substractPoint(toRemove); + }; + this.transposeSelections = function (dir) { + var session = this.session; + var sel = session.multiSelect; + var all = sel.ranges; + for (var i = all.length; i--;) { + var range = all[i]; + if (range.isEmpty()) { + var tmp_1 = session.getWordRange(range.start.row, range.start.column); + range.start.row = tmp_1.start.row; + range.start.column = tmp_1.start.column; + range.end.row = tmp_1.end.row; + range.end.column = tmp_1.end.column; + } + } + sel.mergeOverlappingRanges(); + var words = []; + for (var i = all.length; i--;) { + var range = all[i]; + words.unshift(session.getTextRange(range)); + } + if (dir < 0) + words.unshift(words.pop()); + else + words.push(words.shift()); + for (var i = all.length; i--;) { + var range = all[i]; + var tmp = range.clone(); + session.replace(range, words[i]); + range.start.row = tmp.start.row; + range.start.column = tmp.start.column; + } + sel.fromOrientedRange(sel.ranges[0]); + }; + this.selectMore = function (dir, skip, stopAtFirst) { + var session = this.session; + var sel = session.multiSelect; + var range = sel.toOrientedRange(); + if (range.isEmpty()) { + range = session.getWordRange(range.start.row, range.start.column); + range.cursor = dir == -1 ? range.start : range.end; + this.multiSelect.addRange(range); + if (stopAtFirst) + return; + } + var needle = session.getTextRange(range); + var newRange = find(session, needle, dir); + if (newRange) { + newRange.cursor = dir == -1 ? newRange.start : newRange.end; + this.session.unfold(newRange); + this.multiSelect.addRange(newRange); + this.renderer.scrollCursorIntoView(null, 0.5); + } + if (skip) + this.multiSelect.substractPoint(range.cursor); + }; + this.alignCursors = function () { + var session = this.session; + var sel = session.multiSelect; + var ranges = sel.ranges; + var row = -1; + var sameRowRanges = ranges.filter(function (r) { + if (r.cursor.row == row) + return true; + row = r.cursor.row; + }); + if (!ranges.length || sameRowRanges.length == ranges.length - 1) { + var range = this.selection.getRange(); + var fr = range.start.row, lr = range.end.row; + var guessRange = fr == lr; + if (guessRange) { + var max = this.session.getLength(); + var line; + do { + line = this.session.getLine(lr); + } while (/[=:]/.test(line) && ++lr < max); + do { + line = this.session.getLine(fr); + } while (/[=:]/.test(line) && --fr > 0); + if (fr < 0) + fr = 0; + if (lr >= max) + lr = max - 1; + } + var lines = this.session.removeFullLines(fr, lr); + lines = this.$reAlignText(lines, guessRange); + this.session.insert({ row: fr, column: 0 }, lines.join("\n") + "\n"); + if (!guessRange) { + range.start.column = 0; + range.end.column = lines[lines.length - 1].length; + } + this.selection.setRange(range); + } + else { + sameRowRanges.forEach(function (r) { + sel.substractPoint(r.cursor); + }); + var maxCol = 0; + var minSpace = Infinity; + var spaceOffsets = ranges.map(function (r) { + var p = r.cursor; + var line = session.getLine(p.row); + var spaceOffset = line.substr(p.column).search(/\S/g); + if (spaceOffset == -1) + spaceOffset = 0; + if (p.column > maxCol) + maxCol = p.column; + if (spaceOffset < minSpace) + minSpace = spaceOffset; + return spaceOffset; + }); + ranges.forEach(function (r, i) { + var p = r.cursor; + var l = maxCol - p.column; + var d = spaceOffsets[i] - minSpace; + if (l > d) + session.insert(p, lang.stringRepeat(" ", l - d)); + else + session.remove(new Range(p.row, p.column, p.row, p.column - l + d)); + r.start.column = r.end.column = maxCol; + r.start.row = r.end.row = p.row; + r.cursor = r.end; + }); + sel.fromOrientedRange(ranges[0]); + this.renderer.updateCursor(); + this.renderer.updateBackMarkers(); + } + }; + this.$reAlignText = function (lines, forceLeft) { + var isLeftAligned = true, isRightAligned = true; + var startW, textW, endW; + return lines.map(function (line) { + var m = line.match(/(\s*)(.*?)(\s*)([=:].*)/); + if (!m) + return [line]; + if (startW == null) { + startW = m[1].length; + textW = m[2].length; + endW = m[3].length; + return m; + } + if (startW + textW + endW != m[1].length + m[2].length + m[3].length) + isRightAligned = false; + if (startW != m[1].length) + isLeftAligned = false; + if (startW > m[1].length) + startW = m[1].length; + if (textW < m[2].length) + textW = m[2].length; + if (endW > m[3].length) + endW = m[3].length; + return m; + }).map(forceLeft ? alignLeft : + isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign); + function spaces(n) { + return lang.stringRepeat(" ", n); + } + function alignLeft(m) { + return !m[2] ? m[0] : spaces(startW) + m[2] + + spaces(textW - m[2].length + endW) + + m[4].replace(/^([=:])\s+/, "$1 "); + } + function alignRight(m) { + return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2] + + spaces(endW) + + m[4].replace(/^([=:])\s+/, "$1 "); + } + function unAlign(m) { + return !m[2] ? m[0] : spaces(startW) + m[2] + + spaces(endW) + + m[4].replace(/^([=:])\s+/, "$1 "); + } + }; +}).call(Editor.prototype); +function isSamePoint(p1, p2) { + return p1.row == p2.row && p1.column == p2.column; +} +exports.onSessionChange = function (e) { + var session = e.session; + if (session && !session.multiSelect) { + session.$selectionMarkers = []; + session.selection.$initRangeList(); + session.multiSelect = session.selection; + } + this.multiSelect = session && session.multiSelect; + var oldSession = e.oldSession; + if (oldSession) { + oldSession.multiSelect.off("addRange", this.$onAddRange); + oldSession.multiSelect.off("removeRange", this.$onRemoveRange); + oldSession.multiSelect.off("multiSelect", this.$onMultiSelect); + oldSession.multiSelect.off("singleSelect", this.$onSingleSelect); + oldSession.multiSelect.lead.off("change", this.$checkMultiselectChange); + oldSession.multiSelect.anchor.off("change", this.$checkMultiselectChange); + } + if (session) { + session.multiSelect.on("addRange", this.$onAddRange); + session.multiSelect.on("removeRange", this.$onRemoveRange); + session.multiSelect.on("multiSelect", this.$onMultiSelect); + session.multiSelect.on("singleSelect", this.$onSingleSelect); + session.multiSelect.lead.on("change", this.$checkMultiselectChange); + session.multiSelect.anchor.on("change", this.$checkMultiselectChange); + } + if (session && this.inMultiSelectMode != session.selection.inMultiSelectMode) { + if (session.selection.inMultiSelectMode) + this.$onMultiSelect(); + else + this.$onSingleSelect(); + } +}; +function MultiSelect(editor) { + if (editor.$multiselectOnSessionChange) + return; + editor.$onAddRange = editor.$onAddRange.bind(editor); + editor.$onRemoveRange = editor.$onRemoveRange.bind(editor); + editor.$onMultiSelect = editor.$onMultiSelect.bind(editor); + editor.$onSingleSelect = editor.$onSingleSelect.bind(editor); + editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor); + editor.$checkMultiselectChange = editor.$checkMultiselectChange.bind(editor); + editor.$multiselectOnSessionChange(editor); + editor.on("changeSession", editor.$multiselectOnSessionChange); + editor.on("mousedown", onMouseDown); + editor.commands.addCommands(commands.defaultCommands); + addAltCursorListeners(editor); +} +function addAltCursorListeners(editor) { + if (!editor.textInput) + return; + var el = editor.textInput.getElement(); + var altCursor = false; + event.addListener(el, "keydown", function (e) { + var altDown = e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey); + if (editor.$blockSelectEnabled && altDown) { + if (!altCursor) { + editor.renderer.setMouseCursor("crosshair"); + altCursor = true; + } + } + else if (altCursor) { + reset(); } - - if (startColumn < 0) - startColumn = 0; - if (startRow < 0) - startRow = 0; - - if (startRow == endRow) - includeEmptyLines = true; - - var docEnd; - for (var row = startRow; row <= endRow; row++) { - var range = Range.fromPoints( - this.session.screenToDocumentPosition(row, startColumn, startOffsetX), - this.session.screenToDocumentPosition(row, endColumn, endOffsetX) - ); - if (range.isEmpty()) { - if (docEnd && isSamePoint(range.end, docEnd)) - break; - docEnd = range.end; - } - range.cursor = xBackwards ? range.start : range.end; - rectSel.push(range); + }, editor); + event.addListener(el, "keyup", reset, editor); + event.addListener(el, "blur", reset, editor); + function reset(e) { + if (altCursor) { + editor.renderer.setMouseCursor(""); + altCursor = false; } - - if (yBackwards) - rectSel.reverse(); - - if (!includeEmptyLines) { - var end = rectSel.length - 1; - while (rectSel[end].isEmpty() && end > 0) - end--; - if (end > 0) { - var start = 0; - while (rectSel[start].isEmpty()) - start++; + } +} +exports.MultiSelect = MultiSelect; +require("./config").defineOptions(Editor.prototype, "editor", { + enableMultiselect: { + set: function (val) { + MultiSelect(this); + if (val) { + this.on("mousedown", onMouseDown); } - for (var i = end; i >= start; i--) { - if (rectSel[i].isEmpty()) - rectSel.splice(i, 1); + else { + this.off("mousedown", onMouseDown); } - } - - return rectSel; - }; -}).call(Selection.prototype); -var Editor = require("./editor").Editor; -(function() { - this.updateSelectionMarkers = function() { - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); - }; - this.addSelectionMarker = function(orientedRange) { - if (!orientedRange.cursor) - orientedRange.cursor = orientedRange.end; + }, + value: true + }, + enableBlockSelect: { + set: function (val) { + this.$blockSelectEnabled = val; + }, + value: true + } +}); - var style = this.getSelectionStyle(); - orientedRange.marker = this.session.addMarker(orientedRange, "ace_selection", style); +}); - this.session.$selectionMarkers.push(orientedRange); - this.session.selectionMarkerCount = this.session.$selectionMarkers.length; - return orientedRange; +ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"], function(require, exports, module){"use strict"; +var Range = require("../../range").Range; +var FoldMode = exports.FoldMode = function () { }; +(function () { + this.foldingStartMarker = null; + this.foldingStopMarker = null; + this.getFoldWidget = function (session, foldStyle, row) { + var line = session.getLine(row); + if (this.foldingStartMarker.test(line)) + return "start"; + if (foldStyle == "markbeginend" + && this.foldingStopMarker + && this.foldingStopMarker.test(line)) + return "end"; + return ""; }; - this.removeSelectionMarker = function(range) { - if (!range.marker) - return; - this.session.removeMarker(range.marker); - var index = this.session.$selectionMarkers.indexOf(range); - if (index != -1) - this.session.$selectionMarkers.splice(index, 1); - this.session.selectionMarkerCount = this.session.$selectionMarkers.length; + this.getFoldWidgetRange = function (session, foldStyle, row) { + return null; }; - - this.removeSelectionMarkers = function(ranges) { - var markerList = this.session.$selectionMarkers; - for (var i = ranges.length; i--; ) { - var range = ranges[i]; - if (!range.marker) + this.indentationBlock = function (session, row, column) { + var re = /\S/; + var line = session.getLine(row); + var startLevel = line.search(re); + if (startLevel == -1) + return; + var startColumn = column || line.length; + var maxRow = session.getLength(); + var startRow = row; + var endRow = row; + while (++row < maxRow) { + var level = session.getLine(row).search(re); + if (level == -1) continue; - this.session.removeMarker(range.marker); - var index = markerList.indexOf(range); - if (index != -1) - markerList.splice(index, 1); + if (level <= startLevel) { + var token = session.getTokenAt(row, 0); + if (!token || token.type !== "string") + break; + } + endRow = row; + } + if (endRow > startRow) { + var endColumn = session.getLine(endRow).length; + return new Range(startRow, startColumn, endRow, endColumn); } - this.session.selectionMarkerCount = markerList.length; - }; - - this.$onAddRange = function(e) { - this.addSelectionMarker(e.range); - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); - }; - - this.$onRemoveRange = function(e) { - this.removeSelectionMarkers(e.ranges); - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); }; - - this.$onMultiSelect = function(e) { - if (this.inMultiSelectMode) + this.openingBracketBlock = function (session, bracket, row, column, typeRe) { + var start = { row: row, column: column + 1 }; + var end = session.$findClosingBracket(bracket, start, typeRe); + if (!end) return; - this.inMultiSelectMode = true; - - this.setStyle("ace_multiselect"); - this.keyBinding.addKeyboardHandler(commands.keyboardHandler); - this.commands.setDefaultHandler("exec", this.$onMultiSelectExec); - - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); + var fw = session.foldWidgets[end.row]; + if (fw == null) + fw = session.getFoldWidget(end.row); + if (fw == "start" && end.row > start.row) { + end.row--; + end.column = session.getLine(end.row).length; + } + return Range.fromPoints(start, end); }; - - this.$onSingleSelect = function(e) { - if (this.session.multiSelect.inVirtualMode) + this.closingBracketBlock = function (session, bracket, row, column, typeRe) { + var end = { row: row, column: column }; + var start = session.$findOpeningBracket(bracket, end); + if (!start) return; - this.inMultiSelectMode = false; + start.column++; + end.column--; + return Range.fromPoints(start, end); + }; +}).call(FoldMode.prototype); - this.unsetStyle("ace_multiselect"); - this.keyBinding.removeKeyboardHandler(commands.keyboardHandler); +}); - this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec); - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); - this._emit("changeSelection"); +ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"], function(require, exports, module){"use strict"; +var LineWidgets = require("../line_widgets").LineWidgets; +var dom = require("../lib/dom"); +var Range = require("../range").Range; +var nls = require("../config").nls; +function binarySearch(array, needle, comparator) { + var first = 0; + var last = array.length - 1; + while (first <= last) { + var mid = (first + last) >> 1; + var c = comparator(needle, array[mid]); + if (c > 0) + first = mid + 1; + else if (c < 0) + last = mid - 1; + else + return mid; + } + return -(first + 1); +} +function findAnnotations(session, row, dir) { + var annotations = session.getAnnotations().sort(Range.comparePoints); + if (!annotations.length) + return; + var i = binarySearch(annotations, { row: row, column: -1 }, Range.comparePoints); + if (i < 0) + i = -i - 1; + if (i >= annotations.length) + i = dir > 0 ? 0 : annotations.length - 1; + else if (i === 0 && dir < 0) + i = annotations.length - 1; + var annotation = annotations[i]; + if (!annotation || !dir) + return; + if (annotation.row === row) { + do { + annotation = annotations[i += dir]; + } while (annotation && annotation.row === row); + if (!annotation) + return annotations.slice(); + } + var matched = []; + row = annotation.row; + do { + matched[dir < 0 ? "unshift" : "push"](annotation); + annotation = annotations[i += dir]; + } while (annotation && annotation.row == row); + return matched.length && matched; +} +exports.showErrorMarker = function (editor, dir) { + var session = editor.session; + if (!session.widgetManager) { + session.widgetManager = new LineWidgets(session); + session.widgetManager.attach(editor); + } + var pos = editor.getCursorPosition(); + var row = pos.row; + var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function (w) { + return w.type == "errorMarker"; + })[0]; + if (oldWidget) { + oldWidget.destroy(); + } + else { + row -= dir; + } + var annotations = findAnnotations(session, row, dir); + var gutterAnno; + if (annotations) { + var annotation = annotations[0]; + pos.column = (annotation.pos && typeof annotation.column != "number" + ? annotation.pos.sc + : annotation.column) || 0; + pos.row = annotation.row; + gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row]; + } + else if (oldWidget) { + return; + } + else { + gutterAnno = { + displayText: [nls("error-marker.good-state", "Looks good!")], + className: "ace_ok" + }; + } + editor.session.unfold(pos.row); + editor.selection.moveToPosition(pos); + var w = { + row: pos.row, + fixedWidth: true, + coverGutter: true, + el: dom.createElement("div"), + type: "errorMarker" }; - - this.$onMultiSelectExec = function(e) { - var command = e.command; - var editor = e.editor; - if (!editor.multiSelect) - return; - if (!command.multiSelectAction) { - var result = command.exec(editor, e.args || {}); - editor.multiSelect.addRange(editor.multiSelect.toOrientedRange()); - editor.multiSelect.mergeOverlappingRanges(); - } else if (command.multiSelectAction == "forEach") { - result = editor.forEachSelection(command, e.args); - } else if (command.multiSelectAction == "forEachLine") { - result = editor.forEachSelection(command, e.args, true); - } else if (command.multiSelectAction == "single") { - editor.exitMultiSelectMode(); - result = command.exec(editor, e.args || {}); - } else { - result = command.multiSelectAction(editor, e.args || {}); + var el = w.el.appendChild(dom.createElement("div")); + var arrow = w.el.appendChild(dom.createElement("div")); + arrow.className = "error_widget_arrow " + gutterAnno.className; + var left = editor.renderer.$cursorLayer + .getPixelPosition(pos).left; + arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px"; + w.el.className = "error_widget_wrapper"; + el.className = "error_widget " + gutterAnno.className; + gutterAnno.displayText.forEach(function (annoTextLine, i) { + el.appendChild(dom.createTextNode(annoTextLine)); + if (i < gutterAnno.displayText.length - 1) { + el.appendChild(dom.createElement("br")); + } + }); + el.appendChild(dom.createElement("div")); + var kb = function (_, hashId, keyString) { + if (hashId === 0 && (keyString === "esc" || keyString === "return")) { + w.destroy(); + return { command: "null" }; } - return result; }; - this.forEachSelection = function(cmd, args, options) { - if (this.inVirtualSelectionMode) + w.destroy = function () { + if (editor.$mouseHandler.isMousePressed) return; - var keepOrder = options && options.keepOrder; - var $byLines = options == true || options && options.$byLines; - var session = this.session; - var selection = this.selection; - var rangeList = selection.rangeList; - var ranges = (keepOrder ? selection : rangeList).ranges; - var result; + editor.keyBinding.removeKeyboardHandler(kb); + session.widgetManager.removeLineWidget(w); + editor.off("changeSelection", w.destroy); + editor.off("changeSession", w.destroy); + editor.off("mouseup", w.destroy); + editor.off("change", w.destroy); + }; + editor.keyBinding.addKeyboardHandler(kb); + editor.on("changeSelection", w.destroy); + editor.on("changeSession", w.destroy); + editor.on("mouseup", w.destroy); + editor.on("change", w.destroy); + editor.session.widgetManager.addLineWidget(w); + w.el.onmousedown = editor.focus.bind(editor); + editor.renderer.scrollCursorIntoView(null, 0.5, { bottom: w.el.offsetHeight }); +}; +dom.importCssString("\n .error_widget_wrapper {\n background: inherit;\n color: inherit;\n border:none\n }\n .error_widget {\n border-top: solid 2px;\n border-bottom: solid 2px;\n margin: 5px 0;\n padding: 10px 40px;\n white-space: pre-wrap;\n }\n .error_widget.ace_error, .error_widget_arrow.ace_error{\n border-color: #ff5a5a\n }\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n border-color: #F1D817\n }\n .error_widget.ace_info, .error_widget_arrow.ace_info{\n border-color: #5a5a5a\n }\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n border-color: #5aaa5a\n }\n .error_widget_arrow {\n position: absolute;\n border: solid 5px;\n border-top-color: transparent!important;\n border-right-color: transparent!important;\n border-left-color: transparent!important;\n top: -5px;\n }\n", "error_marker.css", false); - if (!ranges.length) - return cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {}); +}); - var reg = selection._eventRegistry; - selection._eventRegistry = {}; +ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"], function(require, exports, module){/** + * The main class required to set up an Ace instance in the browser. + * + * @namespace Ace + **/ +"use strict"; +require("./loader_build")(exports) +var dom = require("./lib/dom"); +var Range = require("./range").Range; +var Editor = require("./editor").Editor; +var EditSession = require("./edit_session").EditSession; +var UndoManager = require("./undomanager").UndoManager; +var Renderer = require("./virtual_renderer").VirtualRenderer; +require("./worker/worker_client"); +require("./keyboard/hash_handler"); +require("./placeholder"); +require("./multi_select"); +require("./mode/folding/fold_mode"); +require("./theme/textmate"); +require("./ext/error_marker"); +exports.config = require("./config"); +exports.edit = function (el, options) { + if (typeof el == "string") { + var _id = el; + el = document.getElementById(_id); + if (!el) + throw new Error("ace.edit can't find div #" + _id); + } + if (el && el.env && el.env.editor instanceof Editor) + return el.env.editor; + var value = ""; + if (el && /input|textarea/i.test(el.tagName)) { + var oldNode = el; + value = oldNode.value; + el = dom.createElement("pre"); + oldNode.parentNode.replaceChild(el, oldNode); + } + else if (el) { + value = el.textContent; + el.innerHTML = ""; + } + var doc = exports.createEditSession(value); + var editor = new Editor(new Renderer(el), doc, options); + var env = { + document: doc, + editor: editor, + onResize: editor.resize.bind(editor, null) + }; + if (oldNode) + env.textarea = oldNode; + editor.on("destroy", function () { + env.editor.container.env = null; // prevent memory leak on old ie + }); + editor.container.env = editor.env = env; + return editor; +}; +exports.createEditSession = function (text, mode) { + var doc = new EditSession(text, mode); + doc.setUndoManager(new UndoManager()); + return doc; +}; +exports.Range = Range; +exports.Editor = Editor; +exports.EditSession = EditSession; +exports.UndoManager = UndoManager; +exports.VirtualRenderer = Renderer; +var version = exports.config.version; +exports.version = version; - var tmpSel = new Selection(session); - this.inVirtualSelectionMode = true; - for (var i = ranges.length; i--;) { - if ($byLines) { - while (i > 0 && ranges[i].start.row == ranges[i - 1].end.row) - i--; - } - tmpSel.fromOrientedRange(ranges[i]); - tmpSel.index = i; - this.selection = session.selection = tmpSel; - var cmdResult = cmd.exec ? cmd.exec(this, args || {}) : cmd(this, args || {}); - if (!result && cmdResult !== undefined) - result = cmdResult; - tmpSel.toOrientedRange(ranges[i]); - } - tmpSel.detach(); +}); (function() { + ace.require(["ace/ace"], function(a) { + if (a) { + a.config.init(true); + a.define = ace.define; + } + var global = (function () { + return this; + })(); + if (!global && typeof window != "undefined") global = window; // can happen in strict mode + if (!global && typeof self != "undefined") global = self; // can happen in webworker + + if (!global.ace) + global.ace = a; + for (var key in a) if (a.hasOwnProperty(key)) + global.ace[key] = a[key]; + global.ace["default"] = global.ace; + if ( true && module) { + module.exports = global.ace; + } + }); + })(); - this.selection = session.selection = selection; - this.inVirtualSelectionMode = false; - selection._eventRegistry = reg; - selection.mergeOverlappingRanges(); - if (selection.ranges[0]) - selection.fromOrientedRange(selection.ranges[0]); - var anim = this.renderer.$scrollAnimation; - this.onCursorChange(); - this.onSelectionChange(); - if (anim && anim.from == anim.to) - this.renderer.animateScrolling(anim.from); +/***/ }), +/***/ 6489: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"], function(require, exports, module){"use strict"; +var dom = require("./lib/dom"); +var oop = require("./lib/oop"); +var EventEmitter = require("./lib/event_emitter").EventEmitter; +var lang = require("./lib/lang"); +var Range = require("./range").Range; +var RangeList = require("./range_list").RangeList; +var HashHandler = require("./keyboard/hash_handler").HashHandler; +var Tokenizer = require("./tokenizer").Tokenizer; +var clipboard = require("./clipboard"); +var VARIABLES = { + CURRENT_WORD: function (editor) { + return editor.session.getTextRange(editor.session.getWordRange()); + }, + SELECTION: function (editor, name, indentation) { + var text = editor.session.getTextRange(); + if (indentation) + return text.replace(/\n\r?([ \t]*\S)/g, "\n" + indentation + "$1"); + return text; + }, + CURRENT_LINE: function (editor) { + return editor.session.getLine(editor.getCursorPosition().row); + }, + PREV_LINE: function (editor) { + return editor.session.getLine(editor.getCursorPosition().row - 1); + }, + LINE_INDEX: function (editor) { + return editor.getCursorPosition().row; + }, + LINE_NUMBER: function (editor) { + return editor.getCursorPosition().row + 1; + }, + SOFT_TABS: function (editor) { + return editor.session.getUseSoftTabs() ? "YES" : "NO"; + }, + TAB_SIZE: function (editor) { + return editor.session.getTabSize(); + }, + CLIPBOARD: function (editor) { + return clipboard.getText && clipboard.getText(); + }, + FILENAME: function (editor) { + return /[^/\\]*$/.exec(this.FILEPATH(editor))[0]; + }, + FILENAME_BASE: function (editor) { + return /[^/\\]*$/.exec(this.FILEPATH(editor))[0].replace(/\.[^.]*$/, ""); + }, + DIRECTORY: function (editor) { + return this.FILEPATH(editor).replace(/[^/\\]*$/, ""); + }, + FILEPATH: function (editor) { return "/not implemented.txt"; }, + WORKSPACE_NAME: function () { return "Unknown"; }, + FULLNAME: function () { return "Unknown"; }, + BLOCK_COMMENT_START: function (editor) { + var mode = editor.session.$mode || {}; + return mode.blockComment && mode.blockComment.start || ""; + }, + BLOCK_COMMENT_END: function (editor) { + var mode = editor.session.$mode || {}; + return mode.blockComment && mode.blockComment.end || ""; + }, + LINE_COMMENT: function (editor) { + var mode = editor.session.$mode || {}; + return mode.lineCommentStart || ""; + }, + CURRENT_YEAR: date.bind(null, { year: "numeric" }), + CURRENT_YEAR_SHORT: date.bind(null, { year: "2-digit" }), + CURRENT_MONTH: date.bind(null, { month: "numeric" }), + CURRENT_MONTH_NAME: date.bind(null, { month: "long" }), + CURRENT_MONTH_NAME_SHORT: date.bind(null, { month: "short" }), + CURRENT_DATE: date.bind(null, { day: "2-digit" }), + CURRENT_DAY_NAME: date.bind(null, { weekday: "long" }), + CURRENT_DAY_NAME_SHORT: date.bind(null, { weekday: "short" }), + CURRENT_HOUR: date.bind(null, { hour: "2-digit", hour12: false }), + CURRENT_MINUTE: date.bind(null, { minute: "2-digit" }), + CURRENT_SECOND: date.bind(null, { second: "2-digit" }) +}; +VARIABLES.SELECTED_TEXT = VARIABLES.SELECTION; +function date(dateFormat) { + var str = new Date().toLocaleString("en-us", dateFormat); + return str.length == 1 ? "0" + str : str; +} +var SnippetManager = /** @class */ (function () { + function SnippetManager() { + this.snippetMap = {}; + this.snippetNameMap = {}; + this.variables = VARIABLES; + } + SnippetManager.prototype.getTokenizer = function () { + return SnippetManager["$tokenizer"] || this.createTokenizer(); + }; + SnippetManager.prototype.createTokenizer = function () { + function TabstopToken(str) { + str = str.substr(1); + if (/^\d+$/.test(str)) + return [{ tabstopId: parseInt(str, 10) }]; + return [{ text: str }]; + } + function escape(ch) { + return "(?:[^\\\\" + ch + "]|\\\\.)"; + } + var formatMatcher = { + regex: "/(" + escape("/") + "+)/", + onMatch: function (val, state, stack) { + var ts = stack[0]; + ts.fmtString = true; + ts.guard = val.slice(1, -1); + ts.flag = ""; + return ""; + }, + next: "formatString" + }; + SnippetManager["$tokenizer"] = new Tokenizer({ + start: [ + { regex: /\\./, onMatch: function (val, state, stack) { + var ch = val[1]; + if (ch == "}" && stack.length) { + val = ch; + } + else if ("`$\\".indexOf(ch) != -1) { + val = ch; + } + return [val]; + } }, + { regex: /}/, onMatch: function (val, state, stack) { + return [stack.length ? stack.shift() : val]; + } }, + { regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken }, + { regex: /\$\{[\dA-Z_a-z]+/, onMatch: function (str, state, stack) { + var t = TabstopToken(str.substr(1)); + stack.unshift(t[0]); + return t; + }, next: "snippetVar" }, + { regex: /\n/, token: "newline", merge: false } + ], + snippetVar: [ + { regex: "\\|" + escape("\\|") + "*\\|", onMatch: function (val, state, stack) { + var choices = val.slice(1, -1).replace(/\\[,|\\]|,/g, function (operator) { + return operator.length == 2 ? operator[1] : "\x00"; + }).split("\x00").map(function (value) { + return { value: value }; + }); + stack[0].choices = choices; + return [choices[0]]; + }, next: "start" }, + formatMatcher, + { regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start" } + ], + formatString: [ + { regex: /:/, onMatch: function (val, state, stack) { + if (stack.length && stack[0].expectElse) { + stack[0].expectElse = false; + stack[0].ifEnd = { elseEnd: stack[0] }; + return [stack[0].ifEnd]; + } + return ":"; + } }, + { regex: /\\./, onMatch: function (val, state, stack) { + var ch = val[1]; + if (ch == "}" && stack.length) + val = ch; + else if ("`$\\".indexOf(ch) != -1) + val = ch; + else if (ch == "n") + val = "\n"; + else if (ch == "t") + val = "\t"; + else if ("ulULE".indexOf(ch) != -1) + val = { changeCase: ch, local: ch > "a" }; + return [val]; + } }, + { regex: "/\\w*}", onMatch: function (val, state, stack) { + var next = stack.shift(); + if (next) + next.flag = val.slice(1, -1); + this.next = next && next.tabstopId ? "start" : ""; + return [next || val]; + }, next: "start" }, + { regex: /\$(?:\d+|\w+)/, onMatch: function (val, state, stack) { + return [{ text: val.slice(1) }]; + } }, + { regex: /\${\w+/, onMatch: function (val, state, stack) { + var token = { text: val.slice(2) }; + stack.unshift(token); + return [token]; + }, next: "formatStringVar" }, + { regex: /\n/, token: "newline", merge: false }, + { regex: /}/, onMatch: function (val, state, stack) { + var next = stack.shift(); + this.next = next && next.tabstopId ? "start" : ""; + return [next || val]; + }, next: "start" } + ], + formatStringVar: [ + { regex: /:\/\w+}/, onMatch: function (val, state, stack) { + var ts = stack[0]; + ts.formatFunction = val.slice(2, -1); + return [stack.shift()]; + }, next: "formatString" }, + formatMatcher, + { regex: /:[\?\-+]?/, onMatch: function (val, state, stack) { + if (val[1] == "+") + stack[0].ifEnd = stack[0]; + if (val[1] == "?") + stack[0].expectElse = true; + }, next: "formatString" }, + { regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "formatString" } + ] + }); + return SnippetManager["$tokenizer"]; + }; + SnippetManager.prototype.tokenizeTmSnippet = function (str, startState) { + return this.getTokenizer().getLineTokens(str, startState).tokens.map(function (x) { + return x.value || x; + }); + }; + SnippetManager.prototype.getVariableValue = function (editor, name, indentation) { + if (/^\d+$/.test(name)) + return (this.variables.__ || {})[name] || ""; + if (/^[A-Z]\d+$/.test(name)) + return (this.variables[name[0] + "__"] || {})[name.substr(1)] || ""; + name = name.replace(/^TM_/, ""); + if (!this.variables.hasOwnProperty(name)) + return ""; + var value = this.variables[name]; + if (typeof value == "function") + value = this.variables[name](editor, name, indentation); + return value == null ? "" : value; + }; + SnippetManager.prototype.tmStrFormat = function (str, ch, editor) { + if (!ch.fmt) + return str; + var flag = ch.flag || ""; + var re = ch.guard; + re = new RegExp(re, flag.replace(/[^gim]/g, "")); + var fmtTokens = typeof ch.fmt == "string" ? this.tokenizeTmSnippet(ch.fmt, "formatString") : ch.fmt; + var _self = this; + var formatted = str.replace(re, function () { + var oldArgs = _self.variables.__; + _self.variables.__ = [].slice.call(arguments); + var fmtParts = _self.resolveVariables(fmtTokens, editor); + var gChangeCase = "E"; + for (var i = 0; i < fmtParts.length; i++) { + var ch = fmtParts[i]; + if (typeof ch == "object") { + fmtParts[i] = ""; + if (ch.changeCase && ch.local) { + var next = fmtParts[i + 1]; + if (next && typeof next == "string") { + if (ch.changeCase == "u") + fmtParts[i] = next[0].toUpperCase(); + else + fmtParts[i] = next[0].toLowerCase(); + fmtParts[i + 1] = next.substr(1); + } + } + else if (ch.changeCase) { + gChangeCase = ch.changeCase; + } + } + else if (gChangeCase == "U") { + fmtParts[i] = ch.toUpperCase(); + } + else if (gChangeCase == "L") { + fmtParts[i] = ch.toLowerCase(); + } + } + _self.variables.__ = oldArgs; + return fmtParts.join(""); + }); + return formatted; + }; + SnippetManager.prototype.tmFormatFunction = function (str, ch, editor) { + if (ch.formatFunction == "upcase") + return str.toUpperCase(); + if (ch.formatFunction == "downcase") + return str.toLowerCase(); + return str; + }; + SnippetManager.prototype.resolveVariables = function (snippet, editor) { + var result = []; + var indentation = ""; + var afterNewLine = true; + for (var i = 0; i < snippet.length; i++) { + var ch = snippet[i]; + if (typeof ch == "string") { + result.push(ch); + if (ch == "\n") { + afterNewLine = true; + indentation = ""; + } + else if (afterNewLine) { + indentation = /^\t*/.exec(ch)[0]; + afterNewLine = /\S/.test(ch); + } + continue; + } + if (!ch) + continue; + afterNewLine = false; + if (ch.fmtString) { + var j = snippet.indexOf(ch, i + 1); + if (j == -1) + j = snippet.length; + ch.fmt = snippet.slice(i + 1, j); + i = j; + } + if (ch.text) { + var value = this.getVariableValue(editor, ch.text, indentation) + ""; + if (ch.fmtString) + value = this.tmStrFormat(value, ch, editor); + if (ch.formatFunction) + value = this.tmFormatFunction(value, ch, editor); + if (value && !ch.ifEnd) { + result.push(value); + gotoNext(ch); + } + else if (!value && ch.ifEnd) { + gotoNext(ch.ifEnd); + } + } + else if (ch.elseEnd) { + gotoNext(ch.elseEnd); + } + else if (ch.tabstopId != null) { + result.push(ch); + } + else if (ch.changeCase != null) { + result.push(ch); + } + } + function gotoNext(ch) { + var i1 = snippet.indexOf(ch, i + 1); + if (i1 != -1) + i = i1; + } return result; }; - this.exitMultiSelectMode = function() { - if (!this.inMultiSelectMode || this.inVirtualSelectionMode) - return; - this.multiSelect.toSingleRange(); + SnippetManager.prototype.getDisplayTextForSnippet = function (editor, snippetText) { + var processedSnippet = processSnippetText.call(this, editor, snippetText); + return processedSnippet.text; }; - - this.getSelectedText = function() { - var text = ""; - if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { - var ranges = this.multiSelect.rangeList.ranges; - var buf = []; - for (var i = 0; i < ranges.length; i++) { - buf.push(this.session.getTextRange(ranges[i])); - } - var nl = this.session.getDocument().getNewLineCharacter(); - text = buf.join(nl); - if (text.length == (buf.length - 1) * nl.length) - text = ""; - } else if (!this.selection.isEmpty()) { - text = this.session.getTextRange(this.getSelectionRange()); + SnippetManager.prototype.insertSnippetForSelection = function (editor, snippetText, options) { + if (options === void 0) { options = {}; } + var processedSnippet = processSnippetText.call(this, editor, snippetText, options); + var range = editor.getSelectionRange(); + var end = editor.session.replace(range, processedSnippet.text); + var tabstopManager = new TabstopManager(editor); + var selectionId = editor.inVirtualSelectionMode && editor.selection.index; + tabstopManager.addTabstops(processedSnippet.tabstops, range.start, end, selectionId); + }; + SnippetManager.prototype.insertSnippet = function (editor, snippetText, options) { + if (options === void 0) { options = {}; } + var self = this; + if (editor.inVirtualSelectionMode) + return self.insertSnippetForSelection(editor, snippetText, options); + editor.forEachSelection(function () { + self.insertSnippetForSelection(editor, snippetText, options); + }, null, { keepOrder: true }); + if (editor.tabstopManager) + editor.tabstopManager.tabNext(); + }; + SnippetManager.prototype.$getScope = function (editor) { + var scope = editor.session.$mode.$id || ""; + scope = scope.split("/").pop(); + if (scope === "html" || scope === "php") { + if (scope === "php" && !editor.session.$mode.inlinePhp) + scope = "html"; + var c = editor.getCursorPosition(); + var state = editor.session.getState(c.row); + if (typeof state === "object") { + state = state[0]; + } + if (state.substring) { + if (state.substring(0, 3) == "js-") + scope = "javascript"; + else if (state.substring(0, 4) == "css-") + scope = "css"; + else if (state.substring(0, 4) == "php-") + scope = "php"; + } + } + return scope; + }; + SnippetManager.prototype.getActiveScopes = function (editor) { + var scope = this.$getScope(editor); + var scopes = [scope]; + var snippetMap = this.snippetMap; + if (snippetMap[scope] && snippetMap[scope].includeScopes) { + scopes.push.apply(scopes, snippetMap[scope].includeScopes); + } + scopes.push("_"); + return scopes; + }; + SnippetManager.prototype.expandWithTab = function (editor, options) { + var self = this; + var result = editor.forEachSelection(function () { + return self.expandSnippetForSelection(editor, options); + }, null, { keepOrder: true }); + if (result && editor.tabstopManager) + editor.tabstopManager.tabNext(); + return result; + }; + SnippetManager.prototype.expandSnippetForSelection = function (editor, options) { + var cursor = editor.getCursorPosition(); + var line = editor.session.getLine(cursor.row); + var before = line.substring(0, cursor.column); + var after = line.substr(cursor.column); + var snippetMap = this.snippetMap; + var snippet; + this.getActiveScopes(editor).some(function (scope) { + var snippets = snippetMap[scope]; + if (snippets) + snippet = this.findMatchingSnippet(snippets, before, after); + return !!snippet; + }, this); + if (!snippet) + return false; + if (options && options.dryRun) + return true; + editor.session.doc.removeInLine(cursor.row, cursor.column - snippet.replaceBefore.length, cursor.column + snippet.replaceAfter.length); + this.variables.M__ = snippet.matchBefore; + this.variables.T__ = snippet.matchAfter; + this.insertSnippetForSelection(editor, snippet.content); + this.variables.M__ = this.variables.T__ = null; + return true; + }; + SnippetManager.prototype.findMatchingSnippet = function (snippetList, before, after) { + for (var i = snippetList.length; i--;) { + var s = snippetList[i]; + if (s.startRe && !s.startRe.test(before)) + continue; + if (s.endRe && !s.endRe.test(after)) + continue; + if (!s.startRe && !s.endRe) + continue; + s.matchBefore = s.startRe ? s.startRe.exec(before) : [""]; + s.matchAfter = s.endRe ? s.endRe.exec(after) : [""]; + s.replaceBefore = s.triggerRe ? s.triggerRe.exec(before)[0] : ""; + s.replaceAfter = s.endTriggerRe ? s.endTriggerRe.exec(after)[0] : ""; + return s; } - return text; }; - - this.$checkMultiselectChange = function(e, anchor) { - if (this.inMultiSelectMode && !this.inVirtualSelectionMode) { - var range = this.multiSelect.ranges[0]; - if (this.multiSelect.isEmpty() && anchor == this.multiSelect.anchor) + SnippetManager.prototype.register = function (snippets, scope) { + var snippetMap = this.snippetMap; + var snippetNameMap = this.snippetNameMap; + var self = this; + if (!snippets) + snippets = []; + function wrapRegexp(src) { + if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src)) + src = "(?:" + src + ")"; + return src || ""; + } + function guardedRegexp(re, guard, opening) { + re = wrapRegexp(re); + guard = wrapRegexp(guard); + if (opening) { + re = guard + re; + if (re && re[re.length - 1] != "$") + re = re + "$"; + } + else { + re = re + guard; + if (re && re[0] != "^") + re = "^" + re; + } + return new RegExp(re); + } + function addSnippet(s) { + if (!s.scope) + s.scope = scope || "_"; + scope = s.scope; + if (!snippetMap[scope]) { + snippetMap[scope] = []; + snippetNameMap[scope] = {}; + } + var map = snippetNameMap[scope]; + if (s.name) { + var old = map[s.name]; + if (old) + self.unregister(old); + map[s.name] = s; + } + snippetMap[scope].push(s); + if (s.prefix) + s.tabTrigger = s.prefix; + if (!s.content && s.body) + s.content = Array.isArray(s.body) ? s.body.join("\n") : s.body; + if (s.tabTrigger && !s.trigger) { + if (!s.guard && /^\w/.test(s.tabTrigger)) + s.guard = "\\b"; + s.trigger = lang.escapeRegExp(s.tabTrigger); + } + if (!s.trigger && !s.guard && !s.endTrigger && !s.endGuard) return; - var pos = anchor == this.multiSelect.anchor - ? range.cursor == range.start ? range.end : range.start - : range.cursor; - if (pos.row != anchor.row - || this.session.$clipPositionToDocument(pos.row, pos.column).column != anchor.column) - this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()); - else - this.multiSelect.mergeOverlappingRanges(); + s.startRe = guardedRegexp(s.trigger, s.guard, true); + s.triggerRe = new RegExp(s.trigger); + s.endRe = guardedRegexp(s.endTrigger, s.endGuard, true); + s.endTriggerRe = new RegExp(s.endTrigger); } - }; - this.findAll = function(needle, options, additive) { - options = options || {}; - options.needle = needle || options.needle; - if (options.needle == undefined) { - var range = this.selection.isEmpty() - ? this.selection.getWordRange() - : this.selection.getRange(); - options.needle = this.session.getTextRange(range); + if (Array.isArray(snippets)) { + snippets.forEach(addSnippet); } - this.$search.set(options); - - var ranges = this.$search.findAll(this.session); - if (!ranges.length) - return 0; - - var selection = this.multiSelect; - - if (!additive) - selection.toSingleRange(ranges[0]); - - for (var i = ranges.length; i--; ) - selection.addRange(ranges[i], true); - if (range && selection.rangeList.rangeAtPoint(range.start)) - selection.addRange(range, true); - - return ranges.length; + else { + Object.keys(snippets).forEach(function (key) { + addSnippet(snippets[key]); + }); + } + this._signal("registerSnippets", { scope: scope }); + }; + SnippetManager.prototype.unregister = function (snippets, scope) { + var snippetMap = this.snippetMap; + var snippetNameMap = this.snippetNameMap; + function removeSnippet(s) { + var nameMap = snippetNameMap[s.scope || scope]; + if (nameMap && nameMap[s.name]) { + delete nameMap[s.name]; + var map = snippetMap[s.scope || scope]; + var i = map && map.indexOf(s); + if (i >= 0) + map.splice(i, 1); + } + } + if (snippets.content) + removeSnippet(snippets); + else if (Array.isArray(snippets)) + snippets.forEach(removeSnippet); + }; + SnippetManager.prototype.parseSnippetFile = function (str) { + str = str.replace(/\r/g, ""); + var list = [], /**@type{Snippet}*/ snippet = {}; + var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm; + var m; + while (m = re.exec(str)) { + if (m[1]) { + try { + snippet = JSON.parse(m[1]); + list.push(snippet); + } + catch (e) { } + } + if (m[4]) { + snippet.content = m[4].replace(/^\t/gm, ""); + list.push(snippet); + snippet = {}; + } + else { + var key = m[2], val = m[3]; + if (key == "regex") { + var guardRe = /\/((?:[^\/\\]|\\.)*)|$/g; + snippet.guard = guardRe.exec(val)[1]; + snippet.trigger = guardRe.exec(val)[1]; + snippet.endTrigger = guardRe.exec(val)[1]; + snippet.endGuard = guardRe.exec(val)[1]; + } + else if (key == "snippet") { + snippet.tabTrigger = val.match(/^\S*/)[0]; + if (!snippet.name) + snippet.name = val; + } + else if (key) { + snippet[key] = val; + } + } + } + return list; }; - this.selectMoreLines = function(dir, skip) { - var range = this.selection.toOrientedRange(); - var isBackwards = range.cursor == range.end; - - var screenLead = this.session.documentToScreenPosition(range.cursor); - if (this.selection.$desiredColumn) - screenLead.column = this.selection.$desiredColumn; - - var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column); - - if (!range.isEmpty()) { - var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start); - var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column); - } else { - var anchor = lead; + SnippetManager.prototype.getSnippetByName = function (name, editor) { + var snippetMap = this.snippetNameMap; + var snippet; + this.getActiveScopes(editor).some(function (scope) { + var snippets = snippetMap[scope]; + if (snippets) + snippet = snippets[name]; + return !!snippet; + }, this); + return snippet; + }; + return SnippetManager; +}()); +oop.implement(SnippetManager.prototype, EventEmitter); +var processSnippetText = function (editor, snippetText, options) { + if (options === void 0) { options = {}; } + var cursor = editor.getCursorPosition(); + var line = editor.session.getLine(cursor.row); + var tabString = editor.session.getTabString(); + var indentString = line.match(/^\s*/)[0]; + if (cursor.column < indentString.length) + indentString = indentString.slice(0, cursor.column); + snippetText = snippetText.replace(/\r/g, ""); + var tokens = this.tokenizeTmSnippet(snippetText); + tokens = this.resolveVariables(tokens, editor); + tokens = tokens.map(function (x) { + if (x == "\n" && !options.excludeExtraIndent) + return x + indentString; + if (typeof x == "string") + return x.replace(/\t/g, tabString); + return x; + }); + var tabstops = []; + tokens.forEach(function (p, i) { + if (typeof p != "object") + return; + var id = p.tabstopId; + var ts = tabstops[id]; + if (!ts) { + ts = tabstops[id] = []; + ts.index = id; + ts.value = ""; + ts.parents = {}; + } + if (ts.indexOf(p) !== -1) + return; + if (p.choices && !ts.choices) + ts.choices = p.choices; + ts.push(p); + var i1 = tokens.indexOf(p, i + 1); + if (i1 === -1) + return; + var value = tokens.slice(i + 1, i1); + var isNested = value.some(function (t) { return typeof t === "object"; }); + if (isNested && !ts.value) { + ts.value = value; } - - if (isBackwards) { - var newRange = Range.fromPoints(lead, anchor); - newRange.cursor = newRange.start; - } else { - var newRange = Range.fromPoints(anchor, lead); - newRange.cursor = newRange.end; + else if (value.length && (!ts.value || typeof ts.value !== "string")) { + ts.value = value.join(""); } - - newRange.desiredColumn = screenLead.column; - if (!this.selection.inMultiSelectMode) { - this.selection.addRange(range); - } else { - if (skip) - var toRemove = range.cursor; + }); + tabstops.forEach(function (ts) { ts.length = 0; }); + var expanding = {}; + function copyValue(val) { + var copy = []; + for (var i = 0; i < val.length; i++) { + var p = val[i]; + if (typeof p == "object") { + if (expanding[p.tabstopId]) + continue; + var j = val.lastIndexOf(p, i - 1); + p = copy[j] || { tabstopId: p.tabstopId }; + } + copy[i] = p; } - - this.selection.addRange(newRange); - if (toRemove) - this.selection.substractPoint(toRemove); - }; - this.transposeSelections = function(dir) { - var session = this.session; - var sel = session.multiSelect; - var all = sel.ranges; - - for (var i = all.length; i--; ) { - var range = all[i]; - if (range.isEmpty()) { - var tmp = session.getWordRange(range.start.row, range.start.column); - range.start.row = tmp.start.row; - range.start.column = tmp.start.column; - range.end.row = tmp.end.row; - range.end.column = tmp.end.column; + return copy; + } + for (var i = 0; i < tokens.length; i++) { + var p = tokens[i]; + if (typeof p != "object") + continue; + var id = p.tabstopId; + var ts = tabstops[id]; + var i1 = tokens.indexOf(p, i + 1); + if (expanding[id]) { + if (expanding[id] === p) { + delete expanding[id]; + Object.keys(expanding).forEach(function (parentId) { + ts.parents[parentId] = true; + }); } + continue; } - sel.mergeOverlappingRanges(); - - var words = []; - for (var i = all.length; i--; ) { - var range = all[i]; - words.unshift(session.getTextRange(range)); + expanding[id] = p; + var value = ts.value; + if (typeof value !== "string") + value = copyValue(value); + else if (p.fmt) + value = this.tmStrFormat(value, p, editor); + tokens.splice.apply(tokens, [i + 1, Math.max(0, i1 - i)].concat(value, p)); + if (ts.indexOf(p) === -1) + ts.push(p); + } + var row = 0, column = 0; + var text = ""; + tokens.forEach(function (t) { + if (typeof t === "string") { + var lines = t.split("\n"); + if (lines.length > 1) { + column = lines[lines.length - 1].length; + row += lines.length - 1; + } + else + column += t.length; + text += t; } - - if (dir < 0) - words.unshift(words.pop()); - else - words.push(words.shift()); - - for (var i = all.length; i--; ) { - var range = all[i]; - var tmp = range.clone(); - session.replace(range, words[i]); - range.start.row = tmp.start.row; - range.start.column = tmp.start.column; + else if (t) { + if (!t.start) + t.start = { row: row, column: column }; + else + t.end = { row: row, column: column }; } - sel.fromOrientedRange(sel.ranges[0]); + }); + return { + text: text, + tabstops: tabstops, + tokens: tokens + }; +}; +var TabstopManager = /** @class */ (function () { + function TabstopManager(editor) { + this.index = 0; + this.ranges = []; + this.tabstops = []; + if (editor.tabstopManager) + return editor.tabstopManager; + editor.tabstopManager = this; + this.$onChange = this.onChange.bind(this); + this.$onChangeSelection = lang.delayedCall(this.onChangeSelection.bind(this)).schedule; + this.$onChangeSession = this.onChangeSession.bind(this); + this.$onAfterExec = this.onAfterExec.bind(this); + this.attach(editor); + } + TabstopManager.prototype.attach = function (editor) { + this.$openTabstops = null; + this.selectedTabstop = null; + this.editor = editor; + this.session = editor.session; + this.editor.on("change", this.$onChange); + this.editor.on("changeSelection", this.$onChangeSelection); + this.editor.on("changeSession", this.$onChangeSession); + this.editor.commands.on("afterExec", this.$onAfterExec); + this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + }; + TabstopManager.prototype.detach = function () { + this.tabstops.forEach(this.removeTabstopMarkers, this); + this.ranges.length = 0; + this.tabstops.length = 0; + this.selectedTabstop = null; + this.editor.off("change", this.$onChange); + this.editor.off("changeSelection", this.$onChangeSelection); + this.editor.off("changeSession", this.$onChangeSession); + this.editor.commands.off("afterExec", this.$onAfterExec); + this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); + this.editor.tabstopManager = null; + this.session = null; + this.editor = null; }; - this.selectMore = function(dir, skip, stopAtFirst) { + TabstopManager.prototype.onChange = function (delta) { + var isRemove = delta.action[0] == "r"; + var selectedTabstop = this.selectedTabstop || {}; + var parents = selectedTabstop.parents || {}; + var tabstops = this.tabstops.slice(); + for (var i = 0; i < tabstops.length; i++) { + var ts = tabstops[i]; + var active = ts == selectedTabstop || parents[ts.index]; + ts.rangeList.$bias = active ? 0 : 1; + if (delta.action == "remove" && ts !== selectedTabstop) { + var parentActive = ts.parents && ts.parents[selectedTabstop.index]; + var startIndex = ts.rangeList.pointIndex(delta.start, parentActive); + startIndex = startIndex < 0 ? -startIndex - 1 : startIndex + 1; + var endIndex = ts.rangeList.pointIndex(delta.end, parentActive); + endIndex = endIndex < 0 ? -endIndex - 1 : endIndex - 1; + var toRemove = ts.rangeList.ranges.slice(startIndex, endIndex); + for (var j = 0; j < toRemove.length; j++) + this.removeRange(toRemove[j]); + } + ts.rangeList.$onChange(delta); + } var session = this.session; - var sel = session.multiSelect; - - var range = sel.toOrientedRange(); - if (range.isEmpty()) { - range = session.getWordRange(range.start.row, range.start.column); - range.cursor = dir == -1 ? range.start : range.end; - this.multiSelect.addRange(range); - if (stopAtFirst) - return; + if (!this.$inChange && isRemove && session.getLength() == 1 && !session.getValue()) + this.detach(); + }; + TabstopManager.prototype.updateLinkedFields = function () { + var ts = this.selectedTabstop; + if (!ts || !ts.hasLinkedRanges || !ts.firstNonLinked) + return; + this.$inChange = true; + var session = this.session; + var text = session.getTextRange(ts.firstNonLinked); + for (var i = 0; i < ts.length; i++) { + var range = ts[i]; + if (!range.linked) + continue; + var original = range.original; + var fmt = exports.snippetManager.tmStrFormat(text, original, this.editor); + session.replace(range, fmt); } - var needle = session.getTextRange(range); - - var newRange = find(session, needle, dir); - if (newRange) { - newRange.cursor = dir == -1 ? newRange.start : newRange.end; - this.session.unfold(newRange); - this.multiSelect.addRange(newRange); - this.renderer.scrollCursorIntoView(null, 0.5); + this.$inChange = false; + }; + TabstopManager.prototype.onAfterExec = function (e) { + if (e.command && !e.command.readOnly) + this.updateLinkedFields(); + }; + TabstopManager.prototype.onChangeSelection = function () { + if (!this.editor) + return; + var lead = this.editor.selection.lead; + var anchor = this.editor.selection.anchor; + var isEmpty = this.editor.selection.isEmpty(); + for (var i = 0; i < this.ranges.length; i++) { + if (this.ranges[i].linked) + continue; + var containsLead = this.ranges[i].contains(lead.row, lead.column); + var containsAnchor = isEmpty || this.ranges[i].contains(anchor.row, anchor.column); + if (containsLead && containsAnchor) + return; } - if (skip) - this.multiSelect.substractPoint(range.cursor); + this.detach(); }; - this.alignCursors = function() { - var session = this.session; - var sel = session.multiSelect; - var ranges = sel.ranges; - var row = -1; - var sameRowRanges = ranges.filter(function(r) { - if (r.cursor.row == row) - return true; - row = r.cursor.row; - }); - - if (!ranges.length || sameRowRanges.length == ranges.length - 1) { - var range = this.selection.getRange(); - var fr = range.start.row, lr = range.end.row; - var guessRange = fr == lr; - if (guessRange) { - var max = this.session.getLength(); - var line; - do { - line = this.session.getLine(lr); - } while (/[=:]/.test(line) && ++lr < max); - do { - line = this.session.getLine(fr); - } while (/[=:]/.test(line) && --fr > 0); - - if (fr < 0) fr = 0; - if (lr >= max) lr = max - 1; - } - var lines = this.session.removeFullLines(fr, lr); - lines = this.$reAlignText(lines, guessRange); - this.session.insert({row: fr, column: 0}, lines.join("\n") + "\n"); - if (!guessRange) { - range.start.column = 0; - range.end.column = lines[lines.length - 1].length; - } - this.selection.setRange(range); - } else { - sameRowRanges.forEach(function(r) { - sel.substractPoint(r.cursor); - }); - - var maxCol = 0; - var minSpace = Infinity; - var spaceOffsets = ranges.map(function(r) { - var p = r.cursor; - var line = session.getLine(p.row); - var spaceOffset = line.substr(p.column).search(/\S/g); - if (spaceOffset == -1) - spaceOffset = 0; - - if (p.column > maxCol) - maxCol = p.column; - if (spaceOffset < minSpace) - minSpace = spaceOffset; - return spaceOffset; - }); - ranges.forEach(function(r, i) { - var p = r.cursor; - var l = maxCol - p.column; - var d = spaceOffsets[i] - minSpace; - if (l > d) - session.insert(p, lang.stringRepeat(" ", l - d)); - else - session.remove(new Range(p.row, p.column, p.row, p.column - l + d)); - - r.start.column = r.end.column = maxCol; - r.start.row = r.end.row = p.row; - r.cursor = r.end; - }); - sel.fromOrientedRange(ranges[0]); - this.renderer.updateCursor(); - this.renderer.updateBackMarkers(); + TabstopManager.prototype.onChangeSession = function () { + this.detach(); + }; + TabstopManager.prototype.tabNext = function (dir) { + var max = this.tabstops.length; + var index = this.index + (dir || 1); + index = Math.min(Math.max(index, 1), max); + if (index == max) + index = 0; + this.selectTabstop(index); + this.updateTabstopMarkers(); + if (index === 0) { + this.detach(); } }; - - this.$reAlignText = function(lines, forceLeft) { - var isLeftAligned = true, isRightAligned = true; - var startW, textW, endW; - - return lines.map(function(line) { - var m = line.match(/(\s*)(.*?)(\s*)([=:].*)/); - if (!m) - return [line]; - - if (startW == null) { - startW = m[1].length; - textW = m[2].length; - endW = m[3].length; - return m; + TabstopManager.prototype.selectTabstop = function (index) { + this.$openTabstops = null; + var ts = this.tabstops[this.index]; + if (ts) + this.addTabstopMarkers(ts); + this.index = index; + ts = this.tabstops[this.index]; + if (!ts || !ts.length) + return; + this.selectedTabstop = ts; + var range = ts.firstNonLinked || ts; + if (ts.choices) + range.cursor = range.start; + if (!this.editor.inVirtualSelectionMode) { + var sel = this.editor.multiSelect; + sel.toSingleRange(range); + for (var i = 0; i < ts.length; i++) { + if (ts.hasLinkedRanges && ts[i].linked) + continue; + sel.addRange(ts[i].clone(), true); } - - if (startW + textW + endW != m[1].length + m[2].length + m[3].length) - isRightAligned = false; - if (startW != m[1].length) - isLeftAligned = false; - - if (startW > m[1].length) - startW = m[1].length; - if (textW < m[2].length) - textW = m[2].length; - if (endW > m[3].length) - endW = m[3].length; - - return m; - }).map(forceLeft ? alignLeft : - isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign); - - function spaces(n) { - return lang.stringRepeat(" ", n); } - - function alignLeft(m) { - return !m[2] ? m[0] : spaces(startW) + m[2] - + spaces(textW - m[2].length + endW) - + m[4].replace(/^([=:])\s+/, "$1 "); - } - function alignRight(m) { - return !m[2] ? m[0] : spaces(startW + textW - m[2].length) + m[2] - + spaces(endW) - + m[4].replace(/^([=:])\s+/, "$1 "); + else { + this.editor.selection.fromOrientedRange(range); + } + this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + if (this.selectedTabstop && this.selectedTabstop.choices) + this.editor.execCommand("startAutocomplete", { matches: this.selectedTabstop.choices }); + }; + TabstopManager.prototype.addTabstops = function (tabstops, start, end) { + var useLink = this.useLink || !this.editor.getOption("enableMultiselect"); + if (!this.$openTabstops) + this.$openTabstops = []; + if (!tabstops[0]) { + var p = Range.fromPoints(end, end); + moveRelative(p.start, start); + moveRelative(p.end, start); + tabstops[0] = [p]; + tabstops[0].index = 0; + } + var i = this.index; + var arg = [i + 1, 0]; + var ranges = this.ranges; + var snippetId = this.snippetId = (this.snippetId || 0) + 1; + tabstops.forEach(function (ts, index) { + var dest = this.$openTabstops[index] || ts; + dest.snippetId = snippetId; + for (var i = 0; i < ts.length; i++) { + var p = ts[i]; + var range = Range.fromPoints(p.start, p.end || p.start); + movePoint(range.start, start); + movePoint(range.end, start); + range.original = p; + range.tabstop = dest; + ranges.push(range); + if (dest != ts) + dest.unshift(range); + else + dest[i] = range; + if (p.fmtString || (dest.firstNonLinked && useLink)) { + range.linked = true; + dest.hasLinkedRanges = true; + } + else if (!dest.firstNonLinked) + dest.firstNonLinked = range; + } + if (!dest.firstNonLinked) + dest.hasLinkedRanges = false; + if (dest === ts) { + arg.push(dest); + this.$openTabstops[index] = dest; + } + this.addTabstopMarkers(dest); + dest.rangeList = dest.rangeList || new RangeList(); + dest.rangeList.$bias = 0; + dest.rangeList.addList(dest); + }, this); + if (arg.length > 2) { + if (this.tabstops.length) + arg.push(arg.splice(2, 1)[0]); + this.tabstops.splice.apply(this.tabstops, arg); } - function unAlign(m) { - return !m[2] ? m[0] : spaces(startW) + m[2] - + spaces(endW) - + m[4].replace(/^([=:])\s+/, "$1 "); + }; + TabstopManager.prototype.addTabstopMarkers = function (ts) { + var session = this.session; + ts.forEach(function (range) { + if (!range.markerId) + range.markerId = session.addMarker(range, "ace_snippet-marker", "text"); + }); + }; + TabstopManager.prototype.removeTabstopMarkers = function (ts) { + var session = this.session; + ts.forEach(function (range) { + session.removeMarker(range.markerId); + range.markerId = null; + }); + }; + TabstopManager.prototype.updateTabstopMarkers = function () { + if (!this.selectedTabstop) + return; + var currentSnippetId = this.selectedTabstop.snippetId; + if (this.selectedTabstop.index === 0) { + currentSnippetId--; } + this.tabstops.forEach(function (ts) { + if (ts.snippetId === currentSnippetId) + this.addTabstopMarkers(ts); + else + this.removeTabstopMarkers(ts); + }, this); }; -}).call(Editor.prototype); - - -function isSamePoint(p1, p2) { - return p1.row == p2.row && p1.column == p2.column; -} -exports.onSessionChange = function(e) { - var session = e.session; - if (session && !session.multiSelect) { - session.$selectionMarkers = []; - session.selection.$initRangeList(); - session.multiSelect = session.selection; - } - this.multiSelect = session && session.multiSelect; - - var oldSession = e.oldSession; - if (oldSession) { - oldSession.multiSelect.off("addRange", this.$onAddRange); - oldSession.multiSelect.off("removeRange", this.$onRemoveRange); - oldSession.multiSelect.off("multiSelect", this.$onMultiSelect); - oldSession.multiSelect.off("singleSelect", this.$onSingleSelect); - oldSession.multiSelect.lead.off("change", this.$checkMultiselectChange); - oldSession.multiSelect.anchor.off("change", this.$checkMultiselectChange); - } - - if (session) { - session.multiSelect.on("addRange", this.$onAddRange); - session.multiSelect.on("removeRange", this.$onRemoveRange); - session.multiSelect.on("multiSelect", this.$onMultiSelect); - session.multiSelect.on("singleSelect", this.$onSingleSelect); - session.multiSelect.lead.on("change", this.$checkMultiselectChange); - session.multiSelect.anchor.on("change", this.$checkMultiselectChange); - } - - if (session && this.inMultiSelectMode != session.selection.inMultiSelectMode) { - if (session.selection.inMultiSelectMode) - this.$onMultiSelect(); - else - this.$onSingleSelect(); + TabstopManager.prototype.removeRange = function (range) { + var i = range.tabstop.indexOf(range); + if (i != -1) + range.tabstop.splice(i, 1); + i = this.ranges.indexOf(range); + if (i != -1) + this.ranges.splice(i, 1); + i = range.tabstop.rangeList.ranges.indexOf(range); + if (i != -1) + range.tabstop.splice(i, 1); + this.session.removeMarker(range.markerId); + if (!range.tabstop.length) { + i = this.tabstops.indexOf(range.tabstop); + if (i != -1) + this.tabstops.splice(i, 1); + if (!this.tabstops.length) + this.detach(); + } + }; + return TabstopManager; +}()); +TabstopManager.prototype.keyboardHandler = new HashHandler(); +TabstopManager.prototype.keyboardHandler.bindKeys({ + "Tab": function (editor) { + if (exports.snippetManager && exports.snippetManager.expandWithTab(editor)) + return; + editor.tabstopManager.tabNext(1); + editor.renderer.scrollCursorIntoView(); + }, + "Shift-Tab": function (editor) { + editor.tabstopManager.tabNext(-1); + editor.renderer.scrollCursorIntoView(); + }, + "Esc": function (editor) { + editor.tabstopManager.detach(); } +}); +var movePoint = function (point, diff) { + if (point.row == 0) + point.column += diff.column; + point.row += diff.row; }; -function MultiSelect(editor) { - if (editor.$multiselectOnSessionChange) - return; - editor.$onAddRange = editor.$onAddRange.bind(editor); - editor.$onRemoveRange = editor.$onRemoveRange.bind(editor); - editor.$onMultiSelect = editor.$onMultiSelect.bind(editor); - editor.$onSingleSelect = editor.$onSingleSelect.bind(editor); - editor.$multiselectOnSessionChange = exports.onSessionChange.bind(editor); - editor.$checkMultiselectChange = editor.$checkMultiselectChange.bind(editor); - - editor.$multiselectOnSessionChange(editor); - editor.on("changeSession", editor.$multiselectOnSessionChange); - - editor.on("mousedown", onMouseDown); - editor.commands.addCommands(commands.defaultCommands); +var moveRelative = function (point, start) { + if (point.row == start.row) + point.column -= start.column; + point.row -= start.row; +}; +dom.importCssString("\n.ace_snippet-marker {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n background: rgba(194, 193, 208, 0.09);\n border: 1px dotted rgba(211, 208, 235, 0.62);\n position: absolute;\n}", "snippets.css", false); +exports.snippetManager = new SnippetManager(); +var Editor = require("./editor").Editor; +(function () { + this.insertSnippet = function (content, options) { + return exports.snippetManager.insertSnippet(this, content, options); + }; + this.expandSnippet = function (options) { + return exports.snippetManager.expandWithTab(this, options); + }; +}).call(Editor.prototype); - addAltCursorListeners(editor); -} +}); -function addAltCursorListeners(editor){ - if (!editor.textInput) return; - var el = editor.textInput.getElement(); - var altCursor = false; - event.addListener(el, "keydown", function(e) { - var altDown = e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey); - if (editor.$blockSelectEnabled && altDown) { - if (!altCursor) { - editor.renderer.setMouseCursor("crosshair"); - altCursor = true; +ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/config","ace/lib/useragent"], function(require, exports, module){"use strict"; +var Renderer = require("../virtual_renderer").VirtualRenderer; +var Editor = require("../editor").Editor; +var Range = require("../range").Range; +var event = require("../lib/event"); +var lang = require("../lib/lang"); +var dom = require("../lib/dom"); +var nls = require("../config").nls; +var userAgent = require("./../lib/useragent"); +var getAriaId = function (index) { + return "suggest-aria-id:".concat(index); +}; +var popupAriaRole = userAgent.isSafari ? "menu" : "listbox"; +var optionAriaRole = userAgent.isSafari ? "menuitem" : "option"; +var ariaActiveState = userAgent.isSafari ? "aria-current" : "aria-selected"; +var $singleLineEditor = function (el) { + var renderer = new Renderer(el); + renderer.$maxLines = 4; + var editor = new Editor(renderer); + editor.setHighlightActiveLine(false); + editor.setShowPrintMargin(false); + editor.renderer.setShowGutter(false); + editor.renderer.setHighlightGutterLine(false); + editor.$mouseHandler.$focusTimeout = 0; + editor.$highlightTagPending = true; + return editor; +}; +var AcePopup = /** @class */ (function () { + function AcePopup(parentNode) { + var el = dom.createElement("div"); + var popup = $singleLineEditor(el); + if (parentNode) { + parentNode.appendChild(el); + } + el.style.display = "none"; + popup.renderer.content.style.cursor = "default"; + popup.renderer.setStyle("ace_autocomplete"); + popup.renderer.$textLayer.element.setAttribute("role", popupAriaRole); + popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("autocomplete.popup.aria-roledescription", "Autocomplete suggestions")); + popup.renderer.$textLayer.element.setAttribute("aria-label", nls("autocomplete.popup.aria-label", "Autocomplete suggestions")); + popup.renderer.textarea.setAttribute("aria-hidden", "true"); + popup.setOption("displayIndentGuides", false); + popup.setOption("dragDelay", 150); + var noop = function () { }; + popup.focus = noop; + popup.$isFocused = true; + popup.renderer.$cursorLayer.restartTimer = noop; + popup.renderer.$cursorLayer.element.style.opacity = "0"; + popup.renderer.$maxLines = 8; + popup.renderer.$keepTextAreaAtCursor = false; + popup.setHighlightActiveLine(false); + popup.session.highlight(""); + popup.session.$searchHighlight.clazz = "ace_highlight-marker"; + popup.on("mousedown", function (e) { + var pos = e.getDocumentPosition(); + popup.selection.moveToPosition(pos); + selectionMarker.start.row = selectionMarker.end.row = pos.row; + e.stop(); + }); + var lastMouseEvent; + var hoverMarker = new Range(-1, 0, -1, Infinity); + var selectionMarker = new Range(-1, 0, -1, Infinity); + selectionMarker.id = popup.session.addMarker(selectionMarker, "ace_active-line", "fullLine"); + popup.setSelectOnHover = function (val) { + if (!val) { + hoverMarker.id = popup.session.addMarker(hoverMarker, "ace_line-hover", "fullLine"); + } + else if (hoverMarker.id) { + popup.session.removeMarker(hoverMarker.id); + hoverMarker.id = null; } - } else if (altCursor) { - reset(); - } - }, editor); - - event.addListener(el, "keyup", reset, editor); - event.addListener(el, "blur", reset, editor); - function reset(e) { - if (altCursor) { - editor.renderer.setMouseCursor(""); - altCursor = false; - } - } -} - -exports.MultiSelect = MultiSelect; - - -require("./config").defineOptions(Editor.prototype, "editor", { - enableMultiselect: { - set: function(val) { - MultiSelect(this); - if (val) { - this.on("changeSession", this.$multiselectOnSessionChange); - this.on("mousedown", onMouseDown); - } else { - this.off("changeSession", this.$multiselectOnSessionChange); - this.off("mousedown", onMouseDown); + }; + popup.setSelectOnHover(false); + popup.on("mousemove", function (e) { + if (!lastMouseEvent) { + lastMouseEvent = e; + return; } - }, - value: true - }, - enableBlockSelect: { - set: function(val) { - this.$blockSelectEnabled = val; - }, - value: true + if (lastMouseEvent.x == e.x && lastMouseEvent.y == e.y) { + return; + } + lastMouseEvent = e; + lastMouseEvent.scrollTop = popup.renderer.scrollTop; + popup.isMouseOver = true; + var row = lastMouseEvent.getDocumentPosition().row; + if (hoverMarker.start.row != row) { + if (!hoverMarker.id) + popup.setRow(row); + setHoverMarker(row); + } + }); + popup.renderer.on("beforeRender", function () { + if (lastMouseEvent && hoverMarker.start.row != -1) { + lastMouseEvent.$pos = null; + var row = lastMouseEvent.getDocumentPosition().row; + if (!hoverMarker.id) + popup.setRow(row); + setHoverMarker(row, true); + } + }); + popup.renderer.on("afterRender", function () { + var row = popup.getRow(); + var t = popup.renderer.$textLayer; + var selected = /** @type {HTMLElement|null} */ (t.element.childNodes[row - t.config.firstRow]); + var el = document.activeElement; // Active element is textarea of main editor + if (selected !== popup.selectedNode && popup.selectedNode) { + dom.removeCssClass(popup.selectedNode, "ace_selected"); + el.removeAttribute("aria-activedescendant"); + popup.selectedNode.removeAttribute(ariaActiveState); + popup.selectedNode.removeAttribute("id"); + } + popup.selectedNode = selected; + if (selected) { + dom.addCssClass(selected, "ace_selected"); + var ariaId = getAriaId(row); + selected.id = ariaId; + t.element.setAttribute("aria-activedescendant", ariaId); + el.setAttribute("aria-activedescendant", ariaId); + selected.setAttribute("role", optionAriaRole); + selected.setAttribute("aria-roledescription", nls("autocomplete.popup.item.aria-roledescription", "item")); + selected.setAttribute("aria-label", popup.getData(row).caption || popup.getData(row).value); + selected.setAttribute("aria-setsize", popup.data.length); + selected.setAttribute("aria-posinset", row + 1); + selected.setAttribute("aria-describedby", "doc-tooltip"); + selected.setAttribute(ariaActiveState, "true"); + } + }); + var hideHoverMarker = function () { setHoverMarker(-1); }; + var setHoverMarker = function (row, suppressRedraw) { + if (row !== hoverMarker.start.row) { + hoverMarker.start.row = hoverMarker.end.row = row; + if (!suppressRedraw) + popup.session._emit("changeBackMarker"); + popup._emit("changeHoverMarker"); + } + }; + popup.getHoveredRow = function () { + return hoverMarker.start.row; + }; + event.addListener(popup.container, "mouseout", function () { + popup.isMouseOver = false; + hideHoverMarker(); + }); + popup.on("hide", hideHoverMarker); + popup.on("changeSelection", hideHoverMarker); + popup.session.doc.getLength = function () { + return popup.data.length; + }; + popup.session.doc.getLine = function (i) { + var data = popup.data[i]; + if (typeof data == "string") + return data; + return (data && data.value) || ""; + }; + var bgTokenizer = popup.session.bgTokenizer; + bgTokenizer.$tokenizeRow = function (row) { + var data = popup.data[row]; + var tokens = []; + if (!data) + return tokens; + if (typeof data == "string") + data = { value: data }; + var caption = data.caption || data.value || data.name; + function addToken(value, className) { + value && tokens.push({ + type: (data.className || "") + (className || ""), + value: value + }); + } + var lower = caption.toLowerCase(); + var filterText = (popup.filterText || "").toLowerCase(); + var lastIndex = 0; + var lastI = 0; + for (var i = 0; i <= filterText.length; i++) { + if (i != lastI && (data.matchMask & (1 << i) || i == filterText.length)) { + var sub = filterText.slice(lastI, i); + lastI = i; + var index = lower.indexOf(sub, lastIndex); + if (index == -1) + continue; + addToken(caption.slice(lastIndex, index), ""); + lastIndex = index + sub.length; + addToken(caption.slice(index, lastIndex), "completion-highlight"); + } + } + addToken(caption.slice(lastIndex, caption.length), ""); + tokens.push({ type: "completion-spacer", value: " " }); + if (data.meta) + tokens.push({ type: "completion-meta", value: data.meta }); + if (data.message) + tokens.push({ type: "completion-message", value: data.message }); + return tokens; + }; + bgTokenizer.$updateOnChange = noop; + bgTokenizer.start = noop; + popup.session.$computeWidth = function () { + return this.screenWidth = 0; + }; + popup.isOpen = false; + popup.isTopdown = false; + popup.autoSelect = true; + popup.filterText = ""; + popup.isMouseOver = false; + popup.data = []; + popup.setData = function (list, filterText) { + popup.filterText = filterText || ""; + popup.setValue(lang.stringRepeat("\n", list.length), -1); + popup.data = list || []; + popup.setRow(0); + }; + popup.getData = function (row) { + return popup.data[row]; + }; + popup.getRow = function () { + return selectionMarker.start.row; + }; + popup.setRow = function (line) { + line = Math.max(this.autoSelect ? 0 : -1, Math.min(this.data.length - 1, line)); + if (selectionMarker.start.row != line) { + popup.selection.clearSelection(); + selectionMarker.start.row = selectionMarker.end.row = line || 0; + popup.session._emit("changeBackMarker"); + popup.moveCursorTo(line || 0, 0); + if (popup.isOpen) + popup._signal("select"); + } + }; + popup.on("changeSelection", function () { + if (popup.isOpen) + popup.setRow(popup.selection.lead.row); + popup.renderer.scrollCursorIntoView(); + }); + popup.hide = function () { + this.container.style.display = "none"; + popup.anchorPos = null; + popup.anchor = null; + if (popup.isOpen) { + popup.isOpen = false; + this._signal("hide"); + } + }; + popup.tryShow = function (pos, lineHeight, anchor, forceShow) { + if (!forceShow && popup.isOpen && popup.anchorPos && popup.anchor && + popup.anchorPos.top === pos.top && popup.anchorPos.left === pos.left && + popup.anchor === anchor) { + return true; + } + var el = this.container; + var screenHeight = window.innerHeight; + var screenWidth = window.innerWidth; + var renderer = this.renderer; + var maxH = renderer.$maxLines * lineHeight * 1.4; + var dims = { top: 0, bottom: 0, left: 0 }; + var spaceBelow = screenHeight - pos.top - 3 * this.$borderSize - lineHeight; + var spaceAbove = pos.top - 3 * this.$borderSize; + if (!anchor) { + if (spaceAbove <= spaceBelow || spaceBelow >= maxH) { + anchor = "bottom"; + } + else { + anchor = "top"; + } + } + if (anchor === "top") { + dims.bottom = pos.top - this.$borderSize; + dims.top = dims.bottom - maxH; + } + else if (anchor === "bottom") { + dims.top = pos.top + lineHeight + this.$borderSize; + dims.bottom = dims.top + maxH; + } + var fitsX = dims.top >= 0 && dims.bottom <= screenHeight; + if (!forceShow && !fitsX) { + return false; + } + if (!fitsX) { + if (anchor === "top") { + renderer.$maxPixelHeight = spaceAbove; + } + else { + renderer.$maxPixelHeight = spaceBelow; + } + } + else { + renderer.$maxPixelHeight = null; + } + if (anchor === "top") { + el.style.top = ""; + el.style.bottom = (screenHeight - dims.bottom) + "px"; + popup.isTopdown = false; + } + else { + el.style.top = dims.top + "px"; + el.style.bottom = ""; + popup.isTopdown = true; + } + el.style.display = ""; + var left = pos.left; + if (left + el.offsetWidth > screenWidth) + left = screenWidth - el.offsetWidth; + el.style.left = left + "px"; + el.style.right = ""; + if (!popup.isOpen) { + popup.isOpen = true; + this._signal("show"); + lastMouseEvent = null; + } + popup.anchorPos = pos; + popup.anchor = anchor; + return true; + }; + popup.show = function (pos, lineHeight, topdownOnly) { + this.tryShow(pos, lineHeight, topdownOnly ? "bottom" : undefined, true); + }; + popup.goTo = function (where) { + var row = this.getRow(); + var max = this.session.getLength() - 1; + switch (where) { + case "up": + row = row <= 0 ? max : row - 1; + break; + case "down": + row = row >= max ? -1 : row + 1; + break; + case "start": + row = 0; + break; + case "end": + row = max; + break; + } + this.setRow(row); + }; + popup.getTextLeftOffset = function () { + return this.$borderSize + this.renderer.$padding + this.$imageSize; + }; + popup.$imageSize = 0; + popup.$borderSize = 1; + return popup; } -}); - - + return AcePopup; +}()); +dom.importCssString("\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: \"\";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n", "autocompletion.css", false); +exports.AcePopup = AcePopup; +exports.$singleLineEditor = $singleLineEditor; +exports.getAriaId = getAriaId; }); -ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"], function(require, exports, module) { -"use strict"; - -var Range = require("../../range").Range; - -var FoldMode = exports.FoldMode = function() {}; - -(function() { - - this.foldingStartMarker = null; - this.foldingStopMarker = null; - this.getFoldWidget = function(session, foldStyle, row) { - var line = session.getLine(row); - if (this.foldingStartMarker.test(line)) - return "start"; - if (foldStyle == "markbeginend" - && this.foldingStopMarker - && this.foldingStopMarker.test(line)) - return "end"; - return ""; +ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"], function(require, exports, module){"use strict"; +var AceInlineScreenReader = /** @class */ (function () { + function AceInlineScreenReader(editor) { + this.editor = editor; + this.screenReaderDiv = document.createElement("div"); + this.screenReaderDiv.classList.add("ace_screenreader-only"); + this.editor.container.appendChild(this.screenReaderDiv); + } + AceInlineScreenReader.prototype.setScreenReaderContent = function (content) { + if (!this.popup && this.editor.completer && /**@type{import("../autocomplete").Autocomplete}*/ (this.editor.completer).popup) { + this.popup = /**@type{import("../autocomplete").Autocomplete}*/ (this.editor.completer).popup; + this.popup.renderer.on("afterRender", function () { + var row = this.popup.getRow(); + var t = this.popup.renderer.$textLayer; + var selected = t.element.childNodes[row - t.config.firstRow]; + if (selected) { + var idString = "doc-tooltip "; + for (var lineIndex = 0; lineIndex < this._lines.length; lineIndex++) { + idString += "ace-inline-screenreader-line-".concat(lineIndex, " "); + } + selected.setAttribute("aria-describedby", idString); + } + }.bind(this)); + } + while (this.screenReaderDiv.firstChild) { + this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild); + } + this._lines = content.split(/\r\n|\r|\n/); + var codeElement = this.createCodeBlock(); + this.screenReaderDiv.appendChild(codeElement); }; - - this.getFoldWidgetRange = function(session, foldStyle, row) { - return null; + AceInlineScreenReader.prototype.destroy = function () { + this.screenReaderDiv.remove(); }; + AceInlineScreenReader.prototype.createCodeBlock = function () { + var container = document.createElement("pre"); + container.setAttribute("id", "ace-inline-screenreader"); + for (var lineIndex = 0; lineIndex < this._lines.length; lineIndex++) { + var codeElement = document.createElement("code"); + codeElement.setAttribute("id", "ace-inline-screenreader-line-".concat(lineIndex)); + var line = document.createTextNode(this._lines[lineIndex]); + codeElement.appendChild(line); + container.appendChild(codeElement); + } + return container; + }; + return AceInlineScreenReader; +}()); +exports.AceInlineScreenReader = AceInlineScreenReader; - this.indentationBlock = function(session, row, column) { - var re = /\S/; - var line = session.getLine(row); - var startLevel = line.search(re); - if (startLevel == -1) - return; - - var startColumn = column || line.length; - var maxRow = session.getLength(); - var startRow = row; - var endRow = row; - - while (++row < maxRow) { - var level = session.getLine(row).search(re); - - if (level == -1) - continue; - - if (level <= startLevel) { - var token = session.getTokenAt(row, 0); - if (!token || token.type !== "string") - break; - } +}); - endRow = row; +ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"], function(require, exports, module){"use strict"; +var snippetManager = require("../snippets").snippetManager; +var AceInlineScreenReader = require("./inline_screenreader").AceInlineScreenReader; +var AceInline = /** @class */ (function () { + function AceInline() { + this.editor = null; + } + AceInline.prototype.show = function (editor, completion, prefix) { + prefix = prefix || ""; + if (editor && this.editor && this.editor !== editor) { + this.hide(); + this.editor = null; + this.inlineScreenReader = null; } - - if (endRow > startRow) { - var endColumn = session.getLine(endRow).length; - return new Range(startRow, startColumn, endRow, endColumn); + if (!editor || !completion) { + return false; + } + if (!this.inlineScreenReader) { + this.inlineScreenReader = new AceInlineScreenReader(editor); + } + var displayText = completion.snippet ? snippetManager.getDisplayTextForSnippet(editor, completion.snippet) : completion.value; + if (completion.hideInlinePreview || !displayText || !displayText.startsWith(prefix)) { + return false; + } + this.editor = editor; + this.inlineScreenReader.setScreenReaderContent(displayText); + displayText = displayText.slice(prefix.length); + if (displayText === "") { + editor.removeGhostText(); } + else { + editor.setGhostText(displayText); + } + return true; }; - - this.openingBracketBlock = function(session, bracket, row, column, typeRe) { - var start = {row: row, column: column + 1}; - var end = session.$findClosingBracket(bracket, start, typeRe); - if (!end) - return; - - var fw = session.foldWidgets[end.row]; - if (fw == null) - fw = session.getFoldWidget(end.row); - - if (fw == "start" && end.row > start.row) { - end.row --; - end.column = session.getLine(end.row).length; + AceInline.prototype.isOpen = function () { + if (!this.editor) { + return false; } - return Range.fromPoints(start, end); + return !!this.editor.renderer.$ghostText; }; - - this.closingBracketBlock = function(session, bracket, row, column, typeRe) { - var end = {row: row, column: column}; - var start = session.$findOpeningBracket(bracket, end); - - if (!start) - return; - - start.column++; - end.column--; - - return Range.fromPoints(start, end); + AceInline.prototype.hide = function () { + if (!this.editor) { + return false; + } + this.editor.removeGhostText(); + return true; }; -}).call(FoldMode.prototype); + AceInline.prototype.destroy = function () { + this.hide(); + this.editor = null; + if (this.inlineScreenReader) { + this.inlineScreenReader.destroy(); + this.inlineScreenReader = null; + } + }; + return AceInline; +}()); +exports.AceInline = AceInline; }); -ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) { -"use strict"; - -exports.isDark = false; -exports.cssClass = "ace-tm"; -exports.cssText = ".ace-tm .ace_gutter {\ -background: #f0f0f0;\ -color: #333;\ -}\ -.ace-tm .ace_print-margin {\ -width: 1px;\ -background: #e8e8e8;\ -}\ -.ace-tm .ace_fold {\ -background-color: #6B72E6;\ -}\ -.ace-tm {\ -background-color: #FFFFFF;\ -color: black;\ -}\ -.ace-tm .ace_cursor {\ -color: black;\ -}\ -.ace-tm .ace_invisible {\ -color: rgb(191, 191, 191);\ -}\ -.ace-tm .ace_storage,\ -.ace-tm .ace_keyword {\ -color: blue;\ -}\ -.ace-tm .ace_constant {\ -color: rgb(197, 6, 11);\ -}\ -.ace-tm .ace_constant.ace_buildin {\ -color: rgb(88, 72, 246);\ -}\ -.ace-tm .ace_constant.ace_language {\ -color: rgb(88, 92, 246);\ -}\ -.ace-tm .ace_constant.ace_library {\ -color: rgb(6, 150, 14);\ -}\ -.ace-tm .ace_invalid {\ -background-color: rgba(255, 0, 0, 0.1);\ -color: red;\ -}\ -.ace-tm .ace_support.ace_function {\ -color: rgb(60, 76, 114);\ -}\ -.ace-tm .ace_support.ace_constant {\ -color: rgb(6, 150, 14);\ -}\ -.ace-tm .ace_support.ace_type,\ -.ace-tm .ace_support.ace_class {\ -color: rgb(109, 121, 222);\ -}\ -.ace-tm .ace_keyword.ace_operator {\ -color: rgb(104, 118, 135);\ -}\ -.ace-tm .ace_string {\ -color: rgb(3, 106, 7);\ -}\ -.ace-tm .ace_comment {\ -color: rgb(76, 136, 107);\ -}\ -.ace-tm .ace_comment.ace_doc {\ -color: rgb(0, 102, 255);\ -}\ -.ace-tm .ace_comment.ace_doc.ace_tag {\ -color: rgb(128, 159, 191);\ -}\ -.ace-tm .ace_constant.ace_numeric {\ -color: rgb(0, 0, 205);\ -}\ -.ace-tm .ace_variable {\ -color: rgb(49, 132, 149);\ -}\ -.ace-tm .ace_xml-pe {\ -color: rgb(104, 104, 91);\ -}\ -.ace-tm .ace_entity.ace_name.ace_function {\ -color: #0000A2;\ -}\ -.ace-tm .ace_heading {\ -color: rgb(12, 7, 255);\ -}\ -.ace-tm .ace_list {\ -color:rgb(185, 6, 144);\ -}\ -.ace-tm .ace_meta.ace_tag {\ -color:rgb(0, 22, 142);\ -}\ -.ace-tm .ace_string.ace_regex {\ -color: rgb(255, 0, 0)\ -}\ -.ace-tm .ace_marker-layer .ace_selection {\ -background: rgb(181, 213, 255);\ -}\ -.ace-tm.ace_multiselect .ace_selection.ace_start {\ -box-shadow: 0 0 3px 0px white;\ -}\ -.ace-tm .ace_marker-layer .ace_step {\ -background: rgb(252, 255, 0);\ -}\ -.ace-tm .ace_marker-layer .ace_stack {\ -background: rgb(164, 229, 101);\ -}\ -.ace-tm .ace_marker-layer .ace_bracket {\ -margin: -1px 0 0 -1px;\ -border: 1px solid rgb(192, 192, 192);\ -}\ -.ace-tm .ace_marker-layer .ace_active-line {\ -background: rgba(0, 0, 0, 0.07);\ -}\ -.ace-tm .ace_gutter-active-line {\ -background-color : #dcdcdc;\ -}\ -.ace-tm .ace_marker-layer .ace_selected-word {\ -background: rgb(250, 250, 255);\ -border: 1px solid rgb(200, 200, 250);\ -}\ -.ace-tm .ace_indent-guide {\ -background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ -}\ -"; -exports.$id = "ace/theme/textmate"; +ace.define("ace/autocomplete/util",["require","exports","module"], function(require, exports, module){"use strict"; +exports.parForEach = function (array, fn, callback) { + var completed = 0; + var arLength = array.length; + if (arLength === 0) + callback(); + for (var i = 0; i < arLength; i++) { + fn(array[i], function (result, err) { + completed++; + if (completed === arLength) + callback(result, err); + }); + } +}; +var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/; +exports.retrievePrecedingIdentifier = function (text, pos, regex) { + regex = regex || ID_REGEX; + var buf = []; + for (var i = pos - 1; i >= 0; i--) { + if (regex.test(text[i])) + buf.push(text[i]); + else + break; + } + return buf.reverse().join(""); +}; +exports.retrieveFollowingIdentifier = function (text, pos, regex) { + regex = regex || ID_REGEX; + var buf = []; + for (var i = pos; i < text.length; i++) { + if (regex.test(text[i])) + buf.push(text[i]); + else + break; + } + return buf; +}; +exports.getCompletionPrefix = function (editor) { + var pos = editor.getCursorPosition(); + var line = editor.session.getLine(pos.row); + var prefix; + editor.completers.forEach(function (completer) { + if (completer.identifierRegexps) { + completer.identifierRegexps.forEach(function (identifierRegex) { + if (!prefix && identifierRegex) + prefix = this.retrievePrecedingIdentifier(line, pos.column, identifierRegex); + }.bind(this)); + } + }.bind(this)); + return prefix || this.retrievePrecedingIdentifier(line, pos.column); +}; +exports.triggerAutocomplete = function (editor, previousChar) { + var previousChar = previousChar == null + ? editor.session.getPrecedingCharacter() + : previousChar; + return editor.completers.some(function (completer) { + if (completer.triggerCharacters && Array.isArray(completer.triggerCharacters)) { + return completer.triggerCharacters.includes(previousChar); + } + }); +}; -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); }); -ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"], function(require, exports, module) { -"use strict"; - +ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"], function(require, exports, module){"use strict"; +var HashHandler = require("./keyboard/hash_handler").HashHandler; +var AcePopup = require("./autocomplete/popup").AcePopup; +var AceInline = require("./autocomplete/inline").AceInline; +var getAriaId = require("./autocomplete/popup").getAriaId; +var util = require("./autocomplete/util"); +var lang = require("./lib/lang"); var dom = require("./lib/dom"); - -function LineWidgets(session) { - this.session = session; - this.session.widgetManager = this; - this.session.getRowLength = this.getRowLength; - this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; - this.updateOnChange = this.updateOnChange.bind(this); - this.renderWidgets = this.renderWidgets.bind(this); - this.measureWidgets = this.measureWidgets.bind(this); - this.session._changedWidgets = []; - this.$onChangeEditor = this.$onChangeEditor.bind(this); - - this.session.on("change", this.updateOnChange); - this.session.on("changeFold", this.updateOnFold); - this.session.on("changeEditor", this.$onChangeEditor); -} - -(function() { - this.getRowLength = function(row) { - var h; - if (this.lineWidgets) - h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; - else - h = 0; - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1 + h; - } else { - return this.$wrapData[row].length + 1 + h; - } +var snippetManager = require("./snippets").snippetManager; +var config = require("./config"); +var event = require("./lib/event"); +var preventParentScroll = require("./lib/scroll").preventParentScroll; +var destroyCompleter = function (e, editor) { + editor.completer && editor.completer.destroy(); +}; +var Autocomplete = /** @class */ (function () { + function Autocomplete() { + this.autoInsert = false; + this.autoSelect = true; + this.autoShown = false; + this.exactMatch = false; + this.inlineEnabled = false; + this.keyboardHandler = new HashHandler(); + this.keyboardHandler.bindKeys(this.commands); + this.parentNode = null; + this.setSelectOnHover = false; + this.hasSeen = new Set(); + this.showLoadingState = false; + this.stickySelectionDelay = 500; + this.blurListener = this.blurListener.bind(this); + this.changeListener = this.changeListener.bind(this); + this.mousedownListener = this.mousedownListener.bind(this); + this.mousewheelListener = this.mousewheelListener.bind(this); + this.onLayoutChange = this.onLayoutChange.bind(this); + this.changeTimer = lang.delayedCall(function () { + this.updateCompletions(true); + }.bind(this)); + this.tooltipTimer = lang.delayedCall(this.updateDocTooltip.bind(this), 50); + this.popupTimer = lang.delayedCall(this.$updatePopupPosition.bind(this), 50); + this.stickySelectionTimer = lang.delayedCall(function () { + this.stickySelection = true; + }.bind(this), this.stickySelectionDelay); + this.$firstOpenTimer = lang.delayedCall(/**@this{Autocomplete}*/ function () { + var initialPosition = this.completionProvider && this.completionProvider.initialPosition; + if (this.autoShown || (this.popup && this.popup.isOpen) || !initialPosition || this.editor.completers.length === 0) + return; + this.completions = new FilteredList(Autocomplete.completionsForLoading); + this.openPopup(this.editor, initialPosition.prefix, false); + this.popup.renderer.setStyle("ace_loading", true); + }.bind(this), this.stickySelectionDelay); + } + Object.defineProperty(Autocomplete, "completionsForLoading", { + get: function () { + return [{ + caption: config.nls("autocomplete.loading", "Loading..."), + value: "" + }]; + }, + enumerable: false, + configurable: true + }); + Autocomplete.prototype.$init = function () { + this.popup = new AcePopup(this.parentNode || document.body || document.documentElement); + this.popup.on("click", function (e) { + this.insertMatch(); + e.stop(); + }.bind(this)); + this.popup.focus = this.editor.focus.bind(this.editor); + this.popup.on("show", this.$onPopupShow.bind(this)); + this.popup.on("hide", this.$onHidePopup.bind(this)); + this.popup.on("select", this.$onPopupChange.bind(this)); + event.addListener(this.popup.container, "mouseout", this.mouseOutListener.bind(this)); + this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null)); + this.popup.renderer.on("afterRender", this.$onPopupRender.bind(this)); + return this.popup; + }; + Autocomplete.prototype.$initInline = function () { + if (!this.inlineEnabled || this.inlineRenderer) + return; + this.inlineRenderer = new AceInline(); + return this.inlineRenderer; }; - - this.$getWidgetScreenLength = function() { - var screenRows = 0; - this.lineWidgets.forEach(function(w){ - if (w && w.rowCount && !w.hidden) - screenRows += w.rowCount; - }); - return screenRows; + Autocomplete.prototype.getPopup = function () { + return this.popup || this.$init(); }; - - this.$onChangeEditor = function(e) { - this.attach(e.editor); + Autocomplete.prototype.$onHidePopup = function () { + if (this.inlineRenderer) { + this.inlineRenderer.hide(); + } + this.hideDocTooltip(); + this.stickySelectionTimer.cancel(); + this.popupTimer.cancel(); + this.stickySelection = false; }; - - this.attach = function(editor) { - if (editor && editor.widgetManager && editor.widgetManager != this) - editor.widgetManager.detach(); - - if (this.editor == editor) - return; - - this.detach(); - this.editor = editor; - - if (editor) { - editor.widgetManager = this; - editor.renderer.on("beforeRender", this.measureWidgets); - editor.renderer.on("afterRender", this.renderWidgets); + Autocomplete.prototype.$seen = function (completion) { + if (!this.hasSeen.has(completion) && completion && completion.completer && completion.completer.onSeen && typeof completion.completer.onSeen === "function") { + completion.completer.onSeen(this.editor, completion); + this.hasSeen.add(completion); } }; - this.detach = function(e) { - var editor = this.editor; - if (!editor) - return; - - this.editor = null; - editor.widgetManager = null; - - editor.renderer.off("beforeRender", this.measureWidgets); - editor.renderer.off("afterRender", this.renderWidgets); - var lineWidgets = this.session.lineWidgets; - lineWidgets && lineWidgets.forEach(function(w) { - if (w && w.el && w.el.parentNode) { - w._inDocument = false; - w.el.parentNode.removeChild(w.el); + Autocomplete.prototype.$onPopupChange = function (hide) { + if (this.inlineRenderer && this.inlineEnabled) { + var completion = hide ? null : this.popup.getData(this.popup.getRow()); + this.$updateGhostText(completion); + if (this.popup.isMouseOver && this.setSelectOnHover) { + this.tooltipTimer.call(null, null); + return; } - }); - }; - - this.updateOnFold = function(e, session) { - var lineWidgets = session.lineWidgets; - if (!lineWidgets || !e.action) - return; - var fold = e.data; - var start = fold.start.row; - var end = fold.end.row; - var hide = e.action == "add"; - for (var i = start + 1; i < end; i++) { - if (lineWidgets[i]) - lineWidgets[i].hidden = hide; + this.popupTimer.schedule(); + this.tooltipTimer.schedule(); } - if (lineWidgets[end]) { - if (hide) { - if (!lineWidgets[start]) - lineWidgets[start] = lineWidgets[end]; - else - lineWidgets[end].hidden = hide; - } else { - if (lineWidgets[start] == lineWidgets[end]) - lineWidgets[start] = undefined; - lineWidgets[end].hidden = hide; - } + else { + this.popupTimer.call(null, null); + this.tooltipTimer.call(null, null); } }; - - this.updateOnChange = function(delta) { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) return; - - var startRow = delta.start.row; - var len = delta.end.row - startRow; - - if (len === 0) { - } else if (delta.action == "remove") { - var removed = lineWidgets.splice(startRow + 1, len); - if (!lineWidgets[startRow] && removed[removed.length - 1]) { - lineWidgets[startRow] = removed.pop(); - } - removed.forEach(function(w) { - w && this.removeLineWidget(w); - }, this); - this.$updateRows(); - } else { - var args = new Array(len); - if (lineWidgets[startRow] && lineWidgets[startRow].column != null) { - if (delta.start.column > lineWidgets[startRow].column) - startRow++; - } - args.unshift(startRow, 0); - lineWidgets.splice.apply(lineWidgets, args); - this.$updateRows(); + Autocomplete.prototype.$updateGhostText = function (completion) { + var row = this.base.row; + var column = this.base.column; + var cursorColumn = this.editor.getCursorPosition().column; + var prefix = this.editor.session.getLine(row).slice(column, cursorColumn); + if (!this.inlineRenderer.show(this.editor, completion, prefix)) { + this.inlineRenderer.hide(); + } + else { + this.$seen(completion); } }; - - this.$updateRows = function() { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) return; - var noWidgets = true; - lineWidgets.forEach(function(w, i) { - if (w) { - noWidgets = false; - w.row = i; - while (w.$oldWidget) { - w.$oldWidget.row = i; - w = w.$oldWidget; + Autocomplete.prototype.$onPopupRender = function () { + var inlineEnabled = this.inlineRenderer && this.inlineEnabled; + if (this.completions && this.completions.filtered && this.completions.filtered.length > 0) { + for (var i = this.popup.getFirstVisibleRow(); i <= this.popup.getLastVisibleRow(); i++) { + var completion = this.popup.getData(i); + if (completion && (!inlineEnabled || completion.hideInlinePreview)) { + this.$seen(completion); } } + } + }; + Autocomplete.prototype.$onPopupShow = function (hide) { + this.$onPopupChange(hide); + this.stickySelection = false; + if (this.stickySelectionDelay >= 0) + this.stickySelectionTimer.schedule(this.stickySelectionDelay); + }; + Autocomplete.prototype.observeLayoutChanges = function () { + if (this.$elements || !this.editor) + return; + window.addEventListener("resize", this.onLayoutChange, { passive: true }); + window.addEventListener("wheel", this.mousewheelListener); + var el = this.editor.container.parentNode; + var elements = []; + while (el) { + elements.push(el); + el.addEventListener("scroll", this.onLayoutChange, { passive: true }); + el = el.parentNode; + } + this.$elements = elements; + }; + Autocomplete.prototype.unObserveLayoutChanges = function () { + var _this = this; + window.removeEventListener("resize", this.onLayoutChange, { passive: true }); + window.removeEventListener("wheel", this.mousewheelListener); + this.$elements && this.$elements.forEach(function (el) { + el.removeEventListener("scroll", _this.onLayoutChange, { passive: true }); }); - if (noWidgets) - this.session.lineWidgets = null; + this.$elements = null; }; - - this.$registerLineWidget = function(w) { - if (!this.session.lineWidgets) - this.session.lineWidgets = new Array(this.session.getLength()); - - var old = this.session.lineWidgets[w.row]; - if (old) { - w.$oldWidget = old; - if (old.el && old.el.parentNode) { - old.el.parentNode.removeChild(old.el); - old._inDocument = false; + Autocomplete.prototype.onLayoutChange = function () { + if (!this.popup.isOpen) + return this.unObserveLayoutChanges(); + this.$updatePopupPosition(); + this.updateDocTooltip(); + }; + Autocomplete.prototype.$updatePopupPosition = function () { + var editor = this.editor; + var renderer = editor.renderer; + var lineHeight = renderer.layerConfig.lineHeight; + var pos = renderer.$cursorLayer.getPixelPosition(this.base, true); + pos.left -= this.popup.getTextLeftOffset(); + var rect = editor.container.getBoundingClientRect(); + pos.top += rect.top - renderer.layerConfig.offset; + pos.left += rect.left - editor.renderer.scrollLeft; + pos.left += renderer.gutterWidth; + var posGhostText = { + top: pos.top, + left: pos.left + }; + if (renderer.$ghostText && renderer.$ghostTextWidget) { + if (this.base.row === renderer.$ghostText.position.row) { + posGhostText.top += renderer.$ghostTextWidget.el.offsetHeight; } } - - this.session.lineWidgets[w.row] = w; - return w; - }; - - this.addLineWidget = function(w) { - this.$registerLineWidget(w); - w.session = this.session; - - if (!this.editor) return w; - - var renderer = this.editor.renderer; - if (w.html && !w.el) { - w.el = dom.createElement("div"); - w.el.innerHTML = w.html; + var editorContainerBottom = editor.container.getBoundingClientRect().bottom - lineHeight; + var lowestPosition = editorContainerBottom < posGhostText.top ? + { top: editorContainerBottom, left: posGhostText.left } : + posGhostText; + if (this.popup.tryShow(lowestPosition, lineHeight, "bottom")) { + return; } - if (w.el) { - dom.addCssClass(w.el, "ace_lineWidgetContainer"); - w.el.style.position = "absolute"; - w.el.style.zIndex = 5; - renderer.container.appendChild(w.el); - w._inDocument = true; - - if (!w.coverGutter) { - w.el.style.zIndex = 3; - } - if (w.pixelHeight == null) { - w.pixelHeight = w.el.offsetHeight; - } + if (this.popup.tryShow(pos, lineHeight, "top")) { + return; } - if (w.rowCount == null) { - w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; + this.popup.show(pos, lineHeight); + }; + Autocomplete.prototype.openPopup = function (editor, prefix, keepPopupPosition) { + this.$firstOpenTimer.cancel(); + if (!this.popup) + this.$init(); + if (this.inlineEnabled && !this.inlineRenderer) + this.$initInline(); + this.popup.autoSelect = this.autoSelect; + this.popup.setSelectOnHover(this.setSelectOnHover); + var oldRow = this.popup.getRow(); + var previousSelectedItem = this.popup.data[oldRow]; + this.popup.setData(this.completions.filtered, this.completions.filterText); + if (this.editor.textInput.setAriaOptions) { + this.editor.textInput.setAriaOptions({ + activeDescendant: getAriaId(this.popup.getRow()), + inline: this.inlineEnabled + }); } - - var fold = this.session.getFoldAt(w.row, 0); - w.$fold = fold; - if (fold) { - var lineWidgets = this.session.lineWidgets; - if (w.row == fold.end.row && !lineWidgets[fold.start.row]) - lineWidgets[fold.start.row] = w; - else - w.hidden = true; + editor.keyBinding.addKeyboardHandler(this.keyboardHandler); + var newRow; + if (this.stickySelection) + newRow = this.popup.data.indexOf(previousSelectedItem); + if (!newRow || newRow === -1) + newRow = 0; + this.popup.setRow(this.autoSelect ? newRow : -1); + if (newRow === oldRow && previousSelectedItem !== this.completions.filtered[newRow]) + this.$onPopupChange(); + var inlineEnabled = this.inlineRenderer && this.inlineEnabled; + if (newRow === oldRow && inlineEnabled) { + var completion = this.popup.getData(this.popup.getRow()); + this.$updateGhostText(completion); + } + if (!keepPopupPosition) { + this.popup.setTheme(editor.getTheme()); + this.popup.setFontSize(editor.getFontSize()); + this.$updatePopupPosition(); + if (this.tooltipNode) { + this.updateDocTooltip(); + } + } + this.changeTimer.cancel(); + this.observeLayoutChanges(); + }; + Autocomplete.prototype.detach = function () { + if (this.editor) { + this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); + this.editor.off("changeSelection", this.changeListener); + this.editor.off("blur", this.blurListener); + this.editor.off("mousedown", this.mousedownListener); + this.editor.off("mousewheel", this.mousewheelListener); + } + this.$firstOpenTimer.cancel(); + this.changeTimer.cancel(); + this.hideDocTooltip(); + if (this.completionProvider) { + this.completionProvider.detach(); + } + if (this.popup && this.popup.isOpen) + this.popup.hide(); + if (this.popup && this.popup.renderer) { + this.popup.renderer.off("afterRender", this.$onPopupRender); + } + if (this.base) + this.base.detach(); + this.activated = false; + this.completionProvider = this.completions = this.base = null; + this.unObserveLayoutChanges(); + }; + Autocomplete.prototype.changeListener = function (e) { + var cursor = this.editor.selection.lead; + if (cursor.row != this.base.row || cursor.column < this.base.column) { + this.detach(); } - - this.session._emit("changeFold", {data:{start:{row: w.row}}}); - - this.$updateRows(); - this.renderWidgets(null, renderer); - this.onWidgetChanged(w); - return w; + if (this.activated) + this.changeTimer.schedule(); + else + this.detach(); }; - - this.removeLineWidget = function(w) { - w._inDocument = false; - w.session = null; - if (w.el && w.el.parentNode) - w.el.parentNode.removeChild(w.el); - if (w.editor && w.editor.destroy) try { - w.editor.destroy(); - } catch(e){} - if (this.session.lineWidgets) { - var w1 = this.session.lineWidgets[w.row]; - if (w1 == w) { - this.session.lineWidgets[w.row] = w.$oldWidget; - if (w.$oldWidget) - this.onWidgetChanged(w.$oldWidget); - } else { - while (w1) { - if (w1.$oldWidget == w) { - w1.$oldWidget = w.$oldWidget; - break; + Autocomplete.prototype.blurListener = function (e) { + var el = document.activeElement; + var text = this.editor.textInput.getElement(); + var fromTooltip = e.relatedTarget && this.tooltipNode && this.tooltipNode.contains(e.relatedTarget); + var container = this.popup && this.popup.container; + if (el != text && el.parentNode != container && !fromTooltip + && el != this.tooltipNode && e.relatedTarget != text) { + this.detach(); + } + }; + Autocomplete.prototype.mousedownListener = function (e) { + this.detach(); + }; + Autocomplete.prototype.mousewheelListener = function (e) { + if (this.popup && !this.popup.isMouseOver) + this.detach(); + }; + Autocomplete.prototype.mouseOutListener = function (e) { + if (this.popup.isOpen) + this.$updatePopupPosition(); + }; + Autocomplete.prototype.goTo = function (where) { + this.popup.goTo(where); + }; + Autocomplete.prototype.insertMatch = function (data, options) { + if (!data) + data = this.popup.getData(this.popup.getRow()); + if (!data) + return false; + if (data.value === "") // Explicitly given nothing to insert, e.g. "No suggestion state" + return this.detach(); + var completions = this.completions; + var result = this.getCompletionProvider().insertMatch(this.editor, data, completions.filterText, options); + if (this.completions == completions) + this.detach(); + return result; + }; + Autocomplete.prototype.showPopup = function (editor, options) { + if (this.editor) + this.detach(); + this.activated = true; + this.editor = editor; + if (editor.completer != this) { + if (editor.completer) + editor.completer.detach(); + editor.completer = this; + } + editor.on("changeSelection", this.changeListener); + editor.on("blur", this.blurListener); + editor.on("mousedown", this.mousedownListener); + editor.on("mousewheel", this.mousewheelListener); + this.updateCompletions(false, options); + }; + Autocomplete.prototype.getCompletionProvider = function (initialPosition) { + if (!this.completionProvider) + this.completionProvider = new CompletionProvider(initialPosition); + return this.completionProvider; + }; + Autocomplete.prototype.gatherCompletions = function (editor, callback) { + return this.getCompletionProvider().gatherCompletions(editor, callback); + }; + Autocomplete.prototype.updateCompletions = function (keepPopupPosition, options) { + if (keepPopupPosition && this.base && this.completions) { + var pos = this.editor.getCursorPosition(); + var prefix = this.editor.session.getTextRange({ start: this.base, end: pos }); + if (prefix == this.completions.filterText) + return; + this.completions.setFilter(prefix); + if (!this.completions.filtered.length) + return this.detach(); + if (this.completions.filtered.length == 1 + && this.completions.filtered[0].value == prefix + && !this.completions.filtered[0].snippet) + return this.detach(); + this.openPopup(this.editor, prefix, keepPopupPosition); + return; + } + if (options && options.matches) { + var pos = this.editor.getSelectionRange().start; + this.base = this.editor.session.doc.createAnchor(pos.row, pos.column); + this.base.$insertRight = true; + this.completions = new FilteredList(options.matches); + this.getCompletionProvider().completions = this.completions; + return this.openPopup(this.editor, "", keepPopupPosition); + } + var session = this.editor.getSession(); + var pos = this.editor.getCursorPosition(); + var prefix = util.getCompletionPrefix(this.editor); + this.base = session.doc.createAnchor(pos.row, pos.column - prefix.length); + this.base.$insertRight = true; + var completionOptions = { + exactMatch: this.exactMatch, + ignoreCaption: this.ignoreCaption + }; + this.getCompletionProvider({ + prefix: prefix, + pos: pos + }).provideCompletions(this.editor, completionOptions, + function (err, completions, finished) { + var filtered = completions.filtered; + var prefix = util.getCompletionPrefix(this.editor); + this.$firstOpenTimer.cancel(); + if (finished) { + if (!filtered.length) { + var emptyMessage = !this.autoShown && this.emptyMessage; + if (typeof emptyMessage == "function") + emptyMessage = this.emptyMessage(prefix); + if (emptyMessage) { + var completionsForEmpty = [{ + caption: emptyMessage, + value: "" + } + ]; + this.completions = new FilteredList(completionsForEmpty); + this.openPopup(this.editor, prefix, keepPopupPosition); + this.popup.renderer.setStyle("ace_loading", false); + this.popup.renderer.setStyle("ace_empty-message", true); + return; } - w1 = w1.$oldWidget; + return this.detach(); } + if (filtered.length == 1 && filtered[0].value == prefix + && !filtered[0].snippet) + return this.detach(); + if (this.autoInsert && !this.autoShown && filtered.length == 1) + return this.insertMatch(filtered[0]); + } + this.completions = !finished && this.showLoadingState ? + new FilteredList(Autocomplete.completionsForLoading.concat(filtered), completions.filterText) : + completions; + this.openPopup(this.editor, prefix, keepPopupPosition); + this.popup.renderer.setStyle("ace_empty-message", false); + this.popup.renderer.setStyle("ace_loading", !finished); + }.bind(this)); + if (this.showLoadingState && !this.autoShown && !(this.popup && this.popup.isOpen)) { + this.$firstOpenTimer.delay(this.stickySelectionDelay / 2); + } + }; + Autocomplete.prototype.cancelContextMenu = function () { + this.editor.$mouseHandler.cancelContextMenu(); + }; + Autocomplete.prototype.updateDocTooltip = function () { + var popup = this.popup; + var all = this.completions.filtered; + var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]); + var doc = null; + if (!selected || !this.editor || !this.popup.isOpen) + return this.hideDocTooltip(); + var completersLength = this.editor.completers.length; + for (var i = 0; i < completersLength; i++) { + var completer = this.editor.completers[i]; + if (completer.getDocTooltip && selected.completerId === completer.id) { + doc = completer.getDocTooltip(selected); + break; } } - this.session._emit("changeFold", {data:{start:{row: w.row}}}); - this.$updateRows(); + if (!doc && typeof selected != "string") + doc = selected; + if (typeof doc == "string") + doc = { docText: doc }; + if (!doc || !(doc.docHTML || doc.docText)) + return this.hideDocTooltip(); + this.showDocTooltip(doc); + }; + Autocomplete.prototype.showDocTooltip = function (item) { + if (!this.tooltipNode) { + this.tooltipNode = dom.createElement("div"); + this.tooltipNode.style.margin = "0"; + this.tooltipNode.style.pointerEvents = "auto"; + this.tooltipNode.style.overscrollBehavior = "contain"; + this.tooltipNode.tabIndex = -1; + this.tooltipNode.onblur = this.blurListener.bind(this); + this.tooltipNode.onclick = this.onTooltipClick.bind(this); + this.tooltipNode.id = "doc-tooltip"; + this.tooltipNode.setAttribute("role", "tooltip"); + this.tooltipNode.addEventListener("wheel", preventParentScroll); + } + var theme = this.editor.renderer.theme; + this.tooltipNode.className = "ace_tooltip ace_doc-tooltip " + + (theme.isDark ? "ace_dark " : "") + (theme.cssClass || ""); + var tooltipNode = this.tooltipNode; + if (item.docHTML) { + tooltipNode.innerHTML = item.docHTML; + } + else if (item.docText) { + tooltipNode.textContent = item.docText; + } + if (!tooltipNode.parentNode) + this.popup.container.appendChild(this.tooltipNode); + var popup = this.popup; + var rect = popup.container.getBoundingClientRect(); + tooltipNode.style.top = popup.container.style.top; + tooltipNode.style.bottom = popup.container.style.bottom; + tooltipNode.style.display = "block"; + if (window.innerWidth - rect.right < 320) { + if (rect.left < 320) { + if (popup.isTopdown) { + tooltipNode.style.top = rect.bottom + "px"; + tooltipNode.style.left = rect.left + "px"; + tooltipNode.style.right = ""; + tooltipNode.style.bottom = ""; + } + else { + tooltipNode.style.top = popup.container.offsetTop - tooltipNode.offsetHeight + "px"; + tooltipNode.style.left = rect.left + "px"; + tooltipNode.style.right = ""; + tooltipNode.style.bottom = ""; + } + } + else { + tooltipNode.style.right = window.innerWidth - rect.left + "px"; + tooltipNode.style.left = ""; + } + } + else { + tooltipNode.style.left = (rect.right + 1) + "px"; + tooltipNode.style.right = ""; + } }; - - this.getWidgetsAtRow = function(row) { - var lineWidgets = this.session.lineWidgets; - var w = lineWidgets && lineWidgets[row]; - var list = []; - while (w) { - list.push(w); - w = w.$oldWidget; + Autocomplete.prototype.hideDocTooltip = function () { + this.tooltipTimer.cancel(); + if (!this.tooltipNode) + return; + var el = this.tooltipNode; + if (!this.editor.isFocused() && document.activeElement == el) + this.editor.focus(); + this.tooltipNode = null; + if (el.parentNode) + el.parentNode.removeChild(el); + }; + Autocomplete.prototype.onTooltipClick = function (e) { + var a = e.target; + while (a && a != this.tooltipNode) { + if (a.nodeName == "A" && a.href) { + a.rel = "noreferrer"; + a.target = "_blank"; + break; + } + a = a.parentNode; } - return list; }; - - this.onWidgetChanged = function(w) { - this.session._changedWidgets.push(w); - this.editor && this.editor.renderer.updateFull(); + Autocomplete.prototype.destroy = function () { + this.detach(); + if (this.popup) { + this.popup.destroy(); + var el = this.popup.container; + if (el && el.parentNode) + el.parentNode.removeChild(el); + } + if (this.editor && this.editor.completer == this) { + this.editor.off("destroy", destroyCompleter); + this.editor.completer = null; + } + this.inlineRenderer = this.popup = this.editor = null; }; - - this.measureWidgets = function(e, renderer) { - var changedWidgets = this.session._changedWidgets; - var config = renderer.layerConfig; - - if (!changedWidgets || !changedWidgets.length) return; - var min = Infinity; - for (var i = 0; i < changedWidgets.length; i++) { - var w = changedWidgets[i]; - if (!w || !w.el) continue; - if (w.session != this.session) continue; - if (!w._inDocument) { - if (this.session.lineWidgets[w.row] != w) - continue; - w._inDocument = true; - renderer.container.appendChild(w.el); + Autocomplete.for = function (editor) { + if (editor.completer instanceof Autocomplete) { + return editor.completer; + } + if (editor.completer) { + editor.completer.destroy(); + editor.completer = null; + } + if (config.get("sharedPopups")) { + if (!Autocomplete["$sharedInstance"]) + Autocomplete["$sharedInstance"] = new Autocomplete(); + editor.completer = Autocomplete["$sharedInstance"]; + } + else { + editor.completer = new Autocomplete(); + editor.once("destroy", destroyCompleter); + } + return editor.completer; + }; + return Autocomplete; +}()); +Autocomplete.prototype.commands = { + "Up": function (editor) { editor.completer.goTo("up"); }, + "Down": function (editor) { editor.completer.goTo("down"); }, + "Ctrl-Up|Ctrl-Home": function (editor) { editor.completer.goTo("start"); }, + "Ctrl-Down|Ctrl-End": function (editor) { editor.completer.goTo("end"); }, + "Esc": function (editor) { editor.completer.detach(); }, + "Return": function (editor) { return editor.completer.insertMatch(); }, + "Shift-Return": function (editor) { editor.completer.insertMatch(null, { deleteSuffix: true }); }, + "Tab": function (editor) { + var result = editor.completer.insertMatch(); + if (!result && !editor.tabstopManager) + editor.completer.goTo("down"); + else + return result; + }, + "Backspace": function (editor) { + editor.execCommand("backspace"); + var prefix = util.getCompletionPrefix(editor); + if (!prefix && editor.completer) + editor.completer.detach(); + }, + "PageUp": function (editor) { editor.completer.popup.gotoPageUp(); }, + "PageDown": function (editor) { editor.completer.popup.gotoPageDown(); } +}; +Autocomplete.startCommand = { + name: "startAutocomplete", + exec: function (editor, options) { + var completer = Autocomplete.for(editor); + completer.autoInsert = false; + completer.autoSelect = true; + completer.autoShown = false; + completer.showPopup(editor, options); + completer.cancelContextMenu(); + }, + bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" +}; +var CompletionProvider = /** @class */ (function () { + function CompletionProvider(initialPosition) { + this.initialPosition = initialPosition; + this.active = true; + } + CompletionProvider.prototype.insertByIndex = function (editor, index, options) { + if (!this.completions || !this.completions.filtered) { + return false; + } + return this.insertMatch(editor, this.completions.filtered[index], options); + }; + CompletionProvider.prototype.insertMatch = function (editor, data, options) { + if (!data) + return false; + editor.startOperation({ command: { name: "insertMatch" } }); + if (data.completer && data.completer.insertMatch) { + data.completer.insertMatch(editor, data); + } + else { + if (!this.completions) + return false; + var replaceBefore = this.completions.filterText.length; + var replaceAfter = 0; + if (data.range && data.range.start.row === data.range.end.row) { + replaceBefore -= this.initialPosition.prefix.length; + replaceBefore += this.initialPosition.pos.column - data.range.start.column; + replaceAfter += data.range.end.column - this.initialPosition.pos.column; + } + if (replaceBefore || replaceAfter) { + var ranges; + if (editor.selection.getAllRanges) { + ranges = editor.selection.getAllRanges(); + } + else { + ranges = [editor.getSelectionRange()]; + } + for (var i = 0, range; range = ranges[i]; i++) { + range.start.column -= replaceBefore; + range.end.column += replaceAfter; + editor.session.remove(range); + } } - - w.h = w.el.offsetHeight; - - if (!w.fixedWidth) { - w.w = w.el.offsetWidth; - w.screenWidth = Math.ceil(w.w / config.characterWidth); + if (data.snippet) { + snippetManager.insertSnippet(editor, data.snippet); } - - var rowCount = w.h / config.lineHeight; - if (w.coverLine) { - rowCount -= this.session.getRowLineCount(w.row); - if (rowCount < 0) - rowCount = 0; + else { + this.$insertString(editor, data); } - if (w.rowCount != rowCount) { - w.rowCount = rowCount; - if (w.row < min) - min = w.row; + if (data.completer && data.completer.onInsert && typeof data.completer.onInsert == "function") { + data.completer.onInsert(editor, data); + } + if (data.command && data.command === "startAutocomplete") { + editor.execCommand(data.command); } } - if (min != Infinity) { - this.session._emit("changeFold", {data:{start:{row: min}}}); - this.session.lineWidgetWidth = null; - } - this.session._changedWidgets = []; + editor.endOperation(); + return true; }; - - this.renderWidgets = function(e, renderer) { - var config = renderer.layerConfig; - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) - return; - var first = Math.min(this.firstRow, config.firstRow); - var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); - - while (first > 0 && !lineWidgets[first]) - first--; - - this.firstRow = config.firstRow; - this.lastRow = config.lastRow; - - renderer.$cursorLayer.config = config; - for (var i = first; i <= last; i++) { - var w = lineWidgets[i]; - if (!w || !w.el) continue; - if (w.hidden) { - w.el.style.top = -100 - (w.pixelHeight || 0) + "px"; - continue; + CompletionProvider.prototype.$insertString = function (editor, data) { + var text = data.value || data; + editor.execCommand("insertstring", text); + }; + CompletionProvider.prototype.gatherCompletions = function (editor, callback) { + var session = editor.getSession(); + var pos = editor.getCursorPosition(); + var prefix = util.getCompletionPrefix(editor); + var matches = []; + this.completers = editor.completers; + var total = editor.completers.length; + editor.completers.forEach(function (completer, i) { + completer.getCompletions(editor, session, pos, prefix, function (err, results) { + if (completer.hideInlinePreview) + results = results.map(function (result) { + return Object.assign(result, { hideInlinePreview: completer.hideInlinePreview }); + }); + if (!err && results) + matches = matches.concat(results); + callback(null, { + prefix: util.getCompletionPrefix(editor), + matches: matches, + finished: (--total === 0) + }); + }); + }); + return true; + }; + CompletionProvider.prototype.provideCompletions = function (editor, options, callback) { + var processResults = function (results) { + var prefix = results.prefix; + var matches = results.matches; + this.completions = new FilteredList(matches); + if (options.exactMatch) + this.completions.exactMatch = true; + if (options.ignoreCaption) + this.completions.ignoreCaption = true; + this.completions.setFilter(prefix); + if (results.finished || this.completions.filtered.length) + callback(null, this.completions, results.finished); + }.bind(this); + var isImmediate = true; + var immediateResults = null; + this.gatherCompletions(editor, function (err, results) { + if (!this.active) { + return; } - if (!w._inDocument) { - w._inDocument = true; - renderer.container.appendChild(w.el); + if (err) { + callback(err, [], true); + this.detach(); } - var top = renderer.$cursorLayer.getPixelPosition({row: i, column:0}, true).top; - if (!w.coverLine) - top += config.lineHeight * this.session.getRowLineCount(w.row); - w.el.style.top = top - config.offset + "px"; - - var left = w.coverGutter ? 0 : renderer.gutterWidth; - if (!w.fixedWidth) - left -= renderer.scrollLeft; - w.el.style.left = left + "px"; - - if (w.fullWidth && w.screenWidth) { - w.el.style.minWidth = config.width + 2 * config.padding + "px"; + var prefix = results.prefix; + if (prefix.indexOf(results.prefix) !== 0) + return; + if (isImmediate) { + immediateResults = results; + return; } - - if (w.fixedWidth) { - w.el.style.right = renderer.scrollBar.getWidth() + "px"; - } else { - w.el.style.right = ""; + processResults(results); + }.bind(this)); + isImmediate = false; + if (immediateResults) { + var results = immediateResults; + immediateResults = null; + processResults(results); + } + }; + CompletionProvider.prototype.detach = function () { + this.active = false; + this.completers && this.completers.forEach(function (completer) { + if (typeof completer.cancel === "function") { + completer.cancel(); + } + }); + }; + return CompletionProvider; +}()); +var FilteredList = /** @class */ (function () { + function FilteredList(array, filterText) { + this.all = array; + this.filtered = array; + this.filterText = filterText || ""; + this.exactMatch = false; + this.ignoreCaption = false; + } + FilteredList.prototype.setFilter = function (str) { + if (str.length > this.filterText && str.lastIndexOf(this.filterText, 0) === 0) + var matches = this.filtered; + else + var matches = this.all; + this.filterText = str; + matches = this.filterCompletions(matches, this.filterText); + matches = matches.sort(function (a, b) { + return b.exactMatch - a.exactMatch || b.$score - a.$score + || (a.caption || a.value).localeCompare(b.caption || b.value); + }); + var prev = null; + matches = matches.filter(function (item) { + var caption = item.snippet || item.caption || item.value; + if (caption === prev) + return false; + prev = caption; + return true; + }); + this.filtered = matches; + }; + FilteredList.prototype.filterCompletions = function (items, needle) { + var results = []; + var upper = needle.toUpperCase(); + var lower = needle.toLowerCase(); + loop: for (var i = 0, item; item = items[i]; i++) { + var caption = (!this.ignoreCaption && item.caption) || item.value || item.snippet; + if (!caption) + continue; + var lastIndex = -1; + var matchMask = 0; + var penalty = 0; + var index, distance; + if (this.exactMatch) { + if (needle !== caption.substr(0, needle.length)) + continue loop; + } + else { + var fullMatchIndex = caption.toLowerCase().indexOf(lower); + if (fullMatchIndex > -1) { + penalty = fullMatchIndex; + } + else { + for (var j = 0; j < needle.length; j++) { + var i1 = caption.indexOf(lower[j], lastIndex + 1); + var i2 = caption.indexOf(upper[j], lastIndex + 1); + index = (i1 >= 0) ? ((i2 < 0 || i1 < i2) ? i1 : i2) : i2; + if (index < 0) + continue loop; + distance = index - lastIndex - 1; + if (distance > 0) { + if (lastIndex === -1) + penalty += 10; + penalty += distance; + matchMask = matchMask | (1 << j); + } + lastIndex = index; + } + } } + item.matchMask = matchMask; + item.exactMatch = penalty ? 0 : 1; + item.$score = (item.score || 0) - penalty; + results.push(item); } + return results; }; - -}).call(LineWidgets.prototype); - - -exports.LineWidgets = LineWidgets; + return FilteredList; +}()); +exports.Autocomplete = Autocomplete; +exports.CompletionProvider = CompletionProvider; +exports.FilteredList = FilteredList; }); -ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"], function(require, exports, module) { -"use strict"; -var LineWidgets = require("../line_widgets").LineWidgets; -var dom = require("../lib/dom"); -var Range = require("../range").Range; - -function binarySearch(array, needle, comparator) { - var first = 0; - var last = array.length - 1; - - while (first <= last) { - var mid = (first + last) >> 1; - var c = comparator(needle, array[mid]); - if (c > 0) - first = mid + 1; - else if (c < 0) - last = mid - 1; - else - return mid; - } - return -(first + 1); +ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"], function(require, exports, module){var Range = require("../range").Range; +var splitRegex = /[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/; +function getWordIndex(doc, pos) { + var textBefore = doc.getTextRange(Range.fromPoints({ + row: 0, + column: 0 + }, pos)); + return textBefore.split(splitRegex).length - 1; +} +function wordDistance(doc, pos) { + var prefixPos = getWordIndex(doc, pos); + var words = doc.getValue().split(splitRegex); + var wordScores = Object.create(null); + var currentWord = words[prefixPos]; + words.forEach(function (word, idx) { + if (!word || word === currentWord) + return; + var distance = Math.abs(prefixPos - idx); + var score = words.length - distance; + if (wordScores[word]) { + wordScores[word] = Math.max(score, wordScores[word]); + } + else { + wordScores[word] = score; + } + }); + return wordScores; } +exports.getCompletions = function (editor, session, pos, prefix, callback) { + var wordScore = wordDistance(session, pos); + var wordList = Object.keys(wordScore); + callback(null, wordList.map(function (word) { + return { + caption: word, + value: word, + score: wordScore[word], + meta: "local" + }; + })); +}; -function findAnnotations(session, row, dir) { - var annotations = session.getAnnotations().sort(Range.comparePoints); - if (!annotations.length) - return; - - var i = binarySearch(annotations, {row: row, column: -1}, Range.comparePoints); - if (i < 0) - i = -i - 1; - - if (i >= annotations.length) - i = dir > 0 ? 0 : annotations.length - 1; - else if (i === 0 && dir < 0) - i = annotations.length - 1; +}); - var annotation = annotations[i]; - if (!annotation || !dir) +ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"], function(require, exports, module){"use strict"; +var snippetManager = require("../snippets").snippetManager; +var Autocomplete = require("../autocomplete").Autocomplete; +var config = require("../config"); +var lang = require("../lib/lang"); +var util = require("../autocomplete/util"); +var textCompleter = require("../autocomplete/text_completer"); +var keyWordCompleter = { + getCompletions: function (editor, session, pos, prefix, callback) { + if (session.$mode.completer) { + return session.$mode.completer.getCompletions(editor, session, pos, prefix, callback); + } + var state = editor.session.getState(pos.row); + var completions = session.$mode.getCompletions(state, session, pos, prefix); + completions = completions.map(function (el) { + el.completerId = keyWordCompleter.id; + return el; + }); + callback(null, completions); + }, + id: "keywordCompleter" +}; +var transformSnippetTooltip = function (str) { + var record = {}; + return str.replace(/\${(\d+)(:(.*?))?}/g, function (_, p1, p2, p3) { + return (record[p1] = p3 || ''); + }).replace(/\$(\d+?)/g, function (_, p1) { + return record[p1]; + }); +}; +var snippetCompleter = { + getCompletions: function (editor, session, pos, prefix, callback) { + var scopes = []; + var token = session.getTokenAt(pos.row, pos.column); + if (token && token.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)) + scopes.push('html-tag'); + else + scopes = snippetManager.getActiveScopes(editor); + var snippetMap = snippetManager.snippetMap; + var completions = []; + scopes.forEach(function (scope) { + var snippets = snippetMap[scope] || []; + for (var i = snippets.length; i--;) { + var s = snippets[i]; + var caption = s.name || s.tabTrigger; + if (!caption) + continue; + completions.push({ + caption: caption, + snippet: s.content, + meta: s.tabTrigger && !s.name ? s.tabTrigger + "\u21E5 " : "snippet", + completerId: snippetCompleter.id + }); + } + }, this); + callback(null, completions); + }, + getDocTooltip: function (item) { + if (item.snippet && !item.docHTML) { + item.docHTML = [ + "", lang.escapeHTML(item.caption), "", "
", + lang.escapeHTML(transformSnippetTooltip(item.snippet)) + ].join(""); + } + }, + id: "snippetCompleter" +}; +var completers = [snippetCompleter, textCompleter, keyWordCompleter]; +exports.setCompleters = function (val) { + completers.length = 0; + if (val) + completers.push.apply(completers, val); +}; +exports.addCompleter = function (completer) { + completers.push(completer); +}; +exports.textCompleter = textCompleter; +exports.keyWordCompleter = keyWordCompleter; +exports.snippetCompleter = snippetCompleter; +var expandSnippet = { + name: "expandSnippet", + exec: function (editor) { + return snippetManager.expandWithTab(editor); + }, + bindKey: "Tab" +}; +var onChangeMode = function (e, editor) { + loadSnippetsForMode(editor.session.$mode); +}; +var loadSnippetsForMode = function (mode) { + if (typeof mode == "string") + mode = config.$modes[mode]; + if (!mode) return; - - if (annotation.row === row) { - do { - annotation = annotations[i += dir]; - } while (annotation && annotation.row === row); - if (!annotation) - return annotations.slice(); - } - - - var matched = []; - row = annotation.row; - do { - matched[dir < 0 ? "unshift" : "push"](annotation); - annotation = annotations[i += dir]; - } while (annotation && annotation.row == row); - return matched.length && matched; -} - -exports.showErrorMarker = function(editor, dir) { - var session = editor.session; - if (!session.widgetManager) { - session.widgetManager = new LineWidgets(session); - session.widgetManager.attach(editor); - } - - var pos = editor.getCursorPosition(); - var row = pos.row; - var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function(w) { - return w.type == "errorMarker"; - })[0]; - if (oldWidget) { - oldWidget.destroy(); - } else { - row -= dir; - } - var annotations = findAnnotations(session, row, dir); - var gutterAnno; - if (annotations) { - var annotation = annotations[0]; - pos.column = (annotation.pos && typeof annotation.column != "number" - ? annotation.pos.sc - : annotation.column) || 0; - pos.row = annotation.row; - gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row]; - } else if (oldWidget) { + if (!snippetManager.files) + snippetManager.files = {}; + loadSnippetFile(mode.$id, mode.snippetFileId); + if (mode.modes) + mode.modes.forEach(loadSnippetsForMode); +}; +var loadSnippetFile = function (id, snippetFilePath) { + if (!snippetFilePath || !id || snippetManager.files[id]) return; - } else { - gutterAnno = { - text: ["Looks good!"], - className: "ace_ok" - }; + snippetManager.files[id] = {}; + config.loadModule(snippetFilePath, function (m) { + if (!m) + return; + snippetManager.files[id] = m; + if (!m.snippets && m.snippetText) + m.snippets = snippetManager.parseSnippetFile(m.snippetText); + snippetManager.register(m.snippets || [], m.scope); + if (m.includeScopes) { + snippetManager.snippetMap[m.scope].includeScopes = m.includeScopes; + m.includeScopes.forEach(function (x) { + loadSnippetsForMode("ace/mode/" + x); + }); + } + }); +}; +var doLiveAutocomplete = function (e) { + var editor = e.editor; + var hasCompleter = editor.completer && editor.completer.activated; + if (e.command.name === "backspace") { + if (hasCompleter && !util.getCompletionPrefix(editor)) + editor.completer.detach(); } - editor.session.unfold(pos.row); - editor.selection.moveToPosition(pos); - - var w = { - row: pos.row, - fixedWidth: true, - coverGutter: true, - el: dom.createElement("div"), - type: "errorMarker" - }; - var el = w.el.appendChild(dom.createElement("div")); - var arrow = w.el.appendChild(dom.createElement("div")); - arrow.className = "error_widget_arrow " + gutterAnno.className; - - var left = editor.renderer.$cursorLayer - .getPixelPosition(pos).left; - arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px"; - - w.el.className = "error_widget_wrapper"; - el.className = "error_widget " + gutterAnno.className; - el.innerHTML = gutterAnno.text.join("
"); - - el.appendChild(dom.createElement("div")); - - var kb = function(_, hashId, keyString) { - if (hashId === 0 && (keyString === "esc" || keyString === "return")) { - w.destroy(); - return {command: "null"}; + else if (e.command.name === "insertstring" && !hasCompleter) { + lastExecEvent = e; + var delay = e.editor.$liveAutocompletionDelay; + if (delay) { + liveAutocompleteTimer.delay(delay); + } + else { + showLiveAutocomplete(e); } - }; - - w.destroy = function() { - if (editor.$mouseHandler.isMousePressed) - return; - editor.keyBinding.removeKeyboardHandler(kb); - session.widgetManager.removeLineWidget(w); - editor.off("changeSelection", w.destroy); - editor.off("changeSession", w.destroy); - editor.off("mouseup", w.destroy); - editor.off("change", w.destroy); - }; - - editor.keyBinding.addKeyboardHandler(kb); - editor.on("changeSelection", w.destroy); - editor.on("changeSession", w.destroy); - editor.on("mouseup", w.destroy); - editor.on("change", w.destroy); - - editor.session.widgetManager.addLineWidget(w); - - w.el.onmousedown = editor.focus.bind(editor); - - editor.renderer.scrollCursorIntoView(null, 0.5, {bottom: w.el.offsetHeight}); -}; - - -dom.importCssString("\ - .error_widget_wrapper {\ - background: inherit;\ - color: inherit;\ - border:none\ - }\ - .error_widget {\ - border-top: solid 2px;\ - border-bottom: solid 2px;\ - margin: 5px 0;\ - padding: 10px 40px;\ - white-space: pre-wrap;\ - }\ - .error_widget.ace_error, .error_widget_arrow.ace_error{\ - border-color: #ff5a5a\ - }\ - .error_widget.ace_warning, .error_widget_arrow.ace_warning{\ - border-color: #F1D817\ - }\ - .error_widget.ace_info, .error_widget_arrow.ace_info{\ - border-color: #5a5a5a\ - }\ - .error_widget.ace_ok, .error_widget_arrow.ace_ok{\ - border-color: #5aaa5a\ - }\ - .error_widget_arrow {\ - position: absolute;\ - border: solid 5px;\ - border-top-color: transparent!important;\ - border-right-color: transparent!important;\ - border-left-color: transparent!important;\ - top: -5px;\ - }\ -", ""); - -}); - -ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"], function(require, exports, module) { -"use strict"; - -require("./lib/fixoldbrowsers"); - -var dom = require("./lib/dom"); -var event = require("./lib/event"); - -var Range = require("./range").Range; -var Editor = require("./editor").Editor; -var EditSession = require("./edit_session").EditSession; -var UndoManager = require("./undomanager").UndoManager; -var Renderer = require("./virtual_renderer").VirtualRenderer; -require("./worker/worker_client"); -require("./keyboard/hash_handler"); -require("./placeholder"); -require("./multi_select"); -require("./mode/folding/fold_mode"); -require("./theme/textmate"); -require("./ext/error_marker"); - -exports.config = require("./config"); -exports.require = require; - -if (true) - exports.define = __webpack_require__.amdD; -exports.edit = function(el, options) { - if (typeof el == "string") { - var _id = el; - el = document.getElementById(_id); - if (!el) - throw new Error("ace.edit can't find div #" + _id); } - - if (el && el.env && el.env.editor instanceof Editor) - return el.env.editor; - - var value = ""; - if (el && /input|textarea/i.test(el.tagName)) { - var oldNode = el; - value = oldNode.value; - el = dom.createElement("pre"); - oldNode.parentNode.replaceChild(el, oldNode); - } else if (el) { - value = el.textContent; - el.innerHTML = ""; +}; +var lastExecEvent; +var liveAutocompleteTimer = lang.delayedCall(function () { + showLiveAutocomplete(lastExecEvent); +}, 0); +var showLiveAutocomplete = function (e) { + var editor = e.editor; + var prefix = util.getCompletionPrefix(editor); + var previousChar = e.args; + var triggerAutocomplete = util.triggerAutocomplete(editor, previousChar); + if (prefix && prefix.length >= editor.$liveAutocompletionThreshold || triggerAutocomplete) { + var completer = Autocomplete.for(editor); + completer.autoShown = true; + completer.showPopup(editor); + } +}; +var Editor = require("../editor").Editor; +require("../config").defineOptions(Editor.prototype, "editor", { + enableBasicAutocompletion: { + set: function (val) { + if (val) { + if (!this.completers) + this.completers = Array.isArray(val) ? val : completers; + this.commands.addCommand(Autocomplete.startCommand); + } + else { + this.commands.removeCommand(Autocomplete.startCommand); + } + }, + value: false + }, + enableLiveAutocompletion: { + set: function (val) { + if (val) { + if (!this.completers) + this.completers = Array.isArray(val) ? val : completers; + this.commands.on('afterExec', doLiveAutocomplete); + } + else { + this.commands.off('afterExec', doLiveAutocomplete); + } + }, + value: false + }, + liveAutocompletionDelay: { + initialValue: 0 + }, + liveAutocompletionThreshold: { + initialValue: 0 + }, + enableSnippets: { + set: function (val) { + if (val) { + this.commands.addCommand(expandSnippet); + this.on("changeMode", onChangeMode); + onChangeMode(null, this); + } + else { + this.commands.removeCommand(expandSnippet); + this.off("changeMode", onChangeMode); + } + }, + value: false } +}); - var doc = exports.createEditSession(value); - - var editor = new Editor(new Renderer(el), doc, options); - - var env = { - document: doc, - editor: editor, - onResize: editor.resize.bind(editor, null) - }; - if (oldNode) env.textarea = oldNode; - event.addListener(window, "resize", env.onResize); - editor.on("destroy", function() { - event.removeListener(window, "resize", env.onResize); - env.editor.container.env = null; // prevent memory leak on old ie - }); - editor.container.env = editor.env = env; - return editor; -}; -exports.createEditSession = function(text, mode) { - var doc = new EditSession(text, mode); - doc.setUndoManager(new UndoManager()); - return doc; -}; -exports.Range = Range; -exports.Editor = Editor; -exports.EditSession = EditSession; -exports.UndoManager = UndoManager; -exports.VirtualRenderer = Renderer; -exports.version = exports.config.version; -}); (function() { - ace.require(["ace/ace"], function(a) { - if (a) { - a.config.init(true); - a.define = ace.define; - } - if (!window.ace) - window.ace = a; - for (var key in a) if (a.hasOwnProperty(key)) - window.ace[key] = a[key]; - window.ace["default"] = window.ace; - if ( true && module) { - module.exports = window.ace; - } - }); - })(); +}); (function() { + ace.require(["ace/ext/language_tools"], function(m) { + if ( true && module) { + module.exports = m; + } + }); + })(); /***/ }), -/***/ 3330: +/***/ 6534: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); -ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) { -"use strict"; +ace.define("ace/ext/searchbox-css",["require","exports","module"], function(require, exports, module){module.exports = "\n\n/* ------------------------------------------------------------------------------------------\n * Editor Search Form\n * --------------------------------------------------------------------------------------- */\n.ace_search {\n background-color: #ddd;\n color: #666;\n border: 1px solid #cbcbcb;\n border-top: 0 none;\n overflow: hidden;\n margin: 0;\n padding: 4px 6px 0 4px;\n position: absolute;\n top: 0;\n z-index: 99;\n white-space: normal;\n}\n.ace_search.left {\n border-left: 0 none;\n border-radius: 0px 0px 5px 0px;\n left: 0;\n}\n.ace_search.right {\n border-radius: 0px 0px 0px 5px;\n border-right: 0 none;\n right: 0;\n}\n\n.ace_search_form, .ace_replace_form {\n margin: 0 20px 4px 0;\n overflow: hidden;\n line-height: 1.9;\n}\n.ace_replace_form {\n margin-right: 0;\n}\n.ace_search_form.ace_nomatch {\n outline: 1px solid red;\n}\n\n.ace_search_field {\n border-radius: 3px 0 0 3px;\n background-color: white;\n color: black;\n border: 1px solid #cbcbcb;\n border-right: 0 none;\n outline: 0;\n padding: 0;\n font-size: inherit;\n margin: 0;\n line-height: inherit;\n padding: 0 6px;\n min-width: 17em;\n vertical-align: top;\n min-height: 1.8em;\n box-sizing: content-box;\n}\n.ace_searchbtn {\n border: 1px solid #cbcbcb;\n line-height: inherit;\n display: inline-block;\n padding: 0 6px;\n background: #fff;\n border-right: 0 none;\n border-left: 1px solid #dcdcdc;\n cursor: pointer;\n margin: 0;\n position: relative;\n color: #666;\n}\n.ace_searchbtn:last-child {\n border-radius: 0 3px 3px 0;\n border-right: 1px solid #cbcbcb;\n}\n.ace_searchbtn:disabled {\n background: none;\n cursor: default;\n}\n.ace_searchbtn:hover {\n background-color: #eef1f6;\n}\n.ace_searchbtn.prev, .ace_searchbtn.next {\n padding: 0px 0.7em\n}\n.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\n content: \"\";\n border: solid 2px #888;\n width: 0.5em;\n height: 0.5em;\n border-width: 2px 0 0 2px;\n display:inline-block;\n transform: rotate(-45deg);\n}\n.ace_searchbtn.next:after {\n border-width: 0 2px 2px 0 ;\n}\n.ace_searchbtn_close {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\n border-radius: 50%;\n border: 0 none;\n color: #656565;\n cursor: pointer;\n font: 16px/16px Arial;\n padding: 0;\n height: 14px;\n width: 14px;\n top: 9px;\n right: 7px;\n position: absolute;\n}\n.ace_searchbtn_close:hover {\n background-color: #656565;\n background-position: 50% 100%;\n color: white;\n}\n\n.ace_button {\n margin-left: 2px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n opacity: 0.7;\n border: 1px solid rgba(100,100,100,0.23);\n padding: 1px;\n box-sizing: border-box!important;\n color: black;\n}\n\n.ace_button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_button:active {\n background-color: #ddd;\n}\n\n.ace_button.checked {\n border-color: #3399ff;\n opacity:1;\n}\n\n.ace_search_options{\n margin-bottom: 3px;\n text-align: right;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n clear: both;\n}\n\n.ace_search_counter {\n float: left;\n font-family: arial;\n padding: 0 8px;\n}"; + +}); +ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/ext/searchbox-css","ace/keyboard/hash_handler","ace/lib/keys","ace/config"], function(require, exports, module){"use strict"; var dom = require("../lib/dom"); var lang = require("../lib/lang"); var event = require("../lib/event"); -var searchboxCss = "\ -.ace_search {\ -background-color: #ddd;\ -color: #666;\ -border: 1px solid #cbcbcb;\ -border-top: 0 none;\ -overflow: hidden;\ -margin: 0;\ -padding: 4px 6px 0 4px;\ -position: absolute;\ -top: 0;\ -z-index: 99;\ -white-space: normal;\ -}\ -.ace_search.left {\ -border-left: 0 none;\ -border-radius: 0px 0px 5px 0px;\ -left: 0;\ -}\ -.ace_search.right {\ -border-radius: 0px 0px 0px 5px;\ -border-right: 0 none;\ -right: 0;\ -}\ -.ace_search_form, .ace_replace_form {\ -margin: 0 20px 4px 0;\ -overflow: hidden;\ -line-height: 1.9;\ -}\ -.ace_replace_form {\ -margin-right: 0;\ -}\ -.ace_search_form.ace_nomatch {\ -outline: 1px solid red;\ -}\ -.ace_search_field {\ -border-radius: 3px 0 0 3px;\ -background-color: white;\ -color: black;\ -border: 1px solid #cbcbcb;\ -border-right: 0 none;\ -outline: 0;\ -padding: 0;\ -font-size: inherit;\ -margin: 0;\ -line-height: inherit;\ -padding: 0 6px;\ -min-width: 17em;\ -vertical-align: top;\ -min-height: 1.8em;\ -box-sizing: content-box;\ -}\ -.ace_searchbtn {\ -border: 1px solid #cbcbcb;\ -line-height: inherit;\ -display: inline-block;\ -padding: 0 6px;\ -background: #fff;\ -border-right: 0 none;\ -border-left: 1px solid #dcdcdc;\ -cursor: pointer;\ -margin: 0;\ -position: relative;\ -color: #666;\ -}\ -.ace_searchbtn:last-child {\ -border-radius: 0 3px 3px 0;\ -border-right: 1px solid #cbcbcb;\ -}\ -.ace_searchbtn:disabled {\ -background: none;\ -cursor: default;\ -}\ -.ace_searchbtn:hover {\ -background-color: #eef1f6;\ -}\ -.ace_searchbtn.prev, .ace_searchbtn.next {\ -padding: 0px 0.7em\ -}\ -.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\ -content: \"\";\ -border: solid 2px #888;\ -width: 0.5em;\ -height: 0.5em;\ -border-width: 2px 0 0 2px;\ -display:inline-block;\ -transform: rotate(-45deg);\ -}\ -.ace_searchbtn.next:after {\ -border-width: 0 2px 2px 0 ;\ -}\ -.ace_searchbtn_close {\ -background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\ -border-radius: 50%;\ -border: 0 none;\ -color: #656565;\ -cursor: pointer;\ -font: 16px/16px Arial;\ -padding: 0;\ -height: 14px;\ -width: 14px;\ -top: 9px;\ -right: 7px;\ -position: absolute;\ -}\ -.ace_searchbtn_close:hover {\ -background-color: #656565;\ -background-position: 50% 100%;\ -color: white;\ -}\ -.ace_button {\ -margin-left: 2px;\ -cursor: pointer;\ --webkit-user-select: none;\ --moz-user-select: none;\ --o-user-select: none;\ --ms-user-select: none;\ -user-select: none;\ -overflow: hidden;\ -opacity: 0.7;\ -border: 1px solid rgba(100,100,100,0.23);\ -padding: 1px;\ -box-sizing: border-box!important;\ -color: black;\ -}\ -.ace_button:hover {\ -background-color: #eee;\ -opacity:1;\ -}\ -.ace_button:active {\ -background-color: #ddd;\ -}\ -.ace_button.checked {\ -border-color: #3399ff;\ -opacity:1;\ -}\ -.ace_search_options{\ -margin-bottom: 3px;\ -text-align: right;\ --webkit-user-select: none;\ --moz-user-select: none;\ --o-user-select: none;\ --ms-user-select: none;\ -user-select: none;\ -clear: both;\ -}\ -.ace_search_counter {\ -float: left;\ -font-family: arial;\ -padding: 0 8px;\ -}"; +var searchboxCss = require("./searchbox-css"); var HashHandler = require("../keyboard/hash_handler").HashHandler; var keyUtil = require("../lib/keys"); - +var nls = require("../config").nls; var MAX_COUNT = 999; - -dom.importCssString(searchboxCss, "ace_searchbox"); - -var SearchBox = function(editor, range, showReplaceForm) { - var div = dom.createElement("div"); - dom.buildDom(["div", {class:"ace_search right"}, - ["span", {action: "hide", class: "ace_searchbtn_close"}], - ["div", {class: "ace_search_form"}, - ["input", {class: "ace_search_field", placeholder: "Search for", spellcheck: "false"}], - ["span", {action: "findPrev", class: "ace_searchbtn prev"}, "\u200b"], - ["span", {action: "findNext", class: "ace_searchbtn next"}, "\u200b"], - ["span", {action: "findAll", class: "ace_searchbtn", title: "Alt-Enter"}, "All"] - ], - ["div", {class: "ace_replace_form"}, - ["input", {class: "ace_search_field", placeholder: "Replace with", spellcheck: "false"}], - ["span", {action: "replaceAndFindNext", class: "ace_searchbtn"}, "Replace"], - ["span", {action: "replaceAll", class: "ace_searchbtn"}, "All"] - ], - ["div", {class: "ace_search_options"}, - ["span", {action: "toggleReplace", class: "ace_button", title: "Toggle Replace mode", - style: "float:left;margin-top:-2px;padding:0 5px;"}, "+"], - ["span", {class: "ace_search_counter"}], - ["span", {action: "toggleRegexpMode", class: "ace_button", title: "RegExp Search"}, ".*"], - ["span", {action: "toggleCaseSensitive", class: "ace_button", title: "CaseSensitive Search"}, "Aa"], - ["span", {action: "toggleWholeWords", class: "ace_button", title: "Whole Word Search"}, "\\b"], - ["span", {action: "searchInSelection", class: "ace_button", title: "Search In Selection"}, "S"] - ] - ], div); - this.element = div.firstChild; - - this.setSession = this.setSession.bind(this); - - this.$init(); - this.setEditor(editor); - dom.importCssString(searchboxCss, "ace_searchbox", editor.container); -}; - -(function() { - this.setEditor = function(editor) { +dom.importCssString(searchboxCss, "ace_searchbox", false); +var SearchBox = /** @class */ (function () { + function SearchBox(editor, range, showReplaceForm) { + this.activeInput; + var div = dom.createElement("div"); + dom.buildDom(["div", { class: "ace_search right" }, + ["span", { action: "hide", class: "ace_searchbtn_close" }], + ["div", { class: "ace_search_form" }, + ["input", { class: "ace_search_field", placeholder: nls("search-box.find.placeholder", "Search for"), spellcheck: "false" }], + ["span", { action: "findPrev", class: "ace_searchbtn prev" }, "\u200b"], + ["span", { action: "findNext", class: "ace_searchbtn next" }, "\u200b"], + ["span", { action: "findAll", class: "ace_searchbtn", title: "Alt-Enter" }, nls("search-box.find-all.text", "All")] + ], + ["div", { class: "ace_replace_form" }, + ["input", { class: "ace_search_field", placeholder: nls("search-box.replace.placeholder", "Replace with"), spellcheck: "false" }], + ["span", { action: "replaceAndFindNext", class: "ace_searchbtn" }, nls("search-box.replace-next.text", "Replace")], + ["span", { action: "replaceAll", class: "ace_searchbtn" }, nls("search-box.replace-all.text", "All")] + ], + ["div", { class: "ace_search_options" }, + ["span", { action: "toggleReplace", class: "ace_button", title: nls("search-box.toggle-replace.title", "Toggle Replace mode"), + style: "float:left;margin-top:-2px;padding:0 5px;" }, "+"], + ["span", { class: "ace_search_counter" }], + ["span", { action: "toggleRegexpMode", class: "ace_button", title: nls("search-box.toggle-regexp.title", "RegExp Search") }, ".*"], + ["span", { action: "toggleCaseSensitive", class: "ace_button", title: nls("search-box.toggle-case.title", "CaseSensitive Search") }, "Aa"], + ["span", { action: "toggleWholeWords", class: "ace_button", title: nls("search-box.toggle-whole-word.title", "Whole Word Search") }, "\\b"], + ["span", { action: "searchInSelection", class: "ace_button", title: nls("search-box.toggle-in-selection.title", "Search In Selection") }, "S"] + ] + ], div); + this.element = div.firstChild; + this.setSession = this.setSession.bind(this); + this.$init(); + this.setEditor(editor); + dom.importCssString(searchboxCss, "ace_searchbox", editor.container); + } + SearchBox.prototype.setEditor = function (editor) { editor.searchBox = this; editor.renderer.scroller.appendChild(this.element); this.editor = editor; }; - - this.setSession = function(e) { + SearchBox.prototype.setSession = function (e) { this.searchRange = null; this.$syncOptions(true); }; - - this.$initElements = function(sb) { + SearchBox.prototype.$initElements = function (sb) { this.searchBox = sb.querySelector(".ace_search_form"); this.replaceBox = sb.querySelector(".ace_replace_form"); this.searchOption = sb.querySelector("[action=searchInSelection]"); @@ -40330,20 +41830,17 @@ var SearchBox = function(editor, range, showReplaceForm) { this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); this.searchCounter = sb.querySelector(".ace_search_counter"); }; - - this.$init = function() { + SearchBox.prototype.$init = function () { var sb = this.element; - this.$initElements(sb); - var _this = this; - event.addListener(sb, "mousedown", function(e) { - setTimeout(function(){ + event.addListener(sb, "mousedown", function (e) { + setTimeout(function () { _this.activeInput.focus(); }, 0); event.stopPropagation(e); }); - event.addListener(sb, "click", function(e) { + event.addListener(sb, "click", function (e) { var t = e.target || e.srcElement; var action = t.getAttribute("action"); if (action && _this[action]) @@ -40352,8 +41849,7 @@ var SearchBox = function(editor, range, showReplaceForm) { _this.$searchBarKb.commands[action].exec(_this); event.stopPropagation(e); }); - - event.addCommandKeyListener(sb, function(e, hashId, keyCode) { + event.addCommandKeyListener(sb, function (e, hashId, keyCode) { var keyString = keyUtil.keyCodeToString(keyCode); var command = _this.$searchBarKb.findKeyCommand(hashId, keyString); if (command && command.exec) { @@ -40361,122 +41857,32 @@ var SearchBox = function(editor, range, showReplaceForm) { event.stopEvent(e); } }); - - this.$onChange = lang.delayedCall(function() { + this.$onChange = lang.delayedCall(function () { _this.find(false, false); }); - - event.addListener(this.searchInput, "input", function() { + event.addListener(this.searchInput, "input", function () { _this.$onChange.schedule(20); }); - event.addListener(this.searchInput, "focus", function() { + event.addListener(this.searchInput, "focus", function () { _this.activeInput = _this.searchInput; _this.searchInput.value && _this.highlight(); }); - event.addListener(this.replaceInput, "focus", function() { + event.addListener(this.replaceInput, "focus", function () { _this.activeInput = _this.replaceInput; _this.searchInput.value && _this.highlight(); }); }; - this.$closeSearchBarKb = new HashHandler([{ - bindKey: "Esc", - name: "closeSearchBar", - exec: function(editor) { - editor.searchBox.hide(); - } - }]); - this.$searchBarKb = new HashHandler(); - this.$searchBarKb.bindKeys({ - "Ctrl-f|Command-f": function(sb) { - var isReplace = sb.isReplace = !sb.isReplace; - sb.replaceBox.style.display = isReplace ? "" : "none"; - sb.replaceOption.checked = false; - sb.$syncOptions(); - sb.searchInput.focus(); - }, - "Ctrl-H|Command-Option-F": function(sb) { - if (sb.editor.getReadOnly()) - return; - sb.replaceOption.checked = true; - sb.$syncOptions(); - sb.replaceInput.focus(); - }, - "Ctrl-G|Command-G": function(sb) { - sb.findNext(); - }, - "Ctrl-Shift-G|Command-Shift-G": function(sb) { - sb.findPrev(); - }, - "esc": function(sb) { - setTimeout(function() { sb.hide();}); - }, - "Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findNext(); - }, - "Shift-Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findPrev(); - }, - "Alt-Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replaceAll(); - sb.findAll(); - }, - "Tab": function(sb) { - (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus(); - } - }); - - this.$searchBarKb.addCommands([{ - name: "toggleRegexpMode", - bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"}, - exec: function(sb) { - sb.regExpOption.checked = !sb.regExpOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleCaseSensitive", - bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"}, - exec: function(sb) { - sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleWholeWords", - bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"}, - exec: function(sb) { - sb.wholeWordOption.checked = !sb.wholeWordOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleReplace", - exec: function(sb) { - sb.replaceOption.checked = !sb.replaceOption.checked; - sb.$syncOptions(); - } - }, { - name: "searchInSelection", - exec: function(sb) { - sb.searchOption.checked = !sb.searchRange; - sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange()); - sb.$syncOptions(); - } - }]); - - this.setSearchRange = function(range) { + SearchBox.prototype.setSearchRange = function (range) { this.searchRange = range; if (range) { this.searchRangeMarker = this.editor.session.addMarker(range, "ace_active-line"); - } else if (this.searchRangeMarker) { + } + else if (this.searchRangeMarker) { this.editor.session.removeMarker(this.searchRangeMarker); this.searchRangeMarker = null; } }; - - this.$syncOptions = function(preventScroll) { + SearchBox.prototype.$syncOptions = function (preventScroll) { dom.setCssClass(this.replaceOption, "checked", this.searchRange); dom.setCssClass(this.searchOption, "checked", this.searchOption.checked); this.replaceOption.textContent = this.replaceOption.checked ? "-" : "+"; @@ -40488,12 +41894,11 @@ var SearchBox = function(editor, range, showReplaceForm) { this.replaceBox.style.display = this.replaceOption.checked && !readOnly ? "" : "none"; this.find(false, false, preventScroll); }; - - this.highlight = function(re) { + SearchBox.prototype.highlight = function (re) { this.editor.session.highlight(re || this.editor.$search.$options.re); this.editor.renderer.updateBackMarkers(); }; - this.find = function(skipCurrent, backwards, preventScroll) { + SearchBox.prototype.find = function (skipCurrent, backwards, preventScroll) { var range = this.editor.find(this.searchInput.value, { skipCurrent: skipCurrent, backwards: backwards, @@ -40510,20 +41915,19 @@ var SearchBox = function(editor, range, showReplaceForm) { this.highlight(); this.updateCounter(); }; - this.updateCounter = function() { + SearchBox.prototype.updateCounter = function () { var editor = this.editor; var regex = editor.$search.$options.re; + var supportsUnicodeFlag = regex.unicode; var all = 0; var before = 0; if (regex) { var value = this.searchRange ? editor.session.getTextRange(this.searchRange) : editor.getValue(); - var offset = editor.session.doc.positionToIndex(editor.selection.anchor); if (this.searchRange) offset -= editor.session.doc.positionToIndex(this.searchRange.start); - var last = regex.lastIndex = 0; var m; while ((m = regex.exec(value))) { @@ -40534,21 +41938,21 @@ var SearchBox = function(editor, range, showReplaceForm) { if (all > MAX_COUNT) break; if (!m[0]) { - regex.lastIndex = last += 1; + regex.lastIndex = last += lang.skipEmptyMatch(value, last, supportsUnicodeFlag); if (last >= value.length) break; } } } - this.searchCounter.textContent = before + " of " + (all > MAX_COUNT ? MAX_COUNT + "+" : all); + this.searchCounter.textContent = nls("search-box.search-counter", "$0 of $1", [before, (all > MAX_COUNT ? MAX_COUNT + "+" : all)]); }; - this.findNext = function() { + SearchBox.prototype.findNext = function () { this.find(true, false); }; - this.findPrev = function() { + SearchBox.prototype.findPrev = function () { this.find(true, true); }; - this.findAll = function(){ + SearchBox.prototype.findAll = function () { var range = this.editor.findAll(this.searchInput.value, { regExp: this.regExpOption.checked, caseSensitive: this.caseSensitiveOption.checked, @@ -40560,56 +41964,136 @@ var SearchBox = function(editor, range, showReplaceForm) { this.highlight(); this.hide(); }; - this.replace = function() { + SearchBox.prototype.replace = function () { if (!this.editor.getReadOnly()) this.editor.replace(this.replaceInput.value); }; - this.replaceAndFindNext = function() { + SearchBox.prototype.replaceAndFindNext = function () { if (!this.editor.getReadOnly()) { this.editor.replace(this.replaceInput.value); this.findNext(); } }; - this.replaceAll = function() { + SearchBox.prototype.replaceAll = function () { if (!this.editor.getReadOnly()) this.editor.replaceAll(this.replaceInput.value); }; - - this.hide = function() { + SearchBox.prototype.hide = function () { this.active = false; this.setSearchRange(null); this.editor.off("changeSession", this.setSession); - this.element.style.display = "none"; this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); this.editor.focus(); }; - this.show = function(value, isReplace) { + SearchBox.prototype.show = function (value, isReplace) { this.active = true; this.editor.on("changeSession", this.setSession); this.element.style.display = ""; this.replaceOption.checked = isReplace; - if (value) this.searchInput.value = value; - this.searchInput.focus(); this.searchInput.select(); - this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); - this.$syncOptions(true); }; - - this.isFocused = function() { + SearchBox.prototype.isFocused = function () { var el = document.activeElement; return el == this.searchInput || el == this.replaceInput; }; -}).call(SearchBox.prototype); - + return SearchBox; +}()); +var $searchBarKb = new HashHandler(); +$searchBarKb.bindKeys({ + "Ctrl-f|Command-f": function (sb) { + var isReplace = sb.isReplace = !sb.isReplace; + sb.replaceBox.style.display = isReplace ? "" : "none"; + sb.replaceOption.checked = false; + sb.$syncOptions(); + sb.searchInput.focus(); + }, + "Ctrl-H|Command-Option-F": function (sb) { + if (sb.editor.getReadOnly()) + return; + sb.replaceOption.checked = true; + sb.$syncOptions(); + sb.replaceInput.focus(); + }, + "Ctrl-G|Command-G": function (sb) { + sb.findNext(); + }, + "Ctrl-Shift-G|Command-Shift-G": function (sb) { + sb.findPrev(); + }, + "esc": function (sb) { + setTimeout(function () { sb.hide(); }); + }, + "Return": function (sb) { + if (sb.activeInput == sb.replaceInput) + sb.replace(); + sb.findNext(); + }, + "Shift-Return": function (sb) { + if (sb.activeInput == sb.replaceInput) + sb.replace(); + sb.findPrev(); + }, + "Alt-Return": function (sb) { + if (sb.activeInput == sb.replaceInput) + sb.replaceAll(); + sb.findAll(); + }, + "Tab": function (sb) { + (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus(); + } +}); +$searchBarKb.addCommands([{ + name: "toggleRegexpMode", + bindKey: { win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/" }, + exec: function (sb) { + sb.regExpOption.checked = !sb.regExpOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleCaseSensitive", + bindKey: { win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I" }, + exec: function (sb) { + sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleWholeWords", + bindKey: { win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W" }, + exec: function (sb) { + sb.wholeWordOption.checked = !sb.wholeWordOption.checked; + sb.$syncOptions(); + } + }, { + name: "toggleReplace", + exec: function (sb) { + sb.replaceOption.checked = !sb.replaceOption.checked; + sb.$syncOptions(); + } + }, { + name: "searchInSelection", + exec: function (sb) { + sb.searchOption.checked = !sb.searchRange; + sb.setSearchRange(sb.searchOption.checked && sb.editor.getSelectionRange()); + sb.$syncOptions(); + } + }]); +var $closeSearchBarKb = new HashHandler([{ + bindKey: "Esc", + name: "closeSearchBar", + exec: function (editor) { + editor.searchBox.hide(); + } + }]); +SearchBox.prototype.$searchBarKb = $searchBarKb; +SearchBox.prototype.$closeSearchBarKb = $closeSearchBarKb; exports.SearchBox = SearchBox; - -exports.Search = function(editor, isReplace) { +exports.Search = function (editor, isReplace) { var sb = editor.searchBox || new SearchBox(editor); sb.show(editor.session.getTextRange(), isReplace); }; @@ -40625,209 +42109,172 @@ exports.Search = function(editor, isReplace) { /***/ }), -/***/ 4091: +/***/ 4221: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); -ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { -"use strict"; - +ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict"; var oop = require("../lib/oop"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JsonHighlightRules = function() { +var JsonHighlightRules = function () { this.$rules = { - "start" : [ + "start": [ { - token : "variable", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' + token: "variable", // single line + regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' }, { - token : "string", // single line - regex : '"', - next : "string" + token: "string", // single line + regex: '"', + next: "string" }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" + token: "constant.numeric", // hex + regex: "0[xX][0-9a-fA-F]+\\b" }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + token: "constant.numeric", // float + regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" + token: "constant.language.boolean", + regex: "(?:true|false)\\b" }, { - token : "text", // single quoted strings are not allowed - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + token: "text", // single quoted strings are not allowed + regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { - token : "comment", // comments are not allowed, but who cares? - regex : "\\/\\/.*$" + token: "comment", // comments are not allowed, but who cares? + regex: "\\/\\/.*$" }, { - token : "comment.start", // comments are not allowed, but who cares? - regex : "\\/\\*", - next : "comment" + token: "comment.start", // comments are not allowed, but who cares? + regex: "\\/\\*", + next: "comment" }, { - token : "paren.lparen", - regex : "[[({]" + token: "paren.lparen", + regex: "[[({]" }, { - token : "paren.rparen", - regex : "[\\])}]" + token: "paren.rparen", + regex: "[\\])}]" }, { - token : "text", - regex : "\\s+" + token: "punctuation.operator", + regex: /[,]/ + }, { + token: "text", + regex: "\\s+" } ], - "string" : [ + "string": [ { - token : "constant.language.escape", - regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ + token: "constant.language.escape", + regex: /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ }, { - token : "string", - regex : '"|$', - next : "start" + token: "string", + regex: '"|$', + next: "start" }, { - defaultToken : "string" + defaultToken: "string" } ], - "comment" : [ + "comment": [ { - token : "comment.end", // comments are not allowed, but who cares? - regex : "\\*\\/", - next : "start" + token: "comment.end", // comments are not allowed, but who cares? + regex: "\\*\\/", + next: "start" }, { defaultToken: "comment" } ] }; - }; - oop.inherits(JsonHighlightRules, TextHighlightRules); - exports.JsonHighlightRules = JsonHighlightRules; -}); -ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict"; var Range = require("../range").Range; - -var MatchingBraceOutdent = function() {}; - -(function() { - - this.checkOutdent = function(line, input) { - if (! /^\s+$/.test(line)) +var MatchingBraceOutdent = function () { }; +(function () { + this.checkOutdent = function (line, input) { + if (!/^\s+$/.test(line)) return false; - return /^\s*\}/.test(input); }; - - this.autoOutdent = function(doc, row) { + this.autoOutdent = function (doc, row) { var line = doc.getLine(row); var match = line.match(/^(\s*\})/); - - if (!match) return 0; - + if (!match) + return 0; var column = match[1].length; - var openBracePos = doc.findMatchingBracket({row: row, column: column}); - - if (!openBracePos || openBracePos.row == row) return 0; - + var openBracePos = doc.findMatchingBracket({ row: row, column: column }); + if (!openBracePos || openBracePos.row == row) + return 0; var indent = this.$getIndent(doc.getLine(openBracePos.row)); - doc.replace(new Range(row, 0, row, column-1), indent); + doc.replace(new Range(row, 0, row, column - 1), indent); }; - - this.$getIndent = function(line) { + this.$getIndent = function (line) { return line.match(/^\s*/)[0]; }; - }).call(MatchingBraceOutdent.prototype); - exports.MatchingBraceOutdent = MatchingBraceOutdent; -}); -ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { -"use strict"; +}); +ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict"; var oop = require("../../lib/oop"); var Range = require("../../range").Range; var BaseFoldMode = require("./fold_mode").FoldMode; - -var FoldMode = exports.FoldMode = function(commentRegex) { +var FoldMode = exports.FoldMode = function (commentRegex) { if (commentRegex) { - this.foldingStartMarker = new RegExp( - this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) - ); - this.foldingStopMarker = new RegExp( - this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) - ); + this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)); + this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)); } }; oop.inherits(FoldMode, BaseFoldMode); - -(function() { - +(function () { this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/; this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/; - this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; + this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this._getFoldWidgetBase = this.getFoldWidget; - this.getFoldWidget = function(session, foldStyle, row) { + this.getFoldWidget = function (session, foldStyle, row) { var line = session.getLine(row); - if (this.singleLineBlockCommentRe.test(line)) { if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) return ""; } - var fw = this._getFoldWidgetBase(session, foldStyle, row); - if (!fw && this.startRegionRe.test(line)) return "start"; // lineCommentRegionStart - return fw; }; - - this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { + this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) { var line = session.getLine(row); - if (this.startRegionRe.test(line)) return this.getCommentRegionBlock(session, line, row); - var match = line.match(this.foldingStartMarker); if (match) { var i = match.index; - if (match[1]) return this.openingBracketBlock(session, match[1], row, i); - var range = session.getCommentFoldRange(row, i + match[0].length, 1); - if (range && !range.isMultiLine()) { if (forceMultiline) { range = this.getSectionRange(session, row); - } else if (foldStyle != "all") + } + else if (foldStyle != "all") range = null; } - return range; } - if (foldStyle === "markbegin") return; - var match = line.match(this.foldingStopMarker); if (match) { var i = match.index + match[0].length; - if (match[1]) return this.closingBracketBlock(session, match[1], row, i); - return session.getCommentFoldRange(row, i, -1); } }; - - this.getSectionRange = function(session, row) { + this.getSectionRange = function (session, row) { var line = session.getLine(row); var startIndent = line.search(/\S/); var startRow = row; @@ -40840,116 +42287,99 @@ oop.inherits(FoldMode, BaseFoldMode); var indent = line.search(/\S/); if (indent === -1) continue; - if (startIndent > indent) + if (startIndent > indent) break; var subRange = this.getFoldWidgetRange(session, "all", row); - if (subRange) { if (subRange.start.row <= startRow) { break; - } else if (subRange.isMultiLine()) { + } + else if (subRange.isMultiLine()) { row = subRange.end.row; - } else if (startIndent == indent) { + } + else if (startIndent == indent) { break; } } endRow = row; } - return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); }; - this.getCommentRegionBlock = function(session, line, row) { + this.getCommentRegionBlock = function (session, line, row) { var startColumn = line.search(/\s*$/); var maxRow = session.getLength(); var startRow = row; - var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var depth = 1; while (++row < maxRow) { line = session.getLine(row); var m = re.exec(line); - if (!m) continue; - if (m[1]) depth--; - else depth++; - - if (!depth) break; + if (!m) + continue; + if (m[1]) + depth--; + else + depth++; + if (!depth) + break; } - var endRow = row; if (endRow > startRow) { return new Range(startRow, startColumn, endRow, line.length); } }; - }).call(FoldMode.prototype); }); -ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"], function(require, exports, module) { -"use strict"; - +ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle","ace/worker/worker_client"], function(require, exports, module){"use strict"; var oop = require("../lib/oop"); var TextMode = require("./text").Mode; var HighlightRules = require("./json_highlight_rules").JsonHighlightRules; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var WorkerClient = require("../worker/worker_client").WorkerClient; - -var Mode = function() { +var Mode = function () { this.HighlightRules = HighlightRules; this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); + this.$behaviour = this.$defaultBehaviour; this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); - -(function() { - +(function () { this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { + this.blockComment = { start: "/*", end: "*/" }; + this.getNextLineIndent = function (state, line, tab) { var indent = this.$getIndent(line); - if (state == "start") { var match = line.match(/^.*[\{\(\[]\s*$/); if (match) { indent += tab; } } - return indent; }; - - this.checkOutdent = function(state, line, input) { + this.checkOutdent = function (state, line, input) { return this.$outdent.checkOutdent(line, input); }; - - this.autoOutdent = function(state, doc, row) { + this.autoOutdent = function (state, doc, row) { this.$outdent.autoOutdent(doc, row); }; - - this.createWorker = function(session) { + this.createWorker = function (session) { var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker"); worker.attachToDocument(session.getDocument()); - - worker.on("annotate", function(e) { + worker.on("annotate", function (e) { session.setAnnotations(e.data); }); - - worker.on("terminate", function() { + worker.on("terminate", function () { session.clearAnnotations(); }); - return worker; }; - - this.$id = "ace/mode/json"; }).call(Mode.prototype); - exports.Mode = Mode; + }); (function() { ace.require(["ace/mode/json"], function(m) { if ( true && module) { @@ -40961,21 +42391,21 @@ exports.Mode = Mode; /***/ }), -/***/ 8903: +/***/ 2229: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var compileSchema = __webpack_require__(5689) - , resolve = __webpack_require__(3969) - , Cache = __webpack_require__(5255) - , SchemaObject = __webpack_require__(4293) - , stableStringify = __webpack_require__(3508) - , formats = __webpack_require__(3368) - , rules = __webpack_require__(742) - , $dataMetaSchema = __webpack_require__(9394) - , util = __webpack_require__(3724); +var compileSchema = __webpack_require__(2620) + , resolve = __webpack_require__(4292) + , Cache = __webpack_require__(9336) + , SchemaObject = __webpack_require__(4427) + , stableStringify = __webpack_require__(9306) + , formats = __webpack_require__(2084) + , rules = __webpack_require__(3483) + , $dataMetaSchema = __webpack_require__(8852) + , util = __webpack_require__(6862); module.exports = Ajv; @@ -40992,14 +42422,14 @@ Ajv.prototype.errorsText = errorsText; Ajv.prototype._addSchema = _addSchema; Ajv.prototype._compile = _compile; -Ajv.prototype.compileAsync = __webpack_require__(9677); -var customKeyword = __webpack_require__(7931); +Ajv.prototype.compileAsync = __webpack_require__(600); +var customKeyword = __webpack_require__(413); Ajv.prototype.addKeyword = customKeyword.add; Ajv.prototype.getKeyword = customKeyword.get; Ajv.prototype.removeKeyword = customKeyword.remove; Ajv.prototype.validateKeyword = customKeyword.validate; -var errorClasses = __webpack_require__(5359); +var errorClasses = __webpack_require__(3689); Ajv.ValidationError = errorClasses.Validation; Ajv.MissingRefError = errorClasses.MissingRef; Ajv.$dataMetaSchema = $dataMetaSchema; @@ -41408,11 +42838,11 @@ function addFormat(name, format) { function addDefaultMetaSchema(self) { var $dataSchema; if (self._opts.$data) { - $dataSchema = __webpack_require__(6835); + $dataSchema = __webpack_require__(3420); self.addMetaSchema($dataSchema, $dataSchema.$id, true); } if (self._opts.meta === false) return; - var metaSchema = __webpack_require__(38); + var metaSchema = __webpack_require__(8198); if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA); self.addMetaSchema(metaSchema, META_SCHEMA_ID, true); self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID; @@ -41475,7 +42905,7 @@ function noop() {} /***/ }), -/***/ 5255: +/***/ 9336: /***/ (function(module) { "use strict"; @@ -41509,13 +42939,13 @@ Cache.prototype.clear = function Cache_clear() { /***/ }), -/***/ 9677: +/***/ 600: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var MissingRefError = __webpack_require__(5359).MissingRef; +var MissingRefError = (__webpack_require__(3689).MissingRef); module.exports = compileAsync; @@ -41607,13 +43037,13 @@ function compileAsync(schema, meta, callback) { /***/ }), -/***/ 5359: +/***/ 3689: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var resolve = __webpack_require__(3969); +var resolve = __webpack_require__(4292); module.exports = { Validation: errorSubclass(ValidationError), @@ -41649,13 +43079,13 @@ function errorSubclass(Subclass) { /***/ }), -/***/ 3368: +/***/ 2084: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(3724); +var util = __webpack_require__(6862); var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31]; @@ -41799,25 +43229,25 @@ function regex(str) { /***/ }), -/***/ 5689: +/***/ 2620: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var resolve = __webpack_require__(3969) - , util = __webpack_require__(3724) - , errorClasses = __webpack_require__(5359) - , stableStringify = __webpack_require__(3508); +var resolve = __webpack_require__(4292) + , util = __webpack_require__(6862) + , errorClasses = __webpack_require__(3689) + , stableStringify = __webpack_require__(9306); -var validateGenerator = __webpack_require__(1869); +var validateGenerator = __webpack_require__(1035); /** * Functions below are used inside compiled validations function */ var ucs2length = util.ucs2length; -var equal = __webpack_require__(2303); +var equal = __webpack_require__(5215); // this error is thrown by async schemas to return validation errors via exception var ValidationError = errorClasses.Validation; @@ -42194,17 +43624,17 @@ function vars(arr, statement) { /***/ }), -/***/ 3969: +/***/ 4292: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var URI = __webpack_require__(7533) - , equal = __webpack_require__(2303) - , util = __webpack_require__(3724) - , SchemaObject = __webpack_require__(4293) - , traverse = __webpack_require__(500); +var URI = __webpack_require__(6777) + , equal = __webpack_require__(5215) + , util = __webpack_require__(6862) + , SchemaObject = __webpack_require__(4427) + , traverse = __webpack_require__(4316); module.exports = resolve; @@ -42472,14 +43902,14 @@ function resolveIds(schema) { /***/ }), -/***/ 742: +/***/ 3483: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var ruleModules = __webpack_require__(9646) - , toHash = __webpack_require__(3724).toHash; +var ruleModules = __webpack_require__(8161) + , toHash = (__webpack_require__(6862).toHash); module.exports = function rules() { var RULES = [ @@ -42546,13 +43976,13 @@ module.exports = function rules() { /***/ }), -/***/ 4293: +/***/ 4427: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var util = __webpack_require__(3724); +var util = __webpack_require__(6862); module.exports = SchemaObject; @@ -42563,7 +43993,7 @@ function SchemaObject(obj) { /***/ }), -/***/ 6887: +/***/ 611: /***/ (function(module) { "use strict"; @@ -42591,7 +44021,7 @@ module.exports = function ucs2length(str) { /***/ }), -/***/ 3724: +/***/ 6862: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -42606,8 +44036,8 @@ module.exports = { toHash: toHash, getProperty: getProperty, escapeQuotes: escapeQuotes, - equal: __webpack_require__(2303), - ucs2length: __webpack_require__(6887), + equal: __webpack_require__(5215), + ucs2length: __webpack_require__(611), varOccurences: varOccurences, varReplace: varReplace, schemaHasRules: schemaHasRules, @@ -42838,7 +44268,7 @@ function unescapeJsonPointer(str) { /***/ }), -/***/ 9394: +/***/ 8852: /***/ (function(module) { "use strict"; @@ -42895,13 +44325,13 @@ module.exports = function (metaSchema, keywordsJsonPointers) { /***/ }), -/***/ 5868: +/***/ 9407: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; -var metaSchema = __webpack_require__(38); +var metaSchema = __webpack_require__(8198); module.exports = { $id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js', @@ -42940,7 +44370,7 @@ module.exports = { /***/ }), -/***/ 1796: +/***/ 1765: /***/ (function(module) { "use strict"; @@ -43111,7 +44541,7 @@ module.exports = function generate__limit(it, $keyword, $ruleType) { /***/ }), -/***/ 2407: +/***/ 9337: /***/ (function(module) { "use strict"; @@ -43199,7 +44629,7 @@ module.exports = function generate__limitItems(it, $keyword, $ruleType) { /***/ }), -/***/ 1250: +/***/ 5433: /***/ (function(module) { "use strict"; @@ -43292,7 +44722,7 @@ module.exports = function generate__limitLength(it, $keyword, $ruleType) { /***/ }), -/***/ 2596: +/***/ 7724: /***/ (function(module) { "use strict"; @@ -43380,7 +44810,7 @@ module.exports = function generate__limitProperties(it, $keyword, $ruleType) { /***/ }), -/***/ 9486: +/***/ 3531: /***/ (function(module) { "use strict"; @@ -43430,7 +44860,7 @@ module.exports = function generate_allOf(it, $keyword, $ruleType) { /***/ }), -/***/ 5347: +/***/ 8854: /***/ (function(module) { "use strict"; @@ -43511,7 +44941,7 @@ module.exports = function generate_anyOf(it, $keyword, $ruleType) { /***/ }), -/***/ 923: +/***/ 8372: /***/ (function(module) { "use strict"; @@ -43533,7 +44963,7 @@ module.exports = function generate_comment(it, $keyword, $ruleType) { /***/ }), -/***/ 2617: +/***/ 9650: /***/ (function(module) { "use strict"; @@ -43597,7 +45027,7 @@ module.exports = function generate_const(it, $keyword, $ruleType) { /***/ }), -/***/ 2119: +/***/ 1292: /***/ (function(module) { "use strict"; @@ -43686,7 +45116,7 @@ module.exports = function generate_contains(it, $keyword, $ruleType) { /***/ }), -/***/ 1793: +/***/ 8050: /***/ (function(module) { "use strict"; @@ -43922,7 +45352,7 @@ module.exports = function generate_custom(it, $keyword, $ruleType) { /***/ }), -/***/ 9115: +/***/ 2860: /***/ (function(module) { "use strict"; @@ -44098,7 +45528,7 @@ module.exports = function generate_dependencies(it, $keyword, $ruleType) { /***/ }), -/***/ 9317: +/***/ 7112: /***/ (function(module) { "use strict"; @@ -44172,7 +45602,7 @@ module.exports = function generate_enum(it, $keyword, $ruleType) { /***/ }), -/***/ 8327: +/***/ 4682: /***/ (function(module) { "use strict"; @@ -44330,7 +45760,7 @@ module.exports = function generate_format(it, $keyword, $ruleType) { /***/ }), -/***/ 5926: +/***/ 1678: /***/ (function(module) { "use strict"; @@ -44441,7 +45871,7 @@ module.exports = function generate_if(it, $keyword, $ruleType) { /***/ }), -/***/ 9646: +/***/ 8161: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -44449,40 +45879,40 @@ module.exports = function generate_if(it, $keyword, $ruleType) { //all requires must be explicit because browserify won't work with dynamic requires module.exports = { - '$ref': __webpack_require__(2331), - allOf: __webpack_require__(9486), - anyOf: __webpack_require__(5347), - '$comment': __webpack_require__(923), - const: __webpack_require__(2617), - contains: __webpack_require__(2119), - dependencies: __webpack_require__(9115), - 'enum': __webpack_require__(9317), - format: __webpack_require__(8327), - 'if': __webpack_require__(5926), - items: __webpack_require__(392), - maximum: __webpack_require__(1796), - minimum: __webpack_require__(1796), - maxItems: __webpack_require__(2407), - minItems: __webpack_require__(2407), - maxLength: __webpack_require__(1250), - minLength: __webpack_require__(1250), - maxProperties: __webpack_require__(2596), - minProperties: __webpack_require__(2596), - multipleOf: __webpack_require__(6039), - not: __webpack_require__(7946), - oneOf: __webpack_require__(9344), - pattern: __webpack_require__(9737), - properties: __webpack_require__(2537), - propertyNames: __webpack_require__(2127), - required: __webpack_require__(1204), - uniqueItems: __webpack_require__(1985), - validate: __webpack_require__(1869) + '$ref': __webpack_require__(7096), + allOf: __webpack_require__(3531), + anyOf: __webpack_require__(8854), + '$comment': __webpack_require__(8372), + const: __webpack_require__(9650), + contains: __webpack_require__(1292), + dependencies: __webpack_require__(2860), + 'enum': __webpack_require__(7112), + format: __webpack_require__(4682), + 'if': __webpack_require__(1678), + items: __webpack_require__(3913), + maximum: __webpack_require__(1765), + minimum: __webpack_require__(1765), + maxItems: __webpack_require__(9337), + minItems: __webpack_require__(9337), + maxLength: __webpack_require__(5433), + minLength: __webpack_require__(5433), + maxProperties: __webpack_require__(7724), + minProperties: __webpack_require__(7724), + multipleOf: __webpack_require__(812), + not: __webpack_require__(1004), + oneOf: __webpack_require__(6288), + pattern: __webpack_require__(2079), + properties: __webpack_require__(2124), + propertyNames: __webpack_require__(4926), + required: __webpack_require__(2000), + uniqueItems: __webpack_require__(7812), + validate: __webpack_require__(1035) }; /***/ }), -/***/ 392: +/***/ 3913: /***/ (function(module) { "use strict"; @@ -44630,7 +46060,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { /***/ }), -/***/ 6039: +/***/ 812: /***/ (function(module) { "use strict"; @@ -44718,7 +46148,7 @@ module.exports = function generate_multipleOf(it, $keyword, $ruleType) { /***/ }), -/***/ 7946: +/***/ 1004: /***/ (function(module) { "use strict"; @@ -44810,7 +46240,7 @@ module.exports = function generate_not(it, $keyword, $ruleType) { /***/ }), -/***/ 9344: +/***/ 6288: /***/ (function(module) { "use strict"; @@ -44891,7 +46321,7 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { /***/ }), -/***/ 9737: +/***/ 2079: /***/ (function(module) { "use strict"; @@ -44974,7 +46404,7 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) { /***/ }), -/***/ 2537: +/***/ 2124: /***/ (function(module) { "use strict"; @@ -45317,7 +46747,7 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { /***/ }), -/***/ 2127: +/***/ 4926: /***/ (function(module) { "use strict"; @@ -45406,7 +46836,7 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { /***/ }), -/***/ 2331: +/***/ 7096: /***/ (function(module) { "use strict"; @@ -45538,7 +46968,7 @@ module.exports = function generate_ref(it, $keyword, $ruleType) { /***/ }), -/***/ 1204: +/***/ 2000: /***/ (function(module) { "use strict"; @@ -45816,7 +47246,7 @@ module.exports = function generate_required(it, $keyword, $ruleType) { /***/ }), -/***/ 1985: +/***/ 7812: /***/ (function(module) { "use strict"; @@ -45910,7 +47340,7 @@ module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { /***/ }), -/***/ 1869: +/***/ 1035: /***/ (function(module) { "use strict"; @@ -46400,15 +47830,15 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { /***/ }), -/***/ 7931: +/***/ 413: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; -var customRuleCode = __webpack_require__(1793); -var definitionSchema = __webpack_require__(5868); +var customRuleCode = __webpack_require__(8050); +var definitionSchema = __webpack_require__(9407); module.exports = { add: addKeyword, @@ -46554,7 +47984,7 @@ function validateKeyword(definition, throwError) { /***/ }), -/***/ 2303: +/***/ 5215: /***/ (function(module) { "use strict"; @@ -46608,7 +48038,7 @@ module.exports = function equal(a, b) { /***/ }), -/***/ 3508: +/***/ 9306: /***/ (function(module) { "use strict"; @@ -46675,7 +48105,7 @@ module.exports = function (data, opts) { /***/ }), -/***/ 233: +/***/ 1342: /***/ (function(module) { /* @@ -46727,7 +48157,7 @@ module.exports = function naturalSort (a, b) { /***/ }), -/***/ 5156: +/***/ 9151: /***/ (function(__unused_webpack_module, exports) { (function(exports) { @@ -46872,6 +48302,18 @@ module.exports = function naturalSort (a, b) { var TYPE_NULL = 7; var TYPE_ARRAY_NUMBER = 8; var TYPE_ARRAY_STRING = 9; + var TYPE_NAME_TABLE = { + 0: 'number', + 1: 'any', + 2: 'string', + 3: 'array', + 4: 'object', + 5: 'boolean', + 6: 'expression', + 7: 'null', + 8: 'Array', + 9: 'Array' + }; var TOK_EOF = "EOF"; var TOK_UNQUOTEDIDENTIFIER = "UnquotedIdentifier"; @@ -47283,10 +48725,8 @@ module.exports = function naturalSort (a, b) { var node = {type: "Field", name: token.value}; if (this._lookahead(0) === TOK_LPAREN) { throw new Error("Quoted identifier not allowed for function names."); - } else { - return node; } - break; + return node; case TOK_NOT: right = this.expression(bindingPower.Not); return {type: "NotExpression", children: [right]}; @@ -47320,10 +48760,8 @@ module.exports = function naturalSort (a, b) { right = this._parseProjectionRHS(bindingPower.Star); return {type: "Projection", children: [{type: "Identity"}, right]}; - } else { - return this._parseMultiselectList(); } - break; + return this._parseMultiselectList(); case TOK_CURRENT: return {type: TOK_CURRENT}; case TOK_EXPREF: @@ -47355,13 +48793,11 @@ module.exports = function naturalSort (a, b) { if (this._lookahead(0) !== TOK_STAR) { right = this._parseDotRHS(rbp); return {type: "Subexpression", children: [left, right]}; - } else { - // Creating a projection. - this._advance(); - right = this._parseProjectionRHS(rbp); - return {type: "ValueProjection", children: [left, right]}; } - break; + // Creating a projection. + this._advance(); + right = this._parseProjectionRHS(rbp); + return {type: "ValueProjection", children: [left, right]}; case TOK_PIPE: right = this.expression(bindingPower.Pipe); return {type: TOK_PIPE, children: [left, right]}; @@ -47415,13 +48851,11 @@ module.exports = function naturalSort (a, b) { if (token.type === TOK_NUMBER || token.type === TOK_COLON) { right = this._parseIndexExpression(); return this._projectIfSlice(left, right); - } else { - this._match(TOK_STAR); - this._match(TOK_RBRACKET); - right = this._parseProjectionRHS(bindingPower.Star); - return {type: "Projection", children: [left, right]}; } - break; + this._match(TOK_STAR); + this._match(TOK_RBRACKET); + right = this._parseProjectionRHS(bindingPower.Star); + return {type: "Projection", children: [left, right]}; default: this._errorToken(this._lookaheadToken(0)); } @@ -47598,19 +49032,15 @@ module.exports = function naturalSort (a, b) { var matched, current, result, first, second, field, left, right, collected, i; switch (node.type) { case "Field": - if (value === null ) { - return null; - } else if (isObject(value)) { + if (value !== null && isObject(value)) { field = value[node.name]; if (field === undefined) { return null; } else { return field; } - } else { - return null; } - break; + return null; case "Subexpression": result = this.visit(node.children[0], value); for (i = 1; i < node.children.length; i++) { @@ -47981,11 +49411,16 @@ module.exports = function naturalSort (a, b) { } } if (!typeMatched) { + var expected = currentSpec + .map(function(typeIdentifier) { + return TYPE_NAME_TABLE[typeIdentifier]; + }) + .join(','); throw new Error("TypeError: " + name + "() " + "expected argument " + (i + 1) + - " to be type " + currentSpec + - " but received type " + actualType + - " instead."); + " to be type " + expected + + " but received type " + + TYPE_NAME_TABLE[actualType] + " instead."); } } }, @@ -48401,7 +49836,7 @@ module.exports = function naturalSort (a, b) { /***/ }), -/***/ 500: +/***/ 4316: /***/ (function(module) { "use strict"; @@ -48498,7 +49933,7 @@ function escapeJsonPtr(str) { /***/ }), -/***/ 7026: +/***/ 3094: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -48971,975 +50406,7 @@ function escapeJsonPointer(str) { /***/ }), -/***/ 5755: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.default = JsonRepairError; - -function JsonRepairError(message, char) { - if (!(this instanceof JsonRepairError)) { - throw new SyntaxError('Constructor must be called with the new operator'); - } - - this.message = message + ' (char ' + char + ')'; - this.char = char; - this.stack = new Error().stack; -} - -JsonRepairError.prototype = new Error(); -JsonRepairError.prototype.constructor = Error; - - -/***/ }), - -/***/ 8909: -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -module.exports = __webpack_require__(8107).default - - -/***/ }), - -/***/ 8107: -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -var __webpack_unused_export__; - - -__webpack_unused_export__ = ({ - value: true -}); -exports.default = jsonrepair; - -var _JsonRepairError = _interopRequireDefault(__webpack_require__(5755)); - -var _stringUtils = __webpack_require__(1536); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// token types enumeration -var DELIMITER = 0; -var NUMBER = 1; -var STRING = 2; -var SYMBOL = 3; -var WHITESPACE = 4; -var COMMENT = 5; -var UNKNOWN = 6; -/** - * @typedef {DELIMITER | NUMBER | STRING | SYMBOL | WHITESPACE | COMMENT | UNKNOWN} TokenType - */ -// map with all delimiters - -var DELIMITERS = { - '': true, - '{': true, - '}': true, - '[': true, - ']': true, - ':': true, - ',': true, - // for JSONP and MongoDB data type notation - '(': true, - ')': true, - ';': true, - // for string concatenation - '+': true -}; // map with all escape characters - -var ESCAPE_CHARACTERS = { - '"': '"', - '\\': '\\', - '/': '/', - b: '\b', - f: '\f', - n: '\n', - r: '\r', - t: '\t' // \u is handled by getToken() - -}; // TODO: can we unify CONTROL_CHARACTERS and ESCAPE_CHARACTERS? - -var CONTROL_CHARACTERS = { - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t' -}; -var SYMBOLS = { - null: 'null', - true: 'true', - false: 'false' -}; -var PYTHON_SYMBOLS = { - None: 'null', - True: 'true', - False: 'false' -}; -var input = ''; // current json text - -var output = ''; // generated output - -var index = 0; // current index in text - -var c = ''; // current token character in text - -var token = ''; // current token - -var tokenType = UNKNOWN; // type of current token - -/** - * Repair a string containing an invalid JSON document. - * For example changes JavaScript notation into JSON notation. - * - * Example: - * - * jsonrepair('{name: \'John\'}") // '{"name": "John"}' - * - * @param {string} text - * @return {string} - */ - -function jsonrepair(text) { - // initialize - input = text; - output = ''; - index = 0; - c = input.charAt(0); - token = ''; - tokenType = UNKNOWN; // get first token - - processNextToken(); - var rootLevelTokenType = tokenType; // parse everything - - parseObject(); // ignore trailing comma - - skipComma(); - - if (token === '') { - // reached the end of the document properly - return output; - } - - if (rootLevelTokenType === tokenType && tokenIsStartOfValue()) { - // start of a new value after end of the root level object: looks like - // newline delimited JSON -> turn into a root level array - var stashedOutput = ''; - - while (rootLevelTokenType === tokenType && tokenIsStartOfValue()) { - output = (0, _stringUtils.insertBeforeLastWhitespace)(output, ','); - stashedOutput += output; - output = ''; // parse next newline delimited item - - parseObject(); // ignore trailing comma - - skipComma(); - } // wrap the output in an array - - - return "[\n".concat(stashedOutput).concat(output, "\n]"); - } - - throw new _JsonRepairError.default('Unexpected characters', index - token.length); -} -/** - * Get the next character from the expression. - * The character is stored into the char c. If the end of the expression is - * reached, the function puts an empty string in c. - */ - - -function next() { - index++; - c = input.charAt(index); // Note: not using input[index] because that returns undefined when index is out of range -} -/** - * Special version of the function next, used to parse escaped strings - */ - - -function nextSkipEscape() { - next(); - - if (c === '\\') { - next(); - } -} -/** - * check whether the current token is the start of a value: - * object, array, number, string, or symbol - * @returns {boolean} - */ - - -function tokenIsStartOfValue() { - return tokenType === DELIMITER && (token === '[' || token === '{') || tokenType === STRING || tokenType === NUMBER || tokenType === SYMBOL; -} -/** - * check whether the current token is the start of a key (or possible key): - * number, string, or symbol - * @returns {boolean} - */ - - -function tokenIsStartOfKey() { - return tokenType === STRING || tokenType === NUMBER || tokenType === SYMBOL; -} -/** - * Process the previous token, and get next token in the current text - */ - - -function processNextToken() { - output += token; - tokenType = UNKNOWN; - token = ''; - getTokenDelimiter(); - - if (tokenType === WHITESPACE) { - // we leave the whitespace as it is, except replacing special white - // space character - token = (0, _stringUtils.normalizeWhitespace)(token); - processNextToken(); - } - - if (tokenType === COMMENT) { - // ignore comments - tokenType = UNKNOWN; - token = ''; - processNextToken(); - } -} - -function skipComma() { - if (token === ',') { - token = ''; - tokenType = UNKNOWN; - processNextToken(); - } -} // check for delimiters like ':', '{', ']' - - -function getTokenDelimiter() { - if (DELIMITERS[c]) { - tokenType = DELIMITER; - token = c; - next(); - return; - } - - getTokenNumber(); -} // check for a number like "2.3e+5" - - -function getTokenNumber() { - if ((0, _stringUtils.isDigit)(c) || c === '-') { - tokenType = NUMBER; - - if (c === '-') { - token += c; - next(); - - if (!(0, _stringUtils.isDigit)(c)) { - throw new _JsonRepairError.default('Invalid number, digit expected', index); - } - } else if (c === '0') { - token += c; - next(); - } else {// digit 1-9, nothing extra to do - } - - while ((0, _stringUtils.isDigit)(c)) { - token += c; - next(); - } - - if (c === '.') { - token += c; - next(); - - if (!(0, _stringUtils.isDigit)(c)) { - throw new _JsonRepairError.default('Invalid number, digit expected', index); - } - - while ((0, _stringUtils.isDigit)(c)) { - token += c; - next(); - } - } - - if (c === 'e' || c === 'E') { - token += c; - next(); - - if (c === '+' || c === '-') { - token += c; - next(); - } - - if (!(0, _stringUtils.isDigit)(c)) { - throw new _JsonRepairError.default('Invalid number, digit expected', index); - } - - while ((0, _stringUtils.isDigit)(c)) { - token += c; - next(); - } - } - - return; - } - - getTokenEscapedString(); -} // get a token string like '\"hello world\"' - - -function getTokenEscapedString() { - if (c === '\\' && input.charAt(index + 1) === '"') { - // an escaped piece of JSON - next(); - getTokenString(nextSkipEscape); - } else { - getTokenString(next); - } -} // get a token string like '"hello world"' - - -function getTokenString(getNext) { - if ((0, _stringUtils.isQuote)(c)) { - var quote = (0, _stringUtils.normalizeQuote)(c); - var isEndQuote = (0, _stringUtils.isSingleQuote)(c) ? _stringUtils.isSingleQuote : _stringUtils.isDoubleQuote; - token += '"'; // output valid double quote - - tokenType = STRING; - getNext(); // eslint-disable-next-line no-unmodified-loop-condition - - while (c !== '' && !isEndQuote(c)) { - if (c === '\\') { - // handle escape characters - getNext(); - var unescaped = ESCAPE_CHARACTERS[c]; - - if (unescaped !== undefined) { - token += '\\' + c; - getNext(); - } else if (c === 'u') { - // parse escaped unicode character, like '\\u260E' - token += "\\u"; - getNext(); - - for (var u = 0; u < 4; u++) { - if (!(0, _stringUtils.isHex)(c)) { - throw new _JsonRepairError.default('Invalid unicode character', index - token.length); - } - - token += c; - getNext(); - } - } else if (c === '\'') { - // escaped single quote character -> remove the escape character - token += '\''; - getNext(); - } else { - throw new _JsonRepairError.default('Invalid escape character "\\' + c + '"', index); - } - } else if (CONTROL_CHARACTERS[c]) { - // unescaped special character - // fix by adding an escape character - token += CONTROL_CHARACTERS[c]; - getNext(); - } else if (c === '"') { - // unescaped double quote -> escape it - token += '\\"'; - getNext(); - } else { - // a regular character - token += c; - getNext(); - } - } - - if ((0, _stringUtils.normalizeQuote)(c) !== quote) { - throw new _JsonRepairError.default('End of string expected', index - token.length); - } - - token += '"'; // output valid double quote - - getNext(); - return; - } - - getTokenAlpha(); -} // check for symbols (true, false, null) - - -function getTokenAlpha() { - if ((0, _stringUtils.isAlpha)(c)) { - tokenType = SYMBOL; - - while ((0, _stringUtils.isAlpha)(c) || (0, _stringUtils.isDigit)(c) || c === '$') { - token += c; - next(); - } - - return; - } - - getTokenWhitespace(); -} // get whitespaces: space, tab, newline, and carriage return - - -function getTokenWhitespace() { - if ((0, _stringUtils.isWhitespace)(c) || (0, _stringUtils.isSpecialWhitespace)(c)) { - tokenType = WHITESPACE; - - while ((0, _stringUtils.isWhitespace)(c) || (0, _stringUtils.isSpecialWhitespace)(c)) { - token += c; - next(); - } - - return; - } - - getTokenComment(); -} - -function getTokenComment() { - // find a block comment '/* ... */' - if (c === '/' && input[index + 1] === '*') { - tokenType = COMMENT; - - while (c !== '' && (c !== '*' || c === '*' && input[index + 1] !== '/')) { - token += c; - next(); - } - - if (c === '*' && input[index + 1] === '/') { - token += c; - next(); - token += c; - next(); - } - - return; - } // find a comment '// ...' - - - if (c === '/' && input[index + 1] === '/') { - tokenType = COMMENT; - - while (c !== '' && c !== '\n') { - token += c; - next(); - } - - return; - } - - getTokenUnknown(); -} // something unknown is found, wrong characters -> a syntax error - - -function getTokenUnknown() { - tokenType = UNKNOWN; - - while (c !== '') { - token += c; - next(); - } - - throw new _JsonRepairError.default('Syntax error in part "' + token + '"', index - token.length); -} -/** - * Parse an object like '{"key": "value"}' - * @return {*} - */ - - -function parseObject() { - if (tokenType === DELIMITER && token === '{') { - processNextToken(); // TODO: can we make this redundant? - - if (tokenType === DELIMITER && token === '}') { - // empty object - processNextToken(); - return; - } - - while (true) { - // parse key - if (tokenType === SYMBOL || tokenType === NUMBER) { - // unquoted key -> add quotes around it, change it into a string - tokenType = STRING; - token = "\"".concat(token, "\""); - } - - if (tokenType !== STRING) { - // TODO: handle ambiguous cases like '[{"a":1,{"b":2}]' which could be an array with two objects or one - throw new _JsonRepairError.default('Object key expected', index - token.length); - } - - processNextToken(); // parse colon (key/value separator) - - if (tokenType === DELIMITER && token === ':') { - processNextToken(); - } else { - if (tokenIsStartOfValue()) { - // we expect a colon here, but got the start of a value - // -> insert a colon before any inserted whitespaces at the end of output - output = (0, _stringUtils.insertBeforeLastWhitespace)(output, ':'); - } else { - throw new _JsonRepairError.default('Colon expected', index - token.length); - } - } // parse value - - - parseObject(); // parse comma (key/value pair separator) - - if (tokenType === DELIMITER && token === ',') { - processNextToken(); - - if (tokenType === DELIMITER && token === '}') { - // we've just passed a trailing comma -> remove the trailing comma - output = (0, _stringUtils.stripLastOccurrence)(output, ','); - break; - } - - if (token === '') { - // end of json reached, but missing } - // Strip the missing comma (the closing bracket will be added later) - output = (0, _stringUtils.stripLastOccurrence)(output, ','); - break; - } - } else { - if (tokenIsStartOfKey()) { - // we expect a comma here, but got the start of a new key - // -> insert a comma before any inserted whitespaces at the end of output - output = (0, _stringUtils.insertBeforeLastWhitespace)(output, ','); - } else { - break; - } - } - } - - if (tokenType === DELIMITER && token === '}') { - processNextToken(); - } else { - // missing end bracket -> insert the missing bracket - output = (0, _stringUtils.insertBeforeLastWhitespace)(output, '}'); - } - - return; - } - - parseArray(); -} -/** - * Parse an object like '["item1", "item2", ...]' - */ - - -function parseArray() { - if (tokenType === DELIMITER && token === '[') { - processNextToken(); - - if (tokenType === DELIMITER && token === ']') { - // empty array - processNextToken(); - return; - } - - while (true) { - // parse item - parseObject(); // parse comma (item separator) - - if (tokenType === DELIMITER && token === ',') { - processNextToken(); - - if (tokenType === DELIMITER && token === ']') { - // we've just passed a trailing comma -> remove the trailing comma - output = (0, _stringUtils.stripLastOccurrence)(output, ','); - break; - } - - if (token === '') { - // end of json reached, but missing ] - // Strip the missing comma (the closing bracket will be added later) - output = (0, _stringUtils.stripLastOccurrence)(output, ','); - break; - } - } else { - if (tokenIsStartOfValue()) { - // we expect a comma here, but got the start of a new item - // -> insert a comma before any inserted whitespaces at the end of output - output = (0, _stringUtils.insertBeforeLastWhitespace)(output, ','); - } else { - break; - } - } - } - - if (tokenType === DELIMITER && token === ']') { - processNextToken(); - } else { - // missing end bracket -> insert the missing bracket - output = (0, _stringUtils.insertBeforeLastWhitespace)(output, ']'); - } - - return; - } - - parseString(); -} -/** - * Parse a string enclosed by double quotes "...". Can contain escaped quotes - */ - - -function parseString() { - if (tokenType === STRING) { - processNextToken(); - - while (tokenType === DELIMITER && token === '+') { - // string concatenation like "hello" + "world" - token = ''; // don't output the concatenation - - processNextToken(); - - if (tokenType === STRING) { - // concatenate with the previous string - var endIndex = output.lastIndexOf('"'); - output = output.substring(0, endIndex) + token.substring(1); - token = ''; - processNextToken(); - } - } - - return; - } - - parseNumber(); -} -/** - * Parse a number - */ - - -function parseNumber() { - if (tokenType === NUMBER) { - processNextToken(); - return; - } - - parseSymbol(); -} -/** - * Parse constants true, false, null - */ - - -function parseSymbol() { - if (tokenType === SYMBOL) { - // a supported symbol: true, false, null - if (SYMBOLS[token]) { - processNextToken(); - return; - } // for example replace None with null - - - if (PYTHON_SYMBOLS[token]) { - token = PYTHON_SYMBOLS[token]; - processNextToken(); - return; - } // make a copy of the symbol, let's see what comes next - - - var symbol = token; - var symbolIndex = output.length; - token = ''; - processNextToken(); // if (tokenType === DELIMITER && token === '(') { - - if (tokenType === DELIMITER && token === '(') { - // a MongoDB function call or JSONP call - // Can be a MongoDB data type like in {"_id": ObjectId("123")} - // token = '' // do not output the function name - // processNextToken() - // next() - token = ''; // do not output the ( character - - processNextToken(); // process the part inside the brackets - - parseObject(); // skip the closing bracket ")" and ");" - - if (tokenType === DELIMITER && token === ')') { - token = ''; // do not output the ) character - - processNextToken(); - - if (tokenType === DELIMITER && token === ';') { - token = ''; // do not output the semicolon character - - processNextToken(); - } - } - - return; - } // unknown symbol => turn into in a string - // it is possible that by reading the next token we already inserted - // extra spaces in the output which should be inside the string, - // hence the symbolIndex - - - output = (0, _stringUtils.insertAtIndex)(output, "\"".concat(symbol), symbolIndex); - - while (tokenType === SYMBOL || tokenType === NUMBER) { - processNextToken(); - } - - output += '"'; - return; - } - - parseEnd(); -} -/** - * Evaluated when the expression is not yet ended but expected to end - */ - - -function parseEnd() { - if (token === '') { - // syntax error or unexpected end of expression - throw new _JsonRepairError.default('Unexpected end of json string', index - token.length); - } else { - throw new _JsonRepairError.default('Value expected', index - token.length); - } -} - - -/***/ }), - -/***/ 1536: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isAlpha = isAlpha; -exports.isHex = isHex; -exports.isDigit = isDigit; -exports.isWhitespace = isWhitespace; -exports.isSpecialWhitespace = isSpecialWhitespace; -exports.normalizeWhitespace = normalizeWhitespace; -exports.isQuote = isQuote; -exports.isSingleQuote = isSingleQuote; -exports.isDoubleQuote = isDoubleQuote; -exports.normalizeQuote = normalizeQuote; -exports.stripLastOccurrence = stripLastOccurrence; -exports.insertBeforeLastWhitespace = insertBeforeLastWhitespace; -exports.insertAtIndex = insertAtIndex; -var SINGLE_QUOTES = { - '\'': true, - // quote - "\u2018": true, - // quote left - "\u2019": true, - // quote right - "`": true, - // grave accent - "\xB4": true // acute accent - -}; -var DOUBLE_QUOTES = { - '"': true, - "\u201C": true, - // double quote left - "\u201D": true // double quote right - -}; -/** - * Check if the given character contains an alpha character, a-z, A-Z, _ - * @param {string} c - * @return {boolean} - */ - -function isAlpha(c) { - return ALPHA_REGEX.test(c); -} - -var ALPHA_REGEX = /^[a-zA-Z_]$/; -/** - * Check if the given character contains a hexadecimal character 0-9, a-f, A-F - * @param {string} c - * @return {boolean} - */ - -function isHex(c) { - return HEX_REGEX.test(c); -} - -var HEX_REGEX = /^[0-9a-fA-F]$/; -/** - * checks if the given char c is a digit - * @param {string} c - * @return {boolean} - */ - -function isDigit(c) { - return DIGIT_REGEX.test(c); -} - -var DIGIT_REGEX = /^[0-9]$/; -/** - * Check if the given character is a whitespace character like space, tab, or - * newline - * @param {string} c - * @return {boolean} - */ - -function isWhitespace(c) { - return c === ' ' || c === '\t' || c === '\n' || c === '\r'; -} -/** - * Check if the given character is a special whitespace character, some - * unicode variant - * @param {string} c - * @return {boolean} - */ - - -function isSpecialWhitespace(c) { - return c === "\xA0" || c >= "\u2000" && c <= "\u200A" || c === "\u202F" || c === "\u205F" || c === "\u3000"; -} -/** - * Replace speical whitespace characters with regular spaces - * @param {string} text - * @returns {string} - */ - - -function normalizeWhitespace(text) { - var normalized = ''; - - for (var i = 0; i < text.length; i++) { - var char = text[i]; - normalized += isSpecialWhitespace(char) ? ' ' : char; - } - - return normalized; -} -/** - * Test whether the given character is a quote or double quote character. - * Also tests for special variants of quotes. - * @param {string} c - * @returns {boolean} - */ - - -function isQuote(c) { - return SINGLE_QUOTES[c] === true || DOUBLE_QUOTES[c] === true; -} -/** - * Test whether the given character is a single quote character. - * Also tests for special variants of single quotes. - * @param {string} c - * @returns {boolean} - */ - - -function isSingleQuote(c) { - return SINGLE_QUOTES[c] === true; -} -/** - * Test whether the given character is a double quote character. - * Also tests for special variants of double quotes. - * @param {string} c - * @returns {boolean} - */ - - -function isDoubleQuote(c) { - return DOUBLE_QUOTES[c] === true; -} -/** - * Normalize special double or single quote characters to their regular - * variant ' or " - * @param {string} c - * @returns {string} - */ - - -function normalizeQuote(c) { - if (SINGLE_QUOTES[c] === true) { - return '\''; - } - - if (DOUBLE_QUOTES[c] === true) { - return '"'; - } - - return c; -} -/** - * Strip last occurrence of textToStrip from text - * @param {string} text - * @param {string} textToStrip - * @returns {string} - */ - - -function stripLastOccurrence(text, textToStrip) { - var index = text.lastIndexOf(textToStrip); - return index !== -1 ? text.substring(0, index) + text.substring(index + 1) : text; -} -/** - * Insert textToInsert into text before the last whitespace in text - * @param {string} text - * @param {string} textToInsert - * @returns {string} - */ - - -function insertBeforeLastWhitespace(text, textToInsert) { - var index = text.length; - - if (!isWhitespace(text[index - 1])) { - // no trailing whitespaces - return text + textToInsert; - } - - while (isWhitespace(text[index - 1])) { - index--; - } - - return text.substring(0, index) + textToInsert + text.substring(index); -} -/** - * Insert textToInsert at index in text - * @param {string} text - * @param {string} textToInsert - * @param {number} index - * @returns {string} - */ - - -function insertAtIndex(text, textToInsert, index) { - return text.substring(0, index) + textToInsert + text.substring(index); -} - - -/***/ }), - -/***/ 483: +/***/ 8340: /***/ (function(module, exports) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** @@ -50547,7 +51014,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ /***/ }), -/***/ 7533: +/***/ 6777: /***/ (function(__unused_webpack_module, exports) { /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ @@ -51995,20 +52462,20 @@ Object.defineProperty(exports, '__esModule', { value: true }); /***/ }), -/***/ 4049: +/***/ 7598: /***/ (function(module) { /*! - * vanilla-picker v2.11.2 + * vanilla-picker v2.12.3 * https://vanilla-picker.js.org * - * Copyright 2017-2021 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate) + * Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate) * Released under the ISC license. */ (function (global, factory) { true ? module.exports = factory() : 0; -}(this, (function () { 'use strict'; +})(this, (function () { 'use strict'; var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { @@ -52179,7 +52646,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); } }, { key: 'rgba', - get: function get$$1() { + get: function get() { if (this._rgba) { return this._rgba; } @@ -52189,7 +52656,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); return this._rgba = Color.hslToRgb(this._hsla); }, - set: function set$$1(rgb) { + set: function set(rgb) { if (rgb.length === 3) { rgb[3] = 1; } @@ -52199,17 +52666,17 @@ Object.defineProperty(exports, '__esModule', { value: true }); } }, { key: 'rgbString', - get: function get$$1() { + get: function get() { return this.printRGB(); } }, { key: 'rgbaString', - get: function get$$1() { + get: function get() { return this.printRGB(true); } }, { key: 'hsla', - get: function get$$1() { + get: function get() { if (this._hsla) { return this._hsla; } @@ -52219,7 +52686,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); return this._hsla = Color.rgbToHsl(this._rgba); }, - set: function set$$1(hsl) { + set: function set(hsl) { if (hsl.length === 3) { hsl[3] = 1; } @@ -52229,17 +52696,17 @@ Object.defineProperty(exports, '__esModule', { value: true }); } }, { key: 'hslString', - get: function get$$1() { + get: function get() { return this.printHSL(); } }, { key: 'hslaString', - get: function get$$1() { + get: function get() { return this.printHSL(true); } }, { key: 'hex', - get: function get$$1() { + get: function get() { var rgb = this.rgba, hex = rgb.map(function (x, i) { return i < 3 ? x.toString(16) : Math.round(x * 255).toString(16); @@ -52249,7 +52716,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); return x.padStart(2, '0'); }).join(''); }, - set: function set$$1(hex) { + set: function set(hex) { this.rgba = Color.hexToRgb(hex); } }], [{ @@ -52484,7 +52951,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); }); } - var BG_TRANSP = 'url("data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'2\' height=\'2\'%3E%3Cpath d=\'M1,0H0V1H2V2H1\' fill=\'lightgrey\'/%3E%3C/svg%3E")'; + var BG_TRANSP = 'linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em'; var HUES = 360; var EVENT_KEY = 'keydown', @@ -52511,10 +52978,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); }); } - var _style = document.createElement('style'); - _style.textContent = '.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-flow:row wrap;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:stretch;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:\'\';display:block;width:100%;height:0;-webkit-box-ordinal-group:2;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{-webkit-box-flex:1;flex:1 1 auto}.layout_default .picker_sl::before{content:\'\';display:block;padding-bottom:100%}.layout_default .picker_editor{-webkit-box-ordinal-group:2;order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{-webkit-box-ordinal-group:2;order:1;-webkit-box-flex:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{-webkit-box-ordinal-group:2;order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px dodgerblue}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:whitesmoke;background-image:-webkit-gradient(linear, left bottom, left top, from(gainsboro), to(transparent));background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:-webkit-gradient(linear, left bottom, left top, from(transparent), to(gainsboro));background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:white}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid white;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:-webkit-gradient(linear, left top, right top, from(red), color-stop(yellow), color-stop(lime), color-stop(cyan), color-stop(blue), color-stop(magenta), to(red));background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:-webkit-gradient(linear, left top, left bottom, from(white), color-stop(50%, rgba(255,255,255,0))),-webkit-gradient(linear, left bottom, left top, from(black), color-stop(50%, rgba(0,0,0,0))),-webkit-gradient(linear, left top, right top, from(gray), to(rgba(128,128,128,0)));background-image:linear-gradient(180deg, white, rgba(255,255,255,0) 50%),linear-gradient(0deg, black, rgba(0,0,0,0) 50%),linear-gradient(90deg, gray, rgba(128,128,128,0))}.picker_alpha,.picker_sample{position:relative;background:url("data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'2\' height=\'2\'%3E%3Cpath d=\'M1,0H0V1H2V2H1\' fill=\'lightgrey\'/%3E%3C/svg%3E") left top/contain white;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:\'\';position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,0.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}'; - document.documentElement.firstElementChild.appendChild(_style); - var Picker = function () { function Picker(options) { classCallCheck(this, Picker); @@ -52950,7 +53413,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); transp = opaque.replace('hsl', 'hsla').replace(')', ', 0)'), bg = 'linear-gradient(' + [opaque, transp] + ')'; - this._domA.style.backgroundImage = bg + ', ' + BG_TRANSP; + this._domA.style.background = bg + ', ' + BG_TRANSP; if (!flags.fromEditor) { var format = this.settings.editorFormat, @@ -52995,19 +53458,934 @@ Object.defineProperty(exports, '__esModule', { value: true }); } return toggle; } - }], [{ - key: 'StyleElement', - get: function get$$1() { - return _style; - } }]); return Picker; }(); + { + var style = document.createElement('style'); + style.textContent = '.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}'; + document.documentElement.firstElementChild.appendChild(style); + + Picker.StyleElement = style; + } + return Picker; -}))); +})); + + +/***/ }), + +/***/ 9857: +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + m: function() { return /* binding */ jsonrepair; } +}); + +;// ./node_modules/jsonrepair/lib/esm/utils/JSONRepairError.js +class JSONRepairError extends Error { + constructor(message, position) { + super(`${message} at position ${position}`); + this.position = position; + } +} + +;// ./node_modules/jsonrepair/lib/esm/utils/stringUtils.js +const codeBackslash = 0x5c; // "\" +const codeSlash = 0x2f; // "/" +const codeAsterisk = 0x2a; // "*" +const codeOpeningBrace = 0x7b; // "{" +const codeClosingBrace = 0x7d; // "}" +const codeOpeningBracket = 0x5b; // "[" +const codeClosingBracket = 0x5d; // "]" +const codeOpenParenthesis = 0x28; // "(" +const codeCloseParenthesis = 0x29; // ")" +const codeSpace = 0x20; // " " +const codeNewline = 0xa; // "\n" +const codeTab = 0x9; // "\t" +const codeReturn = 0xd; // "\r" +const codeBackspace = 0x08; // "\b" +const codeFormFeed = 0x0c; // "\f" +const codeDoubleQuote = 0x0022; // " +const codePlus = 0x2b; // "+" +const codeMinus = 0x2d; // "-" +const codeQuote = 0x27; // "'" +const codeZero = 0x30; // "0" +const codeNine = 0x39; // "9" +const codeComma = 0x2c; // "," +const codeDot = 0x2e; // "." (dot, period) +const codeColon = 0x3a; // ":" +const codeSemicolon = 0x3b; // ";" +const codeUppercaseA = 0x41; // "A" +const codeLowercaseA = 0x61; // "a" +const codeUppercaseE = 0x45; // "E" +const codeLowercaseE = 0x65; // "e" +const codeUppercaseF = 0x46; // "F" +const codeLowercaseF = 0x66; // "f" +const codeNonBreakingSpace = 0xa0; +const codeEnQuad = 0x2000; +const codeHairSpace = 0x200a; +const codeNarrowNoBreakSpace = 0x202f; +const codeMediumMathematicalSpace = 0x205f; +const codeIdeographicSpace = 0x3000; +const codeDoubleQuoteLeft = 0x201c; // “ +const codeDoubleQuoteRight = 0x201d; // ” +const codeQuoteLeft = 0x2018; // ‘ +const codeQuoteRight = 0x2019; // ’ +const codeGraveAccent = 0x0060; // ` +const codeAcuteAccent = 0x00b4; // ´ + +function isHex(code) { + return code >= codeZero && code <= codeNine || code >= codeUppercaseA && code <= codeUppercaseF || code >= codeLowercaseA && code <= codeLowercaseF; +} +function isDigit(code) { + return code >= codeZero && code <= codeNine; +} +function isValidStringCharacter(code) { + return code >= 0x20 && code <= 0x10ffff; +} +function isDelimiter(char) { + return regexDelimiter.test(char); +} +const regexDelimiter = /^[,:[\]/{}()\n+]$/; +const regexUnquotedStringDelimiter = /^[,[\]/{}\n+]$/; +const regexFunctionNameCharStart = /^[a-zA-Z_$]$/; +const regexFunctionNameChar = /^[a-zA-Z_$0-9]$/; + +// matches "https://" and other schemas +const regexUrlStart = /^(http|https|ftp|mailto|file|data|irc):\/\/$/; + +// matches all valid URL characters EXCEPT "[", "]", and ",", since that are important JSON delimiters +const regexUrlChar = /^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/; +function isUnquotedStringDelimiter(char) { + return regexUnquotedStringDelimiter.test(char); +} +function isStartOfValue(char) { + return regexStartOfValue.test(char) || char && isQuote(char.charCodeAt(0)); +} + +// alpha, number, minus, or opening bracket or brace +const regexStartOfValue = /^[[{\w-]$/; +function isControlCharacter(code) { + return code === codeNewline || code === codeReturn || code === codeTab || code === codeBackspace || code === codeFormFeed; +} + +/** + * Check if the given character is a whitespace character like space, tab, or + * newline + */ +function isWhitespace(code) { + return code === codeSpace || code === codeNewline || code === codeTab || code === codeReturn; +} + +/** + * Check if the given character is a special whitespace character, some + * unicode variant + */ +function isSpecialWhitespace(code) { + return code === codeNonBreakingSpace || code >= codeEnQuad && code <= codeHairSpace || code === codeNarrowNoBreakSpace || code === codeMediumMathematicalSpace || code === codeIdeographicSpace; +} + +/** + * Test whether the given character is a quote or double quote character. + * Also tests for special variants of quotes. + */ +function isQuote(code) { + // the first check double quotes, since that occurs most often + return isDoubleQuoteLike(code) || isSingleQuoteLike(code); +} + +/** + * Test whether the given character is a double quote character. + * Also tests for special variants of double quotes. + */ +function isDoubleQuoteLike(code) { + // the first check double quotes, since that occurs most often + return code === codeDoubleQuote || code === codeDoubleQuoteLeft || code === codeDoubleQuoteRight; +} + +/** + * Test whether the given character is a double quote character. + * Does NOT test for special variants of double quotes. + */ +function isDoubleQuote(code) { + return code === codeDoubleQuote; +} + +/** + * Test whether the given character is a single quote character. + * Also tests for special variants of single quotes. + */ +function isSingleQuoteLike(code) { + return code === codeQuote || code === codeQuoteLeft || code === codeQuoteRight || code === codeGraveAccent || code === codeAcuteAccent; +} + +/** + * Test whether the given character is a single quote character. + * Does NOT test for special variants of single quotes. + */ +function isSingleQuote(code) { + return code === codeQuote; +} + +/** + * Strip last occurrence of textToStrip from text + */ +function stripLastOccurrence(text, textToStrip) { + let stripRemainingText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + const index = text.lastIndexOf(textToStrip); + return index !== -1 ? text.substring(0, index) + (stripRemainingText ? '' : text.substring(index + 1)) : text; +} +function insertBeforeLastWhitespace(text, textToInsert) { + let index = text.length; + if (!isWhitespace(text.charCodeAt(index - 1))) { + // no trailing whitespaces + return text + textToInsert; + } + while (isWhitespace(text.charCodeAt(index - 1))) { + index--; + } + return text.substring(0, index) + textToInsert + text.substring(index); +} +function removeAtIndex(text, start, count) { + return text.substring(0, start) + text.substring(start + count); +} + +/** + * Test whether a string ends with a newline or comma character and optional whitespace + */ +function endsWithCommaOrNewline(text) { + return /[,\n][ \t\r]*$/.test(text); +} + +;// ./node_modules/jsonrepair/lib/esm/regular/jsonrepair.js + + +const controlCharacters = { + '\b': '\\b', + '\f': '\\f', + '\n': '\\n', + '\r': '\\r', + '\t': '\\t' +}; + +// map with all escape characters +const escapeCharacters = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + // note that \u is handled separately in parseString() +}; + +/** + * Repair a string containing an invalid JSON document. + * For example changes JavaScript notation into JSON notation. + * + * Example: + * + * try { + * const json = "{name: 'John'}" + * const repaired = jsonrepair(json) + * console.log(repaired) + * // '{"name": "John"}' + * } catch (err) { + * console.error(err) + * } + * + */ +function jsonrepair(text) { + let i = 0; // current index in text + let output = ''; // generated output + + const processed = parseValue(); + if (!processed) { + throwUnexpectedEnd(); + } + const processedComma = parseCharacter(codeComma); + if (processedComma) { + parseWhitespaceAndSkipComments(); + } + if (isStartOfValue(text[i]) && endsWithCommaOrNewline(output)) { + // start of a new value after end of the root level object: looks like + // newline delimited JSON -> turn into a root level array + if (!processedComma) { + // repair missing comma + output = insertBeforeLastWhitespace(output, ','); + } + parseNewlineDelimitedJSON(); + } else if (processedComma) { + // repair: remove trailing comma + output = stripLastOccurrence(output, ','); + } + + // repair redundant end quotes + while (text.charCodeAt(i) === codeClosingBrace || text.charCodeAt(i) === codeClosingBracket) { + i++; + parseWhitespaceAndSkipComments(); + } + if (i >= text.length) { + // reached the end of the document properly + return output; + } + throwUnexpectedCharacter(); + function parseValue() { + parseWhitespaceAndSkipComments(); + const processed = parseObject() || parseArray() || parseString() || parseNumber() || parseKeywords() || parseUnquotedString(false) || parseRegex(); + parseWhitespaceAndSkipComments(); + return processed; + } + function parseWhitespaceAndSkipComments() { + const start = i; + let changed = parseWhitespace(); + do { + changed = parseComment(); + if (changed) { + changed = parseWhitespace(); + } + } while (changed); + return i > start; + } + function parseWhitespace() { + let whitespace = ''; + let normal; + // biome-ignore lint/suspicious/noAssignInExpressions: + while ((normal = isWhitespace(text.charCodeAt(i))) || isSpecialWhitespace(text.charCodeAt(i))) { + if (normal) { + whitespace += text[i]; + } else { + // repair special whitespace + whitespace += ' '; + } + i++; + } + if (whitespace.length > 0) { + output += whitespace; + return true; + } + return false; + } + function parseComment() { + // find a block comment '/* ... */' + if (text.charCodeAt(i) === codeSlash && text.charCodeAt(i + 1) === codeAsterisk) { + // repair block comment by skipping it + while (i < text.length && !atEndOfBlockComment(text, i)) { + i++; + } + i += 2; + return true; + } + + // find a line comment '// ...' + if (text.charCodeAt(i) === codeSlash && text.charCodeAt(i + 1) === codeSlash) { + // repair line comment by skipping it + while (i < text.length && text.charCodeAt(i) !== codeNewline) { + i++; + } + return true; + } + return false; + } + function parseCharacter(code) { + if (text.charCodeAt(i) === code) { + output += text[i]; + i++; + return true; + } + return false; + } + function skipCharacter(code) { + if (text.charCodeAt(i) === code) { + i++; + return true; + } + return false; + } + function skipEscapeCharacter() { + return skipCharacter(codeBackslash); + } + + /** + * Skip ellipsis like "[1,2,3,...]" or "[1,2,3,...,9]" or "[...,7,8,9]" + * or a similar construct in objects. + */ + function skipEllipsis() { + parseWhitespaceAndSkipComments(); + if (text.charCodeAt(i) === codeDot && text.charCodeAt(i + 1) === codeDot && text.charCodeAt(i + 2) === codeDot) { + // repair: remove the ellipsis (three dots) and optionally a comma + i += 3; + parseWhitespaceAndSkipComments(); + skipCharacter(codeComma); + return true; + } + return false; + } + + /** + * Parse an object like '{"key": "value"}' + */ + function parseObject() { + if (text.charCodeAt(i) === codeOpeningBrace) { + output += '{'; + i++; + parseWhitespaceAndSkipComments(); + + // repair: skip leading comma like in {, message: "hi"} + if (skipCharacter(codeComma)) { + parseWhitespaceAndSkipComments(); + } + let initial = true; + while (i < text.length && text.charCodeAt(i) !== codeClosingBrace) { + let processedComma; + if (!initial) { + processedComma = parseCharacter(codeComma); + if (!processedComma) { + // repair missing comma + output = insertBeforeLastWhitespace(output, ','); + } + parseWhitespaceAndSkipComments(); + } else { + processedComma = true; + initial = false; + } + skipEllipsis(); + const processedKey = parseString() || parseUnquotedString(true); + if (!processedKey) { + if (text.charCodeAt(i) === codeClosingBrace || text.charCodeAt(i) === codeOpeningBrace || text.charCodeAt(i) === codeClosingBracket || text.charCodeAt(i) === codeOpeningBracket || text[i] === undefined) { + // repair trailing comma + output = stripLastOccurrence(output, ','); + } else { + throwObjectKeyExpected(); + } + break; + } + parseWhitespaceAndSkipComments(); + const processedColon = parseCharacter(codeColon); + const truncatedText = i >= text.length; + if (!processedColon) { + if (isStartOfValue(text[i]) || truncatedText) { + // repair missing colon + output = insertBeforeLastWhitespace(output, ':'); + } else { + throwColonExpected(); + } + } + const processedValue = parseValue(); + if (!processedValue) { + if (processedColon || truncatedText) { + // repair missing object value + output += 'null'; + } else { + throwColonExpected(); + } + } + } + if (text.charCodeAt(i) === codeClosingBrace) { + output += '}'; + i++; + } else { + // repair missing end bracket + output = insertBeforeLastWhitespace(output, '}'); + } + return true; + } + return false; + } + + /** + * Parse an array like '["item1", "item2", ...]' + */ + function parseArray() { + if (text.charCodeAt(i) === codeOpeningBracket) { + output += '['; + i++; + parseWhitespaceAndSkipComments(); + + // repair: skip leading comma like in [,1,2,3] + if (skipCharacter(codeComma)) { + parseWhitespaceAndSkipComments(); + } + let initial = true; + while (i < text.length && text.charCodeAt(i) !== codeClosingBracket) { + if (!initial) { + const processedComma = parseCharacter(codeComma); + if (!processedComma) { + // repair missing comma + output = insertBeforeLastWhitespace(output, ','); + } + } else { + initial = false; + } + skipEllipsis(); + const processedValue = parseValue(); + if (!processedValue) { + // repair trailing comma + output = stripLastOccurrence(output, ','); + break; + } + } + if (text.charCodeAt(i) === codeClosingBracket) { + output += ']'; + i++; + } else { + // repair missing closing array bracket + output = insertBeforeLastWhitespace(output, ']'); + } + return true; + } + return false; + } + + /** + * Parse and repair Newline Delimited JSON (NDJSON): + * multiple JSON objects separated by a newline character + */ + function parseNewlineDelimitedJSON() { + // repair NDJSON + let initial = true; + let processedValue = true; + while (processedValue) { + if (!initial) { + // parse optional comma, insert when missing + const processedComma = parseCharacter(codeComma); + if (!processedComma) { + // repair: add missing comma + output = insertBeforeLastWhitespace(output, ','); + } + } else { + initial = false; + } + processedValue = parseValue(); + } + if (!processedValue) { + // repair: remove trailing comma + output = stripLastOccurrence(output, ','); + } + + // repair: wrap the output inside array brackets + output = `[\n${output}\n]`; + } + + /** + * Parse a string enclosed by double quotes "...". Can contain escaped quotes + * Repair strings enclosed in single quotes or special quotes + * Repair an escaped string + * + * The function can run in two stages: + * - First, it assumes the string has a valid end quote + * - If it turns out that the string does not have a valid end quote followed + * by a delimiter (which should be the case), the function runs again in a + * more conservative way, stopping the string at the first next delimiter + * and fixing the string by inserting a quote there. + */ + function parseString() { + let stopAtDelimiter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + let skipEscapeChars = text.charCodeAt(i) === codeBackslash; + if (skipEscapeChars) { + // repair: remove the first escape character + i++; + skipEscapeChars = true; + } + if (isQuote(text.charCodeAt(i))) { + // double quotes are correct JSON, + // single quotes come from JavaScript for example, we assume it will have a correct single end quote too + // otherwise, we will match any double-quote-like start with a double-quote-like end, + // or any single-quote-like start with a single-quote-like end + const isEndQuote = isDoubleQuote(text.charCodeAt(i)) ? isDoubleQuote : isSingleQuote(text.charCodeAt(i)) ? isSingleQuote : isSingleQuoteLike(text.charCodeAt(i)) ? isSingleQuoteLike : isDoubleQuoteLike; + const iBefore = i; + const oBefore = output.length; + let str = '"'; + i++; + while (true) { + if (i >= text.length) { + // end of text, we are missing an end quote + + const iPrev = prevNonWhitespaceIndex(i - 1); + if (!stopAtDelimiter && isDelimiter(text.charAt(iPrev))) { + // if the text ends with a delimiter, like ["hello], + // so the missing end quote should be inserted before this delimiter + // retry parsing the string, stopping at the first next delimiter + i = iBefore; + output = output.substring(0, oBefore); + return parseString(true); + } + + // repair missing quote + str = insertBeforeLastWhitespace(str, '"'); + output += str; + return true; + // biome-ignore lint/style/noUselessElse: + } else if (isEndQuote(text.charCodeAt(i))) { + // end quote + // let us check what is before and after the quote to verify whether this is a legit end quote + const iQuote = i; + const oQuote = str.length; + str += '"'; + i++; + output += str; + parseWhitespaceAndSkipComments(); + if (stopAtDelimiter || i >= text.length || isDelimiter(text.charAt(i)) || isQuote(text.charCodeAt(i)) || isDigit(text.charCodeAt(i))) { + // The quote is followed by the end of the text, a delimiter, or a next value + // so the quote is indeed the end of the string + parseConcatenatedString(); + return true; + } + if (isDelimiter(text.charAt(prevNonWhitespaceIndex(iQuote - 1)))) { + // This is not the right end quote: it is preceded by a delimiter, + // and NOT followed by a delimiter. So, there is an end quote missing + // parse the string again and then stop at the first next delimiter + i = iBefore; + output = output.substring(0, oBefore); + return parseString(true); + } + + // revert to right after the quote but before any whitespace, and continue parsing the string + output = output.substring(0, oBefore); + i = iQuote + 1; + + // repair unescaped quote + str = `${str.substring(0, oQuote)}\\${str.substring(oQuote)}`; + } else if (stopAtDelimiter && isUnquotedStringDelimiter(text[i])) { + // we're in the mode to stop the string at the first delimiter + // because there is an end quote missing + + // test start of an url like "https://..." (this would be parsed as a comment) + if (text.charCodeAt(i - 1) === codeColon && regexUrlStart.test(text.substring(iBefore + 1, i + 2))) { + while (i < text.length && regexUrlChar.test(text[i])) { + str += text[i]; + i++; + } + } + + // repair missing quote + str = insertBeforeLastWhitespace(str, '"'); + output += str; + parseConcatenatedString(); + return true; + } else if (text.charCodeAt(i) === codeBackslash) { + // handle escaped content like \n or \u2605 + const char = text.charAt(i + 1); + const escapeChar = escapeCharacters[char]; + if (escapeChar !== undefined) { + str += text.slice(i, i + 2); + i += 2; + } else if (char === 'u') { + let j = 2; + while (j < 6 && isHex(text.charCodeAt(i + j))) { + j++; + } + if (j === 6) { + str += text.slice(i, i + 6); + i += 6; + } else if (i + j >= text.length) { + // repair invalid or truncated unicode char at the end of the text + // by removing the unicode char and ending the string here + i = text.length; + } else { + throwInvalidUnicodeCharacter(); + } + } else { + // repair invalid escape character: remove it + str += char; + i += 2; + } + } else { + // handle regular characters + const char = text.charAt(i); + const code = text.charCodeAt(i); + if (code === codeDoubleQuote && text.charCodeAt(i - 1) !== codeBackslash) { + // repair unescaped double quote + str += `\\${char}`; + i++; + } else if (isControlCharacter(code)) { + // unescaped control character + str += controlCharacters[char]; + i++; + } else { + if (!isValidStringCharacter(code)) { + throwInvalidCharacter(char); + } + str += char; + i++; + } + } + if (skipEscapeChars) { + // repair: skipped escape character (nothing to do) + skipEscapeCharacter(); + } + } + } + return false; + } + + /** + * Repair concatenated strings like "hello" + "world", change this into "helloworld" + */ + function parseConcatenatedString() { + let processed = false; + parseWhitespaceAndSkipComments(); + while (text.charCodeAt(i) === codePlus) { + processed = true; + i++; + parseWhitespaceAndSkipComments(); + + // repair: remove the end quote of the first string + output = stripLastOccurrence(output, '"', true); + const start = output.length; + const parsedStr = parseString(); + if (parsedStr) { + // repair: remove the start quote of the second string + output = removeAtIndex(output, start, 1); + } else { + // repair: remove the + because it is not followed by a string + output = insertBeforeLastWhitespace(output, '"'); + } + } + return processed; + } + + /** + * Parse a number like 2.4 or 2.4e6 + */ + function parseNumber() { + const start = i; + if (text.charCodeAt(i) === codeMinus) { + i++; + if (atEndOfNumber()) { + repairNumberEndingWithNumericSymbol(start); + return true; + } + if (!isDigit(text.charCodeAt(i))) { + i = start; + return false; + } + } + + // Note that in JSON leading zeros like "00789" are not allowed. + // We will allow all leading zeros here though and at the end of parseNumber + // check against trailing zeros and repair that if needed. + // Leading zeros can have meaning, so we should not clear them. + while (isDigit(text.charCodeAt(i))) { + i++; + } + if (text.charCodeAt(i) === codeDot) { + i++; + if (atEndOfNumber()) { + repairNumberEndingWithNumericSymbol(start); + return true; + } + if (!isDigit(text.charCodeAt(i))) { + i = start; + return false; + } + while (isDigit(text.charCodeAt(i))) { + i++; + } + } + if (text.charCodeAt(i) === codeLowercaseE || text.charCodeAt(i) === codeUppercaseE) { + i++; + if (text.charCodeAt(i) === codeMinus || text.charCodeAt(i) === codePlus) { + i++; + } + if (atEndOfNumber()) { + repairNumberEndingWithNumericSymbol(start); + return true; + } + if (!isDigit(text.charCodeAt(i))) { + i = start; + return false; + } + while (isDigit(text.charCodeAt(i))) { + i++; + } + } + + // if we're not at the end of the number by this point, allow this to be parsed as another type + if (!atEndOfNumber()) { + i = start; + return false; + } + if (i > start) { + // repair a number with leading zeros like "00789" + const num = text.slice(start, i); + const hasInvalidLeadingZero = /^0\d/.test(num); + output += hasInvalidLeadingZero ? `"${num}"` : num; + return true; + } + return false; + } + + /** + * Parse keywords true, false, null + * Repair Python keywords True, False, None + */ + function parseKeywords() { + return parseKeyword('true', 'true') || parseKeyword('false', 'false') || parseKeyword('null', 'null') || + // repair Python keywords True, False, None + parseKeyword('True', 'true') || parseKeyword('False', 'false') || parseKeyword('None', 'null'); + } + function parseKeyword(name, value) { + if (text.slice(i, i + name.length) === name) { + output += value; + i += name.length; + return true; + } + return false; + } + /** + * Repair an unquoted string by adding quotes around it + * Repair a MongoDB function call like NumberLong("2") + * Repair a JSONP function call like callback({...}); + */ + function parseUnquotedString(isKey) { + // note that the symbol can end with whitespaces: we stop at the next delimiter + // also, note that we allow strings to contain a slash / in order to support repairing regular expressions + const start = i; + if (regexFunctionNameCharStart.test(text[i])) { + while (i < text.length && regexFunctionNameChar.test(text[i])) { + i++; + } + let j = i; + while (isWhitespace(text.charCodeAt(j))) { + j++; + } + if (text[j] === '(') { + // repair a MongoDB function call like NumberLong("2") + // repair a JSONP function call like callback({...}); + i = j + 1; + parseValue(); + if (text.charCodeAt(i) === codeCloseParenthesis) { + // repair: skip close bracket of function call + i++; + if (text.charCodeAt(i) === codeSemicolon) { + // repair: skip semicolon after JSONP call + i++; + } + } + return true; + } + } + while (i < text.length && !isUnquotedStringDelimiter(text[i]) && !isQuote(text.charCodeAt(i)) && (!isKey || text.charCodeAt(i) !== codeColon)) { + i++; + } + + // test start of an url like "https://..." (this would be parsed as a comment) + if (text.charCodeAt(i - 1) === codeColon && regexUrlStart.test(text.substring(start, i + 2))) { + while (i < text.length && regexUrlChar.test(text[i])) { + i++; + } + } + if (i > start) { + // repair unquoted string + // also, repair undefined into null + + // first, go back to prevent getting trailing whitespaces in the string + while (isWhitespace(text.charCodeAt(i - 1)) && i > 0) { + i--; + } + const symbol = text.slice(start, i); + output += symbol === 'undefined' ? 'null' : JSON.stringify(symbol); + if (text.charCodeAt(i) === codeDoubleQuote) { + // we had a missing start quote, but now we encountered the end quote, so we can skip that one + i++; + } + return true; + } + } + function parseRegex() { + if (text[i] === '/') { + const start = i; + i++; + while (i < text.length && (text[i] !== '/' || text[i - 1] === '\\')) { + i++; + } + i++; + output += `"${text.substring(start, i)}"`; + return true; + } + } + function prevNonWhitespaceIndex(start) { + let prev = start; + while (prev > 0 && isWhitespace(text.charCodeAt(prev))) { + prev--; + } + return prev; + } + function atEndOfNumber() { + return i >= text.length || isDelimiter(text[i]) || isWhitespace(text.charCodeAt(i)); + } + function repairNumberEndingWithNumericSymbol(start) { + // repair numbers cut off at the end + // this will only be called when we end after a '.', '-', or 'e' and does not + // change the number more than it needs to make it valid JSON + output += `${text.slice(start, i)}0`; + } + function throwInvalidCharacter(char) { + throw new JSONRepairError(`Invalid character ${JSON.stringify(char)}`, i); + } + function throwUnexpectedCharacter() { + throw new JSONRepairError(`Unexpected character ${JSON.stringify(text[i])}`, i); + } + function throwUnexpectedEnd() { + throw new JSONRepairError('Unexpected end of json string', text.length); + } + function throwObjectKeyExpected() { + throw new JSONRepairError('Object key expected', i); + } + function throwColonExpected() { + throw new JSONRepairError('Colon expected', i); + } + function throwInvalidUnicodeCharacter() { + const chars = text.slice(i, i + 6); + throw new JSONRepairError(`Invalid unicode character "${chars}"`, i); + } +} +function atEndOfBlockComment(text, i) { + return text[i] === '*' && text[i + 1] === '/'; +} + + +/***/ }), + +/***/ 3420: +/***/ (function(module) { + +"use strict"; +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}'); + +/***/ }), + +/***/ 5207: +/***/ (function(module) { + +"use strict"; +module.exports = /*#__PURE__*/JSON.parse('{"id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-04/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string"},"$schema":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"multipleOf":{"type":"number","minimum":0,"exclusiveMinimum":true},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"dependencies":{"exclusiveMaximum":["maximum"],"exclusiveMinimum":["minimum"]},"default":{}}'); + +/***/ }), + +/***/ 6801: +/***/ (function(module) { + +"use strict"; +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}'); + +/***/ }), + +/***/ 8198: +/***/ (function(module) { + +"use strict"; +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}'); /***/ }) @@ -53102,7 +54480,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __webpack_require__(3161); +/******/ var __webpack_exports__ = __webpack_require__(1346); /******/ /******/ return __webpack_exports__; /******/ })() diff --git a/app/grandchallenge/core/static/vendored/jsoneditor/jsoneditor.min.css b/app/grandchallenge/core/static/vendored/jsoneditor/jsoneditor.min.css index 281fe63d92..72101fd60b 100644 --- a/app/grandchallenge/core/static/vendored/jsoneditor/jsoneditor.min.css +++ b/app/grandchallenge/core/static/vendored/jsoneditor/jsoneditor.min.css @@ -1,6 +1,6 @@ -.jsoneditor input,.jsoneditor input:not([type]),.jsoneditor input[type=search],.jsoneditor input[type=text],.jsoneditor-modal input,.jsoneditor-modal input:not([type]),.jsoneditor-modal input[type=search],.jsoneditor-modal input[type=text]{height:auto;border:inherit;box-shadow:none;font-size:inherit;box-sizing:inherit;padding:inherit;font-family:inherit;transition:none;line-height:inherit}.jsoneditor input:focus,.jsoneditor input:not([type]):focus,.jsoneditor input[type=search]:focus,.jsoneditor input[type=text]:focus,.jsoneditor-modal input:focus,.jsoneditor-modal input:not([type]):focus,.jsoneditor-modal input[type=search]:focus,.jsoneditor-modal input[type=text]:focus{border:inherit;box-shadow:inherit}.jsoneditor textarea,.jsoneditor-modal textarea{height:inherit}.jsoneditor select,.jsoneditor-modal select{display:inherit;height:inherit}.jsoneditor label,.jsoneditor-modal label{font-size:inherit;font-weight:inherit;color:inherit}.jsoneditor table,.jsoneditor-modal table{border-collapse:collapse;width:auto}.jsoneditor td,.jsoneditor th,.jsoneditor-modal td,.jsoneditor-modal th{padding:0;display:table-cell;text-align:left;vertical-align:inherit;border-radius:inherit}.jsoneditor .autocomplete.dropdown{position:absolute;background:#fff;box-shadow:2px 2px 12px rgba(128,128,128,.3);border:1px solid #d3d3d3;overflow-x:hidden;overflow-y:auto;cursor:default;margin:0;padding:5px;text-align:left;outline:0;font-family:"dejavu sans mono","droid sans mono",consolas,monaco,"lucida console","courier new",courier,monospace,sans-serif;font-size:10pt}.jsoneditor .autocomplete.dropdown .item{color:#1a1a1a}.jsoneditor .autocomplete.dropdown .item.hover{background-color:#ebebeb}.jsoneditor .autocomplete.hint{color:#a1a1a1;top:4px;left:4px}.jsoneditor-contextmenu-root{position:relative;width:0;height:0}.jsoneditor-contextmenu{position:absolute;box-sizing:content-box;z-index:2}.jsoneditor-contextmenu .jsoneditor-menu{position:relative;left:0;top:0;width:128px;height:auto;background:#fff;border:1px solid #d3d3d3;box-shadow:2px 2px 12px rgba(128,128,128,.3);list-style:none;margin:0;padding:0}.jsoneditor-contextmenu .jsoneditor-menu button{position:relative;padding:0 8px 0 0;margin:0;width:128px;height:auto;border:none;cursor:pointer;color:#4d4d4d;background:0 0;font-size:10pt;font-family:arial,sans-serif;box-sizing:border-box;text-align:left}.jsoneditor-contextmenu .jsoneditor-menu button::-moz-focus-inner{padding:0;border:0}.jsoneditor-contextmenu .jsoneditor-menu button.jsoneditor-default{width:96px}.jsoneditor-contextmenu .jsoneditor-menu button.jsoneditor-expand{float:right;width:32px;height:24px;border-left:1px solid #e5e5e5}.jsoneditor-contextmenu .jsoneditor-menu li{overflow:hidden}.jsoneditor-contextmenu .jsoneditor-menu li ul{display:none;position:relative;left:-10px;top:0;border:none;box-shadow:inset 0 0 10px rgba(128,128,128,.5);padding:0 10px;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out}.jsoneditor-contextmenu .jsoneditor-menu li ul .jsoneditor-icon{margin-left:24px}.jsoneditor-contextmenu .jsoneditor-menu li ul li button{padding-left:24px;animation:all ease-in-out 1s}.jsoneditor-contextmenu .jsoneditor-menu li button .jsoneditor-expand{position:absolute;top:0;right:0;width:24px;height:24px;padding:0;margin:0 4px 0 0;background-image:url(./img/jsoneditor-icons.svg);background-position:0 -72px}.jsoneditor-contextmenu .jsoneditor-icon{position:absolute;top:0;left:0;width:24px;height:24px;border:none;padding:0;margin:0;background-image:url(./img/jsoneditor-icons.svg)}.jsoneditor-contextmenu .jsoneditor-text{padding:4px 0 4px 24px;word-wrap:break-word}.jsoneditor-contextmenu .jsoneditor-text.jsoneditor-right-margin{padding-right:24px}.jsoneditor-contextmenu .jsoneditor-separator{height:0;border-top:1px solid #e5e5e5;padding-top:5px;margin-top:5px}.jsoneditor-contextmenu button.jsoneditor-remove .jsoneditor-icon{background-position:-24px 0}.jsoneditor-contextmenu button.jsoneditor-append .jsoneditor-icon{background-position:0 0}.jsoneditor-contextmenu button.jsoneditor-insert .jsoneditor-icon{background-position:0 0}.jsoneditor-contextmenu button.jsoneditor-duplicate .jsoneditor-icon{background-position:-48px 0}.jsoneditor-contextmenu button.jsoneditor-sort-asc .jsoneditor-icon{background-position:-168px 0}.jsoneditor-contextmenu button.jsoneditor-sort-desc .jsoneditor-icon{background-position:-192px 0}.jsoneditor-contextmenu button.jsoneditor-transform .jsoneditor-icon{background-position:-216px 0}.jsoneditor-contextmenu button.jsoneditor-extract .jsoneditor-icon{background-position:0 -24px}.jsoneditor-contextmenu button.jsoneditor-type-string .jsoneditor-icon{background-position:-144px 0}.jsoneditor-contextmenu button.jsoneditor-type-auto .jsoneditor-icon{background-position:-120px 0}.jsoneditor-contextmenu button.jsoneditor-type-object .jsoneditor-icon{background-position:-72px 0}.jsoneditor-contextmenu button.jsoneditor-type-array .jsoneditor-icon{background-position:-96px 0}.jsoneditor-contextmenu button.jsoneditor-type-modes .jsoneditor-icon{background-image:none;width:6px}.jsoneditor-contextmenu li,.jsoneditor-contextmenu ul{box-sizing:content-box;position:relative}.jsoneditor-contextmenu .jsoneditor-menu button:focus,.jsoneditor-contextmenu .jsoneditor-menu button:hover{color:#1a1a1a;background-color:#f5f5f5;outline:0}.jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected,.jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected:focus,.jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected:hover{color:#fff;background-color:#ee422e}.jsoneditor-contextmenu .jsoneditor-menu li ul li button:focus,.jsoneditor-contextmenu .jsoneditor-menu li ul li button:hover{background-color:#f5f5f5}.jsoneditor-modal{max-width:95%;border-radius:2px!important;padding:45px 15px 15px 15px!important;box-shadow:2px 2px 12px rgba(128,128,128,.3);color:#4d4d4d;line-height:1.3em}.jsoneditor-modal.jsoneditor-modal-transform{width:600px!important}.jsoneditor-modal .pico-modal-header{position:absolute;box-sizing:border-box;top:0;left:0;width:100%;padding:0 10px;height:30px;line-height:30px;font-family:arial,sans-serif;font-size:11pt;background:#3883fa;color:#fff}.jsoneditor-modal table{width:100%}.jsoneditor-modal table td{padding:3px 0}.jsoneditor-modal table td.jsoneditor-modal-input{text-align:right;padding-right:0;white-space:nowrap}.jsoneditor-modal table td.jsoneditor-modal-actions{padding-top:15px}.jsoneditor-modal table th{vertical-align:middle}.jsoneditor-modal p:first-child{margin-top:0}.jsoneditor-modal a{color:#3883fa}.jsoneditor-modal .jsoneditor-jmespath-block{margin-bottom:10px}.jsoneditor-modal .pico-close{background:0 0!important;font-size:24px!important;top:7px!important;right:7px!important;color:#fff}.jsoneditor-modal input{padding:4px}.jsoneditor-modal input[type=text]{cursor:inherit}.jsoneditor-modal input[disabled]{background:#d3d3d3;color:grey}.jsoneditor-modal .jsoneditor-select-wrapper{position:relative;display:inline-block}.jsoneditor-modal .jsoneditor-select-wrapper:after{content:"";width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid #666;position:absolute;right:8px;top:14px;pointer-events:none}.jsoneditor-modal select{padding:3px 24px 3px 10px;min-width:180px;max-width:350px;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-indent:0;text-overflow:"";font-size:10pt;line-height:1.5em}.jsoneditor-modal select::-ms-expand{display:none}.jsoneditor-modal .jsoneditor-button-group input{padding:4px 10px;margin:0;border-radius:0;border-left-style:none}.jsoneditor-modal .jsoneditor-button-group input.jsoneditor-button-first{border-top-left-radius:3px;border-bottom-left-radius:3px;border-left-style:solid}.jsoneditor-modal .jsoneditor-button-group input.jsoneditor-button-last{border-top-right-radius:3px;border-bottom-right-radius:3px}.jsoneditor-modal .jsoneditor-transform-preview{background:#f5f5f5;height:200px}.jsoneditor-modal .jsoneditor-transform-preview.jsoneditor-error{color:#ee422e}.jsoneditor-modal .jsoneditor-jmespath-wizard{line-height:1.2em;width:100%;padding:0;border-radius:3px}.jsoneditor-modal .jsoneditor-jmespath-label{font-weight:700;color:#1e90ff;margin-top:20px;margin-bottom:5px}.jsoneditor-modal .jsoneditor-jmespath-wizard-table{width:100%;border-collapse:collapse}.jsoneditor-modal .jsoneditor-jmespath-wizard-label{font-style:italic;margin:4px 0 2px 0}.jsoneditor-modal .jsoneditor-inline{position:relative;display:inline-block;width:100%;padding-top:2px;padding-bottom:2px}.jsoneditor-modal .jsoneditor-inline:not(:last-child){padding-right:2px}.jsoneditor-modal .jsoneditor-jmespath-filter{display:flex;flex-wrap:wrap}.jsoneditor-modal .jsoneditor-jmespath-filter-field{width:180px}.jsoneditor-modal .jsoneditor-jmespath-filter-relation{width:100px}.jsoneditor-modal .jsoneditor-jmespath-filter-value{min-width:180px;flex:1}.jsoneditor-modal .jsoneditor-jmespath-sort-field{width:170px}.jsoneditor-modal .jsoneditor-jmespath-sort-order{width:150px}.jsoneditor-modal .jsoneditor-jmespath-select-fields{width:100%}.jsoneditor-modal .selectr-selected{border-color:#d3d3d3;padding:4px 28px 4px 8px}.jsoneditor-modal .selectr-selected .selectr-tag{background-color:#3883fa;border-radius:5px}.jsoneditor-modal table td,.jsoneditor-modal table th{text-align:left;vertical-align:middle;font-weight:400;color:#4d4d4d;border-spacing:0;border-collapse:collapse}.jsoneditor-modal #query,.jsoneditor-modal input,.jsoneditor-modal input[type=text],.jsoneditor-modal input[type=text]:focus,.jsoneditor-modal select,.jsoneditor-modal textarea{background:#fff;border:1px solid #d3d3d3;color:#4d4d4d;border-radius:3px;padding:4px}.jsoneditor-modal,.jsoneditor-modal #query,.jsoneditor-modal input,.jsoneditor-modal input[type=text],.jsoneditor-modal option,.jsoneditor-modal select,.jsoneditor-modal table td,.jsoneditor-modal table th,.jsoneditor-modal textarea{font-size:10.5pt;font-family:arial,sans-serif}.jsoneditor-modal #query,.jsoneditor-modal .jsoneditor-transform-preview{font-family:"dejavu sans mono","droid sans mono",consolas,monaco,"lucida console","courier new",courier,monospace,sans-serif;font-size:10pt;width:100%;box-sizing:border-box}.jsoneditor-modal input[type=button],.jsoneditor-modal input[type=submit]{background:#f5f5f5;padding:4px 20px}.jsoneditor-modal input,.jsoneditor-modal select{cursor:pointer}.jsoneditor-modal .jsoneditor-button-group.jsoneditor-button-group-value-asc input.jsoneditor-button-asc,.jsoneditor-modal .jsoneditor-button-group.jsoneditor-button-group-value-desc input.jsoneditor-button-desc{background:#3883fa;border-color:#3883fa;color:#fff}.jsoneditor{color:#1a1a1a;border:thin solid #3883fa;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;position:relative;padding:0;line-height:100%}div.jsoneditor-default,div.jsoneditor-field,div.jsoneditor-readonly,div.jsoneditor-value{border:1px solid transparent;min-height:16px;min-width:32px;padding:2px;margin:1px;word-wrap:break-word;float:left}div.jsoneditor-field p,div.jsoneditor-value p{margin:0}div.jsoneditor-value{word-break:break-word}div.jsoneditor-value.jsoneditor-empty::after{content:"value"}div.jsoneditor-value.jsoneditor-string{color:#006000}div.jsoneditor-value.jsoneditor-number{color:#ee422e}div.jsoneditor-value.jsoneditor-boolean{color:#ff8c00}div.jsoneditor-value.jsoneditor-null{color:#004ed0}div.jsoneditor-value.jsoneditor-color-value{color:#1a1a1a}div.jsoneditor-value.jsoneditor-invalid{color:#1a1a1a}div.jsoneditor-readonly{min-width:16px;color:grey}div.jsoneditor-empty{border-color:#d3d3d3;border-style:dashed;border-radius:2px}div.jsoneditor-field.jsoneditor-empty::after{content:"field"}div.jsoneditor td{vertical-align:top}div.jsoneditor td.jsoneditor-separator{padding:3px 0;vertical-align:top;color:grey}div.jsoneditor td.jsoneditor-tree{vertical-align:top}div.jsoneditor.busy pre.jsoneditor-preview{background:#f5f5f5;color:grey}div.jsoneditor.busy div.jsoneditor-busy{display:inherit}div.jsoneditor code.jsoneditor-preview{background:0 0}div.jsoneditor.jsoneditor-mode-preview pre.jsoneditor-preview{width:100%;height:100%;box-sizing:border-box;overflow:auto;padding:2px;margin:0;white-space:pre-wrap;word-break:break-all}div.jsoneditor-default{color:grey;padding-left:10px}div.jsoneditor-tree{width:100%;height:100%;position:relative;overflow:auto}div.jsoneditor-tree button.jsoneditor-button{width:24px;height:24px;padding:0;margin:0;border:none;cursor:pointer;background-color:transparent;background-image:url(./img/jsoneditor-icons.svg)}div.jsoneditor-tree button.jsoneditor-button:focus{background-color:#f5f5f5;outline:#e5e5e5 solid 1px}div.jsoneditor-tree button.jsoneditor-collapsed{background-position:0 -48px}div.jsoneditor-tree button.jsoneditor-expanded{background-position:0 -72px}div.jsoneditor-tree button.jsoneditor-contextmenu-button{background-position:-48px -72px}div.jsoneditor-tree button.jsoneditor-invisible{visibility:hidden;background:0 0}div.jsoneditor-tree button.jsoneditor-dragarea{background-image:url(./img/jsoneditor-icons.svg);background-position:-72px -72px;cursor:move}div.jsoneditor-tree :focus{outline:0}div.jsoneditor-tree div.jsoneditor-show-more{display:inline-block;padding:3px 4px;margin:2px 0;background-color:#e5e5e5;border-radius:3px;color:grey;font-family:arial,sans-serif;font-size:10pt}div.jsoneditor-tree div.jsoneditor-show-more a{display:inline-block;color:grey}div.jsoneditor-tree div.jsoneditor-color{display:inline-block;width:12px;height:12px;margin:4px;border:1px solid grey;cursor:pointer}div.jsoneditor-tree div.jsoneditor-date{background:#a1a1a1;color:#fff;font-family:arial,sans-serif;border-radius:3px;display:inline-block;padding:3px;margin:0 3px}div.jsoneditor-tree table.jsoneditor-tree{border-collapse:collapse;border-spacing:0;width:100%}div.jsoneditor-tree .jsoneditor-button.jsoneditor-schema-error{width:24px;height:24px;padding:0;margin:0 4px 0 0;background-image:url(./img/jsoneditor-icons.svg);background-position:-168px -48px;background-color:transparent}div.jsoneditor-outer{position:static;width:100%;height:100%;margin:0;padding:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}div.jsoneditor-outer.has-nav-bar{margin-top:-26px;padding-top:26px}div.jsoneditor-outer.has-nav-bar.has-main-menu-bar{margin-top:-61px;padding-top:61px}div.jsoneditor-outer.has-status-bar{margin-bottom:-26px;padding-bottom:26px}div.jsoneditor-outer.has-main-menu-bar{margin-top:-35px;padding-top:35px}div.jsoneditor-busy{position:absolute;top:15%;left:0;box-sizing:border-box;width:100%;text-align:center;display:none}div.jsoneditor-busy span{background-color:#ffffab;border:1px solid #fe0;border-radius:3px;padding:5px 15px;box-shadow:0 0 5px rgba(0,0,0,.4)}div.jsoneditor-field.jsoneditor-empty::after,div.jsoneditor-value.jsoneditor-empty::after{pointer-events:none;color:#d3d3d3;font-size:8pt}a.jsoneditor-value.jsoneditor-url,div.jsoneditor-value.jsoneditor-url{color:#006000;text-decoration:underline}a.jsoneditor-value.jsoneditor-url{display:inline-block;padding:2px;margin:2px}a.jsoneditor-value.jsoneditor-url:focus,a.jsoneditor-value.jsoneditor-url:hover{color:#ee422e}div.jsoneditor-field.jsoneditor-highlight,div.jsoneditor-field[contenteditable=true]:focus,div.jsoneditor-field[contenteditable=true]:hover,div.jsoneditor-value.jsoneditor-highlight,div.jsoneditor-value[contenteditable=true]:focus,div.jsoneditor-value[contenteditable=true]:hover{background-color:#ffffab;border:1px solid #fe0;border-radius:2px}div.jsoneditor-field.jsoneditor-highlight-active,div.jsoneditor-field.jsoneditor-highlight-active:focus,div.jsoneditor-field.jsoneditor-highlight-active:hover,div.jsoneditor-value.jsoneditor-highlight-active,div.jsoneditor-value.jsoneditor-highlight-active:focus,div.jsoneditor-value.jsoneditor-highlight-active:hover{background-color:#fe0;border:1px solid #ffc700;border-radius:2px}div.jsoneditor-value.jsoneditor-array,div.jsoneditor-value.jsoneditor-object{min-width:16px}div.jsoneditor-tree button.jsoneditor-contextmenu-button.jsoneditor-selected,div.jsoneditor-tree button.jsoneditor-contextmenu-button:focus,div.jsoneditor-tree button.jsoneditor-contextmenu-button:hover,tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-contextmenu-button{background-position:-48px -48px}div.jsoneditor-tree div.jsoneditor-show-more a:focus,div.jsoneditor-tree div.jsoneditor-show-more a:hover{color:#ee422e}.ace-jsoneditor,textarea.jsoneditor-text{min-height:150px}.ace-jsoneditor *,textarea.jsoneditor-text *{font-family:"dejavu sans mono","droid sans mono",consolas,monaco,"lucida console","courier new",courier,monospace,sans-serif}textarea.jsoneditor-text{width:100%;height:100%;margin:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-width:0;border:none;background-color:#fff;resize:none}tr.jsoneditor-highlight,tr.jsoneditor-selected{background-color:#d3d3d3}tr.jsoneditor-selected button.jsoneditor-contextmenu-button,tr.jsoneditor-selected button.jsoneditor-dragarea{visibility:hidden}tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-contextmenu-button,tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-dragarea{visibility:visible}div.jsoneditor-tree button.jsoneditor-dragarea:focus,div.jsoneditor-tree button.jsoneditor-dragarea:hover,tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-dragarea{background-position:-72px -48px}div.jsoneditor td,div.jsoneditor th,div.jsoneditor tr{padding:0;margin:0}.jsoneditor-popover,.jsoneditor-schema-error,div.jsoneditor td,div.jsoneditor textarea,div.jsoneditor th,div.jsoneditor-field,div.jsoneditor-value,pre.jsoneditor-preview{font-family:"dejavu sans mono","droid sans mono",consolas,monaco,"lucida console","courier new",courier,monospace,sans-serif;font-size:10pt;color:#1a1a1a}.jsoneditor-schema-error{cursor:default;display:inline-block;height:24px;line-height:24px;position:relative;text-align:center;width:24px}.jsoneditor-popover{background-color:#4c4c4c;border-radius:3px;box-shadow:0 0 5px rgba(0,0,0,.4);color:#fff;padding:7px 10px;position:absolute;cursor:auto;width:200px}.jsoneditor-popover.jsoneditor-above{bottom:32px;left:-98px}.jsoneditor-popover.jsoneditor-above:before{border-top:7px solid #4c4c4c;bottom:-7px}.jsoneditor-popover.jsoneditor-below{top:32px;left:-98px}.jsoneditor-popover.jsoneditor-below:before{border-bottom:7px solid #4c4c4c;top:-7px}.jsoneditor-popover.jsoneditor-left{top:-7px;right:32px}.jsoneditor-popover.jsoneditor-left:before{border-left:7px solid #4c4c4c;border-top:7px solid transparent;border-bottom:7px solid transparent;content:"";top:19px;right:-14px;left:inherit;margin-left:inherit;margin-top:-7px;position:absolute}.jsoneditor-popover.jsoneditor-right{top:-7px;left:32px}.jsoneditor-popover.jsoneditor-right:before{border-right:7px solid #4c4c4c;border-top:7px solid transparent;border-bottom:7px solid transparent;content:"";top:19px;left:-14px;margin-left:inherit;margin-top:-7px;position:absolute}.jsoneditor-popover:before{border-right:7px solid transparent;border-left:7px solid transparent;content:"";display:block;left:50%;margin-left:-7px;position:absolute}.jsoneditor-text-errors tr.jump-to-line:hover{text-decoration:underline;cursor:pointer}.jsoneditor-schema-error:focus .jsoneditor-popover,.jsoneditor-schema-error:hover .jsoneditor-popover{display:block;animation:fade-in .3s linear 1,move-up .3s linear 1}@keyframes fade-in{from{opacity:0}to{opacity:1}}.jsoneditor .jsoneditor-validation-errors-container{max-height:130px;overflow-y:auto}.jsoneditor .jsoneditor-validation-errors{width:100%;overflow:hidden}.jsoneditor .jsoneditor-additional-errors{position:absolute;margin:auto;bottom:31px;left:calc(50% - 92px);color:grey;background-color:#ebebeb;padding:7px 15px;border-radius:8px}.jsoneditor .jsoneditor-additional-errors.visible{visibility:visible;opacity:1;transition:opacity 2s linear}.jsoneditor .jsoneditor-additional-errors.hidden{visibility:hidden;opacity:0;transition:visibility 0s 2s,opacity 2s linear}.jsoneditor .jsoneditor-text-errors{width:100%;border-collapse:collapse;border-top:1px solid #ffc700}.jsoneditor .jsoneditor-text-errors td{padding:3px 6px;vertical-align:middle}.jsoneditor .jsoneditor-text-errors td pre{margin:0;white-space:normal}.jsoneditor .jsoneditor-text-errors tr{background-color:#ffffab}.jsoneditor .jsoneditor-text-errors tr.parse-error{background-color:#ee2e2e70}.jsoneditor-text-errors .jsoneditor-schema-error{border:none;width:24px;height:24px;padding:0;margin:0 4px 0 0;cursor:pointer}.jsoneditor-text-errors tr .jsoneditor-schema-error{background-image:url(./img/jsoneditor-icons.svg);background-position:-168px -48px;background-color:transparent}.jsoneditor-text-errors tr.parse-error .jsoneditor-schema-error{background-image:url(./img/jsoneditor-icons.svg);background-position:-25px 0;background-color:transparent}.jsoneditor-anchor{cursor:pointer}.jsoneditor-anchor .picker_wrapper.popup.popup_bottom{top:28px;left:-10px}.fadein{-webkit-animation:fadein .3s;animation:fadein .3s;-moz-animation:fadein .3s;-o-animation:fadein .3s}@keyframes fadein{0%{opacity:0}100%{opacity:1}}.jsoneditor-modal input[type=search].selectr-input{border:1px solid #d3d3d3;width:calc(100% - 4px);margin:2px;padding:4px;box-sizing:border-box}.jsoneditor-modal button.selectr-input-clear{right:8px}.jsoneditor-menu{width:100%;height:35px;padding:2px;margin:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;background-color:#3883fa;border-bottom:1px solid #3883fa}.jsoneditor-menu>.jsoneditor-modes>button,.jsoneditor-menu>button{width:26px;height:26px;margin:2px;padding:0;border-radius:2px;border:1px solid transparent;background-color:transparent;background-image:url(./img/jsoneditor-icons.svg);color:#fff;opacity:.8;font-family:arial,sans-serif;font-size:10pt;float:left}.jsoneditor-menu>.jsoneditor-modes>button:hover,.jsoneditor-menu>button:hover{background-color:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.4)}.jsoneditor-menu>.jsoneditor-modes>button:active,.jsoneditor-menu>.jsoneditor-modes>button:focus,.jsoneditor-menu>button:active,.jsoneditor-menu>button:focus{background-color:rgba(255,255,255,.3)}.jsoneditor-menu>.jsoneditor-modes>button:disabled,.jsoneditor-menu>button:disabled{opacity:.5;background-color:transparent;border:none}.jsoneditor-menu>button.jsoneditor-collapse-all{background-position:0 -96px}.jsoneditor-menu>button.jsoneditor-expand-all{background-position:0 -120px}.jsoneditor-menu>button.jsoneditor-sort{background-position:-120px -96px}.jsoneditor-menu>button.jsoneditor-transform{background-position:-144px -96px}.jsoneditor.jsoneditor-mode-form>.jsoneditor-menu>button.jsoneditor-sort,.jsoneditor.jsoneditor-mode-form>.jsoneditor-menu>button.jsoneditor-transform,.jsoneditor.jsoneditor-mode-view>.jsoneditor-menu>button.jsoneditor-sort,.jsoneditor.jsoneditor-mode-view>.jsoneditor-menu>button.jsoneditor-transform{display:none}.jsoneditor-menu>button.jsoneditor-undo{background-position:-24px -96px}.jsoneditor-menu>button.jsoneditor-undo:disabled{background-position:-24px -120px}.jsoneditor-menu>button.jsoneditor-redo{background-position:-48px -96px}.jsoneditor-menu>button.jsoneditor-redo:disabled{background-position:-48px -120px}.jsoneditor-menu>button.jsoneditor-compact{background-position:-72px -96px}.jsoneditor-menu>button.jsoneditor-format{background-position:-72px -120px}.jsoneditor-menu>button.jsoneditor-repair{background-position:-96px -96px}.jsoneditor-menu>.jsoneditor-modes{display:inline-block;float:left}.jsoneditor-menu>.jsoneditor-modes>button{background-image:none;width:auto;padding-left:6px;padding-right:6px}.jsoneditor-menu>.jsoneditor-modes>button.jsoneditor-separator,.jsoneditor-menu>button.jsoneditor-separator{margin-left:10px}.jsoneditor-menu a{font-family:arial,sans-serif;font-size:10pt;color:#fff;opacity:.8;vertical-align:middle}.jsoneditor-menu a:hover{opacity:1}.jsoneditor-menu a.jsoneditor-poweredBy{font-size:8pt;position:absolute;right:0;top:0;padding:10px}.jsoneditor-navigation-bar{width:100%;height:26px;line-height:26px;padding:0;margin:0;border-bottom:1px solid #d3d3d3;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;color:grey;background-color:#ebebeb;overflow:hidden;font-family:arial,sans-serif;font-size:10pt}.jsoneditor-search{font-family:arial,sans-serif;position:absolute;right:4px;top:4px;border-collapse:collapse;border-spacing:0;display:flex}.jsoneditor-search input{color:#1a1a1a;width:120px;border:none;outline:0;margin:1px;line-height:20px;font-family:arial,sans-serif}.jsoneditor-search button{width:16px;height:24px;padding:0;margin:0;border:none;background:url(./img/jsoneditor-icons.svg);vertical-align:top}.jsoneditor-search button:hover{background-color:transparent}.jsoneditor-search button.jsoneditor-refresh{width:18px;background-position:-99px -73px}.jsoneditor-search button.jsoneditor-next{cursor:pointer;background-position:-124px -73px}.jsoneditor-search button.jsoneditor-next:hover{background-position:-124px -49px}.jsoneditor-search button.jsoneditor-previous{cursor:pointer;background-position:-148px -73px;margin-right:2px}.jsoneditor-search button.jsoneditor-previous:hover{background-position:-148px -49px}.jsoneditor-results{font-family:arial,sans-serif;color:#fff;padding-right:5px;line-height:26px}.jsoneditor-frame{border:1px solid transparent;background-color:#fff;padding:0 2px;margin:0}.jsoneditor-statusbar{line-height:26px;height:26px;color:grey;background-color:#ebebeb;border-top:1px solid #d3d3d3;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:10pt}.jsoneditor-statusbar>.jsoneditor-curserinfo-val{margin-right:12px}.jsoneditor-statusbar>.jsoneditor-curserinfo-count{margin-left:4px}.jsoneditor-statusbar>.jsoneditor-validation-error-icon{float:right;width:24px;height:24px;padding:0;margin-top:1px;background-image:url(./img/jsoneditor-icons.svg);background-position:-168px -48px;cursor:pointer}.jsoneditor-statusbar>.jsoneditor-validation-error-count{float:right;margin:0 4px 0 0;cursor:pointer}.jsoneditor-statusbar>.jsoneditor-parse-error-icon{float:right;width:24px;height:24px;padding:0;margin:1px;background-image:url(./img/jsoneditor-icons.svg);background-position:-25px 0}.jsoneditor-statusbar .jsoneditor-array-info a{color:inherit}div.jsoneditor-statusbar>.jsoneditor-curserinfo-label,div.jsoneditor-statusbar>.jsoneditor-size-info{margin:0 4px}.jsoneditor-treepath{padding:0 5px;overflow:hidden;white-space:nowrap;outline:0}.jsoneditor-treepath.show-all{word-wrap:break-word;white-space:normal;position:absolute;background-color:#ebebeb;z-index:1;box-shadow:2px 2px 12px rgba(128,128,128,.3)}.jsoneditor-treepath.show-all span.jsoneditor-treepath-show-all-btn{display:none}.jsoneditor-treepath div.jsoneditor-contextmenu-root{position:absolute;left:0}.jsoneditor-treepath .jsoneditor-treepath-show-all-btn{position:absolute;background-color:#ebebeb;left:0;height:20px;padding:0 3px;cursor:pointer}.jsoneditor-treepath .jsoneditor-treepath-element{margin:1px;font-family:arial,sans-serif;font-size:10pt}.jsoneditor-treepath .jsoneditor-treepath-seperator{margin:2px;font-size:9pt;font-family:arial,sans-serif}.jsoneditor-treepath span.jsoneditor-treepath-element:hover,.jsoneditor-treepath span.jsoneditor-treepath-seperator:hover{cursor:pointer;text-decoration:underline}/*! - * Selectr 2.4.0 - * https://github.com/Mobius1/Selectr +.jsoneditor,.jsoneditor-modal{-webkit-text-size-adjust:none;text-size-adjust:none}.jsoneditor input,.jsoneditor input:not([type]),.jsoneditor input[type=search],.jsoneditor input[type=text],.jsoneditor-modal input,.jsoneditor-modal input:not([type]),.jsoneditor-modal input[type=search],.jsoneditor-modal input[type=text]{height:auto;border:inherit;box-shadow:none;font-size:inherit;box-sizing:inherit;padding:inherit;font-family:inherit;transition:none;line-height:inherit}.jsoneditor input:focus,.jsoneditor input:not([type]):focus,.jsoneditor input[type=search]:focus,.jsoneditor input[type=text]:focus,.jsoneditor-modal input:focus,.jsoneditor-modal input:not([type]):focus,.jsoneditor-modal input[type=search]:focus,.jsoneditor-modal input[type=text]:focus{border:inherit;box-shadow:inherit}.jsoneditor textarea,.jsoneditor-modal textarea{height:inherit}.jsoneditor select,.jsoneditor-modal select{display:inherit;height:inherit}.jsoneditor label,.jsoneditor-modal label{font-size:inherit;font-weight:inherit;color:inherit}.jsoneditor table,.jsoneditor-modal table{border-collapse:collapse;width:auto}.jsoneditor td,.jsoneditor th,.jsoneditor-modal td,.jsoneditor-modal th{padding:0;display:table-cell;text-align:left;vertical-align:inherit;border-radius:inherit}.jsoneditor .autocomplete.dropdown{position:absolute;background:#fff;box-shadow:2px 2px 12px rgba(128,128,128,.3);border:1px solid #d3d3d3;overflow-x:hidden;overflow-y:auto;cursor:default;margin:0;padding:5px;text-align:left;outline:0;font-family:consolas,menlo,monaco,"Ubuntu Mono",source-code-pro,monospace;font-size:14px}.jsoneditor .autocomplete.dropdown .item{color:#1a1a1a}.jsoneditor .autocomplete.dropdown .item.hover{background-color:#ebebeb}.jsoneditor .autocomplete.hint{color:#a1a1a1;top:4px;left:4px}.jsoneditor-contextmenu-root{position:relative;width:0;height:0}.jsoneditor-contextmenu{position:absolute;box-sizing:content-box;z-index:2}.jsoneditor-contextmenu .jsoneditor-menu{position:relative;left:0;top:0;width:128px;height:auto;background:#fff;border:1px solid #d3d3d3;box-shadow:2px 2px 12px rgba(128,128,128,.3);list-style:none;margin:0;padding:0}.jsoneditor-contextmenu .jsoneditor-menu button{position:relative;padding:0 8px 0 0;margin:0;width:128px;height:auto;border:none;cursor:pointer;color:#4d4d4d;background:0 0;font-size:14px;font-family:arial,sans-serif;box-sizing:border-box;text-align:left}.jsoneditor-contextmenu .jsoneditor-menu button::-moz-focus-inner{padding:0;border:0}.jsoneditor-contextmenu .jsoneditor-menu button.jsoneditor-default{width:96px}.jsoneditor-contextmenu .jsoneditor-menu button.jsoneditor-expand{float:right;width:32px;height:24px;border-left:1px solid #e5e5e5}.jsoneditor-contextmenu .jsoneditor-menu li{overflow:hidden}.jsoneditor-contextmenu .jsoneditor-menu li ul{display:none;position:relative;left:-10px;top:0;border:none;box-shadow:inset 0 0 10px rgba(128,128,128,.5);padding:0 10px;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out}.jsoneditor-contextmenu .jsoneditor-menu li ul .jsoneditor-icon{margin-left:24px}.jsoneditor-contextmenu .jsoneditor-menu li ul li button{padding-left:24px;animation:all ease-in-out 1s}.jsoneditor-contextmenu .jsoneditor-menu li button .jsoneditor-expand{position:absolute;top:0;right:0;width:24px;height:24px;padding:0;margin:0 4px 0 0;background-image:url(./img/jsoneditor-icons.svg);background-position:0 -72px}.jsoneditor-contextmenu .jsoneditor-icon{position:absolute;top:0;left:0;width:24px;height:24px;border:none;padding:0;margin:0;background-image:url(./img/jsoneditor-icons.svg)}.jsoneditor-contextmenu .jsoneditor-text{padding:4px 0 4px 24px;word-wrap:break-word}.jsoneditor-contextmenu .jsoneditor-text.jsoneditor-right-margin{padding-right:24px}.jsoneditor-contextmenu .jsoneditor-separator{height:0;border-top:1px solid #e5e5e5;padding-top:5px;margin-top:5px}.jsoneditor-contextmenu button.jsoneditor-remove .jsoneditor-icon{background-position:-24px 0}.jsoneditor-contextmenu button.jsoneditor-append .jsoneditor-icon{background-position:0 0}.jsoneditor-contextmenu button.jsoneditor-insert .jsoneditor-icon{background-position:0 0}.jsoneditor-contextmenu button.jsoneditor-duplicate .jsoneditor-icon{background-position:-48px 0}.jsoneditor-contextmenu button.jsoneditor-sort-asc .jsoneditor-icon{background-position:-168px 0}.jsoneditor-contextmenu button.jsoneditor-sort-desc .jsoneditor-icon{background-position:-192px 0}.jsoneditor-contextmenu button.jsoneditor-transform .jsoneditor-icon{background-position:-216px 0}.jsoneditor-contextmenu button.jsoneditor-extract .jsoneditor-icon{background-position:0 -24px}.jsoneditor-contextmenu button.jsoneditor-type-string .jsoneditor-icon{background-position:-144px 0}.jsoneditor-contextmenu button.jsoneditor-type-auto .jsoneditor-icon{background-position:-120px 0}.jsoneditor-contextmenu button.jsoneditor-type-object .jsoneditor-icon{background-position:-72px 0}.jsoneditor-contextmenu button.jsoneditor-type-array .jsoneditor-icon{background-position:-96px 0}.jsoneditor-contextmenu button.jsoneditor-type-modes .jsoneditor-icon{background-image:none;width:6px}.jsoneditor-contextmenu li,.jsoneditor-contextmenu ul{box-sizing:content-box;position:relative}.jsoneditor-contextmenu .jsoneditor-menu button:focus,.jsoneditor-contextmenu .jsoneditor-menu button:hover{color:#1a1a1a;background-color:#f5f5f5;outline:0}.jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected,.jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected:focus,.jsoneditor-contextmenu .jsoneditor-menu li button.jsoneditor-selected:hover{color:#fff;background-color:#ee422e}.jsoneditor-contextmenu .jsoneditor-menu li ul li button:focus,.jsoneditor-contextmenu .jsoneditor-menu li ul li button:hover{background-color:#f5f5f5}.jsoneditor-modal{max-width:95%;border-radius:2px!important;padding:45px 15px 15px 15px!important;box-shadow:2px 2px 12px rgba(128,128,128,.3);color:#4d4d4d;line-height:1.3em}.jsoneditor-modal.jsoneditor-modal-transform{width:600px!important}.jsoneditor-modal .pico-modal-header{position:absolute;box-sizing:border-box;top:0;left:0;width:100%;padding:0 10px;height:30px;line-height:30px;font-family:arial,sans-serif;font-size:11pt;background:#3883fa;color:#fff}.jsoneditor-modal table{width:100%}.jsoneditor-modal table td{padding:3px 0}.jsoneditor-modal table td.jsoneditor-modal-input{text-align:right;padding-right:0;white-space:nowrap}.jsoneditor-modal table td.jsoneditor-modal-actions{padding-top:15px}.jsoneditor-modal table th{vertical-align:middle}.jsoneditor-modal p:first-child{margin-top:0}.jsoneditor-modal a{color:#3883fa}.jsoneditor-modal .jsoneditor-jmespath-block{margin-bottom:10px}.jsoneditor-modal .pico-close{background:0 0!important;font-size:24px!important;top:7px!important;right:7px!important;color:#fff}.jsoneditor-modal input{padding:4px}.jsoneditor-modal input[type=text]{cursor:inherit}.jsoneditor-modal input[disabled]{background:#d3d3d3;color:grey}.jsoneditor-modal .jsoneditor-select-wrapper{position:relative;display:inline-block}.jsoneditor-modal .jsoneditor-select-wrapper:after{content:"";width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid #666;position:absolute;right:8px;top:14px;pointer-events:none}.jsoneditor-modal select{padding:3px 24px 3px 10px;min-width:180px;max-width:350px;-webkit-appearance:none;-moz-appearance:none;appearance:none;text-indent:0;text-overflow:"";font-size:14px;line-height:1.5em}.jsoneditor-modal select::-ms-expand{display:none}.jsoneditor-modal .jsoneditor-button-group input{padding:4px 10px;margin:0;border-radius:0;border-left-style:none}.jsoneditor-modal .jsoneditor-button-group input.jsoneditor-button-first{border-top-left-radius:3px;border-bottom-left-radius:3px;border-left-style:solid}.jsoneditor-modal .jsoneditor-button-group input.jsoneditor-button-last{border-top-right-radius:3px;border-bottom-right-radius:3px}.jsoneditor-modal .jsoneditor-transform-preview{background:#f5f5f5;height:200px}.jsoneditor-modal .jsoneditor-transform-preview.jsoneditor-error{color:#ee422e}.jsoneditor-modal .jsoneditor-jmespath-wizard{line-height:1.2em;width:100%;padding:0;border-radius:3px}.jsoneditor-modal .jsoneditor-jmespath-label{font-weight:700;color:#1e90ff;margin-top:20px;margin-bottom:5px}.jsoneditor-modal .jsoneditor-jmespath-wizard-table{width:100%;border-collapse:collapse}.jsoneditor-modal .jsoneditor-jmespath-wizard-label{font-style:italic;margin:4px 0 2px 0}.jsoneditor-modal .jsoneditor-inline{position:relative;display:inline-block;width:100%;padding-top:2px;padding-bottom:2px}.jsoneditor-modal .jsoneditor-inline:not(:last-child){padding-right:2px}.jsoneditor-modal .jsoneditor-jmespath-filter{display:flex;flex-wrap:wrap}.jsoneditor-modal .jsoneditor-jmespath-filter-field{width:180px}.jsoneditor-modal .jsoneditor-jmespath-filter-relation{width:100px}.jsoneditor-modal .jsoneditor-jmespath-filter-value{min-width:180px;flex:1}.jsoneditor-modal .jsoneditor-jmespath-sort-field{width:170px}.jsoneditor-modal .jsoneditor-jmespath-sort-order{width:150px}.jsoneditor-modal .jsoneditor-jmespath-select-fields{width:100%}.jsoneditor-modal .selectr-selected{border-color:#d3d3d3;padding:4px 28px 4px 8px}.jsoneditor-modal .selectr-selected .selectr-tag{background-color:#3883fa;border-radius:5px}.jsoneditor-modal table td,.jsoneditor-modal table th{text-align:left;vertical-align:middle;font-weight:400;color:#4d4d4d;border-spacing:0;border-collapse:collapse}.jsoneditor-modal #query,.jsoneditor-modal input,.jsoneditor-modal input[type=text],.jsoneditor-modal input[type=text]:focus,.jsoneditor-modal select,.jsoneditor-modal textarea{background:#fff;border:1px solid #d3d3d3;color:#4d4d4d;border-radius:3px;padding:4px}.jsoneditor-modal #query,.jsoneditor-modal textarea{border-radius:unset}.jsoneditor-modal,.jsoneditor-modal #query,.jsoneditor-modal input,.jsoneditor-modal input[type=text],.jsoneditor-modal option,.jsoneditor-modal select,.jsoneditor-modal table td,.jsoneditor-modal table th,.jsoneditor-modal textarea{font-size:10.5pt;font-family:arial,sans-serif}.jsoneditor-modal #query,.jsoneditor-modal .jsoneditor-transform-preview{font-family:consolas,menlo,monaco,"Ubuntu Mono",source-code-pro,monospace;font-size:14px;width:100%;box-sizing:border-box}.jsoneditor-modal input[type=button],.jsoneditor-modal input[type=submit]{background:#f5f5f5;padding:4px 20px}.jsoneditor-modal input,.jsoneditor-modal select{cursor:pointer}.jsoneditor-modal .jsoneditor-button-group.jsoneditor-button-group-value-asc input.jsoneditor-button-asc,.jsoneditor-modal .jsoneditor-button-group.jsoneditor-button-group-value-desc input.jsoneditor-button-desc{background:#3883fa;border-color:#3883fa;color:#fff}.jsoneditor{color:#1a1a1a;border:thin solid #3883fa;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;position:relative;padding:0;line-height:100%}a.jsoneditor-value,div.jsoneditor-default,div.jsoneditor-field,div.jsoneditor-readonly,div.jsoneditor-value{border:1px solid transparent;min-height:16px;min-width:32px;line-height:16px;padding:2px;margin:1px;word-wrap:break-word;word-break:break-word;overflow-wrap:break-word;float:left}div.jsoneditor-field p,div.jsoneditor-value p{margin:0}div.jsoneditor-value.jsoneditor-empty::after{content:"value"}div.jsoneditor-value.jsoneditor-string{color:#006000}div.jsoneditor-value.jsoneditor-number{color:#ee422e}div.jsoneditor-value.jsoneditor-boolean{color:#ff8c00}div.jsoneditor-value.jsoneditor-null{color:#004ed0}div.jsoneditor-value.jsoneditor-color-value{color:#1a1a1a}div.jsoneditor-value.jsoneditor-invalid{color:#1a1a1a}div.jsoneditor-readonly{min-width:16px;color:grey}div.jsoneditor-empty{border-color:#d3d3d3;border-style:dashed;border-radius:2px}div.jsoneditor-field.jsoneditor-empty::after{content:"field"}div.jsoneditor td{vertical-align:top}div.jsoneditor td.jsoneditor-separator{padding:3px 0;vertical-align:top;color:grey}div.jsoneditor td.jsoneditor-tree{vertical-align:top}div.jsoneditor.busy pre.jsoneditor-preview{background:#f5f5f5;color:grey}div.jsoneditor.busy div.jsoneditor-busy{display:inherit}div.jsoneditor code.jsoneditor-preview{background:0 0}div.jsoneditor.jsoneditor-mode-preview pre.jsoneditor-preview{width:100%;height:100%;box-sizing:border-box;overflow:auto;padding:2px;margin:0;white-space:pre-wrap;word-break:break-all}div.jsoneditor-default{color:grey;padding-left:10px}div.jsoneditor-tree{width:100%;height:100%;position:relative;overflow:auto;background:#fff}div.jsoneditor-tree button.jsoneditor-button{width:24px;height:24px;padding:0;margin:0;border:none;cursor:pointer;background-color:transparent;background-image:url(./img/jsoneditor-icons.svg)}div.jsoneditor-tree button.jsoneditor-button:focus{background-color:#f5f5f5;outline:#e5e5e5 solid 1px}div.jsoneditor-tree button.jsoneditor-collapsed{background-position:0 -48px}div.jsoneditor-tree button.jsoneditor-expanded{background-position:0 -72px}div.jsoneditor-tree button.jsoneditor-contextmenu-button{background-position:-48px -72px}div.jsoneditor-tree button.jsoneditor-invisible{visibility:hidden;background:0 0}div.jsoneditor-tree button.jsoneditor-dragarea{background-image:url(./img/jsoneditor-icons.svg);background-position:-72px -72px;cursor:move}div.jsoneditor-tree :focus{outline:0}div.jsoneditor-tree div.jsoneditor-show-more{display:inline-block;padding:3px 4px;margin:2px 0;background-color:#e5e5e5;border-radius:3px;color:grey;font-family:arial,sans-serif;font-size:14px}div.jsoneditor-tree div.jsoneditor-show-more a{display:inline-block;color:grey}div.jsoneditor-tree div.jsoneditor-color{display:inline-block;width:12px;height:12px;margin:4px;border:1px solid grey;cursor:pointer}div.jsoneditor-tree div.jsoneditor-color.jsoneditor-color-readonly{cursor:inherit}div.jsoneditor-tree div.jsoneditor-date{background:#a1a1a1;color:#fff;font-family:arial,sans-serif;border-radius:3px;display:inline-block;padding:3px;margin:0 3px}div.jsoneditor-tree table.jsoneditor-tree{border-collapse:collapse;border-spacing:0;width:100%}div.jsoneditor-tree .jsoneditor-button{display:block}div.jsoneditor-tree .jsoneditor-button.jsoneditor-schema-error{width:24px;height:24px;padding:0;margin:0 4px 0 0;background-image:url(./img/jsoneditor-icons.svg);background-position:-168px -48px;background-color:transparent}div.jsoneditor-outer{position:static;width:100%;height:100%;margin:0;padding:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}div.jsoneditor-outer.has-nav-bar{margin-top:-26px;padding-top:26px}div.jsoneditor-outer.has-nav-bar.has-main-menu-bar{margin-top:-61px;padding-top:61px}div.jsoneditor-outer.has-status-bar{margin-bottom:-26px;padding-bottom:26px}div.jsoneditor-outer.has-main-menu-bar{margin-top:-35px;padding-top:35px}div.jsoneditor-busy{position:absolute;top:15%;left:0;box-sizing:border-box;width:100%;text-align:center;display:none}div.jsoneditor-busy span{background-color:#ffffab;border:1px solid #fe0;border-radius:3px;padding:5px 15px;box-shadow:0 0 5px rgba(0,0,0,.4)}div.jsoneditor-field.jsoneditor-empty::after,div.jsoneditor-value.jsoneditor-empty::after{pointer-events:none;color:#d3d3d3;font-size:8pt}a.jsoneditor-value.jsoneditor-url,div.jsoneditor-value.jsoneditor-url{color:#006000;text-decoration:underline}a.jsoneditor-value.jsoneditor-url{display:inline-block;padding:2px;margin:2px}a.jsoneditor-value.jsoneditor-url:focus,a.jsoneditor-value.jsoneditor-url:hover{color:#ee422e}div.jsoneditor-field.jsoneditor-highlight,div.jsoneditor-field[contenteditable=true]:focus,div.jsoneditor-field[contenteditable=true]:hover,div.jsoneditor-value.jsoneditor-highlight,div.jsoneditor-value[contenteditable=true]:focus,div.jsoneditor-value[contenteditable=true]:hover{background-color:#ffffab;border:1px solid #fe0;border-radius:2px}div.jsoneditor-field.jsoneditor-highlight-active,div.jsoneditor-field.jsoneditor-highlight-active:focus,div.jsoneditor-field.jsoneditor-highlight-active:hover,div.jsoneditor-value.jsoneditor-highlight-active,div.jsoneditor-value.jsoneditor-highlight-active:focus,div.jsoneditor-value.jsoneditor-highlight-active:hover{background-color:#fe0;border:1px solid #ffc700;border-radius:2px}div.jsoneditor-value.jsoneditor-array,div.jsoneditor-value.jsoneditor-object{min-width:16px}div.jsoneditor-tree button.jsoneditor-contextmenu-button.jsoneditor-selected,div.jsoneditor-tree button.jsoneditor-contextmenu-button:focus,div.jsoneditor-tree button.jsoneditor-contextmenu-button:hover,tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-contextmenu-button{background-position:-48px -48px}div.jsoneditor-tree div.jsoneditor-show-more a:focus,div.jsoneditor-tree div.jsoneditor-show-more a:hover{color:#ee422e}.ace-jsoneditor,textarea.jsoneditor-text{min-height:150px}.ace-jsoneditor.ace_editor,textarea.jsoneditor-text.ace_editor{font-family:consolas,menlo,monaco,"Ubuntu Mono",source-code-pro,monospace}textarea.jsoneditor-text{width:100%;height:100%;margin:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline-width:0;border:none;background-color:#fff;resize:none}tr.jsoneditor-highlight,tr.jsoneditor-selected{background-color:#d3d3d3}tr.jsoneditor-selected button.jsoneditor-contextmenu-button,tr.jsoneditor-selected button.jsoneditor-dragarea{visibility:hidden}tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-contextmenu-button,tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-dragarea{visibility:visible}div.jsoneditor-tree button.jsoneditor-dragarea:focus,div.jsoneditor-tree button.jsoneditor-dragarea:hover,tr.jsoneditor-selected.jsoneditor-first button.jsoneditor-dragarea{background-position:-72px -48px}div.jsoneditor td,div.jsoneditor th,div.jsoneditor tr{padding:0;margin:0}.jsoneditor-popover,.jsoneditor-schema-error,div.jsoneditor td,div.jsoneditor textarea,div.jsoneditor th,div.jsoneditor-field,div.jsoneditor-value,pre.jsoneditor-preview{font-family:consolas,menlo,monaco,"Ubuntu Mono",source-code-pro,monospace;font-size:14px;color:#1a1a1a}.jsoneditor-schema-error{cursor:default;display:inline-block;height:24px;line-height:24px;position:relative;text-align:center;width:24px}.jsoneditor-popover{background-color:#4c4c4c;border-radius:3px;box-shadow:0 0 5px rgba(0,0,0,.4);color:#fff;padding:7px 10px;position:absolute;cursor:auto;width:200px}.jsoneditor-popover.jsoneditor-above{bottom:32px;left:-98px}.jsoneditor-popover.jsoneditor-above:before{border-top:7px solid #4c4c4c;bottom:-7px}.jsoneditor-popover.jsoneditor-below{top:32px;left:-98px}.jsoneditor-popover.jsoneditor-below:before{border-bottom:7px solid #4c4c4c;top:-7px}.jsoneditor-popover.jsoneditor-left{top:-7px;right:32px}.jsoneditor-popover.jsoneditor-left:before{border-left:7px solid #4c4c4c;border-top:7px solid transparent;border-bottom:7px solid transparent;content:"";top:19px;right:-14px;left:inherit;margin-left:inherit;margin-top:-7px;position:absolute}.jsoneditor-popover.jsoneditor-right{top:-7px;left:32px}.jsoneditor-popover.jsoneditor-right:before{border-right:7px solid #4c4c4c;border-top:7px solid transparent;border-bottom:7px solid transparent;content:"";top:19px;left:-14px;margin-left:inherit;margin-top:-7px;position:absolute}.jsoneditor-popover:before{border-right:7px solid transparent;border-left:7px solid transparent;content:"";display:block;left:50%;margin-left:-7px;position:absolute}.jsoneditor-text-errors tr.jump-to-line:hover{text-decoration:underline;cursor:pointer}.jsoneditor-schema-error:focus .jsoneditor-popover,.jsoneditor-schema-error:hover .jsoneditor-popover{display:block;animation:fade-in .3s linear 1,move-up .3s linear 1}@keyframes fade-in{from{opacity:0}to{opacity:1}}.jsoneditor .jsoneditor-validation-errors-container{max-height:130px;overflow-y:auto}.jsoneditor .jsoneditor-validation-errors{width:100%;overflow:hidden}.jsoneditor .jsoneditor-additional-errors{position:absolute;margin:auto;bottom:31px;left:calc(50% - 92px);color:grey;background-color:#ebebeb;padding:7px 15px;border-radius:8px}.jsoneditor .jsoneditor-additional-errors.visible{visibility:visible;opacity:1;transition:opacity 2s linear}.jsoneditor .jsoneditor-additional-errors.hidden{visibility:hidden;opacity:0;transition:visibility 0s 2s,opacity 2s linear}.jsoneditor .jsoneditor-text-errors{width:100%;border-collapse:collapse;border-top:1px solid #ffc700}.jsoneditor .jsoneditor-text-errors td{padding:3px 6px;vertical-align:middle}.jsoneditor .jsoneditor-text-errors td pre{margin:0;white-space:pre-wrap}.jsoneditor .jsoneditor-text-errors tr{background-color:#ffffab}.jsoneditor .jsoneditor-text-errors tr.parse-error{background-color:rgba(238,46,46,.4392156863)}.jsoneditor-text-errors .jsoneditor-schema-error{border:none;width:24px;height:24px;padding:0;margin:0 4px 0 0;cursor:pointer}.jsoneditor-text-errors tr .jsoneditor-schema-error{background-image:url(./img/jsoneditor-icons.svg);background-position:-168px -48px;background-color:transparent}.jsoneditor-text-errors tr.parse-error .jsoneditor-schema-error{background-image:url(./img/jsoneditor-icons.svg);background-position:-25px 0;background-color:transparent}.jsoneditor-anchor{cursor:pointer}.jsoneditor-anchor .picker_wrapper.popup.popup_bottom{top:28px;left:-10px}.fadein{-webkit-animation:fadein .3s;animation:fadein .3s;-moz-animation:fadein .3s;-o-animation:fadein .3s}@keyframes fadein{0%{opacity:0}100%{opacity:1}}.jsoneditor-modal input[type=search].selectr-input{border:1px solid #d3d3d3;width:calc(100% - 4px);margin:2px;padding:4px;box-sizing:border-box}.jsoneditor-modal button.selectr-input-clear{right:8px}.jsoneditor-menu{width:100%;height:35px;padding:2px;margin:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;background-color:#3883fa;border-bottom:1px solid #3883fa}.jsoneditor-menu>.jsoneditor-modes>button,.jsoneditor-menu>button{width:26px;height:26px;margin:2px;padding:0;border-radius:2px;border:1px solid transparent;background-color:transparent;background-image:url(./img/jsoneditor-icons.svg);color:#fff;opacity:.8;font-family:arial,sans-serif;font-size:14px;float:left}.jsoneditor-menu>.jsoneditor-modes>button:hover,.jsoneditor-menu>button:hover{background-color:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.4)}.jsoneditor-menu>.jsoneditor-modes>button:active,.jsoneditor-menu>.jsoneditor-modes>button:focus,.jsoneditor-menu>button:active,.jsoneditor-menu>button:focus{background-color:rgba(255,255,255,.3)}.jsoneditor-menu>.jsoneditor-modes>button:disabled,.jsoneditor-menu>button:disabled{opacity:.5;background-color:transparent;border:none}.jsoneditor-menu>button.jsoneditor-collapse-all{background-position:0 -96px}.jsoneditor-menu>button.jsoneditor-expand-all{background-position:0 -120px}.jsoneditor-menu>button.jsoneditor-sort{background-position:-120px -96px}.jsoneditor-menu>button.jsoneditor-transform{background-position:-144px -96px}.jsoneditor.jsoneditor-mode-form>.jsoneditor-menu>button.jsoneditor-sort,.jsoneditor.jsoneditor-mode-form>.jsoneditor-menu>button.jsoneditor-transform,.jsoneditor.jsoneditor-mode-view>.jsoneditor-menu>button.jsoneditor-sort,.jsoneditor.jsoneditor-mode-view>.jsoneditor-menu>button.jsoneditor-transform{display:none}.jsoneditor-menu>button.jsoneditor-undo{background-position:-24px -96px}.jsoneditor-menu>button.jsoneditor-undo:disabled{background-position:-24px -120px}.jsoneditor-menu>button.jsoneditor-redo{background-position:-48px -96px}.jsoneditor-menu>button.jsoneditor-redo:disabled{background-position:-48px -120px}.jsoneditor-menu>button.jsoneditor-compact{background-position:-72px -96px}.jsoneditor-menu>button.jsoneditor-format{background-position:-72px -120px}.jsoneditor-menu>button.jsoneditor-repair{background-position:-96px -96px}.jsoneditor-menu>.jsoneditor-modes{display:inline-block;float:left}.jsoneditor-menu>.jsoneditor-modes>button{background-image:none;width:auto;padding-left:6px;padding-right:6px}.jsoneditor-menu>.jsoneditor-modes>button.jsoneditor-separator,.jsoneditor-menu>button.jsoneditor-separator{margin-left:10px}.jsoneditor-menu a{font-family:arial,sans-serif;font-size:14px;color:#fff;opacity:.8;vertical-align:middle}.jsoneditor-menu a:hover{opacity:1}.jsoneditor-menu a.jsoneditor-poweredBy{font-size:8pt;position:absolute;right:0;top:0;padding:10px}.jsoneditor-navigation-bar{width:100%;height:26px;line-height:26px;padding:0;margin:0;border-bottom:1px solid #d3d3d3;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;color:grey;background-color:#ebebeb;overflow:hidden;font-family:arial,sans-serif;font-size:14px}.jsoneditor-search{font-family:arial,sans-serif;position:absolute;right:4px;top:4px;border-collapse:collapse;border-spacing:0;display:flex}.jsoneditor-search input{color:#1a1a1a;width:120px;border:none;outline:0;margin:1px;line-height:20px;font-family:arial,sans-serif}.jsoneditor-search button{width:16px;height:24px;padding:0;margin:0;border:none;background:url(./img/jsoneditor-icons.svg);vertical-align:top}.jsoneditor-search button:hover{background-color:transparent}.jsoneditor-search button.jsoneditor-refresh{width:18px;background-position:-99px -73px}.jsoneditor-search button.jsoneditor-next{cursor:pointer;background-position:-124px -73px}.jsoneditor-search button.jsoneditor-next:hover{background-position:-124px -49px}.jsoneditor-search button.jsoneditor-previous{cursor:pointer;background-position:-148px -73px;margin-right:2px}.jsoneditor-search button.jsoneditor-previous:hover{background-position:-148px -49px}.jsoneditor-results{font-family:arial,sans-serif;color:#fff;padding-right:5px;line-height:26px}.jsoneditor-frame{border:1px solid transparent;background-color:#fff;padding:0 2px;margin:0}.jsoneditor-statusbar{line-height:26px;height:26px;color:grey;background-color:#ebebeb;border-top:1px solid #d3d3d3;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}.jsoneditor-statusbar>.jsoneditor-curserinfo-val{margin-right:12px}.jsoneditor-statusbar>.jsoneditor-curserinfo-count{margin-left:4px}.jsoneditor-statusbar>.jsoneditor-validation-error-icon{float:right;width:24px;height:24px;padding:0;margin-top:1px;background-image:url(./img/jsoneditor-icons.svg);background-position:-168px -48px;cursor:pointer}.jsoneditor-statusbar>.jsoneditor-validation-error-count{float:right;margin:0 4px 0 0;cursor:pointer}.jsoneditor-statusbar>.jsoneditor-parse-error-icon{float:right;width:24px;height:24px;padding:0;margin:1px;background-image:url(./img/jsoneditor-icons.svg);background-position:-25px 0}.jsoneditor-statusbar .jsoneditor-array-info a{color:inherit}div.jsoneditor-statusbar>.jsoneditor-curserinfo-label,div.jsoneditor-statusbar>.jsoneditor-size-info{margin:0 4px}.jsoneditor-treepath{padding:0 5px;overflow:hidden;white-space:nowrap;outline:0}.jsoneditor-treepath.show-all{word-wrap:break-word;white-space:normal;position:absolute;background-color:#ebebeb;z-index:1;box-shadow:2px 2px 12px rgba(128,128,128,.3)}.jsoneditor-treepath.show-all span.jsoneditor-treepath-show-all-btn{display:none}.jsoneditor-treepath div.jsoneditor-contextmenu-root{position:absolute;left:0}.jsoneditor-treepath .jsoneditor-treepath-show-all-btn{position:absolute;background-color:#ebebeb;left:0;height:20px;padding:0 3px;cursor:pointer}.jsoneditor-treepath .jsoneditor-treepath-element{margin:1px;font-family:arial,sans-serif;font-size:14px}.jsoneditor-treepath .jsoneditor-treepath-seperator{margin:2px;font-size:9pt;font-family:arial,sans-serif}.jsoneditor-treepath span.jsoneditor-treepath-element:hover,.jsoneditor-treepath span.jsoneditor-treepath-seperator:hover{cursor:pointer;text-decoration:underline}/*! + * Selectr 2.4.13 + * http://mobius.ovh/docs/selectr * * Released under the MIT license */.selectr-container{position:relative}.selectr-container li{list-style:none}.selectr-hidden{position:absolute;overflow:hidden;clip:rect(0,0,0,0);width:1px;height:1px;margin:-1px;padding:0;border:0 none}.selectr-visible{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;z-index:11}.selectr-desktop.multiple .selectr-visible{display:none}.selectr-desktop.multiple.native-open .selectr-visible{top:100%;min-height:200px!important;height:auto;opacity:1;display:block}.selectr-container.multiple.selectr-mobile .selectr-selected{z-index:0}.selectr-selected{position:relative;z-index:1;box-sizing:border-box;width:100%;padding:7px 28px 7px 14px;cursor:pointer;border:1px solid #999;border-radius:3px;background-color:#fff}.selectr-selected::before{position:absolute;top:50%;right:10px;width:0;height:0;content:"";-o-transform:rotate(0) translate3d(0,-50%,0);-ms-transform:rotate(0) translate3d(0,-50%,0);-moz-transform:rotate(0) translate3d(0,-50%,0);-webkit-transform:rotate(0) translate3d(0,-50%,0);transform:rotate(0) translate3d(0,-50%,0);border-width:4px 4px 0 4px;border-style:solid;border-color:#6c7a86 transparent transparent}.selectr-container.native-open .selectr-selected::before,.selectr-container.open .selectr-selected::before{border-width:0 4px 4px 4px;border-style:solid;border-color:transparent transparent #6c7a86}.selectr-label{display:none;overflow:hidden;width:100%;white-space:nowrap;text-overflow:ellipsis}.selectr-placeholder{color:#6c7a86}.selectr-tags{margin:0;padding:0;white-space:normal}.has-selected .selectr-tags{margin:0 0 -2px}.selectr-tag{list-style:none;position:relative;float:left;padding:2px 25px 2px 8px;margin:0 2px 2px 0;cursor:default;color:#fff;border:medium none;border-radius:10px;background:#acb7bf none repeat scroll 0 0}.selectr-container.multiple.has-selected .selectr-selected{padding:5px 28px 5px 5px}.selectr-options-container{position:absolute;z-index:10000;top:calc(100% - 1px);left:0;display:none;box-sizing:border-box;width:100%;border-width:0 1px 1px;border-style:solid;border-color:transparent #999 #999;border-radius:0 0 3px 3px;background-color:#fff}.selectr-container.open .selectr-options-container{display:block}.selectr-input-container{position:relative;display:none}.selectr-clear,.selectr-input-clear,.selectr-tag-remove{position:absolute;top:50%;right:22px;width:20px;height:20px;padding:0;cursor:pointer;-o-transform:translate3d(0,-50%,0);-ms-transform:translate3d(0,-50%,0);-moz-transform:translate3d(0,-50%,0);-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0);border:medium none;background-color:transparent;z-index:11}.selectr-clear,.selectr-input-clear{display:none}.selectr-container.has-selected .selectr-clear,.selectr-input-container.active .selectr-input-clear{display:block}.selectr-selected .selectr-tag-remove{right:2px}.selectr-clear::after,.selectr-clear::before,.selectr-input-clear::after,.selectr-input-clear::before,.selectr-tag-remove::after,.selectr-tag-remove::before{position:absolute;top:5px;left:9px;width:2px;height:10px;content:" ";background-color:#6c7a86}.selectr-tag-remove::after,.selectr-tag-remove::before{top:4px;width:3px;height:12px;background-color:#fff}.selectr-clear:before,.selectr-input-clear::before,.selectr-tag-remove::before{-o-transform:rotate(45deg);-ms-transform:rotate(45deg);-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg)}.selectr-clear:after,.selectr-input-clear::after,.selectr-tag-remove::after{-o-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.selectr-input-container.active,.selectr-input-container.active .selectr-clear{display:block}.selectr-input{top:5px;left:5px;box-sizing:border-box;width:calc(100% - 30px);margin:10px 15px;padding:7px 30px 7px 9px;border:1px solid #999;border-radius:3px}.selectr-notice{display:none;box-sizing:border-box;width:100%;padding:8px 16px;border-top:1px solid #999;border-radius:0 0 3px 3px;background-color:#fff}.selectr-container.notice .selectr-notice{display:block}.selectr-container.notice .selectr-selected{border-radius:3px 3px 0 0}.selectr-options{position:relative;top:calc(100% + 2px);display:none;overflow-x:auto;overflow-y:scroll;max-height:200px;margin:0;padding:0}.selectr-container.notice .selectr-options-container,.selectr-container.open .selectr-input-container,.selectr-container.open .selectr-options{display:block}.selectr-option{position:relative;display:block;padding:5px 20px;list-style:outside none none;cursor:pointer;font-weight:400}.selectr-options.optgroups>.selectr-option{padding-left:25px}.selectr-optgroup{font-weight:700;padding:0}.selectr-optgroup--label{font-weight:700;margin-top:10px;padding:5px 15px}.selectr-match{text-decoration:underline}.selectr-option.selected{background-color:#ddd}.selectr-option.active{color:#fff;background-color:#5897fb}.selectr-option.disabled{opacity:.4}.selectr-option.excluded{display:none}.selectr-container.open .selectr-selected{border-color:#999 #999 transparent #999;border-radius:3px 3px 0 0}.selectr-container.open .selectr-selected::after{-o-transform:rotate(180deg) translate3d(0,50%,0);-ms-transform:rotate(180deg) translate3d(0,50%,0);-moz-transform:rotate(180deg) translate3d(0,50%,0);-webkit-transform:rotate(180deg) translate3d(0,50%,0);transform:rotate(180deg) translate3d(0,50%,0)}.selectr-disabled{opacity:.6}.has-selected .selectr-placeholder,.selectr-empty{display:none}.has-selected .selectr-label{display:block}.taggable .selectr-selected{padding:4px 28px 4px 4px}.taggable .selectr-selected::after{display:table;content:" ";clear:both}.taggable .selectr-label{width:auto}.taggable .selectr-tags{float:left;display:block}.taggable .selectr-placeholder{display:none}.input-tag{float:left;min-width:90px;width:auto}.selectr-tag-input{border:medium none;padding:3px 10px;width:100%;font-family:inherit;font-weight:inherit;font-size:inherit}.selectr-input-container.loading::after{position:absolute;top:50%;right:20px;width:20px;height:20px;content:"";-o-transform:translate3d(0,-50%,0);-ms-transform:translate3d(0,-50%,0);-moz-transform:translate3d(0,-50%,0);-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0);-o-transform-origin:50% 0 0;-ms-transform-origin:50% 0 0;-moz-transform-origin:50% 0 0;-webkit-transform-origin:50% 0 0;transform-origin:50% 0 0;-moz-animation:.5s linear 0s normal forwards infinite running selectr-spin;-webkit-animation:.5s linear 0s normal forwards infinite running selectr-spin;animation:.5s linear 0s normal forwards infinite running selectr-spin;border-width:3px;border-style:solid;border-color:#aaa #ddd #ddd;border-radius:50%}@-webkit-keyframes selectr-spin{0%{-webkit-transform:rotate(0) translate3d(0,-50%,0);transform:rotate(0) translate3d(0,-50%,0)}100%{-webkit-transform:rotate(360deg) translate3d(0,-50%,0);transform:rotate(360deg) translate3d(0,-50%,0)}}@keyframes selectr-spin{0%{-webkit-transform:rotate(0) translate3d(0,-50%,0);transform:rotate(0) translate3d(0,-50%,0)}100%{-webkit-transform:rotate(360deg) translate3d(0,-50%,0);transform:rotate(360deg) translate3d(0,-50%,0)}}.selectr-container.open.inverted .selectr-selected{border-color:transparent #999 #999;border-radius:0 0 3px 3px}.selectr-container.inverted .selectr-options-container{border-width:1px 1px 0;border-color:#999 #999 transparent;border-radius:3px 3px 0 0;background-color:#fff}.selectr-container.inverted .selectr-options-container{top:auto;bottom:calc(100% - 1px)}.selectr-container ::-webkit-input-placeholder{color:#6c7a86;opacity:1}.selectr-container ::-moz-placeholder{color:#6c7a86;opacity:1}.selectr-container :-ms-input-placeholder{color:#6c7a86;opacity:1}.selectr-container ::placeholder{color:#6c7a86;opacity:1} diff --git a/app/grandchallenge/core/static/vendored/jsoneditor/jsoneditor.min.js b/app/grandchallenge/core/static/vendored/jsoneditor/jsoneditor.min.js index 77d360c8b6..d8e29036c6 100644 --- a/app/grandchallenge/core/static/vendored/jsoneditor/jsoneditor.min.js +++ b/app/grandchallenge/core/static/vendored/jsoneditor/jsoneditor.min.js @@ -6,7 +6,7 @@ * It has various modes such as a tree editor, a code editor, and a plain text * editor. * - * Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 8+ + * Supported browsers: Chrome, Firefox, Safari, Edge * * @license * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -21,27 +21,30 @@ * License for the specific language governing permissions and limitations under * the License. * - * Copyright (c) 2011-2021 Jos de Jong, http://jsoneditoronline.org + * Copyright (c) 2011-2024 Jos de Jong, http://jsoneditoronline.org * * @author Jos de Jong, - * @version 9.5.2 - * @date 2021-07-22 + * @version 10.1.1 + * @date 2024-11-13 */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSONEditor=t():e.JSONEditor=t()}(self,function(){return i={6835:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},2689:function(e){"use strict";e.exports=JSON.parse('{"id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-04/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string"},"$schema":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"multipleOf":{"type":"number","minimum":0,"exclusiveMinimum":true},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"dependencies":{"exclusiveMaximum":["maximum"],"exclusiveMinimum":["minimum"]},"default":{}}')},1030:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}')},38:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},897:function(e,t,i){"use strict";i.d(t,{x:function(){return r}});var c=i(2602),h=i(9791),u=i(7907);function n(e,t){for(var i=0;ir.top&&(n=!1);i=i?0:o.top-s.top;n?(s=e.offsetHeight,this.dom.menu.style.left="0",this.dom.menu.style.top=i+s+"px",this.dom.menu.style.bottom=""):(this.dom.menu.style.left="0",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px"),this.limitHeight&&(r=n?r.bottom-o.bottom-10:o.top-r.top-10,this.dom.list.style.maxHeight=r+"px",this.dom.list.style.overflowY="auto"),this.dom.absoluteAnchor.appendChild(this.dom.root),this.selection=(0,h.getSelection)(),this.anchor=e,setTimeout(function(){a.dom.focusButton.focus()},0),l.visibleMenu&&l.visibleMenu.hide(),l.visibleMenu=this}},{key:"hide",value:function(){this.dom.absoluteAnchor&&(this.dom.absoluteAnchor.destroy(),delete this.dom.absoluteAnchor),this.dom.root.parentNode&&(this.dom.root.parentNode.removeChild(this.dom.root),this.onClose&&this.onClose()),l.visibleMenu===this&&(l.visibleMenu=void 0)}},{key:"_onExpandItem",value:function(i){var n,r=this,e=i===this.expandedItem,t=this.expandedItem;t&&(t.ul.style.height="0",t.ul.style.padding="",setTimeout(function(){r.expandedItem!==t&&(t.ul.style.display="",h.removeClassName)(t.ul.parentNode,"jsoneditor-selected")},300),this.expandedItem=void 0),e||((n=i.ul).style.display="block",n.clientHeight,setTimeout(function(){if(r.expandedItem===i){for(var e=0,t=0;te[0].length)||(e=t,i=o,this.options.flex));o++);return e?((n=e[0].match(/\n.*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-1:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,r[i],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,i,n){switch(i){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t.lexer=e,t}();t.parser=i,t.parse=i.parse.bind(i)},3879:function(e){"use strict";function n(){}var i={defaultSelected:!0,width:"auto",disabled:!1,searchable:!0,clearable:!1,sortSelected:!1,allowDeselect:!1,closeOnScroll:!1,nativeDropdown:!1,placeholder:"Select an option...",taggable:!1,tagPlaceholder:"Enter a tag..."};n.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){this._events=this._events||{},e in this._events!=!1&&this._events[e].splice(this._events[e].indexOf(t),1)},emit:function(e){if(this._events=this._events||{},e in this._events!=!1)for(var t=0;t"+t.label+""}),h.each(t.children,function(e,t){t.idx=s,o.appendChild(c.call(this,t,o)),s++},this)):(t.idx=s,c.call(this,t),s++)},this),this.config.data&&Array.isArray(this.config.data)&&(i=!(this.data=[]),o=!1,s=0,h.each(this.config.data,function(e,t){l(t,"children")?(i=h.createElement("optgroup",{label:t.text}),o=h.createElement("ul",{class:"selectr-optgroup",role:"group",html:"
  • "+t.text+"
  • "}),h.each(t.children,function(e,t){(n=new Option(t.text,t.value,!1,t.hasOwnProperty("selected")&&!0===t.selected)).disabled=l(t,"disabled"),this.options.push(n),i.appendChild(n),n.idx=s,o.appendChild(c.call(this,n,t)),this.data[s]=t,s++},this)):((n=new Option(t.text,t.value,!1,t.hasOwnProperty("selected")&&!0===t.selected)).disabled=l(t,"disabled"),this.options.push(n),n.idx=s,c.call(this,n,t),this.data[s]=t,s++)},this)),this.setSelected(!0);for(var a=this.navIndex=0;athis.tree.lastElementChild.idx){this.navIndex=this.tree.lastElementChild.idx;break}if(this.navIndexthis.optsRect.top+this.optsRect.height&&(this.tree.scrollTop=this.tree.scrollTop+(e.top+e.height-(this.optsRect.top+this.optsRect.height))),this.navIndex===this.tree.childElementCount-1&&this.requiresPagination&&o.call(this)):0===this.navIndex?this.tree.scrollTop=0:e.top-this.optsRect.top<0&&(this.tree.scrollTop=this.tree.scrollTop+(e.top-this.optsRect.top)),i&&h.removeClass(i,"active"),h.addClass(this.items[this.navIndex],"active")}else this.navigating=!1}.bind(this),this.events.reset=this.reset.bind(this),(this.config.nativeDropdown||this.mobileDevice)&&(this.container.addEventListener("touchstart",function(e){e.changedTouches[0].target===n.el&&n.toggle()}),(this.config.nativeDropdown||this.mobileDevice)&&this.container.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),e.target===n.el&&n.toggle()}),this.el.addEventListener("change",function(e){var t;n.el.multiple?(t=n.getSelectedProperties("idx"),t=function(e,t){for(var i,n=[],r=e.slice(0),o=0;oi?(h.addClass(this.container,"inverted"),this.isInverted=!0):(h.removeClass(this.container,"inverted"),this.isInverted=!1),this.optsRect=h.rect(this.tree)},r.prototype.getOptionByIndex=function(e){return this.options[e]},r.prototype.getOptionByValue=function(e){for(var t=!1,i=0,n=this.options.length;ithis.limit&&1s.EX?((0,p.addClassName)((i=this).frame,"busy"),i.dom.busyContent.innerText=t,setTimeout(function(){e(),(0,p.removeClassName)(i.frame,"busy"),i.dom.busyContent.innerText=""},100)):e()},t.validate=i.validate,t._renderErrors=i._renderErrors;var m=[{mode:"preview",mixin:t,data:"json"}]},6210:function(e,t,i){"use strict";i.r(t),i.d(t,{showSortModal:function(){return s}});var t=i(483),n=i.n(t),r=i(7907),o=i(9791);function s(e,t,s,i){var a=Array.isArray(t)?(0,o.getChildPaths)(t):[""],l=i&&i.path&&(0,o.contains)(a,i.path)?i.path:a[0],c=i&&i.direction||"asc",i='
    '+(0,r.Iu)("sort")+"
    "+(0,r.Iu)("sortFieldLabel")+'
    '+(0,r.Iu)("sortDirectionLabel")+'
    ';n()({parent:e,content:i,overlayClass:"jsoneditor-modal-overlay",overlayStyles:{backgroundColor:"rgb(1,1,1)",opacity:.3},modalClass:"jsoneditor-modal jsoneditor-modal-sort"}).afterCreate(function(t){var e=t.modalElem().querySelector("form"),i=t.modalElem().querySelector("#ok"),n=t.modalElem().querySelector("#field"),r=t.modalElem().querySelector("#direction");function o(e){r.value=e,r.className="jsoneditor-button-group jsoneditor-button-group-value-"+r.value}a.forEach(function(e){var t,i=document.createElement("option");i.text=""===(t=e)?"@":"."===t[0]?t.slice(1):t,i.value=e,n.appendChild(i)}),n.value=l||a[0],o(c||"asc"),r.onclick=function(e){o(e.target.getAttribute("data-value"))},i.onclick=function(e){e.preventDefault(),e.stopPropagation(),t.close(),s({path:n.value,direction:r.value})},e&&(e.onsubmit=i.onclick)}).afterClose(function(e){e.destroy()}).show()}},2558:function(e,t,i){"use strict";i.r(t),i.d(t,{showTransformModal:function(){return a}});var t=i(483),n=i.n(t),t=i(3879),x=i.n(t),r=i(7907);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t,i,n){return"boolean"==typeof e||e instanceof Boolean||null===e||"number"==typeof e||e instanceof Number||"string"==typeof e||e instanceof String||e instanceof Date?JSON.stringify(e):Array.isArray(e)?function(e,t,i,n){for(var r=t?i+t:void 0,o=t?"[\n":"[",s=0;sn)return o+"..."}return o+=t?"\n"+i+"]":"]"}(e,t,i,n):e&&"object"===o(e)?function(e,t,i,n){var r,o=t?i+t:void 0,s=!0,a=t?"{\n":"{";if("function"==typeof e.toJSON)return k(e.toJSON(),t,i,n);for(r in e)if(function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,r)){var l=e[r];if(s?s=!1:a+=t?",\n":",",a+=t?o+'"'+r+'": ':'"'+r+'":',(a+=k(l,t,o,n)).length>n)return a+"..."}return a+=t?"\n"+i+"}":"}"}(e,t,i,n):void 0}function E(e,t){for(var i="";0JMESPath query to filter, sort, or transform the JSON data.
    To learn JMESPath, go to the interactive tutorial.';function a(e){var t=e.container,A=e.json,i=e.queryDescription,i=void 0===i?s:i,b=e.createQuery,y=e.executeQuery,w=e.onTransform,S=A,i='