diff --git a/.doctor-rst.yaml b/.doctor-rst.yaml new file mode 100644 index 000000000..a398dc0f7 --- /dev/null +++ b/.doctor-rst.yaml @@ -0,0 +1,74 @@ +rules: + american_english: ~ + avoid_repetetive_words: ~ + blank_line_after_anchor: ~ + blank_line_after_directive: ~ + blank_line_before_directive: ~ + composer_dev_option_not_at_the_end: ~ + correct_code_block_directive_based_on_the_content: ~ + deprecated_directive_should_have_version: ~ + ensure_exactly_one_space_between_link_definition_and_link: ~ + ensure_link_definition_contains_valid_url: ~ + ensure_order_of_code_blocks_in_configuration_block: ~ + extend_abstract_controller: ~ + extension_xlf_instead_of_xliff: ~ + indention: ~ + lowercase_as_in_use_statements: ~ + max_blank_lines: + max: 2 + max_colons: ~ + no_app_console: ~ + no_blank_line_after_filepath_in_php_code_block: ~ + no_blank_line_after_filepath_in_twig_code_block: ~ + no_blank_line_after_filepath_in_xml_code_block: ~ + no_blank_line_after_filepath_in_yaml_code_block: ~ + no_brackets_in_method_directive: ~ + no_composer_req: ~ + no_directive_after_shorthand: ~ + no_explicit_use_of_code_block_php: ~ + no_inheritdoc: ~ + no_namespace_after_use_statements: ~ + no_php_open_tag_in_code_block_php_directive: ~ + no_space_before_self_xml_closing_tag: ~ + only_backslashes_in_namespace_in_php_code_block: ~ + only_backslashes_in_use_statements_in_php_code_block: ~ + ordered_use_statements: ~ + php_prefix_before_bin_console: ~ + replace_code_block_types: ~ + replacement: ~ + short_array_syntax: ~ + space_between_label_and_link_in_doc: ~ + space_between_label_and_link_in_ref: ~ + string_replacement: ~ + typo: ~ + unused_links: ~ + use_deprecated_directive_instead_of_versionadded: ~ + use_https_xsd_urls: ~ + valid_inline_highlighted_namespaces: ~ + valid_use_statements: ~ + versionadded_directive_should_have_version: ~ + yaml_instead_of_yml_suffix: ~ + yarn_dev_option_at_the_end: ~ +# no_app_bundle: ~ + + # master + versionadded_directive_major_version: + major_version: 4 + + versionadded_directive_min_version: + min_version: '4.0' + + deprecated_directive_major_version: + major_version: 4 + + deprecated_directive_min_version: + min_version: '4.0' + +# do not report as violation +whitelist: + regex: + - '/``.yml``/' + lines: + - '.. code-block:: twig' + - '// bin/console' + - '.. code-block:: php' diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..d65c6002c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +.* export-ignore +*.md export-ignore +tests export-ignore +docs export-ignore +phpunit export-ignore +phpunit.xml.dist export-ignore +utils export-ignore \ No newline at end of file diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..10e6514f8 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: DjordyKoert diff --git a/.github/ISSUE_TEMPLATE/1_Bug_report.yaml b/.github/ISSUE_TEMPLATE/1_Bug_report.yaml new file mode 100644 index 000000000..dfd02e7f9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1_Bug_report.yaml @@ -0,0 +1,43 @@ +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["bug"] + +body: + - type: input + id: version + attributes: + label: Version + description: What version are you running? + placeholder: x.y.z + validations: + required: true + - type: textarea + id: description + attributes: + label: Description + description: A clear and concise description of the problem + validations: + required: true + - type: textarea + id: json + attributes: + label: JSON OpenApi + description: Your generated JSON OpenApi documentation (`bin/console nelmio:apidoc:dump`) + value: | +
JSON OpenApi + + ```json + + Replace this text with your JSON (`bin/console nelmio:apidoc:dump`) + + ``` + +
+ validations: + required: false + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Any other context about the bug (configs, logs, screenshots etc.) diff --git a/.github/ISSUE_TEMPLATE/2_Question.yaml b/.github/ISSUE_TEMPLATE/2_Question.yaml new file mode 100644 index 000000000..5fdeb750e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2_Question.yaml @@ -0,0 +1,26 @@ +name: Question +description: Ask a question +title: "[Question]: " +labels: ["question"] + +body: + - type: input + id: version + attributes: + label: Version + description: What version are you running? + placeholder: x.y.z + validations: + required: true + - type: textarea + id: question + attributes: + label: Question + description: Please tell us about your question or problem + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Any other context (configs, logs, screenshots etc.) diff --git a/.github/ISSUE_TEMPLATE/3_Feature_request.yaml b/.github/ISSUE_TEMPLATE/3_Feature_request.yaml new file mode 100644 index 000000000..971413daf --- /dev/null +++ b/.github/ISSUE_TEMPLATE/3_Feature_request.yaml @@ -0,0 +1,18 @@ +name: Feature Request +description: Suggest ideas for new features and improvements +title: "[Feature]: " +labels: ["enhancement"] + +body: + - type: textarea + id: description + attributes: + label: Description + description: A clear and concise description of the feature + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Any other context about the feature request (e.g. screenshots, code snippets, etc.) diff --git a/.github/ISSUE_TEMPLATE/config.yaml b/.github/ISSUE_TEMPLATE/config.yaml new file mode 100644 index 000000000..0086358db --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yaml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..9603891b9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "npm" + directory: "/utils" + schedule: + interval: "weekly" + versioning-strategy: increase diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..d51a802fe --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,18 @@ +## Description + +*Please include a summary of the changes and the related issue.* + +Closes #... + +## What type of PR is this? (check all applicable) +- [ ] Bug Fix +- [ ] Feature +- [ ] Refactor +- [ ] Deprecation +- [ ] Breaking Change +- [ ] Documentation Update +- [ ] CI + +## Checklist +- [ ] I have made corresponding changes to the documentation (`docs/`) +- [ ] I have made corresponding changes to the changelog (`CHANGELOG.md`) \ No newline at end of file diff --git a/.github/workflows/common/composer-install/action.yaml b/.github/workflows/common/composer-install/action.yaml new file mode 100644 index 000000000..0aedb105a --- /dev/null +++ b/.github/workflows/common/composer-install/action.yaml @@ -0,0 +1,46 @@ +name: Composer setup +description: Setup, install and cache Composer dependencies + +inputs: + symfony-version: + description: The required Symfony version that will be installed + required: true + type: string + + install-doctrine-annotations: + description: If the doctrine/annotations package should be additionally installed as a dependency + required: true + type: boolean + + composer-flags: + description: Additional flags that are passed to the `composer update` step + required: false + type: string + +runs: + using: composite + steps: + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + shell: bash + + - name: Cache Composer dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: | + ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + ${{ runner.os }}-composer- + + - name: Install doctrine/annotations + if: ${{ inputs.install-doctrine-annotations == 'true' }} + run: composer require --no-update doctrine/annotations + shell: bash + + - name: Install dependencies with Composer + env: + SYMFONY_REQUIRE: "${{ inputs.symfony-version }}.*" + run: composer update --no-interaction --no-progress ${{ inputs.composer-flags }} + shell: bash diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 000000000..2c195236c --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,198 @@ +# from doctrine/instantiator: +# https://github.com/doctrine/instantiator/blob/97aa11bb71ad6259a8c5a1161b4de2d6cdcc5501/.github/workflows/continuous-integration.yml + +name: CI + +on: + pull_request: + branches: + - "*.x" + - master + push: + branches: + - "*.x" + - master + +env: + fail-fast: true + +jobs: + phpunit: + name: PHPUnit + runs-on: ubuntu-22.04 + + strategy: + fail-fast: false + matrix: + include: + - php-version: 7.4 + symfony-require: "5.4" + composer-flags: "--prefer-lowest" + doctrine-annotations: true + - php-version: 7.4 + symfony-require: "5.4" + doctrine-annotations: true + - php-version: 8.0 + symfony-require: "5.4" + doctrine-annotations: true + - php-version: 8.1 + symfony-require: "5.4" + doctrine-annotations: true + - php-version: 8.2 + symfony-require: "5.4" + doctrine-annotations: true + - php-version: 8.3 + symfony-require: "5.4" + doctrine-annotations: true + - php-version: 8.4 + symfony-require: "5.4" + doctrine-annotations: true + - php-version: 8.1 + symfony-require: "6.4" + doctrine-annotations: true + - php-version: 8.2 + symfony-require: "6.4" + doctrine-annotations: true + - php-version: 8.3 + symfony-require: "6.4" + doctrine-annotations: true + - php-version: 8.4 + symfony-require: "6.4" + doctrine-annotations: true + - php-version: 8.2 + symfony-require: "7.1" + doctrine-annotations: false + - php-version: 8.3 + symfony-require: "7.1" + doctrine-annotations: false + - php-version: 8.4 + symfony-require: "7.1" + doctrine-annotations: false + - php-version: 8.2 + symfony-require: "7.2" + doctrine-annotations: false + - php-version: 8.3 + symfony-require: "7.2" + doctrine-annotations: false + - php-version: 8.4 + symfony-require: "7.2" + doctrine-annotations: false + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Install PHP with coverage + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer, flex + coverage: pcov + + - name: Setup dependencies + uses: ./.github/workflows/common/composer-install + with: + symfony-version: ${{ matrix.symfony-require }} + install-doctrine-annotations: ${{ matrix.doctrine-annotations }} + composer-flags: ${{ matrix.composer-flags }} + + - name: PHPUnit Tests + run: | + vendor/bin/phpunit \ + --configuration phpunit.xml.dist \ + --log-junit=junit-${{ matrix.php-version }}-${{ matrix.symfony-require }}-${{ matrix.doctrine-annotations }}${{ matrix.composer-flags }}.xml \ + --coverage-clover=coverage-${{ matrix.php-version }}-${{ matrix.symfony-require }}-${{ matrix.doctrine-annotations }}${{ matrix.composer-flags }}.xml \ + --coverage-filter=src/ + + - uses: actions/upload-artifact@v4 + if: ${{ matrix.php-version != '7.4' }} + with: + name: phpunit-${{ matrix.php-version }}-${{ matrix.symfony-require }}-${{ matrix.doctrine-annotations }}${{ matrix.composer-flags }} + path: | + coverage*.xml + junit*.xml + if-no-files-found: error + retention-days: 2 + + codecov: + name: Codecov + runs-on: ubuntu-22.04 + + needs: phpunit + timeout-minutes: 5 + + if: github.event.pull_request.user.login != 'dependabot[bot]' + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Download artifacts + uses: actions/download-artifact@v4 + + - name: Upload test results to Codecov.io + uses: codecov/test-results-action@v1 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + - name: Upload code coverage to Codecov.io + uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Install PHP without coverage + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + tools: composer, flex + coverage: none + + - name: Setup dependencies + uses: ./.github/workflows/common/composer-install + with: + symfony-version: "7.2.*" + install-doctrine-annotations: false + + - name: Run PHP-CS-Fixer + run: vendor/bin/php-cs-fixer check -v --diff + + phpstan: + name: PHPStan + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Install PHP without coverage + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + tools: composer, flex + coverage: none + + - name: Setup dependencies + uses: ./.github/workflows/common/composer-install + with: + symfony-version: "7.2.*" + install-doctrine-annotations: false + + - name: Run PHPStan + run: vendor/bin/phpstan analyse --memory-limit=2G --no-progress --no-interaction diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 000000000..d2dc7bc42 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,33 @@ +name: Dependabot update UI files + +on: pull_request + +jobs: + dependabot: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./utils + + permissions: + contents: write + + if: github.event.pull_request.user.login == 'dependabot[bot]' + steps: + - name: "Checkout" + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + - run: yarn install + - name: Swagger UI + run: yarn run swagger + - name: Redocly + run: yarn run redoc + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "[dependabot-skip] Update UI files" + branch: ${{ github.head_ref }} \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..b6de4ea68 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,33 @@ +name: CI + +on: + push: ~ + pull_request: ~ + +jobs: + doctor-rst: + name: Lint (DOCtor-RST) + + runs-on: ubuntu-latest + + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: "Create cache dir" + run: mkdir .cache + + - name: "Extract base branch name" + run: echo "branch=$(echo ${GITHUB_BASE_REF:=${GITHUB_REF##*/}})" >> $GITHUB_OUTPUT + id: extract_base_branch + + - name: "Cache DOCtor-RST" + uses: actions/cache@v4 + with: + path: .cache + key: ${{ runner.os }}-doctor-rst-${{ steps.extract_base_branch.outputs.branch }} + + - name: "Run DOCtor-RST" + uses: docker://oskarstark/doctor-rst + with: + args: --short --error-format=github --cache-file=/github/workspace/.cache/doctor-rst.cache diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 000000000..4c730a57d --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,22 @@ +name: GitHub PR Lint + +on: + pull_request_target: + types: + - opened + - edited + - reopened + - synchronize + +jobs: + semantic-pr: + name: Validate semantic PR title + runs-on: ubuntu-latest + + steps: + - name: Semantic PR title + uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + subjectPattern: ^(?![A-Z]).+$ # This pattern ensures the subject doesn't start with an uppercase character. diff --git a/.gitignore b/.gitignore index e83aa85dd..5e6bcf55c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,16 @@ +/var/ /vendor/ /composer.phar /composer.lock -/.php_cs.cache -/.php_cs /phpunit.xml /.phpunit +/.phpunit.result.cache /Tests/Functional/cache /Tests/Functional/logs +.idea +/phpstan.neon + +###> friendsofphp/php-cs-fixer ### +/.php-cs-fixer.php +/.php-cs-fixer.cache +###< friendsofphp/php-cs-fixer ### diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 000000000..9f192617e --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,36 @@ +in(__DIR__) + ->exclude('var') + ->exclude('tests/Functional/cache') + ->exclude('tests/Functional/ModelDescriber/Fixtures'); + +return (new PhpCsFixer\Config()) + ->setRules([ + '@Symfony' => true, + '@PHP84Migration' => true, + 'header_comment' => [ + 'header' => <<
false, + ]) + ->setFinder($finder); diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index 2bb967fdb..000000000 --- a/.php_cs.dist +++ /dev/null @@ -1,25 +0,0 @@ -in(__DIR__) - ->exclude('Tests/Functional/cache') -; - -return PhpCsFixer\Config::create() - ->setRules([ - '@Symfony' => true, - 'ordered_imports' => true, - 'phpdoc_order' => true, - 'header_comment' => [ - 'header' => <<
setFinder($finder) -; diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index c41d89142..000000000 --- a/.styleci.yml +++ /dev/null @@ -1,11 +0,0 @@ -preset: symfony - -enabled: - - newline_after_open_tag - - ordered_use - - short_array_syntax - -disabled: - - unalign_equals - - braces - - property_separation diff --git a/.symfony.bundle.yaml b/.symfony.bundle.yaml new file mode 100644 index 000000000..63e4ce19b --- /dev/null +++ b/.symfony.bundle.yaml @@ -0,0 +1,6 @@ +branches: ["2.x", "3.x", "master", "5.x"] +maintained_branches: ["master", "5.x"] +current_branch: "master" +master_alias: "4.x" +dev_branch: "5.x" +doc_dir: { "3.x": "Resources/doc/", "master": "docs/", "5.x": "docs/" } diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bd845b9b7..000000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - -sudo: false - -cache: - directories: - - .phpunit - - $HOME/.composer/cache - -branches: - only: - - master - - dev - - /^\d+\.\d+$/ - -matrix: - fast_finish: true - include: - - php: 7.0 - env: COMPOSER_FLAGS="--prefer-lowest" - -before_install: - - phpenv config-rm xdebug.ini - -install: composer update $COMPOSER_FLAGS --prefer-stable - -script: ./phpunit diff --git a/Annotation/Model.php b/Annotation/Model.php deleted file mode 100644 index d4aeff502..000000000 --- a/Annotation/Model.php +++ /dev/null @@ -1,43 +0,0 @@ - 'string', - 'groups' => '[string]', - ]; - - public static $_required = ['type']; - - public static $_parents = [ - 'Swagger\Annotations\Parameter', - 'Swagger\Annotations\Response', - ]; - - /** - * @var string - */ - public $type; - - /** - * @var string[] - */ - public $groups; -} diff --git a/Annotation/Security.php b/Annotation/Security.php deleted file mode 100644 index 1b5108541..000000000 --- a/Annotation/Security.php +++ /dev/null @@ -1,32 +0,0 @@ - 'string', - ]; - - public static $_required = ['name']; - - /** - * @var string - */ - public $name; -} diff --git a/ApiDocGenerator.php b/ApiDocGenerator.php deleted file mode 100644 index 4000be1f1..000000000 --- a/ApiDocGenerator.php +++ /dev/null @@ -1,80 +0,0 @@ -describers = $describers; - $this->modelDescribers = $modelDescribers; - $this->cacheItemPool = $cacheItemPool; - $this->cacheItemId = $cacheItemId; - } - - public function setAlternativeNames(array $alternativeNames) - { - $this->alternativeNames = $alternativeNames; - } - - public function generate(): Swagger - { - if (null !== $this->swagger) { - return $this->swagger; - } - - if ($this->cacheItemPool) { - $item = $this->cacheItemPool->getItem($this->cacheItemId ?? 'swagger_doc'); - if ($item->isHit()) { - return $this->swagger = $item->get(); - } - } - - $this->swagger = new Swagger(); - $modelRegistry = new ModelRegistry($this->modelDescribers, $this->swagger, $this->alternativeNames); - foreach ($this->describers as $describer) { - if ($describer instanceof ModelRegistryAwareInterface) { - $describer->setModelRegistry($modelRegistry); - } - - $describer->describe($this->swagger); - } - $modelRegistry->registerDefinitions(); - - if (isset($item)) { - $this->cacheItemPool->save($item->set($this->swagger)); - } - - return $this->swagger; - } -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 41334a30a..ff7e37942 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,281 @@ -CHANGELOG -========= +# CHANGELOG -3.3.0 (unreleased) ------------------- +## 4.38.0 +* Added a `#[Ignore]` attribute that allows a property to be excluded from the generated schema. +```php + ['foo', 'bar']])] ++#[Areas(properties: ['foo', 'bar'])] + +-#[Areas(['value' => ['foo', 'bar']])] ++#[Areas(['foo', 'bar'])] +``` + +## 4.36.0 +* Configuration option `with_annotation` has been deprecated in favor of `with_attribute` +```diff +nelmio_api_doc: + areas: + path_patterns: + - ^/api/foo +- with_annotation: true ++ with_attribute: true +``` + +## 4.35.0 +* Added support for the symfony/type-info component +```yaml +nelmio_api_doc: + type_info: true +``` + +## 4.34.0 +* Changed minimum Symfony version for 7.x from 7.0 to 7.1 + +## 4.33.6 +* Fixed Symfony 7.2 deprecation of tagged arguments + +## 4.33.5 +* Added new optional parameter `$context` to` PropertyDescriberInterface::supports()` + +## 4.33.4 +* Deprecated `null` type from `$options` in `Nelmio\ApiDocBundle\Attribute\Model::__construct()`. Pass an empty array (`[]`) instead. +* Deprecated `null` type from `$options` in `NNelmio\ApiDocBundle\Attribute\Model::__construct()`. Pass an empty array (`[]`) instead. + +## 4.33.3 +* Bumped swagger-ui files from `5.18.1` to `5.18.2` +* Bumped redoc files to `2.2.0` + +## 4.33.2 +* Fixed incorrect directory updated for swagger-ui files from version `4.33.2` + +## 4.33.1 +* Bumped swagger-ui files to `5.18.1` +* Fixed explicitly set default values defined in `#[OA\Property]` being overwritten + +## 4.33.0 +* Fixed custom JMS enum type handling +* Added support for name based serialisation of JMS enums + +## 4.32.3 + +* Deprecated `Nelmio\ApiDocBundle\Annotation` namespace in favor of `Nelmio\ApiDocBundle\Attribute` namespace in preparation for 5.x. Consider upgrading to the new attribute syntax. +```diff +- use Nelmio\ApiDocBundle\Annotation\Areas; +- use Nelmio\ApiDocBundle\Annotation\Model; +- use Nelmio\ApiDocBundle\Annotation\Operation; +- use Nelmio\ApiDocBundle\Annotation\Security; + ++ use Nelmio\ApiDocBundle\Attribute\Areas; ++ use Nelmio\ApiDocBundle\Attribute\Model; ++ use Nelmio\ApiDocBundle\Attribute\Operation; ++ use Nelmio\ApiDocBundle\Attribute\Security; +``` + + +## 4.32.0 + +* Added support to configure `options` and `serializationContext` via `nelmio_api_doc.models.names`. +* Fixed `serializationContext` not being applied to nested models. + +## 4.31.0 + +* Added support to opt out of JMS serializer usage per endpoint by setting `useJms` in the serializationContext. + ```php + #[OA\Response(response: 200, content: new Model(type: UserDto::class, serializationContext: ["useJms" => false]))] + ``` + +## 4.30.0 +* Create top level OpenApi Tag from Tags top level annotations/attributes + +## 4.25.3 + +* Calling `DocumentationExtension::getExtendedType()` has been deprecated in favor of `DocumentationExtension::getExtendedTypes()` to align with the deprecation introduced with `symfony/symfony` version `4.2`. + + +## 4.26.0 + +* Add ability to configure UI through configuration +```yaml +nelmio_api_doc: + html_config: + assets_mode: bundle + redocly_config: + expandResponses: '200,201' + hideDownloadButton: true + swagger_ui_config: + deepLinking: true +``` + +## 4.25.0 + +* Added support for [JMS @Discriminator](https://jmsyst.com/libs/serializer/master/reference/annotations#discriminator) annotation/attribute + ```php + #[\JMS\Serializer\Annotation\Discriminator(field: 'type', map: ['car' => Car::class, 'plane' => Plane::class])] + abstract class Vehicle { } + class Car extends Vehicle { } + class Plane extends Vehicle { } + ``` + +## 4.24.0 + +* Added support for some integer ranges (https://phpstan.org/writing-php-code/phpdoc-types#integer-ranges). + Annotations attached to integer properties like: + ```php + /** + * @var int<6, 11> + * @var int + * @var int<6, max> + * @var positive-int + * @var negative-int + */ + ``` + will be interpreted as appropriate `minimum` and `maximum` properties in the generated OpenAPI specification. + +### Minor breaking change +Dropped support for PHP 7.2 and PHP 7.3. PHP 7.4 is the minimum required version now. + +## 4.23.0 + +* Cache configuration option `nelmio_api_doc.cache.item_id` now automatically gets the area appended. + ```yml + nelmio_api_doc: + cache: + pool: app.cache + item_id: nelmio_api_doc.docs + areas: + default: + ... + area1: + ... + ``` + Result in cache keys: `nelmio_api_doc.docs.default` & `nelmio_api_doc.docs.area1` to be used respectively. +* Added cache configuration option per area. + ```yml + nelmio_api_doc: + areas: + default: # Manual cache configuration + cache: + pool: app.cache + item_id: nelmio_api_doc.docs.default + ... + area1: + cache: + pool: app.cache + item_id: nelmio_api_doc.docs.area1 + ... + ``` + Non-configured options will be inherited from `nelmio_api_doc.cache`. +* Fixed vendor extensions (`x-*`) from configuration not being outputted in the generated specification. + ```yml + nelmio_api_doc: + documentation: + info: + title: 'My API' + description: 'My API description' + x-foo: 'bar' + ``` + Now results in JSON specification: + ```json + { + ... + "info": { + "title": "API", + "version": "1.0", + "x-foo": "bar" + }, + ... + } + ``` +* Updated nullable enum handling to align with the behaviour of other object types. It now uses wraps nullable enums with `oneOf` instead of `allOf`. + +## 4.22.0 + +* Updated bundle directory structure to recommended file structure as described in https://symfony.com/doc/7.0/bundles/best_practices.html. + + It might be necessary to reinstall the assets: + ```bash + bin/console assets:install + ``` + +### Breaking change +If your codebase mentions a file or directory by path then an update to this path is necessary. For example to following configuration: +```yaml +doc-api: + resource: "@NelmioApiDocBundle/Resources/config/routing/swaggerui.xml" + prefix: /api/doc +``` +Becomes: +```yaml +doc-api: + resource: "@NelmioApiDocBundle/config/routing/swaggerui.xml" + prefix: /api/doc +``` + +## 4.21.0 + +* Added bundle configuration options `nelmio_api_doc.cache.pool` and `nelmio_api_doc.cache.item_id`. + ```yml + nelmio_api_doc: + cache: + pool: app.cache + item_id: nelmio_api_doc.docs + ``` + +## 4.20.0 + +* Added Redocly as an alternative to Swagger UI. https://github.com/Redocly/redoc. +* Added support for describing dictionary types in OpenAPI 3.0. + +## 4.17.0 + +* Passing groups to `PropertyDescriberInterface::describe()` via the `$groups` parameter is deprecated, the parameter will get removed in a future version. Pass groups via `$context['groups']` instead. + + +## 4.0.0 + +* Added support of OpenAPI 3.0. The internals were completely reworked and this version introduces BC breaks. + +## 3.7.0 + + +* Added `@SerializedName` annotation support and name converters when using Symfony >= 4.2. +* Removed pattern added from the Expression Violation message. +* Added FOSRestBundle 3.x support +* Added `@SWG` annotations support at methods level in models + +## 3.3.0 + + +* Usage of Google Fonts was removed. System fonts `serif` / `sans` will be used instead. This can lead to a different look on different operating systems. You can [re-add Google Fonts again manually by overriding the template](https://symfony.com/doc/current/bundles/NelmioApiDocBundle/faq.html#re-add-google-fonts). * The Twig template for the Swagger UI now contains blocks to make it easier to overwrite certain parts. See the [official documentation](https://symfony.com/doc/current/bundles/NelmioApiDocBundle/customization.html) how to do this. -3.2.0 (2018-03-24) ------------------- +## 3.2.0 (2018-03-24) * Add a documentation form extension. Use the ``documentation`` option to define how a form field is documented. * Allow references to config definitions in controllers. -* Using `@Model` implicitely in `@SWG\Schema`, `@SWG\Items` and `@SWG\Property` is deprecated. Use `ref=@Model()` instead. +* Using `@Model` implicitly in `@SWG\Schema`, `@SWG\Items` and `@SWG\Property` is deprecated. Use `ref=@Model()` instead. Before: ```php @@ -48,8 +307,7 @@ Config * Added dependency for "symfony/options-resolver:^3.4.4|^4.0" -3.1.0 (2018-01-28) ------------------- +## 3.1.0 (2018-01-28) * Added Symfony Validator constraints support @@ -80,8 +338,7 @@ Config areas: [ path_patterns: [ /api ] ] ``` -3.0.0 (2017-12-10) ------------------- +## 3.0.0 (2017-12-10) Large refactoring introducing `zircote/swagger-php` for swagger annotations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2be8a0f5c..fa6c305b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,28 +1,57 @@ -Contributing -============ +# Contributing -First of all, **thank you** for contributing, **you are awesome**! +First of all, **thank you** for contributing, **you are awesome**! With your contribution, you not only improve this +bundle, but also become part of a [great community](https://github.com/nelmio/NelmioApiDocBundle/graphs/contributors) +maintaining it. -Here are a few rules to follow in order to ease code reviews, and discussions before -maintainers accept and merge your work. +## Guidelines -You MUST follow the [PSR-1](http://www.php-fig.org/psr/1/) and -[PSR-2](http://www.php-fig.org/psr/2/). If you don't know about any of them, you -should really read the recommendations. Can't wait? Use the [PHP-CS-Fixer -tool](http://cs.sensiolabs.org/). +Here are a few guidelines to follow in order to ease code reviews, and discussions before maintainers can accept and +merge your work. Thank you! -You MUST run the test suite. +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", +"RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in +[RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119). -You MUST write (or update) unit tests. +### Code Style -You SHOULD write documentation. +Code MUST adhere to all rules outlined in the +[Symfony Coding Standards](https://symfony.com/doc/current/contributing/code/standards.html) as +defined by the [@Symfony](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/ruleSets/Symfony.rst) rule set, +utilized by the [PHP-CS-Fixer](https://cs.symfony.com) tool. -Please, write [commit messages that make -sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), -and [rebase your branch](http://git-scm.com/book/en/Git-Branching-Rebasing) -before submitting your Pull Request. +You SHOULD run `composer run phpcs-check` to check for any violations. You SHOULD run `composer run phpcs-fix` to +fix any potential issues. -Also, while creating your Pull Request on GitHub, you MUST write a description -which gives the context and/or explains why you are creating it. +### Code Quality -Thank you! +You MUST use the static analysis tool [PHPStan](https://phpstan.org/) to analyse any newly added or revised code within +this bundle. + +You MUST run `composer run phpstan` to check for any violations. You MUST fix all violations related to any newly added +or revised code. + +### Tests + +You MUST write (or update) unit and/or functional tests for any newly added or revised functionality within this bundle. + +You MUST validate newly added or revised tests by running `composer run phpunit`. + +### Documentation + +You SHOULD write (or update) documentation. + +You SHOULD write +[commit messages that make sense](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). + +### Pull requests + +You MUST [rebase your branch](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) before submitting your pull request. + +You MUST use a pull request title compliant with the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. + +You MUST write a meaningful description which gives the context and/or explains why you +are creating the pull request. + +You SHOULD resolve review comments instead of commenting. +Once you've done the work, resolve the conversation by selecting the Resolve conversation button in the PR overview. Avoid posting comments like "I've done the work", or "Done". \ No newline at end of file diff --git a/Controller/DocumentationController.php b/Controller/DocumentationController.php deleted file mode 100644 index 2bc0915a5..000000000 --- a/Controller/DocumentationController.php +++ /dev/null @@ -1,57 +0,0 @@ - function () use ($generatorLocator): ApiDocGenerator { - return $generatorLocator; - }]); - } - - $this->generatorLocator = $generatorLocator; - } - - public function __invoke(Request $request, $area = 'default') - { - if (!$this->generatorLocator->has($area)) { - throw new BadRequestHttpException(sprintf('Area "%s" is not supported.', $area)); - } - - $spec = $this->generatorLocator->get($area)->generate()->toArray(); - if ('' !== $request->getBaseUrl()) { - $spec['basePath'] = $request->getBaseUrl(); - } - - return new JsonResponse($spec); - } -} diff --git a/Controller/SwaggerUiController.php b/Controller/SwaggerUiController.php deleted file mode 100644 index a8ccca313..000000000 --- a/Controller/SwaggerUiController.php +++ /dev/null @@ -1,64 +0,0 @@ - function () use ($generatorLocator): ApiDocGenerator { - return $generatorLocator; - }]); - } - - $this->generatorLocator = $generatorLocator; - $this->twig = $twig; - } - - public function __invoke(Request $request, $area = 'default') - { - if (!$this->generatorLocator->has($area)) { - throw new BadRequestHttpException(sprintf('Area "%s" is not supported.', $area)); - } - - $spec = $this->generatorLocator->get($area)->generate()->toArray(); - if ('' !== $request->getBaseUrl()) { - $spec['basePath'] = $request->getBaseUrl(); - } - - return new Response( - $this->twig->render('@NelmioApiDoc/SwaggerUi/index.html.twig', ['swagger_data' => ['spec' => $spec]]), - Response::HTTP_OK, - ['Content-Type' => 'text/html'] - ); - } -} diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php deleted file mode 100644 index 1c04e4a13..000000000 --- a/DependencyInjection/Configuration.php +++ /dev/null @@ -1,110 +0,0 @@ -root('nelmio_api_doc') - ->beforeNormalization() - ->ifTrue(function ($v) { - return !isset($v['areas']) && isset($v['routes']); - }) - ->then(function ($v) { - $v['areas'] = $v['routes']; - unset($v['routes']); - @trigger_error('The `nelmio_api_doc.routes` config option is deprecated. Please use `nelmio_api_doc.areas` instead (just replace `routes` by `areas` in your config).', E_USER_DEPRECATED); - - return $v; - }) - ->end() - ->beforeNormalization() - ->ifTrue(function ($v) { - return isset($v['routes']); - }) - ->thenInvalid('You must not use both `nelmio_api_doc.areas` and `nelmio_api_doc.routes` config options. Please update your config to only use `nelmio_api_doc.areas`.') - ->end() - ->children() - ->arrayNode('documentation') - ->useAttributeAsKey('key') - ->info('The documentation used as base') - ->example(['info' => ['title' => 'My App']]) - ->prototype('variable')->end() - ->end() - ->arrayNode('areas') - ->info('Filter the routes that are documented') - ->defaultValue(['default' => ['path_patterns' => [], 'host_patterns' => []]]) - ->beforeNormalization() - ->ifTrue(function ($v) { - return 0 === count($v) || isset($v['path_patterns']) || isset($v['host_patterns']); - }) - ->then(function ($v) { - return ['default' => $v]; - }) - ->end() - ->validate() - ->ifTrue(function ($v) { - return !isset($v['default']); - }) - ->thenInvalid('You must specify a `default` area under `nelmio_api_doc.areas`.') - ->end() - ->useAttributeAsKey('name') - ->prototype('array') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('path_patterns') - ->defaultValue([]) - ->example(['^/api', '^/api(?!/admin)']) - ->prototype('scalar')->end() - ->end() - ->arrayNode('host_patterns') - ->defaultValue([]) - ->example(['^api\.']) - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->arrayNode('models') - ->addDefaultsIfNotSet() - ->children() - ->booleanNode('use_jms')->defaultFalse()->end() - ->end() - ->children() - ->arrayNode('names') - ->prototype('array') - ->children() - ->scalarNode('alias')->isRequired()->end() - ->scalarNode('type')->isRequired()->end() - ->arrayNode('groups') - ->defaultValue([]) - ->prototype('scalar')->end() - ->end() - ->arrayNode('areas') - ->defaultValue([]) - ->prototype('scalar')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end(); - - return $treeBuilder; - } -} diff --git a/DependencyInjection/NelmioApiDocExtension.php b/DependencyInjection/NelmioApiDocExtension.php deleted file mode 100644 index 1522712d8..000000000 --- a/DependencyInjection/NelmioApiDocExtension.php +++ /dev/null @@ -1,175 +0,0 @@ -prependExtensionConfig('framework', ['property_info' => ['enabled' => true]]); - - $bundles = $container->getParameter('kernel.bundles'); - - // JMS Serializer support - if (isset($bundles['JMSSerializerBundle'])) { - $container->prependExtensionConfig('nelmio_api_doc', ['models' => ['use_jms' => true]]); - } - } - - /** - * {@inheritdoc} - */ - public function load(array $configs, ContainerBuilder $container) - { - $config = $this->processConfiguration(new Configuration(), $configs); - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - - $loader->load('services.xml'); - - // Filter routes - $routesDefinition = (new Definition(RouteCollection::class)) - ->setFactory([new Reference('router'), 'getRouteCollection']); - - $container->setParameter('nelmio_api_doc.areas', array_keys($config['areas'])); - foreach ($config['areas'] as $area => $areaConfig) { - $nameAliases = $this->findNameAliases($config['models']['names'], $area); - - $container->register(sprintf('nelmio_api_doc.generator.%s', $area), ApiDocGenerator::class) - ->setPublic(false) - ->addMethodCall('setAlternativeNames', [$nameAliases]) - ->setArguments([ - new TaggedIteratorArgument(sprintf('nelmio_api_doc.describer.%s', $area)), - new TaggedIteratorArgument('nelmio_api_doc.model_describer'), - ]); - - if (0 === count($areaConfig['path_patterns']) && 0 === count($areaConfig['host_patterns'])) { - $container->setDefinition(sprintf('nelmio_api_doc.routes.%s', $area), $routesDefinition) - ->setPublic(false); - } else { - $container->register(sprintf('nelmio_api_doc.routes.%s', $area), RouteCollection::class) - ->setPublic(false) - ->setFactory([ - (new Definition(FilteredRouteCollectionBuilder::class)) - ->addArgument($areaConfig), - 'filter', - ]) - ->addArgument($routesDefinition); - } - - $container->register(sprintf('nelmio_api_doc.describers.route.%s', $area), RouteDescriber::class) - ->setPublic(false) - ->setArguments([ - new Reference(sprintf('nelmio_api_doc.routes.%s', $area)), - new Reference('nelmio_api_doc.controller_reflector'), - new TaggedIteratorArgument('nelmio_api_doc.route_describer'), - ]) - ->addTag(sprintf('nelmio_api_doc.describer.%s', $area), ['priority' => -400]); - - $container->register(sprintf('nelmio_api_doc.describers.swagger_php.%s', $area), SwaggerPhpDescriber::class) - ->setPublic(false) - ->setArguments([ - new Reference(sprintf('nelmio_api_doc.routes.%s', $area)), - new Reference('nelmio_api_doc.controller_reflector'), - new Reference('annotation_reader'), - new Reference('logger'), - ]) - ->addTag(sprintf('nelmio_api_doc.describer.%s', $area), ['priority' => -200]); - } - - $container->register('nelmio_api_doc.generator_locator') - ->setPublic(false) - ->addTag('container.service_locator') - ->addArgument(array_combine( - array_keys($config['areas']), - array_map(function ($area) { return new Reference(sprintf('nelmio_api_doc.generator.%s', $area)); }, array_keys($config['areas'])) - )); - - // Import services needed for each library - $loader->load('php_doc.xml'); - - if (interface_exists(ParamInterface::class)) { - $loader->load('fos_rest.xml'); - } - - // ApiPlatform support - $bundles = $container->getParameter('kernel.bundles'); - if (!isset($bundles['TwigBundle'])) { - $container->removeDefinition('nelmio_api_doc.controller.swagger_ui'); - } - if (isset($bundles['ApiPlatformBundle']) && class_exists('ApiPlatform\Core\Documentation\Documentation')) { - $loader->load('api_platform.xml'); - } - - // JMS metadata support - if ($config['models']['use_jms']) { - $container->register('nelmio_api_doc.model_describers.jms', JMSModelDescriber::class) - ->setPublic(false) - ->setArguments([ - new Reference('jms_serializer.metadata_factory'), - new Reference('jms_serializer.naming_strategy'), - new Reference('annotation_reader'), - ]) - ->addTag('nelmio_api_doc.model_describer', ['priority' => 50]); - - // Bazinga Hateoas metadata support - if (isset($bundles['BazingaHateoasBundle'])) { - $container->register('nelmio_api_doc.model_describers.jms.bazinga_hateoas', BazingaHateoasModelDescriber::class) - ->setDecoratedService('nelmio_api_doc.model_describers.jms', 'nelmio_api_doc.model_describers.jms.inner') - ->setPublic(false) - ->setArguments([ - new Reference('hateoas.configuration.metadata_factory'), - new Reference('nelmio_api_doc.model_describers.jms.inner'), - ]); - } - } - - // Import the base configuration - $container->getDefinition('nelmio_api_doc.describers.config')->replaceArgument(0, $config['documentation']); - } - - private function findNameAliases(array $names, string $area): array - { - $nameAliases = array_filter($names, function (array $aliasInfo) use ($area) { - return empty($aliasInfo['areas']) || in_array($area, $aliasInfo['areas'], true); - }); - - $aliases = []; - foreach ($nameAliases as $nameAlias) { - $aliases[$nameAlias['alias']] = [ - 'type' => $nameAlias['type'], - 'groups' => $nameAlias['groups'], - ]; - } - - return $aliases; - } -} diff --git a/Describer/ApiPlatformDescriber.php b/Describer/ApiPlatformDescriber.php deleted file mode 100644 index 2a77f4c1a..000000000 --- a/Describer/ApiPlatformDescriber.php +++ /dev/null @@ -1,34 +0,0 @@ -normalize($documentation); - unset($documentation['basePath']); - - return $documentation; - }); - } -} diff --git a/Describer/DefaultDescriber.php b/Describer/DefaultDescriber.php deleted file mode 100644 index 0b7c8ffad..000000000 --- a/Describer/DefaultDescriber.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -final class DefaultDescriber implements DescriberInterface -{ - public function describe(Swagger $api) - { - // Info - $info = $api->getInfo(); - if (null === $info->getTitle()) { - $info->setTitle(''); - } - if (null === $info->getVersion()) { - $info->setVersion('0.0.0'); - } - - // Paths - $paths = $api->getPaths(); - foreach ($paths as $uri => $path) { - foreach ($path->getMethods() as $method) { - $operation = $path->getOperation($method); - - // Default Response - if (0 === iterator_count($operation->getResponses())) { - $defaultResponse = $operation->getResponses()->get('default'); - $defaultResponse->setDescription(''); - } - } - } - } -} diff --git a/Describer/SwaggerPhpDescriber.php b/Describer/SwaggerPhpDescriber.php deleted file mode 100644 index b23fd8ca0..000000000 --- a/Describer/SwaggerPhpDescriber.php +++ /dev/null @@ -1,271 +0,0 @@ -routeCollection = $routeCollection; - $this->controllerReflector = $controllerReflector; - $this->annotationReader = $annotationReader; - $this->logger = $logger; - $this->overwrite = $overwrite; - } - - public function describe(Swagger $api) - { - $analysis = $this->getAnnotations($api); - - $analysis->process($this->getProcessors()); - $analysis->validate(); - - $api->merge(json_decode(json_encode($analysis->swagger), true), $this->overwrite); - } - - private function getProcessors(): array - { - $processors = [ - new AddDefaults(), - new ModelRegister($this->modelRegistry), - ]; - - return array_merge($processors, Analysis::processors()); - } - - private function getAnnotations(Swagger $api): Analysis - { - $analysis = new Analysis(); - $analysis->addAnnotation(new class($api) extends SWG\Swagger { - private $api; - - public function __construct(Swagger $api) - { - $this->api = $api; - parent::__construct([]); - } - - /** - * Support definitions from the config and reference to models. - */ - public function ref($ref) - { - if (0 === strpos($ref, '#/definitions/') && $this->api->getDefinitions()->has(substr($ref, 14))) { - return; - } - if (0 === strpos($ref, '#/parameters/') && isset($this->api->getParameters()[substr($ref, 13)])) { - return; - } - - parent::ref($ref); - } - }, null); - - $operationAnnotations = [ - 'get' => SWG\Get::class, - 'post' => SWG\Post::class, - 'put' => SWG\Put::class, - 'patch' => SWG\Patch::class, - 'delete' => SWG\Delete::class, - 'options' => SWG\Options::class, - 'head' => SWG\Head::class, - ]; - - $classAnnotations = []; - - foreach ($this->getMethodsToParse() as $method => list($path, $httpMethods)) { - $declaringClass = $method->getDeclaringClass(); - if (!array_key_exists($declaringClass->getName(), $classAnnotations)) { - $classAnnotations = array_filter($this->annotationReader->getClassAnnotations($declaringClass), function ($v) { - return $v instanceof SWG\AbstractAnnotation; - }); - $classAnnotations[$declaringClass->getName()] = $classAnnotations; - } - - $annotations = array_filter($this->annotationReader->getMethodAnnotations($method), function ($v) { - return $v instanceof SWG\AbstractAnnotation; - }); - - if (0 === count($annotations)) { - continue; - } - - $context = new Context([ - 'namespace' => $method->getNamespaceName(), - 'class' => $declaringClass->getShortName(), - 'method' => $method->name, - 'filename' => $method->getFileName(), - ]); - $nestedContext = clone $context; - $nestedContext->nested = true; - $implicitAnnotations = []; - $operations = []; - $tags = []; - $security = []; - foreach (array_merge($annotations, $classAnnotations[$declaringClass->getName()]) as $annotation) { - $annotation->_context = $context; - $this->updateNestedAnnotations($annotation, $nestedContext); - - if ($annotation instanceof Operation) { - foreach ($httpMethods as $httpMethod) { - $annotationClass = $operationAnnotations[$httpMethod]; - $operation = new $annotationClass(['_context' => $context]); - $operation->path = $path; - $operation->mergeProperties($annotation); - - $operations[$httpMethod] = $operation; - $analysis->addAnnotation($operation, null); - } - - continue; - } - - if ($annotation instanceof SWG\Operation) { - if (null === $annotation->path) { - $annotation = clone $annotation; - $annotation->path = $path; - } - - $operations[$annotation->method] = $annotation; - $analysis->addAnnotation($annotation, null); - - continue; - } - - if ($annotation instanceof Security) { - $annotation->validate(); - $security[] = [$annotation->name => []]; - - continue; - } - - if ($annotation instanceof SWG\Tag) { - $annotation->validate(); - $tags[] = $annotation->name; - - continue; - } - - if (!$annotation instanceof SWG\Response && !$annotation instanceof SWG\Parameter && !$annotation instanceof SWG\ExternalDocumentation) { - throw new \LogicException(sprintf('Using the annotation "%s" as a root annotation in "%s::%s()" is not allowed.', get_class($annotation), $method->getDeclaringClass()->name, $method->name)); - } - - $implicitAnnotations[] = $annotation; - } - - if (0 === count($implicitAnnotations) && 0 === count($tags) && 0 === count($security)) { - continue; - } - - // Registers new annotations - $analysis->addAnnotations($implicitAnnotations, null); - - foreach ($httpMethods as $httpMethod) { - $annotationClass = $operationAnnotations[$httpMethod]; - $constructorArg = [ - '_context' => $context, - 'path' => $path, - 'value' => $implicitAnnotations, - ]; - - if (0 !== count($tags)) { - $constructorArg['tags'] = $tags; - } - if (0 !== count($security)) { - $constructorArg['security'] = $security; - } - - $operation = new $annotationClass($constructorArg); - if (isset($operations[$httpMethod])) { - $operations[$httpMethod]->mergeProperties($operation); - } else { - $analysis->addAnnotation($operation, null); - } - } - } - - return $analysis; - } - - private function getMethodsToParse(): \Generator - { - foreach ($this->routeCollection->all() as $route) { - if (!$route->hasDefault('_controller')) { - continue; - } - - $controller = $route->getDefault('_controller'); - if ($callable = $this->controllerReflector->getReflectionClassAndMethod($controller)) { - list($class, $method) = $callable; - $path = $this->normalizePath($route->getPath()); - $httpMethods = $route->getMethods() ?: Swagger::$METHODS; - $httpMethods = array_map('strtolower', $httpMethods); - $supportedHttpMethods = array_intersect($httpMethods, Swagger::$METHODS); - - if (empty($supportedHttpMethods)) { - $this->logger->warning('None of the HTTP methods specified for path {path} are supported by swagger-ui, skipping this path', [ - 'path' => $path, - 'methods' => $httpMethods, - ]); - - continue; - } - - yield $method => [$path, $supportedHttpMethods]; - } - } - } - - private function normalizePath(string $path): string - { - if ('.{_format}' === substr($path, -10)) { - $path = substr($path, 0, -10); - } - - return $path; - } - - private function updateNestedAnnotations($value, Context $context) - { - if ($value instanceof AbstractAnnotation) { - $value->_context = $context; - } elseif (!is_array($value)) { - return; - } - - foreach ($value as $v) { - $this->updateNestedAnnotations($v, $context); - } - } -} diff --git a/Model/Model.php b/Model/Model.php deleted file mode 100644 index d24ed017a..000000000 --- a/Model/Model.php +++ /dev/null @@ -1,51 +0,0 @@ -type = $type; - $this->groups = $groups; - } - - /** - * @return Type - */ - public function getType() - { - return $this->type; - } - - /** - * @return string[]|null - */ - public function getGroups() - { - return $this->groups; - } - - public function getHash(): string - { - return md5(serialize([$this->type, $this->groups])); - } -} diff --git a/Model/ModelRegistry.php b/Model/ModelRegistry.php deleted file mode 100644 index 1d1a96d77..000000000 --- a/Model/ModelRegistry.php +++ /dev/null @@ -1,163 +0,0 @@ -modelDescribers = $modelDescribers; - $this->api = $api; - $this->alternativeNames = array_reverse($alternativeNames); // last rule wins - } - - public function register(Model $model): string - { - $hash = $model->getHash(); - if (isset($this->names[$hash])) { - return '#/definitions/'.$this->names[$hash]; - } - - $this->names[$hash] = $name = $this->generateModelName($model); - $this->models[$hash] = $model; - $this->unregistered[] = $hash; - - // Reserve the name - $this->api->getDefinitions()->get($name); - - return '#/definitions/'.$name; - } - - /** - * @internal - */ - public function registerDefinitions() - { - while (count($this->unregistered)) { - $tmp = []; - foreach ($this->unregistered as $hash) { - $tmp[$this->names[$hash]] = $this->models[$hash]; - } - $this->unregistered = []; - - foreach ($tmp as $name => $model) { - $schema = null; - foreach ($this->modelDescribers as $modelDescriber) { - if ($modelDescriber instanceof ModelRegistryAwareInterface) { - $modelDescriber->setModelRegistry($this); - } - if ($modelDescriber->supports($model)) { - $schema = new Schema(); - $modelDescriber->describe($model, $schema); - - break; - } - } - - if (null === $schema) { - throw new \LogicException(sprintf('Schema of type "%s" can\'t be generated, no describer supports it.', $this->typeToString($model->getType()))); - } - - $this->api->getDefinitions()->set($name, $schema); - } - } - } - - private function generateModelName(Model $model): string - { - $definitions = $this->api->getDefinitions(); - - $name = $base = $this->getAlternativeName($model) ?? $this->getTypeShortName($model->getType()); - - $i = 1; - while ($definitions->has($name)) { - ++$i; - $name = $base.$i; - } - - return $name; - } - - /** - * @param Model $model - * - * @return string|null - */ - private function getAlternativeName(Model $model) - { - $type = $model->getType(); - foreach ($this->alternativeNames as $alternativeName => $criteria) { - if ( - Type::BUILTIN_TYPE_OBJECT === $type->getBuiltinType() && - $type->getClassName() === $criteria['type'] && - $criteria['groups'] == $model->getGroups() - ) { - return $alternativeName; - } - } - - return null; - } - - private function getTypeShortName(Type $type): string - { - if (null !== $type->getCollectionValueType()) { - return $this->getTypeShortName($type->getCollectionValueType()).'[]'; - } - - if (Type::BUILTIN_TYPE_OBJECT === $type->getBuiltinType()) { - $parts = explode('\\', $type->getClassName()); - - return end($parts); - } - - return $type->getBuiltinType(); - } - - private function typeToString(Type $type): string - { - if (Type::BUILTIN_TYPE_OBJECT === $type->getBuiltinType()) { - return $type->getClassName(); - } elseif ($type->isCollection()) { - if (null !== $type->getCollectionValueType()) { - return $this->typeToString($type->getCollectionValueType()).'[]'; - } else { - return 'mixed[]'; - } - } else { - return $type->getBuiltinType(); - } - } -} diff --git a/ModelDescriber/Annotations/AnnotationsReader.php b/ModelDescriber/Annotations/AnnotationsReader.php deleted file mode 100644 index 5c9f92c1f..000000000 --- a/ModelDescriber/Annotations/AnnotationsReader.php +++ /dev/null @@ -1,57 +0,0 @@ -annotationsReader = $annotationsReader; - $this->modelRegistry = $modelRegistry; - - $this->phpDocReader = new PropertyPhpDocReader(); - $this->swgAnnotationsReader = new SwgAnnotationsReader($annotationsReader, $modelRegistry); - $this->symfonyConstraintAnnotationReader = new SymfonyConstraintAnnotationReader($annotationsReader); - } - - public function updateDefinition(\ReflectionClass $reflectionClass, Schema $schema) - { - $this->swgAnnotationsReader->updateDefinition($reflectionClass, $schema); - $this->symfonyConstraintAnnotationReader->setSchema($schema); - } - - public function getPropertyName(\ReflectionProperty $reflectionProperty, string $default): string - { - return $this->swgAnnotationsReader->getPropertyName($reflectionProperty, $default); - } - - public function updateProperty(\ReflectionProperty $reflectionProperty, Schema $property, array $serializationGroups = null) - { - $this->phpDocReader->updateProperty($reflectionProperty, $property); - $this->swgAnnotationsReader->updateProperty($reflectionProperty, $property, $serializationGroups); - $this->symfonyConstraintAnnotationReader->updateProperty($reflectionProperty, $property); - } -} diff --git a/ModelDescriber/Annotations/PropertyPhpDocReader.php b/ModelDescriber/Annotations/PropertyPhpDocReader.php deleted file mode 100644 index 8cac5cd46..000000000 --- a/ModelDescriber/Annotations/PropertyPhpDocReader.php +++ /dev/null @@ -1,64 +0,0 @@ -docBlockFactory = DocBlockFactory::createInstance(); - } - - /** - * Update the Swagger information with information from the DocBlock comment. - */ - public function updateProperty(\ReflectionProperty $reflectionProperty, Schema $property) - { - try { - $docBlock = $this->docBlockFactory->create($reflectionProperty); - } catch (\Exception $e) { - // ignore - return; - } - - if (!$title = $docBlock->getSummary()) { - /** @var Var_ $var */ - foreach ($docBlock->getTagsByName('var') as $var) { - if (!$description = $var->getDescription()) { - continue; - } - $title = $description->render(); - if ($title) { - break; - } - } - } - if (null === $property->getTitle() && $title) { - $property->setTitle($title); - } - if (null === $property->getDescription() && $docBlock->getDescription() && $docBlock->getDescription()->render()) { - $property->setDescription($docBlock->getDescription()->render()); - } - } -} diff --git a/ModelDescriber/Annotations/SwgAnnotationsReader.php b/ModelDescriber/Annotations/SwgAnnotationsReader.php deleted file mode 100644 index 9d365dffd..000000000 --- a/ModelDescriber/Annotations/SwgAnnotationsReader.php +++ /dev/null @@ -1,89 +0,0 @@ -annotationsReader = $annotationsReader; - $this->modelRegister = new ModelRegister($modelRegistry); - } - - public function updateDefinition(\ReflectionClass $reflectionClass, Schema $schema) - { - /** @var SwgDefinition $swgDefinition */ - if (!$swgDefinition = $this->annotationsReader->getClassAnnotation($reflectionClass, SwgDefinition::class)) { - return; - } - - // Read @Model annotations - $this->modelRegister->__invoke(new Analysis([$swgDefinition])); - - if (!$swgDefinition->validate()) { - return; - } - - $schema->merge(json_decode(json_encode($swgDefinition))); - } - - public function getPropertyName(\ReflectionProperty $reflectionProperty, string $default): string - { - /** @var SwgProperty $swgProperty */ - if (!$swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class)) { - return $default; - } - - return $swgProperty->property ?? $default; - } - - public function updateProperty(\ReflectionProperty $reflectionProperty, Schema $property, array $serializationGroups = null) - { - if (!$swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class)) { - return; - } - - $declaringClass = $reflectionProperty->getDeclaringClass(); - $context = new Context([ - 'namespace' => $declaringClass->getNamespaceName(), - 'class' => $declaringClass->getShortName(), - 'property' => $reflectionProperty->name, - 'filename' => $declaringClass->getFileName(), - ]); - $swgProperty->_context = $context; - - // Read @Model annotations - $this->modelRegister->__invoke(new Analysis([$swgProperty]), $serializationGroups); - - if (!$swgProperty->validate()) { - return; - } - - $property->merge(json_decode(json_encode($swgProperty))); - } -} diff --git a/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php b/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php deleted file mode 100644 index c4df7cdbd..000000000 --- a/ModelDescriber/Annotations/SymfonyConstraintAnnotationReader.php +++ /dev/null @@ -1,118 +0,0 @@ -annotationsReader = $annotationsReader; - } - - /** - * Update the given property and schema with defined Symfony constraints. - */ - public function updateProperty(\ReflectionProperty $reflectionProperty, Schema $property) - { - $annotations = $this->annotationsReader->getPropertyAnnotations($reflectionProperty); - - foreach ($annotations as $annotation) { - if ($annotation instanceof Assert\NotBlank || $annotation instanceof Assert\NotNull) { - $this->updateSchemaDefinitionWithRequiredProperty($reflectionProperty); - } - - if ($annotation instanceof Assert\Length) { - if ($annotation->min > 0) { - $this->updateSchemaDefinitionWithRequiredProperty($reflectionProperty); - } - - $property->setMinLength($annotation->min); - $property->setMaxLength($annotation->max); - } - - if ($annotation instanceof Assert\Regex) { - $this->appendPattern($property, $annotation->getHtmlPattern()); - } - - if ($annotation instanceof Assert\DateTime) { - $this->appendPattern($property, $annotation->format); - } - - if ($annotation instanceof Assert\Count) { - $property->setMinItems($annotation->min); - $property->setMaxItems($annotation->max); - } - - if ($annotation instanceof Assert\Choice) { - $property->setEnum($annotation->callback ? call_user_func($annotation->callback) : $annotation->choices); - } - - if ($annotation instanceof Assert\Expression) { - $this->appendPattern($property, $annotation->message); - } - } - } - - public function setSchema($schema) - { - $this->schema = $schema; - } - - /** - * Set the required properties on the scheme. - */ - private function updateSchemaDefinitionWithRequiredProperty(\ReflectionProperty $reflectionProperty) - { - if (null === $this->schema) { - return; - } - - $existingRequiredFields = $this->schema->getRequired() ?? []; - - $existingRequiredFields[] = $reflectionProperty->getName(); - - $this->schema->setRequired(array_values(array_unique($existingRequiredFields))); - } - - /** - * Append the pattern from the constraint to the existing pattern. - */ - private function appendPattern(Schema $property, $newPattern) - { - if (null === $newPattern) { - return; - } - - if (null !== $property->getPattern()) { - $property->setPattern(sprintf('%s, %s', $property->getPattern(), $newPattern)); - } else { - $property->setPattern($newPattern); - } - } -} diff --git a/ModelDescriber/BazingaHateoasModelDescriber.php b/ModelDescriber/BazingaHateoasModelDescriber.php deleted file mode 100644 index e967f1ac9..000000000 --- a/ModelDescriber/BazingaHateoasModelDescriber.php +++ /dev/null @@ -1,146 +0,0 @@ -factory = $factory; - $this->JMSModelDescriber = $JMSModelDescriber; - } - - public function setModelRegistry(ModelRegistry $modelRegistry) - { - $this->modelRegistry = $modelRegistry; - $this->JMSModelDescriber->setModelRegistry($modelRegistry); - } - - /** - * {@inheritdoc} - */ - public function describe(Model $model, Schema $schema) - { - $this->JMSModelDescriber->describe($model, $schema); - - $metadata = $this->getHateoasMetadata($model); - if (null === $metadata) { - return; - } - - $groupsExclusion = null !== $model->getGroups() ? new GroupsExclusionStrategy($model->getGroups()) : null; - - $schema->setType('object'); - - foreach ($metadata->getRelations() as $relation) { - if (!$relation->getEmbedded() && !$relation->getHref()) { - continue; - } - - if (null !== $groupsExclusion && $relation->getExclusion()) { - $item = new RelationPropertyMetadata($relation->getExclusion(), $relation); - - // filter groups - if ($groupsExclusion->shouldSkipProperty($item, SerializationContext::create())) { - continue; - } - } - - $name = $relation->getName(); - - $relationSchema = $schema->getProperties()->get($relation->getEmbedded() ? '_embedded' : '_links'); - - $properties = $relationSchema->getProperties(); - $relationSchema->setReadOnly(true); - - $property = $properties->get($name); - $property->setType('object'); - - if ($relation->getHref()) { - $subProperties = $property->getProperties(); - - $hrefProp = $subProperties->get('href'); - $hrefProp->setType('string'); - - $this->setAttributeProperties($relation, $subProperties); - } - } - } - - private function getHateoasMetadata(Model $model) - { - $className = $model->getType()->getClassName(); - - try { - if ($metadata = $this->factory->getMetadataForClass($className)) { - return $metadata; - } - } catch (\ReflectionException $e) { - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function supports(Model $model): bool - { - return $this->JMSModelDescriber->supports($model) || null !== $this->getHateoasMetadata($model); - } - - private function setAttributeProperties(Relation $relation, $subProperties) - { - foreach ($relation->getAttributes() as $attribute => $value) { - $subSubProp = $subProperties->get($attribute); - switch (gettype($value)) { - case 'integer': - $subSubProp->setType('integer'); - $subSubProp->setDefault($value); - - break; - case 'double': - case 'float': - $subSubProp->setType('number'); - $subSubProp->setDefault($value); - - break; - case 'boolean': - $subSubProp->setType('boolean'); - $subSubProp->setDefault($value); - - break; - case 'string': - $subSubProp->setType('string'); - $subSubProp->setDefault($value); - - break; - } - } - } -} diff --git a/ModelDescriber/FormModelDescriber.php b/ModelDescriber/FormModelDescriber.php deleted file mode 100644 index 3cbebf854..000000000 --- a/ModelDescriber/FormModelDescriber.php +++ /dev/null @@ -1,243 +0,0 @@ -formFactory = $formFactory; - } - - public function describe(Model $model, Schema $schema) - { - if (method_exists(AbstractType::class, 'setDefaultOptions')) { - throw new \LogicException('symfony/form < 3.0 is not supported, please upgrade to an higher version to use a form as a model.'); - } - if (null === $this->formFactory) { - throw new \LogicException('You need to enable forms in your application to use a form as a model.'); - } - - $schema->setType('object'); - - $class = $model->getType()->getClassName(); - - $form = $this->formFactory->create($class, null, []); - $this->parseForm($schema, $form); - } - - public function supports(Model $model): bool - { - return is_a($model->getType()->getClassName(), FormTypeInterface::class, true); - } - - private function parseForm(Schema $schema, FormInterface $form) - { - $properties = $schema->getProperties(); - - foreach ($form as $name => $child) { - $config = $child->getConfig(); - $property = $properties->get($name); - - if ($config->getRequired()) { - $required = $schema->getRequired() ?? []; - $required[] = $name; - - $schema->setRequired($required); - } - - $property->merge($config->getOption('documentation')); - if (null !== $property->getType()) { - continue; // Type manually defined - } - - $this->findFormType($config, $property); - } - } - - /** - * Finds and sets the schema type on $property based on $config info. - * - * Returns true if a native Swagger type was found, false otherwise - * - * @param FormConfigBuilderInterface $config - * @param $property - * - * @return bool - */ - private function findFormType(FormConfigBuilderInterface $config, $property): bool - { - $type = $config->getType(); - - if (!$builtinFormType = $this->getBuiltinFormType($type)) { - // if form type is not builtin in Form component. - $model = new Model(new Type(Type::BUILTIN_TYPE_OBJECT, false, get_class($type->getInnerType()))); - $property->setRef($this->modelRegistry->register($model)); - - return false; - } - - do { - $blockPrefix = $builtinFormType->getBlockPrefix(); - - if ('text' === $blockPrefix) { - $property->setType('string'); - - return true; - } - - if ('number' === $blockPrefix) { - $property->setType('number'); - - return true; - } - - if ('integer' === $blockPrefix) { - $property->setType('integer'); - - return true; - } - - if ('date' === $blockPrefix) { - $property->setType('string'); - $property->setFormat('date'); - - return true; - } - - if ('datetime' === $blockPrefix) { - $property->setType('string'); - $property->setFormat('date-time'); - - return true; - } - - if ('choice' === $blockPrefix) { - if ($config->getOption('multiple')) { - $property->setType('array'); - } else { - $property->setType('string'); - } - if (($choices = $config->getOption('choices')) && is_array($choices) && count($choices)) { - $enums = array_values($choices); - $type = $this->isNumbersArray($enums) ? 'number' : 'string'; - if ($config->getOption('multiple')) { - $property->getItems()->setType($type)->setEnum($enums); - } else { - $property->setType($type)->setEnum($enums); - } - } - - return true; - } - - if ('checkbox' === $blockPrefix) { - $property->setType('boolean'); - - return true; - } - - if ('collection' === $blockPrefix) { - $subType = $config->getOption('entry_type'); - $subOptions = $config->getOption('entry_options'); - $subForm = $this->formFactory->create($subType, null, $subOptions); - - $property->setType('array'); - $itemsProp = $property->getItems(); - - if (!$this->findFormType($subForm->getConfig(), $itemsProp)) { - $property->setExample(sprintf('[{%s}]', $subType)); - } - - return true; - } - - if ('entity' === $blockPrefix) { - $entityClass = $config->getOption('class'); - - if ($config->getOption('multiple')) { - $property->setFormat(sprintf('[%s id]', $entityClass)); - $property->setType('array'); - } else { - $property->setType('string'); - $property->setFormat(sprintf('%s id', $entityClass)); - } - - return true; - } - } while ($builtinFormType = $builtinFormType->getParent()); - - return false; - } - - /** - * @param array $array - * - * @return bool true if $array contains only numbers, false otherwise - */ - private function isNumbersArray(array $array): bool - { - foreach ($array as $item) { - if (!is_numeric($item)) { - return false; - } - } - - return true; - } - - /** - * @param ResolvedFormTypeInterface $type - * - * @return ResolvedFormTypeInterface|null - */ - private function getBuiltinFormType(ResolvedFormTypeInterface $type) - { - do { - $class = get_class($type->getInnerType()); - - if (FormType::class === $class) { - return null; - } - - if ('entity' === $type->getBlockPrefix()) { - return $type; - } - - if (0 === strpos($class, 'Symfony\Component\Form\Extension\Core\Type\\')) { - return $type; - } - } while ($type = $type->getParent()); - - return null; - } -} diff --git a/ModelDescriber/JMSModelDescriber.php b/ModelDescriber/JMSModelDescriber.php deleted file mode 100644 index 1a067406d..000000000 --- a/ModelDescriber/JMSModelDescriber.php +++ /dev/null @@ -1,212 +0,0 @@ -factory = $factory; - $this->namingStrategy = $namingStrategy; - $this->doctrineReader = $reader; - } - - /** - * {@inheritdoc} - */ - public function describe(Model $model, Schema $schema) - { - $className = $model->getType()->getClassName(); - $metadata = $this->factory->getMetadataForClass($className); - if (null === $metadata) { - throw new \InvalidArgumentException(sprintf('No metadata found for class %s.', $className)); - } - - $groupsExclusion = null !== $model->getGroups() ? new GroupsExclusionStrategy($model->getGroups()) : null; - - $schema->setType('object'); - $annotationsReader = new AnnotationsReader($this->doctrineReader, $this->modelRegistry); - $annotationsReader->updateDefinition(new \ReflectionClass($className), $schema); - - $properties = $schema->getProperties(); - foreach ($metadata->propertyMetadata as $item) { - // filter groups - if (null !== $groupsExclusion && $groupsExclusion->shouldSkipProperty($item, SerializationContext::create())) { - continue; - } - - $name = $this->namingStrategy->translateName($item); - $groups = $model->getGroups(); - if (isset($groups[$name]) && is_array($groups[$name])) { - $groups = $model->getGroups()[$name]; - } - - // read property options from Swagger Property annotation if it exists - if (null !== $item->reflection) { - $property = $properties->get($annotationsReader->getPropertyName($item->reflection, $name)); - $annotationsReader->updateProperty($item->reflection, $property, $groups); - } else { - $property = $properties->get($name); - } - - if (null !== $property->getType() || null !== $property->getRef()) { - continue; - } - if (null === $item->type) { - $properties->remove($name); - - continue; - } - - if ($nestedType = $this->getNestedTypeInArray($item)) { - list($type, $isHash) = $nestedType; - if ($isHash) { - $property->setType('object'); - - $typeDef = $this->findPropertyType($type, $groups); - - // in the case of a virtual property, set it as free object type - $property->merge(['additionalProperties' => $typeDef ?: []]); - - continue; - } else { - $property->setType('array'); - $property = $property->getItems(); - } - } else { - $type = $item->type['name']; - } - - $typeDef = $this->findPropertyType($type, $groups); - - // virtual property - if (!$typeDef) { - continue; - } - - $this->registerPropertyType($typeDef, $property); - } - } - - /** - * {@inheritdoc} - */ - public function supports(Model $model): bool - { - $className = $model->getType()->getClassName(); - - try { - if ($this->factory->getMetadataForClass($className)) { - return true; - } - } catch (\ReflectionException $e) { - } - - return false; - } - - /** - * @param string $type - * @param array|null $groups - * - * @return array|null - */ - private function findPropertyType(string $type, array $groups = null) - { - $typeDef = []; - if (in_array($type, ['boolean', 'string', 'array'])) { - $typeDef['type'] = $type; - } elseif (in_array($type, ['int', 'integer'])) { - $typeDef['type'] = 'integer'; - } elseif (in_array($type, ['double', 'float'])) { - $typeDef['type'] = 'number'; - $typeDef['format'] = $type; - } elseif (is_subclass_of($type, \DateTimeInterface::class)) { - $typeDef['type'] = 'string'; - $typeDef['format'] = 'date-time'; - } else { - // we can use property type also for custom handlers, then we don't have here real class name - if (!class_exists($type)) { - return null; - } - - $typeDef['$ref'] = $this->modelRegistry->register( - new Model(new Type(Type::BUILTIN_TYPE_OBJECT, false, $type), $groups) - ); - } - - return $typeDef; - } - - private function registerPropertyType(array $typeDef, $property) - { - if (isset($typeDef['$ref'])) { - $property->setRef($typeDef['$ref']); - } else { - if (isset($typeDef['type'])) { - $property->setType($typeDef['type']); - } - if (isset($typeDef['format'])) { - $property->setFormat($typeDef['format']); - } - } - } - - /** - * @param PropertyMetadata $item - * - * @return array|null - */ - private function getNestedTypeInArray(PropertyMetadata $item) - { - if ('array' !== $item->type['name'] && 'ArrayCollection' !== $item->type['name']) { - return null; - } - - // array - if (isset($item->type['params'][1]['name'])) { - return [$item->type['params'][1]['name'], true]; - } - - // array - if (isset($item->type['params'][0]['name'])) { - return [$item->type['params'][0]['name'], false]; - } - - return null; - } -} diff --git a/ModelDescriber/ObjectModelDescriber.php b/ModelDescriber/ObjectModelDescriber.php deleted file mode 100644 index 55b634017..000000000 --- a/ModelDescriber/ObjectModelDescriber.php +++ /dev/null @@ -1,127 +0,0 @@ -propertyInfo = $propertyInfo; - $this->doctrineReader = $reader; - } - - public function describe(Model $model, Schema $schema) - { - $schema->setType('object'); - $properties = $schema->getProperties(); - - $class = $model->getType()->getClassName(); - $context = []; - if (null !== $model->getGroups()) { - $context = ['serializer_groups' => $model->getGroups()]; - } - - $annotationsReader = new AnnotationsReader($this->doctrineReader, $this->modelRegistry); - $annotationsReader->updateDefinition(new \ReflectionClass($class), $schema); - - $propertyInfoProperties = $this->propertyInfo->getProperties($class, $context); - if (null === $propertyInfoProperties) { - return; - } - - foreach ($propertyInfoProperties as $propertyName) { - // read property options from Swagger Property annotation if it exists - if (property_exists($class, $propertyName)) { - $reflectionProperty = new \ReflectionProperty($class, $propertyName); - $property = $properties->get($annotationsReader->getPropertyName($reflectionProperty, $propertyName)); - - $groups = $model->getGroups(); - if (isset($groups[$propertyName]) && is_array($groups[$propertyName])) { - $groups = $model->getGroups()[$propertyName]; - } - - $annotationsReader->updateProperty($reflectionProperty, $property, $groups); - } else { - $property = $properties->get($propertyName); - } - - // If type manually defined - if (null !== $property->getType() || null !== $property->getRef()) { - continue; - } - - $types = $this->propertyInfo->getTypes($class, $propertyName); - if (null === $types || 0 === count($types)) { - throw new \LogicException(sprintf('The PropertyInfo component was not able to guess the type of %s::$%s', $class, $propertyName)); - } - if (count($types) > 1) { - throw new \LogicException(sprintf('Property %s::$%s defines more than one type.', $class, $propertyName)); - } - - $type = $types[0]; - if (Type::BUILTIN_TYPE_ARRAY === $type->getBuiltinType()) { - $type = $type->getCollectionValueType(); - if (null === $type) { - throw new \LogicException(sprintf('Property "%s:%s" is an array, but no indication of the array elements are made. Use e.g. string[] for an array of string.', $class, $propertyName)); - } - - $property->setType('array'); - $property = $property->getItems(); - } - - if (Type::BUILTIN_TYPE_STRING === $type->getBuiltinType()) { - $property->setType('string'); - } elseif (Type::BUILTIN_TYPE_BOOL === $type->getBuiltinType()) { - $property->setType('boolean'); - } elseif (Type::BUILTIN_TYPE_INT === $type->getBuiltinType()) { - $property->setType('integer'); - } elseif (Type::BUILTIN_TYPE_FLOAT === $type->getBuiltinType()) { - $property->setType('number'); - $property->setFormat('float'); - } elseif (Type::BUILTIN_TYPE_OBJECT === $type->getBuiltinType()) { - if (is_subclass_of($type->getClassName(), \DateTimeInterface::class)) { - $property->setType('string'); - $property->setFormat('date-time'); - } else { - $property->setRef( - $this->modelRegistry->register(new Model($type, $model->getGroups())) - ); - } - } else { - throw new \Exception(sprintf('Unknown type: %s', $type->getBuiltinType())); - } - } - } - - public function supports(Model $model): bool - { - return Type::BUILTIN_TYPE_OBJECT === $model->getType()->getBuiltinType(); - } -} diff --git a/NelmioApiDocBundle.php b/NelmioApiDocBundle.php deleted file mode 100644 index 1d1791f12..000000000 --- a/NelmioApiDocBundle.php +++ /dev/null @@ -1,29 +0,0 @@ -addCompilerPass(new ConfigurationPass()); - $container->addCompilerPass(new TagDescribersPass()); - } -} diff --git a/README.md b/README.md index 9ede5a72c..2f1d8944a 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,24 @@ NelmioApiDocBundle ================== -[![Build -Status](https://travis-ci.org/nelmio/NelmioApiDocBundle.svg?branch=master)](http://travis-ci.org/nelmio/NelmioApiDocBundle) -[![Total Downloads](https://poser.pugx.org/nelmio/api-doc-bundle/downloads)](https://packagist.org/packages/nelmio/api-doc-bundle) -[![Latest Stable -Version](https://poser.pugx.org/nelmio/api-doc-bundle/v/stable)](https://packagist.org/packages/nelmio/api-doc-bundle) +[![Build Status](https://img.shields.io/github/actions/workflow/status/nelmio/NelmioApiDocBundle/continuous-integration.yml?branch=master&style=flat-square)](https://github.com/nelmio/NelmioApiDocBundle/actions?query=workflow:CI) +[![Codecov](https://img.shields.io/codecov/c/github/nelmio/NelmioApiDocBundle?branch=master&style=flat-square)](https://app.codecov.io/gh/nelmio/NelmioApiDocBundle) +[![Total Downloads](https://img.shields.io/packagist/dt/nelmio/api-doc-bundle?style=flat-square)](https://packagist.org/packages/nelmio/api-doc-bundle) +[![Latest Stable Version](https://img.shields.io/packagist/v/nelmio/api-doc-bundle?label=stable&style=flat-square)](https://packagist.org/packages/nelmio/api-doc-bundle) +[![PHP Version](https://img.shields.io/packagist/dependency-v/nelmio/api-doc-bundle/PHP?style=flat-square)](https://packagist.org/packages/nelmio/api-doc-bundle) The **NelmioApiDocBundle** bundle allows you to generate a decent documentation for your APIs. +## Migrate from 3.x to 4.0 + +[To migrate from 3.x to 4.0, follow our guide.](https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-4.0.md) + +Version 4.0 brings OpenAPI 3.0 support. If you want to stick to Swagger 2.0, you should use the version 3 of this bundle. + ## Migrate from 2.x to 3.0 -[To migrate from 2.x to 3.0, just follow our guide.](https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-3.0.md) +[To migrate from 2.x to 3.0, follow our guide.](https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-3.0.md) ## Installation diff --git a/Resources/config/services.xml b/Resources/config/services.xml deleted file mode 100644 index 1f4393aa7..000000000 --- a/Resources/config/services.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Resources/doc/alternative_names.rst b/Resources/doc/alternative_names.rst deleted file mode 100644 index 720b7aabd..000000000 --- a/Resources/doc/alternative_names.rst +++ /dev/null @@ -1,28 +0,0 @@ -Alternative Names -================= - -NelmioApiDoc generates automatically the model names but the ``nelmio_api_doc.models.names`` option allows to -customize the names for some models. - -Configuration -------------- - -You can define alternative names for each group and area combination, the last matching rule is used: - -.. code-block:: yaml - - nelmio_api_doc: - models: - names: - - { alias: MainUser, type: App\Entity\User} - - { alias: MainUser_light, type: App\Entity\User, groups: [light] } - - { alias: MainUser_secret, type: App\Entity\User, areas: [private] } - - { alias: MainUser, type: App\Entity\User, groups: [standard], areas: [private] } - - -In this case the class ``App\Entity\User`` will be aliased into: - -- ``MainUser`` when no more detailed rules are specified -- ``MainUser_light`` when the group is equal to ``light`` -- ``MainUser_secret`` for the ``private`` area -- ``MainUser`` for the ``private`` area when the group is equal to ``standard`` diff --git a/Resources/doc/areas.rst b/Resources/doc/areas.rst deleted file mode 100644 index 390dd11b6..000000000 --- a/Resources/doc/areas.rst +++ /dev/null @@ -1,50 +0,0 @@ -Areas -===== - -We've already seen that you can configure which routes are documented using ``nelmio_api_doc.areas``: - -.. code-block:: yaml - - nelmio_api_doc: - areas: - path_patterns: [ ^/api ] - host_patterns: [ ^api\. ] - -But in fact, this config option is way more powerful and allows you to split your documentation in several parts. - -Configuration -------------- - -You can define areas which will each generates a different documentation: - -.. code-block:: yaml - - nelmio_api_doc: - areas: - default: - path_patterns: [ ^/api ] - host_patterns: [ ^api\. ] - internal: - path_patterns: [ ^/internal ] - commercial: - path_patterns: [ ^/commercial ] - -Your main documentation is under the ``default`` area. It's the one shown when accessing ``/api/doc``. - -Then update your routing to be able to access your different documentations: - -.. code-block:: yaml - - # app/config/routing.yml - app.swagger_ui: - path: /api/doc/{area} - methods: GET - defaults: { _controller: nelmio_api_doc.controller.swagger_ui, area: default } - - # To expose them as JSON - #app.swagger.areas: - # path: /api/doc/{area}.json - # methods: GET - # defaults: { _controller: nelmio_api_doc.controller.swagger } - -That's all! You can now access ``/api/doc/internal`` and ``/api/doc/commercial``. diff --git a/Resources/doc/customization.rst b/Resources/doc/customization.rst deleted file mode 100644 index f1c613583..000000000 --- a/Resources/doc/customization.rst +++ /dev/null @@ -1,38 +0,0 @@ -Customization -============= - -The look and feel of the Swagger UI can be customized. - - -Overwrite Twig Template ------------------------ - -If you want to customize parts of the template, you can create your own Twig template. -This allows to change the title, the header, add additional or replace existing styles or scripts. - -Take a look at the Twig documentation `how to extend templates `_. - -The following example will add additional scripts and a custom style to the template. -Just create a file ``templates/bundles/NelmioApiDocBundle/SwaggerUI/index.html.twig``. - -.. code-block:: twig - - {# templates/bundles/NelmioApiDocBundle/views/SwaggerUI/index.html.twig #} - - {# - To avoid a "reached nested level" error an exclamation mark `!` has to be added - See https://symfony.com/blog/new-in-symfony-3-4-improved-the-overriding-of-templates - #} - {% extends '@!NelmioApiDoc/SwaggerUi/index.html.twig' %} - - {% block stylesheets %} - {{ parent() }} - - {% endblock stylesheets %} - - {% block javascripts %} - {{ parent() }} - - {% endblock javascripts %} - -You can have a look at the original template to see which blocks can be overridden. diff --git a/Resources/doc/faq.rst b/Resources/doc/faq.rst deleted file mode 100644 index 4cecf61b7..000000000 --- a/Resources/doc/faq.rst +++ /dev/null @@ -1,180 +0,0 @@ -Frequently Asked Questions (FAQ) -================================ - -Sharing parameter configuration -------------------------------- - -Q: I use the same value in multiple end points. How can I avoid duplicating the descriptions? - -A: You can configure ``definitions`` in the nelmio_api_doc configuration and then reference them: - -.. code-block:: yaml - - # config/nelmio_api_doc.yml - nelmio_api_doc: - documentation: - definitions: - NelmioImageList: - description: "Response for some queries" - type: object - properties: - total: - type: integer - example: 42 - items: - type: array - items: - $ref: "#/definitions/ImageMetadata" - -.. code-block:: php - - // src/App/Controller/NelmioController.php - - /** - * @SWG\Response( - * response=200, - * description="List of image definitions", - * @SWG\Schema( - * type="object", - * title="ListOperationsResponse", - * additionalProperties={"$ref": "#/definitions/NelmioImageList"} - * ) - */ - -Optional Path Parameters ------------------------- - -Q: I have a controller with an optional path parameter. In swagger-ui, the parameter is required - can I make it - optional? The controller might look like this:: - - /** - * Get all user meta or metadata for a specific field. - * - * @Route("/{user}/meta/{metaName}", - * methods={"GET"}, - * name="get_user_metadata" - * ) - * - * @SWG\Response( - * response=200, - * description="Json object with all user meta data or a json string with the value of the requested field" - * ) - */ - public function getAction(string $user, string $metaName = null) - { - ... - } - -A: Optional path parameters are not supported by the OpenAPI specification. The solution to this is to define two - separate actions in your controller. For example:: - - /** - * Get all user meta data. - * - * @Route("/{user}/meta", - * methods={"GET"}, - * name="get_user_metadata" - * ) - * - * @SWG\Response( - * response=200, - * description="Json hashmap with all user meta data", - * @SWG\Schema( - * type="object", - * example={"foo": "bar", "hello": "world"} - * ) - * - * ) - */ - public function cgetAction(string $user) - { - return $this->getAction($user, null); - } - - /** - * Get user meta for a specific field. - * - * @Route("/{user}/meta/{metaName}", - * methods={"GET"}, - * name="get_user_metadata_single" - * ) - * - * @SWG\Response( - * response=200, - * description="A json string with the value of the requested field", - * @SWG\Schema( - * type="string" - * ) - * ) - */ - public function getAction(string $user, string $metaName = null) - { - ... - } - -The first action is redundant for Symfony, but adds all the relevant documentation for the OpenAPI specification. - -Asset files not loaded ----------------------- - -Q: How do I fix 404 or 406 HTTP status on NelmioApiDocBundle assets files (css, js, images)? - -A: The assets normally are installed by composer if any command event (usually ``post-install-cmd`` or - ``post-update-cmd``) triggers the ``ScriptHandler::installAssets`` script. - If you have not set up this script, you can manually execute this command: - -.. code-block:: bash - - $ bin/console assets:install --symlink - -Re-add Google Fonts -------------------- - -Q: How can I change the font for the UI? - -A: We removed the google fonts in 3.3 to avoid the external request for GDPR reasons. To change the font, you can :doc:`customize the template ` to add this style information: - -.. code-block:: twig - - {# templates/bundles/NelmioApiDocBundle/SwaggerUI/index.html.twig #} - - {# - To avoid a "reached nested level" error an exclamation mark `!` has to be added - See https://symfony.com/blog/new-in-symfony-3-4-improved-the-overriding-of-templates - #} - {% extends '@!NelmioApiDoc/SwaggerUi/index.html.twig' %} - - {% block stylesheets %} - - {{ parent() }} - - {% endblock stylesheets %} diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst deleted file mode 100644 index 51f175f76..000000000 --- a/Resources/doc/index.rst +++ /dev/null @@ -1,314 +0,0 @@ -NelmioApiDocBundle -================== - -The **NelmioApiDocBundle** bundle allows you to generate documentation in the -OpenAPI (Swagger) format and provides a sandbox to interactively browse the API documentation. - -What's supported? ------------------ - -This bundle supports *Symfony* route requirements, PHP annotations, `Swagger-Php`_ annotations, -`FOSRestBundle`_ annotations and apps using `Api-Platform`_. - -.. _`Swagger-Php`: https://github.com/zircote/swagger-php -.. _`FOSRestBundle`: https://github.com/FriendsOfSymfony/FOSRestBundle -.. _`Api-Platform`: https://github.com/api-platform/api-platform - -For models, it supports the `Symfony serializer`_ , the `JMS serializer`_ and the `willdurand/Hateoas`_ library. -It does also support `Symfony form`_ types. - -Migrate from 2.x to 3.0 ------------------------ - -`To migrate from 2.x to 3.0, just follow our guide.`__ - -__ https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-3.0.md - -Installation ------------- - -Open a command console, enter your project directory and execute the following command to download the latest version of this bundle: - -.. code-block:: bash - - $ composer require nelmio/api-doc-bundle - -.. note:: - - If you're not using Flex, then add the bundle to your kernel:: - - class AppKernel extends Kernel - { - public function registerBundles() - { - $bundles = [ - // ... - - new Nelmio\ApiDocBundle\NelmioApiDocBundle(), - ]; - - // ... - } - } - - To browse your documentation with Swagger UI, register the following route: - - .. code-block:: yaml - - # app/config/routing.yml - app.swagger_ui: - path: /api/doc - methods: GET - defaults: { _controller: nelmio_api_doc.controller.swagger_ui } - - If you also want to expose it in JSON, register this route: - - .. code-block:: yaml - - # app/config/routing.yml - app.swagger: - path: /api/doc.json - methods: GET - defaults: { _controller: nelmio_api_doc.controller.swagger } - - As you just installed the bundle, you'll likely see routes you don't want in - your documentation such as `/_profiler/`. To fix this, you can filter the - routes that are documented by configuring the bundle: - - .. code-block:: yaml - - # app/config/config.yml - nelmio_api_doc: - areas: - path_patterns: # an array of regexps - - ^/api(?!/doc$) - host_patterns: - - ^api\. - -How does this bundle work? --------------------------- - -It generates you an OpenAPI documentation from your symfony app thanks to -**Describers**. One extracts data from SwaggerPHP annotations, one from your -routes, etc. - -If you configured the ``app.swagger_ui`` route above, you can browse your -documentation at `http://example.org/api/doc`. - -Using the bundle ----------------- - -You can configure global information in the bundle configuration ``documentation.info`` section (take a look at -`the OpenAPI 2.0 specification (formerly Swagger)`_ to know the fields -available): - -.. code-block:: yaml - - nelmio_api_doc: - documentation: - host: api.example.com - schemes: [http, https] - info: - title: My App - description: This is an awesome app! - version: 1.0.0 - securityDefinitions: - Bearer: - type: apiKey - description: 'Value: Bearer {jwt}' - name: Authorization - in: header - security: - - Bearer: [] - -.. _`the OpenAPI 2.0 specification (formerly Swagger)`: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md - -.. note:: - - If you're using Flex, this config is there by default. Don't forget to adapt it to your app! - -To document your routes, you can use the SwaggerPHP annotations and the -``Nelmio\ApiDocBundle\Annotation\Model`` annotation in your controllers:: - - namespace AppBundle\Controller; - - use AppBundle\Entity\User; - use AppBundle\Entity\Reward; - use Nelmio\ApiDocBundle\Annotation\Model; - use Nelmio\ApiDocBundle\Annotation\Security; - use Swagger\Annotations as SWG; - use Symfony\Component\Routing\Annotation\Route; - - class UserController - { -       /** -         * List the rewards of the specified user. - * - * This call takes into account all confirmed awards, but not pending or refused awards. - * - * @Route("/api/{user}/rewards", methods={"GET"}) - * @SWG\Response( - * response=200, - * description="Returns the rewards of an user", - * @SWG\Schema( - * type="array", - * @SWG\Items(ref=@Model(type=Reward::class, groups={"full"})) - * ) - * ) - * @SWG\Parameter( - * name="order", - * in="query", - * type="string", - * description="The field used to order rewards" - * ) - * @SWG\Tag(name="rewards") - * @Security(name="Bearer") - */ - public function fetchUserRewardsAction(User $user) - { - // ... - } - } - -The normal PHP docblock for the controller method is used for the summary and description. - -Use models ----------- - -As shown in the example above, the bundle provides the ``@Model`` annotation. -Use it instead of a definition reference and the bundle will deduce your model properties. - -.. note:: - -    A model can be a Symfony form type, a Doctrine ORM entity or a general PHP object. - -This annotation has two options: - -* ``type`` to specify your model's type:: - - /** -     * @SWG\Response( -     * response=200, -     *     @Model(type=User::class) -     * ) -     */ - -* ``groups`` to specify the serialization groups used to (de)serialize your model:: - -   /** -     * @SWG\Response( -     * response=200, -     *     @Model(type=User::class, groups={"non_sensitive_data"}) -     * ) -     */ - - .. tip:: - - When used at the root of ``@SWG\Response`` and ``@SWG\Parameter``, ``@Model`` is automatically nested - in a ``@SWG\Schema``. - - To use ``@Model`` directly within a ``@SWG\Schema``, ``@SWG\Items`` or ``@SWG\Property``, you have to use the ``$ref`` field:: - - /** - * @SWG\Response( - * @SWG\Schema(ref=@Model(type=User::class)) - * ) - * - * or - * - * @SWG\Response( - * @SWG\Schema(type="object", - * @SWG\Property(property="foo", ref=@Model(type=FooClass::class)) - * ) - * ) - */ - -Symfony Form types -~~~~~~~~~~~~~~~~~~ - -You can customize the documentation of a form field using the ``documentation`` option:: - - $builder->add('username', TextType::class, [ - 'documentation' => [ - 'type' => 'string', // would have been automatically detected in this case - 'description' => 'Your username.', - ], - ]); - -See the `OpenAPI 2.0 specification`__ to see all the available fields of the ``documentation`` option. - -__ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject - - -General PHP objects -~~~~~~~~~~~~~~~~~~~ - -.. tip:: - - **If you're not using the JMS Serializer**, the `Symfony PropertyInfo component`_ is used to describe your models. - It supports doctrine annotations, type hints, and even PHP doc blocks. - It does also support serialization groups when using the Symfony serializer. - - **If you're using the JMS Serializer**, the metadata of the JMS serializer are used by default to describe your - models. Additional information is extracted from the PHP doc block comment, - but the property types must be specified in the JMS annotations. - - In case you prefer using the `Symfony PropertyInfo component`_ (you - won't be able to use JMS serialization groups), you can disable JMS serializer - support in your config: - - .. code-block:: yaml - - nelmio_api_doc: - models: { use_jms: false } - - When using the JMS serializer combined with `willdurand/Hateoas`_ (and the `BazingaHateoasBundle`_), - HATEOAS metadata are automatically extracted - -If you want to customize the documentation of a property of an object, you can use ``@SWG\Property``:: - - use Nelmio\ApiDocBundle\Annotation\Model; - use Swagger\Annotations as SWG; - - class User - { - /** - * @var int - * @SWG\Property(description="The unique identifier of the user.") - */ - public $id; - - /** - * @SWG\Property(type="string", maxLength=255) - */ - public $username; - - /** - * @SWG\Property(ref=@Model(type=User::class)) - */ - public $friend; - } - -See the `OpenAPI 2.0 specification`__ to see all the available fields of ``@SWG\Property``. - -__ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject - -Learn more ----------- - -If you need more complex features, take a look at: - -.. toctree:: - :maxdepth: 1 - - areas - alternative_names - customization - faq - -.. _`Symfony PropertyInfo component`: https://symfony.com/doc/current/components/property_info.html -.. _`willdurand/Hateoas`: https://github.com/willdurand/Hateoas -.. _`BazingaHateoasBundle`: https://github.com/willdurand/BazingaHateoasBundle -.. _`JMS serializer`: https://jmsyst.com/libs/serializer -.. _`Symfony form`: https://symfony.com/doc/current/forms.html -.. _`Symfony serializer`: https://symfony.com/doc/current/components/serializer.html diff --git a/Resources/public/init-swagger-ui.js b/Resources/public/init-swagger-ui.js deleted file mode 100644 index 1d7382337..000000000 --- a/Resources/public/init-swagger-ui.js +++ /dev/null @@ -1,25 +0,0 @@ -// This file is part of the API Platform project. -// -// (c) Kévin Dunglas -// -// For the full copyright and license information, please view the LICENSE -// file that was distributed with this source code. - -window.onload = () => { - const data = JSON.parse(document.getElementById('swagger-data').innerText); - const ui = SwaggerUIBundle({ - spec: data.spec, - dom_id: '#swagger-ui', - validatorUrl: null, - presets: [ - SwaggerUIBundle.presets.apis, - SwaggerUIStandalonePreset - ], - plugins: [ - SwaggerUIBundle.plugins.DownloadUrl - ], - layout: 'StandaloneLayout' - }); - - window.ui = ui; -}; diff --git a/Resources/public/swagger-ui/swagger-ui-bundle.js b/Resources/public/swagger-ui/swagger-ui-bundle.js deleted file mode 100644 index add3f3199..000000000 --- a/Resources/public/swagger-ui/swagger-ui-bundle.js +++ /dev/null @@ -1,99 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist",t(t.s=1213)}([function(e,t,n){"use strict";e.exports=n(92)},function(e,t,n){e.exports=n(995)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(331),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?d(e)+t:t}function v(){return!0}function g(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}function x(e){this.next=e}function w(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function k(){return{value:void 0,done:!0}}function E(e){return!!A(e)}function S(e){return e&&"function"==typeof e.next}function C(e){var t=A(e);return t&&t.call(e)}function A(e){var t=e&&(wn&&e[wn]||e[kn]);if("function"==typeof t)return t}function D(e){return e&&"number"==typeof e.length}function O(e){return null===e||void 0===e?B():o(e)?e.toSeq():z(e)}function M(e){return null===e||void 0===e?B().toKeyedSeq():o(e)?a(e)?e.toSeq():e.fromEntrySeq():L(e)}function T(e){return null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e.toIndexedSeq():q(e)}function P(e){return(null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e:q(e)).toSetSeq()}function I(e){this._array=e,this.size=e.length}function R(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function j(e){this._iterable=e,this.size=e.length||e.size}function F(e){this._iterator=e,this._iteratorCache=[]}function N(e){return!(!e||!e[Sn])}function B(){return Cn||(Cn=new I([]))}function L(e){var t=Array.isArray(e)?new I(e).fromEntrySeq():S(e)?new F(e).fromEntrySeq():E(e)?new j(e).fromEntrySeq():"object"==typeof e?new R(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function q(e){var t=U(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function z(e){var t=U(e)||"object"==typeof e&&new R(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function U(e){return D(e)?new I(e):S(e)?new F(e):E(e)?new j(e):void 0}function W(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function V(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new x(function(){var e=i[n?o-a:a];return a++>o?k():w(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function H(e,t){return t?G(t,e,"",{"":e}):J(e)}function G(e,t,n,r){return Array.isArray(t)?e.call(r,n,T(t).map(function(n,r){return G(e,n,r,t)})):K(t)?e.call(r,n,M(t).map(function(n,r){return G(e,n,r,t)})):t}function J(e){return Array.isArray(e)?T(e).map(J).toList():K(e)?M(e).map(J).toMap():e}function K(e){return e&&(e.constructor===Object||void 0===e.constructor)}function X(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function Y(e,t){if(e===t)return!0;if(!o(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||a(e)!==a(t)||s(e)!==s(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&X(i[1],e)&&(n||X(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var c=e;e=t,t=c}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):i?!X(t,e.get(r,vn)):!X(e.get(r,vn),t))return p=!1,!1});return p&&e.size===f}function $(e,t){if(!(this instanceof $))return new $(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(An)return An;An=this}}function Z(e,t){if(!e)throw new Error(t)}function Q(e,t,n){if(!(this instanceof Q))return new Q(e,t,n);if(Z(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t>>1&1073741824|3221225471&e}function oe(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!==e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)e/=4294967295,n^=e;return ie(n)}if("string"===t)return e.length>Fn?ae(e):se(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return ue(e);if("function"==typeof e.toString)return se(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ae(e){var t=Ln[e];return void 0===t&&(t=se(e),Bn===Nn&&(Bn=0,Ln={}),Bn++,Ln[e]=t),t}function se(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function ce(e){Z(e!==1/0,"Cannot perform this action with an infinite size.")}function pe(e){return null===e||void 0===e?we():fe(e)&&!l(e)?e:we().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function fe(e){return!(!e||!e[qn])}function he(e,t){this.ownerID=e,this.entries=t}function de(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function me(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&be(e._root)}function _e(e,t){return w(e,t[0],t[1])}function be(e,t){return{node:e,index:0,__prev:t}}function xe(e,t,n,r){var i=Object.create(zn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function we(){return Un||(Un=xe(0))}function ke(e,t,n){var r,i;if(e._root){var o=c(gn),a=c(yn);if(r=Ee(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===vn?-1:1:0)}else{if(n===vn)return e;i=1,r=new he(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?xe(i,r):we()}function Ee(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===vn?e:(p(s),p(a),new ge(t,r,[i,o]))}function Se(e){return e.constructor===ge||e.constructor===ve}function Ce(e,t,n,r,i){if(e.keyHash===r)return new ve(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&mn,s=(0===n?r:r>>>n)&mn;return new de(t,1<>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new me(e,o+1,a)}function Me(e,t,r){for(var i=[],a=0;a>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Fe(e,t,n,r){var i=r?e:h(e);return i[t]=n,i}function Ne(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s0&&io?0:o-n,l=a-n;return l>dn&&(l=dn),function(){if(i===l)return Xn;var e=t?--l:i++;return r&&r[e]}}function i(e,r,i){var s,u=e&&e.array,l=i>o?0:o-i>>r,c=1+(a-i>>r);return c>dn&&(c=dn),function(){for(;;){if(s){var e=s();if(e!==Xn)return e;s=null}if(l===c)return Xn;var o=t?--c:l++;s=n(u&&u[o],r-hn,i+(o<=e.size||t<0)return e.withMutations(function(e){t<0?Xe(e,t).set(0,n):Xe(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=c(yn);return t>=$e(e._capacity)?r=Ge(r,e.__ownerID,0,t,n,o):i=Ge(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):We(e._origin,e._capacity,e._level,i,r):e}function Ge(e,t,n,r,i,o){var a=r>>>n&mn,s=e&&a0){var l=e&&e.array[a],c=Ge(l,t,n-hn,r,i,o);return c===l?e:(u=Je(e,t),u.array[a]=c,u)}return s&&e.array[a]===i?e:(p(o),u=Je(e,t),void 0===i&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function Je(e,t){return t&&e&&t===e.ownerID?e:new ze(e?e.array.slice():[],t)}function Ke(e,t){if(t>=$e(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&mn],r-=hn;return n}}function Xe(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new f,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var u=e._level,l=e._root,c=0;a+c<0;)l=new ze(l&&l.array.length?[void 0,l]:[],r),u+=hn,c+=1<=1<p?new ze([],r):d;if(d&&h>p&&ahn;g-=hn){var y=p>>>g&mn;v=v.array[y]=Je(v.array[y],r)}v.array[p>>>hn&mn]=d}if(s=h)a-=h,s-=h,u=hn,l=null,m=m&&m.removeBefore(r,0,a);else if(a>i||h>>u&mn;if(_!==h>>>u&mn)break;_&&(c+=(1<i&&(l=l.removeBefore(r,u,a-c)),l&&ha&&(a=l.size),o(u)||(l=l.map(function(e){return H(e)})),i.push(l)}return a>e.size&&(e=e.setSize(a)),Ie(e,t,i)}function $e(e){return e>>hn<=dn&&a.size>=2*o.size?(i=a.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):et(r,i)}function rt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function it(e){this._iter=e,this.size=e.size}function ot(e){this._iter=e,this.size=e.size}function at(e){this._iter=e,this.size=e.size}function st(e){var t=Dt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Ot,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===xn){var r=e.__iterator(t,n);return new x(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===bn?_n:bn,n)},t}function ut(e,t,n){var r=Dt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,vn);return o===vn?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(xn,i);return new x(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return w(r,s,t.call(n,a[1],s,e),i)})},r}function lt(e,t){var n=Dt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=st(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Ot,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function ct(e,t,n,r){var i=Dt(e);return r&&(i.has=function(r){var i=e.get(r,vn);return i!==vn&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,vn);return o!==vn&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,u){if(t.call(n,e,o,u))return s++,i(e,r?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(xn,o),s=0;return new x(function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,l=u[0],c=u[1];if(t.call(n,c,l,e))return w(i,r?l:s++,c,o)}})},i}function pt(e,t,n){var r=pe().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(e){return e+1})}),r.asImmutable()}function ft(e,t,n){var r=a(e),i=(l(e)?Ze():pe()).asMutable();e.__iterate(function(o,a){i.update(t.call(n,o,a,e),function(e){return e=e||[],e.push(r?[a,o]:o),e})});var o=At(e);return i.map(function(t){return Et(e,o(t))})}function ht(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(t,n,i))return e;var o=y(t,i),a=_(n,i);if(o!==o||a!==a)return ht(e.toSeq().cacheResult(),t,n,r);var s,u=a-o;u===u&&(s=u<0?0:u);var l=Dt(e);return l.size=0===s?s:e.size&&s||void 0,!r&&N(e)&&s>=0&&(l.get=function(t,n){return t=m(this,t),t>=0&&ts)return k();var e=i.next();return r||t===bn?e:t===_n?w(t,u-1,void 0,e):w(t,u-1,e.value[1],e)})},l}function dt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(xn,i),s=!0;return new x(function(){if(!s)return k();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],l=i[1];return t.call(n,l,u,o)?r===xn?e:w(r,u,l,e):(s=!1,k())})},r}function mt(e,t,n,r){var i=Dt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate(function(e,o,l){if(!s||!(s=t.call(n,e,o,l)))return u++,i(e,r?o:u-1,a)}),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(xn,o),u=!0,l=0;return new x(function(){var e,o,c;do{if(e=s.next(),e.done)return r||i===bn?e:i===_n?w(i,l++,void 0,e):w(i,l++,e.value[1],e);var p=e.value;o=p[0],c=p[1],u&&(u=t.call(n,c,o,a))}while(u);return i===xn?e:w(i,o,c,e)})},i}function vt(e,t){var r=a(e),i=[e].concat(t).map(function(e){return o(e)?r&&(e=n(e)):e=r?L(e):q(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var u=i[0];if(u===e||r&&a(u)||s(e)&&s(u))return u}var l=new I(i);return r?l=l.toKeyedSeq():s(e)||(l=l.toSetSeq()),l=l.flatten(!0),l.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),l}function gt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){function a(e,l){var c=this;e.__iterate(function(e,i){return(!t||l0}function kt(e,n,r){var i=Dt(e);return i.size=new I(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(bn,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=t(e),C(i?e.reverse():e)}),a=0,s=!1;return new x(function(){var t;return s||(t=o.map(function(e){return e.next()}),s=t.some(function(e){return e.done})),s?k():w(e,a++,n.apply(null,t.map(function(e){return e.value})))})},i}function Et(e,t){return N(e)?t:e.constructor(t)}function St(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ct(e){return ce(e.size),d(e)}function At(e){return a(e)?n:s(e)?r:i}function Dt(e){return Object.create((a(e)?M:s(e)?T:P).prototype)}function Ot(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Mt(e,t){return e>t?1:et?-1:0}function on(e){if(e.size===1/0)return 0;var t=l(e),n=a(e),r=t?1:0;return an(e.__iterate(n?t?function(e,t){r=31*r+sn(oe(e),oe(t))|0}:function(e,t){r=r+sn(oe(e),oe(t))|0}:t?function(e){r=31*r+oe(e)|0}:function(e){r=r+oe(e)|0}),r)}function an(e,t){return t=Mn(t,3432918353),t=Mn(t<<15|t>>>-15,461845907),t=Mn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Mn(t^t>>>16,2246822507),t=Mn(t^t>>>13,3266489909),t=ie(t^t>>>16)}function sn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var un=Array.prototype.slice;e(n,t),e(r,t),e(i,t),t.isIterable=o,t.isKeyed=a,t.isIndexed=s,t.isAssociative=u,t.isOrdered=l,t.Keyed=n,t.Indexed=r,t.Set=i;var ln="@@__IMMUTABLE_ITERABLE__@@",cn="@@__IMMUTABLE_KEYED__@@",pn="@@__IMMUTABLE_INDEXED__@@",fn="@@__IMMUTABLE_ORDERED__@@",hn=5,dn=1<r?k():w(e,i,n[t?r-i++:i++])})},e(R,M),R.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},R.prototype.has=function(e){return this._object.hasOwnProperty(e)},R.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},R.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new x(function(){var a=r[t?i-o:o];return o++>i?k():w(e,a,n[a])})},R.prototype[fn]=!0,e(j,T),j.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=C(n),i=0;if(S(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,i++,this););return i},j.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=C(n);if(!S(r))return new x(k);var i=0;return new x(function(){var t=r.next();return t.done?t:w(e,i++,t.value)})},e(F,T),F.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return w(e,i,r[i++])})};var Cn;e($,T),$.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$.prototype.get=function(e,t){return this.has(e)?this._value:t},$.prototype.includes=function(e){return X(this._value,e)},$.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:new $(this._value,_(t,n)-y(e,n))},$.prototype.reverse=function(){return this},$.prototype.indexOf=function(e){return X(this._value,e)?0:-1},$.prototype.lastIndexOf=function(e){return X(this._value,e)?this.size:-1},$.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?k():w(e,o++,a)})},Q.prototype.equals=function(e){return e instanceof Q?this._start===e._start&&this._end===e._end&&this._step===e._step:Y(this,e)};var Dn;e(ee,t),e(te,ee),e(ne,ee),e(re,ee),ee.Keyed=te,ee.Indexed=ne,ee.Set=re;var On,Mn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){e|=0,t|=0;var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0},Tn=Object.isExtensible,Pn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),In="function"==typeof WeakMap;In&&(On=new WeakMap);var Rn=0,jn="__immutablehash__";"function"==typeof Symbol&&(jn=Symbol(jn));var Fn=16,Nn=255,Bn=0,Ln={};e(pe,te),pe.of=function(){var e=un.call(arguments,0);return we().withMutations(function(t){for(var n=0;n=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},pe.prototype.toString=function(){return this.__toString("Map {","}")},pe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},pe.prototype.set=function(e,t){return ke(this,e,t)},pe.prototype.setIn=function(e,t){return this.updateIn(e,vn,function(){return t})},pe.prototype.remove=function(e){return ke(this,e,vn)},pe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return vn})},pe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},pe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=Re(this,Tt(e),t,n);return r===vn?void 0:r},pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):we()},pe.prototype.merge=function(){return Me(this,void 0,arguments)},pe.prototype.mergeWith=function(e){return Me(this,e,un.call(arguments,1))},pe.prototype.mergeIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.merge?e.merge.apply(e,t):t[t.length-1]})},pe.prototype.mergeDeep=function(){return Me(this,Te,arguments)},pe.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Me(this,Pe(e),t)},pe.prototype.mergeDeepIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,t):t[t.length-1]})},pe.prototype.sort=function(e){return Ze(bt(this,e))},pe.prototype.sortBy=function(e,t){return Ze(bt(this,t,e))},pe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},pe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new f)},pe.prototype.asImmutable=function(){return this.__ensureOwner()},pe.prototype.wasAltered=function(){return this.__altered},pe.prototype.__iterator=function(e,t){return new ye(this,e,t)},pe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},pe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xe(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},pe.isMap=fe;var qn="@@__IMMUTABLE_MAP__@@",zn=pe.prototype;zn[qn]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,he.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o=Wn)return Ae(e,u,r,i);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new he(e,m)}},de.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=1<<((0===e?t:t>>>e)&mn),o=this.bitmap;return 0==(o&i)?r:this.nodes[je(o&i-1)].get(e+hn,t,n,r)},de.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=1<=Vn)return Oe(e,f,l,s,d);if(c&&!d&&2===f.length&&Se(f[1^p]))return f[1^p];if(c&&d&&1===f.length&&Se(d))return d;var m=e&&e===this.ownerID,v=c?d?l:l^u:l|u,g=c?d?Fe(f,p,d,m):Be(f,p,m):Ne(f,p,d,m);return m?(this.bitmap=v,this.nodes=g,this):new de(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=(0===e?t:t>>>e)&mn,o=this.nodes[i];return o?o.get(e+hn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=i===vn,l=this.nodes,c=l[s];if(u&&!c)return this;var p=Ee(c,e,t+hn,n,r,i,o,a);if(p===c)return this;var f=this.count;if(c){if(!p&&--f=0&&e>>t&mn;if(r>=this.array.length)return new ze([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-hn,n))===a&&o)return this}if(o&&!i)return this;var s=Je(this,e);if(!o)for(var u=0;u>>t&mn;if(r>=this.array.length)return this;var i;if(t>0){var o=this.array[r];if((i=o&&o.removeAfter(e,t-hn,n))===o&&r===this.array.length-1)return this}var a=Je(this,e);return a.array.splice(r+1),i&&(a.array[r]=i),a};var Kn,Xn={};e(Ze,pe),Ze.of=function(){return this(arguments)},Ze.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ze.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Ze.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tt()},Ze.prototype.set=function(e,t){return nt(this,e,t)},Ze.prototype.remove=function(e){return nt(this,e,vn)},Ze.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ze.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Ze.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Ze.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?et(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Ze.isOrderedMap=Qe,Ze.prototype[fn]=!0,Ze.prototype.delete=Ze.prototype.remove;var Yn;e(rt,M),rt.prototype.get=function(e,t){return this._iter.get(e,t)},rt.prototype.has=function(e){return this._iter.has(e)},rt.prototype.valueSeq=function(){return this._iter.valueSeq()},rt.prototype.reverse=function(){var e=this,t=lt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},rt.prototype.map=function(e,t){var n=this,r=ut(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},rt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Ct(this):0,function(i){return e(i,t?--n:n++,r)}),t)},rt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(bn,t),r=t?Ct(this):0;return new x(function(){var i=n.next();return i.done?i:w(e,t?--r:r++,i.value,i)})},rt.prototype[fn]=!0,e(it,T),it.prototype.includes=function(e){return this._iter.includes(e)},it.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},it.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t),r=0;return new x(function(){var t=n.next();return t.done?t:w(e,r++,t.value,t)})},e(ot,P),ot.prototype.has=function(e){return this._iter.includes(e)},ot.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},ot.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){var t=n.next();return t.done?t:w(e,t.value,t.value,t)})},e(at,M),at.prototype.entrySeq=function(){return this._iter.toSeq()},at.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){St(t);var r=o(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},at.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){St(r);var i=o(r);return w(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},it.prototype.cacheResult=rt.prototype.cacheResult=ot.prototype.cacheResult=at.prototype.cacheResult=Ot,e(Pt,te),Pt.prototype.toString=function(){return this.__toString(Rt(this)+" {","}")},Pt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Pt.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},Pt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=It(this,we()))},Pt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+Rt(this));if(this._map&&!this._map.has(e)){if(t===this._defaultValues[e])return this}var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:It(this,n)},Pt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:It(this,t)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()},Pt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterator(e,t)},Pt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterate(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?It(this,t,e):(this.__ownerID=e,this._map=t,this)};var $n=Pt.prototype;$n.delete=$n.remove,$n.deleteIn=$n.removeIn=zn.removeIn,$n.merge=zn.merge,$n.mergeWith=zn.mergeWith,$n.mergeIn=zn.mergeIn,$n.mergeDeep=zn.mergeDeep,$n.mergeDeepWith=zn.mergeDeepWith,$n.mergeDeepIn=zn.mergeDeepIn,$n.setIn=zn.setIn,$n.update=zn.update,$n.updateIn=zn.updateIn,$n.withMutations=zn.withMutations,$n.asMutable=zn.asMutable,$n.asImmutable=zn.asImmutable,e(Nt,re),Nt.of=function(){return this(arguments)},Nt.fromKeys=function(e){return this(n(e).keySeq())},Nt.prototype.toString=function(){return this.__toString("Set {","}")},Nt.prototype.has=function(e){return this._map.has(e)},Nt.prototype.add=function(e){return Lt(this,this._map.set(e,!0))},Nt.prototype.remove=function(e){return Lt(this,this._map.remove(e))},Nt.prototype.clear=function(){return Lt(this,this._map.clear())},Nt.prototype.union=function(){var e=un.call(arguments,0);return e=e.filter(function(e){return 0!==e.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kt(e,t)},Gt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;ce(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kt(t,n)},Gt.prototype.pop=function(){return this.slice(1)},Gt.prototype.unshift=function(){return this.push.apply(this,arguments)},Gt.prototype.unshiftAll=function(e){return this.pushAll(e)},Gt.prototype.shift=function(){return this.pop.apply(this,arguments)},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xt()},Gt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size);if(_(t,this.size)!==this.size)return ne.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Kt(r,i)},Gt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kt(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Gt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new x(function(){if(r){var t=r.value;return r=r.next,w(e,n++,t)}return k()})},Gt.isStack=Jt;var rr="@@__IMMUTABLE_STACK__@@",ir=Gt.prototype;ir[rr]=!0,ir.withMutations=zn.withMutations,ir.asMutable=zn.asMutable,ir.asImmutable=zn.asImmutable,ir.wasAltered=zn.wasAltered;var or;t.Iterator=x,Yt(t,{toArray:function(){ce(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return pe(this.toKeyedSeq())},toObject:function(){ce(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Ze(this.toKeyedSeq())},toOrderedSet:function(){return Ut(a(this)?this.valueSeq():this)},toSet:function(){return Nt(a(this)?this.valueSeq():this)},toSetSeq:function(){return new ot(this)},toSeq:function(){return s(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gt(a(this)?this.valueSeq():this)},toList:function(){return Le(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Et(this,vt(this,un.call(arguments,0)))},includes:function(e){return this.some(function(t){return X(t,e)})},entries:function(){return this.__iterator(xn)},every:function(e,t){ce(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return Et(this,ct(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return ce(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ce(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(_n)},map:function(e,t){return Et(this,ut(this,e,t))},reduce:function(e,t,n){ce(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Et(this,lt(this,!0))},slice:function(e,t){return Et(this,ht(this,e,t,!0))},some:function(e,t){return!this.every(Qt(e),t)},sort:function(e){return Et(this,bt(this,e))},values:function(){return this.__iterator(bn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return d(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return pt(this,e,t)},equals:function(e){return Y(this,e)},entrySeq:function(){var e=this;if(e._cache)return new I(e._cache);var t=e.toSeq().map(Zt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Qt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return Et(this,yt(this,e,t))},flatten:function(e){return Et(this,gt(this,e,!0))},fromEntrySeq:function(){return new at(this)},get:function(e,t){return this.find(function(t,n){return X(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Tt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,vn):vn)===vn)return t}return r},groupBy:function(e,t){return ft(this,e,t)},has:function(e){return this.get(e,vn)!==vn},hasIn:function(e){return this.getIn(e,vn)!==vn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return X(t,e)})},keySeq:function(){return this.toSeq().map($t).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return xt(this,e)},maxBy:function(e,t){return xt(this,t,e)},min:function(e){return xt(this,e?en(e):rn)},minBy:function(e,t){return xt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Et(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Et(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Qt(e),t)},sortBy:function(e,t){return Et(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Et(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Et(this,dt(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Qt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var ar=t.prototype;ar[ln]=!0,ar[En]=ar.values,ar.__toJS=ar.toArray,ar.__toStringMapper=tn,ar.inspect=ar.toSource=function(){return this.toString()},ar.chain=ar.flatMap,ar.contains=ar.includes,Yt(n,{flip:function(){return Et(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return Et(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Et(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var sr=n.prototype;return sr[cn]=!0,sr[En]=ar.entries,sr.__toJS=ar.toObject,sr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Yt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return Et(this,ct(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Et(this,lt(this,!1))},slice:function(e,t){return Et(this,ht(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return Et(this,1===n?r:r.concat(h(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Et(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=m(this,e))>=0&&(void 0!==this.size?this.size===1/0||e5e3)return e.textContent;return function(e){for(var n,r,i,o,a,s=e.textContent,u=0,l=s[0],c=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:c;){if(c=l,l=s[++u],o=p.length>1,!c||f>8&&"\n"==c||[/\S/.test(c),1,1,!/[$\w]/.test(c),("/"==n||"\n"==n)&&o,'"'==n&&o,"'"==n&&o,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),i=f&&f<7?f:i,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(c),/[\])]/.test(c),/[$\w]/.test(c),"/"==c&&i<2&&"<"!=n,'"'==c,"'"==c,c+l+s[u+1]+s[u+2]=="\x3c!--",c+l=="/*",c+l=="//","#"==c][--f];);p+=c}}(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L.default.Map();if(!L.default.Map.isMap(e)||!e.size)return L.default.List();if(Array.isArray(t)||(t=[t]),t.length<1)return e.merge(n);var r=L.default.List(),i=t[0],o=!0,a=!1,s=void 0;try{for(var u,l=(0,T.default)(e.entries());!(o=(u=l.next()).done);o=!0){var c=u.value,p=(0,O.default)(c,2),f=p[0],h=p[1],d=b(h,t.slice(1),n.set(i,f));r=L.default.List.isList(d)?r.concat(d):r.push(d)}}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return r}function x(e){var t=/filename="([^;]*);?"/i.exec(e);return null===t&&(t=/filename=([^;]*);?/i.exec(e)),null!==t&&t.length>1?t[1]:null}function w(e){return(0,V.default)((0,U.default)(e))}function k(e){return w(e.replace(/\.[^.\/]*$/,""))}function E(e){return"string"!=typeof e||""===e?"":(0,q.sanitizeUrl)(e)}function S(e){if(!L.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&(0,j.default)(e.get("content")||{}).length>0}),n=e.get("default")||L.default.OrderedMap(),r=(n.get("content")||L.default.OrderedMap()).keySeq().toJS(),i=r.length?n:null;return t||i}Object.defineProperty(t,"__esModule",{value:!0}),t.getExtensions=t.escapeDeepLinkPath=t.createDeepLinkPath=t.shallowEqualKeys=t.buildFormData=t.sorters=t.btoa=t.parseSearch=t.getSampleSchema=t.validateParam=t.validatePattern=t.validateMinLength=t.validateMaxLength=t.validateGuid=t.validateDateTime=t.validateString=t.validateBoolean=t.validateFile=t.validateInteger=t.validateNumber=t.validateMinimum=t.validateMaximum=t.propChecker=t.memoize=t.isImmutable=void 0;var C=n(34),A=r(C),D=n(18),O=r(D),M=n(95),T=r(M),P=n(35),I=r(P),R=n(47),j=r(R),F=n(48),N=r(F);t.isJSONObject=i,t.objectify=o,t.arrayify=a,t.fromJSOrdered=s,t.bindToState=u,t.normalizeArray=l,t.isFn=c,t.isObject=p,t.isFunc=f,t.isArray=h,t.objMap=d,t.objReduce=m,t.systemThunkMiddleware=v,t.defaultStatusCode=g,t.getList=y,t.highlight=_,t.mapToList=b,t.extractFileNameFromContentDispositionHeader=x,t.pascalCase=w,t.pascalCaseFilename=k,t.sanitizeUrl=E,t.getAcceptControllingResponse=S;var B=n(7),L=r(B),q=n(505),z=n(939),U=r(z),W=n(428),V=r(W),H=n(425),G=r(H),J=n(222),K=r(J),X=n(954),Y=r(X),$=n(120),Z=r($),Q=n(171),ee=n(46),te=r(ee),ne=n(696),re=r(ne),ie="default",oe=t.isImmutable=function(e){return L.default.Iterable.isIterable(e)},ae=(t.memoize=G.default,t.propChecker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,j.default)(e).length!==(0,j.default)(t).length||((0,Y.default)(e,function(e,n){if(r.includes(n))return!1;var i=t[n];return L.default.Iterable.isIterable(e)?!L.default.is(e,i):("object"!==(void 0===e?"undefined":(0,N.default)(e))||"object"!==(void 0===i?"undefined":(0,N.default)(i)))&&e!==i})||n.some(function(n){return!(0,Z.default)(e[n],t[n])}))},t.validateMaximum=function(e,t){if(e>t)return"Value must be less than Maximum"}),se=t.validateMinimum=function(e,t){if(et)return"Value must be less than MaxLength"},ve=t.validateMinLength=function(e,t){if(e.length2&&void 0!==arguments[2]&&arguments[2],r=[],i=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),o=e.get("required"),a=n?e.get("schema"):e;if(!a)return r;var s=a.get("maximum"),u=a.get("minimum"),l=a.get("type"),c=a.get("format"),p=a.get("maxLength"),f=a.get("minLength"),h=a.get("pattern");if(l&&(o||i)){var d="string"===l&&i,m="array"===l&&Array.isArray(i)&&i.length,v="array"===l&&L.default.List.isList(i)&&i.count(),g="file"===l&&i instanceof te.default.File,y="boolean"===l&&(i||!1===i),_="number"===l&&(i||0===i),b="integer"===l&&(i||0===i);if(o&&!(d||m||v||g||y||_||b))return r.push("Required field is not provided"),r;if(h){var x=ge(i,h);x&&r.push(x)}if(p||0===p){var w=me(i,p);w&&r.push(w)}if(f){var k=ve(i,f);k&&r.push(k)}if(s||0===s){var E=ae(i,s);E&&r.push(E)}if(u||0===u){var S=se(i,u);S&&r.push(S)}if("string"===l){var C=void 0;if(!(C="date-time"===c?he(i):"uuid"===c?de(i):fe(i)))return r;r.push(C)}else if("boolean"===l){var A=pe(i);if(!A)return r;r.push(A)}else if("number"===l){var D=ue(i);if(!D)return r;r.push(D)}else if("integer"===l){var O=le(i);if(!O)return r;r.push(O)}else if("array"===l){var M=void 0;if(!i.count())return r;M=a.getIn(["items","type"]),i.forEach(function(e,t){var n=void 0;"number"===M?n=ue(e):"integer"===M?n=le(e):"string"===M&&(n=fe(e)),n&&r.push({index:t,error:n})})}else if("file"===l){var T=ce(i);if(!T)return r;r.push(T)}}return r},t.getSampleSchema=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'\n\x3c!-- XML example cannot be generated --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return(0,Q.memoizedCreateXMLExample)(e,n)}return(0,A.default)((0,Q.memoizedSampleFromSchema)(e,n),null,2)},t.parseSearch=function(){var e={},t=te.default.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]))}return e},t.btoa=function(t){var n=void 0;return n=t instanceof e?t:new e(t.toString(),"utf-8"),n.toString("base64")},t.sorters={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},t.buildFormData=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},t.shallowEqualKeys=function(e,t,n){return!!(0,K.default)(n,function(n){return(0,Z.default)(e[n],t[n])})},t.createDeepLinkPath=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"_"):""});t.escapeDeepLinkPath=function(e){return(0,re.default)(ye(e))},t.getExtensions=function(e){return e.filter(function(e,t){return/^x-/.test(t)})}}).call(t,n(38).Buffer)},function(e,t,n){"use strict";var r=n(31),i=r;e.exports=i},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r6?s-6:0),l=6;l5?l-5:0),p=5;p5?a-5:0),u=5;u key("+c[p]+")"].concat(s));if(h instanceof Error)return h}}return i(t)}function u(e){return a(e,"List",b.List.isList)}function l(e,t,n,r){function o(){for(var i=arguments.length,o=Array(i),u=0;u5?s-5:0),l=5;l5?l-5:0),p=5;p>",w={listOf:u,mapOf:c,orderedMapOf:p,setOf:f,orderedSetOf:h,stackOf:d,iterableOf:m,recordOf:v,shape:y,contains:y,mapContains:_,list:o("List",b.List.isList),map:o("Map",b.Map.isMap),orderedMap:o("OrderedMap",b.OrderedMap.isOrderedMap),set:o("Set",b.Set.isSet),orderedSet:o("OrderedSet",b.OrderedSet.isOrderedSet),stack:o("Stack",b.Stack.isStack),seq:o("Seq",b.Seq.isSeq),record:o("Record",function(e){return e instanceof b.Record}),iterable:o("Iterable",b.Iterable.isIterable)};e.exports=w},function(e,t,n){"use strict";function r(e,t){return 1===e.nodeType&&e.getAttribute(d)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function i(e){for(var t;t=e._renderedComponent;)e=t;return e}function o(e,t){var n=i(e);n._hostNode=t,t[v]=n}function a(e){var t=e._hostNode;t&&(delete t[v],e._hostNode=null)}function s(e,t){if(!(e._flags&m.hasCachedChildNodes)){var n=e._renderedChildren,a=t.firstChild;e:for(var s in n)if(n.hasOwnProperty(s)){var u=n[s],l=i(u)._domID;if(0!==l){for(;null!==a;a=a.nextSibling)if(r(a,l)){o(u,a);continue e}p("32",l)}}e._flags|=m.hasCachedChildNodes}}function u(e){if(e[v])return e[v];for(var t=[];!e[v];){if(t.push(e),!e.parentNode)return null;e=e.parentNode}for(var n,r;e&&(r=e[v]);e=t.pop())n=r,t.length&&s(r,e);return n}function l(e){var t=u(e);return null!=t&&t._hostNode===e?t:null}function c(e){if(void 0===e._hostNode&&p("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||p("34"),e=e._hostParent;for(;t.length;e=t.pop())s(e,e._hostNode);return e._hostNode}var p=n(11),f=n(89),h=n(453),d=(n(8),f.ID_ATTRIBUTE_NAME),m=h,v="__reactInternalInstance$"+Math.random().toString(36).slice(2),g={getClosestInstanceFromNode:u,getInstanceFromNode:l,getNodeFromInstance:c,precacheChildNodes:s,precacheNode:o,uncacheNode:a};e.exports=g},function(e,t){var n=e.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";function r(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===a.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=r(t.styleAliases||null),-1===s.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var o=n(117),a=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];e.exports=i},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(563),o=r(i),a=n(95),s=r(a);t.default=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=(0,s.default)(e);!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if((0,o.default)(Object(t)))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){var r=n(361)("wks"),i=n(201),o=n(30).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";t.__esModule=!0;var r=n(35),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=i.default||function(e){for(var t=1;t=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function l(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function c(e,t){var n=0;return o(y,t)?y[t]:35===t.charCodeAt(0)&&g.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),u(n))?l(n):e}function p(e){return e.indexOf("&")<0?e:e.replace(v,c)}function f(e){return x[e]}function h(e){return _.test(e)?e.replace(b,f):e}var d=Object.prototype.hasOwnProperty,m=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,v=/&([a-z#][a-z0-9]{1,31});/gi,g=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,y=n(488),_=/[&<>"]/,b=/[&<>"]/g,x={"&":"&","<":"<",">":">",'"':"""};t.assign=a,t.isString=i,t.has=o,t.unescapeMd=s,t.isValidEntityCode=u,t.fromCodePoint=l,t.replaceEntities=p,t.escapeHtml=h},function(e,t,n){var r=n(30),i=n(63),o=n(64),a=n(78),s=n(136),u=function(e,t,n){var l,c,p,f,h=e&u.F,d=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,_=d?i:i[t]||(i[t]={}),b=_.prototype||(_.prototype={});d&&(n=t);for(l in n)c=!h&&y&&void 0!==y[l],p=(c?y:n)[l],f=g&&c?s(p,r):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,l,p,e&u.U),_[l]!=p&&o(_,l,f),v&&b[l]!=p&&(b[l]=p)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(27),i=n(107),o=n(57),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+""};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){m&&h&&(m=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!m){var e=i(a);m=!0;for(var t=d.length;t;){for(h=d,d=[];++v1)for(var n=1;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return D(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}var l;if(i){var c=-1;for(l=n;ls&&(n=s-u),l=n;l>=0;l--){for(var p=!0,f=0;fi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=n){var u,l,c,p;switch(s){case 1:o<128&&(a=o);break;case 2:u=e[i+1],128==(192&u)&&(p=(31&o)<<6|63&u)>127&&(a=p);break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&(p=(15&o)<<12|(63&u)<<6|63&l)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(p=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=s}return O(r)}function O(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function F(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,r,52,8),n+8}function z(e){if(e=U(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function U(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function J(e){return Y.toByteArray(z(e))}function K(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function X(e){return e!==e}/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -var Y=n(622),$=n(763),Z=n(387);t.Buffer=o,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return u(null,e,t,n)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,s=n-t,u=Math.min(a,s),l=this.slice(r,i),c=e.slice(t,n),p=0;pi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return k(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){j(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a0&&(a=this.buffer[u-1],e.call(r,a)<0);)if(u--,this.pointer-u>n/2-1){o=" ... ",u+=5;break}for(l="",i=this.pointer;in/2-1){l=" ... ",i-=5;break}return""+new Array(t).join(" ")+o+this.buffer.slice(u,i)+l+"\n"+new Array(t+this.pointer-u+o.length).join(" ")+"^"},t.prototype.toString=function(){var e,t;return e=this.get_snippet(),t=" on line "+(this.line+1)+", column "+(this.column+1),e?t:t+":\n"+e},t}(),this.YAMLError=function(e){function n(e){this.message=e,n.__super__.constructor.call(this),this.stack=this.toString()+"\n"+(new Error).stack.split("\n").slice(1).join("\n")}return t(n,e),n.prototype.toString=function(){return this.message},n}(Error),this.MarkedYAMLError=function(e){function n(e,t,r,i,o){this.context=e,this.context_mark=t,this.problem=r,this.problem_mark=i,this.note=o,n.__super__.constructor.call(this)}return t(n,e),n.prototype.toString=function(){var e;return e=[],null!=this.context&&e.push(this.context),null==this.context_mark||null!=this.problem&&null!=this.problem_mark&&this.context_mark.line===this.problem_mark.line&&this.context_mark.column===this.problem_mark.column||e.push(this.context_mark.toString()),null!=this.problem&&e.push(this.problem),null!=this.problem_mark&&e.push(this.problem_mark.toString()),null!=this.note&&e.push(this.note),e.join("\n")},n}(this.YAMLError)}).call(this)},function(e,t,n){"use strict";var r=n(95),i=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;var t=["File","Blob","FormData"],n=!0,r=!1,o=void 0;try{for(var a,s=(0,i.default)(t);!(n=(a=s.next()).done);n=!0){var u=a.value;u in window&&(e[u]=window[u])}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}catch(e){console.error(e)}return e}()},function(e,t,n){e.exports={default:n(576),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(566),o=r(i),a=n(565),s=r(a),u="function"==typeof s.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===u(o.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":u(e)}},function(e,t,n){e.exports=!n(54)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";function r(e,t,n){return n?[e,t]:e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var i=this.constructor.Interface;for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse,this}var i=n(12),o=n(70),a=n(31),s=(n(10),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),u={type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n1?t-1:0),i=1;i2?n-2:0),o=2;o=n?e:e.length+1===n?""+t+e:""+new Array(n-e.length+1).join(t)+e},this.to_hex=function(e){return"string"==typeof e&&(e=e.charCodeAt(0)),e.toString(16)}}).call(this)}).call(t,n(17))},function(e,t,n){var r=n(77);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(138),i=n(360);e.exports=n(106)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=n(724),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){function r(e){return null==e?void 0===e?u:s:(e=Object(e),l&&l in e?o(e):a(e))}var i=n(82),o=n(895),a=n(924),s="[object Null]",u="[object Undefined]",l=i?i.toStringTag:void 0;e.exports=r},function(e,t,n){function r(e,t){var n=o(e,t);return i(n)?n:void 0}var i=n(853),o=n(896);e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r=n(11),i=(n(8),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),o=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},s=function(e,t,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,e,t,n,r),o}return new i(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(30),i=n(64),o=n(108),a=n(201)("src"),s=Function.toString,u=(""+s).split("toString");n(63).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(l&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){"use strict";var r=n(372)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";function r(e){return void 0===e||null===e}function i(e){return"object"==typeof e&&null!==e}function o(e){return Array.isArray(e)?e:r(e)?[]:[e]}function a(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t,n){"use strict";var r=n(12),i=n(474),o=n(1099),a=n(1100),s=n(93),u=n(1101),l=n(1102),c=n(1103),p=n(1107),f=s.createElement,h=s.createFactory,d=s.cloneElement,m=r,v=function(e){return e},g={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:p},Component:i.Component,PureComponent:i.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:c,createFactory:h,createMixin:v,DOM:a,version:l,__spread:m};e.exports=g},function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function i(e){return void 0!==e.key}var o=n(12),a=n(52),s=(n(10),n(478),Object.prototype.hasOwnProperty),u=n(476),l={key:!0,ref:!0,__self:!0,__source:!0},c=function(e,t,n,r,i,o,a){var s={$$typeof:u,type:e,key:t,ref:n,props:a,_owner:o};return s};c.createElement=function(e,t,n){var o,u={},p=null,f=null;if(null!=t){r(t)&&(f=t.ref),i(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source;for(o in t)s.call(t,o)&&!l.hasOwnProperty(o)&&(u[o]=t[o])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var d=Array(h),m=0;m1){for(var g=Array(v),y=0;y=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(562),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(605);for(var r=n(24),i=n(56),o=n(73),a=n(22)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u0?i(r(e),9007199254740991):0}},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function a(e){return"number"==typeof e}function s(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function l(e){return void 0===e}function c(e){return"[object RegExp]"===v(e)}function p(e){return"object"==typeof e&&null!==e}function f(e){return"[object Date]"===v(e)}function h(e){return"[object Error]"===v(e)||e instanceof Error}function d(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function v(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=r,t.isNull=i,t.isNullOrUndefined=o,t.isNumber=a,t.isString=s,t.isSymbol=u,t.isUndefined=l,t.isRegExp=c,t.isObject=p,t.isDate=f,t.isError=h,t.isFunction=d,t.isPrimitive=m,t.isBuffer=e.isBuffer}).call(t,n(38).Buffer)},function(e,t,n){"use strict";function r(e){return"string"==typeof e&&i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=/-webkit-|-moz-|-ms-/;e.exports=t.default},function(e,t){e.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(e){return"tag"===e.type||"script"===e.type||"style"===e.type}}},function(e,t,n){var r=n(710),i=n(709);t.decode=function(e,t){return(!t||t<=0?i.XML:i.HTML)(e)},t.decodeStrict=function(e,t){return(!t||t<=0?i.XML:i.HTMLStrict)(e)},t.encode=function(e,t){return(!t||t<=0?r.XML:r.HTML)(e)},t.encodeXML=r.XML,t.encodeHTML4=t.encodeHTML5=t.encodeHTML=r.HTML,t.decodeXML=t.decodeXMLStrict=i.XML,t.decodeHTML4=t.decodeHTML5=t.decodeHTML=i.HTML,t.decodeHTML4Strict=t.decodeHTML5Strict=t.decodeHTMLStrict=i.HTMLStrict,t.escape=r.escape},function(e,t,n){"use strict";var r=n(79);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){function r(t,n){return delete e.exports[t],e.exports[t]=n,n}var i=n(380),o=n(699);e.exports={Parser:i,Tokenizer:n(381),ElementType:n(113),DomHandler:o,get FeedHandler(){return r("FeedHandler",n(759))},get Stream(){return r("Stream",n(761))},get WritableStream(){return r("WritableStream",n(382))},get ProxyHandler(){return r("ProxyHandler",n(760))},get DomUtils(){return r("DomUtils",n(701))},get CollectingHandler(){return r("CollectingHandler",n(758))},DefaultHandler:o,get RssHandler(){return r("RssHandler",this.FeedHandler)},parseDOM:function(e,t){var n=new o(t);return new i(n,t).end(e),n.dom},parseFeed:function(t,n){var r=new e.exports.FeedHandler(n);return new i(r,n).end(t),r.dom},createDomStream:function(e,t,n){var r=new o(e,t,n);return new i(r,t)},EVENTS:{attribute:2,cdatastart:0,cdataend:0,text:1,processinginstruction:2,comment:1,commentend:0,closetag:1,opentag:2,opentagname:1,error:1,end:0}}},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=new r({include:[n(388)],implicit:[n(813),n(806)],explicit:[n(798),n(808),n(809),n(811)]})},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?s(e)?o(e[0],e[1]):i(e):u(e)}var i=n(857),o=n(858),a=n(224),s=n(20),u=n(951);e.exports=r},function(e,t){function n(e,t){return e===t||e!==e&&t!==t}e.exports=n},function(e,t){function n(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')}function r(e){var t=e.match(y);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var n=e,o=r(e);if(o){if(!o.path)return e;n=o.path}for(var a,s=t.isAbsolute(n),u=n.split(/\/+/),l=0,c=u.length-1;c>=0;c--)a=u[c],"."===a?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return n=u.join("/"),""===n&&(n=s?"/":"."),o?(o.path=n,i(o)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),a=r(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(_))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var s="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=s,i(a)):s}function s(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function u(e){return e}function l(e){return p(e)?"$"+e:e}function c(e){return p(e)?e.slice(1):e}function p(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function f(e,t,n){var r=d(e.source,t.source);return 0!==r?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)||n?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:(r=e.generatedLine-t.generatedLine,0!==r?r:d(e.name,t.name))}function h(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)||n?r:0!==(r=d(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,0!==r?r:d(e.name,t.name))}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=d(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:(n=e.originalColumn-t.originalColumn,0!==n?n:d(e.name,t.name))}function v(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function g(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var s=r(n);if(!s)throw new Error("sourceMapURL could not be parsed");if(s.path){var u=s.path.lastIndexOf("/");u>=0&&(s.path=s.path.substring(0,u+1))}t=a(i(s),t)}return o(t)}t.getArg=n;var y=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_=/^data:.+\,.+$/;t.urlParse=r,t.urlGenerate=i,t.normalize=o,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||y.test(e)},t.relative=s;var b=function(){return!("__proto__"in Object.create(null))}();t.toSetString=b?u:l,t.fromSetString=b?u:c,t.compareByOriginalPositions=f,t.compareByGeneratedPositionsDeflated=h,t.compareByGeneratedPositionsInflated=m,t.parseSourceMapInput=v,t.computeSourceURL=g},function(e,t,n){"use strict";function r(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}function i(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||!r(t));default:return!1}}var o=n(11),a=n(242),s=n(243),u=n(247),l=n(462),c=n(463),p=(n(8),{}),f=null,h=function(e,t){e&&(s.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},d=function(e){return h(e,!0)},m=function(e){return h(e,!1)},v=function(e){return"."+e._rootNodeID},g={injection:{injectEventPluginOrder:a.injectEventPluginOrder,injectEventPluginsByName:a.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&o("94",t,typeof n);var r=v(e);(p[t]||(p[t]={}))[r]=n;var i=a.registrationNameModules[t];i&&i.didPutListener&&i.didPutListener(e,t,n)},getListener:function(e,t){var n=p[t];if(i(t,e._currentElement.type,e._currentElement.props))return null;var r=v(e);return n&&n[r]},deleteListener:function(e,t){var n=a.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=p[t];if(r){delete r[v(e)]}},deleteAllListeners:function(e){var t=v(e);for(var n in p)if(p.hasOwnProperty(n)&&p[n][t]){var r=a.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete p[n][t]}},extractEvents:function(e,t,n,r){for(var i,o=a.plugins,s=0;s0&&void 0!==arguments[0]?arguments[0]:{};return{type:v,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CLEAR=t.NEW_AUTH_ERR=t.NEW_SPEC_ERR_BATCH=t.NEW_SPEC_ERR=t.NEW_THROWN_ERR_BATCH=t.NEW_THROWN_ERR=void 0,t.newThrownErr=r,t.newThrownErrBatch=i,t.newSpecErr=o,t.newSpecErrBatch=a,t.newAuthErr=s,t.clear=u;var l=n(265),c=function(e){return e&&e.__esModule?e:{default:e}}(l),p=t.NEW_THROWN_ERR="err_new_thrown_err",f=t.NEW_THROWN_ERR_BATCH="err_new_thrown_err_batch",h=t.NEW_SPEC_ERR="err_new_spec_err",d=t.NEW_SPEC_ERR_BATCH="err_new_spec_err_batch",m=t.NEW_AUTH_ERR="err_new_auth_err",v=t.CLEAR="err_clear"},function(e,t,n){var r=n(53),i=n(337),o=n(335),a=n(37),s=n(133),u=n(191),l={},c={},t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(h=s(e.length);h>_;_++)if((v=t?y(a(d=e[_])[0],d[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=i(m,y,d.value,t))===l||v===c)return v};t.BREAK=l,t.RETURN=c},function(e,t){e.exports=!0},function(e,t,n){var r=n(134)("meta"),i=n(29),o=n(55),a=n(41).f,s=0,u=Object.isExtensible||function(){return!0},l=!n(54)(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},h=function(e){return l&&d.NEED&&u(e)&&!o(e,r)&&c(e),e},d=e.exports={KEY:r,NEED:!1,fastKey:p,getWeak:f,onFreeze:h}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(187),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(135);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";var r=n(64),i=n(78),o=n(107),a=n(57),s=n(19);e.exports=function(e,t,n){var u=s(e),l=n(a,u,""[e]),c=l[0],p=l[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,c),r(RegExp.prototype,u,2==t?function(e,t){return p.call(e,this,t)}:function(e){return p.call(e,this)}))}},function(e,t,n){var r=n(62),i=n(641),o=n(660),a=Object.defineProperty;t.f=n(106)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(643),i=n(57);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r,i=n(373),o=n(376),a=n(728),s=n(733);r=e.exports=function(e,t){var n,r,a,u,l;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=a=!0,r=!1):(n=s.call(e,"c"),r=s.call(e,"e"),a=s.call(e,"w")),l={value:t,configurable:n,enumerable:r,writable:a},u?i(o(u),l):l},r.gs=function(e,t,n){var r,u,l,c;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],null==t?t=void 0:a(t)?null==n?n=void 0:a(n)||(l=n,n=void 0):(l=t,t=n=void 0),null==e?(r=!0,u=!1):(r=s.call(e,"c"),u=s.call(e,"e")),c={get:t,set:n,configurable:r,enumerable:u},l?i(o(l),c):c}},function(e,t,n){"use strict";e.exports=n(725)("forEach")},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),l=n.slice(),i=l.length,u=0;u0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=r.DEFAULT=new r({include:[n(118)],explicit:[n(804),n(803),n(802)]})},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e]/;e.exports=i},function(e,t,n){"use strict";var r,i=n(25),o=n(241),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(249),l=u(function(e,t){if(e.namespaceURI!==o.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML=""+t+"";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(i.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=l},function(e,t,n){"use strict";function r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o=-1,a=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos1&&void 0!==arguments[1])||arguments[1];return e=(0,s.normalizeArray)(e),{type:p,payload:{thing:e,shown:t}}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,s.normalizeArray)(e),{type:c,payload:{thing:e,mode:t}}}Object.defineProperty(t,"__esModule",{value:!0}),t.SHOW=t.UPDATE_MODE=t.UPDATE_FILTER=t.UPDATE_LAYOUT=void 0,t.updateLayout=r,t.updateFilter=i,t.show=o,t.changeMode=a;var s=n(9),u=t.UPDATE_LAYOUT="layout_update_layout",l=t.UPDATE_FILTER="layout_update_filter",c=t.UPDATE_MODE="layout_update_mode",p=t.SHOW="layout_show"},function(e,t,n){"use strict";function r(e,t){return{type:u,payload:{selectedServerUrl:e,namespace:t}}}function i(e){var t=e.value,n=e.pathMethod;return{type:l,payload:{value:t,pathMethod:n}}}function o(e){var t=e.value,n=e.pathMethod;return{type:c,payload:{value:t,pathMethod:n}}}function a(e){var t=e.value,n=e.path,r=e.method;return{type:p,payload:{value:t,path:n,method:r}}}function s(e){var t=e.server,n=e.namespace,r=e.key,i=e.val;return{type:f,payload:{server:t,namespace:n,key:r,val:i}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setSelectedServer=r,t.setRequestBodyValue=i,t.setRequestContentType=o,t.setResponseContentType=a,t.setServerVariableValue=s;var u=t.UPDATE_SELECTED_SERVER="oas3_set_servers",l=t.UPDATE_REQUEST_BODY_VALUE="oas3_set_request_body_value",c=t.UPDATE_REQUEST_CONTENT_TYPE="oas3_set_request_content_type",p=t.UPDATE_RESPONSE_CONTENT_TYPE="oas3_set_response_content_type",f=t.UPDATE_SERVER_VARIABLE_VALUE="oas3_set_server_variable_value"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=h(e,t);if(n)return(0,s.default)(n,{declaration:!0,indent:"\t"})}Object.defineProperty(t,"__esModule",{value:!0}),t.memoizedSampleFromSchema=t.memoizedCreateXMLExample=t.sampleXmlFromSchema=t.inferSchema=t.sampleFromSchema=void 0,t.createXMLExample=i;var o=n(9),a=n(1198),s=r(a),u=n(967),l=r(u),c={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},p=function(e){e=(0,o.objectify)(e);var t=e,n=t.type,r=t.format,i=c[n+"_"+r]||c[n];return(0,o.isFunc)(i)?i(e):"Unknown Type: "+e.type},f=t.sampleFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.example,s=r.properties,u=r.additionalProperties,l=r.items,c=n.includeReadOnly,f=n.includeWriteOnly;if(void 0!==a)return a;if(!i)if(s)i="object";else{if(!l)return;i="array"}if("object"===i){var h=(0,o.objectify)(s),d={};for(var m in h)h[m].readOnly&&!c||h[m].writeOnly&&!f||(d[m]=e(h[m],n));if(!0===u)d.additionalProp1={};else if(u)for(var v=(0,o.objectify)(u),g=e(v,n),y=1;y<4;y++)d["additionalProp"+y]=g;return d}return"array"===i?[e(l,n)]:t.enum?t.default?t.default:(0,o.normalizeArray)(t.enum)[0]:"file"!==i?p(t):void 0},h=(t.inferSchema=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},t.sampleXmlFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.properties,s=r.additionalProperties,u=r.items,l=r.example,c=n.includeReadOnly,f=n.includeWriteOnly,h=r.default,d={},m={},v=t.xml,g=v.name,y=v.prefix,_=v.namespace,b=r.enum,x=void 0,w=void 0;if(!i)if(a||s)i="object";else{if(!u)return;i="array"}if(g=g||"notagname",x=(y?y+":":"")+g,_){m[y?"xmlns:"+y:"xmlns"]=_}if("array"===i&&u){if(u.xml=u.xml||v||{},u.xml.name=u.xml.name||v.name,v.wrapped)return d[x]=[],Array.isArray(l)?l.forEach(function(t){u.example=t,d[x].push(e(u,n))}):Array.isArray(h)?h.forEach(function(t){u.default=t,d[x].push(e(u,n))}):d[x]=[e(u,n)],m&&d[x].push({_attr:m}),d;var k=[];return Array.isArray(l)?(l.forEach(function(t){u.example=t,k.push(e(u,n))}),k):Array.isArray(h)?(h.forEach(function(t){u.default=t,k.push(e(u,n))}),k):e(u,n)}if("object"===i){var E=(0,o.objectify)(a);d[x]=[],l=l||{};for(var S in E)if(E.hasOwnProperty(S)&&(!E[S].readOnly||c)&&(!E[S].writeOnly||f))if(E[S].xml=E[S].xml||{},E[S].xml.attribute){var C=Array.isArray(E[S].enum)&&E[S].enum[0],A=E[S].example,D=E[S].default;m[E[S].xml.name||S]=void 0!==A&&A||void 0!==l[S]&&l[S]||void 0!==D&&D||C||p(E[S])}else{E[S].xml.name=E[S].xml.name||S,E[S].example=void 0!==E[S].example?E[S].example:l[S];var O=e(E[S]);Array.isArray(O)?d[x]=d[x].concat(O):d[x].push(O)}return!0===s?d[x].push({additionalProp:"Anything can be here"}):s&&d[x].push({additionalProp:p(s)}),m&&d[x].push({_attr:m}),d}return w=void 0!==l?l:void 0!==h?h:Array.isArray(b)?b[0]:p(t),d[x]=m?[{_attr:m},w]:w,d});t.memoizedCreateXMLExample=(0,l.default)(i),t.memoizedSampleFromSchema=(0,l.default)(f)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=X(e).replace(/\t/g," ");if("string"==typeof e)return{type:R,payload:t}}function o(e){return{type:J,payload:e}}function a(e){return{type:j,payload:e}}function s(e){return{type:F,payload:e}}function u(e,t,n,r,i){return{type:N,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:i}}}function l(e){return{type:H,payload:{pathMethod:e}}}function c(e,t){return{type:G,payload:{path:e,value:t,key:"consumes_value"}}}function p(e,t){return{type:G,payload:{path:e,value:t,key:"produces_value"}}}function f(e,t){return{type:W,payload:{path:e,method:t}}}function h(e,t){return{type:V,payload:{path:e,method:t}}}function d(e,t,n){return{type:K,payload:{scheme:e,path:t,method:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.executeRequest=t.logRequest=t.setMutatedRequest=t.setRequest=t.setResponse=t.validateParams=t.resolveSpec=t.parseToJson=t.SET_SCHEME=t.UPDATE_RESOLVED=t.UPDATE_OPERATION_VALUE=t.CLEAR_VALIDATE_PARAMS=t.CLEAR_REQUEST=t.CLEAR_RESPONSE=t.LOG_REQUEST=t.SET_MUTATED_REQUEST=t.SET_REQUEST=t.SET_RESPONSE=t.VALIDATE_PARAMS=t.UPDATE_PARAM=t.UPDATE_JSON=t.UPDATE_URL=t.UPDATE_SPEC=void 0;var m=n(21),v=r(m),g=n(96),y=r(g),_=n(35),b=r(_),x=n(47),w=r(x),k=n(48),E=r(k);t.updateSpec=i,t.updateResolved=o,t.updateUrl=a,t.updateJsonSpec=s,t.changeParam=u,t.clearValidateParams=l,t.changeConsumesValue=c,t.changeProducesValue=p,t.clearResponse=f,t.clearRequest=h,t.setScheme=d;var S=n(210),C=r(S),A=n(1186),D=r(A),O=n(265),M=r(O),T=n(422),P=r(T),I=n(9),R=t.UPDATE_SPEC="spec_update_spec",j=t.UPDATE_URL="spec_update_url",F=t.UPDATE_JSON="spec_update_json",N=t.UPDATE_PARAM="spec_update_param",B=t.VALIDATE_PARAMS="spec_validate_param",L=t.SET_RESPONSE="spec_set_response",q=t.SET_REQUEST="spec_set_request",z=t.SET_MUTATED_REQUEST="spec_set_mutated_request",U=t.LOG_REQUEST="spec_log_request",W=t.CLEAR_RESPONSE="spec_clear_response",V=t.CLEAR_REQUEST="spec_clear_request",H=t.CLEAR_VALIDATE_PARAMS="spec_clear_validate_param",G=t.UPDATE_OPERATION_VALUE="spec_update_operation_value",J=t.UPDATE_RESOLVED="spec_update_resolved",K=t.SET_SCHEME="set_scheme",X=function(e){return(0,P.default)(e)?e:""},Y=(t.parseToJson=function(e){return function(t){var n=t.specActions,r=t.specSelectors,i=t.errActions,o=r.specStr,a=null;try{e=e||o(),i.clear({source:"parser"}),a=C.default.safeLoad(e)}catch(e){return console.error(e),i.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===(void 0===a?"undefined":(0,E.default)(a))?n.updateJsonSpec(a):{}}},t.resolveSpec=function(e,t){return function(n){var r=n.specActions,i=n.specSelectors,o=n.errActions,a=n.fn,s=a.fetch,u=a.resolve,l=a.AST,c=n.getConfigs,p=c(),f=p.modelPropertyMacro,h=p.parameterMacro,d=p.requestInterceptor,m=p.responseInterceptor;void 0===e&&(e=i.specJson()),void 0===t&&(t=i.url());var v=l.getLineNumberForPath,g=i.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:f,parameterMacro:h,requestInterceptor:d,responseInterceptor:m}).then(function(e){var t=e.spec,n=e.errors;if(o.clear({type:"thrown"}),Array.isArray(n)&&n.length>0){var i=n.map(function(e){return console.error(e),e.line=e.fullPath?v(g,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e});o.newThrownErrBatch(i)}return r.updateResolved(t)})}},t.validateParams=function(e,t){return{type:B,payload:{pathMethod:e,isOAS3:t}}},t.setResponse=function(e,t,n){return{payload:{path:e,method:t,res:n},type:L}},t.setRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:q}},t.setMutatedRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:z}},t.logRequest=function(e){return{payload:e,type:U}},t.executeRequest=function(e){return function(t){var n=t.fn,r=t.specActions,i=t.specSelectors,o=t.getConfigs,a=t.oas3Selectors,s=e.pathName,u=e.method,l=e.operation,c=o(),p=c.requestInterceptor,f=c.responseInterceptor,h=l.toJS();if(e.contextUrl=(0,D.default)(i.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&s&&u&&(e.operationId=n.opId(h,s,u)),i.isOAS3()){var d=s+":"+u;e.server=a.selectedServer(d)||a.selectedServer();var m=a.serverVariables({server:e.server,namespace:d}).toJS(),v=a.serverVariables({server:e.server}).toJS();e.serverVariables=(0,w.default)(m).length?m:v,e.requestContentType=a.requestContentType(s,u),e.responseContentType=a.responseContentType(s,u)||"*/*";var g=a.requestBodyValue(s,u);(0,I.isJSONObject)(g)?e.requestBody=JSON.parse(g):e.requestBody=g}var y=(0,b.default)({},e);y=n.buildRequest(y),r.setRequest(e.pathName,e.method,y);var _=function(t){var n=p.apply(this,[t]),i=(0,b.default)({},n);return r.setMutatedRequest(e.pathName,e.method,i),n};e.requestInterceptor=_,e.responseInterceptor=f;var x=Date.now();return n.execute(e).then(function(t){t.duration=Date.now()-x,r.setResponse(e.pathName,e.method,t)}).catch(function(t){return r.setResponse(e.pathName,e.method,{error:!0,err:(0,M.default)(t)})})}},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=(0,y.default)(e,["path","method"]);return function(e){var i=e.fn.fetch,o=e.specSelectors,a=e.specActions,s=o.spec().toJS(),u=o.operationScheme(t,n),l=o.contentTypeValues([t,n]).toJS(),c=l.requestContentType,p=l.responseContentType,f=/xml/i.test(c),h=o.parameterValues([t,n],f).toJS();return a.executeRequest((0,v.default)({fetch:i,spec:s,pathName:t,method:n,parameters:h,requestContentType:c,scheme:u,responseContentType:p},r))}});t.execute=Y},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(53),i=n(179),o=n(75),a=n(133),s=n(585);e.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,p=6==e,f=5==e||p,h=t||s;return function(t,s,d){for(var m,v,g=o(t),y=i(g),_=r(s,d,3),b=a(y.length),x=0,w=n?h(t,b):u?h(t,0):void 0;b>x;x++)if((f||x in y)&&(m=y[x],v=_(m,x,g),e))if(n)w[x]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:w.push(m)}else if(c)return!1;return p?-1:l||c?c:w}}},function(e,t,n){var r=n(99),i=n(22)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(29),i=n(24).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(99);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(98);e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(37),i=n(594),o=n(178),a=n(185)("IE_PROTO"),s=function(){},u=function(){var e,t=n(177)("iframe"),r=o.length;for(t.style.display="none",n(333).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(" + {% endblock %} + + {# + Change Redocly configuration + All parameters are explained on Redocly website: + https://redocly.com/docs/redoc/config/ + #} + {% block swagger_initialization %} + + {% endblock %} + + {# Import your own stylesheet #} + {% block stylesheets %} + {{ parent() }} + + {% endblock stylesheets %} + + {# Import your own script #} + {% block javascripts %} + {{ parent() }} + + {% endblock javascripts %} + +You can have a look at the `original template `_, in ``/templates/SwaggerUi/index.html.twig``, to see which blocks can be overridden. + +Assets Loading Options +----------------------- + +The `html_config` settings allow you to configure how assets are loaded for the UI. The `assets_mode` option supports three values: `cdn`, `bundle`, and `offline`. + + + .. code-block:: yaml + + nelmio_api_doc: + html_config: + assets_mode: 'cdn' # Other values: 'bundle', 'offline' + +`assets_mode` +~~~~~~~~~~~~~ + +The three values possible values can be found in `AssetsMode.php `_ +- **cdn**: Loads assets from `jsDelivr `_. +- **bundle**: Fetches assets from the bundle in the vendor directory, including updates. +- **offline**: Loads assets from the local `assets` directory, requiring the developer to update them manually. diff --git a/docs/faq.rst b/docs/faq.rst new file mode 100644 index 000000000..95181fffb --- /dev/null +++ b/docs/faq.rst @@ -0,0 +1,346 @@ +Frequently Asked Questions (FAQ) +================================ + +Sharing parameter configuration +------------------------------- + +Q: I use the same value in multiple endpoints. How can I avoid duplicating the descriptions? + +A: You can configure ``schemas`` in the nelmio_api_doc configuration and then reference them: + +.. code-block:: yaml + + # config/nelmio_api_doc.yaml + nelmio_api_doc: + documentation: + components: + schemas: + NelmioImageList: + description: "Response for some queries" + type: object + properties: + total: + type: integer + example: 42 + items: + type: array + items: + $ref: "#/components/schemas/ImageMetadata" + +.. code-block:: php + + // src/App/Controller/NelmioController.php + /** + * @OA\Response( + * response=200, + * description="List of image definitions", + * @OA\JsonContent( + * ref="#/components/schemas/NelmioImageList", + * ) + */ + +Optional Path Parameters +------------------------ + +Q: I have a controller with an optional path parameter. In swagger-ui, the parameter is required - can I make it +optional? The controller might look like this:: + + /** + * Get all user meta or metadata for a specific field. + * + * @Route("/{user}/meta/{metaName}", + * methods={"GET"}, + * name="get_user_metadata" + * ) + * + * @OA\Response( + * response=200, + * description="Json object with all user meta data or a json string with the value of the requested field" + * ) + */ + public function getAction(string $user, string $metaName = null) + { + ... + } + +A: Optional path parameters are not supported by the OpenAPI specification. The solution to this is to define two +separate actions in your controller. For example:: + + /** + * Get all user meta data. + * + * @Route("/{user}/meta", + * methods={"GET"}, + * name="get_user_metadata" + * ) + * + * @OA\Response( + * response=200, + * description="Json hashmap with all user meta data", + * @OA\JsonContent(@OA\Schema( + * type="object", + * example={"foo": "bar", "hello": "world"} + * )) + * ) + */ + public function cgetAction(string $user) + { + return $this->getAction($user, null); + } + + /** + * Get user meta for a specific field. + * + * @Route("/{user}/meta/{metaName}", + * methods={"GET"}, + * name="get_user_metadata_single" + * ) + * + * @OA\Response( + * response=200, + * description="A json string with the value of the requested field", + * @OA\JsonContent(@OA\Schema( + * type="string" + * )) + * ) + */ + public function getAction(string $user, string $metaName = null) + { + ... + } + +The first action is redundant for Symfony, but adds all the relevant documentation for the OpenAPI specification. + +Asset files not loaded +---------------------- + +Q: How do I fix 404 or 406 HTTP status on NelmioApiDocBundle assets files (css, js, images)? + +A: The assets normally are installed by composer if any command event (usually ``post-install-cmd`` or +``post-update-cmd``) triggers the ``ScriptHandler::installAssets`` script. +If you have not set up this script, you can manually execute this command: + +.. code-block:: bash + + $ php bin/console assets:install --symlink + +Re-add Google Fonts +------------------- + +Q: How can I change the font for the UI? + +A: We removed the google fonts in 3.3 to avoid the external request for GDPR reasons. To change the font, you can :doc:`customize the template ` to add this style information: + +.. code-block:: twig + + {# templates/bundles/NelmioApiDocBundle/SwaggerUi/index.html.twig #} + {# + To avoid a "reached nested level" error an exclamation mark `!` has to be added + See https://symfony.com/blog/new-in-symfony-3-4-improved-the-overriding-of-templates + #} + {% extends '@!NelmioApiDoc/SwaggerUi/index.html.twig' %} + + {% block stylesheets %} + + {{ parent() }} + + {% endblock stylesheets %} + +Endpoints grouping +------------------ + +Q: Areas feature doesn't fit my needs. So how can I group similar endpoints of one or more controllers in a separate section in the documentation? + +A: Use ``#[OA\Tag]`` attribute. + +.. configuration-block:: + + .. code-block:: php-annotations + + /** + * Class BookmarkController + * + * @OA\Tag(name="Bookmarks") + */ + class BookmarkController extends AbstractFOSRestController implements ContextPresetInterface + { + // ... + } + + .. code-block:: php-attributes + + /** + * Class BookmarkController + */ + #[OA\Tag(name: "Bookmarks")] + class BookmarkController extends AbstractFOSRestController implements ContextPresetInterface + { + // ... + } + + +Disable Default Section +----------------------- + +Q: I don't want to render the "default" section, how do I do that? + +A: Use ``disable_default_routes`` config in your area. + +.. code-block:: yaml + + nelmio_api_doc: + areas: + default: + disable_default_routes: true + +Overriding a Form or Plain PHP Object Schema Type +------------------------------------------------- + +Q: I'd like to define a PHP object or form with a type other any ``object``, how +do I do that? + +A: By using the ``#[OA\Schema]`` attribute/annotation with a ``type`` or ``ref``. +Note, however, that a ``type="object"`` will still read all a models properties. + +.. configuration-block:: + + .. code-block:: php-annotations + + use Nelmio\ApiDocBundle\Annotation\Model; + use OpenApi\Annotations as OA; + + /** + * @OA\Schema(type="array", @OA\Items(ref=@Model(type=SomeEntity::class))) + * + * or define a `ref`: + * @OA\Schema(ref="#/components/schemas/SomeRef") + */ + class SomeCollection implements \IteratorAggregate + { + // ... + } + + .. code-block:: php-attributes + + use Nelmio\ApiDocBundle\Attribute\Model; + use OpenApi\Attributes as OA; + + /** + * or define a `ref`: + * #[OA\Schema(ref: "#/components/schemas/SomeRef") + */ + #[OA\Schema(type: "array", items: new OA\Items(ref: new Model(type: SomeEntity::class)))] + class SomeCollection implements \IteratorAggregate + { + // ... + } + +PropertyInfo component was unable to guess the type +--------------------------------------------------- + +Q: I have a property that is not recognized. How can I specify the type? + +.. tip:: + + Enable the `TypeInfo component`_ in your configuration to improve automatic type guessing: + + .. code-block:: yaml + + nelmio_api_doc: + type_info: true + # ... + +.. versionadded:: 4.35 + + The `TypeInfo component`_ was introduced as a stable feature in Symfony 7.2. + +A: If you want to customize the documentation of an object's property, you can use the ``#[OA\Property]`` attribute or annotate the property with ``@var``:: + +.. configuration-block:: + + .. code-block:: php-annotations + + use Nelmio\ApiDocBundle\Attribute\Model; + use OpenApi\Annotations as OA; + + class User + { + /** + * @var int + * @OA\Property(description="The unique identifier of the user.") + */ + public $id; + + /** + * @OA\Property(type="string", maxLength=255) + */ + public $username; + + /** + * @OA\Property(ref=@Model(type=User::class)) + */ + public $friend; + + /** + * @OA\Property(description="This is my coworker!") + */ + public setCoworker(User $coworker) { + // ... + } + } + + .. code-block:: php-attributes + + use Nelmio\ApiDocBundle\Attribute\Model; + use OpenApi\Attributes as OA; + + class User + { + /** + * @var int + */ + #[OA\Property(description: 'The unique identifier of the user.')] + public $id; + + #[OA\Property(type: 'string', maxLength: 255)] + public $username; + + #[OA\Property(ref: new Model(type: User::class))] + public $friend; + + #[OA\Property(description: 'This is my coworker!')] + public setCoworker(User $coworker) { + // ... + } + } + +.. _`TypeInfo component`: https://symfony.com/doc/current/components/type_info.html diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 000000000..f03a53ee8 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,638 @@ +NelmioApiDocBundle +================== + +The **NelmioApiDocBundle** bundle allows you to generate documentation in the +OpenAPI (Swagger) format and provides a sandbox to interactively experiment with the API. + +What's supported? +----------------- + +This bundle supports *Symfony* route requirements, *Symfony* request mapping (:doc:`symfony_attributes`), PHP annotations, `Swagger-Php`_ annotations, +`FOSRestBundle`_ annotations and applications using `Api-Platform`_. + +.. _`Swagger-Php`: https://github.com/zircote/swagger-php +.. _`FOSRestBundle`: https://github.com/FriendsOfSymfony/FOSRestBundle +.. _`Api-Platform`: https://github.com/api-platform/api-platform + +For models, it supports the `Symfony serializer`_ , the `JMS serializer`_ and the `willdurand/Hateoas`_ library. +It does also support `Symfony form`_ types. + +Attributes are supported from version 4.7 and PHP 8.1. + +Migrate from 3.x to 4.0 +----------------------- + +`To migrate from 3.x to 4.0, follow our guide.`__ + +__ https://github.com/nelmio/NelmioApiDocBundle/blob/master/UPGRADE-4.0.md + +Installation +------------ + +Open a command console, enter your project directory and execute the following command to download the latest version of this bundle: + +.. code-block:: bash + + $ composer require nelmio/api-doc-bundle + +By default, only routes under ``/api`` are documented. Update the regexp at ``nelmio_api_doc.areas.path_patterns`` in ``config/packages/nelmio_api_doc.yaml`` to change this policy. + +.. note:: + + If you're not using Flex, then add the bundle to your kernel:: + + class AppKernel extends Kernel + { + public function registerBundles(): iterable + { + $bundles = [ + // ... + + new Nelmio\ApiDocBundle\NelmioApiDocBundle(), + ]; + + // ... + } + } + + To browse your documentation with an UI, register one of the following route: + + .. code-block:: yaml + + # config/routes.yaml + app.swagger_ui: + path: /api/doc + methods: GET + defaults: { _controller: nelmio_api_doc.controller.swagger_ui } + + .. code-block:: yaml + + # config/routes.yaml + app.redocly: + path: /api/doc + methods: GET + defaults: { _controller: nelmio_api_doc.controller.redocly } + + .. code-block:: yaml + + # config/routes.yaml + app.stoplight: + path: /api/doc + methods: GET + defaults: { _controller: nelmio_api_doc.controller.stoplight } + + If you also want to expose it in JSON, register this route: + + .. code-block:: yaml + + # config/routes.yaml + app.swagger: + path: /api/doc.json + methods: GET + defaults: { _controller: nelmio_api_doc.controller.swagger } + + As you just installed the bundle, you'll likely see routes you don't want in + your documentation such as ``/_profiler/``. To fix this, you can filter the + routes that are documented by configuring the bundle: + + .. code-block:: yaml + + # config/packages/nelmio_api_doc.yaml + nelmio_api_doc: + areas: + path_patterns: # an array of regexps (document only routes under /api, except /api/doc) + - ^/api(?!/doc$) + host_patterns: # document only routes with a host of the form api.* + - ^api\. + +.. tip:: + + `Twig `_ and `Assets `_ packages are needed to use swagger ui. + +How does this bundle work? +-------------------------- + +It generates an OpenAPI documentation from your Symfony app thanks to +**Describers**. One extracts data from SwaggerPHP attributes/annotations, one from your +routes, etc. + +If you configured the ``app.swagger_ui`` route above, you can browse your +documentation at ``http://example.org/api/doc``. + +Using the bundle +---------------- + +You can configure global information in the bundle configuration ``documentation.info`` section (take a look at +`the OpenAPI 3.0 specification (formerly Swagger)`_ to know the available fields). + +.. code-block:: yaml + + nelmio_api_doc: + documentation: + servers: + - url: http://api.example.com/unsafe + description: API over HTTP + - url: https://api.example.com/secured + description: API over HTTPS + info: + title: My App + description: This is an awesome app! + version: 1.0.0 + x-build: #CommitHash + components: + securitySchemes: + Bearer: + type: http + scheme: bearer + bearerFormat: JWT + security: + - Bearer: [] + +.. _`the OpenAPI 3.0 specification (formerly Swagger)`: https://swagger.io/docs/specification + +.. note:: + + If you're using Flex, this config is there by default under ``config/packages/nelmio_api_doc.yaml``. Don't forget to adapt it to your app! + +.. tip:: + + This configuration field can more generally be used to store your documentation as yaml. + You may find in the ``.yaml`` files from `SwaggerPHP examples`_. + +To document your routes, you can use the SwaggerPHP attributes/annotations and the +``#[Model]`` attribute/annotation in your controllers:: + +.. configuration-block:: + + .. code-block:: php-annotations + + namespace AppBundle\Controller; + + use AppBundle\Entity\Reward; + use AppBundle\Entity\User; + use Nelmio\ApiDocBundle\Annotation\Model; + use Nelmio\ApiDocBundle\Annotation\Security; + use OpenApi\Annotations as OA; + use Symfony\Component\Routing\Annotation\Route; + + class UserController + { + /** + * List the rewards of the specified user. + * + * This call takes into account all confirmed awards, but not pending or refused awards. + * + * @Route("/api/{user}/rewards", methods={"GET"}) + * @OA\Response( + * response=200, + * description="Returns the rewards of an user", + * @OA\JsonContent( + * type="array", + * @OA\Items(ref=@Model(type=Reward::class, groups={"full"})) + * ) + * ) + * @OA\Parameter( + * name="order", + * in="query", + * description="The field used to order rewards", + * @OA\Schema(type="string") + * ) + * @OA\Tag(name="rewards") + * @Security(name="Bearer") + */ + public function fetchUserRewardsAction(User $user) + { + // ... + } + } + + .. code-block:: php-attributes + + namespace AppBundle\Controller; + + use AppBundle\Entity\Reward; + use AppBundle\Entity\User; + use Nelmio\ApiDocBundle\Attribute\Model; + use Nelmio\ApiDocBundle\Attribute\Security; + use OpenApi\Attributes as OA; + use Symfony\Component\Routing\Annotation\Route; + + class UserController + { + /** + * List the rewards of the specified user. + * + * This call takes into account all confirmed awards, but not pending or refused awards. + */ + #[Route('/api/{user}/rewards', methods: ['GET'])] + #[OA\Response( + response: 200, + description: 'Returns the rewards of an user', + content: new OA\JsonContent( + type: 'array', + items: new OA\Items(ref: new Model(type: AlbumDto::class, groups: ['full'])) + ) + )] + #[OA\Parameter( + name: 'order', + in: 'query', + description: 'The field used to order rewards', + schema: new OA\Schema(type: 'string') + )] + #[OA\Tag(name: 'rewards')] + #[Security(name: 'Bearer')] + public function fetchUserRewardsAction(User $user) + { + // ... + } + } + + +The normal PHPDoc block on the controller method is used for the summary and description. + +.. tip:: + + Examples of using the attributes/annotations can be found in `SwaggerPHP examples`_. + However, unlike in those examples, when using this bundle you don't need to specify paths and you can easily document models as well as some + other properties described below as they can be automatically be documented using the Symfony integration. + +.. tip:: + + **NelmioApiDocBundle** understands **symfony's** controller attributes. + Using these attributes inside your controller allows this bundle to automatically create the necessary documentation. + More information can be found here: :doc:`symfony_attributes`. + +Use Models +---------- + +As shown in the example above, the bundle provides the ``#[Model]`` attribute. +Use it instead of a definition reference and the bundle will deduce your model properties. + +.. note:: + + A model can be a Symfony form type, a Doctrine ORM entity or a general PHP object. + +This attribute has two options: + +* ``type`` to specify your model's type:: + +.. configuration-block:: + + .. code-block:: php-annotations + + /** + * @OA\Response( + * response=200, + *     @Model(type=User::class) + * ) + */ + + .. code-block:: php-attributes + + #[OA\Response( + response: 200, + description: 'Successful response', + content: new Model(type: User::class) + )] + +* ``groups`` to specify the serialization groups used to (de)serialize your model:: + + +.. configuration-block:: + + .. code-block:: php-annotations + + /** + * @OA\Response( + * response=200, + *     @Model(type=User::class, groups={"non_sensitive_data"}) + * ) + */ + + .. code-block:: php-attributes + + #[OA\Response( + response: 200, + description: 'Successful response', + content: new Model(type: User::class, groups: ['non_sensitive_data']) + )] + +* ``groups`` may also be used to specify the constraint validation groups used + (de)serialize your model, but this must be enabled in configuration:: + +.. code-block:: yaml + + nelmio_api_doc: + use_validation_groups: true + # ... + +With this enabled, groups set in the model will apply to both serializer +properties and validator constraints. Take the model class below: + +.. configuration-block:: + + .. code-block:: php-annotations + + use Symfony\Component\Serializer\Annotation\Groups; + use Symfony\Component\Validator\Constraints as Assert; + + class UserDto + { + /** + * @Groups({"default", "create", "update"}) + * @Assert\NotBlank(groups={"default", "create"}) + */ + public string $username; + } + + .. code-block:: php-attributes + + use Symfony\Component\Serializer\Annotation\Groups; + use Symfony\Component\Validator\Constraints as Assert; + + class UserDto + { + #[Groups(["default", "create", "update"])] + #[Assert\NotBlank(groups: ["default", "create"])] + public string $username; + } + +The ``NotBlank`` constraint will apply only to the ``default`` and ``create`` +group, but not ``update``. In more practical terms: the ``username`` property +would show as ``required`` for both model create and default, but not update. +When using code generators to build API clients, this often translates into +client side validation and types. ``NotBlank`` adding ``required`` will cause +that property type to not be nullable, for example. + +.. configuration-block:: + + .. code-block:: php-annotations + + use OpenApi\Annotations as OA; + + /** + * shows `username` as `required` in the OpenAPI schema (not nullable) + * @OA\Response( + * response=200, + *     @Model(type=UserDto::class, groups={"default"}) + * ) + */ + + /** + * Similarly, this will make the username `required` in the create + * schema + * @OA\RequestBody(@Model(type=UserDto::class, groups={"create"})) + */ + + /** + * But for updates, the `username` property will not be required + * @OA\RequestBody(@Model(type=UserDto::class, groups={"update"})) + */ + + .. code-block:: php-attributes + + use OpenApi\Attributes as OA; + + // shows `username` as `required` in the OpenAPI schema (not nullable) + #[OA\Response(response: 200, content: new Model(type: UserDto::class, groups: ["default"]))] + + // Similarly, this will make the username `required` in the create schema + #[OA\RequestBody(content: new Model(type: UserDto::class, groups: ["create"]))] + + // But for updates, the `username` property will not be required + #[OA\RequestBody(content: new Model(type: UserDto::class, groups: ["update"]))] + + +.. tip:: + + When used at the root of ``#[OA\Response]`` and ``#[OA\Parameter]``, ``#[Model]`` is automatically nested + in a ``#[OA\Schema]``. + + The media type defaults to ``application/json``. + + To use ``#[Model]`` directly within a ``#[OA\Schema]``, ``#[OA\Items]`` or ``#[OA\Property]``, you have to use the ``$ref`` field:: + +.. configuration-block:: + + .. code-block:: php-annotations + + /** + * @OA\Response( + * @OA\JsonContent(ref=@Model(type=User::class)) + * ) + * + * or + * + * @OA\Response(@OA\XmlContent( + * @OA\Schema(type="object", + * @OA\Property(property="foo", ref=@Model(type=FooClass::class)) + * ) + * )) + */ + + .. code-block:: php-attributes + + #[OA\Response( + content: new OA\JsonContent(ref: new Model(type: User::class)) + )] + /** + * or + */ + #[OA\Response( + content: new OA\XmlContent(example: new OA\Schema( + type: 'object', + properties: [ + new OA\Property(property: 'foo', ref: new Model(type: FooClass::class)) + ] + )) + )] + +Symfony Form types +~~~~~~~~~~~~~~~~~~ + +You can customize the documentation of a form field using the ``documentation`` option:: + + $builder->add('username', TextType::class, [ + 'documentation' => [ + 'type' => 'string', // would have been automatically detected in this case + 'description' => 'Your username.', + ], + ]); + +See the `OpenAPI 3.0 specification`__ to see all the available fields of the ``documentation`` option (it accepts the same fields as the OpenApi ``Property`` object). + +__ https://swagger.io/specification/ + + +General PHP objects +~~~~~~~~~~~~~~~~~~~ + +.. tip:: + + **If you're not using the JMS Serializer**, the `Symfony PropertyInfo component`_ is used to describe your models. + It supports doctrine attributes/annotations, type hints, and even PHP doc blocks. + It does also support serialization groups when using the Symfony serializer. + + **If you're using the JMS Serializer**, the metadata of the JMS serializer are used by default to describe your + models. Additional information is extracted from the PHP doc block comment, + but the property types must be specified in the JMS attributes/annotations. + + NOTE: If you are using serialization contexts (e.g. Groups) each permutation will be treated as a separate Path. For example if you have the following two variations defined in different places in your code: + + .. code-block:: php + + /** + * A nested serializer property with no context group + * + * @JMS\VirtualProperty + * @JMS\Type("ArrayCollection") + * @JMS\Since("1.0") + * + * @return Collection|ItemResponse[] + */ + public function getItems(): Collection|array + { + return $this->items; + } + + + .. configuration-block:: + + .. code-block:: php-annotations + + @OA\Schema(ref=@Model(type="App\Response\ItemResponse", groups=["Default"])), + + .. code-block:: php-attributes + + #[OA\Schema(ref: new Model(type: App\Response\ItemResponse::class, groups: ['Default']))] + + It will generate two different component schemas (ItemResponse, ItemResponse2), even though Default and blank are the same. This is by design. + + In case you prefer using the `Symfony PropertyInfo component`_ (you + won't be able to use JMS serialization groups), you can disable JMS serializer + support in your config: + + .. code-block:: yaml + + nelmio_api_doc: + models: { use_jms: false } + + Alternatively, it is also possible to opt out of JMS serializer usage per endpoint by setting ``useJms`` in the serializationContext: + + .. configuration-block:: + + .. code-block:: php-annotations + + /** @OA\Response(response=200, @Model(type=UserDto::class, serializationContext={"useJms"=false})) */ + + .. code-block:: php-attributes + + #[OA\Response(response: 200, content: new Model(type: UserDto::class, serializationContext: ["useJms" => false]))] + + When using the JMS serializer combined with `willdurand/Hateoas`_ (and the `BazingaHateoasBundle`_), + HATEOAS metadata are automatically extracted + +.. tip:: + + Enable the `TypeInfo component`_ in your configuration to improve automatic type guessing: + + .. code-block:: yaml + + nelmio_api_doc: + type_info: true + # ... + +.. versionadded:: 4.35 + + The `TypeInfo component`_ was introduced as a stable feature in Symfony 7.2. + +If you want to customize the documentation of an object's property, you can use ``#[OA\Property]``:: + + +.. configuration-block:: + + .. code-block:: php-annotations + + use Nelmio\ApiDocBundle\Attribute\Model; + use OpenApi\Annotations as OA; + + class User + { + /** + * @var int + * @OA\Property(description="The unique identifier of the user.") + */ + public $id; + + /** + * @OA\Property(type="string", maxLength=255) + */ + public $username; + + /** + * @OA\Property(ref=@Model(type=User::class)) + */ + public $friend; + + /** + * @OA\Property(description="This is my coworker!") + */ + public setCoworker(User $coworker) { + // ... + } + } + + .. code-block:: php-attributes + + use Nelmio\ApiDocBundle\Attribute\Model; + use OpenApi\Attributes as OA; + + class User + { + /** + * @var int + */ + #[OA\Property(description: 'The unique identifier of the user.')] + public $id; + + #[OA\Property(type: 'string', maxLength: 255)] + public $username; + + #[OA\Property(ref: new Model(type: User::class))] + public $friend; + + #[OA\Property(description: 'This is my coworker!')] + public setCoworker(User $coworker) { + // ... + } + } + +See the `OpenAPI 3.0 specification`__ to see all the available fields of ``#[@OA\Property]``. + +__ https://swagger.io/specification/ + +Learn more +---------- + +If you need more complex features, take a look at: + +.. toctree:: + :maxdepth: 1 + + areas + alternative_names + customization + commands + security + symfony_attributes + configuration_reference + faq + +.. _`SwaggerPHP examples`: https://github.com/zircote/swagger-php/tree/master/Examples +.. _`Symfony PropertyInfo component`: https://symfony.com/doc/current/components/property_info.html +.. _`TypeInfo component`: https://symfony.com/doc/current/components/type_info.html +.. _`willdurand/Hateoas`: https://github.com/willdurand/Hateoas +.. _`BazingaHateoasBundle`: https://github.com/willdurand/BazingaHateoasBundle +.. _`JMS serializer`: https://jmsyst.com/libs/serializer +.. _`Symfony form`: https://symfony.com/doc/current/forms.html +.. _`Symfony serializer`: https://symfony.com/doc/current/components/serializer.html diff --git a/docs/security.rst b/docs/security.rst new file mode 100644 index 000000000..cfa9b0c47 --- /dev/null +++ b/docs/security.rst @@ -0,0 +1,55 @@ +Security +======== + +A default security policy can be added in ``nelmio_api_doc.documentation.security`` + +.. code-block:: yaml + + nelmio_api_doc: + documentation: + components: + securitySchemes: + Bearer: + type: http + scheme: bearer + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + security: + - Bearer: [] + +This will add the Bearer security policy to all registered paths. + +Overriding Specific Paths +------------------------- + +The security policy can be overridden for a path using the ``Security`` attribute/annotation. + +.. configuration-block:: + + .. code-block:: php-annotations + + /** + * @Security(name="ApiKeyAuth") + */ + + .. code-block:: php-attributes + + #[Security(name: "ApiKeyAuth")] + +Notice at the bottom of the docblock is a ``Security`` attribute/annotation with a name of `ApiKeyAuth`. This will override the global security policy to only accept the ``ApiKeyAuth`` policy for this path. + +You can also completely remove security from a path by providing ``Security`` with a name of ``null``. + +.. configuration-block:: + + .. code-block:: php-annotations + + /** + * @Security(name=null) + */ + + .. code-block:: php-attributes + + #[Security(name: null)] diff --git a/docs/symfony_attributes.rst b/docs/symfony_attributes.rst new file mode 100644 index 000000000..e88c95a76 --- /dev/null +++ b/docs/symfony_attributes.rst @@ -0,0 +1,240 @@ +Symfony attributes +================================ + +NelmioApiDocBundle has the ability to automatically create documentation from **symfony** controller attributes. + +MapQueryString +------------------------------- + +Using the `Symfony MapQueryString`_ attribute allows NelmioApiDocBundle to automatically generate your query parameter documentation for your endpoint from your object. + +Modify generated documentation +~~~~~~~ + +Modifying the generated documentation can easily by done in two ways, by: +* Customizing the documentation of an object's property (``#[OA\Property]`` attribute) +* Customizing the documentation of a query parameter (``#[OA\Parameter]`` attribute) + +Customizing the documentation of a specific query parameter can be done by adding the ``#[OA\Parameter]`` attribute to your controller method. +Make sure that the ``in`` property is set to ``'query'`` and that the ``name`` property is set to the object's property name which you want to customize. + + .. code-block:: php-attributes + + #[OA\Parameter( + name: 'id', + description: 'Some additional parameter description', + in: 'query', + )] + +MapQueryParameter +------------------------------- + +Using the `Symfony MapQueryParameter`_ attribute allows NelmioApiDocBundle to automatically generate your query parameter documentation for your endpoint. + +Modify generated documentation +~~~~~~~ + +Customizing the documentation of the query parameter can be done by adding the ``#[OA\Parameter]`` attribute to your controller method. +Make sure that the ``in`` property is set to ``'query'`` and that the ``name`` property is set to the name of the controller method parameter. + + .. code-block:: php-attributes + + #[OA\Parameter( + name: 'id', + description: 'Some additional parameter description', + in: 'query', + )] + +MapRequestPayload +------------------------------- + +Using the `Symfony MapRequestPayload`_ attribute allows NelmioApiDocBundle to automatically generate your request body documentation for your endpoint. + +Modify generated documentation +~~~~~~~ + +Customizing the documentation of the request body can be done by adding the ``#[OA\RequestBody]`` attribute to your controller method. + + .. code-block:: php-attributes + + #[OA\RequestBody( + groups: ["create"], + ) + +MapUploadedFile +------------------------------- + +Using the `Symfony MapUploadedFile`_ attribute allows NelmioApiDocBundle to automatically generate your request body documentation for your endpoint. + +.. versionadded:: 4.37 + + The :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapUploadedFile` attribute was introduced in Symfony 7.1. + + +Modify generated documentation +~~~~~~~ + +Customizing the documentation of the uploaded file can be done by adding the ``#[OA\RequestBody]`` attribute with the corresponding ``#[OA\MediaType]`` and ``#[OA\Schema]`` to your controller method. + + .. code-block:: php-attributes + + #[OA\RequestBody( + description: 'Describe the body', + content: [ + new OA\MediaType('multipart/form-data', new OA\Schema( + properties: [new OA\Property( + property: 'file', + description: 'Describe the file' + )], + )), + ], + )] + +Complete example +---------------------- + + .. code-block:: php-attributes + + class UserQuery + { + public int $userId; + } + + .. code-block:: php-attributes + + use Symfony\Component\Serializer\Annotation\Groups; + use Symfony\Component\Validator\Constraints as Assert; + + class UserDto + { + #[Groups(["default", "create", "update"])] + #[Assert\NotBlank(groups: ["default", "create"])] + public string $username; + } + + .. code-block:: php-attributes + + namespace AppBundle\Controller; + + use AppBundle\UserDTO; + use AppBundle\UserQuery; + use OpenApi\Attributes as OA; + use Symfony\Component\HttpKernel\Attribute\MapQueryParameter; + use Symfony\Component\HttpKernel\Attribute\MapQueryString; + use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; + use Symfony\Component\HttpKernel\Attribute\MapUploadedFile; + use Symfony\Component\Routing\Annotation\Route; + + class UserController + { + /** + * Find user with MapQueryString. + */ + #[Route('/api/users', methods: ['GET'])] + #[OA\Parameter( + name: 'userId', + description: 'Id of the user to find', + in: 'query', + )] + public function findUser(#[MapQueryString] UserQuery $userQuery) + { + // ... + } + + /** + * Find user with MapQueryParameter. + */ + #[Route('/api/users/v2', methods: ['GET'])] + #[OA\Parameter( + name: 'userId', + description: 'Id of the user to find', + in: 'query', + )] + public function findUserV2(#[MapQueryParameter] int $userId) + { + // ... + } + + /** + * Create a new user. + */ + #[Route('/api/users', methods: ['POST'])] + #[OA\RequestBody( + groups: ['create'], + )] + public function createUser(#[MapRequestPayload] UserDTO $user) + { + // ... + } + + /** + * Upload a profile picture + */ + #[Route('/api/users/picture', methods: ['POST'])] + #[OA\RequestBody( + description: 'Content of the profile picture upload request', + content: [ + new OA\MediaType('multipart/form-data', new OA\Schema( + properties: [new OA\Property( + property: 'file', + description: 'File containing the profile picture', + )], + )), + ], + )] + public function createUser(#[MapUploadedFile] UploadedFile $picture) + { + // ... + } + } + +Customization +---------------------- + +Imagine you want to add, modify, or remove some documentation for a route argument. For that you will have to create your own describer which implements the `RouteArgumentDescriberInterface`_ interface. + +Register your route argument describer +~~~~~~~ + +Before you can use your custom describer you must register it in your route argument describer as a service and tag it with ``nelmio_api_doc.route_argument_describer``. +Services implementing the `RouteArgumentDescriberInterface`_ interface are automatically detected and used by NelmioApiDocBundle. + +.. configuration-block:: + + .. code-block:: yaml + + # config/services.yaml + services: + App\Describer\CustomRouteArgumentDescriber: + tags: + - { name: nelmio_api_doc.route_argument_describer } + + .. code-block:: xml + + + + + + + .. code-block:: php + + // config/services.php + use App\Describer\CustomRouteArgumentDescriber; + + return function (ContainerConfigurator $container) { + $container->services() + ->set(CustomRouteArgumentDescriber::class) + ->tag('nelmio_api_doc.route_argument_describer') + ; + }; + +Disclaimer +---------------------- + +Make sure to use at least php 8.1 (attribute support) to make use of this functionality. + +.. _`Symfony MapQueryString`: https://symfony.com/doc/current/controller.html#mapping-the-whole-query-string +.. _`Symfony MapQueryParameter`: https://symfony.com/doc/current/controller.html#mapping-query-parameters-individually +.. _`Symfony MapRequestPayload`: https://symfony.com/doc/current/controller.html#mapping-request-payload +.. _`Symfony MapUploadedFile`: https://symfony.com/doc/current/controller.html#mapping-uploaded-files +.. _`RouteArgumentDescriberInterface`: https://github.com/DjordyKoert/NelmioApiDocBundle/blob/master/src/RouteDescriber/RouteArgumentDescriber/RouteArgumentDescriberInterface.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 000000000..b9f3a3e92 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,166 @@ +parameters: + ignoreErrors: + - + message: "#^Class Nelmio\\\\ApiDocBundle\\\\Annotation\\\\Areas extends @final class Nelmio\\\\ApiDocBundle\\\\Attribute\\\\Areas\\.$#" + count: 1 + path: src/Annotation/Areas.php + + - + message: "#^Class Nelmio\\\\ApiDocBundle\\\\Annotation\\\\Model extends @final class Nelmio\\\\ApiDocBundle\\\\Attribute\\\\Model\\.$#" + count: 1 + path: src/Annotation/Model.php + + - + message: "#^Class Nelmio\\\\ApiDocBundle\\\\Annotation\\\\Operation extends @final class Nelmio\\\\ApiDocBundle\\\\Attribute\\\\Operation\\.$#" + count: 1 + path: src/Annotation/Operation.php + + - + message: "#^Class Nelmio\\\\ApiDocBundle\\\\Annotation\\\\Security extends @final class Nelmio\\\\ApiDocBundle\\\\Attribute\\\\Security\\.$#" + count: 1 + path: src/Annotation/Security.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: src/Describer/ExternalDocDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\PropertyDescriberInterface\\:\\:describe\\(\\) invoked with 5 parameters, 2\\-3 required\\.$#" + count: 1 + path: src/ModelDescriber/ObjectModelDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\ArrayPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/ArrayPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\PropertyDescriberInterface\\:\\:describe\\(\\) invoked with 5 parameters, 2\\-3 required\\.$#" + count: 1 + path: src/PropertyDescriber/ArrayPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\BooleanPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/BooleanPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\CompoundPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/CompoundPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\PropertyDescriberInterface\\:\\:describe\\(\\) invoked with 5 parameters, 2\\-3 required\\.$#" + count: 1 + path: src/PropertyDescriber/CompoundPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\DateTimePropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/DateTimePropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\DictionaryPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/DictionaryPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\PropertyDescriberInterface\\:\\:describe\\(\\) invoked with 5 parameters, 2\\-3 required\\.$#" + count: 1 + path: src/PropertyDescriber/DictionaryPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\FloatPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/FloatPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\IntegerPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/IntegerPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\NullablePropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/NullablePropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\PropertyDescriberInterface\\:\\:describe\\(\\) invoked with 5 parameters, 2\\-3 required\\.$#" + count: 1 + path: src/PropertyDescriber/NullablePropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\ObjectPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/ObjectPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\PropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/PropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\PropertyDescriberInterface\\:\\:describe\\(\\) invoked with 5 parameters, 2\\-3 required\\.$#" + count: 1 + path: src/PropertyDescriber/PropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\PropertyDescriberInterface\\:\\:supports\\(\\) invoked with 2 parameters, 1 required\\.$#" + count: 1 + path: src/PropertyDescriber/PropertyDescriber.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$context$#" + count: 2 + path: src/PropertyDescriber/PropertyDescriberInterface.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$schema$#" + count: 1 + path: src/PropertyDescriber/PropertyDescriberInterface.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\PropertyDescriberInterface\\:\\:describe\\(\\) invoked with 5 parameters, 2\\-3 required\\.$#" + count: 1 + path: src/PropertyDescriber/RequiredPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\RequiredPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/RequiredPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\StringPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/StringPropertyDescriber.php + + - + message: "#^Method Nelmio\\\\ApiDocBundle\\\\PropertyDescriber\\\\UuidPropertyDescriber\\:\\:supports\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#" + count: 1 + path: src/PropertyDescriber/UuidPropertyDescriber.php + + - + message: "#^Call to method render\\(\\) on an unknown class Twig_Environment\\.$#" + count: 3 + path: src/Render/Html/HtmlOpenApiRenderer.php + + - + message: "#^Class Twig_Environment not found\\.$#" + count: 1 + path: src/Render/Html/HtmlOpenApiRenderer.php + + - + message: "#^Parameter \\$twig of method Nelmio\\\\ApiDocBundle\\\\Render\\\\Html\\\\HtmlOpenApiRenderer\\:\\:__construct\\(\\) has invalid type Twig_Environment\\.$#" + count: 1 + path: src/Render/Html/HtmlOpenApiRenderer.php + + - + message: "#^Property Nelmio\\\\ApiDocBundle\\\\Render\\\\Html\\\\HtmlOpenApiRenderer\\:\\:\\$twig has unknown class Twig_Environment as its type\\.$#" + count: 1 + path: src/Render/Html/HtmlOpenApiRenderer.php + + - + message: "#^Call to function method_exists\\(\\) with 'Hateoas\\\\\\\\Configuration\\\\\\\\Embedded' and 'getType' will always evaluate to true\\.$#" + count: 1 + path: tests/Functional/BazingaFunctionalTest.php diff --git a/phpstan.dist.neon b/phpstan.dist.neon new file mode 100644 index 000000000..7025c70a4 --- /dev/null +++ b/phpstan.dist.neon @@ -0,0 +1,34 @@ +includes: + - phpstan-baseline.neon + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-phpunit/rules.neon + - vendor/phpstan/phpstan-symfony/extension.neon + - vendor/phpstan/phpstan-symfony/rules.neon + - vendor/phpstan/phpstan-strict-rules/rules.neon + +parameters: + level: 6 + paths: + - src + - tests + excludePaths: + - tests/Functional/Entity/* + - tests/Functional/EntityExcluded/* + - tests/Functional/Controller/* + - tests/ModelDescriber/Annotations/Fixture/* + dynamicConstantNames: + - Symfony\Component\HttpKernel\Kernel::VERSION + - Symfony\Component\HttpKernel\Kernel::VERSION_ID + - Symfony\Component\HttpKernel\Kernel::MAJOR_VERSION + - Symfony\Component\HttpKernel\Kernel::MINOR_VERSION + - Symfony\Component\HttpKernel\Kernel::RELEASE_VERSION + symfony: + consoleApplicationLoader: tests/console-application.php + strictRules: + noVariableVariables: false # Neccessary for swagger-php integration + universalObjectCratesClasses: + - OpenApi\Context + treatPhpDocTypesAsCertain: false + ignoreErrors: + - identifier: missingType.generics + - '#^Property class@anonymous/tests/.* has no type specified.$#' diff --git a/phpunit b/phpunit deleted file mode 100755 index 2934e5b91..000000000 --- a/phpunit +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env php - - + + + + - Tests + tests - - - . - - Tests - vendor - - - + + + src + + diff --git a/public/init-redocly-ui.js b/public/init-redocly-ui.js new file mode 100644 index 000000000..39dcada2b --- /dev/null +++ b/public/init-redocly-ui.js @@ -0,0 +1,7 @@ +'use strict'; + +function loadRedocly(userOptions = {}) { + const data = JSON.parse(document.getElementById('swagger-data').innerText); + + Redoc.init(data.spec, userOptions, document.getElementById('swagger-ui')); +} diff --git a/public/init-swagger-ui.js b/public/init-swagger-ui.js new file mode 100644 index 000000000..8f4ee3c8a --- /dev/null +++ b/public/init-swagger-ui.js @@ -0,0 +1,78 @@ +// This file is part of the API Platform project. +// +// (c) Kévin Dunglas +// +// For the full copyright and license information, please view the LICENSE +// file that was distributed with this source code. + +function loadSwaggerUI(userOptions = {}) { + const data = JSON.parse(document.getElementById('swagger-data').innerText); + const defaultOptions = { + spec: data.spec, + dom_id: '#swagger-ui', + validatorUrl: null, + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl + ], + layout: 'StandaloneLayout' + }; + const options = Object.assign({}, defaultOptions, userOptions); + const ui = SwaggerUIBundle(options); + + const storageKey = 'nelmio_api_auth'; + + function getAuthorizationsFromStorage() { + if (sessionStorage.getItem(storageKey)) { + try { + return JSON.parse(sessionStorage.getItem(storageKey)); + } catch (ignored) { + // catch any errors here so it does not stop script execution + } + } + + return {}; + } + + // if we have auth in storage use it + try { + const currentAuthorizations = getAuthorizationsFromStorage(); + Object.keys(currentAuthorizations).forEach(k => ui.authActions.authorize({[k]: currentAuthorizations[k]})); + } catch (ignored) { + // catch any errors here so it does not stop script execution + } + + // hook into authorize to store the auth in local storage when user performs authorization + const currentAuthorize = ui.authActions.authorize; + ui.authActions.authorize = function (payload) { + try { + sessionStorage.setItem(storageKey, JSON.stringify(Object.assign( + getAuthorizationsFromStorage(), + payload + ))); + } catch (ignored) { + // catch any errors here so it does not stop script execution + } + + return currentAuthorize(payload); + }; + + // hook into logout to clear auth from storage if user logs out + const currentLogout = ui.authActions.logout; + ui.authActions.logout = function (payload) { + try { + let currentAuth = getAuthorizationsFromStorage(); + payload.forEach(k => delete currentAuth[k]); + sessionStorage.setItem(storageKey, JSON.stringify(currentAuth)); + } catch (ignored) { + // catch any errors here so it does not stop script execution + } + + return currentLogout(payload); + }; + + window.ui = ui; +} diff --git a/Resources/public/logo.png b/public/logo.png similarity index 100% rename from Resources/public/logo.png rename to public/logo.png diff --git a/public/redocly/redoc.standalone.js b/public/redocly/redoc.standalone.js new file mode 100644 index 000000000..a3e20268a --- /dev/null +++ b/public/redocly/redoc.standalone.js @@ -0,0 +1,1832 @@ +/*! For license information please see redoc.standalone.js.LICENSE.txt */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null")):"function"==typeof define&&define.amd?define(["null"],t):"object"==typeof exports?exports.Redoc=t(require("null")):e.Redoc=t(e.null)}(this,(function(e){return function(){var t={854:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.mapTypeToComponent=t.bundleDocument=t.bundleFromString=t.bundle=t.OasVersion=void 0;const i=n(8142),o=n(2928),a=n(2161),s=n(1990),l=n(5735),c=n(3101),u=n(3873),p=n(2900),d=n(3416),f=n(8209),h=n(4125),m=n(474),g=n(4335);var y;function b(e){return r(this,void 0,void 0,(function*(){const{document:t,config:n,customTypes:r,externalRefResolver:i,dereference:u=!1,skipRedoclyRegistryRefs:d=!1,removeUnusedComponents:f=!1,keepUrlRefs:h=!1}=e,y=(0,c.detectSpec)(t.parsed),b=(0,c.getMajorSpecVersion)(y),v=n.getRulesForOasVersion(b),w=(0,s.normalizeTypes)(n.extendTypes(null!=r?r:(0,c.getTypes)(y),y),n),k=(0,p.initRules)(v,n,"preprocessors",y),S=(0,p.initRules)(v,n,"decorators",y),O={problems:[],oasVersion:y,refTypes:new Map,visitorsData:{}};f&&S.push({severity:"error",ruleId:"remove-unused-components",visitor:b===c.SpecMajorVersion.OAS2?(0,m.RemoveUnusedComponents)({}):(0,g.RemoveUnusedComponents)({})});let E=yield(0,o.resolveDocument)({rootDocument:t,rootType:w.Root,externalRefResolver:i});k.length>0&&((0,l.walkDocument)({document:t,rootType:w.Root,normalizedVisitors:(0,a.normalizeVisitors)(k,w),resolvedRefMap:E,ctx:O}),E=yield(0,o.resolveDocument)({rootDocument:t,rootType:w.Root,externalRefResolver:i}));const _=(0,a.normalizeVisitors)([{severity:"error",ruleId:"bundler",visitor:x(b,u,d,t,E,h)},...S],w);return(0,l.walkDocument)({document:t,rootType:w.Root,normalizedVisitors:_,resolvedRefMap:E,ctx:O}),{bundle:t,problems:O.problems.map((e=>n.addProblemToIgnore(e))),fileDependencies:i.getFiles(),rootType:w.Root,refTypes:O.refTypes,visitorsData:O.visitorsData}}))}function v(e,t){switch(t){case c.SpecMajorVersion.OAS3:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";case"Response":return"responses";case"Example":return"examples";case"RequestBody":return"requestBodies";case"Header":return"headers";case"SecuritySchema":return"securitySchemes";case"Link":return"links";case"Callback":return"callbacks";default:return null}case c.SpecMajorVersion.OAS2:switch(e){case"Schema":return"definitions";case"Parameter":return"parameters";case"Response":return"responses";default:return null}case c.SpecMajorVersion.Async2:switch(e){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}}}function x(e,t,n,r,a,s){let l,p;const m={ref:{leave(i,l,c){if(!c.location||void 0===c.node)return void(0,d.reportUnresolvedRef)(c,l.report,l.location);if(c.location.source===r.source&&c.location.source===l.location.source&&"scalar"!==l.type.name&&!t)return;if(n&&(0,h.isRedoclyRegistryURL)(i.$ref))return;if(s&&(0,u.isAbsoluteUrl)(i.$ref))return;const p=v(l.type.name,e);p?t?(y(p,c,l),g(i,c,l)):(i.$ref=y(p,c,l),function(e,t,n){const i=(0,o.makeRefId)(n.location.source.absoluteRef,e.$ref);a.set(i,{document:r,isRemote:!1,node:t.node,nodePointer:e.$ref,resolved:!0})}(i,c,l)):g(i,c,l)}},Root:{enter(t,n){p=n.location,e===c.SpecMajorVersion.OAS3?l=t.components=t.components||{}:e===c.SpecMajorVersion.OAS2&&(l=t)}}};function g(e,t,n){if((0,f.isPlainObject)(t.node)){delete e.$ref;const n=Object.assign({},t.node,e);Object.assign(e,n)}else n.parent[n.key]=t.node}function y(t,n,r){l[t]=l[t]||{};const i=function(e,t,n){const[r,i]=[e.location.source.absoluteRef,e.location.pointer],o=l[t];let a="";const s=i.slice(2).split("/").filter(f.isTruthy);for(;s.length>0;)if(a=s.pop()+(a?`-${a}`:""),!o||!o[a]||b(o[a],e,n))return a;if(a=(0,u.refBaseName)(r)+(a?`_${a}`:""),!o[a]||b(o[a],e,n))return a;const c=a;let p=2;for(;o[a]&&!b(o[a],e,n);)a=`${c}-${p}`,p++;return o[a]||n.report({message:`Two schemas are referenced with the same name but different content. Renamed ${c} to ${a}.`,location:n.location,forceSeverity:"warn"}),a}(n,t,r);return l[t][i]=n.node,e===c.SpecMajorVersion.OAS3?`#/components/${t}/${i}`:`#/${t}/${i}`}function b(e,t,n){var r;return!(!(0,u.isRef)(e)||(null===(r=n.resolve(e,p.absolutePointer).location)||void 0===r?void 0:r.absolutePointer)!==t.location.absolutePointer)||i(e,t.node)}return e===c.SpecMajorVersion.OAS3&&(m.DiscriminatorMapping={leave(n,r){for(const i of Object.keys(n)){const o=n[i],a=r.resolve({$ref:o});if(!a.location||void 0===a.node)return void(0,d.reportUnresolvedRef)(a,r.report,r.location.child(i));const s=v("Schema",e);t?y(s,a,r):n[i]=y(s,a,r)}}}),m}!function(e){e.Version2="oas2",e.Version3_0="oas3_0",e.Version3_1="oas3_1"}(y||(t.OasVersion=y={})),t.bundle=function(e){return r(this,void 0,void 0,(function*(){const{ref:t,doc:n,externalRefResolver:r=new o.BaseResolver(e.config.resolve),base:i=null}=e;if(!t&&!n)throw new Error("Document or reference is required.\n");const a=void 0===n?yield r.resolveDocument(i,t,!0):n;if(a instanceof Error)throw a;return b(Object.assign(Object.assign({document:a},e),{config:e.config.styleguide,externalRefResolver:r}))}))},t.bundleFromString=function(e){return r(this,void 0,void 0,(function*(){const{source:t,absoluteRef:n,externalRefResolver:r=new o.BaseResolver(e.config.resolve)}=e,i=(0,o.makeDocumentFromString)(t,n||"/");return b(Object.assign(Object.assign({document:i},e),{externalRefResolver:r,config:e.config.styleguide}))}))},t.bundleDocument=b,t.mapTypeToComponent=v},8921:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Config=t.StyleguideConfig=t.AVAILABLE_REGIONS=t.DOMAINS=t.DEFAULT_REGION=t.IGNORE_FILE=void 0;const r=n(7992),i=n(7975),o=n(970),a=n(8209),s=n(3101),l=n(1827),c=n(462),u=n(3873);t.IGNORE_FILE=".redocly.lint-ignore.yaml",t.DEFAULT_REGION="us",t.DOMAINS=function(){const e={us:"redocly.com",eu:"eu.redocly.com"},t=l.env.REDOCLY_DOMAIN;return(null==t?void 0:t.endsWith(".redocly.host"))&&(e[t.split(".")[0]]=t),"redoc.online"===t&&(e[t]=t),e}(),t.AVAILABLE_REGIONS=Object.keys(t.DOMAINS);class p{constructor(e,n){this.rawConfig=e,this.configFile=n,this.ignore={},this._usedRules=new Set,this._usedVersions=new Set,this.plugins=e.plugins||[],this.doNotResolveExamples=!!e.doNotResolveExamples,this.recommendedFallback=e.recommendedFallback||!1,this.rules={[s.SpecVersion.OAS2]:Object.assign(Object.assign({},e.rules),e.oas2Rules),[s.SpecVersion.OAS3_0]:Object.assign(Object.assign({},e.rules),e.oas3_0Rules),[s.SpecVersion.OAS3_1]:Object.assign(Object.assign({},e.rules),e.oas3_1Rules),[s.SpecVersion.Async2]:Object.assign(Object.assign({},e.rules),e.async2Rules)},this.preprocessors={[s.SpecVersion.OAS2]:Object.assign(Object.assign({},e.preprocessors),e.oas2Preprocessors),[s.SpecVersion.OAS3_0]:Object.assign(Object.assign({},e.preprocessors),e.oas3_0Preprocessors),[s.SpecVersion.OAS3_1]:Object.assign(Object.assign({},e.preprocessors),e.oas3_1Preprocessors),[s.SpecVersion.Async2]:Object.assign(Object.assign({},e.preprocessors),e.async2Preprocessors)},this.decorators={[s.SpecVersion.OAS2]:Object.assign(Object.assign({},e.decorators),e.oas2Decorators),[s.SpecVersion.OAS3_0]:Object.assign(Object.assign({},e.decorators),e.oas3_0Decorators),[s.SpecVersion.OAS3_1]:Object.assign(Object.assign({},e.decorators),e.oas3_1Decorators),[s.SpecVersion.Async2]:Object.assign(Object.assign({},e.decorators),e.async2Decorators)},this.extendPaths=e.extendPaths||[],this.pluginPaths=e.pluginPaths||[],this.resolveIgnore(function(e){return e?(0,a.doesYamlFileExist)(e)?i.join(i.dirname(e),t.IGNORE_FILE):i.join(e,t.IGNORE_FILE):l.isBrowser?void 0:i.join(process.cwd(),t.IGNORE_FILE)}(n))}resolveIgnore(e){if(e&&(0,a.doesYamlFileExist)(e)){this.ignore=(0,o.parseYaml)(r.readFileSync(e,"utf-8"))||{};for(const t of Object.keys(this.ignore)){this.ignore[(0,u.isAbsoluteUrl)(t)?t:i.resolve(i.dirname(e),t)]=this.ignore[t];for(const e of Object.keys(this.ignore[t]))this.ignore[t][e]=new Set(this.ignore[t][e]);(0,u.isAbsoluteUrl)(t)||delete this.ignore[t]}}}saveIgnore(){const e=this.configFile?i.dirname(this.configFile):process.cwd(),n=i.join(e,t.IGNORE_FILE),s={};for(const t of Object.keys(this.ignore)){const n=s[(0,u.isAbsoluteUrl)(t)?t:(0,a.slash)(i.relative(e,t))]=this.ignore[t];for(const e of Object.keys(n))n[e]=Array.from(n[e])}r.writeFileSync(n,"# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API.\n# See https://redoc.ly/docs/cli/ for more information.\n"+(0,o.stringifyYaml)(s))}addIgnore(e){const t=this.ignore,n=e.location[0];if(void 0===n.pointer)return;const r=t[n.source.absoluteRef]=t[n.source.absoluteRef]||{};(r[e.ruleId]=r[e.ruleId]||new Set).add(n.pointer)}addProblemToIgnore(e){const t=e.location[0];if(void 0===t.pointer)return e;const n=(this.ignore[t.source.absoluteRef]||{})[e.ruleId],r=n&&n.has(t.pointer);return r?Object.assign(Object.assign({},e),{ignored:r}):e}extendTypes(e,t){let n=e;for(const e of this.plugins)if(void 0!==e.typeExtension)switch(t){case s.SpecVersion.OAS3_0:case s.SpecVersion.OAS3_1:if(!e.typeExtension.oas3)continue;n=e.typeExtension.oas3(n,t);break;case s.SpecVersion.OAS2:if(!e.typeExtension.oas2)continue;n=e.typeExtension.oas2(n,t);break;case s.SpecVersion.Async2:if(!e.typeExtension.async2)continue;n=e.typeExtension.async2(n,t);break;default:throw new Error("Not implemented")}return n}getRuleSettings(e,t){this._usedRules.add(e),this._usedVersions.add(t);const n=this.rules[t][e]||"off";return"string"==typeof n?{severity:n}:Object.assign({severity:"error"},n)}getPreprocessorSettings(e,t){this._usedRules.add(e),this._usedVersions.add(t);const n=this.preprocessors[t][e]||"off";return"string"==typeof n?{severity:"on"===n?"error":n}:Object.assign({severity:"error"},n)}getDecoratorSettings(e,t){this._usedRules.add(e),this._usedVersions.add(t);const n=this.decorators[t][e]||"off";return"string"==typeof n?{severity:"on"===n?"error":n}:Object.assign({severity:"error"},n)}getUnusedRules(){const e=[],t=[],n=[];for(const r of Array.from(this._usedVersions))e.push(...Object.keys(this.rules[r]).filter((e=>!this._usedRules.has(e)))),t.push(...Object.keys(this.decorators[r]).filter((e=>!this._usedRules.has(e)))),n.push(...Object.keys(this.preprocessors[r]).filter((e=>!this._usedRules.has(e))));return{rules:e,preprocessors:n,decorators:t}}getRulesForOasVersion(e){switch(e){case s.SpecMajorVersion.OAS3:const e=[];return this.plugins.forEach((t=>{var n;return(null===(n=t.preprocessors)||void 0===n?void 0:n.oas3)&&e.push(t.preprocessors.oas3)})),this.plugins.forEach((t=>{var n;return(null===(n=t.rules)||void 0===n?void 0:n.oas3)&&e.push(t.rules.oas3)})),this.plugins.forEach((t=>{var n;return(null===(n=t.decorators)||void 0===n?void 0:n.oas3)&&e.push(t.decorators.oas3)})),e;case s.SpecMajorVersion.OAS2:const t=[];return this.plugins.forEach((e=>{var n;return(null===(n=e.preprocessors)||void 0===n?void 0:n.oas2)&&t.push(e.preprocessors.oas2)})),this.plugins.forEach((e=>{var n;return(null===(n=e.rules)||void 0===n?void 0:n.oas2)&&t.push(e.rules.oas2)})),this.plugins.forEach((e=>{var n;return(null===(n=e.decorators)||void 0===n?void 0:n.oas2)&&t.push(e.decorators.oas2)})),t;case s.SpecMajorVersion.Async2:const n=[];return this.plugins.forEach((e=>{var t;return(null===(t=e.preprocessors)||void 0===t?void 0:t.async2)&&n.push(e.preprocessors.async2)})),this.plugins.forEach((e=>{var t;return(null===(t=e.rules)||void 0===t?void 0:t.async2)&&n.push(e.rules.async2)})),this.plugins.forEach((e=>{var t;return(null===(t=e.decorators)||void 0===t?void 0:t.async2)&&n.push(e.decorators.async2)})),n}}skipRules(e){for(const t of e||[])for(const e of Object.values(s.SpecVersion))this.rules[e][t]&&(this.rules[e][t]="off")}skipPreprocessors(e){for(const t of e||[])for(const e of Object.values(s.SpecVersion))this.preprocessors[e][t]&&(this.preprocessors[e][t]="off")}skipDecorators(e){for(const t of e||[])for(const e of Object.values(s.SpecVersion))this.decorators[e][t]&&(this.decorators[e][t]="off")}}t.StyleguideConfig=p,t.Config=class{constructor(e,t){this.rawConfig=e,this.configFile=t,this.apis=e.apis||{},this.styleguide=new p(e.styleguide||{},t),this.theme=e.theme||{},this.resolve=(0,c.getResolveConfig)(null==e?void 0:e.resolve),this.region=e.region,this.organization=e.organization,this.files=e.files||[],this.telemetry=e.telemetry}}},2900:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initRules=void 0;const r=n(8209);t.initRules=function(e,t,n,i){return e.flatMap((e=>Object.keys(e).map((r=>{const o=e[r],a="rules"===n?t.getRuleSettings(r,i):"preprocessors"===n?t.getPreprocessorSettings(r,i):t.getDecoratorSettings(r,i);if("off"===a.severity)return;const s=a.severity,l=o(a);return Array.isArray(l)?l.map((e=>({severity:s,ruleId:r,visitor:e}))):{severity:s,ruleId:r,visitor:l}})))).flatMap((e=>e)).filter(r.isDefined)}},462:function(e,t,n){"use strict";var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);it[e]));n[e]&&null===t&&(0,i.showWarningForDeprecatedField)(e),n[e]&&t&&n[t]&&(0,i.showErrorForDeprecatedField)(e,t),n[e]&&r&&n[r]&&(0,i.showErrorForDeprecatedField)(e,t,r),(n[e]||o)&&(0,i.showWarningForDeprecatedField)(e,t,r)}t.parsePresetName=function(e){if(e.indexOf("/")>-1){const[t,n]=e.split("/");return{pluginId:t,configName:n}}return{pluginId:"",configName:e}},t.transformApiDefinitionsToApis=s,t.prefixRules=function(e,t){if(!t)return e;const n={};for(const r of Object.keys(e))n[`${t}/${r}`]=e[r];return n},t.mergeExtends=function(e){const t={rules:{},oas2Rules:{},oas3_0Rules:{},oas3_1Rules:{},async2Rules:{},preprocessors:{},oas2Preprocessors:{},oas3_0Preprocessors:{},oas3_1Preprocessors:{},async2Preprocessors:{},decorators:{},oas2Decorators:{},oas3_0Decorators:{},oas3_1Decorators:{},async2Decorators:{},plugins:[],pluginPaths:[],extendPaths:[]};for(const n of e){if(n.extends)throw new Error(`'extends' is not supported in shared configs yet: ${JSON.stringify(n,null,2)}.`);Object.assign(t.rules,n.rules),Object.assign(t.oas2Rules,n.oas2Rules),(0,i.assignExisting)(t.oas2Rules,n.rules||{}),Object.assign(t.oas3_0Rules,n.oas3_0Rules),(0,i.assignExisting)(t.oas3_0Rules,n.rules||{}),Object.assign(t.oas3_1Rules,n.oas3_1Rules),(0,i.assignExisting)(t.oas3_1Rules,n.rules||{}),Object.assign(t.async2Rules,n.async2Rules),(0,i.assignExisting)(t.async2Rules,n.rules||{}),Object.assign(t.preprocessors,n.preprocessors),Object.assign(t.oas2Preprocessors,n.oas2Preprocessors),(0,i.assignExisting)(t.oas2Preprocessors,n.preprocessors||{}),Object.assign(t.oas3_0Preprocessors,n.oas3_0Preprocessors),(0,i.assignExisting)(t.oas3_0Preprocessors,n.preprocessors||{}),Object.assign(t.oas3_1Preprocessors,n.oas3_1Preprocessors),(0,i.assignExisting)(t.oas3_1Preprocessors,n.preprocessors||{}),Object.assign(t.async2Preprocessors,n.async2Preprocessors),(0,i.assignExisting)(t.async2Preprocessors,n.preprocessors||{}),Object.assign(t.decorators,n.decorators),Object.assign(t.oas2Decorators,n.oas2Decorators),(0,i.assignExisting)(t.oas2Decorators,n.decorators||{}),Object.assign(t.oas3_0Decorators,n.oas3_0Decorators),(0,i.assignExisting)(t.oas3_0Decorators,n.decorators||{}),Object.assign(t.oas3_1Decorators,n.oas3_1Decorators),(0,i.assignExisting)(t.oas3_1Decorators,n.decorators||{}),Object.assign(t.async2Decorators,n.async2Decorators),(0,i.assignExisting)(t.async2Decorators,n.decorators||{}),t.plugins.push(...n.plugins||[]),t.pluginPaths.push(...n.pluginPaths||[]),t.extendPaths.push(...new Set(n.extendPaths))}return t},t.getMergedConfig=function(e,t){var n,r,a,s,l,c,u,p;const d=[...Object.values(e.apis).map((e=>{var t;return null===(t=null==e?void 0:e.styleguide)||void 0===t?void 0:t.extendPaths})),null===(r=null===(n=e.rawConfig)||void 0===n?void 0:n.styleguide)||void 0===r?void 0:r.extendPaths].flat().filter(i.isTruthy),f=[...Object.values(e.apis).map((e=>{var t;return null===(t=null==e?void 0:e.styleguide)||void 0===t?void 0:t.pluginPaths})),null===(s=null===(a=e.rawConfig)||void 0===a?void 0:a.styleguide)||void 0===s?void 0:s.pluginPaths].flat().filter(i.isTruthy);return t?new o.Config(Object.assign(Object.assign({},e.rawConfig),{styleguide:Object.assign(Object.assign({},e.apis[t]?e.apis[t].styleguide:e.rawConfig.styleguide),{extendPaths:d,pluginPaths:f}),theme:Object.assign(Object.assign({},e.rawConfig.theme),null===(l=e.apis[t])||void 0===l?void 0:l.theme),files:[...e.files,...null!==(p=null===(u=null===(c=e.apis)||void 0===c?void 0:c[t])||void 0===u?void 0:u.files)&&void 0!==p?p:[]]}),e.configFile):e},t.checkForDeprecatedFields=u,t.transformConfig=function(e){var t,n;const i=[["apiDefinitions","apis",void 0],["referenceDocs","openapi","theme"],["lint",void 0,void 0],["styleguide",void 0,void 0],["features.openapi","openapi","theme"]];for(const[t,n,r]of i)u(t,n,e,r);const{apis:o,apiDefinitions:p,referenceDocs:d,lint:f}=e,h=r(e,["apis","apiDefinitions","referenceDocs","lint"]),{styleguideConfig:m,rawConfigRest:g}=l(h),y=Object.assign({theme:{openapi:Object.assign(Object.assign(Object.assign({},d),e["features.openapi"]),null===(t=e.theme)||void 0===t?void 0:t.openapi),mockServer:Object.assign(Object.assign({},e["features.mockServer"]),null===(n=e.theme)||void 0===n?void 0:n.mockServer)},apis:c(o)||s(p),styleguide:m||f},g);return function(e){var t,n;let r=Object.assign({},null===(t=e.styleguide)||void 0===t?void 0:t.rules);for(const t of Object.values(e.apis||{}))r=Object.assign(Object.assign({},r),null===(n=null==t?void 0:t.styleguide)||void 0===n?void 0:n.rules);for(const e of Object.keys(r))e.startsWith("assert/")&&a.logger.warn(`\nThe 'assert/' syntax in ${e} is deprecated. Update your configuration to use 'rule/' instead. Examples and more information: https://redocly.com/docs/cli/rules/configurable-rules/\n`)}(y),y},t.getResolveConfig=function(e){var t,n;return{http:{headers:null!==(n=null===(t=null==e?void 0:e.http)||void 0===t?void 0:t.headers)&&void 0!==n?n:[],customFetch:void 0}}},t.getUniquePlugins=function(e){const t=new Set,n=[];for(const r of e)t.has(r.id)?r.id&&a.logger.warn(`Duplicate plugin id "${a.colorize.red(r.id)}".\n`):(n.push(r),t.add(r.id));return n};class p extends Error{}t.ConfigValidationError=p},1827:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.env=t.isBrowser=void 0,t.isBrowser="undefined"!=typeof window||"undefined"!=typeof self||"undefined"==typeof process,t.env=t.isBrowser?{}:{}||{}},970:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringifyYaml=t.parseYaml=void 0;const r=n(7210),i=r.JSON_SCHEMA.extend({implicit:[r.types.merge],explicit:[r.types.binary,r.types.omap,r.types.pairs,r.types.set]});t.parseYaml=(e,t)=>(0,r.load)(e,Object.assign({schema:i},t)),t.stringifyYaml=(e,t)=>(0,r.dump)(e,t)},2678:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.colorize=t.colorOptions=void 0;const r=n(8825);var i=n(8825);Object.defineProperty(t,"colorOptions",{enumerable:!0,get:function(){return i.options}});const o=n(1827),a=n(8209);t.colorize=new Proxy(r,{get(e,t){return o.isBrowser?a.identity:e[t]}}),t.logger=new class{stderr(e){return process.stderr.write(e)}info(e){return o.isBrowser?console.log(e):this.stderr(e)}warn(e){return o.isBrowser?console.warn(e):this.stderr(t.colorize.yellow(e))}error(e){return o.isBrowser?console.error(e):this.stderr(t.colorize.red(e))}}},3101:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTypes=t.getMajorSpecVersion=t.detectSpec=t.SpecMajorVersion=t.SpecVersion=void 0;const r=n(4409),i=n(4154),o=n(2082),a=n(264);var s,l;!function(e){e.OAS2="oas2",e.OAS3_0="oas3_0",e.OAS3_1="oas3_1",e.Async2="async2"}(s||(t.SpecVersion=s={})),function(e){e.OAS2="oas2",e.OAS3="oas3",e.Async2="async2"}(l||(t.SpecMajorVersion=l={}));const c={[s.OAS2]:r.Oas2Types,[s.OAS3_0]:i.Oas3Types,[s.OAS3_1]:o.Oas3_1Types,[s.Async2]:a.AsyncApi2Types};t.detectSpec=function(e){if("object"!=typeof e)throw new Error("Document must be JSON object, got "+typeof e);if(e.openapi&&"string"!=typeof e.openapi)throw new Error(`Invalid OpenAPI version: should be a string but got "${typeof e.openapi}"`);if(e.openapi&&e.openapi.startsWith("3.0"))return s.OAS3_0;if(e.openapi&&e.openapi.startsWith("3.1"))return s.OAS3_1;if(e.swagger&&"2.0"===e.swagger)return s.OAS2;if(e.openapi||e.swagger)throw new Error(`Unsupported OpenAPI version: ${e.openapi||e.swagger}`);if(e.asyncapi&&e.asyncapi.startsWith("2."))return s.Async2;if(e.asyncapi)throw new Error(`Unsupported AsyncAPI version: ${e.asyncapi}`);throw new Error("Unsupported specification")},t.getMajorSpecVersion=function(e){return e===s.OAS2?l.OAS2:e===s.Async2?l.Async2:l.OAS3},t.getTypes=function(e){return c[e]}},4125:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.isRedoclyRegistryURL=t.RedoclyClient=void 0;const i=n(3986),o=n(7975),a=n(2941),s=n(919),l=n(8921),c=n(1827),u=n(8209),p=n(2678),d=".redocly-config.json";t.RedoclyClient=class{constructor(e){this.accessTokens={},this.region=this.loadRegion(e),this.loadTokens(),this.domain=e?l.DOMAINS[e]:c.env.REDOCLY_DOMAIN||l.DOMAINS[l.DEFAULT_REGION],c.env.REDOCLY_DOMAIN=this.domain,this.registryApi=new s.RegistryApi(this.accessTokens,this.region)}loadRegion(e){if(e&&!l.DOMAINS[e])throw new Error(`Invalid argument: region in config file.\nGiven: ${p.colorize.green(e)}, choices: "us", "eu".`);return c.env.REDOCLY_DOMAIN?l.AVAILABLE_REGIONS.find((e=>l.DOMAINS[e]===c.env.REDOCLY_DOMAIN))||l.DEFAULT_REGION:e||l.DEFAULT_REGION}getRegion(){return this.region}hasTokens(){return(0,u.isNotEmptyObject)(this.accessTokens)}hasToken(){return!!this.accessTokens[this.region]}getAuthorizationHeader(){return r(this,void 0,void 0,(function*(){return this.accessTokens[this.region]}))}setAccessTokens(e){this.accessTokens=e}loadTokens(){const e=(0,o.resolve)((0,a.homedir)(),d),t=this.readCredentialsFile(e);(0,u.isNotEmptyObject)(t)&&this.setAccessTokens(Object.assign(Object.assign({},t),t.token&&!t[this.region]&&{[this.region]:t.token})),c.env.REDOCLY_AUTHORIZATION&&this.setAccessTokens(Object.assign(Object.assign({},this.accessTokens),{[this.region]:c.env.REDOCLY_AUTHORIZATION}))}getAllTokens(){return Object.entries(this.accessTokens).filter((([e])=>l.AVAILABLE_REGIONS.includes(e))).map((([e,t])=>({region:e,token:t})))}getValidTokens(){return r(this,void 0,void 0,(function*(){const e=this.getAllTokens(),t=yield Promise.allSettled(e.map((({token:e,region:t})=>this.verifyToken(e,t))));return e.filter(((e,n)=>"fulfilled"===t[n].status)).map((({token:e,region:t})=>({token:e,region:t,valid:!0})))}))}getTokens(){return r(this,void 0,void 0,(function*(){return this.hasTokens()?yield this.getValidTokens():[]}))}isAuthorizedWithRedoclyByRegion(){return r(this,void 0,void 0,(function*(){if(!this.hasTokens())return!1;const e=this.accessTokens[this.region];if(!e)return!1;try{return yield this.verifyToken(e,this.region),!0}catch(e){return!1}}))}isAuthorizedWithRedocly(){return r(this,void 0,void 0,(function*(){return this.hasTokens()&&(0,u.isNotEmptyObject)(yield this.getValidTokens())}))}readCredentialsFile(e){return(0,i.existsSync)(e)?JSON.parse((0,i.readFileSync)(e,"utf-8")):{}}verifyToken(e,t,n=!1){return r(this,void 0,void 0,(function*(){return this.registryApi.authStatus(e,t,n)}))}login(e,t=!1){return r(this,void 0,void 0,(function*(){const n=(0,o.resolve)((0,a.homedir)(),d);try{yield this.verifyToken(e,this.region,t)}catch(e){throw new Error("Authorization failed. Please check if you entered a valid API key.")}const r=Object.assign(Object.assign({},this.readCredentialsFile(n)),{[this.region]:e,token:e});this.accessTokens=r,this.registryApi.setAccessTokens(r),(0,i.writeFileSync)(n,JSON.stringify(r,null,2))}))}logout(){const e=(0,o.resolve)((0,a.homedir)(),d);(0,i.existsSync)(e)&&(0,i.unlinkSync)(e)}},t.isRedoclyRegistryURL=function(e){const t=c.env.REDOCLY_DOMAIN||l.DOMAINS[l.DEFAULT_REGION],n="redocly.com"===t?"redoc.ly":t;return!(!e.startsWith(`https://api.${t}/registry/`)&&!e.startsWith(`https://api.${n}/registry/`))}},919:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.RegistryApi=void 0;const i=n(8381),o=n(8921),a=n(8209),s=n(2079).rE;t.RegistryApi=class{constructor(e,t){this.accessTokens=e,this.region=t}get accessToken(){return(0,a.isNotEmptyObject)(this.accessTokens)&&this.accessTokens[this.region]}getBaseUrl(e=o.DEFAULT_REGION){return`https://api.${o.DOMAINS[e]}/registry`}setAccessTokens(e){return this.accessTokens=e,this}request(e="",t={},n){var o,a;return r(this,void 0,void 0,(function*(){const r="undefined"!=typeof process&&(null===(o={})||void 0===o?void 0:o.REDOCLY_CLI_COMMAND)||"",l="undefined"!=typeof process&&(null===(a={})||void 0===a?void 0:a.REDOCLY_ENVIRONMENT)||"",c=Object.assign({},t.headers||{},{"x-redocly-cli-version":s,"user-agent":`redocly-cli / ${s} ${r} ${l}`});if(!c.hasOwnProperty("authorization"))throw new Error("Unauthorized");const u=yield(0,i.default)(`${this.getBaseUrl(n)}${e}`,Object.assign({},t,{headers:c}));if(401===u.status)throw new Error("Unauthorized");if(404===u.status){const e=yield u.json();throw new Error(e.code)}return u}))}authStatus(e,t,n=!1){return r(this,void 0,void 0,(function*(){try{const n=yield this.request("",{headers:{authorization:e}},t);return yield n.json()}catch(e){throw n&&console.log(e),e}}))}prepareFileUpload({organizationId:e,name:t,version:n,filesHash:i,filename:o,isUpsert:a}){return r(this,void 0,void 0,(function*(){const r=yield this.request(`/${e}/${t}/${n}/prepare-file-upload`,{method:"POST",headers:{"content-type":"application/json",authorization:this.accessToken},body:JSON.stringify({filesHash:i,filename:o,isUpsert:a})},this.region);if(r.ok)return r.json();throw new Error("Could not prepare file upload")}))}pushApi({organizationId:e,name:t,version:n,rootFilePath:i,filePaths:o,branch:a,isUpsert:s,isPublic:l,batchId:c,batchSize:u}){return r(this,void 0,void 0,(function*(){if(!(yield this.request(`/${e}/${t}/${n}`,{method:"PUT",headers:{"content-type":"application/json",authorization:this.accessToken},body:JSON.stringify({rootFilePath:i,filePaths:o,branch:a,isUpsert:s,isPublic:l,batchId:c,batchSize:u})},this.region)).ok)throw new Error("Could not push api")}))}}},3873:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAnchor=t.isMappingRef=t.isAbsoluteUrl=t.refBaseName=t.pointerBaseName=t.parsePointer=t.parseRef=t.escapePointer=t.unescapePointer=t.Location=t.isRef=t.joinPointer=void 0;const r=n(8209);function i(e,t){return""===e&&(e="#/"),"/"===e[e.length-1]?e+t:e+"/"+t}t.joinPointer=i,t.isRef=function(e){return e&&"string"==typeof e.$ref};class o{constructor(e,t){this.source=e,this.pointer=t}child(e){return new o(this.source,i(this.pointer,(Array.isArray(e)?e:[e]).map(s).join("/")))}key(){return Object.assign(Object.assign({},this),{reportOnKey:!0})}get absolutePointer(){return this.source.absoluteRef+("#/"===this.pointer?"":this.pointer)}}function a(e){return decodeURIComponent(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function s(e){return"number"==typeof e?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}t.Location=o,t.unescapePointer=a,t.escapePointer=s,t.parseRef=function(e){const[t,n]=e.split("#/");return{uri:t||null,pointer:n?n.split("/").map(a).filter(r.isTruthy):[]}},t.parsePointer=function(e){return e.substr(2).split("/").map(a)},t.pointerBaseName=function(e){const t=e.split("/");return t[t.length-1]},t.refBaseName=function(e){const t=e.split(/[\/\\]/);return t[t.length-1].replace(/\.[^.]+$/,"")},t.isAbsoluteUrl=function(e){return e.startsWith("http://")||e.startsWith("https://")},t.isMappingRef=function(e){return e.startsWith("#")||e.startsWith("https://")||e.startsWith("http://")||e.startsWith("./")||e.startsWith("../")||e.indexOf("/")>-1},t.isAnchor=function(e){return/^#[A-Za-z][A-Za-z0-9\-_:.]*$/.test(e)}},2928:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.resolveDocument=t.BaseResolver=t.makeDocumentFromString=t.makeRefId=t.YamlParseError=t.ResolveError=t.Source=void 0;const i=n(7411),o=n(7975),a=n(3873),s=n(1990),l=n(8209);class c{constructor(e,t,n){this.absoluteRef=e,this.body=t,this.mimeType=n}getAst(e){var t;return void 0===this._ast&&(this._ast=null!==(t=e(this.body,{filename:this.absoluteRef}))&&void 0!==t?t:void 0,this._ast&&0===this._ast.kind&&""===this._ast.value&&1!==this._ast.startPosition&&(this._ast.startPosition=1,this._ast.endPosition=1)),this._ast}getLines(){return void 0===this._lines&&(this._lines=this.body.split(/\r\n|[\n\r]/g)),this._lines}}t.Source=c;class u extends Error{constructor(e){super(e.message),this.originalError=e,Object.setPrototypeOf(this,u.prototype)}}t.ResolveError=u;const p=/\((\d+):(\d+)\)$/;class d extends Error{constructor(e,t){super(e.message.split("\n")[0]),this.originalError=e,this.source=t,Object.setPrototypeOf(this,d.prototype);const[,n,r]=this.message.match(p)||[];this.line=parseInt(n,10),this.col=parseInt(r,10)}}function f(e,t){return e+"::"+t}function h(e,t){return{prev:e,node:t}}t.YamlParseError=d,t.makeRefId=f,t.makeDocumentFromString=function(e,t){const n=new c(t,e);try{return{source:n,parsed:(0,l.parseYaml)(e,{filename:t})}}catch(e){throw new d(e,n)}},t.BaseResolver=class{constructor(e={http:{headers:[]}}){this.config=e,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(e,t){return(0,a.isAbsoluteUrl)(t)?t:e&&(0,a.isAbsoluteUrl)(e)?new URL(t,e).href:o.resolve(e?o.dirname(e):process.cwd(),t)}loadExternalRef(e){return r(this,void 0,void 0,(function*(){try{if((0,a.isAbsoluteUrl)(e)){const{body:t,mimeType:n}=yield(0,l.readFileFromUrl)(e,this.config.http);return new c(e,t,n)}{if(i.lstatSync(e).isDirectory())throw new Error(`Expected a file but received a folder at ${e}`);const t=yield i.promises.readFile(e,"utf-8");return new c(e,t.replace(/\r\n/g,"\n"))}}catch(e){throw e.message=e.message.replace(", lstat",""),new u(e)}}))}parseDocument(e,t=!1){var n;const r=e.absoluteRef.substr(e.absoluteRef.lastIndexOf("."));if(![".json",".json",".yml",".yaml"].includes(r)&&!(null===(n=e.mimeType)||void 0===n?void 0:n.match(/(json|yaml|openapi)/))&&!t)return{source:e,parsed:e.body};try{return{source:e,parsed:(0,l.parseYaml)(e.body,{filename:e.absoluteRef})}}catch(t){throw new d(t,e)}}resolveDocument(e,t,n=!1){return r(this,void 0,void 0,(function*(){const r=this.resolveExternalRef(e,t),i=this.cache.get(r);if(i)return i;const o=this.loadExternalRef(r).then((e=>this.parseDocument(e,n)));return this.cache.set(r,o),o}))}};const m={name:"unknown",properties:{}},g={name:"scalar",properties:{}};t.resolveDocument=function(e){return r(this,void 0,void 0,(function*(){const{rootDocument:t,externalRefResolver:n,rootType:i}=e,o=new Map,c=new Set,u=[];let p;!function e(t,i,p,d){const y=i.source.absoluteRef,b=new Map;function v(e,t,i){return r(this,void 0,void 0,(function*(){if(function(e,t){for(;e;){if(e.node===t)return!0;e=e.prev}return!1}(i.prev,t))throw new Error("Self-referencing circular pointer");if((0,a.isAnchor)(t.$ref)){yield(0,l.nextTick)();const n={resolved:!0,isRemote:!1,node:b.get(t.$ref),document:e,nodePointer:t.$ref},r=f(e.source.absoluteRef,t.$ref);return o.set(r,n),n}const{uri:r,pointer:s}=(0,a.parseRef)(t.$ref),c=null!==r;let u;try{u=c?yield n.resolveDocument(e.source.absoluteRef,r):e}catch(n){const r={resolved:!1,isRemote:c,document:void 0,error:n},i=f(e.source.absoluteRef,t.$ref);return o.set(i,r),r}let p={resolved:!0,document:u,isRemote:c,node:e.parsed,nodePointer:"#/"},d=u.parsed;const m=s;for(const e of m){if("object"!=typeof d){d=void 0;break}if(void 0!==d[e])d=d[e],p.nodePointer=(0,a.joinPointer)(p.nodePointer,(0,a.escapePointer)(e));else{if(!(0,a.isRef)(d)){d=void 0;break}if(p=yield v(u,d,h(i,d)),u=p.document||u,"object"!=typeof p.node){d=void 0;break}d=p.node[e],p.nodePointer=(0,a.joinPointer)(p.nodePointer,(0,a.escapePointer)(e))}}p.node=d,p.document=u;const g=f(e.source.absoluteRef,t.$ref);return p.document&&(0,a.isRef)(d)&&(p=yield v(p.document,d,h(i,d))),o.set(g,p),Object.assign({},p)}))}!function t(n,r,o){if("object"!=typeof n||null===n)return;const l=`${r.name}::${o}`;if(c.has(l))return;c.add(l);const[p,d]=Object.entries(n).find((([e])=>"$anchor"===e))||[];if(d&&b.set(`#${d}`,n),Array.isArray(n)){const e=r.items;if(void 0===e&&r!==m&&r!==s.SpecExtension)return;for(let r=0;r{t.resolved&&e(t.node,t.document,t.nodePointer,r)}));u.push(t)}}}(t,d,y+p)}(t.parsed,t,"#/",i);do{p=yield Promise.all(u)}while(u.length!==p.length);return o}))}},3416:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportUnresolvedRef=t.NoUnresolvedRefs=void 0;const r=n(2928);function i(e,t,n){var i;const o=e.error;o instanceof r.YamlParseError&&t({message:"Failed to parse: "+o.message,location:{source:o.source,pointer:void 0,start:{col:o.col,line:o.line}}});const a=null===(i=e.error)||void 0===i?void 0:i.message;t({location:n,message:"Can't resolve $ref"+(a?": "+a:"")})}t.NoUnresolvedRefs=()=>({ref:{leave(e,{report:t,location:n},r){void 0===r.node&&i(r,t,n)}},DiscriminatorMapping(e,{report:t,resolve:n,location:r}){for(const o of Object.keys(e)){const a=n({$ref:e[o]});if(void 0!==a.node)return;i(a,t,r.child(o))}}}),t.reportUnresolvedRef=i},474:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoveUnusedComponents=void 0;const r=n(8209);t.RemoveUnusedComponents=()=>{const e=new Map;function t(t,n,r){var i;e.set(t.absolutePointer,{used:(null===(i=e.get(t.absolutePointer))||void 0===i?void 0:i.used)||!1,componentType:n,name:r})}return{ref:{leave(t,{type:n,resolve:r,key:i}){if(["Schema","Parameter","Response","SecurityScheme"].includes(n.name)){const n=r(t);if(!n.location)return;const[o,a]=n.location.absolutePointer.split("#",2),s=`${o}#${a.split("/").slice(0,3).join("/")}`;e.set(s,{used:!0,name:i.toString()})}}},Root:{leave(t,n){const i=n.getVisitorData();i.removedCount=0;const o=new Set;e.forEach((e=>{const{used:n,name:r,componentType:a}=e;!n&&a&&(o.add(a),delete t[a][r],i.removedCount++)}));for(const e of o)(0,r.isEmptyObject)(t[e])&&delete t[e]}},NamedSchemas:{Schema(e,{location:n,key:r}){e.allOf||t(n,"definitions",r.toString())}},NamedParameters:{Parameter(e,{location:n,key:r}){t(n,"parameters",r.toString())}},NamedResponses:{Response(e,{location:n,key:r}){t(n,"responses",r.toString())}},NamedSecuritySchemes:{SecurityScheme(e,{location:n,key:r}){t(n,"securityDefinitions",r.toString())}}}}},4335:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoveUnusedComponents=void 0;const r=n(8209);t.RemoveUnusedComponents=()=>{const e=new Map;function t(t,n,r){var i;e.set(t.absolutePointer,{used:(null===(i=e.get(t.absolutePointer))||void 0===i?void 0:i.used)||!1,componentType:n,name:r})}return{ref:{leave(t,{type:n,resolve:r,key:i}){if(["Schema","Header","Parameter","Response","Example","RequestBody"].includes(n.name)){const n=r(t);if(!n.location)return;const[o,a]=n.location.absolutePointer.split("#",2),s=`${o}#${a.split("/").slice(0,4).join("/")}`;e.set(s,{used:!0,name:i.toString()})}}},Root:{leave(t,n){const i=n.getVisitorData();i.removedCount=0,e.forEach((e=>{const{used:n,componentType:o,name:a}=e;if(!n&&o&&t.components){const e=t.components[o];delete e[a],i.removedCount++,(0,r.isEmptyObject)(e)&&delete t.components[o]}})),(0,r.isEmptyObject)(t.components)&&delete t.components}},NamedSchemas:{Schema(e,{location:n,key:r}){e.allOf||t(n,"schemas",r.toString())}},NamedParameters:{Parameter(e,{location:n,key:r}){t(n,"parameters",r.toString())}},NamedResponses:{Response(e,{location:n,key:r}){t(n,"responses",r.toString())}},NamedExamples:{Example(e,{location:n,key:r}){t(n,"examples",r.toString())}},NamedRequestBodies:{RequestBody(e,{location:n,key:r}){t(n,"requestBodies",r.toString())}},NamedHeaders:{Header(e,{location:n,key:r}){t(n,"headers",r.toString())}}}}},264:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncApi2Types=void 0;const r=n(1990),i=n(3873),o={properties:{},allowed(){return["http","ws","kafka","anypointmq","amqp","amqp1","mqtt","mqtt5","nats","jms","sns","solace","sqs","stomp","redis","mercure","ibmmq","googlepubsub","pulsar"]},additionalProperties:{type:"object"}},a={properties:{},allowed(){return["http","ws","kafka","anypointmq","amqp","amqp1","mqtt","mqtt5","nats","jms","sns","solace","sqs","stomp","redis","mercure","ibmmq","googlepubsub","pulsar"]},additionalProperties:{type:"object"}},s={properties:{},allowed(){return["http","ws","kafka","anypointmq","amqp","amqp1","mqtt","mqtt5","nats","jms","sns","solace","sqs","stomp","redis","mercure","ibmmq","googlepubsub","pulsar"]},additionalProperties:{type:"object"}},l={properties:{},allowed(){return["http","ws","kafka","anypointmq","amqp","amqp1","mqtt","mqtt5","nats","jms","sns","solace","sqs","stomp","redis","mercure","ibmmq","googlepubsub","pulsar"]},additionalProperties:{type:"object"}},c={properties:{$id:{type:"string"},id:{type:"string"},$schema:{type:"string"},definitions:"NamedSchemas",$defs:"NamedSchemas",$vocabulary:{type:"string"},externalDocs:"ExternalDocs",discriminator:"Discriminator",myArbitraryKeyword:{type:"boolean"},title:{type:"string"},multipleOf:{type:"number",minimum:0},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0},pattern:{type:"string"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0},uniqueItems:{type:"boolean"},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:e=>Array.isArray(e)?{type:"array",items:{enum:["object","array","string","number","integer","boolean","null"]}}:{enum:["object","array","string","number","integer","boolean","null"]},allOf:(0,r.listOf)("Schema"),anyOf:(0,r.listOf)("Schema"),oneOf:(0,r.listOf)("Schema"),not:"Schema",if:"Schema",then:"Schema",else:"Schema",dependentSchemas:(0,r.listOf)("Schema"),prefixItems:(0,r.listOf)("Schema"),contains:"Schema",minContains:{type:"integer",minimum:0},maxContains:{type:"integer",minimum:0},patternProperties:{type:"object"},propertyNames:"Schema",unevaluatedItems:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",unevaluatedProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",summary:{type:"string"},properties:"SchemaProperties",items:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",description:{type:"string"},format:{type:"string"},contentEncoding:{type:"string"},contentMediaType:{type:"string"},default:null,readOnly:{type:"boolean"},writeOnly:{type:"boolean"},examples:{type:"array"},example:{isExample:!0},deprecated:{type:"boolean"},const:null,$comment:{type:"string"},dependencies:{type:"object"}}},u={properties:{},additionalProperties:e=>(0,i.isMappingRef)(e)?{type:"string",directResolveAs:"Schema"}:{type:"string"}},p={properties:{type:{enum:["userPassword","apiKey","X509","symmetricEncryption","asymmetricEncryption","httpApiKey","http","oauth2","openIdConnect","plain","scramSha256","scramSha512","gssapi"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header","cookie","user","password"]},scheme:{type:"string"},bearerFormat:{type:"string"},flows:"SecuritySchemeFlows",openIdConnectUrl:{type:"string"}},required(e){switch(null==e?void 0:e.type){case"apiKey":return["type","in"];case"httpApiKey":return["type","name","in"];case"http":return["type","scheme"];case"oauth2":return["type","flows"];case"openIdConnect":return["type","openIdConnectUrl"];default:return["type"]}},allowed(e){switch(null==e?void 0:e.type){case"apiKey":return["type","in","description"];case"httpApiKey":return["type","name","in","description"];case"http":return["type","scheme","bearerFormat","description"];case"oauth2":return["type","flows","description"];case"openIdConnect":return["type","openIdConnectUrl","description"];default:return["type","description"]}},extensionsPrefix:"x-"},d={properties:{}};o.properties.http=d;const f={properties:{}};a.properties.http=f;const h={properties:{headers:"Schema",bindingVersion:{type:"string"}}};s.properties.http=h;const m={properties:{type:{type:"string"},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"]},headers:"Schema",bindingVersion:{type:"string"}}};l.properties.http=m;const g={properties:{method:{type:"string"},query:"Schema",headers:"Schema",bindingVersion:{type:"string"}}};o.properties.ws=g;const y={properties:{}};a.properties.ws=y;const b={properties:{}};s.properties.ws=b;const v={properties:{}};l.properties.ws=v;const x={properties:{topic:{type:"string"},partitions:{type:"integer"},replicas:{type:"integer"},topicConfiguration:"KafkaTopicConfiguration",bindingVersion:{type:"string"}}};o.properties.kafka=x;const w={properties:{}};a.properties.kafka=w;const k={properties:{key:"Schema",schemaIdLocation:{type:"string"},schemaIdPayloadEncoding:{type:"string"},schemaLookupStrategy:{type:"string"},bindingVersion:{type:"string"}}};s.properties.kafka=k;const S={properties:{groupId:"Schema",clientId:"Schema",bindingVersion:{type:"string"}}};l.properties.kafka=S;const O={properties:{destination:{type:"string"},destinationType:{type:"string"},bindingVersion:{type:"string"}}};o.properties.anypointmq=O;const E={properties:{}};a.properties.anypointmq=E;const _={properties:{headers:"Schema",bindingVersion:{type:"string"}}};s.properties.anypointmq=_;const A={properties:{}};l.properties.anypointmq=A;const j={properties:{}};o.properties.amqp=j;const C={properties:{}};a.properties.amqp=C;const P={properties:{contentEncoding:{type:"string"},messageType:{type:"string"},bindingVersion:{type:"string"}}};s.properties.amqp=P;const T={properties:{expiration:{type:"integer"},userId:{type:"string"},cc:{type:"array",items:{type:"string"}},priority:{type:"integer"},deliveryMode:{type:"integer"},mandatory:{type:"boolean"},bcc:{type:"array",items:{type:"string"}},replyTo:{type:"string"},timestamp:{type:"boolean"},ack:{type:"boolean"},bindingVersion:{type:"string"}}};l.properties.amqp=T;const I={properties:{}};o.properties.amqp1=I;const R={properties:{}};a.properties.amqp1=R;const N={properties:{}};s.properties.amqp1=N;const $={properties:{}};l.properties.amqp1=$;const L={properties:{qos:{type:"integer"},retain:{type:"boolean"},bindingVersion:{type:"string"}}};o.properties.mqtt=L;const D={properties:{clientId:{type:"string"},cleanSession:{type:"boolean"},lastWill:"MqttServerBindingLastWill",keepAlive:{type:"integer"},bindingVersion:{type:"string"}}};a.properties.mqtt=D;const M={properties:{bindingVersion:{type:"string"}}};s.properties.mqtt=M;const F={properties:{qos:{type:"integer"},retain:{type:"boolean"},bindingVersion:{type:"string"}}};l.properties.mqtt=F;const z={properties:{}};o.properties.mqtt5=z;const U={properties:{}};a.properties.mqtt5=U;const B={properties:{}};s.properties.mqtt5=B;const q={properties:{}};l.properties.mqtt5=q;const V={properties:{}};o.properties.nats=V;const W={properties:{}};a.properties.nats=W;const H={properties:{}};s.properties.nats=H;const Y={properties:{queue:{type:"string"},bindingVersion:{type:"string"}}};l.properties.nats=Y;const G={properties:{destination:{type:"string"},destinationType:{type:"string"},bindingVersion:{type:"string"}}};o.properties.jms=G;const Q={properties:{}};a.properties.jms=Q;const X={properties:{headers:"Schema",bindingVersion:{type:"string"}}};s.properties.jms=X;const K={properties:{headers:"Schema",bindingVersion:{type:"string"}}};l.properties.jms=K;const Z={properties:{}};o.properties.solace=Z;const J={properties:{bindingVersion:{type:"string"},msgVpn:{type:"string"}}};a.properties.solace=J;const ee={properties:{}};s.properties.solace=ee;const te={properties:{bindingVersion:{type:"string"},destinations:(0,r.listOf)("SolaceDestination")}};l.properties.solace=te;const ne={properties:{}};o.properties.stomp=ne;const re={properties:{}};a.properties.stomp=re;const ie={properties:{}};s.properties.stomp=ie;const oe={properties:{}};l.properties.stomp=oe;const ae={properties:{}};o.properties.redis=ae;const se={properties:{}};a.properties.redis=se;const le={properties:{}};s.properties.redis=le;const ce={properties:{}};l.properties.redis=ce;const ue={properties:{}};o.properties.mercure=ue;const pe={properties:{}};a.properties.mercure=pe;const de={properties:{}};s.properties.mercure=de;const fe={properties:{}};l.properties.mercure=fe,t.AsyncApi2Types={Root:{properties:{asyncapi:null,info:"Info",id:{type:"string"},servers:"ServerMap",channels:"ChannelMap",components:"Components",tags:"TagList",externalDocs:"ExternalDocs",defaultContentType:{type:"string"}},required:["asyncapi","channels","info"]},Tag:{properties:{name:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs"},required:["name"]},TagList:(0,r.listOf)("Tag"),ServerMap:{properties:{},additionalProperties:(e,t)=>t.match(/^[A-Za-z0-9_\-]+$/)?"Server":void 0},ExternalDocs:{properties:{description:{type:"string"},url:{type:"string"}},required:["url"]},Server:{properties:{url:{type:"string"},protocol:{type:"string"},protocolVersion:{type:"string"},description:{type:"string"},variables:"ServerVariablesMap",security:"SecurityRequirementList",bindings:"ServerBindings",tags:"TagList"},required:["url","protocol"]},ServerVariable:{properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"},examples:{type:"array",items:{type:"string"}}},required:[]},ServerVariablesMap:(0,r.mapOf)("ServerVariable"),SecurityRequirement:{properties:{},additionalProperties:{type:"array",items:{type:"string"}}},SecurityRequirementList:(0,r.listOf)("SecurityRequirement"),Info:{properties:{title:{type:"string"},version:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},contact:"Contact",license:"License"},required:["title","version"]},Contact:{properties:{name:{type:"string"},url:{type:"string"},email:{type:"string"}}},License:{properties:{name:{type:"string"},url:{type:"string"}},required:["name"]},HttpServerBinding:f,HttpChannelBinding:d,HttpMessageBinding:h,HttpOperationBinding:m,WsServerBinding:y,WsChannelBinding:g,WsMessageBinding:b,WsOperationBinding:v,KafkaServerBinding:w,KafkaTopicConfiguration:{properties:{"cleanup.policy":{type:"array",items:{enum:["delete","compact"]}},"retention.ms":{type:"integer"},"retention.bytes":{type:"integer"},"delete.retention.ms":{type:"integer"},"max.message.bytes":{type:"integer"}}},KafkaChannelBinding:x,KafkaMessageBinding:k,KafkaOperationBinding:S,AnypointmqServerBinding:E,AnypointmqChannelBinding:O,AnypointmqMessageBinding:_,AnypointmqOperationBinding:A,AmqpServerBinding:C,AmqpChannelBinding:j,AmqpMessageBinding:P,AmqpOperationBinding:T,Amqp1ServerBinding:R,Amqp1ChannelBinding:I,Amqp1MessageBinding:N,Amqp1OperationBinding:$,MqttServerBindingLastWill:{properties:{topic:{type:"string"},qos:{type:"integer"},message:{type:"string"},retain:{type:"boolean"}}},MqttServerBinding:D,MqttChannelBinding:L,MqttMessageBinding:M,MqttOperationBinding:F,Mqtt5ServerBinding:U,Mqtt5ChannelBinding:z,Mqtt5MessageBinding:B,Mqtt5OperationBinding:q,NatsServerBinding:W,NatsChannelBinding:V,NatsMessageBinding:H,NatsOperationBinding:Y,JmsServerBinding:Q,JmsChannelBinding:G,JmsMessageBinding:X,JmsOperationBinding:K,SolaceServerBinding:J,SolaceChannelBinding:Z,SolaceMessageBinding:ee,SolaceDestination:{properties:{destinationType:{type:"string",enum:["queue","topic"]},deliveryMode:{type:"string",enum:["direct","persistent"]},"queue.name":{type:"string"},"queue.topicSubscriptions":{type:"array",items:{type:"string"}},"queue.accessType":{type:"string",enum:["exclusive","nonexclusive"]},"queue.maxMsgSpoolSize":{type:"string"},"queue.maxTtl":{type:"string"},"topic.topicSubscriptions":{type:"array",items:{type:"string"}}}},SolaceOperationBinding:te,StompServerBinding:re,StompChannelBinding:ne,StompMessageBinding:ie,StompOperationBinding:oe,RedisServerBinding:se,RedisChannelBinding:ae,RedisMessageBinding:le,RedisOperationBinding:ce,MercureServerBinding:pe,MercureChannelBinding:ue,MercureMessageBinding:de,MercureOperationBinding:fe,ServerBindings:a,ChannelBindings:o,ChannelMap:{properties:{},additionalProperties:"Channel"},Channel:{properties:{description:{type:"string"},subscribe:"Operation",publish:"Operation",parameters:"ParametersMap",bindings:"ChannelBindings",servers:{type:"array",items:{type:"string"}}}},Parameter:{properties:{description:{type:"string"},schema:"Schema",location:{type:"string"}}},ParametersMap:(0,r.mapOf)("Parameter"),Operation:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},security:"SecurityRequirementList",bindings:"OperationBindings",traits:"OperationTraitList",message:"Message"},required:[]},Schema:c,MessageExample:{properties:{payload:{isExample:!0},summary:{type:"string"},name:{type:"string"},headers:{type:"object"}}},SchemaProperties:{properties:{},additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema"},DiscriminatorMapping:u,Discriminator:{properties:{propertyName:{type:"string"},mapping:"DiscriminatorMapping"},required:["propertyName"]},Components:{properties:{messages:"NamedMessages",parameters:"NamedParameters",schemas:"NamedSchemas",correlationIds:"NamedCorrelationIds",messageTraits:"NamedMessageTraits",operationTraits:"NamedOperationTraits",streamHeaders:"NamedStreamHeaders",securitySchemes:"NamedSecuritySchemes",servers:"ServerMap",serverVariables:"ServerVariablesMap",channels:"ChannelMap",serverBindings:"ServerBindings",channelBindings:"ChannelBindings",operationBindings:"OperationBindings",messageBindings:"MessageBindings"}},NamedSchemas:(0,r.mapOf)("Schema"),NamedMessages:(0,r.mapOf)("Message"),NamedMessageTraits:(0,r.mapOf)("MessageTrait"),NamedOperationTraits:(0,r.mapOf)("OperationTrait"),NamedParameters:(0,r.mapOf)("Parameter"),NamedSecuritySchemes:(0,r.mapOf)("SecurityScheme"),NamedCorrelationIds:(0,r.mapOf)("CorrelationId"),NamedStreamHeaders:(0,r.mapOf)("StreamHeader"),ImplicitFlow:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},authorizationUrl:{type:"string"}},required:["authorizationUrl","scopes"]},PasswordFlow:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"]},ClientCredentials:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"]},AuthorizationCode:{properties:{refreshUrl:{type:"string"},authorizationUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["authorizationUrl","tokenUrl","scopes"]},SecuritySchemeFlows:{properties:{implicit:"ImplicitFlow",password:"PasswordFlow",clientCredentials:"ClientCredentials",authorizationCode:"AuthorizationCode"}},SecurityScheme:p,Message:{properties:{messageId:{type:"string"},headers:"Schema",payload:"Schema",correlationId:"CorrelationId",schemaFormat:{type:"string"},contentType:{type:"string"},name:{type:"string"},title:{type:"string"},summary:{type:"string"},description:{type:"string"},tags:"TagList",externalDocs:"ExternalDocs",bindings:"MessageBindings",traits:"MessageTraitList"},additionalProperties:{}},MessageBindings:s,OperationBindings:l,OperationTrait:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},security:"SecurityRequirementList",bindings:"OperationBindings"},required:[]},OperationTraitList:(0,r.listOf)("OperationTrait"),MessageTrait:{properties:{messageId:{type:"string"},headers:"Schema",correlationId:"CorrelationId",schemaFormat:{type:"string"},contentType:{type:"string"},name:{type:"string"},title:{type:"string"},summary:{type:"string"},description:{type:"string"},tags:"TagList",externalDocs:"ExternalDocs",bindings:"MessageBindings"},additionalProperties:{}},MessageTraitList:(0,r.listOf)("MessageTrait"),CorrelationId:{properties:{description:{type:"string"},location:{type:"string"}},required:["location"]}}},1990:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNamedType=t.normalizeTypes=t.SpecExtension=t.mapOf=t.listOf=void 0,t.listOf=function(e){return{name:`${e}List`,properties:{},items:e}},t.mapOf=function(e){return{name:`${e}Map`,properties:{},additionalProperties:()=>e}},t.SpecExtension={name:"SpecExtension",properties:{},additionalProperties:{resolvable:!0}},t.normalizeTypes=function(e,n={}){const r={};for(const t of Object.keys(e))r[t]=Object.assign(Object.assign({},e[t]),{name:t});for(const e of Object.values(r))i(e);return r.SpecExtension=t.SpecExtension,r;function i(e){if(e.additionalProperties&&(e.additionalProperties=o(e.additionalProperties)),e.items&&(e.items=o(e.items)),e.properties){const t={};for(const[r,i]of Object.entries(e.properties))t[r]=o(i),n.doNotResolveExamples&&i&&i.isExample&&(t[r]=Object.assign(Object.assign({},i),{resolvable:!1}));e.properties=t}}function o(e){if("string"==typeof e){if(!r[e])throw new Error(`Unknown type name found: ${e}`);return r[e]}return"function"==typeof e?(t,n)=>o(e(t,n)):e&&e.name?(i(e=Object.assign({},e)),e):e&&e.directResolveAs?Object.assign(Object.assign({},e),{directResolveAs:o(e.directResolveAs)}):e}},t.isNamedType=function(e){return"string"==typeof(null==e?void 0:e.name)}},4409:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Oas2Types=void 0;const r=n(1990),i=/^[0-9][0-9Xx]{2}$/,o={properties:{name:{type:"string"},in:{type:"string",enum:["query","header","path","formData","body"]},description:{type:"string"},required:{type:"boolean"},schema:"Schema",type:{type:"string",enum:["string","number","integer","boolean","array","file"]},format:{type:"string"},allowEmptyValue:{type:"boolean"},items:"ParameterItems",collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes","multi"]},default:null,maximum:{type:"integer"},exclusiveMaximum:{type:"boolean"},minimum:{type:"integer"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer"},minLength:{type:"integer"},pattern:{type:"string"},maxItems:{type:"integer"},minItems:{type:"integer"},uniqueItems:{type:"boolean"},enum:{type:"array"},multipleOf:{type:"number"},"x-example":"Example","x-examples":"ExamplesMap"},required(e){return e&&e.in?"body"===e.in?["name","in","schema"]:"array"===e.type?["name","in","type","items"]:["name","in","type"]:["name","in"]},extensionsPrefix:"x-"},a={properties:{type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:"ParameterItems",collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes","multi"]},default:null,maximum:{type:"integer"},exclusiveMaximum:{type:"boolean"},minimum:{type:"integer"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer"},minLength:{type:"integer"},pattern:{type:"string"},maxItems:{type:"integer"},minItems:{type:"integer"},uniqueItems:{type:"boolean"},enum:{type:"array"},multipleOf:{type:"number"}},required(e){return e&&"array"===e.type?["type","items"]:["type"]},extensionsPrefix:"x-"},s={properties:{default:"Response"},additionalProperties:(e,t)=>i.test(t)?"Response":void 0},l={properties:{description:{type:"string"},schema:"Schema",headers:(0,r.mapOf)("Header"),examples:"Examples","x-summary":{type:"string"}},required:["description"],extensionsPrefix:"x-"},c={properties:{description:{type:"string"},type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:"ParameterItems",collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes","multi"]},default:null,maximum:{type:"integer"},exclusiveMaximum:{type:"boolean"},minimum:{type:"integer"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer"},minLength:{type:"integer"},pattern:{type:"string"},maxItems:{type:"integer"},minItems:{type:"integer"},uniqueItems:{type:"boolean"},enum:{type:"array"},multipleOf:{type:"number"}},required(e){return e&&"array"===e.type?["type","items"]:["type"]},extensionsPrefix:"x-"},u={properties:{format:{type:"string"},title:{type:"string"},description:{type:"string"},default:null,multipleOf:{type:"number"},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"boolean"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"number"},minLength:{type:"number"},pattern:{type:"string"},maxItems:{type:"number"},minItems:{type:"number"},uniqueItems:{type:"boolean"},maxProperties:{type:"number"},minProperties:{type:"number"},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:{type:"string",enum:["object","array","string","number","integer","boolean","null"]},items:e=>Array.isArray(e)?(0,r.listOf)("Schema"):"Schema",allOf:(0,r.listOf)("Schema"),properties:"SchemaProperties",additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",discriminator:{type:"string"},readOnly:{type:"boolean"},xml:"Xml",externalDocs:"ExternalDocs",example:{isExample:!0},"x-tags":{type:"array",items:{type:"string"}},"x-nullable":{type:"boolean"},"x-extendedDiscriminator":{type:"string"},"x-additionalPropertiesName":{type:"string"},"x-explicitMappingOnly":{type:"boolean"},"x-enumDescriptions":"EnumDescriptions"},extensionsPrefix:"x-"},p={properties:{type:{enum:["basic","apiKey","oauth2"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header"]},flow:{enum:["implicit","password","application","accessCode"]},authorizationUrl:{type:"string"},tokenUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},"x-defaultClientId":{type:"string"}},required(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in"];case"oauth2":switch(null==e?void 0:e.flow){case"implicit":return["type","flow","authorizationUrl","scopes"];case"accessCode":return["type","flow","authorizationUrl","tokenUrl","scopes"];case"application":case"password":return["type","flow","tokenUrl","scopes"];default:return["type","flow","scopes"]}default:return["type"]}},allowed(e){switch(null==e?void 0:e.type){case"basic":return["type","description"];case"apiKey":return["type","name","in","description"];case"oauth2":switch(null==e?void 0:e.flow){case"implicit":return["type","flow","authorizationUrl","description","scopes"];case"accessCode":return["type","flow","authorizationUrl","tokenUrl","description","scopes"];case"application":case"password":return["type","flow","tokenUrl","description","scopes"];default:return["type","flow","tokenUrl","authorizationUrl","description","scopes"]}default:return["type","description"]}},extensionsPrefix:"x-"};t.Oas2Types={Root:{properties:{swagger:{type:"string"},info:"Info",host:{type:"string"},basePath:{type:"string"},schemes:{type:"array",items:{type:"string"}},consumes:{type:"array",items:{type:"string"}},produces:{type:"array",items:{type:"string"}},paths:"Paths",definitions:"NamedSchemas",parameters:"NamedParameters",responses:"NamedResponses",securityDefinitions:"NamedSecuritySchemes",security:"SecurityRequirementList",tags:"TagList",externalDocs:"ExternalDocs","x-servers":"XServerList","x-tagGroups":"TagGroups","x-ignoredHeaderParameters":{type:"array",items:{type:"string"}}},required:["swagger","paths","info"],extensionsPrefix:"x-"},Tag:{properties:{name:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs","x-traitTag":{type:"boolean"},"x-displayName":{type:"string"}},required:["name"],extensionsPrefix:"x-"},TagList:(0,r.listOf)("Tag"),TagGroups:(0,r.listOf)("TagGroup"),TagGroup:{properties:{name:{type:"string"},tags:{type:"array",items:{type:"string"}}}},ExternalDocs:{properties:{description:{type:"string"},url:{type:"string"}},required:["url"],extensionsPrefix:"x-"},Example:{properties:{value:{isExample:!0},summary:{type:"string"},description:{type:"string"},externalValue:{type:"string"}},extensionsPrefix:"x-"},ExamplesMap:(0,r.mapOf)("Example"),EnumDescriptions:{properties:{},additionalProperties:{type:"string"}},SecurityRequirement:{properties:{},additionalProperties:{type:"array",items:{type:"string"}}},SecurityRequirementList:(0,r.listOf)("SecurityRequirement"),Info:{properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},contact:"Contact",license:"License",version:{type:"string"},"x-logo":"Logo"},required:["title","version"],extensionsPrefix:"x-"},Contact:{properties:{name:{type:"string"},url:{type:"string"},email:{type:"string"}},extensionsPrefix:"x-"},License:{properties:{name:{type:"string"},url:{type:"string"}},required:["name"],extensionsPrefix:"x-"},Logo:{properties:{url:{type:"string"},altText:{type:"string"},backgroundColor:{type:"string"},href:{type:"string"}},extensionsPrefix:"x-"},Paths:{properties:{},additionalProperties:(e,t)=>t.startsWith("/")?"PathItem":void 0},PathItem:{properties:{$ref:{type:"string"},parameters:"ParameterList",get:"Operation",put:"Operation",post:"Operation",delete:"Operation",options:"Operation",head:"Operation",patch:"Operation"},extensionsPrefix:"x-"},Parameter:o,ParameterItems:a,ParameterList:(0,r.listOf)("Parameter"),Operation:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},consumes:{type:"array",items:{type:"string"}},produces:{type:"array",items:{type:"string"}},parameters:"ParameterList",responses:"Responses",schemes:{type:"array",items:{type:"string"}},deprecated:{type:"boolean"},security:"SecurityRequirementList","x-codeSamples":"XCodeSampleList","x-code-samples":"XCodeSampleList","x-hideTryItPanel":{type:"boolean"}},required:["responses"],extensionsPrefix:"x-"},Examples:{properties:{},additionalProperties:{isExample:!0}},Header:c,Responses:s,Response:l,Schema:u,Xml:{properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean"},wrapped:{type:"boolean"}},extensionsPrefix:"x-"},SchemaProperties:{properties:{},additionalProperties:"Schema"},NamedSchemas:(0,r.mapOf)("Schema"),NamedResponses:(0,r.mapOf)("Response"),NamedParameters:(0,r.mapOf)("Parameter"),NamedSecuritySchemes:(0,r.mapOf)("SecurityScheme"),SecurityScheme:p,XCodeSample:{properties:{lang:{type:"string"},label:{type:"string"},source:{type:"string"}}},XCodeSampleList:(0,r.listOf)("XCodeSample"),XServerList:(0,r.listOf)("XServer"),XServer:{properties:{url:{type:"string"},description:{type:"string"}},required:["url"]}}},4154:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Oas3Types=void 0;const r=n(1990),i=n(3873),o=/^[0-9][0-9Xx]{2}$/,a={properties:{default:"Response"},additionalProperties:(e,t)=>o.test(t)?"Response":void 0},s={properties:{externalDocs:"ExternalDocs",discriminator:"Discriminator",title:{type:"string"},multipleOf:{type:"number",minimum:0},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"boolean"},exclusiveMinimum:{type:"boolean"},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0},pattern:{type:"string"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0},uniqueItems:{type:"boolean"},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:{enum:["object","array","string","number","integer","boolean","null"]},allOf:(0,r.listOf)("Schema"),anyOf:(0,r.listOf)("Schema"),oneOf:(0,r.listOf)("Schema"),not:"Schema",properties:"SchemaProperties",items:e=>Array.isArray(e)?(0,r.listOf)("Schema"):"Schema",additionalItems:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",description:{type:"string"},format:{type:"string"},default:null,nullable:{type:"boolean"},readOnly:{type:"boolean"},writeOnly:{type:"boolean"},xml:"Xml",example:{isExample:!0},deprecated:{type:"boolean"},"x-tags":{type:"array",items:{type:"string"}},"x-additionalPropertiesName":{type:"string"},"x-explicitMappingOnly":{type:"boolean"}},extensionsPrefix:"x-"},l={properties:{},additionalProperties:e=>(0,i.isMappingRef)(e)?{type:"string",directResolveAs:"Schema"}:{type:"string"}},c={properties:{type:{enum:["apiKey","http","oauth2","openIdConnect"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header","cookie"]},scheme:{type:"string"},bearerFormat:{type:"string"},flows:"OAuth2Flows",openIdConnectUrl:{type:"string"},"x-defaultClientId":{type:"string"}},required(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in"];case"http":return["type","scheme"];case"oauth2":return["type","flows"];case"openIdConnect":return["type","openIdConnectUrl"];default:return["type"]}},allowed(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in","description"];case"http":return["type","scheme","bearerFormat","description"];case"oauth2":return["type","flows","description"];case"openIdConnect":return["type","openIdConnectUrl","description"];default:return["type","description"]}},extensionsPrefix:"x-"};t.Oas3Types={Root:{properties:{openapi:null,info:"Info",servers:"ServerList",security:"SecurityRequirementList",tags:"TagList",externalDocs:"ExternalDocs",paths:"Paths",components:"Components","x-webhooks":"WebhooksMap","x-tagGroups":"TagGroups","x-ignoredHeaderParameters":{type:"array",items:{type:"string"}}},required:["openapi","paths","info"],extensionsPrefix:"x-"},Tag:{properties:{name:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs","x-traitTag":{type:"boolean"},"x-displayName":{type:"string"}},required:["name"],extensionsPrefix:"x-"},TagList:(0,r.listOf)("Tag"),TagGroups:(0,r.listOf)("TagGroup"),TagGroup:{properties:{name:{type:"string"},tags:{type:"array",items:{type:"string"}}},extensionsPrefix:"x-"},ExternalDocs:{properties:{description:{type:"string"},url:{type:"string"}},required:["url"],extensionsPrefix:"x-"},Server:{properties:{url:{type:"string"},description:{type:"string"},variables:"ServerVariablesMap"},required:["url"],extensionsPrefix:"x-"},ServerList:(0,r.listOf)("Server"),ServerVariable:{properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},required:["default"],extensionsPrefix:"x-"},ServerVariablesMap:(0,r.mapOf)("ServerVariable"),SecurityRequirement:{properties:{},additionalProperties:{type:"array",items:{type:"string"}}},SecurityRequirementList:(0,r.listOf)("SecurityRequirement"),Info:{properties:{title:{type:"string"},version:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},contact:"Contact",license:"License","x-logo":"Logo"},required:["title","version"],extensionsPrefix:"x-"},Contact:{properties:{name:{type:"string"},url:{type:"string"},email:{type:"string"}},extensionsPrefix:"x-"},License:{properties:{name:{type:"string"},url:{type:"string"}},required:["name"],extensionsPrefix:"x-"},Paths:{properties:{},additionalProperties:(e,t)=>t.startsWith("/")?"PathItem":void 0},PathItem:{properties:{$ref:{type:"string"},servers:"ServerList",parameters:"ParameterList",summary:{type:"string"},description:{type:"string"},get:"Operation",put:"Operation",post:"Operation",delete:"Operation",options:"Operation",head:"Operation",patch:"Operation",trace:"Operation"},extensionsPrefix:"x-"},Parameter:{properties:{name:{type:"string"},in:{enum:["query","header","path","cookie"]},description:{type:"string"},required:{type:"boolean"},deprecated:{type:"boolean"},allowEmptyValue:{type:"boolean"},style:{enum:["form","simple","label","matrix","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean"},schema:"Schema",example:{isExample:!0},examples:"ExamplesMap",content:"MediaTypesMap"},required:["name","in"],requiredOneOf:["schema","content"],extensionsPrefix:"x-"},ParameterList:(0,r.listOf)("Parameter"),Operation:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},parameters:"ParameterList",security:"SecurityRequirementList",servers:"ServerList",requestBody:"RequestBody",responses:"Responses",deprecated:{type:"boolean"},callbacks:"CallbacksMap","x-codeSamples":"XCodeSampleList","x-code-samples":"XCodeSampleList","x-hideTryItPanel":{type:"boolean"}},required:["responses"],extensionsPrefix:"x-"},Callback:(0,r.mapOf)("PathItem"),CallbacksMap:(0,r.mapOf)("Callback"),RequestBody:{properties:{description:{type:"string"},required:{type:"boolean"},content:"MediaTypesMap"},required:["content"],extensionsPrefix:"x-"},MediaTypesMap:{properties:{},additionalProperties:"MediaType"},MediaType:{properties:{schema:"Schema",example:{isExample:!0},examples:"ExamplesMap",encoding:"EncodingMap"},extensionsPrefix:"x-"},Example:{properties:{value:{isExample:!0},summary:{type:"string"},description:{type:"string"},externalValue:{type:"string"}},extensionsPrefix:"x-"},ExamplesMap:(0,r.mapOf)("Example"),Encoding:{properties:{contentType:{type:"string"},headers:"HeadersMap",style:{enum:["form","simple","label","matrix","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean"}},extensionsPrefix:"x-"},EncodingMap:(0,r.mapOf)("Encoding"),EnumDescriptions:{properties:{},additionalProperties:{type:"string"}},Header:{properties:{description:{type:"string"},required:{type:"boolean"},deprecated:{type:"boolean"},allowEmptyValue:{type:"boolean"},style:{enum:["form","simple","label","matrix","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean"},schema:"Schema",example:{isExample:!0},examples:"ExamplesMap",content:"MediaTypesMap"},requiredOneOf:["schema","content"],extensionsPrefix:"x-"},HeadersMap:(0,r.mapOf)("Header"),Responses:a,Response:{properties:{description:{type:"string"},headers:"HeadersMap",content:"MediaTypesMap",links:"LinksMap","x-summary":{type:"string"}},required:["description"],extensionsPrefix:"x-"},Link:{properties:{operationRef:{type:"string"},operationId:{type:"string"},parameters:null,requestBody:null,description:{type:"string"},server:"Server"},extensionsPrefix:"x-"},Logo:{properties:{url:{type:"string"},altText:{type:"string"},backgroundColor:{type:"string"},href:{type:"string"}}},Schema:s,Xml:{properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean"},wrapped:{type:"boolean"}},extensionsPrefix:"x-"},SchemaProperties:{properties:{},additionalProperties:"Schema"},DiscriminatorMapping:l,Discriminator:{properties:{propertyName:{type:"string"},mapping:"DiscriminatorMapping"},required:["propertyName"],extensionsPrefix:"x-"},Components:{properties:{parameters:"NamedParameters",schemas:"NamedSchemas",responses:"NamedResponses",examples:"NamedExamples",requestBodies:"NamedRequestBodies",headers:"NamedHeaders",securitySchemes:"NamedSecuritySchemes",links:"NamedLinks",callbacks:"NamedCallbacks"},extensionsPrefix:"x-"},LinksMap:(0,r.mapOf)("Link"),NamedSchemas:(0,r.mapOf)("Schema"),NamedResponses:(0,r.mapOf)("Response"),NamedParameters:(0,r.mapOf)("Parameter"),NamedExamples:(0,r.mapOf)("Example"),NamedRequestBodies:(0,r.mapOf)("RequestBody"),NamedHeaders:(0,r.mapOf)("Header"),NamedSecuritySchemes:(0,r.mapOf)("SecurityScheme"),NamedLinks:(0,r.mapOf)("Link"),NamedCallbacks:(0,r.mapOf)("Callback"),ImplicitFlow:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},authorizationUrl:{type:"string"}},required:["authorizationUrl","scopes"],extensionsPrefix:"x-"},PasswordFlow:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"],extensionsPrefix:"x-"},ClientCredentials:{properties:{refreshUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"}},required:["tokenUrl","scopes"],extensionsPrefix:"x-"},AuthorizationCode:{properties:{refreshUrl:{type:"string"},authorizationUrl:{type:"string"},scopes:{type:"object",additionalProperties:{type:"string"}},tokenUrl:{type:"string"},"x-usePkce":e=>"boolean"==typeof e?{type:"boolean"}:"XUsePkce"},required:["authorizationUrl","tokenUrl","scopes"],extensionsPrefix:"x-"},OAuth2Flows:{properties:{implicit:"ImplicitFlow",password:"PasswordFlow",clientCredentials:"ClientCredentials",authorizationCode:"AuthorizationCode"},extensionsPrefix:"x-"},SecurityScheme:c,XCodeSample:{properties:{lang:{type:"string"},label:{type:"string"},source:{type:"string"}}},XCodeSampleList:(0,r.listOf)("XCodeSample"),XUsePkce:{properties:{disableManualConfiguration:{type:"boolean"},hideClientSecretInput:{type:"boolean"}}},WebhooksMap:{properties:{},additionalProperties:()=>"PathItem"}}},2082:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Oas3_1Types=void 0;const r=n(1990),i=n(4154),o={properties:{$id:{type:"string"},$anchor:{type:"string"},id:{type:"string"},$schema:{type:"string"},definitions:"NamedSchemas",$defs:"NamedSchemas",$vocabulary:{type:"string"},externalDocs:"ExternalDocs",discriminator:"Discriminator",title:{type:"string"},multipleOf:{type:"number",minimum:0},maximum:{type:"number"},minimum:{type:"number"},exclusiveMaximum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0},pattern:{type:"string"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0},uniqueItems:{type:"boolean"},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0},required:{type:"array",items:{type:"string"}},enum:{type:"array"},type:e=>Array.isArray(e)?{type:"array",items:{enum:["object","array","string","number","integer","boolean","null"]}}:{enum:["object","array","string","number","integer","boolean","null"]},allOf:(0,r.listOf)("Schema"),anyOf:(0,r.listOf)("Schema"),oneOf:(0,r.listOf)("Schema"),not:"Schema",if:"Schema",then:"Schema",else:"Schema",dependentSchemas:(0,r.listOf)("Schema"),prefixItems:(0,r.listOf)("Schema"),contains:"Schema",minContains:{type:"integer",minimum:0},maxContains:{type:"integer",minimum:0},patternProperties:{type:"object"},propertyNames:"Schema",unevaluatedItems:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",unevaluatedProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",summary:{type:"string"},properties:"SchemaProperties",items:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",additionalProperties:e=>"boolean"==typeof e?{type:"boolean"}:"Schema",description:{type:"string"},format:{type:"string"},contentEncoding:{type:"string"},contentMediaType:{type:"string"},default:null,readOnly:{type:"boolean"},writeOnly:{type:"boolean"},xml:"Xml",examples:{type:"array"},example:{isExample:!0},deprecated:{type:"boolean"},const:null,$comment:{type:"string"},"x-tags":{type:"array",items:{type:"string"}}},extensionsPrefix:"x-"},a={properties:{type:{enum:["apiKey","http","oauth2","openIdConnect","mutualTLS"]},description:{type:"string"},name:{type:"string"},in:{type:"string",enum:["query","header","cookie"]},scheme:{type:"string"},bearerFormat:{type:"string"},flows:"OAuth2Flows",openIdConnectUrl:{type:"string"}},required(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in"];case"http":return["type","scheme"];case"oauth2":return["type","flows"];case"openIdConnect":return["type","openIdConnectUrl"];default:return["type"]}},allowed(e){switch(null==e?void 0:e.type){case"apiKey":return["type","name","in","description"];case"http":return["type","scheme","bearerFormat","description"];case"oauth2":switch(null==e?void 0:e.flows){case"implicit":return["type","flows","authorizationUrl","refreshUrl","description","scopes"];case"password":case"clientCredentials":return["type","flows","tokenUrl","refreshUrl","description","scopes"];default:return["type","flows","authorizationUrl","refreshUrl","tokenUrl","description","scopes"]}case"openIdConnect":return["type","openIdConnectUrl","description"];default:return["type","description"]}},extensionsPrefix:"x-"};t.Oas3_1Types=Object.assign(Object.assign({},i.Oas3Types),{Info:{properties:{title:{type:"string"},version:{type:"string"},description:{type:"string"},termsOfService:{type:"string"},summary:{type:"string"},contact:"Contact",license:"License","x-logo":"Logo"},required:["title","version"],extensionsPrefix:"x-"},Root:{properties:{openapi:null,info:"Info",servers:"ServerList",security:"SecurityRequirementList",tags:"TagList",externalDocs:"ExternalDocs",paths:"Paths",webhooks:"WebhooksMap",components:"Components",jsonSchemaDialect:{type:"string"}},required:["openapi","info"],requiredOneOf:["paths","components","webhooks"],extensionsPrefix:"x-"},Schema:o,License:{properties:{name:{type:"string"},url:{type:"string"},identifier:{type:"string"}},required:["name"],extensionsPrefix:"x-"},Components:{properties:{parameters:"NamedParameters",schemas:"NamedSchemas",responses:"NamedResponses",examples:"NamedExamples",requestBodies:"NamedRequestBodies",headers:"NamedHeaders",securitySchemes:"NamedSecuritySchemes",links:"NamedLinks",callbacks:"NamedCallbacks",pathItems:"NamedPathItems"},extensionsPrefix:"x-"},NamedPathItems:(0,r.mapOf)("PathItem"),SecurityScheme:a,Operation:{properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:"ExternalDocs",operationId:{type:"string"},parameters:"ParameterList",security:"SecurityRequirementList",servers:"ServerList",requestBody:"RequestBody",responses:"Responses",deprecated:{type:"boolean"},callbacks:"CallbacksMap","x-codeSamples":"XCodeSampleList","x-code-samples":"XCodeSampleList","x-hideTryItPanel":{type:"boolean"}},extensionsPrefix:"x-"}})},8209:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=t.pickDefined=t.keysOf=t.identity=t.isTruthy=t.showErrorForDeprecatedField=t.showWarningForDeprecatedField=t.doesYamlFileExist=t.isCustomRuleId=t.getMatchingStatusCodeRange=t.assignExisting=t.isNotString=t.isString=t.isNotEmptyObject=t.slash=t.isPathParameter=t.yamlAndJsonSyncReader=t.readFileAsStringSync=t.isSingular=t.validateMimeTypeOAS3=t.validateMimeType=t.splitCamelCaseIntoWords=t.omitObjectProps=t.pickObjectProps=t.readFileFromUrl=t.isEmptyArray=t.isEmptyObject=t.isPlainObject=t.isDefined=t.loadYaml=t.popStack=t.pushStack=t.stringifyYaml=t.parseYaml=void 0;const i=n(7411),o=n(7975),a=n(4536),s=n(8381),l=n(5127),c=n(970),u=n(1827),p=n(2678);var d=n(970);function f(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function h(e,t){return t.match(/^https?:\/\//)||(e=e.replace(/^https?:\/\//,"")),a(e,t)}function m(e){return"string"==typeof e}function g(e){return!!e}function y(e,t){return`${void 0!==t?`${t}.`:""}${e}`}Object.defineProperty(t,"parseYaml",{enumerable:!0,get:function(){return d.parseYaml}}),Object.defineProperty(t,"stringifyYaml",{enumerable:!0,get:function(){return d.stringifyYaml}}),t.pushStack=function(e,t){return{prev:e,value:t}},t.popStack=function(e){var t;return null!==(t=null==e?void 0:e.prev)&&void 0!==t?t:null},t.loadYaml=function(e){return r(this,void 0,void 0,(function*(){const t=yield i.promises.readFile(e,"utf-8");return(0,c.parseYaml)(t)}))},t.isDefined=function(e){return void 0!==e},t.isPlainObject=f,t.isEmptyObject=function(e){return f(e)&&0===Object.keys(e).length},t.isEmptyArray=function(e){return Array.isArray(e)&&0===e.length},t.readFileFromUrl=function(e,t){return r(this,void 0,void 0,(function*(){const n={};for(const r of t.headers)h(e,r.matches)&&(n[r.name]=void 0!==r.envVariable?u.env[r.envVariable]||"":r.value);const r=yield(t.customFetch||s.default)(e,{headers:n});if(!r.ok)throw new Error(`Failed to load ${e}: ${r.status} ${r.statusText}`);return{body:yield r.text(),mimeType:r.headers.get("content-type")}}))},t.pickObjectProps=function(e,t){return Object.fromEntries(t.filter((t=>t in e)).map((t=>[t,e[t]])))},t.omitObjectProps=function(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))},t.splitCamelCaseIntoWords=function(e){const t=e.split(/(?:[-._])|([A-Z][a-z]+)/).filter(g).map((e=>e.toLocaleLowerCase())),n=e.split(/([A-Z]{2,})/).filter((e=>e&&e===e.toUpperCase())).map((e=>e.toLocaleLowerCase()));return new Set([...t,...n])},t.validateMimeType=function({type:e,value:t},{report:n,location:r},i){if(!i)throw new Error(`Parameter "allowedValues" is not provided for "${"consumes"===e?"request":"response"}-mime-type" rule`);if(t[e])for(const o of t[e])i.includes(o)||n({message:`Mime type "${o}" is not allowed`,location:r.child(t[e].indexOf(o)).key()})},t.validateMimeTypeOAS3=function({type:e,value:t},{report:n,location:r},i){if(!i)throw new Error(`Parameter "allowedValues" is not provided for "${"consumes"===e?"request":"response"}-mime-type" rule`);if(t.content)for(const e of Object.keys(t.content))i.includes(e)||n({message:`Mime type "${e}" is not allowed`,location:r.child("content").child(e).key()})},t.isSingular=function(e){return l.isSingular(e)},t.readFileAsStringSync=function(e){return i.readFileSync(e,"utf-8")},t.yamlAndJsonSyncReader=function(e){const t=i.readFileSync(e,"utf-8");return(0,c.parseYaml)(t)},t.isPathParameter=function(e){return e.startsWith("{")&&e.endsWith("}")},t.slash=function(e){return/^\\\\\?\\/.test(e)?e:e.replace(/\\/g,"/")},t.isNotEmptyObject=function(e){return!!e&&Object.keys(e).length>0},t.isString=m,t.isNotString=function(e){return!m(e)},t.assignExisting=function(e,t){for(const n of Object.keys(t))e.hasOwnProperty(n)&&(e[n]=t[n])},t.getMatchingStatusCodeRange=function(e){return`${e}`.replace(/^(\d)\d\d$/,((e,t)=>`${t}XX`))},t.isCustomRuleId=function(e){return e.includes("/")},t.doesYamlFileExist=function(e){return(".yaml"===(0,o.extname)(e)||".yml"===(0,o.extname)(e))&&i.hasOwnProperty("existsSync")&&i.existsSync(e)},t.showWarningForDeprecatedField=function(e,t,n){p.logger.warn(`The '${p.colorize.red(e)}' field is deprecated. ${t?`Use ${p.colorize.green(y(t,n))} instead. `:""}Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties\n`)},t.showErrorForDeprecatedField=function(e,t,n){throw new Error(`Do not use '${e}' field. ${t?`Use '${y(t,n)}' instead. `:""}\n`)},t.isTruthy=g,t.identity=function(e){return e},t.keysOf=function(e){return e?Object.keys(e):[]},t.pickDefined=function(e){if(!e)return;const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t},t.nextTick=function(){new Promise((e=>{setTimeout(e)}))}},2161:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeVisitors=void 0;const r=n(1990),i={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};t.normalizeVisitors=function(e,t){const n={any:{enter:[],leave:[]}};for(const e of Object.keys(t))n[e]={enter:[],leave:[]};n.ref={enter:[],leave:[]};for(const{ruleId:t,severity:n,visitor:r}of e)s({ruleId:t,severity:n},r,null);for(const e of Object.keys(n))n[e].enter.sort(((e,t)=>t.depth-e.depth)),n[e].leave.sort(((e,t)=>e.depth-t.depth));return n;function o(e,t,i,a,s=[]){if(s.includes(t))return;s=[...s,t];const l=new Set;for(const n of Object.values(t.properties))n!==i?"object"==typeof n&&null!==n&&n.name&&l.add(n):c(e,s);t.additionalProperties&&"function"!=typeof t.additionalProperties&&(t.additionalProperties===i?c(e,s):void 0!==t.additionalProperties.name&&l.add(t.additionalProperties)),t.items&&(t.items===i?c(e,s):void 0!==t.items.name&&l.add(t.items)),t.extensionsPrefix&&l.add(r.SpecExtension);for(const t of Array.from(l.values()))o(e,t,i,a,s);function c(e,t){for(const r of t.slice(1))n[r.name]=n[r.name]||{enter:[],leave:[]},n[r.name].enter.push(Object.assign(Object.assign({},e),{visit:()=>{},depth:0,context:{isSkippedLevel:!0,seen:new Set,parent:a}}))}}function a(e,t){if(Array.isArray(t)){const n=t.find((t=>e[t]))||void 0;return n&&e[n]}return e[t]}function s(e,r,l,c=0){const u=Object.keys(t);if(0===c)u.push("any"),u.push("ref");else{if(r.any)throw new Error("any() is allowed only on top level");if(r.ref)throw new Error("ref() is allowed only on top level")}for(const p of u){const u=r[p]||a(r,i[p]),d=n[p];if(!u)continue;let f,h,m;const g="object"==typeof u;if("ref"===p&&g&&u.skip)throw new Error("ref() visitor does not support skip");"function"==typeof u?f=u:g&&(f=u.enter,h=u.leave,m=u.skip);const y={activatedOn:null,type:t[p],parent:l,isSkippedLevel:!1};if("object"==typeof u&&s(e,u,y,c+1),l&&o(e,l.type,t[p],l),f||g){if(f&&"function"!=typeof f)throw new Error("DEV: should be function");d.enter.push(Object.assign(Object.assign({},e),{visit:f||(()=>{}),skip:m,depth:c,context:y}))}if(h){if("function"!=typeof h)throw new Error("DEV: should be function");d.leave.push(Object.assign(Object.assign({},e),{visit:h,depth:c,context:y}))}}}}},5735:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.walkDocument=void 0;const r=n(3873),i=n(8209),o=n(2928),a=n(1990);function s(e){var t,n;const r={};for(;e.parent;)(null===(t=e.parent.activatedOn)||void 0===t?void 0:t.value.location)&&(r[e.parent.type.name]=null===(n=e.parent.activatedOn)||void 0===n?void 0:n.value.location),e=e.parent;return r}t.walkDocument=function(e){const{document:t,rootType:n,normalizedVisitors:l,resolvedRefMap:c,ctx:u}=e,p={},d=new Set;!function e(t,n,f,h,m){var g,y,b,v,x,w,k,S,O,E,_;const A=(e,t=C.source.absoluteRef)=>{if(!(0,r.isRef)(e))return{location:f,node:e};const n=(0,o.makeRefId)(t,e.$ref),i=c.get(n);if(!i)return{location:void 0,node:void 0};const{resolved:a,node:s,document:l,nodePointer:u,error:p}=i;return{location:a?new r.Location(l.source,u):p instanceof o.YamlParseError?new r.Location(p.source,""):void 0,node:s,error:p}},j=f;let C=f;const{node:P,location:T,error:I}=A(t),R=new Set;if((0,r.isRef)(t)){const e=l.ref.enter;for(const{visit:r,ruleId:i,severity:o,context:a}of e)R.add(a),r(t,{report:$.bind(void 0,i,o),resolve:A,rawNode:t,rawLocation:j,location:f,type:n,parent:h,key:m,parentLocations:{},oasVersion:u.oasVersion,getVisitorData:L.bind(void 0,i)},{node:P,location:T,error:I}),(null==T?void 0:T.source.absoluteRef)&&u.refTypes&&u.refTypes.set(null==T?void 0:T.source.absoluteRef,n)}if(void 0!==P&&T&&"scalar"!==n.name){C=T;const o=null===(y=null===(g=p[n.name])||void 0===g?void 0:g.has)||void 0===y?void 0:y.call(g,P);let s=!1;const c=l.any.enter.concat((null===(b=l[n.name])||void 0===b?void 0:b.enter)||[]),u=[];for(const{context:e,visit:r,skip:a,ruleId:l,severity:p}of c){if(d.has(C.pointer))break;if(e.isSkippedLevel)!e.parent.activatedOn||e.parent.activatedOn.value.nextLevelTypeActivated||e.seen.has(t)||(e.seen.add(t),s=!0,u.push(e));else if(e.parent&&e.parent.activatedOn&&(null===(v=e.activatedOn)||void 0===v?void 0:v.value.withParentNode)!==e.parent.activatedOn.value.node&&(null===(x=e.parent.activatedOn.value.nextLevelTypeActivated)||void 0===x?void 0:x.value)!==n||!e.parent&&!o){u.push(e);const o={node:P,location:T,nextLevelTypeActivated:null,withParentNode:null===(k=null===(w=e.parent)||void 0===w?void 0:w.activatedOn)||void 0===k?void 0:k.value.node,skipped:null!==(E=(null===(O=null===(S=e.parent)||void 0===S?void 0:S.activatedOn)||void 0===O?void 0:O.value.skipped)||(null==a?void 0:a(P,m,{location:f,rawLocation:j,resolve:A,rawNode:t})))&&void 0!==E&&E};e.activatedOn=(0,i.pushStack)(e.activatedOn,o);let c=e.parent;for(;c;)c.activatedOn.value.nextLevelTypeActivated=(0,i.pushStack)(c.activatedOn.value.nextLevelTypeActivated,n),c=c.parent;o.skipped||(s=!0,R.add(e),N(r,P,t,e,l,p))}}if(s||!o)if(p[n.name]=p[n.name]||new Set,p[n.name].add(P),Array.isArray(P)){const t=n.items;if(void 0!==t)for(let n=0;n!i.includes(e)))):n.extensionsPrefix&&i.push(...Object.keys(P).filter((e=>e.startsWith(n.extensionsPrefix)))),(0,r.isRef)(t)&&i.push(...Object.keys(t).filter((e=>"$ref"!==e&&!i.includes(e))));for(const o of i){let i=P[o],s=T;void 0===i&&(i=t[o],s=f);let l=n.properties[o];void 0===l&&(l=n.additionalProperties),"function"==typeof l&&(l=l(i,o)),void 0===l&&n.extensionsPrefix&&o.startsWith(n.extensionsPrefix)&&(l=a.SpecExtension),!(0,a.isNamedType)(l)&&(null==l?void 0:l.directResolveAs)&&(l=l.directResolveAs,i={$ref:i}),l&&void 0===l.name&&!1!==l.resolvable&&(l={name:"scalar",properties:{}}),(0,a.isNamedType)(l)&&("scalar"!==l.name||(0,r.isRef)(i))&&e(i,l,s.child([o]),P,o)}}const h=l.any.leave,I=((null===(_=l[n.name])||void 0===_?void 0:_.leave)||[]).concat(h);for(const e of u.reverse())if(e.isSkippedLevel)e.seen.delete(P);else if(e.activatedOn=(0,i.popStack)(e.activatedOn),e.parent){let t=e.parent;for(;t;)t.activatedOn.value.nextLevelTypeActivated=(0,i.popStack)(t.activatedOn.value.nextLevelTypeActivated),t=t.parent}for(const{context:e,visit:n,ruleId:r,severity:i}of I)!e.isSkippedLevel&&R.has(e)&&N(n,P,t,e,r,i)}if(C=f,(0,r.isRef)(t)){const e=l.ref.leave;for(const{visit:r,ruleId:i,severity:o,context:a}of e)R.has(a)&&r(t,{report:$.bind(void 0,i,o),resolve:A,rawNode:t,rawLocation:j,location:f,type:n,parent:h,key:m,parentLocations:{},oasVersion:u.oasVersion,getVisitorData:L.bind(void 0,i)},{node:P,location:T,error:I})}function N(e,t,r,i,o,a){e(t,{report:$.bind(void 0,o,a),resolve:A,rawNode:r,location:C,rawLocation:j,type:n,parent:h,key:m,parentLocations:s(i),oasVersion:u.oasVersion,ignoreNextVisitorsOnNode:()=>{d.add(C.pointer)},getVisitorData:L.bind(void 0,o)},function(e){var t;const n={};for(;e.parent;)n[e.parent.type.name]=null===(t=e.parent.activatedOn)||void 0===t?void 0:t.value.node,e=e.parent;return n}(i),i)}function $(e,t,n){const r=(n.location?Array.isArray(n.location)?n.location:[n.location]:[Object.assign(Object.assign({},C),{reportOnKey:!1})]).map((e=>Object.assign(Object.assign(Object.assign({},C),{reportOnKey:!1}),e))),i=n.forceSeverity||t;"off"!==i&&u.problems.push(Object.assign(Object.assign({ruleId:n.ruleId||e,severity:i},n),{suggest:n.suggest||[],location:r}))}function L(e){return u.visitorsData[e]=u.visitorsData[e]||{},u.visitorsData[e]}}(t.parsed,n,new r.Location(t.source,"#/"),void 0,"")}},1431:function(e,t,n){var r=n(8505);e.exports=function(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),g(function(e){return e.split("\\\\").join(i).split("\\{").join(o).split("\\}").join(a).split("\\,").join(s).split("\\.").join(l)}(e),!0).map(u)):[]};var i="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",s="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function u(e){return e.split(i).join("\\").split(o).join("{").split(a).join("}").split(s).join(",").split(l).join(".")}function p(e){if(!e)return[""];var t=[],n=r("{","}",e);if(!n)return e.split(",");var i=n.pre,o=n.body,a=n.post,s=i.split(",");s[s.length-1]+="{"+o+"}";var l=p(a);return a.length&&(s[s.length-1]+=l.shift(),s.push.apply(s,l)),t.push.apply(t,s),t}function d(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function h(e,t){return e<=t}function m(e,t){return e>=t}function g(e,t){var n=[],i=r("{","}",e);if(!i)return[e];var o=i.pre,s=i.post.length?g(i.post,!1):[""];if(/\$$/.test(i.pre))for(var l=0;l=0;if(!w&&!k)return i.post.match(/,.*\}/)?g(e=i.pre+"{"+i.body+a+i.post):[e];if(w)y=i.body.split(/\.\./);else if(1===(y=p(i.body)).length&&1===(y=g(y[0],!1).map(d)).length)return s.map((function(e){return i.pre+y[0]+e}));if(w){var S=c(y[0]),O=c(y[1]),E=Math.max(y[0].length,y[1].length),_=3==y.length?Math.abs(c(y[2])):1,A=h;O0){var I=new Array(T+1).join("0");P=C<0?"-"+I+P.slice(1):I+P}}b.push(P)}}else{b=[];for(var R=0;R(g(t),!(!n.nocomment&&"#"===t.charAt(0))&&new v(t,n).match(e));e.exports=r;const i=n(4077);r.sep=i.sep;const o=Symbol("globstar **");r.GLOBSTAR=o;const a=n(1431),s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},l="[^/]",c=l+"*?",u=e=>e.split("").reduce(((e,t)=>(e[t]=!0,e)),{}),p=u("().*{}+?[]^$\\!"),d=u("[.("),f=/\/+/;r.filter=(e,t={})=>(n,i,o)=>r(n,e,t);const h=(e,t={})=>{const n={};return Object.keys(e).forEach((t=>n[t]=e[t])),Object.keys(t).forEach((e=>n[e]=t[e])),n};r.defaults=e=>{if(!e||"object"!=typeof e||!Object.keys(e).length)return r;const t=r,n=(n,r,i)=>t(n,r,h(e,i));return(n.Minimatch=class extends t.Minimatch{constructor(t,n){super(t,h(e,n))}}).defaults=n=>t.defaults(h(e,n)).Minimatch,n.filter=(n,r)=>t.filter(n,h(e,r)),n.defaults=n=>t.defaults(h(e,n)),n.makeRe=(n,r)=>t.makeRe(n,h(e,r)),n.braceExpand=(n,r)=>t.braceExpand(n,h(e,r)),n.match=(n,r,i)=>t.match(n,r,h(e,i)),n},r.braceExpand=(e,t)=>m(e,t);const m=(e,t={})=>(g(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:a(e)),g=e=>{if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},y=Symbol("subparse");r.makeRe=(e,t)=>new v(e,t||{}).makeRe(),r.match=(e,t,n={})=>{const r=new v(t,n);return e=e.filter((e=>r.match(e))),r.options.nonull&&!e.length&&e.push(t),e};const b=e=>e.replace(/[[\]\\]/g,"\\$&");class v{constructor(e,t){g(e),t||(t={}),this.options=t,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||!1===t.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();let n=this.globSet=this.braceExpand();t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,n),n=this.globParts=n.map((e=>e.split(f))),this.debug(this.pattern,n),n=n.map(((e,t,n)=>e.map(this.parse,this))),this.debug(this.pattern,n),n=n.filter((e=>-1===e.indexOf(!1))),this.debug(this.pattern,n),this.set=n}parseNegate(){if(this.options.nonegate)return;const e=this.pattern;let t=!1,n=0;for(let r=0;r>> no match, partial?",e,d,t,f),d!==s))}if("string"==typeof u?(c=p===u,this.debug("string match",u,p,c)):(c=p.match(u),this.debug("pattern match",u,p,c)),!c)return!1}if(i===s&&a===l)return!0;if(i===s)return n;if(a===l)return i===s-1&&""===e[i];throw new Error("wtf?")}braceExpand(){return m(this.pattern,this.options)}parse(e,t){g(e);const n=this.options;if("**"===e){if(!n.noglobstar)return o;e="*"}if(""===e)return"";let r="",i=!1,a=!1;const u=[],f=[];let h,m,v,x,w=!1,k=-1,S=-1,O="."===e.charAt(0),E=n.dot||O;const _=e=>"."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",A=()=>{if(h){switch(h){case"*":r+=c,i=!0;break;case"?":r+=l,i=!0;break;default:r+="\\"+h}this.debug("clearStateChar %j %j",h,r),h=!1}};for(let t,o=0;o(n||(n="\\"),t+t+n+"|"))),this.debug("tail=%j\n %s",e,e,v,r);const t="*"===v.type?c:"?"===v.type?l:"\\"+v.type;i=!0,r=r.slice(0,v.reStart)+t+"\\("+e}A(),a&&(r+="\\\\");const j=d[r.charAt(0)];for(let e=f.length-1;e>-1;e--){const n=f[e],i=r.slice(0,n.reStart),o=r.slice(n.reStart,n.reEnd-8);let a=r.slice(n.reEnd);const s=r.slice(n.reEnd-8,n.reEnd)+a,l=i.split(")").length,c=i.split("(").length-l;let u=a;for(let e=0;ee.replace(/\\(.)/g,"$1"))(e);const C=n.nocase?"i":"";try{return Object.assign(new RegExp("^"+r+"$",C),{_glob:e,_src:r})}catch(e){return new RegExp("$.")}}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const e=this.set;if(!e.length)return this.regexp=!1,this.regexp;const t=this.options,n=t.noglobstar?c:t.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=t.nocase?"i":"";let i=e.map((e=>(e=e.map((e=>"string"==typeof e?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):e===o?o:e._src)).reduce(((e,t)=>(e[e.length-1]===o&&t===o||e.push(t),e)),[]),e.forEach(((t,r)=>{t===o&&e[r-1]!==o&&(0===r?e.length>1?e[r+1]="(?:\\/|"+n+"\\/)?"+e[r+1]:e[r]=n:r===e.length-1?e[r-1]+="(?:\\/|"+n+")?":(e[r-1]+="(?:\\/|\\/"+n+"\\/)"+e[r+1],e[r+1]=o))})),e.filter((e=>e!==o)).join("/")))).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=new RegExp(i,r)}catch(e){this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;const n=this.options;"/"!==i.sep&&(e=e.split(i.sep).join("/")),e=e.split(f),this.debug(this.pattern,"split",e);const r=this.set;let o;this.debug(this.pattern,"set",r);for(let t=e.length-1;t>=0&&(o=e[t],!o);t--);for(let i=0;i=0&&c>0){if(e===t)return[l,c];for(r=[],o=n.length;u>=0&&!s;)u==l?(r.push(u),l=n.indexOf(e,u+1)):1==r.length?s=[r.pop(),c]:((i=r.pop())=0?l:c;r.length&&(s=[o,a])}return s}e.exports=t,t.range=r},3998:function(e,t,n){"use strict";var r=n(1137);e.exports=function(e,t){return e?void t.then((function(t){r((function(){e(null,t)}))}),(function(t){r((function(){e(t)}))})):t}},1137:function(e){"use strict";e.exports="object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:"function"==typeof setImmediate?setImmediate:function(e){setTimeout(e,0)}},2485:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;tu;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},1344:function(e,t,n){var r=n(6885),i=n(8664),o=n(2612),a=n(3747),s=n(2998),l=[].push,c=function(e){var t=1==e,n=2==e,c=3==e,u=4==e,p=6==e,d=7==e,f=5==e||p;return function(h,m,g,y){for(var b,v,x=o(h),w=i(x),k=r(m,g,3),S=a(w.length),O=0,E=y||s,_=t?E(h,S):n||d?E(h,0):void 0;S>O;O++)if((f||O in w)&&(v=k(b=w[O],O,x),e))if(t)_[O]=v;else if(v)switch(e){case 3:return!0;case 5:return b;case 6:return O;case 2:l.call(_,b)}else switch(e){case 4:return!1;case 7:l.call(_,b)}return p?-1:c||u?u:_}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},5634:function(e,t,n){var r=n(2074),i=n(1602),o=n(6845),a=i("species");e.exports=function(e){return o>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},2998:function(e,t,n){var r=n(5335),i=n(8679),o=n(1602)("species");e.exports=function(e,t){var n;return i(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},8569:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},3062:function(e,t,n){var r=n(3129),i=n(8569),o=n(1602)("toStringTag"),a="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:a?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},4361:function(e,t,n){var r=n(1883),i=n(5816),o=n(7632),a=n(3610);e.exports=function(e,t){for(var n=i(t),s=a.f,l=o.f,c=0;c=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=r[1]),e.exports=i&&+i},290:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},1605:function(e,t,n){var r=n(200),i=n(7632).f,o=n(7712),a=n(7485),s=n(5975),l=n(4361),c=n(4977);e.exports=function(e,t){var n,u,p,d,f,h=e.target,m=e.global,g=e.stat;if(n=m?r:g?r[h]||s(h,{}):(r[h]||{}).prototype)for(u in t){if(d=t[u],p=e.noTargetGet?(f=i(n,u))&&f.value:n[u],!c(m?u:h+(g?".":"#")+u,e.forced)&&void 0!==p){if(typeof d==typeof p)continue;l(d,p)}(e.sham||p&&p.sham)&&o(d,"sham",!0),a(n,u,d,e)}}},2074:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},6885:function(e,t,n){var r=n(9085);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},6492:function(e,t,n){var r=n(9720),i=n(200),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e])||o(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}},200:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},1883:function(e,t,n){var r=n(2612),i={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return i.call(r(e),t)}},7708:function(e){e.exports={}},8890:function(e,t,n){var r=n(6492);e.exports=r("document","documentElement")},7694:function(e,t,n){var r=n(5077),i=n(2074),o=n(3262);e.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},8664:function(e,t,n){var r=n(2074),i=n(8569),o="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?o.call(e,""):Object(e)}:Object},9965:function(e,t,n){var r=n(9310),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource},9206:function(e,t,n){var r,i,o,a=n(2886),s=n(200),l=n(5335),c=n(7712),u=n(1883),p=n(9310),d=n(5904),f=n(7708),h="Object already initialized",m=s.WeakMap;if(a||p.state){var g=p.state||(p.state=new m),y=g.get,b=g.has,v=g.set;r=function(e,t){if(b.call(g,e))throw new TypeError(h);return t.facade=e,v.call(g,e,t),t},i=function(e){return y.call(g,e)||{}},o=function(e){return b.call(g,e)}}else{var x=d("state");f[x]=!0,r=function(e,t){if(u(e,x))throw new TypeError(h);return t.facade=e,c(e,x,t),t},i=function(e){return u(e,x)?e[x]:{}},o=function(e){return u(e,x)}}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},8679:function(e,t,n){var r=n(8569);e.exports=Array.isArray||function(e){return"Array"==r(e)}},4977:function(e,t,n){var r=n(2074),i=/#|\.prototype\./,o=function(e,t){var n=s[a(e)];return n==c||n!=l&&("function"==typeof t?r(t):!!t)},a=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},s=o.data={},l=o.NATIVE="N",c=o.POLYFILL="P";e.exports=o},5335:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},6926:function(e){e.exports=!1},1849:function(e,t,n){var r=n(6845),i=n(2074);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},2886:function(e,t,n){var r=n(200),i=n(9965),o=r.WeakMap;e.exports="function"==typeof o&&/native code/.test(i(o))},3105:function(e,t,n){var r,i=n(3938),o=n(5318),a=n(290),s=n(7708),l=n(8890),c=n(3262),u=n(5904),p="prototype",d="script",f=u("IE_PROTO"),h=function(){},m=function(e){return"<"+d+">"+e+""},g=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t,n;g=r?function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):(t=c("iframe"),n="java"+d+":",t.style.display="none",l.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F);for(var i=a.length;i--;)delete g[p][a[i]];return g()};s[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[p]=i(e),n=new h,h[p]=null,n[f]=e):n=g(),void 0===t?n:o(n,t)}},5318:function(e,t,n){var r=n(5077),i=n(3610),o=n(3938),a=n(1641);e.exports=r?Object.defineProperties:function(e,t){o(e);for(var n,r=a(t),s=r.length,l=0;s>l;)i.f(e,n=r[l++],t[n]);return e}},3610:function(e,t,n){var r=n(5077),i=n(7694),o=n(3938),a=n(874),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(o(e),t=a(t,!0),o(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},7632:function(e,t,n){var r=n(5077),i=n(9304),o=n(6843),a=n(5476),s=n(874),l=n(1883),c=n(7694),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=a(e),t=s(t,!0),c)try{return u(e,t)}catch(e){}if(l(e,t))return o(!i.f.call(e,t),e[t])}},6509:function(e,t,n){var r=n(5476),i=n(4789).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},4789:function(e,t,n){var r=n(6347),i=n(290).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},8916:function(e,t){t.f=Object.getOwnPropertySymbols},6347:function(e,t,n){var r=n(1883),i=n(5476),o=n(8186).indexOf,a=n(7708);e.exports=function(e,t){var n,s=i(e),l=0,c=[];for(n in s)!r(a,n)&&r(s,n)&&c.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~o(c,n)||c.push(n));return c}},1641:function(e,t,n){var r=n(6347),i=n(290);e.exports=Object.keys||function(e){return r(e,i)}},9304:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},4972:function(e,t,n){"use strict";var r=n(3129),i=n(3062);e.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},5816:function(e,t,n){var r=n(6492),i=n(4789),o=n(8916),a=n(3938);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(a(e)),n=o.f;return n?t.concat(n(e)):t}},9720:function(e,t,n){var r=n(200);e.exports=r},7485:function(e,t,n){var r=n(200),i=n(7712),o=n(1883),a=n(5975),s=n(9965),l=n(9206),c=l.get,u=l.enforce,p=String(String).split("String");(e.exports=function(e,t,n,s){var l,c=!!s&&!!s.unsafe,d=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||o(n,"name")||i(n,"name",t),(l=u(n)).source||(l.source=p.join("string"==typeof t?t:""))),e!==r?(c?!f&&e[t]&&(d=!0):delete e[t],d?e[t]=n:i(e,t,n)):d?e[t]=n:a(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},1229:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},5975:function(e,t,n){var r=n(200),i=n(7712);e.exports=function(e,t){try{i(r,e,t)}catch(n){r[e]=t}return t}},5282:function(e,t,n){var r=n(3610).f,i=n(1883),o=n(1602)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},5904:function(e,t,n){var r=n(2),i=n(665),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},9310:function(e,t,n){var r=n(200),i=n(5975),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a},2:function(e,t,n){var r=n(6926),i=n(9310);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.14.0",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6539:function(e,t,n){var r=n(7317),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},5476:function(e,t,n){var r=n(8664),i=n(1229);e.exports=function(e){return r(i(e))}},7317:function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},3747:function(e,t,n){var r=n(7317),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},2612:function(e,t,n){var r=n(1229);e.exports=function(e){return Object(r(e))}},874:function(e,t,n){var r=n(5335);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},3129:function(e,t,n){var r={};r[n(1602)("toStringTag")]="z",e.exports="[object z]"===String(r)},665:function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}},5225:function(e,t,n){var r=n(1849);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},802:function(e,t,n){var r=n(1602);t.f=r},1602:function(e,t,n){var r=n(200),i=n(2),o=n(1883),a=n(665),s=n(1849),l=n(5225),c=i("wks"),u=r.Symbol,p=l?u:u&&u.withoutSetter||a;e.exports=function(e){return o(c,e)&&(s||"string"==typeof c[e])||(s&&o(u,e)?c[e]=u[e]:c[e]=p("Symbol."+e)),c[e]}},115:function(e,t,n){"use strict";var r=n(1605),i=n(2074),o=n(8679),a=n(5335),s=n(2612),l=n(3747),c=n(2057),u=n(2998),p=n(5634),d=n(1602),f=n(6845),h=d("isConcatSpreadable"),m=9007199254740991,g="Maximum allowed index exceeded",y=f>=51||!i((function(){var e=[];return e[h]=!1,e.concat()[0]!==e})),b=p("concat"),v=function(e){if(!a(e))return!1;var t=e[h];return void 0!==t?!!t:o(e)};r({target:"Array",proto:!0,forced:!y||!b},{concat:function(e){var t,n,r,i,o,a=s(this),p=u(a,0),d=0;for(t=-1,r=arguments.length;tm)throw TypeError(g);for(n=0;n=m)throw TypeError(g);c(p,d++,o)}return p.length=d,p}})},1586:function(e,t,n){var r=n(200);n(5282)(r.JSON,"JSON",!0)},6982:function(e,t,n){n(5282)(Math,"Math",!0)},5086:function(e,t,n){var r=n(3129),i=n(7485),o=n(4972);r||i(Object.prototype,"toString",o,{unsafe:!0})},3719:function(e,t,n){var r=n(1605),i=n(200),o=n(5282);r({global:!0},{Reflect:{}}),o(i.Reflect,"Reflect",!0)},7727:function(e,t,n){n(1272)("asyncIterator")},590:function(e,t,n){"use strict";var r=n(1605),i=n(5077),o=n(200),a=n(1883),s=n(5335),l=n(3610).f,c=n(4361),u=o.Symbol;if(i&&"function"==typeof u&&(!("description"in u.prototype)||void 0!==u().description)){var p={},d=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof d?new u(e):void 0===e?u():u(e);return""===e&&(p[t]=!0),t};c(d,u);var f=d.prototype=u.prototype;f.constructor=d;var h=f.toString,m="Symbol(test)"==String(u("test")),g=/^Symbol\((.*)\)[^)]+$/;l(f,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=h.call(e);if(a(p,e))return"";var n=m?t.slice(7,-1):t.replace(g,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:d})}},8290:function(e,t,n){n(1272)("hasInstance")},2619:function(e,t,n){n(1272)("isConcatSpreadable")},4216:function(e,t,n){n(1272)("iterator")},3534:function(e,t,n){"use strict";var r=n(1605),i=n(200),o=n(6492),a=n(6926),s=n(5077),l=n(1849),c=n(5225),u=n(2074),p=n(1883),d=n(8679),f=n(5335),h=n(3938),m=n(2612),g=n(5476),y=n(874),b=n(6843),v=n(3105),x=n(1641),w=n(4789),k=n(6509),S=n(8916),O=n(7632),E=n(3610),_=n(9304),A=n(7712),j=n(7485),C=n(2),P=n(5904),T=n(7708),I=n(665),R=n(1602),N=n(802),$=n(1272),L=n(5282),D=n(9206),M=n(1344).forEach,F=P("hidden"),z="Symbol",U="prototype",B=R("toPrimitive"),q=D.set,V=D.getterFor(z),W=Object[U],H=i.Symbol,Y=o("JSON","stringify"),G=O.f,Q=E.f,X=k.f,K=_.f,Z=C("symbols"),J=C("op-symbols"),ee=C("string-to-symbol-registry"),te=C("symbol-to-string-registry"),ne=C("wks"),re=i.QObject,ie=!re||!re[U]||!re[U].findChild,oe=s&&u((function(){return 7!=v(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=G(W,t);r&&delete W[t],Q(e,t,n),r&&e!==W&&Q(W,t,r)}:Q,ae=function(e,t){var n=Z[e]=v(H[U]);return q(n,{type:z,tag:e,description:t}),s||(n.description=t),n},se=c?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof H},le=function(e,t,n){e===W&&le(J,t,n),h(e);var r=y(t,!0);return h(n),p(Z,r)?(n.enumerable?(p(e,F)&&e[F][r]&&(e[F][r]=!1),n=v(n,{enumerable:b(0,!1)})):(p(e,F)||Q(e,F,b(1,{})),e[F][r]=!0),oe(e,r,n)):Q(e,r,n)},ce=function(e,t){h(e);var n=g(t),r=x(n).concat(fe(n));return M(r,(function(t){s&&!ue.call(n,t)||le(e,t,n[t])})),e},ue=function(e){var t=y(e,!0),n=K.call(this,t);return!(this===W&&p(Z,t)&&!p(J,t))&&(!(n||!p(this,t)||!p(Z,t)||p(this,F)&&this[F][t])||n)},pe=function(e,t){var n=g(e),r=y(t,!0);if(n!==W||!p(Z,r)||p(J,r)){var i=G(n,r);return!i||!p(Z,r)||p(n,F)&&n[F][r]||(i.enumerable=!0),i}},de=function(e){var t=X(g(e)),n=[];return M(t,(function(e){p(Z,e)||p(T,e)||n.push(e)})),n},fe=function(e){var t=e===W,n=X(t?J:g(e)),r=[];return M(n,(function(e){!p(Z,e)||t&&!p(W,e)||r.push(Z[e])})),r};l||(H=function(){if(this instanceof H)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=I(e),n=function(e){this===W&&n.call(J,e),p(this,F)&&p(this[F],t)&&(this[F][t]=!1),oe(this,t,b(1,e))};return s&&ie&&oe(W,t,{configurable:!0,set:n}),ae(t,e)},j(H[U],"toString",(function(){return V(this).tag})),j(H,"withoutSetter",(function(e){return ae(I(e),e)})),_.f=ue,E.f=le,O.f=pe,w.f=k.f=de,S.f=fe,N.f=function(e){return ae(R(e),e)},s&&(Q(H[U],"description",{configurable:!0,get:function(){return V(this).description}}),a||j(W,"propertyIsEnumerable",ue,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:H}),M(x(ne),(function(e){$(e)})),r({target:z,stat:!0,forced:!l},{for:function(e){var t=String(e);if(p(ee,t))return ee[t];var n=H(t);return ee[t]=n,te[n]=t,n},keyFor:function(e){if(!se(e))throw TypeError(e+" is not a symbol");if(p(te,e))return te[e]},useSetter:function(){ie=!0},useSimple:function(){ie=!1}}),r({target:"Object",stat:!0,forced:!l,sham:!s},{create:function(e,t){return void 0===t?v(e):ce(v(e),t)},defineProperty:le,defineProperties:ce,getOwnPropertyDescriptor:pe}),r({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:de,getOwnPropertySymbols:fe}),r({target:"Object",stat:!0,forced:u((function(){S.f(1)}))},{getOwnPropertySymbols:function(e){return S.f(m(e))}}),Y&&r({target:"JSON",stat:!0,forced:!l||u((function(){var e=H();return"[null]"!=Y([e])||"{}"!=Y({a:e})||"{}"!=Y(Object(e))}))},{stringify:function(e,t,n){for(var r,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(r=t,(f(t)||void 0!==e)&&!se(e))return d(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!se(t))return t}),i[1]=t,Y.apply(null,i)}}),H[U][B]||A(H[U],B,H[U].valueOf),L(H,z),T[F]=!0},6195:function(e,t,n){n(1272)("matchAll")},2957:function(e,t,n){n(1272)("match")},4100:function(e,t,n){n(1272)("replace")},3006:function(e,t,n){n(1272)("search")},4910:function(e,t,n){n(1272)("species")},2820:function(e,t,n){n(1272)("split")},6611:function(e,t,n){n(1272)("toPrimitive")},9576:function(e,t,n){n(1272)("toStringTag")},9747:function(e,t,n){n(1272)("unscopables")},8997:function(e,t,n){"use strict";var r=n(4991),i=n.n(r),o=n(6314),a=n.n(o)()(i());a.push([e.id,".ps{overflow:hidden!important;overflow-anchor:none;-ms-overflow-style:none;touch-action:auto;-ms-touch-action:auto}.ps__rail-x{display:none;opacity:0;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;height:15px;bottom:0;position:absolute}.ps__rail-y{display:none;opacity:0;transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color .2s linear,opacity .2s linear;width:15px;right:0;position:absolute}.ps--active-x>.ps__rail-x,.ps--active-y>.ps__rail-y{display:block;background-color:transparent}.ps:hover>.ps__rail-x,.ps:hover>.ps__rail-y,.ps--focus>.ps__rail-x,.ps--focus>.ps__rail-y,.ps--scrolling-x>.ps__rail-x,.ps--scrolling-y>.ps__rail-y{opacity:.6}.ps .ps__rail-x:hover,.ps .ps__rail-y:hover,.ps .ps__rail-x:focus,.ps .ps__rail-y:focus,.ps .ps__rail-x.ps--clicking,.ps .ps__rail-y.ps--clicking{background-color:#eee;opacity:.9}.ps__thumb-x{background-color:#aaa;border-radius:6px;transition:background-color .2s linear,height .2s ease-in-out;-webkit-transition:background-color .2s linear,height .2s ease-in-out;height:6px;bottom:2px;position:absolute}.ps__thumb-y{background-color:#aaa;border-radius:6px;transition:background-color .2s linear,width .2s ease-in-out;-webkit-transition:background-color .2s linear,width .2s ease-in-out;width:6px;right:2px;position:absolute}.ps__rail-x:hover>.ps__thumb-x,.ps__rail-x:focus>.ps__thumb-x,.ps__rail-x.ps--clicking .ps__thumb-x{background-color:#999;height:11px}.ps__rail-y:hover>.ps__thumb-y,.ps__rail-y:focus>.ps__thumb-y,.ps__rail-y.ps--clicking .ps__thumb-y{background-color:#999;width:11px}@supports (-ms-overflow-style: none){.ps{overflow:auto!important}}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){.ps{overflow:auto!important}}\n","",{version:3,sources:["webpack://./node_modules/perfect-scrollbar/css/perfect-scrollbar.css"],names:[],mappings:"AAGA,IACE,yBAAA,CACA,oBAAA,CACA,uBAAA,CACA,iBAAA,CACA,qBAAA,CAMF,YACE,YAAA,CACA,SAAA,CACA,yDAAA,CACA,iEAAA,CACA,WAAA,CAEA,QAAA,CAEA,iBAAA,CAGF,YACE,YAAA,CACA,SAAA,CACA,yDAAA,CACA,iEAAA,CACA,UAAA,CAEA,OAAA,CAEA,iBAAA,CAGF,oDAEE,aAAA,CACA,4BAAA,CAGF,oJAME,UAAA,CAGF,kJAME,qBAAA,CACA,UAAA,CAMF,aACE,qBAAA,CAnEF,iBAAA,CAqEE,6DAAA,CACA,qEAAA,CACA,UAAA,CAEA,UAAA,CAEA,iBAAA,CAGF,aACE,qBAAA,CA/EF,iBAAA,CAiFE,4DAAA,CACA,oEAAA,CACA,SAAA,CAEA,SAAA,CAEA,iBAAA,CAGF,oGAGE,qBAAA,CACA,WAAA,CAGF,oGAGE,qBAAA,CACA,UAAA,CAIF,qCACE,IACE,uBAAA,CAAA,CAIJ,wEACE,IACE,uBAAA,CAAA",sourcesContent:["/*\n * Container style\n */\n.ps {\n overflow: hidden !important;\n overflow-anchor: none;\n -ms-overflow-style: none;\n touch-action: auto;\n -ms-touch-action: auto;\n}\n\n/*\n * Scrollbar rail styles\n */\n.ps__rail-x {\n display: none;\n opacity: 0;\n transition: background-color .2s linear, opacity .2s linear;\n -webkit-transition: background-color .2s linear, opacity .2s linear;\n height: 15px;\n /* there must be 'bottom' or 'top' for ps__rail-x */\n bottom: 0px;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps__rail-y {\n display: none;\n opacity: 0;\n transition: background-color .2s linear, opacity .2s linear;\n -webkit-transition: background-color .2s linear, opacity .2s linear;\n width: 15px;\n /* there must be 'right' or 'left' for ps__rail-y */\n right: 0;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps--active-x > .ps__rail-x,\n.ps--active-y > .ps__rail-y {\n display: block;\n background-color: transparent;\n}\n\n.ps:hover > .ps__rail-x,\n.ps:hover > .ps__rail-y,\n.ps--focus > .ps__rail-x,\n.ps--focus > .ps__rail-y,\n.ps--scrolling-x > .ps__rail-x,\n.ps--scrolling-y > .ps__rail-y {\n opacity: 0.6;\n}\n\n.ps .ps__rail-x:hover,\n.ps .ps__rail-y:hover,\n.ps .ps__rail-x:focus,\n.ps .ps__rail-y:focus,\n.ps .ps__rail-x.ps--clicking,\n.ps .ps__rail-y.ps--clicking {\n background-color: #eee;\n opacity: 0.9;\n}\n\n/*\n * Scrollbar thumb styles\n */\n.ps__thumb-x {\n background-color: #aaa;\n border-radius: 6px;\n transition: background-color .2s linear, height .2s ease-in-out;\n -webkit-transition: background-color .2s linear, height .2s ease-in-out;\n height: 6px;\n /* there must be 'bottom' for ps__thumb-x */\n bottom: 2px;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps__thumb-y {\n background-color: #aaa;\n border-radius: 6px;\n transition: background-color .2s linear, width .2s ease-in-out;\n -webkit-transition: background-color .2s linear, width .2s ease-in-out;\n width: 6px;\n /* there must be 'right' for ps__thumb-y */\n right: 2px;\n /* please don't change 'position' */\n position: absolute;\n}\n\n.ps__rail-x:hover > .ps__thumb-x,\n.ps__rail-x:focus > .ps__thumb-x,\n.ps__rail-x.ps--clicking .ps__thumb-x {\n background-color: #999;\n height: 11px;\n}\n\n.ps__rail-y:hover > .ps__thumb-y,\n.ps__rail-y:focus > .ps__thumb-y,\n.ps__rail-y.ps--clicking .ps__thumb-y {\n background-color: #999;\n width: 11px;\n}\n\n/* MS supports */\n@supports (-ms-overflow-style: none) {\n .ps {\n overflow: auto !important;\n }\n}\n\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n .ps {\n overflow: auto !important;\n }\n}\n"],sourceRoot:""}]),t.A=a},6314:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n2?r:e).apply(void 0,i)}}e.memoize=a,e.debounce=s,e.bind=l,e.default={memoize:a,debounce:s,bind:l}},void 0===(r=n.apply(t,[t]))||(e.exports=r)},2838:function(e){e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:a,create:s}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),a||(a=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=O(Array.prototype.forEach),p=O(Array.prototype.pop),d=O(Array.prototype.push),f=O(String.prototype.toLowerCase),h=O(String.prototype.toString),m=O(String.prototype.match),g=O(String.prototype.replace),y=O(String.prototype.indexOf),b=O(String.prototype.trim),v=O(Object.prototype.hasOwnProperty),x=O(RegExp.prototype.test),w=(S=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function _(e){for(let t=0;t/gm),B=a(/\${[\w\W]*}/gm),q=a(/^data-[\-\w.\u00B7-\uFFFF]/),V=a(/^aria-[\-\w]+$/),W=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H=a(/^(?:\w+script|data):/i),Y=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),G=a(/^html$/i),Q=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var X=Object.freeze({__proto__:null,MUSTACHE_EXPR:z,ERB_EXPR:U,TMPLIT_EXPR:B,DATA_ATTR:q,ARIA_ATTR:V,IS_ALLOWED_URI:W,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:Y,DOCTYPE_NAME:G,CUSTOM_ELEMENT:Q});const K=1,Z=3,J=7,ee=8,te=9,ne=function(){return"undefined"==typeof window?null:window};return function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ne();const r=e=>t(e);if(r.version="3.1.3",r.removed=[],!n||!n.document||n.document.nodeType!==te)return r.isSupported=!1,r;let{document:i}=n;const a=i,l=a.currentScript,{DocumentFragment:c,HTMLTemplateElement:S,Node:O,Element:_,NodeFilter:z,NamedNodeMap:U=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:B,DOMParser:q,trustedTypes:V}=n,H=_.prototype,Y=j(H,"cloneNode"),Q=j(H,"nextSibling"),re=j(H,"childNodes"),ie=j(H,"parentNode");if("function"==typeof S){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let oe,ae="";const{implementation:se,createNodeIterator:le,createDocumentFragment:ce,getElementsByTagName:ue}=i,{importNode:pe}=a;let de={};r.isSupported="function"==typeof e&&"function"==typeof ie&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:fe,ERB_EXPR:he,TMPLIT_EXPR:me,DATA_ATTR:ge,ARIA_ATTR:ye,IS_SCRIPT_OR_DATA:be,ATTR_WHITESPACE:ve,CUSTOM_ELEMENT:xe}=X;let{IS_ALLOWED_URI:we}=X,ke=null;const Se=E({},[...C,...P,...T,...R,...$]);let Oe=null;const Ee=E({},[...L,...D,...M,...F]);let _e=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,je=null,Ce=!0,Pe=!0,Te=!1,Ie=!0,Re=!1,Ne=!0,$e=!1,Le=!1,De=!1,Me=!1,Fe=!1,ze=!1,Ue=!0,Be=!1,qe=!0,Ve=!1,We={},He=null;const Ye=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Qe=E({},["audio","video","img","source","image","track"]);let Xe=null;const Ke=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ze="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml";let tt=et,nt=!1,rt=null;const it=E({},[Ze,Je,et],h);let ot=null;const at=["application/xhtml+xml","text/html"];let st=null,lt=null;const ct=i.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!lt||lt!==e){if(e&&"object"==typeof e||(e={}),e=A(e),ot=-1===at.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,st="application/xhtml+xml"===ot?h:f,ke=v(e,"ALLOWED_TAGS")?E({},e.ALLOWED_TAGS,st):Se,Oe=v(e,"ALLOWED_ATTR")?E({},e.ALLOWED_ATTR,st):Ee,rt=v(e,"ALLOWED_NAMESPACES")?E({},e.ALLOWED_NAMESPACES,h):it,Xe=v(e,"ADD_URI_SAFE_ATTR")?E(A(Ke),e.ADD_URI_SAFE_ATTR,st):Ke,Ge=v(e,"ADD_DATA_URI_TAGS")?E(A(Qe),e.ADD_DATA_URI_TAGS,st):Qe,He=v(e,"FORBID_CONTENTS")?E({},e.FORBID_CONTENTS,st):Ye,Ae=v(e,"FORBID_TAGS")?E({},e.FORBID_TAGS,st):{},je=v(e,"FORBID_ATTR")?E({},e.FORBID_ATTR,st):{},We=!!v(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,Pe=!1!==e.ALLOW_DATA_ATTR,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Re=e.SAFE_FOR_TEMPLATES||!1,Ne=!1!==e.SAFE_FOR_XML,$e=e.WHOLE_DOCUMENT||!1,Me=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,Ue=!1!==e.SANITIZE_DOM,Be=e.SANITIZE_NAMED_PROPS||!1,qe=!1!==e.KEEP_CONTENT,Ve=e.IN_PLACE||!1,we=e.ALLOWED_URI_REGEXP||W,tt=e.NAMESPACE||et,_e=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(_e.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(_e.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(_e.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Re&&(Pe=!1),Fe&&(Me=!0),We&&(ke=E({},$),Oe=[],!0===We.html&&(E(ke,C),E(Oe,L)),!0===We.svg&&(E(ke,P),E(Oe,D),E(Oe,F)),!0===We.svgFilters&&(E(ke,T),E(Oe,D),E(Oe,F)),!0===We.mathMl&&(E(ke,R),E(Oe,M),E(Oe,F))),e.ADD_TAGS&&(ke===Se&&(ke=A(ke)),E(ke,e.ADD_TAGS,st)),e.ADD_ATTR&&(Oe===Ee&&(Oe=A(Oe)),E(Oe,e.ADD_ATTR,st)),e.ADD_URI_SAFE_ATTR&&E(Xe,e.ADD_URI_SAFE_ATTR,st),e.FORBID_CONTENTS&&(He===Ye&&(He=A(He)),E(He,e.FORBID_CONTENTS,st)),qe&&(ke["#text"]=!0),$e&&E(ke,["html","head","body"]),ke.table&&(E(ke,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');oe=e.TRUSTED_TYPES_POLICY,ae=oe.createHTML("")}else void 0===oe&&(oe=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(V,l)),null!==oe&&"string"==typeof ae&&(ae=oe.createHTML(""));o&&o(e),lt=e}},dt=E({},["mi","mo","mn","ms","mtext"]),ft=E({},["foreignobject","annotation-xml"]),ht=E({},["title","style","font","a","script"]),mt=E({},[...P,...T,...I]),gt=E({},[...R,...N]),yt=function(e){d(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},bt=function(e,t){try{d(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){d(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Oe[e])if(Me||Fe)try{yt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){let t=null,n=null;if(De)e=""+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ot&&tt===et&&(e=''+e+"");const r=oe?oe.createHTML(e):e;if(tt===et)try{t=(new q).parseFromString(r,ot)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?ae:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),tt===et?ue.call(t,$e?"html":"body")[0]:$e?t.documentElement:o},xt=function(e){return le.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},wt=function(e){return e instanceof B&&(void 0!==e.__depth&&"number"!=typeof e.__depth||void 0!==e.__removalCount&&"number"!=typeof e.__removalCount||"string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof U)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},kt=function(e){return"function"==typeof O&&e instanceof O},St=function(e,t,n){de[e]&&u(de[e],(e=>{e.call(r,t,n,lt)}))},Ot=function(e){let t=null;if(St("beforeSanitizeElements",e,null),wt(e))return yt(e),!0;const n=st(e.nodeName);if(St("uponSanitizeElement",e,{tagName:n,allowedTags:ke}),e.hasChildNodes()&&!kt(e.firstElementChild)&&x(/<[/\w]/g,e.innerHTML)&&x(/<[/\w]/g,e.textContent))return yt(e),!0;if(e.nodeType===J)return yt(e),!0;if(Ne&&e.nodeType===ee&&x(/<[/\w]/g,e.data))return yt(e),!0;if(!ke[n]||Ae[n]){if(!Ae[n]&&_t(n)){if(_e.tagNameCheck instanceof RegExp&&x(_e.tagNameCheck,n))return!1;if(_e.tagNameCheck instanceof Function&&_e.tagNameCheck(n))return!1}if(qe&&!He[n]){const t=ie(e)||e.parentNode,n=re(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const i=Y(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,Q(e))}}return yt(e),!0}return e instanceof _&&!function(e){let t=ie(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!rt[e.namespaceURI]&&(e.namespaceURI===Je?t.namespaceURI===et?"svg"===n:t.namespaceURI===Ze?"svg"===n&&("annotation-xml"===r||dt[r]):Boolean(mt[n]):e.namespaceURI===Ze?t.namespaceURI===et?"math"===n:t.namespaceURI===Je?"math"===n&&ft[r]:Boolean(gt[n]):e.namespaceURI===et?!(t.namespaceURI===Je&&!ft[r])&&!(t.namespaceURI===Ze&&!dt[r])&&!gt[n]&&(ht[n]||!mt[n]):!("application/xhtml+xml"!==ot||!rt[e.namespaceURI]))}(e)?(yt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!x(/<\/no(script|embed|frames)/i,e.innerHTML)?(Re&&e.nodeType===Z&&(t=e.textContent,u([fe,he,me],(e=>{t=g(t,e," ")})),e.textContent!==t&&(d(r.removed,{element:e.cloneNode()}),e.textContent=t)),St("afterSanitizeElements",e,null),!1):(yt(e),!0)},Et=function(e,t,n){if(Ue&&("id"===t||"name"===t)&&(n in i||n in ct||"__depth"===n||"__removalCount"===n))return!1;if(Pe&&!je[t]&&x(ge,t));else if(Ce&&x(ye,t));else if(!Oe[t]||je[t]){if(!(_t(e)&&(_e.tagNameCheck instanceof RegExp&&x(_e.tagNameCheck,e)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(e))&&(_e.attributeNameCheck instanceof RegExp&&x(_e.attributeNameCheck,t)||_e.attributeNameCheck instanceof Function&&_e.attributeNameCheck(t))||"is"===t&&_e.allowCustomizedBuiltInElements&&(_e.tagNameCheck instanceof RegExp&&x(_e.tagNameCheck,n)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(n))))return!1}else if(Xe[t]);else if(x(we,g(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Ge[e])if(Te&&!x(be,g(n,ve,"")));else if(n)return!1;return!0},_t=function(e){return"annotation-xml"!==e&&m(e,xe)},At=function(e){St("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe};let i=t.length;for(;i--;){const o=t[i],{name:a,namespaceURI:s,value:l}=o,c=st(a);let d="value"===a?l:b(l);if(n.attrName=c,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,St("uponSanitizeAttribute",e,n),d=n.attrValue,n.forceKeepAttr)continue;if(bt(a,e),!n.keepAttr)continue;if(!Ie&&x(/\/>/i,d)){bt(a,e);continue}if(Ne&&x(/((--!?|])>)|<\/(style|title)/i,d)){bt(a,e);continue}Re&&u([fe,he,me],(e=>{d=g(d,e," ")}));const f=st(e.nodeName);if(Et(f,c,d)){if(!Be||"id"!==c&&"name"!==c||(bt(a,e),d="user-content-"+d),oe&&"object"==typeof V&&"function"==typeof V.getAttributeType)if(s);else switch(V.getAttributeType(f,c)){case"TrustedHTML":d=oe.createHTML(d);break;case"TrustedScriptURL":d=oe.createScriptURL(d)}try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),wt(e)?yt(e):p(r.removed)}catch(e){}}}St("afterSanitizeAttributes",e,null)},jt=function e(t){let n=null;const r=xt(t);for(St("beforeSanitizeShadowDOM",t,null);n=r.nextNode();){if(St("uponSanitizeShadowNode",n,null),Ot(n))continue;const t=ie(n);n.nodeType===K&&(t&&t.__depth?n.__depth=(n.__removalCount||0)+t.__depth+1:n.__depth=1),(n.__depth>=255||n.__depth<0||k(n.__depth))&&yt(n),n.content instanceof c&&(n.content.__depth=n.__depth,e(n.content)),At(n)}St("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,o=null,s=null;if(nt=!e,nt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!kt(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Le||pt(t),r.removed=[],"string"==typeof e&&(Ve=!1),Ve){if(e.nodeName){const t=st(e.nodeName);if(!ke[t]||Ae[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof O)n=vt("\x3c!----\x3e"),i=n.ownerDocument.importNode(e,!0),i.nodeType===K&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!Me&&!Re&&!$e&&-1===e.indexOf("<"))return oe&&ze?oe.createHTML(e):e;if(n=vt(e),!n)return Me?null:ze?ae:""}n&&De&&yt(n.firstChild);const l=xt(Ve?e:n);for(;o=l.nextNode();){if(Ot(o))continue;const e=ie(o);o.nodeType===K&&(e&&e.__depth?o.__depth=(o.__removalCount||0)+e.__depth+1:o.__depth=1),(o.__depth>=255||o.__depth<0||k(o.__depth))&&yt(o),o.content instanceof c&&(o.content.__depth=o.__depth,jt(o.content)),At(o)}if(Ve)return e;if(Me){if(Fe)for(s=ce.call(n.ownerDocument);n.firstChild;)s.appendChild(n.firstChild);else s=n;return(Oe.shadowroot||Oe.shadowrootmode)&&(s=pe.call(a,s,!0)),s}let p=$e?n.outerHTML:n.innerHTML;return $e&&ke["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&x(G,n.ownerDocument.doctype.name)&&(p="\n"+p),Re&&u([fe,he,me],(e=>{p=g(p,e," ")})),oe&&ze?oe.createHTML(p):p},r.setConfig=function(){pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Le=!0},r.clearConfig=function(){lt=null,Le=!1},r.isValidAttribute=function(e,t,n){lt||pt({});const r=st(e),i=st(t);return Et(r,i,n)},r.addHook=function(e,t){"function"==typeof t&&(de[e]=de[e]||[],d(de[e],t))},r.removeHook=function(e){if(de[e])return p(de[e])},r.removeHooks=function(e){de[e]&&(de[e]=[])},r.removeAllHooks=function(){de={}},r}()}()},6364:function(e){e.exports={}},228:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);iu.depthLimit)return void s(t,e,r,a);if(void 0!==u.edgesLimit&&i+1>u.edgesLimit)return void s(t,e,r,a);if(o.push(e),Array.isArray(e))for(p=0;pt?1:0}function u(e,t,n,a){void 0===a&&(a=o());var s,l=p(e,"",0,[],void 0,0,a)||e;try{s=0===i.length?JSON.stringify(l,t,n):JSON.stringify(l,d(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function p(e,i,o,a,l,u,d){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;fd.depthLimit)return void s(t,e,i,l);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void s(t,e,i,l);if(a.push(e),Array.isArray(e))for(f=0;f0)for(var r=0;r=55296&&r<=56319&&t+1=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function H(e){return/^\n* /.test(e)}var Y=1,G=2,Q=3,X=4,K=5;function Z(e,t,n,r,o){e.dump=function(){if(0===t.length)return e.quotingType===D?'""':"''";if(!e.noCompatMode&&(-1!==N.indexOf(t)||$.test(t)))return e.quotingType===D?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),s=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),c=r||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,r,i,o,a,s){var c,p,d=0,R=null,N=!1,$=!1,L=-1!==r,M=-1,F=B(p=W(e,0))&&p!==l&&!U(p)&&p!==w&&p!==E&&p!==k&&p!==x&&p!==A&&p!==j&&p!==P&&p!==I&&p!==m&&p!==y&&p!==v&&p!==f&&p!==T&&p!==S&&p!==O&&p!==b&&p!==h&&p!==g&&p!==_&&p!==C&&function(e){return!U(e)&&e!==k}(W(e,e.length-1));if(t||a)for(c=0;c=65536?c+=2:c++){if(!B(d=W(e,c)))return K;F=F&&V(d,R,s),R=d}else{for(c=0;c=65536?c+=2:c++){if((d=W(e,c))===u)N=!0,L&&($=$||c-M-1>r&&" "!==e[M+1],M=c);else if(!B(d))return K;F=F&&V(d,R,s),R=d}$=$||L&&c-M-1>r&&" "!==e[M+1]}return N||$?n>9&&H(e)?K:a?o===D?K:G:$?X:Q:!F||a||i(e)?o===D?K:G:Y}(t,c,e.indent,s,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n"+J(t,e.indent)+ee(F(function(e,t){for(var n,r,i,o=/(\n+)([^\n]*)/g,a=(i=-1!==(i=e.indexOf("\n"))?i:e.length,o.lastIndex=i,te(e.slice(0,i),t)),s="\n"===e[0]||" "===e[0];r=o.exec(e);){var l=r[1],c=r[2];n=" "===c[0],a+=l+(s||n||""===c?"":"\n")+te(c,t),s=n}return a}(t,s),a));case K:return'"'+function(e){for(var t,n="",r=0,i=0;i=65536?i+=2:i++)r=W(e,i),!(t=R[r])&&B(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||L(r);return n}(t)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function J(e,t){var n=H(e)?String(t):"",r="\n"===e[e.length-1];return n+(!r||"\n"!==e[e.length-2]&&"\n"!==e?r?"":"-":"+")+"\n"}function ee(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function te(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,o=0,a=0,s=0,l="";n=i.exec(e);)(s=n.index)-o>t&&(r=a>o?a:s,l+="\n"+e.slice(o,r),o=r+1),a=s;return l+="\n",e.length-o>t&&a>o?l+=e.slice(o,a)+"\n"+e.slice(a+1):l+=e.slice(o),l.slice(1)}function ne(e,t,n,r){var i,o,a,s="",l=e.tag;for(i=0,o=n.length;i tag resolver accepts not "'+p+'" style');r=u.represent[p](t,p)}e.dump=r}return!0}return!1}function ie(e,t,n,r,o,s,l){e.tag=null,e.dump=n,re(e,n,!1)||re(e,n,!0);var c,p=a.call(e.dump),d=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var f,h,m="[object Object]"===p||"[object Array]"===p;if(m&&(h=-1!==(f=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||h||2!==e.indent&&t>0)&&(o=!1),h&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(m&&h&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),"[object Object]"===p)r&&0!==Object.keys(e.dump).length?(function(e,t,n,r){var o,a,s,l,c,p,d="",f=e.tag,h=Object.keys(n);if(!0===e.sortKeys)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,a=h.length;o1024)&&(e.dump&&u===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,c&&(p+=z(e,t)),ie(e,t+1,l,!0,c)&&(e.dump&&u===e.dump.charCodeAt(0)?p+=":":p+=": ",d+=p+=e.dump));e.tag=f,e.dump=d||"{}"}(e,t,e.dump,o),h&&(e.dump="&ref_"+f+e.dump)):(function(e,t,n){var r,i,o,a,s,l="",c=e.tag,u=Object.keys(n);for(r=0,i=u.length;r1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ie(e,t,a,!1,!1)&&(l+=s+=e.dump));e.tag=c,e.dump="{"+l+"}"}(e,t,e.dump),h&&(e.dump="&ref_"+f+" "+e.dump));else if("[object Array]"===p)r&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?ne(e,t-1,e.dump,o):ne(e,t,e.dump,o),h&&(e.dump="&ref_"+f+e.dump)):(function(e,t,n){var r,i,o,a="",s=e.tag;for(r=0,i=n.length;r",e.dump=c+" "+e.dump)}return!0}function oe(e,t){var n,r,i=[],o=[];for(ae(e,i,o),n=0,r=o.length;n>10),56320+(e-65536&1023))}for(var j=new Array(256),C=new Array(256),P=0;P<256;P++)j[P]=_(P)?1:0,C[P]=_(P);function T(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||a,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function I(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=o(n),new i(t,n)}function R(e,t){throw I(e,t)}function N(e,t){e.onWarning&&e.onWarning.call(null,I(e,t))}var $={YAML:function(e,t,n){var r,i,o;null!==e.version&&R(e,"duplication of %YAML directive"),1!==n.length&&R(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&R(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&R(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&N(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&R(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],b.test(r)||R(e,"ill-formed tag handle (first argument) of the TAG directive"),s.call(e.tagMap,r)&&R(e,'there is a previously declared suffix for "'+r+'" tag handle'),v.test(i)||R(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){R(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function L(e,t,n,r){var i,o,a,s;if(t1&&(e.result+=r.repeat("\n",t-1))}function q(e,t){var n,r,i=e.tag,o=e.anchor,a=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,R(e,"tab characters must not be used in indentation")),45===r)&&S(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,z(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,H(e,t,u,!1,!0),a.push(e.result),z(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)R(e,"bad indentation of a sequence entry");else if(e.lineIndentt?T=1:e.lineIndent===t?T=0:e.lineIndentt?T=1:e.lineIndent===t?T=0:e.lineIndentt)&&(v&&(a=e.line,s=e.lineStart,l=e.position),H(e,t,p,!0,i)&&(v?y=e.result:b=e.result),v||(M(e,h,m,g,y,b,a,s,l),g=y=b=null),z(e,!0,-1),u=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==u)R(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===o?R(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?R(e,"repeat of an indentation width identifier"):(p=t+o-1,u=!0)}if(k(a)){do{a=e.input.charCodeAt(++e.position)}while(k(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!w(a)&&0!==a)}for(;0!==a;){for(F(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!u||e.lineIndentp&&(p=e.lineIndent),w(a))m++;else{if(e.lineIndent0){for(i=a,o=0;i>0;i--)(a=E(s=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:R(e,"expected hexadecimal character");e.result+=A(o),e.position++}else R(e,"unknown escape sequence");n=r=e.position}else w(s)?(L(e,n,r,!0),B(e,z(e,!1,t)),n=r=e.position):e.position===e.lineStart&&U(e)?R(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}R(e,"unexpected end of the stream within a double quoted scalar")}(e,_)?N=!0:function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!S(r)&&!O(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&R(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),s.call(e.anchorMap,n)||R(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],z(e,!0,-1),!0}(e)?(N=!0,null===e.tag&&null===e.anchor||R(e,"alias node should not have any properties")):function(e,t,n){var r,i,o,a,s,l,c,u,p=e.kind,d=e.result;if(S(u=e.input.charCodeAt(e.position))||O(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(S(r=e.input.charCodeAt(e.position+1))||n&&O(r)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,a=!1;0!==u;){if(58===u){if(S(r=e.input.charCodeAt(e.position+1))||n&&O(r))break}else if(35===u){if(S(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&U(e)||n&&O(u))break;if(w(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,z(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=l,e.lineIndent=c;break}}a&&(L(e,i,o,!1),B(e,e.line-s),i=o=e.position,a=!1),k(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return L(e,i,o,!1),!!e.result||(e.kind=p,e.result=d,!1)}(e,_,l===n)&&(N=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===T&&(N=g&&q(e,P))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&R(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),y=0,b=e.implicitTypes.length;y"),null!==e.result&&x.kind!==e.kind&&R(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+x.kind+'", not "'+e.kind+'"'),x.resolve(e.result,e.tag)?(e.result=x.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):R(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||N}function Y(e){var t,n,r,i,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(z(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(a=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!S(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&R(e,"directive name must not be less than one character in length");0!==i;){for(;k(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!w(i));break}if(w(i))break;for(t=e.position;0!==i&&!S(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&F(e),s.call($,n)?$[n](e,n,r):N(e,'unknown document directive "'+n+'"')}z(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,z(e,!0,-1)):a&&R(e,"directives end mark is expected"),H(e,e.lineIndent-1,p,!1,!0),z(e,!0,-1),e.checkLineBreaks&&g.test(e.input.slice(o,e.position))&&N(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&U(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,z(e,!0,-1)):e.positions&&(t=r-s+(o=" ... ").length),n-r>s&&(n=r+s-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:r-t+o.length}}function o(e,t){return r.repeat(" ",t-e.length)+e}e.exports=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,a=/\r?\n|\r|\0/g,s=[0],l=[],c=-1;n=a.exec(e.buffer);)l.push(n.index),s.push(n.index+n[0].length),e.position<=n.index&&c<0&&(c=s.length-2);c<0&&(c=s.length-1);var u,p,d="",f=Math.min(e.line+t.linesAfter,l.length).toString().length,h=t.maxLength-(t.indent+f+3);for(u=1;u<=t.linesBefore&&!(c-u<0);u++)p=i(e.buffer,s[c-u],l[c-u],e.position-(s[c]-s[c-u]),h),d=r.repeat(" ",t.indent)+o((e.line-u+1).toString(),f)+" | "+p.str+"\n"+d;for(p=i(e.buffer,s[c],l[c],e.position,h),d+=r.repeat(" ",t.indent)+o((e.line+1).toString(),f)+" | "+p.str+"\n",d+=r.repeat("-",t.indent+f+3+p.pos)+"^\n",u=1;u<=t.linesAfter&&!(c+u>=l.length);u++)p=i(e.buffer,s[c+u],l[c+u],e.position-(s[c]-s[c+u]),h),d+=r.repeat(" ",t.indent)+o((e.line+u+1).toString(),f)+" | "+p.str+"\n";return d.replace(/\n$/,"")}},5388:function(e,t,n){"use strict";var r=n(1231),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===i.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){a[String(t)]=e}))})),a),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},9342:function(e,t,n){"use strict";var r=n(5388),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,o=e.length,a=i;for(n=0;n64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),o=r.length,a=i,s=0,l=[];for(t=0;t>16&255),l.push(s>>8&255),l.push(255&s)),s=s<<6|a.indexOf(r.charAt(t));return 0==(n=o%4*6)?(l.push(s>>16&255),l.push(s>>8&255),l.push(255&s)):18===n?(l.push(s>>10&255),l.push(s>>2&255)):12===n&&l.push(s>>4&255),new Uint8Array(l)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",o=0,a=e.length,s=i;for(t=0;t>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]),o=(o<<8)+e[t];return 0==(n=a%3)?(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]):2===n?(r+=s[o>>10&63],r+=s[o>>4&63],r+=s[o<<2&63],r+=s[64]):1===n&&(r+=s[o>>2&63],r+=s[o<<4&63],r+=s[64],r+=s[64]),r}})},6199:function(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},1461:function(e,t,n){"use strict";var r=n(8433),i=n(5388),o=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),a=/^[-+]?[0-9]+e/;e.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},4466:function(e,t,n){"use strict";var r=n(8433),i=n(5388);function o(e){return 48<=e&&e<=55}function a(e){return 48<=e&&e<=57}e.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,i=0,s=!1;if(!r)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===r)return!0;if("b"===(t=e[++i])){for(i++;i=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},2369:function(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},1851:function(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},9198:function(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})},6946:function(e,t,n){"use strict";var r=n(5388),i=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,a,s,l=[],c=e;for(t=0,n=c.length;tc))return!1;var p=s.get(e);if(p&&s.get(t))return p==t;var d=-1,f=!0,h=n&o?new Ae:void 0;for(s.set(e,t),s.set(t,e);++d-1},Ee.prototype.set=function(e,t){var n=this.__data__,r=Ce(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},_e.prototype.clear=function(){this.size=0,this.__data__={hash:new Oe,map:new(de||Ee),string:new Oe}},_e.prototype.delete=function(e){var t=$e(this,e).delete(e);return this.size-=t?1:0,t},_e.prototype.get=function(e){return $e(this,e).get(e)},_e.prototype.has=function(e){return $e(this,e).has(e)},_e.prototype.set=function(e,t){var n=$e(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Ae.prototype.add=Ae.prototype.push=function(e){return this.__data__.set(e,r),this},Ae.prototype.has=function(e){return this.__data__.has(e)},je.prototype.clear=function(){this.__data__=new Ee,this.size=0},je.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},je.prototype.get=function(e){return this.__data__.get(e)},je.prototype.has=function(e){return this.__data__.has(e)},je.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ee){var r=n.__data__;if(!de||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _e(r)}return n.set(e,t),this.size=n.size,this};var De=le?function(e){return null==e?[]:(e=Object(e),function(t){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=a}function Ye(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ge(e){return null!=e&&"object"==typeof e}var Qe=F?function(e){return function(t){return e(t)}}(F):function(e){return Ge(e)&&He(e.length)&&!!P[Pe(e)]};function Xe(e){return null!=(t=e)&&He(t.length)&&!We(t)?function(e,t){var n=qe(e),r=!n&&Be(e),i=!n&&!r&&Ve(e),o=!n&&!r&&!i&&Qe(e),a=n||r||i||o,s=a?function(e,t){for(var n=-1,r=Array(e);++n1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t(this,e),this.ctx=n,this.iframes=r,this.exclude=i,this.iframesTimeout=o}return n(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach((function(t){var n=e.filter((function(e){return e.contains(t)})).length>0;-1!==e.indexOf(t)||n||e.push(t)})),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var i=e.contentWindow;if(r=i.document,!i||!r)throw new Error("iframe inaccessible")}catch(e){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t="about:blank",n=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&n!==t&&n}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,i=!1,o=null,a=function a(){if(!i){i=!0,clearTimeout(o);try{r.isIframeBlank(e)||(e.removeEventListener("load",a),r.getIframeContents(e,t,n))}catch(e){n()}}};e.addEventListener("load",a),o=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(e){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,(function(){return!0}),(function(e){r++,n.waitForIframes(e.querySelector("html"),(function(){--r||t()}))}),(function(e){e||t()}))}},{key:"forEachIframe",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=t.querySelectorAll("iframe"),s=a.length,l=0;a=Array.prototype.slice.call(a);var c=function(){--s<=0&&o(l)};s||c(),a.forEach((function(t){e.matches(t,i.exclude)?c():i.onIframeReady(t,(function(e){n(t)&&(l++,r(e)),c()}),c)}))}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode();return{prevNode:t,node:(null===t||e.nextNode())&&e.nextNode()}}},{key:"checkIframeFilter",value:function(e,t,n,r){var i=!1,o=!1;return r.forEach((function(e,t){e.val===n&&(i=t,o=e.handled)})),this.compareNodeIframe(e,t,n)?(!1!==i||o?!1===i||o||(r[i].handled=!0):r.push({val:n,handled:!0}),!0):(!1===i&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var i=this;e.forEach((function(e){e.handled||i.getIframeContents(e.val,(function(e){i.createInstanceOnIframe(e).forEachNode(t,n,r)}))}))}},{key:"iterateThroughNodes",value:function(e,t,n,r,i){for(var o=this,a=this.createIterator(t,e,r),s=[],l=[],c=void 0,u=void 0;p=void 0,p=o.getIteratorNode(a),u=p.prevNode,c=p.node;)this.iframes&&this.forEachIframe(t,(function(e){return o.checkIframeFilter(c,u,e,s)}),(function(t){o.createInstanceOnIframe(t).forEachNode(e,(function(e){return l.push(e)}),r)})),l.push(c);var p;l.forEach((function(e){n(e)})),this.iframes&&this.handleOpenIframes(s,e,n,r),i()}},{key:"forEachNode",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=this.getContexts(),a=o.length;a||i(),o.forEach((function(o){var s=function(){r.iterateThroughNodes(e,o,t,n,(function(){--a<=0&&i()}))};r.iframes?r.waitForIframes(o,s):s()}))}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var i=!1;return n.every((function(t){return!r.call(e,t)||(i=!0,!1)})),i}return!1}}]),e}(),o=function(){function o(e){t(this,o),this.ctx=e,this.ie=!1;var n=window.navigator.userAgent;(n.indexOf("MSIE")>-1||n.indexOf("Trident")>-1)&&(this.ie=!0)}return n(o,[{key:"log",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===(void 0===r?"undefined":e(r))&&"function"==typeof r[n]&&r[n]("mark.js: "+t)}},{key:"escapeStr",value:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(e){return"disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),"disabled"!==this.opt.wildcards&&(e=this.createWildcardsRegExp(e)),this.createAccuracyRegExp(e)}},{key:"createSynonymsRegExp",value:function(e){var t=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==a&&""!==s&&(e=e.replace(new RegExp("("+this.escapeStr(a)+"|"+this.escapeStr(s)+")","gm"+n),r+"("+this.processSynomyms(a)+"|"+this.processSynomyms(s)+")"+r))}return e}},{key:"processSynomyms",value:function(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}},{key:"setupWildcardsRegExp",value:function(e){return(e=e.replace(/(?:\\)*\?/g,(function(e){return"\\"===e.charAt(0)?"?":""}))).replace(/(?:\\)*\*/g,(function(e){return"\\"===e.charAt(0)?"*":""}))}},{key:"createWildcardsRegExp",value:function(e){var t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(e){return e.replace(/[^(|)\\]/g,(function(e,t,n){var r=n.charAt(t+1);return/[(|)\\]/.test(r)||""===r?e:e+"\0"}))}},{key:"createJoinersRegExp",value:function(e){var t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join("["+t.join("")+"]*"):e}},{key:"createDiacriticsRegExp",value:function(e){var t=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],r=[];return e.split("").forEach((function(i){n.every((function(n){if(-1!==n.indexOf(i)){if(r.indexOf(n)>-1)return!1;e=e.replace(new RegExp("["+n+"]","gm"+t),"["+n+"]"),r.push(n)}return!0}))})),e}},{key:"createMergedBlanksRegExp",value:function(e){return e.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(e){var t=this,n=this.opt.accuracy,r="string"==typeof n?n:n.value,i="string"==typeof n?[]:n.limiters,o="";switch(i.forEach((function(e){o+="|"+t.escapeStr(e)})),r){case"partially":default:return"()("+e+")";case"complementary":return"()([^"+(o="\\s"+(o||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")))+"]*"+e+"[^"+o+"]*)";case"exactly":return"(^|\\s"+o+")("+e+")(?=$|\\s"+o+")"}}},{key:"getSeparatedKeywords",value:function(e){var t=this,n=[];return e.forEach((function(e){t.opt.separateWordSearch?e.split(" ").forEach((function(e){e.trim()&&-1===n.indexOf(e)&&n.push(e)})):e.trim()&&-1===n.indexOf(e)&&n.push(e)})),{keywords:n.sort((function(e,t){return t.length-e.length})),length:n.length}}},{key:"isNumeric",value:function(e){return Number(parseFloat(e))==e}},{key:"checkRanges",value:function(e){var t=this;if(!Array.isArray(e)||"[object Object]"!==Object.prototype.toString.call(e[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];var n=[],r=0;return e.sort((function(e,t){return e.start-t.start})).forEach((function(e){var i=t.callNoMatchOnInvalidRanges(e,r),o=i.start,a=i.end;i.valid&&(e.start=o,e.length=a-o,n.push(e),r=a)})),n}},{key:"callNoMatchOnInvalidRanges",value:function(e,t){var n=void 0,r=void 0,i=!1;return e&&void 0!==e.start?(r=(n=parseInt(e.start,10))+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(e)),this.opt.noMatch(e))):(this.log("Ignoring invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:n,end:r,valid:i}}},{key:"checkWhitespaceRanges",value:function(e,t,n){var r=void 0,i=!0,o=n.length,a=t-o,s=parseInt(e.start,10)-a;return(r=(s=s>o?o:s)+parseInt(e.length,10))>o&&(r=o,this.log("End range automatically set to the max value of "+o)),s<0||r-s<0||s>o||r>o?(i=!1,this.log("Invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)):""===n.substring(s,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:s,end:r,valid:i}}},{key:"getTextNodes",value:function(e){var t=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,(function(e){r.push({start:n.length,end:(n+=e.textContent).length,node:e})}),(function(e){return t.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),(function(){e({value:n,nodes:r})}))}},{key:"matchesExclude",value:function(e){return i.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(e,t,n){var r=this.opt.element?this.opt.element:"mark",i=e.splitText(t),o=i.splitText(n-t),a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),o}},{key:"wrapRangeInMappedTextNode",value:function(e,t,n,r,i){var o=this;e.nodes.every((function(a,s){var l=e.nodes[s+1];if(void 0===l||l.start>t){if(!r(a.node))return!1;var c=t-a.start,u=(n>a.end?a.end:n)-a.start,p=e.value.substr(0,a.start),d=e.value.substr(u+a.start);if(a.node=o.wrapRangeInTextNode(a.node,c,u),e.value=p+d,e.nodes.forEach((function(t,n){n>=s&&(e.nodes[n].start>0&&n!==s&&(e.nodes[n].start-=u),e.nodes[n].end-=u)})),n-=u,i(a.node.previousSibling,a.start),!(n>a.end))return!1;t=a.end}return!0}))}},{key:"wrapMatches",value:function(e,t,n,r,i){var o=this,a=0===t?0:t+1;this.getTextNodes((function(t){t.nodes.forEach((function(t){t=t.node;for(var i=void 0;null!==(i=e.exec(t.textContent))&&""!==i[a];)if(n(i[a],t)){var s=i.index;if(0!==a)for(var l=1;l1&&console.warn("Replacing with",t),m++}}else{let i=u(l(t,e[n]));if(a.verbose>1&&console.warn((!1===i?f.colour.red:f.colour.green)+"Fragment resolution",e[n],f.colour.normal),!1===i){if(r.parent[r.pkey]={},a.fatal){let t=new Error("Fragment $ref resolution failed "+e[n]);if(!a.promise)throw t;a.promise.reject(t)}}else m++,r.parent[r.pkey]=i,h[e[n]]=r.path.replace("/%24ref","")}else if(p.protocol){let t=o.resolve(i,e[n]).toString();a.verbose>1&&console.warn(f.colour.yellow+"Rewriting external url ref",e[n],"as",t,f.colour.normal),e["x-miro"]=e[n],a.externalRefs[e[n]]&&(a.externalRefs[t]||(a.externalRefs[t]=a.externalRefs[e[n]]),a.externalRefs[t].failed=a.externalRefs[e[n]].failed),e[n]=t}else if(!e["x-miro"]){let t=o.resolve(i,e[n]).toString(),r=!1;a.externalRefs[e[n]]&&(r=a.externalRefs[e[n]].failed),r||(a.verbose>1&&console.warn(f.colour.yellow+"Rewriting external ref",e[n],"as",t,f.colour.normal),e["x-miro"]=e[n],e[n]=t)}}));return c(e,{},(function(e,t,n){d(e,t)&&void 0!==e.$fixed&&delete e.$fixed})),a.verbose>1&&console.warn("Finished fragment resolution"),e}function m(e,t){if(!t.filters||!t.filters.length)return e;for(let n of t.filters)e=n(e,t);return e}function g(e,t,n,a){var c=o.parse(n.source),p=n.source.split("\\").join("/").split("/");p.pop()||p.pop();let d="",f=t.split("#");f.length>1&&(d="#"+f[1],t=f[0]),p=p.join("/");let g=(y=o.parse(t).protocol,b=c.protocol,y&&y.length>2?y:b&&b.length>2?b:"file:");var y,b;let v;if(v="file:"===g?i.resolve(p?p+"/":"",t):o.resolve(p?p+"/":"",t),n.cache[v]){n.verbose&&console.warn("CACHED",v,d);let e=u(n.cache[v]),r=n.externalRef=e;if(d&&(r=l(r,d),!1===r&&(r={},n.fatal))){let e=new Error("Cached $ref resolution failed "+v+d);if(!n.promise)throw e;n.promise.reject(e)}return r=h(r,e,t,d,v,n),r=m(r,n),a(u(r),v,n),Promise.resolve(r)}if(n.verbose&&console.warn("GET",v,d),n.handlers&&n.handlers[g])return n.handlers[g](p,t,d,n).then((function(e){return n.externalRef=e,e=m(e,n),n.cache[v]=e,a(e,v,n),e})).catch((function(e){throw n.verbose&&console.warn(e),e}));if(g&&g.startsWith("http")){const e=Object.assign({},n.fetchOptions,{agent:n.agent});return n.fetch(v,e).then((function(e){if(200!==e.status){if(n.ignoreIOErrors)return n.verbose&&console.warn("FAILED",t),n.externalRefs[t].failed=!0,'{"$ref":"'+t+'"}';throw new Error(`Received status code ${e.status}: ${v}`)}return e.text()})).then((function(e){try{let r=s.parse(e,{schema:"core",prettyErrors:!0});if(e=n.externalRef=r,n.cache[v]=u(e),d&&!1===(e=l(e,d))&&(e={},n.fatal)){let e=new Error("Remote $ref resolution failed "+v+d);if(!n.promise)throw e;n.promise.reject(e)}e=m(e=h(e,r,t,d,v,n),n)}catch(e){if(n.verbose&&console.warn(e),!n.promise||!n.fatal)throw e;n.promise.reject(e)}return a(e,v,n),e})).catch((function(e){if(n.verbose&&console.warn(e),n.cache[v]={},!n.promise||!n.fatal)throw e;n.promise.reject(e)}))}{const e='{"$ref":"'+t+'"}';return function(e,t,n,i,o){return new Promise((function(a,s){r.readFile(e,t,(function(e,t){e?n.ignoreIOErrors&&o?(n.verbose&&console.warn("FAILED",i),n.externalRefs[i].failed=!0,a(o)):s(e):a(t)}))}))}(v,n.encoding||"utf8",n,t,e).then((function(e){try{let r=s.parse(e,{schema:"core",prettyErrors:!0});if(e=n.externalRef=r,n.cache[v]=u(e),d&&!1===(e=l(e,d))&&(e={},n.fatal)){let e=new Error("File $ref resolution failed "+v+d);if(!n.promise)throw e;n.promise.reject(e)}e=m(e=h(e,r,t,d,v,n),n)}catch(e){if(n.verbose&&console.warn(e),!n.promise||!n.fatal)throw e;n.promise.reject(e)}return a(e,v,n),e})).catch((function(e){if(n.verbose&&console.warn(e),!n.promise||!n.fatal)throw e;n.promise.reject(e)}))}}function y(e){return new Promise((function(t,n){(function(e){return new Promise((function(t,n){function r(t,n,r){if(t[n]&&d(t[n],"$ref")){let o=t[n].$ref;if(!o.startsWith("#")){let a="";if(!i[o]){let t=Object.keys(i).find((function(e,t,n){return o.startsWith(e+"/")}));t&&(e.verbose&&console.warn("Found potential subschema at",t),a="/"+(o.split("#")[1]||"").replace(t.split("#")[1]||""),a=a.split("/undefined").join(""),o=t)}if(i[o]||(i[o]={resolved:!1,paths:[],extras:{},description:t[n].description}),i[o].resolved)if(i[o].failed);else if(e.rewriteRefs){let r=i[o].resolvedAt;e.verbose>1&&console.warn("Rewriting ref",o,r),t[n]["x-miro"]=o,t[n].$ref=r+a}else t[n]=u(i[o].data);else i[o].paths.push(r.path),i[o].extras[r.path]=a}}}let i=e.externalRefs;if(e.resolver.depth>0&&e.source===e.resolver.base)return t(i);c(e.openapi.definitions,{identityDetection:!0,path:"#/definitions"},r),c(e.openapi.components,{identityDetection:!0,path:"#/components"},r),c(e.openapi,{identityDetection:!0},r),t(i)}))})(e).then((function(t){for(let n in t)if(!t[n].resolved){let r=e.resolver.depth;r>0&&r++,e.resolver.actions[r].push((function(){return g(e.openapi,n,e,(function(e,r,i){if(!t[n].resolved){let o={};o.context=t[n],o.$ref=n,o.original=u(e),o.updated=e,o.source=r,i.externals.push(o),t[n].resolved=!0}let o=Object.assign({},i,{source:"",resolver:{actions:i.resolver.actions,depth:i.resolver.actions.length-1,base:i.resolver.base}});i.patch&&t[n].description&&!e.description&&"object"==typeof e&&(e.description=t[n].description),t[n].data=e;let a=(s=t[n].paths,[...new Set(s)]);var s;a=a.sort((function(e,t){const n=e.startsWith("#/components/")||e.startsWith("#/definitions/"),r=t.startsWith("#/components/")||t.startsWith("#/definitions/");return n&&!r?-1:r&&!n?1:0}));for(let r of a)if(t[n].resolvedAt&&r!==t[n].resolvedAt&&r.indexOf("x-ms-examples/")<0)i.verbose>1&&console.warn("Creating pointer to data at",r),l(i.openapi,r,{$ref:t[n].resolvedAt+t[n].extras[r],"x-miro":n+t[n].extras[r]});else{t[n].resolvedAt?i.verbose>1&&console.warn("Avoiding circular reference"):(t[n].resolvedAt=r,i.verbose>1&&console.warn("Creating initial clone of data at",r));let o=u(e);l(i.openapi,r,o)}0===i.resolver.actions[o.resolver.depth].length&&i.resolver.actions[o.resolver.depth].push((function(){return y(o)}))}))}))}})).catch((function(t){e.verbose&&console.warn(t),n(t)}));let r={options:e};r.actions=e.resolver.actions[e.resolver.depth],t(r)}))}function b(e,t,n){e.resolver.actions.push([]),y(e).then((function(r){var i;(i=r.actions,i.reduce(((e,t)=>e.then((e=>t().then(Array.prototype.concat.bind(e))))),Promise.resolve([]))).then((function(){if(e.resolver.depth>=e.resolver.actions.length)return console.warn("Ran off the end of resolver actions"),t(!0);e.resolver.depth++,e.resolver.actions[e.resolver.depth].length?setTimeout((function(){b(r.options,t,n)}),0):(e.verbose>1&&console.warn(f.colour.yellow+"Finished external resolution!",f.colour.normal),e.resolveInternal&&(e.verbose>1&&console.warn(f.colour.yellow+"Starting internal resolution!",f.colour.normal),e.openapi=p(e.openapi,e.original,{verbose:e.verbose-1}),e.verbose>1&&console.warn(f.colour.yellow+"Finished internal resolution!",f.colour.normal)),c(e.openapi,{},(function(t,n,r){d(t,n)&&(e.preserveMiro||delete t["x-miro"])})),t(e))})).catch((function(t){e.verbose&&console.warn(t),n(t)}))})).catch((function(t){e.verbose&&console.warn(t),n(t)}))}function v(e){if(e.cache||(e.cache={}),e.fetch||(e.fetch=a),e.source){let t=o.parse(e.source);(!t.protocol||t.protocol.length<=2)&&(e.source=i.resolve(e.source))}e.externals=[],e.externalRefs={},e.rewriteRefs=!0,e.resolver={},e.resolver.depth=0,e.resolver.base=e.source,e.resolver.actions=[[]]}e.exports={optionalResolve:function(e){return v(e),new Promise((function(t,n){e.resolve?b(e,t,n):t(e)}))},resolve:function(e,t,n){return n||(n={}),n.openapi=e,n.source=t,n.resolve=!0,v(n),new Promise((function(e,t){b(n,e,t)}))}}},1319:function(e){"use strict";function t(){return{depth:0,seen:new WeakMap,top:!0,combine:!1,allowRefSiblings:!1}}e.exports={getDefaultState:t,walkSchema:function e(n,r,i,o){if(void 0===i.depth&&(i=t()),null==n)return n;if(void 0!==n.$ref){let e={$ref:n.$ref};return i.allowRefSiblings&&n.description&&(e.description=n.description),o(e,r,i),e}if(i.combine&&(n.allOf&&Array.isArray(n.allOf)&&1===n.allOf.length&&delete(n=Object.assign({},n.allOf[0],n)).allOf,n.anyOf&&Array.isArray(n.anyOf)&&1===n.anyOf.length&&delete(n=Object.assign({},n.anyOf[0],n)).anyOf,n.oneOf&&Array.isArray(n.oneOf)&&1===n.oneOf.length&&delete(n=Object.assign({},n.oneOf[0],n)).oneOf),o(n,r,i),i.seen.has(n))return n;if("object"==typeof n&&null!==n&&i.seen.set(n,!0),i.top=!1,i.depth++,void 0!==n.items&&(i.property="items",e(n.items,n,i,o)),n.additionalItems&&"object"==typeof n.additionalItems&&(i.property="additionalItems",e(n.additionalItems,n,i,o)),n.additionalProperties&&"object"==typeof n.additionalProperties&&(i.property="additionalProperties",e(n.additionalProperties,n,i,o)),n.properties)for(let t in n.properties){let r=n.properties[t];i.property="properties/"+t,e(r,n,i,o)}if(n.patternProperties)for(let t in n.patternProperties){let r=n.patternProperties[t];i.property="patternProperties/"+t,e(r,n,i,o)}if(n.allOf)for(let t in n.allOf){let r=n.allOf[t];i.property="allOf/"+t,e(r,n,i,o)}if(n.anyOf)for(let t in n.anyOf){let r=n.anyOf[t];i.property="anyOf/"+t,e(r,n,i,o)}if(n.oneOf)for(let t in n.oneOf){let r=n.oneOf[t];i.property="oneOf/"+t,e(r,n,i,o)}return n.not&&(i.property="not",e(n.not,n,i,o)),i.depth--,n}}},7975:function(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,a=0,s=0;s<=e.length;++s){if(s2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),o=s,a=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=s,a=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,s):r=e.slice(o+1,s),i=s-o-1;o=s,a=0}else 46===n&&-1!==a?++a:a=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a;o>=0?a=arguments[o]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(r=a+"/"+r,i=47===a.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;ic){if(47===n.charCodeAt(s+p))return n.slice(s+p+1);if(0===p)return n.slice(s+p)}else a>c&&(47===e.charCodeAt(i+p)?u=p:0===p&&(u=0));break}var d=e.charCodeAt(i+p);if(d!==n.charCodeAt(s+p))break;47===d&&(u=p)}var f="";for(p=i+u+1;p<=o;++p)p!==o&&47!==e.charCodeAt(p)||(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(s+u):(s+=u,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,a=e.length-1;a>=1;--a)if(47===(n=e.charCodeAt(a))){if(!o){i=a;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,a=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!a){i=r+1;break}}else-1===l&&(a=!1,l=r+1),s>=0&&(c===n.charCodeAt(s)?-1==--s&&(o=r):(s=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!a){i=r+1;break}}else-1===o&&(a=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,a=0,s=e.length-1;s>=0;--s){var l=e.charCodeAt(s);if(47!==l)-1===i&&(o=!1,i=s+1),46===l?-1===n?n=s:1!==a&&(a=1):-1!==n&&(a=-1);else if(!o){r=s+1;break}}return-1===n||-1===i||0===a||1===a&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var a=-1,s=0,l=-1,c=!0,u=e.length-1,p=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===i?-1===a?a=u:1!==p&&(p=1):-1!==a&&(p=-1);else if(!c){s=u+1;break}return-1===a||-1===l||0===p||1===p&&a===l-1&&a===s+1?-1!==l&&(n.base=n.name=0===s&&o?e.slice(1,l):e.slice(s,l)):(0===s&&o?(n.name=e.slice(1,a),n.base=e.slice(1,l)):(n.name=e.slice(s,a),n.base=e.slice(s,l)),n.ext=e.slice(a,l)),s>0?n.dir=e.slice(0,s-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},5127:function(e){e.exports=function(){var e=[],t=[],n={},r={},i={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function a(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t){return e.replace(t[0],(function(n,r){var i,o,s=(i=t[1],o=arguments,i.replace(/\$(\d{1,2})/g,(function(e,t){return o[t]||""})));return a(""===n?e[r-1]:n,s)}))}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var i=r.length;i--;){var o=r[i];if(o[0].test(t))return s(t,o)}return t}function c(e,t,n){return function(r){var i=r.toLowerCase();return t.hasOwnProperty(i)?a(r,i):e.hasOwnProperty(i)?a(r,e[i]):l(i,r,n)}}function u(e,t,n,r){return function(r){var i=r.toLowerCase();return!!t.hasOwnProperty(i)||!e.hasOwnProperty(i)&&l(i,i,n)===i}}function p(e,t,n){return(n?t+" ":"")+(1===t?p.singular(e):p.plural(e))}return p.plural=c(i,r,e),p.isPlural=u(i,r,e),p.singular=c(r,i,t),p.isSingular=u(r,i,t),p.addPluralRule=function(t,n){e.push([o(t),n])},p.addSingularRule=function(e,n){t.push([o(e),n])},p.addUncountableRule=function(e){"string"!=typeof e?(p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")):n[e.toLowerCase()]=!0},p.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,r[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach((function(e){return p.addIrregularRule(e[0],e[1])})),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach((function(e){return p.addPluralRule(e[0],e[1])})),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach((function(e){return p.addSingularRule(e[0],e[1])})),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}()},7022:function(){!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,a=0;a>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean},5624:function(){Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},4511:function(){!function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(Prism)},2415:function(){!function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)},5651:function(){!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,n){return"(?:"+t[+n]+")"}))}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n>/g,(function(){return"(?:"+e+")"}));return e.replace(/<>/g,"[^\\s\\S]")}var i="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",o="class enum interface record struct",a="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",s="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(o),u=RegExp(l(i+" "+o+" "+a+" "+s)),p=l(o+" "+a+" "+s),d=l(i+" "+o+" "+s),f=r(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),h=r(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,g=t(/<<0>>(?:\s*<<1>>)?/.source,[m,f]),y=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[p,g]),b=/\[\s*(?:,\s*)*\]/.source,v=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[y,b]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[f,h,b]),w=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),k=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,y,b]),S={keyword:u,punctuation:/[<>()?,.:[\]]/},O=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,E=/"(?:\\.|[^\\"\r\n])*"/.source,_=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[_]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[E]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[y]),lookbehind:!0,inside:S},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,k]),lookbehind:!0,inside:S},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[c,g]),lookbehind:!0,inside:S},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[y]),lookbehind:!0,inside:S},{pattern:n(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[v]),lookbehind:!0,inside:S},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[k,d,m]),inside:S}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[h]),lookbehind:!0,alias:"class-name",inside:S},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[k,y]),inside:S,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[k]),lookbehind:!0,inside:S,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,f]),inside:{function:n(/^<<0>>/.source,[m]),generic:{pattern:RegExp(f),alias:"class-name",inside:S}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,g,m,k,u.source,h,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[g,h]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:u,"class-name":{pattern:RegExp(k),greedy:!0,inside:S},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var A=E+"|"+O,j=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[A]),C=r(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[j]),2),P=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,T=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[y,C]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[P,T]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[P]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[C]),inside:e.languages.csharp},"class-name":{pattern:RegExp(y),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var I=/:[^}\r\n]+/.source,R=r(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[j]),2),N=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[R,I]),$=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[A]),2),L=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[$,I]);function D(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,I]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[N]),lookbehind:!0,greedy:!0,inside:D(N,R)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[L]),lookbehind:!0,greedy:!0,inside:D(L,$)}],char:{pattern:RegExp(O),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)},2630:function(){Prism.languages.csv={value:/[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,punctuation:/,/}},6378:function(){Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"]},4784:function(){!function(e){function t(e){return RegExp("(^(?:"+e+"):[ \t]*(?![ \t]))[^]+","i")}e.languages.http={"request-line":{pattern:/^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:e.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[\d.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[\d.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[\d.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},header:{pattern:/^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,inside:{"header-value":[{pattern:t(/Content-Security-Policy/.source),lookbehind:!0,alias:["csp","languages-csp"],inside:e.languages.csp},{pattern:t(/Public-Key-Pins(?:-Report-Only)?/.source),lookbehind:!0,alias:["hpkp","languages-hpkp"],inside:e.languages.hpkp},{pattern:t(/Strict-Transport-Security/.source),lookbehind:!0,alias:["hsts","languages-hsts"],inside:e.languages.hsts},{pattern:t(/[^:]+/.source),lookbehind:!0}],"header-name":{pattern:/^[^:]+/,alias:"keyword"},punctuation:/^:/}}};var n,r=e.languages,i={"application/javascript":r.javascript,"application/json":r.json||r.javascript,"application/xml":r.xml,"text/xml":r.xml,"text/html":r.html,"text/css":r.css,"text/plain":r.plain},o={"application/json":!0,"application/xml":!0};function a(e){var t=e.replace(/^[a-z]+\//,"");return"(?:"+e+"|\\w+/(?:[\\w.-]+\\+)+"+t+"(?![+\\w.-]))"}for(var s in i)if(i[s]){n=n||{};var l=o[s]?a(s):s;n[s.replace(/\//g,"-")]={pattern:RegExp("("+/content-type:\s*/.source+l+/(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source+")"+/[^ \t\w-][\s\S]*/.source,"i"),lookbehind:!0,inside:i[s]}}n&&e.languages.insertBefore("http","header",n)}(Prism)},6976:function(){!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)},64:function(){Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}},9700:function(){!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,i,o){if(n.language===r){var a=n.tokenStack=[];n.code=n.code.replace(i,(function(e){if("function"==typeof o&&!o(e))return e;for(var i,s=a.length;-1!==n.code.indexOf(i=t(r,s));)++s;return a[s]=e,i})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var i=0,o=Object.keys(n.tokenStack);!function a(s){for(var l=0;l=o.length);l++){var c=s[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=o[i],p=n.tokenStack[u],d="string"==typeof c?c:c.content,f=t(r,u),h=d.indexOf(f);if(h>-1){++i;var m=d.substring(0,h),g=new e.Token(r,e.tokenize(p,n.grammar),"language-"+r,p),y=d.substring(h+f.length),b=[];m&&b.push.apply(b,a([m])),b.push(g),y&&b.push.apply(b,a([y])),"string"==typeof c?s.splice.apply(s,[l,1].concat(b)):c.content=b}}else c.content&&a(c.content)}return s}(n.tokens)}}}})}(Prism)},4312:function(){Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml},596:function(){Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec},2821:function(){!function(e){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}}(Prism)},3554:function(){!function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:i,punctuation:o};var a={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},s=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:a}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:a}}];e.languages.insertBefore("php","variable",{string:s,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:s,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:i,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(Prism)},2342:function(){Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},4113:function(){Prism.languages.q={string:/"(?:\\.|[^"\\\r\n])*"/,comment:[{pattern:/([\t )\]}])\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|\r?\n|\r)\/[\t ]*(?:(?:\r?\n|\r)(?:.*(?:\r?\n|\r(?!\n)))*?(?:\\(?=[\t ]*(?:\r?\n|\r))|$)|\S.*)/,lookbehind:!0,greedy:!0},{pattern:/^\\[\t ]*(?:\r?\n|\r)[\s\S]+/m,greedy:!0},{pattern:/^#!.+/m,greedy:!0}],symbol:/`(?::\S+|[\w.]*)/,datetime:{pattern:/0N[mdzuvt]|0W[dtz]|\d{4}\.\d\d(?:m|\.\d\d(?:T(?:\d\d(?::\d\d(?::\d\d(?:[.:]\d\d\d)?)?)?)?)?[dz]?)|\d\d:\d\d(?::\d\d(?:[.:]\d\d\d)?)?[uvt]?/,alias:"number"},number:/\b(?![01]:)(?:0N[hje]?|0W[hj]?|0[wn]|0x[\da-fA-F]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?[hjfeb]?)/,keyword:/\\\w+\b|\b(?:abs|acos|aj0?|all|and|any|asc|asin|asof|atan|attr|avgs?|binr?|by|ceiling|cols|cor|cos|count|cov|cross|csv|cut|delete|deltas|desc|dev|differ|distinct|div|do|dsave|ej|enlist|eval|except|exec|exit|exp|fby|fills|first|fkeys|flip|floor|from|get|getenv|group|gtime|hclose|hcount|hdel|hopen|hsym|iasc|identity|idesc|if|ij|in|insert|inter|inv|keys?|last|like|list|ljf?|load|log|lower|lsq|ltime|ltrim|mavg|maxs?|mcount|md5|mdev|med|meta|mins?|mmax|mmin|mmu|mod|msum|neg|next|not|null|or|over|parse|peach|pj|plist|prds?|prev|prior|rand|rank|ratios|raze|read0|read1|reciprocal|reval|reverse|rload|rotate|rsave|rtrim|save|scan|scov|sdev|select|set|setenv|show|signum|sin|sqrt|ssr?|string|sublist|sums?|sv|svar|system|tables|tan|til|trim|txf|type|uj|ungroup|union|update|upper|upsert|value|var|views?|vs|wavg|where|while|within|wj1?|wsum|ww|xasc|xbar|xcols?|xdesc|xexp|xgroup|xkey|xlog|xprev|xrank)\b/,adverb:{pattern:/['\/\\]:?|\beach\b/,alias:"function"},verb:{pattern:/(?:\B\.\B|\b[01]:|<[=>]?|>=?|[:+\-*%,!?~=|$&#@^]):?|\b_\b:?/,alias:"operator"},punctuation:/[(){}\[\];.]/}},1648:function(){!function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism)},4252:function(){Prism.languages.scala=Prism.languages.extend("java",{"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/,number:/\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,builtin:/\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/,symbol:/'[^\d\s\\]\w*/}),Prism.languages.insertBefore("scala","triple-quoted-string",{"string-interpolation":{pattern:/\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i,greedy:!0,inside:{id:{pattern:/^\w+/,greedy:!0,alias:"function"},escape:{pattern:/\\\$"|\$[$"]/,greedy:!0,alias:"symbol"},interpolation:{pattern:/\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,greedy:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:Prism.languages.scala}}},string:/[\s\S]+/}}}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala.function,delete Prism.languages.scala.constant},6966:function(){Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}},4793:function(){Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift}))},83:function(){!function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function a(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return"(?:"+i+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:a(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:a(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:a(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:a(o),lookbehind:!0,greedy:!0},number:{pattern:a(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)},8848:function(e,t,n){var r=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=p.reach);S+=k.value.length,k=k.next){var O=k.value;if(t.length>e.length)return;if(!(O instanceof o)){var E,_=1;if(b){if(!(E=a(w,S,e,y))||E.index>=e.length)break;var A=E.index,j=E.index+E[0].length,C=S;for(C+=k.value.length;A>=C;)C+=(k=k.next).value.length;if(S=C-=k.value.length,k.value instanceof o)continue;for(var P=k;P!==t.tail&&(Cp.reach&&(p.reach=N);var $=k.prev;if(I&&($=c(t,$,I),S+=I.length),u(t,$,_),k=c(t,$,new o(d,g?i.tokenize(T,g):T,v,T)),R&&c(t,k,R),_>1){var L={cause:d+","+h,reach:N};s(e,t,n,k.prev,S,L),p&&L.reach>p.reach&&(p.reach=L.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i"+o.content+""},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,o=n.code,a=n.immediateClose;e.postMessage(i.highlight(o,i.languages[r],r)),a&&e.close()}),!1),i):i;var p=i.util.currentScript();function d(){i.manual||i.highlightAll()}if(p&&(i.filename=p.src,p.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var f=document.readyState;"loading"===f||"interactive"===f&&p&&p.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r),r.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:r.languages[t]},n.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:r.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:i},r.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(e,t){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:r.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,function(){if(void 0!==r&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",i="loaded",o="pre[data-src]:not(["+t+'="'+i+'"]):not(['+t+'="'+n+'"])';r.hooks.add("before-highlightall",(function(e){e.selector+=", "+o})),r.hooks.add("before-sanity-check",(function(a){var s=a.element;if(s.matches(o)){a.code="",s.setAttribute(t,n);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),u=a.language;if("none"===u){var p=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[p]||p}r.util.setLanguage(l,u),r.util.setLanguage(s,u);var d=r.plugins.autoloader;d&&d.loadLanguages(u),function(e,n,o){var a=new XMLHttpRequest;a.open("GET",e,!0),a.onreadystatechange=function(){4==a.readyState&&(a.status<400&&a.responseText?function(e){s.setAttribute(t,i);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(n){var o=e.split(/\r\n?|\n/g),a=n[0],c=null==n[1]?o.length:n[1];a<0&&(a+=o.length),a=Math.max(0,Math.min(a-1,o.length)),c<0&&(c+=o.length),c=Math.max(0,Math.min(c,o.length)),e=o.slice(a,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(a+1))}l.textContent=e,r.highlightElement(l)}(a.responseText):a.status>=400?o("✖ Error "+a.status+" while fetching file: "+a.statusText):o("✖ Error: File does not exist or is empty"))},a.send(null)}(c,0,(function(e){s.setAttribute(t,"failed"),l.textContent=e}))}})),r.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(o),i=0;t=n[i++];)r.highlightElement(t)}};var a=!1;r.fileHighlight=function(){a||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),a=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},2694:function(e,t,n){"use strict";var r=n(6925);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5556:function(e,t,n){e.exports=n(2694)()},6925:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:function(e,t,n){"use strict";var r=n(6540),i=n(194);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n
+ + {% block header_block %} +
+ {% block header %} + + {% endblock header %} +
+ {% endblock header_block %} {% block swagger_ui %}
{% endblock %} {% block javascripts %} - - + {{ nelmioAsset(assets_mode, 'swagger-ui/swagger-ui-bundle.js') }} + {{ nelmioAsset(assets_mode, 'swagger-ui/swagger-ui-standalone-preset.js') }} {% endblock javascripts %} + {{ nelmioAsset(assets_mode, 'init-swagger-ui.js') }} + {% block swagger_initialization %} - + {% endblock swagger_initialization %} diff --git a/Tests/ApiDocGeneratorTest.php b/tests/ApiDocGeneratorTest.php similarity index 62% rename from Tests/ApiDocGeneratorTest.php rename to tests/ApiDocGeneratorTest.php index 8eac565ed..223e72bb5 100644 --- a/Tests/ApiDocGeneratorTest.php +++ b/tests/ApiDocGeneratorTest.php @@ -13,24 +13,25 @@ use Nelmio\ApiDocBundle\ApiDocGenerator; use Nelmio\ApiDocBundle\Describer\DefaultDescriber; +use OpenApi\Generator; use PHPUnit\Framework\TestCase; use Symfony\Component\Cache\Adapter\ArrayAdapter; class ApiDocGeneratorTest extends TestCase { - public function testCache() + public function testCache(): void { $adapter = new ArrayAdapter(); - $generator = new ApiDocGenerator([new DefaultDescriber()], [], $adapter); + $generator = new ApiDocGenerator([new DefaultDescriber()], [], $adapter, null, new Generator()); - $this->assertEquals($generator->generate(), $adapter->getItem('swagger_doc')->get()); + self::assertEquals(json_encode($generator->generate()), json_encode($adapter->getItem('openapi_doc')->get())); } - public function testCacheWithCustomId() + public function testCacheWithCustomId(): void { $adapter = new ArrayAdapter(); - $generator = new ApiDocGenerator([new DefaultDescriber()], [], $adapter, 'custom_id'); + $generator = new ApiDocGenerator([new DefaultDescriber()], [], $adapter, 'custom_id', new Generator()); - $this->assertEquals($generator->generate(), $adapter->getItem('custom_id')->get()); + self::assertEquals(json_encode($generator->generate()), json_encode($adapter->getItem('custom_id')->get())); } } diff --git a/tests/Attribute/AreasTest.php b/tests/Attribute/AreasTest.php new file mode 100644 index 000000000..93bfb1c42 --- /dev/null +++ b/tests/Attribute/AreasTest.php @@ -0,0 +1,99 @@ +has($area)); + } + } + + /** + * @dataProvider provideData + * + * @param string[] $areas + * + * @group legacy + */ + public function testDeprecatedConstruct(array $areas): void + { + $areasAttribute = new Areas(['value' => $areas]); + + foreach ($areas as $area) { + self::assertTrue($areasAttribute->has($area)); + } + } + + public static function provideData(): \Generator + { + yield [ + ['foo', 'bar'], + ]; + + yield [ + ['foo'] + ]; + + yield [ + ['bar'] + ]; + } + + /** + * @dataProvider provideInvalidData + * + * @param string[] $areas + */ + public function testItChecksArrayItemType(array $areas): void + { + self::expectException(\InvalidArgumentException::class); + self::expectExceptionMessage('An area must be given as a string'); + + new Areas($areas); + } + + public function testItChecksEmptyArray(): void + { + self::expectException(\InvalidArgumentException::class); + self::expectExceptionMessage('A list of areas was expected'); + + new Areas([]); + } + + public static function provideInvalidData(): \Generator + { + yield [ + ['foo', 'bar', 42], + ]; + + yield [ + ['foo', 'bar', []], + ]; + + yield [ + ['foo', 'bar', new \stdClass()], + ]; + } +} diff --git a/tests/Command/DumpCommandTest.php b/tests/Command/DumpCommandTest.php new file mode 100644 index 000000000..02a411517 --- /dev/null +++ b/tests/Command/DumpCommandTest.php @@ -0,0 +1,147 @@ + $jsonOptions + */ + public function testJson(array $jsonOptions, int $expectedJsonFlags): void + { + $output = $this->executeDumpCommand($jsonOptions + [ + '--area' => 'test', + ]); + self::assertEquals( + json_encode($this->getOpenApiDefinition('test'), $expectedJsonFlags)."\n", + $output + ); + } + + public static function provideJsonMode(): \Generator + { + yield 'pretty print' => [[], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES]; + + yield 'one line' => [['--no-pretty'], 0 | JSON_UNESCAPED_SLASHES]; + } + + public function testYaml(): void + { + $output = $this->executeDumpCommand([ + '--format' => 'yaml', + '--server-url' => 'http://example.com/api', + ]); + $expectedYaml = <<executeDumpCommand([ + '--area' => 'test', + '--format' => 'html', + '--html-config' => json_encode($htmlConfig), + ]); + self::assertStringContainsString('', $output); + self::assertStringContainsString('', $output); + self::assertStringContainsString($expectedHtml, $output); + } + + public static function provideAssetsMode(): \Generator + { + yield 'default mode is cdn' => [ + null, + 'https://cdn.jsdelivr.net', + ]; + + yield 'invalid mode fallbacks to cdn' => [ + 'invalid', + 'https://cdn.jsdelivr.net', + ]; + + yield 'select cdn mode' => [ + ['assets_mode' => AssetsMode::CDN], + 'https://cdn.jsdelivr.net', + ]; + + yield 'select offline mode' => [ + ['assets_mode' => AssetsMode::OFFLINE], + '', + ]; + yield 'external css' => [ + AssetsMode::BUNDLE, + 'https://cdn.com/my.css', + '', + ]; + } + + public static function provideJs(): \Generator + { + yield 'bundled js' => [ + AssetsMode::BUNDLE, + 'init-swagger-ui.js', + '', + ]; + yield 'cdn js' => [ + AssetsMode::CDN, + 'init-swagger-ui.js', + '', + ]; + yield 'offline js' => [ + AssetsMode::OFFLINE, + 'init-swagger-ui.js', + '', + ]; + yield 'external js' => [ + AssetsMode::BUNDLE, + 'https://cdn.com/my.js', + '', + ]; + } + + public static function provideImage(): \Generator + { + yield 'bundled image' => [ + AssetsMode::BUNDLE, + 'logo.png', + '/bundles/nelmioapidoc/logo.png', + ]; + yield 'cdn image' => [ + AssetsMode::CDN, + 'logo.png', + self::CDN_DIR.'/logo.png', + ]; + yield 'offline image fallbacks to cdn' => [ + AssetsMode::OFFLINE, + 'logo.png', + self::CDN_DIR.'/logo.png', + ]; + } +} diff --git a/tests/Render/RenderOpenApiTest.php b/tests/Render/RenderOpenApiTest.php new file mode 100644 index 000000000..b9bcda55c --- /dev/null +++ b/tests/Render/RenderOpenApiTest.php @@ -0,0 +1,85 @@ +createMock(OpenApiRenderer::class); + $openApiRenderer->method('getFormat')->willReturn(self::FORMAT); + $openApiRenderer->expects(self::once())->method('render'); + $this->renderOpenApi($openApiRenderer); + } + + public function testUnknownFormat(): void + { + $availableOpenApiRenderers = []; + $this->expectExceptionObject(new \InvalidArgumentException(sprintf('Format "%s" is not supported.', self::FORMAT))); + $this->renderOpenApi(...$availableOpenApiRenderers); + } + + public function testUnknownArea(): void + { + $this->hasArea = false; + $this->expectExceptionObject(new \InvalidArgumentException(sprintf('Area "%s" is not supported.', self::AREA))); + $this->renderOpenApi(); + } + + public function testNullFormat(): void + { + $openApiRenderer = $this->createMock(OpenApiRenderer::class); + $openApiRenderer->method('getFormat')->willReturn(self::FORMAT); + $openApiRenderer->expects(self::once())->method('render'); + + $availableOpenApiRenderers = [ + $openApiRenderer, + null, + ]; + $this->renderOpenApi(...$availableOpenApiRenderers); + } + + private function renderOpenApi(?OpenApiRenderer ...$openApiRenderer): void + { + $spec = $this->createMock(OpenApi::class); + $generator = new class($spec) { + private OpenApi $spec; + + public function __construct(OpenApi $spec) + { + $this->spec = $spec; + } + + public function generate(): OpenApi + { + return $this->spec; + } + }; + + $generatorLocator = $this->createMock(ContainerInterface::class); + $generatorLocator->method('has')->willReturn($this->hasArea); + $generatorLocator->method('get')->willReturn($generator); + + $renderOpenApi = new RenderOpenApi($generatorLocator, ...$openApiRenderer); + $renderOpenApi->render(self::FORMAT, self::AREA, []); + } +} diff --git a/tests/RouteDescriber/FosRestDescriberTest.php b/tests/RouteDescriber/FosRestDescriberTest.php new file mode 100644 index 000000000..65c3c91b3 --- /dev/null +++ b/tests/RouteDescriber/FosRestDescriberTest.php @@ -0,0 +1,103 @@ +requirements = new Choice($choices); + + $readerMock = null; + if (interface_exists(Reader::class)) { + $readerMock = $this->createMock(Reader::class); + $readerMock->method('getMethodAnnotations')->willReturn([ + $queryParam, + ]); + } + + $fosRestDescriber = new FosRestDescriber($readerMock, []); + $api = new OpenApi([]); + + $fosRestDescriber->describe( + $api, + new Route('/'), + $this->createMock(\ReflectionMethod::class) + ); + + self::assertSame($choices, $api->paths[0]->get->parameters[0]->schema->enum); + } + + public function testQueryParamWithChoiceConstraintCallbackIsAddedAsEnum(): void + { + $queryParam = new QueryParam(); + $choice = new Choice(); + $choice->callback = function () { + return ['foo', 'bar']; + }; + + $queryParam->requirements = $choice; + $readerMock = $this->createMock(Reader::class); + $readerMock->method('getMethodAnnotations')->willReturn([ + $queryParam, + ]); + + $fosRestDescriber = new FosRestDescriber($readerMock, []); + $api = new OpenApi([]); + + $fosRestDescriber->describe( + $api, + new Route('/'), + $this->createMock(\ReflectionMethod::class) + ); + + self::assertSame(['foo', 'bar'], $api->paths[0]->get->parameters[0]->schema->enum); + } + + public function testQueryParamWithChoiceConstraintAsArray(): void + { + $choices = ['foo', 'bar']; + + $queryParam = new QueryParam(); + $choice = new Choice($choices); + $choice->multiple = true; + $queryParam->requirements = $choice; + + $readerMock = $this->createMock(Reader::class); + $readerMock->method('getMethodAnnotations')->willReturn([ + $queryParam, + ]); + + $fosRestDescriber = new FosRestDescriber($readerMock, []); + $api = new OpenApi([]); + + $fosRestDescriber->describe( + $api, + new Route('/'), + $this->createMock(\ReflectionMethod::class) + ); + + self::assertEquals('array', $api->paths[0]->get->parameters[0]->schema->type); + self::assertSame($choices, $api->paths[0]->get->parameters[0]->schema->items->enum); + } +} diff --git a/tests/RouteDescriber/RouteArgumentDescriber/SymfonyMapRequestPayloadDescriberTest.php b/tests/RouteDescriber/RouteArgumentDescriber/SymfonyMapRequestPayloadDescriberTest.php new file mode 100644 index 000000000..362fd045f --- /dev/null +++ b/tests/RouteDescriber/RouteArgumentDescriber/SymfonyMapRequestPayloadDescriberTest.php @@ -0,0 +1,76 @@ +hasProperty('type')) { + self::markTestSkipped('Requires Symfony 7.1'); + } + + $registry = new ModelRegistry( + [$this->createMock(ModelDescriberInterface::class)], + $this->createMock(OpenApi::class), + ); + $describer = new SymfonyMapRequestPayloadDescriber(); + $describer->setModelRegistry($registry); + + $argumentData = new ArgumentMetadata( + 'someObjects', + Type::BUILTIN_TYPE_ARRAY, + false, + false, + null, + false, + [ + new MapRequestPayload( + null, + [], + null, + RequestPayloadValueResolver::class, + Response::HTTP_UNPROCESSABLE_ENTITY, + SomeObject::class + ), + ] + ); + + $operation = $this->createMock(Operation::class); + $operation->_context = new Context(); + + $describer->describe($argumentData, $operation); + + self::assertSame('#/components/schemas/SomeObject', $operation->_context->{SymfonyMapRequestPayloadDescriber::CONTEXT_MODEL_REF}); + } +} diff --git a/tests/RouteDescriber/RouteArgumentDescriber/fixture/SomeObject.php b/tests/RouteDescriber/RouteArgumentDescriber/fixture/SomeObject.php new file mode 100644 index 000000000..3a4f256fe --- /dev/null +++ b/tests/RouteDescriber/RouteArgumentDescriber/fixture/SomeObject.php @@ -0,0 +1,18 @@ +describe(new OpenApi(['_context' => new Context()]), new Route('foo'), new \ReflectionMethod(__CLASS__, 'testUndefinedCheck')); + } + + public function testRouteRequirementsWithPattern(): void + { + $api = new OpenApi([]); + $routeDescriber = new RouteMetadataDescriber(); + $route = new Route('/index/{bar}/{foo}.html', [], ['foo' => '[0-9]|[a-z]'], [], 'localhost', 'https', ['GET']); + $routeDescriber->describe( + $api, + $route, + new \ReflectionMethod(__CLASS__, 'testRouteRequirementsWithPattern') + ); + + self::assertSame('/index/{bar}/{foo}.html', $api->paths[0]->path); + $getPathParameter = $api->paths[0]->get->parameters[1]; + if ('foo' === $getPathParameter->name) { + self::assertSame('path', $getPathParameter->in); + self::assertSame('foo', $getPathParameter->name); + self::assertSame('string', $getPathParameter->schema->type); + self::assertSame('[0-9]|[a-z]', $getPathParameter->schema->pattern); + } + } + + /** + * @dataProvider provideEnumPattern + */ + public function testSimpleOrRequirementsAreHandledAsEnums(string $req): void + { + $api = new OpenApi([]); + $routeDescriber = new RouteMetadataDescriber(); + $route = new Route('/index/{bar}/{foo}.html', [], ['foo' => $req], [], 'localhost', 'https', ['GET']); + $routeDescriber->describe( + $api, + $route, + new \ReflectionMethod(__CLASS__, 'testSimpleOrRequirementsAreHandledAsEnums') + ); + + self::assertSame('/index/{bar}/{foo}.html', $api->paths[0]->path); + $getPathParameter = $api->paths[0]->get->parameters[1]; + self::assertSame('path', $getPathParameter->in); + self::assertSame('foo', $getPathParameter->name); + self::assertSame('string', $getPathParameter->schema->type); + self::assertSame(explode('|', $req), $getPathParameter->schema->enum); + self::assertSame($req, $getPathParameter->schema->pattern); + } + + /** + * @dataProvider provideInvalidEnumPattern + */ + public function testNonEnumPatterns(string $pattern): void + { + $api = new OpenApi([]); + $routeDescriber = new RouteMetadataDescriber(); + $route = new Route('/index/{foo}.html', [], ['foo' => $pattern], [], 'localhost', 'https', ['GET']); + $routeDescriber->describe( + $api, + $route, + new \ReflectionMethod(__CLASS__, 'testNonEnumPatterns') + ); + + $getPathParameter = $api->paths[0]->get->parameters[0]; + self::assertSame($pattern, $getPathParameter->schema->pattern); + self::assertSame(Generator::UNDEFINED, $getPathParameter->schema->enum); + } + + public static function provideEnumPattern(): \Generator + { + yield ['1|2|3']; + yield ['srf|rtr|rsi']; + yield ['srf-1|srf-2']; + yield ['srf-1|srf-2']; + } + + public static function provideInvalidEnumPattern(): \Generator + { + yield ['|']; + yield ['|a']; + yield ['srf|*|rtr']; + yield ['srf||rtr']; + yield ['1|2|']; + yield ['/1|2/']; + yield ['\d|a']; + // dots have special meaning and should be skipped + yield ['a_1\.html|b-2\.html']; + yield ['a_1.html|b-2.html']; + } +} diff --git a/tests/Routing/FilteredRouteCollectionBuilderTest.php b/tests/Routing/FilteredRouteCollectionBuilderTest.php new file mode 100644 index 000000000..39f9ec933 --- /dev/null +++ b/tests/Routing/FilteredRouteCollectionBuilderTest.php @@ -0,0 +1,383 @@ +doctrineAnnotations = class_exists(AnnotationReader::class) ? new AnnotationReader() : null; + } + + public function testFilter(): void + { + $options = [ + 'path_patterns' => [ + '^/api/foo', + '^/api/bar', + ], + 'host_patterns' => [ + '^$', + '^api\.', + ], + ]; + + $routes = new RouteCollection(); + foreach ($this->getRoutes() as $name => $route) { + $routes->add($name, $route); + } + + $routeBuilder = new FilteredRouteCollectionBuilder( + $this->doctrineAnnotations, + $this->createControllerReflector(), + 'areaName', + $options + ); + $filteredRoutes = $routeBuilder->filter($routes); + + self::assertCount(4, $filteredRoutes); + } + + /** + * @group legacy + * + * @expectedDeprecation Passing an indexed array with a collection of path patterns as argument 1 for `Nelmio\ApiDocBundle\Routing\FilteredRouteCollectionBuilder::__construct()` is deprecated since 3.2.0, expected structure is an array containing parameterized options. + */ + public function testFilterWithDeprecatedArgument(): void + { + $pathPattern = [ + '^/api/foo', + '^/api/bar', + ]; + + $routes = new RouteCollection(); + foreach ($this->getRoutes() as $name => $route) { + $routes->add($name, $route); + } + + $routeBuilder = new FilteredRouteCollectionBuilder( + $this->doctrineAnnotations, + $this->createControllerReflector(), + 'areaName', + $pathPattern + ); + $filteredRoutes = $routeBuilder->filter($routes); + + self::assertCount(5, $filteredRoutes); + } + + /** + * @dataProvider getInvalidOptions + * + * @param array $options + */ + public function testFilterWithInvalidOption(array $options): void + { + $this->expectException(InvalidArgumentException::class); + + new FilteredRouteCollectionBuilder( + $this->doctrineAnnotations, + $this->createControllerReflector(), + 'areaName', + $options + ); + } + + public static function getInvalidOptions(): \Generator + { + yield [['invalid_option' => null]]; + yield [['invalid_option' => 42]]; + yield [['invalid_option' => []]]; + yield [['path_patterns' => [22]]]; + yield [['path_patterns' => [null]]]; + yield [['path_patterns' => [new \stdClass()]]]; + yield [['path_patterns' => ['^/foo$', 1]]]; + yield [['with_annotation' => ['an array']]]; + yield [['with_attribute' => ['an array']]]; + yield [['path_patterns' => 'a string']]; + yield [['path_patterns' => 11]]; + yield [['name_patterns' => 22]]; + yield [['name_patterns' => 'a string']]; + yield [['name_patterns' => [22]]]; + yield [['name_patterns' => [null]]]; + yield [['name_patterns' => [new \stdClass()]]]; + } + + /** + * @return array + */ + private function getRoutes(): array + { + return [ + 'r1' => new Route('/api/bar/action1'), + 'r2' => new Route('/api/foo/action1'), + 'r3' => new Route('/api/foo/action2'), + 'r4' => new Route('/api/demo'), + 'r5' => new Route('/_profiler/test/test'), + 'r6' => new Route('/admin/bar/action1', [], [], [], 'www.example.com'), + 'r7' => new Route('/api/bar/action1', [], [], [], 'www.example.com'), + 'r8' => new Route('/admin/bar/action1', [], [], [], 'api.example.com'), + 'r9' => new Route('/api/bar/action1', [], [], [], 'api.example.com'), + 'r10' => new Route('/api/areas/new'), + ]; + } + + /** + * @dataProvider getMatchingRoutes + * + * @param array $options + */ + public function testMatchingRoutes(string $name, Route $route, array $options = []): void + { + $routes = new RouteCollection(); + $routes->add($name, $route); + + $routeBuilder = new FilteredRouteCollectionBuilder( + $this->doctrineAnnotations, + $this->createControllerReflector(), + 'area', + $options + ); + $filteredRoutes = $routeBuilder->filter($routes); + + self::assertCount(1, $filteredRoutes); + } + + public static function getMatchingRoutes(): \Generator + { + yield from [ + ['r1', new Route('/api/bar/action1')], + ['r2', new Route('/api/foo/action1'), ['path_patterns' => ['^/api', 'i/fo', 'n1$']]], + ['r3', new Route('/api/foo/action2'), ['path_patterns' => ['^/api/foo/action2$']]], + ['r4', new Route('/api/demo'), ['path_patterns' => ['/api/demo'], 'name_patterns' => ['r4']]], + ['r9', new Route('/api/bar/action1', [], [], [], 'api.example.com'), ['path_patterns' => ['^/api/'], 'host_patterns' => ['^api\.ex']]], + ['r10', new Route('/api/areas/new'), ['path_patterns' => ['^/api']]], + ]; + + if (\PHP_VERSION_ID < 80000) { + yield ['r10', new Route('/api/areas_attributes/new'), ['path_patterns' => ['^/api']]]; + } + } + + /** + * @group test + * + * @dataProvider getMatchingRoutesWithAnnotation + * + * @param array $options + */ + public function testMatchingRoutesWithAnnotation(string $name, Route $route, array $options = []): void + { + $routes = new RouteCollection(); + $routes->add($name, $route); + $area = 'area'; + + $reflectionMethodStub = $this->createMock(\ReflectionMethod::class); + $controllerReflectorStub = $this->createMock(ControllerReflector::class); + $controllerReflectorStub->method('getReflectionMethod')->willReturn($reflectionMethodStub); + + $annotationReader = null; + if (interface_exists(Reader::class)) { + $annotationReader = $this->createMock(Reader::class); + $annotationReader + ->method('getMethodAnnotation') + ->with($reflectionMethodStub, Areas::class) + ->willReturn(new Areas([$area])) + ; + } + + $routeBuilder = new FilteredRouteCollectionBuilder( + $annotationReader, + $controllerReflectorStub, + $area, + $options + ); + $filteredRoutes = $routeBuilder->filter($routes); + + self::assertCount(1, $filteredRoutes); + } + + public static function getMatchingRoutesWithAnnotation(): \Generator + { + yield from [ + 'with annotation only, deprecated' => [ + 'r10', + new Route('/api/areas/new', ['_controller' => 'ApiController::newAreaAction']), + ['with_annotation' => true], + ], + 'with annotation only' => [ + 'r10', + new Route('/api/areas/new', ['_controller' => 'ApiController::newAreaAction']), + ['with_attribute' => true], + ], + 'with annotation and path patterns, deprecated' => [ + 'r10', + new Route('/api/areas/new', ['_controller' => 'ApiController::newAreaAction']), + ['path_patterns' => ['^/api'], 'with_annotation' => true], + ], + 'with annotation and path patterns' => [ + 'r10', + new Route('/api/areas/new', ['_controller' => 'ApiController::newAreaAction']), + ['path_patterns' => ['^/api'], 'with_attribute' => true], + ], + ]; + + if (\PHP_VERSION_ID < 80000) { + yield from [ + 'with attribute only, deprecated' => [ + 'r10', + new Route('/api/areas_attributes/new', ['_controller' => 'ApiController::newAreaActionAttributes']), + ['with_annotation' => true], + ], + 'with attribute only' => [ + 'r10', + new Route('/api/areas_attributes/new', ['_controller' => 'ApiController::newAreaActionAttributes']), + ['with_attribute' => true], + ], + 'with attribute and path patterns, deprecated' => [ + 'r10', + new Route('/api/areas_attributes/new', ['_controller' => 'ApiController::newAreaActionAttributes']), + ['path_patterns' => ['^/api'], 'with_annotation' => true], + ], + 'with attribute and path patterns' => [ + 'r10', + new Route('/api/areas_attributes/new', ['_controller' => 'ApiController::newAreaActionAttributes']), + ['path_patterns' => ['^/api'], 'with_attribute' => true], + ], + ]; + } + } + + /** + * @dataProvider getNonMatchingRoutes + * + * @param array $options + */ + public function testNonMatchingRoutes(string $name, Route $route, array $options = []): void + { + $routes = new RouteCollection(); + $routes->add($name, $route); + + $routeBuilder = new FilteredRouteCollectionBuilder( + $this->doctrineAnnotations, + $this->createControllerReflector(), + 'areaName', + $options + ); + $filteredRoutes = $routeBuilder->filter($routes); + + self::assertCount(0, $filteredRoutes); + } + + public static function getNonMatchingRoutes(): \Generator + { + yield ['r1', new Route('/api/bar/action1'), ['path_patterns' => ['^/apis']]]; + yield ['r2', new Route('/api/foo/action1'), ['path_patterns' => ['^/apis', 'i/foo/b', 'n1/$'], 'name_patterns' => ['r2']]]; + yield ['r3_matching_path_and_non_matching_host', new Route('/api/foo/action2'), ['path_patterns' => ['^/api/foo/action2$'], 'host_patterns' => ['^api\.']]]; + yield ['r4_matching_path_and_non_matching_host', new Route('/api/bar/action1', [], [], [], 'www.example.com'), ['path_patterns' => ['^/api/'], 'host_patterns' => ['^api\.']]]; + yield ['r5_non_matching_path_and_matching_host', new Route('/admin/bar/action1', [], [], [], 'api.example.com'), ['path_patterns' => ['^/api/'], 'host_patterns' => ['^api\.']]]; + yield ['r6_non_matching_path_and_non_matching_host', new Route('/admin/bar/action1', [], [], [], 'www.example.com'), ['path_patterns' => ['^/api/'], 'host_patterns' => ['^api\.ex']]]; + } + + /** + * @dataProvider getRoutesWithDisabledDefaultRoutes + * + * @param array $annotations + * @param array $options + */ + public function testRoutesWithDisabledDefaultRoutes( + string $name, + Route $route, + array $annotations, + array $options, + int $expectedRoutesCount + ): void { + $routes = new RouteCollection(); + $routes->add($name, $route); + $area = 'area'; + + $reflectionMethodStub = $this->createMock(\ReflectionMethod::class); + $controllerReflectorStub = $this->createMock(ControllerReflector::class); + $controllerReflectorStub->method('getReflectionMethod')->willReturn($reflectionMethodStub); + + $annotationReader = null; + if (interface_exists(Reader::class)) { + $annotationReader = $this->createMock(Reader::class); + $annotationReader + ->method('getMethodAnnotations') + ->willReturn($annotations) + ; + } + + $routeBuilder = new FilteredRouteCollectionBuilder( + $annotationReader, + $controllerReflectorStub, + $area, + $options + ); + $filteredRoutes = $routeBuilder->filter($routes); + + self::assertCount($expectedRoutesCount, $filteredRoutes); + } + + public static function getRoutesWithDisabledDefaultRoutes(): \Generator + { + yield 'non matching route without Annotation' => [ + 'r10', + new Route('/api/foo', ['_controller' => 'ApiController::fooAction']), + [], + ['disable_default_routes' => true], + 0, + ]; + yield 'matching route with Nelmio Annotation' => [ + 'r10', + new Route('/api/foo', ['_controller' => 'ApiController::fooAction']), + [new Operation(['_context' => new Context()])], + ['disable_default_routes' => true], + 1, + ]; + yield 'matching route with Swagger Annotation' => [ + 'r10', + new Route('/api/foo', ['_controller' => 'ApiController::fooAction']), + [new Parameter(['_context' => new Context()])], + ['disable_default_routes' => true], + 1, + ]; + } + + private function createControllerReflector(): ControllerReflector + { + return new ControllerReflector(new Container()); + } +} diff --git a/tests/SwaggerPhp/UtilTest.php b/tests/SwaggerPhp/UtilTest.php new file mode 100644 index 000000000..2510b2664 --- /dev/null +++ b/tests/SwaggerPhp/UtilTest.php @@ -0,0 +1,938 @@ +rootContext = new Context(['isTestingRoot' => true]); + $this->rootAnnotation = self::createObj(OA\OpenApi::class, ['_context' => $this->rootContext]); + + set_error_handler( + static function ($errno, $errstr) { + throw new \Exception($errstr, $errno); + }, + E_ALL + ); + } + + public function tearDown(): void + { + restore_error_handler(); + } + + public function testCreateContextSetsParentContext(): void + { + $context = Util::createContext([], $this->rootContext); + + $this->assertContextIsConnectedToRootContext($context); + } + + public function testCreateContextWithProperties(): void + { + $context = Util::createContext(['testing' => 'trait']); + + self::assertTrue($context->is('testing')); + self::assertSame('trait', $context->testing); + } + + public function testCreateChild(): void + { + $info = Util::createChild($this->rootAnnotation, OA\Info::class); + + self::assertInstanceOf(OA\Info::class, $info); + } + + public function testCreateChildHasContext(): void + { + $info = Util::createChild($this->rootAnnotation, OA\Info::class); + + self::assertInstanceOf(Context::class, $info->_context); + } + + public function testCreateChildHasNestedContext(): void + { + $path = Util::createChild($this->rootAnnotation, OA\PathItem::class); + $this->assertIsNested($this->rootAnnotation, $path); + + $parameter = Util::createChild($path, OA\Parameter::class); + $this->assertIsNested($path, $parameter); + + $schema = Util::createChild($parameter, OA\Schema::class); + $this->assertIsNested($parameter, $schema); + + $this->assertIsConnectedToRootContext($schema); + } + + public function testCreateChildWithEmptyProperties(): void + { + $properties = []; + /** @var OA\Info $info */ + $info = Util::createChild($this->rootAnnotation, OA\Info::class, $properties); + + $properties = array_filter(\get_object_vars($info), function ($key) { + return 0 !== \strpos($key, '_'); + }, ARRAY_FILTER_USE_KEY); + + self::assertEquals([Generator::UNDEFINED], array_unique(array_values($properties))); + + $this->assertIsNested($this->rootAnnotation, $info); + $this->assertIsConnectedToRootContext($info); + } + + public function testCreateChildWithProperties(): void + { + $properties = ['title' => 'testing', 'version' => '999', 'x' => new \stdClass()]; + /** @var OA\Info $info */ + $info = Util::createChild($this->rootAnnotation, OA\Info::class, $properties); + + self::assertSame($info->title, $properties['title']); + self::assertSame($info->version, $properties['version']); + self::assertSame($info->x, $properties['x']); + + $this->assertIsNested($this->rootAnnotation, $info); + $this->assertIsConnectedToRootContext($info); + } + + public function testCreateCollectionItemAddsCreatedItemToCollection(): void + { + $collection = 'paths'; + $class = OA\PathItem::class; + + $p1 = Util::createCollectionItem($this->rootAnnotation, $collection, $class); + self::assertSame(0, $p1); + self::assertCount(1, $this->rootAnnotation->{$collection}); + self::assertInstanceOf($class, $this->rootAnnotation->{$collection}[$p1]); + $this->assertIsNested($this->rootAnnotation, $this->rootAnnotation->{$collection}[$p1]); + $this->assertIsConnectedToRootContext($this->rootAnnotation->{$collection}[$p1]); + + $p2 = Util::createCollectionItem($this->rootAnnotation, $collection, $class); + self::assertSame(1, $p2); + self::assertCount(2, $this->rootAnnotation->{$collection}); + self::assertInstanceOf($class, $this->rootAnnotation->{$collection}[$p2]); + $this->assertIsNested($this->rootAnnotation, $this->rootAnnotation->{$collection}[$p2]); + $this->assertIsConnectedToRootContext($this->rootAnnotation->{$collection}[$p2]); + + $this->rootAnnotation->components = Util::createChild($this->rootAnnotation, OA\Components::class); + + $collection = 'schemas'; + $class = OA\Schema::class; + + $d1 = Util::createCollectionItem($this->rootAnnotation->components, $collection, $class); + self::assertSame(0, $d1); + self::assertCount(1, $this->rootAnnotation->components->{$collection}); + self::assertInstanceOf($class, $this->rootAnnotation->components->{$collection}[$d1]); + $this->assertIsNested($this->rootAnnotation->components, $this->rootAnnotation->components->{$collection}[$d1]); + $this->assertIsConnectedToRootContext($this->rootAnnotation->components->{$collection}[$d1]); + } + + public function testCreateCollectionItemDoesNotAddToUnknownProperty(): void + { + $collection = 'foobars'; + $class = OA\Info::class; + + self::expectException(\Exception::class); + self::expectExceptionMessage("Property \"foobars\" doesn't exist"); + Util::createCollectionItem($this->rootAnnotation, $collection, $class); + + self::expectException(\Exception::class); + self::expectExceptionMessage("Property \"foobars\" doesn't exist"); + self::assertNull($this->rootAnnotation->{$collection}); /* @phpstan-ignore-line */ + } + + public function testSearchCollectionItem(): void + { + $item1 = new \stdClass(); + $item1->prop1 = 'item 1 prop 1'; + $item1->prop2 = 'item 1 prop 2'; + $item1->prop3 = 'item 1 prop 3'; + + $item2 = new \stdClass(); + $item2->prop1 = 'item 2 prop 1'; + $item2->prop2 = 'item 2 prop 2'; + $item2->prop3 = 'item 2 prop 3'; + + $collection = [ + $item1, + $item2, + ]; + + self::assertSame(0, Util::searchCollectionItem($collection, \get_object_vars($item1))); + self::assertSame(1, Util::searchCollectionItem($collection, \get_object_vars($item2))); + + self::assertNull(Util::searchCollectionItem( + $collection, + array_merge(\get_object_vars($item2), ['prop3' => 'foobar']) + )); + + $search = ['baz' => 'foobar']; + + self::expectException(\Exception::class); + self::expectExceptionMessage('Undefined property: stdClass::$baz'); + Util::searchCollectionItem($collection, array_merge(\get_object_vars($item2), $search)); + + // no exception on empty collection + self::assertNull(Util::searchCollectionItem([], \get_object_vars($item2))); + } + + /** + * @dataProvider provideIndexedCollectionData + * + * @param array $setup + * @param array $asserts + */ + public function testSearchIndexedCollectionItem(array $setup, array $asserts): void + { + foreach ($asserts as $collection => $items) { + foreach ($items as $assert) { + $setupCollection = !isset($assert['components']) ? + ($setup[$collection] ?? []) : + (Generator::UNDEFINED !== $setup['components']->{$collection} ? $setup['components']->{$collection} : []); + + // get the indexing correct within haystack preparation + $properties = array_fill(0, \count($setupCollection), null); + + // prepare the haystack array + foreach ($items as $assertItem) { + // e.g. $properties[1] = self::createObj(OA\PathItem::class, ['path' => 'path 1']) + $properties[$assertItem['index']] = self::createObj($assertItem['class'], [ + $assertItem['key'] => $assertItem['value'], + ]); + } + + self::assertSame( + $assert['index'], + Util::searchIndexedCollectionItem($properties, $assert['key'], $assert['value']), + sprintf('Failed to get the correct index for %s', print_r($assert, true)) + ); + } + } + } + + /** + * @dataProvider provideIndexedCollectionData + * + * @param array $setup + * @param array $asserts + */ + public function testGetIndexedCollectionItem(array $setup, array $asserts): void + { + $parent = new $setup['class'](array_merge( + $this->getSetupPropertiesWithoutClass($setup), + ['_context' => $this->rootContext] + )); + + foreach ($asserts as $collection => $items) { + foreach ($items as $assert) { + $itemParent = !isset($assert['components']) ? $parent : $parent->components; + + self::assertTrue(is_a($assert['class'], OA\AbstractAnnotation::class, true), sprintf('Invalid class %s', $assert['class'])); + $child = Util::getIndexedCollectionItem( + $itemParent, + $assert['class'], + $assert['value'] + ); + + self::assertInstanceOf($assert['class'], $child); + self::assertSame($child->{$assert['key']}, $assert['value']); + self::assertSame( + $itemParent->{$collection}[$assert['index']], + $child + ); + + $setupHaystack = !isset($assert['components']) ? + $setup[$collection] ?? [] : + $setup['components']->{$collection} ?? []; + + // the children created within provider are not connected + if (!\in_array($child, $setupHaystack, true)) { + $this->assertIsNested($itemParent, $child); + $this->assertIsConnectedToRootContext($child); + } + } + } + } + + public static function provideIndexedCollectionData(): \Generator + { + yield [ + 'setup' => [ + 'class' => OA\OpenApi::class, + 'paths' => [ + self::createObj(OA\PathItem::class, ['path' => 'path 0']), + ], + 'components' => self::createObj(OA\Components::class, [ + 'parameters' => [ + self::createObj(OA\Parameter::class, ['parameter' => 'parameter 0']), + self::createObj(OA\Parameter::class, ['parameter' => 'parameter 1']), + ], + ]), + ], + 'assert' => [ + // one fixed within setup and one dynamically created + 'paths' => [ + [ + 'index' => 0, + 'class' => OA\PathItem::class, + 'key' => 'path', + 'value' => 'path 0', + ], + [ + 'index' => 1, + 'class' => OA\PathItem::class, + 'key' => 'path', + 'value' => 'path 1', + ], + ], + // search indexes out of order followed by dynamically created + 'parameters' => [ + [ + 'index' => 1, + 'class' => OA\Parameter::class, + 'key' => 'parameter', + 'value' => 'parameter 1', + 'components' => true, + ], + [ + 'index' => 0, + 'class' => OA\Parameter::class, + 'key' => 'parameter', + 'value' => 'parameter 0', + 'components' => true, + ], + [ + 'index' => 2, + 'class' => OA\Parameter::class, + 'key' => 'parameter', + 'value' => 'parameter 2', + 'components' => true, + ], + ], + // two dynamically created + 'responses' => [ + [ + 'index' => 0, + 'class' => OA\Response::class, + 'key' => 'response', + 'value' => 'response 0', + 'components' => true, + ], + [ + 'index' => 1, + 'class' => OA\Response::class, + 'key' => 'response', + 'value' => 'response 1', + 'components' => true, + ], + ], + // for sake of completeness + 'securitySchemes' => [ + [ + 'index' => 0, + 'class' => OA\SecurityScheme::class, + 'key' => 'securityScheme', + 'value' => 'securityScheme 0', + 'components' => true, + ], + ], + ], + ]; + } + + /** + * @dataProvider provideChildData + * + * @param array $setup + * @param array $asserts + */ + public function testGetChild(array $setup, array $asserts): void + { + $parent = new $setup['class'](array_merge( + $this->getSetupPropertiesWithoutClass($setup), + ['_context' => $this->rootContext] + )); + + foreach ($asserts as $key => $assert) { + if (\array_key_exists('exceptionMessage', $assert)) { + $this->expectExceptionMessage($assert['exceptionMessage']); + } + self::assertTrue(is_a($assert['class'], OA\AbstractAnnotation::class, true), sprintf('Invalid class %s', $assert['class'])); + $child = Util::getChild($parent, $assert['class'], $assert['props']); + + self::assertInstanceOf($assert['class'], $child); + self::assertSame($child, $parent->{$key}); + + if (\array_key_exists($key, $setup)) { + self::assertSame($setup[$key], $parent->{$key}); + } + + self::assertEquals($assert['props'], $this->getNonDefaultProperties($child)); + } + } + + public static function provideChildData(): \Generator + { + yield [ + 'setup' => [ + 'class' => OA\PathItem::class, + 'get' => self::createObj(OA\Get::class, []), + ], + 'assert' => [ + // fixed within setup + 'get' => [ + 'class' => OA\Get::class, + 'props' => [], + ], + // create new without props + 'put' => [ + 'class' => OA\Put::class, + 'props' => [], + ], + // create new with multiple props + 'delete' => [ + 'class' => OA\Delete::class, + 'props' => [ + 'summary' => 'testing delete', + 'deprecated' => true, + ], + ], + ], + ]; + + yield [ + 'setup' => [ + 'class' => OA\Parameter::class, + ], + 'assert' => [ + // create new with multiple props + 'schema' => [ + 'class' => OA\Schema::class, + 'props' => [ + 'ref' => '#/testing/schema', + 'minProperties' => 0, + 'enum' => [null, 'check', 999, false], + ], + ], + ], + ]; + + yield [ + 'setup' => [ + 'class' => OA\Parameter::class, + ], + 'assert' => [ + // externalDocs triggers invalid argument exception + 'schema' => [ + 'class' => OA\Schema::class, + 'props' => [ + 'externalDocs' => [], + ], + 'exceptionMessage' => 'Nesting Annotations is not supported.', + ], + ], + ]; + } + + public function testGetOperationParameterReturnsExisting(): void + { + $name = 'operation name'; + $in = 'operation in'; + + $parameter = self::createObj(OA\Parameter::class, ['name' => $name, 'in' => $in]); + $operation = self::createObj(OA\Get::class, ['parameters' => [ + self::createObj(OA\Parameter::class, []), + self::createObj(OA\Parameter::class, ['name' => 'foo']), + self::createObj(OA\Parameter::class, ['in' => 'bar']), + self::createObj(OA\Parameter::class, ['name' => $name, 'in' => 'bar']), + self::createObj(OA\Parameter::class, ['name' => 'foo', 'in' => $in]), + $parameter, + ]]); + + $actual = Util::getOperationParameter($operation, $name, $in); + self::assertSame($parameter, $actual); + } + + public function testGetOperationParameterCreatesWithNameAndIn(): void + { + $name = 'operation name'; + $in = 'operation in'; + + $operation = self::createObj(OA\Get::class, ['parameters' => [ + self::createObj(OA\Parameter::class, []), + self::createObj(OA\Parameter::class, ['name' => 'foo']), + self::createObj(OA\Parameter::class, ['in' => 'bar']), + self::createObj(OA\Parameter::class, ['name' => $name, 'in' => 'bar']), + self::createObj(OA\Parameter::class, ['name' => 'foo', 'in' => $in]), + ]]); + + $actual = Util::getOperationParameter($operation, $name, $in); + self::assertSame($name, $actual->name); + self::assertSame($in, $actual->in); + } + + public function testGetOperationReturnsExisting(): void + { + $get = self::createObj(OA\Get::class, []); + $path = self::createObj(OA\PathItem::class, ['get' => $get]); + + self::assertSame($get, Util::getOperation($path, 'get')); + } + + public function testGetOperationCreatesWithPath(): void + { + $pathStr = '/testing/get/path'; + $path = self::createObj(OA\PathItem::class, ['path' => $pathStr]); + + $get = Util::getOperation($path, 'get'); + self::assertInstanceOf(OA\Get::class, $get); + self::assertSame($pathStr, $get->path); + } + + public function testMergeWithEmptyArray(): void + { + $api = self::createObj(OA\OpenApi::class, ['_context' => new Context()]); + $expected = json_encode($api); + + Util::merge($api, [], false); + $actual = json_encode($api); + + self::assertSame($expected, $actual); + + Util::merge($api, [], true); + $actual = json_encode($api); + + self::assertSame($expected, $actual); + } + + /** + * @dataProvider provideMergeData + * + * @param array $setup + * @param array|\ArrayObject $merge + * @param array $assert + */ + public function testMerge(array $setup, $merge, array $assert): void + { + $api = self::createObj(OA\OpenApi::class, $setup + ['_context' => new Context()]); + + Util::merge($api, $merge, false); + self::assertTrue($api->validate()); + $actual = json_decode(json_encode($api), true); + + self::assertEquals($assert, $actual); + } + + public static function provideMergeData(): \Generator + { + $no = 'do not overwrite'; + $yes = 'do overwrite'; + + $requiredInfo = ['title' => '', 'version' => '']; + + $setupDefaults = [ + 'info' => self::createObj(OA\Info::class, $requiredInfo), + 'paths' => [], + ]; + $assertDefaults = [ + 'info' => $requiredInfo, + 'openapi' => '3.0.0', + 'paths' => [], + ]; + + yield [ + // simple child merge + 'setup' => [ + 'info' => self::createObj(OA\Info::class, ['version' => $no]), + 'paths' => [], + ], + 'merge' => [ + 'info' => ['title' => $yes, 'version' => $yes], + ], + 'assert' => [ + 'info' => ['title' => $yes, 'version' => $no], + ] + $assertDefaults, + ]; + + yield [ + // Parse server url with variables, see https://github.com/nelmio/NelmioApiDocBundle/issues/1691 + 'setup' => $setupDefaults, + 'merge' => [ + 'servers' => [ + [ + 'url' => 'https://api.example.com/secured/{version}', + 'variables' => ['version' => ['default' => 'v1']], + ], + ], + ], + 'assert' => [ + 'servers' => [ + [ + 'url' => 'https://api.example.com/secured/{version}', + 'variables' => ['version' => ['default' => 'v1']], + ], + ], + ] + $assertDefaults, + ]; + + yield [ + // indexed collection merge + 'setup' => [ + 'components' => self::createObj(OA\Components::class, [ + 'schemas' => [ + self::createObj(OA\Schema::class, ['schema' => $no, 'title' => $no]), + ], + ]), + ] + $setupDefaults, + 'merge' => [ + 'components' => [ + 'schemas' => [ + $no => ['title' => $yes, 'description' => $yes], + ], + ], + ], + 'assert' => [ + 'components' => [ + 'schemas' => [ + $no => ['title' => $no, 'description' => $yes], + ], + ], + ] + $assertDefaults, + ]; + + yield [ + // collection merge + 'setup' => [ + 'tags' => [self::createObj(OA\Tag::class, ['name' => $no])], + ] + $setupDefaults, + 'merge' => [ + 'tags' => [ + // this is actually appending right now, no clue if this is wanted, + // but the complete NelmioApiDocBundle test suite is not upset by this fact + ['name' => $yes], + // this should not append since a tag with exactly the same properties + // is already present + ['name' => $no], + // this does, but should not append since the name already exists, and the + // docs in Tag state that the tag names must be unique, but it is complicated + // and $api->validate() does not complain either + ['name' => $no, 'description' => $yes], + ], + ], + 'assert' => [ + 'tags' => [ + ['name' => $no], + ['name' => $yes], + ['name' => $no, 'description' => $yes], + ], + ] + $assertDefaults, + ]; + + yield [ + // heavy nested merge array + 'setup' => $setupDefaults, + 'merge' => $merge = [ + 'servers' => [ + ['url' => 'http'], + ['url' => 'https'], + ], + 'paths' => [ + '/path/to/resource' => [ + 'get' => [ + 'responses' => [ + '200' => [ + '$ref' => '#/components/responses/default', + ], + ], + 'requestBody' => [ + 'description' => 'request foo', + 'content' => [ + 'foo-request' => [ + 'schema' => [ + 'type' => 'object', + 'required' => ['baz', 'bar'], + ], + ], + ], + ], + ], + ], + ], + 'tags' => [ + ['name' => 'baz'], + ['name' => 'foo'], + ['name' => 'baz'], + ['name' => 'foo'], + ['name' => 'foo'], + ], + 'components' => [ + 'responses' => [ + 'default' => [ + 'description' => 'default response', + 'headers' => [ + 'foo-header' => [ + 'schema' => [ + 'type' => 'array', + 'items' => [ + 'type' => 'string', + 'enum' => ['foo', 'bar', 'baz'], + ], + ], + ], + ], + ], + ], + ], + ], + 'assert' => array_merge( + $assertDefaults, + $merge, + ['tags' => \array_slice($merge['tags'], 0, 2, true)] + ), + ]; + + yield [ + // heavy nested merge array object + 'setup' => $setupDefaults, + 'merge' => new \ArrayObject([ + 'servers' => [ + ['url' => 'http'], + ['url' => 'https'], + ], + 'paths' => [ + '/path/to/resource' => [ + 'get' => new \ArrayObject([ + 'responses' => [ + '200' => [ + '$ref' => '#/components/responses/default', + ], + ], + 'requestBody' => new \ArrayObject([ + 'description' => 'request foo', + 'content' => [ + 'foo-request' => [ + 'schema' => [ + 'required' => ['baz', 'bar'], + 'type' => 'object', + ], + ], + ], + ]), + ]), + ], + ], + 'tags' => new \ArrayObject([ + ['name' => 'baz'], + ['name' => 'foo'], + new \ArrayObject(['name' => 'baz']), + ['name' => 'foo'], + ['name' => 'foo'], + ]), + 'components' => new \ArrayObject([ + 'responses' => [ + 'default' => [ + 'description' => 'default response', + 'headers' => new \ArrayObject([ + 'foo-header' => new \ArrayObject([ + 'schema' => new \ArrayObject([ + 'type' => 'array', + 'items' => new \ArrayObject([ + 'type' => 'string', + 'enum' => ['foo', 'bar', 'baz'], + ]), + ]), + ]), + ]), + ], + ], + ]), + ]), + 'assert' => array_merge( + $assertDefaults, + $merge, + ['tags' => \array_slice($merge['tags'], 0, 2, true)] + ), + ]; + + yield [ + // heavy nested merge swagger instance + 'setup' => $setupDefaults, + 'merge' => self::createObj(OA\OpenApi::class, [ + 'servers' => [ + self::createObj(OA\Server::class, ['url' => 'http']), + self::createObj(OA\Server::class, ['url' => 'https']), + ], + 'paths' => [ + self::createObj(OA\PathItem::class, [ + 'path' => '/path/to/resource', + 'get' => self::createObj(OA\Get::class, [ + 'responses' => [ + self::createObj(OA\Response::class, [ + 'response' => '200', + 'ref' => '#/components/responses/default', + ]), + ], + 'requestBody' => self::createObj(OA\RequestBody::class, [ + 'description' => 'request foo', + 'content' => [ + self::createObj(OA\MediaType::class, [ + 'mediaType' => 'foo-request', + 'schema' => self::createObj(OA\Schema::class, [ + 'type' => 'object', + 'required' => ['baz', 'bar'], + ]), + ]), + ], + ]), + ]), + ]), + ], + 'tags' => [ + self::createObj(OA\Tag::class, ['name' => 'baz']), + self::createObj(OA\Tag::class, ['name' => 'foo']), + self::createObj(OA\Tag::class, ['name' => 'baz']), + self::createObj(OA\Tag::class, ['name' => 'foo']), + self::createObj(OA\Tag::class, ['name' => 'foo']), + ], + 'components' => self::createObj(OA\Components::class, [ + 'responses' => [ + self::createObj(OA\Response::class, [ + 'response' => 'default', + 'description' => 'default response', + 'headers' => [ + self::createObj(OA\Header::class, [ + 'header' => 'foo-header', + 'schema' => self::createObj(OA\Schema::class, [ + 'type' => 'array', + 'items' => self::createObj(OA\Items::class, [ + 'type' => 'string', + 'enum' => ['foo', 'bar', 'baz'], + ]), + ]), + ]), + ], + ]), + ], + ]), + ]), + 'assert' => array_merge( + $assertDefaults, + $merge, + ['tags' => \array_slice($merge['tags'], 0, 2, true)] + ), + ]; + } + + public function testGetTag(): void + { + $api = self::createObj(OA\OpenApi::class, ['_context' => new Context()]); + self::assertEquals(Generator::UNDEFINED, $api->tags); + + $tag = Util::getTag($api, 'foo'); + self::assertEquals('foo', $tag->name); + self::assertEquals(Generator::UNDEFINED, $tag->description); + self::assertEquals(Generator::UNDEFINED, $tag->externalDocs); + + self::assertIsArray($api->tags); + + $api->tags[] = self::createObj(OA\Tag::class, ['name' => 'bar', 'description' => 'baz']); + $tag = Util::getTag($api, 'bar'); + self::assertEquals('bar', $tag->name); + self::assertEquals('baz', $tag->description); + } + + public function assertIsNested(OA\AbstractAnnotation $parent, OA\AbstractAnnotation $child): void + { + self::assertTrue($child->_context->is('nested')); + self::assertSame($parent, $child->_context->nested); + } + + public function assertIsConnectedToRootContext(OA\AbstractAnnotation $annotation): void + { + $this->assertContextIsConnectedToRootContext($annotation->_context); + } + + public function assertContextIsConnectedToRootContext(Context $context): void + { + self::assertSame($this->rootContext, $context->root()); + } + + /** + * @param array $setup + * + * @return array + */ + private function getSetupPropertiesWithoutClass(array $setup): array + { + return array_filter($setup, function ($k) {return 'class' !== $k; }, ARRAY_FILTER_USE_KEY); + } + + /** + * @return array + */ + private function getNonDefaultProperties(OA\AbstractAnnotation $object): array + { + $objectVars = \get_object_vars($object); + $classVars = \get_class_vars(\get_class($object)); + $props = []; + foreach ($objectVars as $key => $value) { + if ($value !== $classVars[$key] && 0 !== \strpos($key, '_')) { + $props[$key] = $value; + } + } + + return $props; + } + + /** + * @param class-string $className + * @param array $props + */ + private static function createObj(string $className, array $props = []): object + { + return new $className($props + ['_context' => new Context()]); + } +} diff --git a/tests/TypeDescriber/ArrayDescriberTest.php b/tests/TypeDescriber/ArrayDescriberTest.php new file mode 100644 index 000000000..2117b890b --- /dev/null +++ b/tests/TypeDescriber/ArrayDescriberTest.php @@ -0,0 +1,59 @@ +=')) { + self::markTestSkipped('TypeInfo component is only available in Symfony 7.2 and later'); + } + + $this->describer = new ArrayDescriber(); + } + + /** + * @dataProvider provideInvalidCollectionTypes + * + * @param CollectionType $type + */ + public function testDescribeHandlesInvalidKeyType($type): void + { + self::expectException(\LogicException::class); + self::expectExceptionMessage('This describer only supports '.CollectionType::class.' with '.UnionType::class.' as key type.'); + + $this->describer->describe($type, new Schema([])); + } + + public static function provideInvalidCollectionTypes(): \Generator + { + if (!version_compare(Kernel::VERSION, '7.2.0', '>=')) { + return yield [false]; + } + + yield [Type::array(Type::int(), Type::int())]; + yield [Type::array(Type::int(), Type::string())]; + yield [Type::list()]; + yield [Type::dict()]; + } +} diff --git a/tests/Util/ControllerReflectorTest.php b/tests/Util/ControllerReflectorTest.php new file mode 100644 index 000000000..36e204e4e --- /dev/null +++ b/tests/Util/ControllerReflectorTest.php @@ -0,0 +1,37 @@ +getReflectionMethod([BazingaController::class, 'userAction'])) + ); + self::assertEquals( + \ReflectionMethod::class, + get_class($controllerReflector->getReflectionMethod(BazingaController::class.'::userAction')) + ); + self::assertNull( + $controllerReflector->getReflectionMethod('UnknownController::userAction') + ); + self::assertNull($controllerReflector->getReflectionMethod(null)); + } +} diff --git a/tests/console-application.php b/tests/console-application.php new file mode 100644 index 000000000..d87aa6902 --- /dev/null +++ b/tests/console-application.php @@ -0,0 +1,34 @@ + -# -# For the full copyright and license information, please view the LICENSE -# file that was distributed with this source code. - -#!/bin/sh - -dest=Resources/public/swagger-ui/ - -yarn add --production --no-lockfile swagger-ui-dist -if [ -d $dest ]; then - rm -Rf $dest -fi -mkdir -p $dest - -cp node_modules/swagger-ui-dist/swagger-ui-bundle.js $dest -cp node_modules/swagger-ui-dist/swagger-ui-bundle.js.map $dest -cp node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js $dest -cp node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js.map $dest -cp node_modules/swagger-ui-dist/swagger-ui.css $dest -cp node_modules/swagger-ui-dist/swagger-ui.css.map $dest -rm -Rf package.json node_modules/ diff --git a/utils/.gitignore b/utils/.gitignore new file mode 100644 index 000000000..97008e5b8 --- /dev/null +++ b/utils/.gitignore @@ -0,0 +1,2 @@ +node_modules +yarn.lock \ No newline at end of file diff --git a/utils/package.json b/utils/package.json new file mode 100644 index 000000000..e71aa1681 --- /dev/null +++ b/utils/package.json @@ -0,0 +1,26 @@ +{ + "description": "Script utils for nelmio/api-doc-bundle UI", + "license": "MIT", + "dependencies": { + "@stoplight/elements": "9.0.0", + "redoc": "2.4.0", + "swagger-ui-dist": "5.20.0" + }, + "scripts": { + "swagger": "yarn run swagger:bundle && yarn run swagger:standalone && yarn run swagger:css", + "swagger:bundle": "cp node_modules/swagger-ui-dist/swagger-ui-bundle.js* $npm_package_config_destination_swagger", + "swagger:standalone": "cp node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js* $npm_package_config_destinationswagger", + "swagger:css": "cp node_modules/swagger-ui-dist/swagger-ui.css* $npm_package_config_destination_swagger", + "redoc": "cp node_modules/redoc/bundles/redoc.standalone.js $npm_package_config_destination_redoc", + "stoplight": "yarn run stoplight:js && yarn run stoplight:css", + "stoplight:js": "cp node_modules/@stoplight/elements/web-components.min.js $npm_package_config_destination_stoplight", + "stoplight:css": "cp node_modules/@stoplight/elements/styles.min.css $npm_package_config_destination_stoplight" + }, + "config": { + "destination": { + "swagger": "../public/swagger-ui", + "redoc": "../public/redocly", + "stoplight": "../public/stoplight" + } + } +}