diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 44c797241..5cfc8684d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,7 +1,7 @@ --- name: 🐛 Bug Report description: Report a reproducible bug in the current release of NetBox -labels: ["type: bug", "needs triage"] +labels: ["type: bug", "status: needs triage"] body: - type: markdown attributes: @@ -26,7 +26,7 @@ body: attributes: label: NetBox Version description: What version of NetBox are you currently running? - placeholder: v3.7.4 + placeholder: v4.0.5 validations: required: true - type: dropdown @@ -34,10 +34,9 @@ body: label: Python Version description: What version of Python are you currently running? options: - - "3.8" - - "3.9" - "3.10" - "3.11" + - "3.12" validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/documentation_change.yaml b/.github/ISSUE_TEMPLATE/documentation_change.yaml index 0f80f1716..b5a970782 100644 --- a/.github/ISSUE_TEMPLATE/documentation_change.yaml +++ b/.github/ISSUE_TEMPLATE/documentation_change.yaml @@ -1,7 +1,7 @@ --- name: 📖 Documentation Change description: Suggest an addition or modification to the NetBox documentation -labels: ["type: documentation", "needs triage"] +labels: ["type: documentation", "status: needs triage"] body: - type: dropdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index a550bff57..c351ec599 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,7 +1,7 @@ --- name: ✨ Feature Request description: Propose a new NetBox feature or enhancement -labels: ["type: feature", "needs triage"] +labels: ["type: feature", "status: needs triage"] body: - type: markdown attributes: @@ -14,7 +14,7 @@ body: attributes: label: NetBox version description: What version of NetBox are you currently running? - placeholder: v3.7.4 + placeholder: v4.0.5 validations: required: true - type: dropdown diff --git a/.github/workflows/auto-assign-issue.yml b/.github/workflows/auto-assign-issue.yml index 20e054806..309f79800 100644 --- a/.github/workflows/auto-assign-issue.yml +++ b/.github/workflows/auto-assign-issue.yml @@ -12,9 +12,10 @@ jobs: auto-assign: runs-on: ubuntu-latest steps: - - uses: pozil/auto-assign-issue@v1 - if: "contains(github.event.issue.labels.*.name, 'type: bug') || contains(github.event.issue.labels.*.name, 'type: feature')" + - uses: pozil/auto-assign-issue@v2 + if: "contains(github.event.issue.labels.*.name, 'status: needs triage')" with: - assignees: abhi1693,arthanson,DanSheps,jeffgdotorg,jeremystretch + # Weighted assignments + assignees: arthanson:3, jeffgdotorg:3, jeremystretch:3, DanSheps numOfAssignee: 1 abortIfPreviousAssignees: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d794786f1..a84359bf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,18 @@ name: CI -on: [push, pull_request] + +on: + push: + paths-ignore: + - 'contrib/**' + - 'docs/**' + pull_request: + paths-ignore: + - 'contrib/**' + - 'docs/**' + permissions: contents: read + jobs: build: runs-on: ubuntu-latest @@ -34,12 +45,12 @@ jobs: uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} @@ -47,7 +58,7 @@ jobs: run: npm install -g yarn - name: Setup Node.js with Yarn Caching - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: yarn diff --git a/.github/workflows/close-incomplete-issues.yml b/.github/workflows/close-incomplete-issues.yml new file mode 100644 index 000000000..4d31d735e --- /dev/null +++ b/.github/workflows/close-incomplete-issues.yml @@ -0,0 +1,32 @@ +# close-stale-issues (https://github.com/marketplace/actions/close-stale-issues) +name: Close incomplete issues + +on: + schedule: + - cron: '15 4 * * *' + workflow_dispatch: + +permissions: + actions: write + issues: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + close-issue-message: > + This issue is being closed as no further information has been provided. If + you would like to revisit this topic, please first modify your original post + to include all the requested detail, and then ask that the issue be reopened. + days-before-stale: 7 + days-before-close: 7 + only-issue-labels: 'status: revisions needed' + operations-per-run: 100 + remove-stale-when-updated: false + stale-issue-label: 'pending closure' + stale-issue-message: > + This is a reminder that additional information is needed in order to further + triage this issue. If the requested details are not provided, the issue will + soon be closed automatically. diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index a1bbb0b7e..b02ffdacd 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -7,6 +7,7 @@ on: workflow_dispatch: permissions: + actions: write issues: write pull-requests: write @@ -16,18 +17,19 @@ jobs: steps: - uses: actions/stale@v9 with: + # General parameters + operations-per-run: 100 + remove-stale-when-updated: false + + # Issue parameters close-issue-message: > This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary. - close-pr-message: > - This PR has been automatically closed due to lack of activity. - days-before-stale: 90 - days-before-close: 30 - exempt-issue-labels: 'status: accepted,status: blocked,status: needs milestone' - operations-per-run: 100 - remove-stale-when-updated: false + days-before-issue-stale: 90 + days-before-issue-close: 30 + exempt-issue-labels: 'status: accepted,status: backlog,status: blocked' stale-issue-label: 'pending closure' stale-issue-message: > This issue has been automatically marked as stale because it has not had @@ -37,6 +39,12 @@ jobs: process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md). + + # Pull request parameters + close-pr-message: > + This PR has been automatically closed due to lack of activity. + days-before-pr-stale: 15 + days-before-pr-close: 15 stale-pr-label: 'pending closure' stale-pr-message: > This PR has been automatically marked as stale because it has not had diff --git a/.github/workflows/update-translation-strings.yml b/.github/workflows/update-translation-strings.yml new file mode 100644 index 000000000..bcd68c887 --- /dev/null +++ b/.github/workflows/update-translation-strings.yml @@ -0,0 +1,45 @@ +name: Update translation strings + +on: + schedule: + - cron: '0 5 * * *' + workflow_dispatch: + +permissions: + contents: write + +env: + LOCALE: "en" + +jobs: + makemessages: + runs-on: ubuntu-latest + env: + NETBOX_CONFIGURATION: netbox.configuration_testing + + steps: + - name: Check out repo + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: Install system dependencies + run: sudo apt install -y gettext + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run makemessages + run: python netbox/manage.py makemessages -l ${{ env.LOCALE }} + + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + add: 'netbox/translations/' + default_author: github_actions + message: 'Update source translation strings' diff --git a/.gitignore b/.gitignore index 93954fd41..88faab27c 100644 --- a/.gitignore +++ b/.gitignore @@ -17,9 +17,11 @@ yarn-error.log* /venv/ /*.sh local_requirements.txt +local_settings.py !upgrade.sh fabfile.py gunicorn.py +uwsgi.ini netbox.log netbox.pid .DS_Store diff --git a/README.md b/README.md index 8d2efed23..4d21003b5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ License Contributors GitHub stars - Languages supported + Languages supported CI status

@@ -95,16 +95,6 @@ NetBox automatically logs the creation, modification, and deletion of all manage * Contributions from the community are encouraged and appreciated! Check out our [contributing guide](CONTRIBUTING.md) to get started. * [Share your idea](https://plugin-ideas.netbox.dev/) for a new plugin, or [learn how to build one](https://github.com/netbox-community/netbox-plugin-tutorial) yourself! -## Project Stats - -

- Timeline graph - Issues graph - Pull requests graph - Top contributors -
Stats via Repography -

- ## Screenshots

diff --git a/base_requirements.txt b/base_requirements.txt index 7c12e8871..9912f1d6b 100644 --- a/base_requirements.txt +++ b/base_requirements.txt @@ -131,9 +131,8 @@ social-auth-app-django strawberry-graphql # Strawberry GraphQL Django extension -# https://github.com/strawberry-graphql/strawberry-django/blob/main/CHANGELOG.md -# Pinned per #15574 -strawberry-graphql-django==0.34.0 +# https://github.com/strawberry-graphql/strawberry-django/releases +strawberry-graphql-django # SVG image rendering (used for rack elevations) # https://github.com/mozman/svgwrite/blob/master/NEWS.rst diff --git a/contrib/generated_schema.json b/contrib/generated_schema.json index b6632dd4c..deda2b821 100644 --- a/contrib/generated_schema.json +++ b/contrib/generated_schema.json @@ -179,6 +179,9 @@ "usb-micro-ab", "usb-3-b", "usb-3-micro-b", + "molex-micro-fit-1x2", + "molex-micro-fit-2x2", + "molex-micro-fit-2x4", "dc-terminal", "saf-d-grid", "neutrik-powercon-20", @@ -281,6 +284,9 @@ "usb-a", "usb-micro-b", "usb-c", + "molex-micro-fit-1x2", + "molex-micro-fit-2x2", + "molex-micro-fit-2x4", "dc-terminal", "hdot-cx", "saf-d-grid", @@ -317,6 +323,7 @@ "100base-tx", "100base-t1", "1000base-t", + "1000base-tx", "2.5gbase-t", "5gbase-t", "10gbase-t", @@ -353,6 +360,8 @@ "800gbase-x-qsfpdd", "800gbase-x-osfp", "1000base-kx", + "2.5gbase-kx", + "5gbase-kr", "10gbase-kr", "10gbase-kx4", "25gbase-kr", @@ -373,6 +382,8 @@ "gsm", "cdma", "lte", + "4g", + "5g", "sonet-oc3", "sonet-oc12", "sonet-oc48", @@ -406,12 +417,15 @@ "e3", "xdsl", "docsis", + "bpon", + "epon", + "10g-epon", "gpon", "xg-pon", "xgs-pon", "ng-pon2", - "epon", - "10g-epon", + "25g-pon", + "50g-pon", "cisco-stackwise", "cisco-stackwise-plus", "cisco-flexstack", diff --git a/contrib/gunicorn.py b/contrib/gunicorn.py index 89d6943b4..4b2b7c6b0 100644 --- a/contrib/gunicorn.py +++ b/contrib/gunicorn.py @@ -14,3 +14,7 @@ timeout = 120 # The maximum number of requests a worker can handle before being respawned max_requests = 5000 max_requests_jitter = 500 + +# Uncomment this line to accept HTTP headers containing underscores, e.g. for remote +# authentication support. See https://docs.gunicorn.org/en/stable/settings.html#header-map +# header-map = 'dangerous' diff --git a/contrib/uwsgi.ini b/contrib/uwsgi.ini index d64803158..a8bedc1d7 100644 --- a/contrib/uwsgi.ini +++ b/contrib/uwsgi.ini @@ -11,8 +11,24 @@ master = true ; clear environment on exit vacuum = true +; make SIGTERM stop the app (instead of reload) +die-on-term = true + ; exit if no app can be loaded need-app = true ; do not use multiple interpreters single-interpreter = true + +; change to the project directory +chdir = netbox + +; specify the WSGI module to load +module = netbox.wsgi + +; workaround to make uWSGI reloads work with pyuwsgi (not to be used if using uwsgi package instead) +binary-path = venv/bin/python + +; only log internal messages and errors (reverse proxy already logs the requests) +disable-logging = true +log-5xx = true diff --git a/docs/_theme/main.html b/docs/_theme/main.html index 3ff44b9cb..99907bf42 100644 --- a/docs/_theme/main.html +++ b/docs/_theme/main.html @@ -2,8 +2,8 @@ {% block site_meta %} {{ super() }} - {# Disable search indexing unless we're building for ReadTheDocs (see #10496) #} - {% if page.canonical_url != 'https://docs.netbox.dev/' %} + {# Disable search indexing unless we're building for public consumption #} + {% if not config.extra.build_public %} {% endif %} {% endblock %} diff --git a/docs/administration/authentication/overview.md b/docs/administration/authentication/overview.md index 3a3b9efc2..a6c3a3159 100644 --- a/docs/administration/authentication/overview.md +++ b/docs/administration/authentication/overview.md @@ -26,7 +26,10 @@ REMOTE_AUTH_BACKEND = 'netbox.authentication.RemoteUserBackend' Another option for remote authentication in NetBox is to enable HTTP header-based user assignment. The front end HTTP server (e.g. nginx or Apache) performs client authentication as a process external to NetBox, and passes information about the authenticated user via HTTP headers. By default, the user is assigned via the `REMOTE_USER` header, but this can be customized via the `REMOTE_AUTH_HEADER` configuration parameter. -Optionally, user profile information can be supplied by `REMOTE_USER_FIRST_NAME`, `REMOTE_USER_LAST_NAME` and `REMOTE_USER_EMAIL` headers. These are saved to the users profile during the authentication process. These headers can be customized like the `REMOTE_USER` header. +Optionally, user profile information can be supplied by `REMOTE_USER_FIRST_NAME`, `REMOTE_USER_LAST_NAME` and `REMOTE_USER_EMAIL` headers. These are saved to the user's profile during the authentication process. These headers can be customized like the `REMOTE_USER` header. + +!!! warning Verify Header Compatibility + Some WSGI servers may drop headers which contain unsupported characters. For instance, gunicorn v22.0 and later silently drops HTTP headers containing underscores. This behavior can be disabled by changing gunicorn's [`header_map`](https://docs.gunicorn.org/en/stable/settings.html#header-map) setting to `dangerous`. ### Single Sign-On (SSO) diff --git a/docs/configuration/date-time.md b/docs/configuration/date-time.md deleted file mode 100644 index a23053e08..000000000 --- a/docs/configuration/date-time.md +++ /dev/null @@ -1,23 +0,0 @@ -# Date & Time Parameters - -## TIME_ZONE - -Default: UTC - -The time zone NetBox will use when dealing with dates and times. It is recommended to use UTC time unless you have a specific need to use a local time zone. Please see the [list of available time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - -## Date and Time Formatting - -You may define custom formatting for date and times. For detailed instructions on writing format strings, please see [the Django documentation](https://docs.djangoproject.com/en/stable/ref/templates/builtins/#date). Default formats are listed below. - -!!! note - These system defaults will be overridden by a user's selected language/locale when [localization](./system.md#enable_localization) is enabled. - -```python -DATE_FORMAT = 'N j, Y' # June 26, 2016 -SHORT_DATE_FORMAT = 'Y-m-d' # 2016-06-26 -TIME_FORMAT = 'g:i a' # 1:23 p.m. -SHORT_TIME_FORMAT = 'H:i:s' # 13:23:00 -DATETIME_FORMAT = 'N j, Y g:i a' # June 26, 2016 1:23 p.m. -SHORT_DATETIME_FORMAT = 'Y-m-d H:i' # 2016-06-26 13:23 -``` diff --git a/docs/configuration/miscellaneous.md b/docs/configuration/miscellaneous.md index 7e68bcee7..1f0a2781b 100644 --- a/docs/configuration/miscellaneous.md +++ b/docs/configuration/miscellaneous.md @@ -33,9 +33,6 @@ This defines custom content to be displayed on the login page above the login fo !!! tip "Dynamic Configuration Parameter" -!!! note - This parameter was added in NetBox v3.5. - This adds a banner to the top of every page when maintenance mode is enabled. HTML is allowed. --- @@ -115,9 +112,6 @@ Default: True By default, NetBox will prevent the creation of duplicate prefixes and IP addresses in the global table (that is, those which are not assigned to any VRF). This validation can be disabled by setting `ENFORCE_GLOBAL_UNIQUE` to False. -!!! info "Changed in v3.7" - The default value for this parameter was changed from False to True in NetBox v3.7. - --- ## FILE_UPLOAD_MAX_MEMORY_SIZE @@ -142,9 +136,6 @@ Setting this to False will disable the GraphQL API. !!! tip "Dynamic Configuration Parameter" -!!! note - This parameter was renamed from `JOBRESULT_RETENTION` in NetBox v3.5. - Default: 90 The number of days to retain job results (scripts and reports). Set this to `0` to retain job results in the database indefinitely. @@ -239,9 +230,6 @@ The maximum execution time of a background task (such as running a custom script ## RQ_RETRY_INTERVAL -!!! note - This parameter was added in NetBox v3.5. - Default: `60` This parameter controls how frequently a failed job is retried, up to the maximum number of times specified by `RQ_RETRY_MAX`. This must be either an integer specifying the number of seconds to wait between successive attempts, or a list of such values. For example, `[60, 300, 3600]` will retry the task after 1 minute, 5 minutes, and 1 hour. @@ -250,9 +238,6 @@ This parameter controls how frequently a failed job is retried, up to the maximu ## RQ_RETRY_MAX -!!! note - This parameter was added in NetBox v3.5. - Default: `0` (retries disabled) The maximum number of times a background task will be retried before being marked as failed. diff --git a/docs/configuration/remote-authentication.md b/docs/configuration/remote-authentication.md index e7fe56a09..5f28d987f 100644 --- a/docs/configuration/remote-authentication.md +++ b/docs/configuration/remote-authentication.md @@ -85,6 +85,9 @@ Default: `'HTTP_REMOTE_USER'` When remote user authentication is in use, this is the name of the HTTP header which informs NetBox of the currently authenticated user. For example, to use the request header `X-Remote-User` it needs to be set to `HTTP_X_REMOTE_USER`. (Requires `REMOTE_AUTH_ENABLED`.) +!!! warning Verify Header Compatibility + Some WSGI servers may drop headers which contain unsupported characters. For instance, gunicorn v22.0 and later silently drops HTTP headers containing underscores. This behavior can be disabled by changing gunicorn's [`header_map`](https://docs.gunicorn.org/en/stable/settings.html#header-map) setting to `dangerous`. + --- ## REMOTE_AUTH_USER_EMAIL diff --git a/docs/configuration/required-parameters.md b/docs/configuration/required-parameters.md index bda365995..90eb8c0cf 100644 --- a/docs/configuration/required-parameters.md +++ b/docs/configuration/required-parameters.md @@ -94,15 +94,25 @@ REDIS = { } ``` -!!! note - If you are upgrading from a NetBox release older than v2.7.0, please note that the Redis connection configuration - settings have changed. Manual modification to bring the `REDIS` section inline with the above specification is - necessary - !!! warning It is highly recommended to keep the task and cache databases separate. Using the same database number on the same Redis instance for both may result in queued background tasks being lost during cache flushing events. +### UNIX Socket Support + +Redis may alternatively be configured by specifying a complete URL instead of individual components. This approach supports the use of a UNIX socket connection. For example: + +```python +REDIS = { + 'tasks': { + 'URL': 'unix:///run/redis-netbox/redis.sock?db=0' + }, + 'caching': { + 'URL': 'unix:///run/redis-netbox/redis.sock?db=1' + }, +} +``` + ### Using Redis Sentinel If you are using [Redis Sentinel](https://redis.io/topics/sentinel) for high-availability purposes, there is minimal diff --git a/docs/configuration/security.md b/docs/configuration/security.md index a21b82a04..15702f649 100644 --- a/docs/configuration/security.md +++ b/docs/configuration/security.md @@ -159,9 +159,12 @@ Note that enabling this setting causes NetBox to update a user's session in the ## LOGIN_REQUIRED -Default: False +Default: True -Setting this to True will permit only authenticated users to access any part of NetBox. By default, anonymous users are permitted to access most data in NetBox but not make any changes. +When enabled, only authenticated users are permitted to access any part of NetBox. Disabling this will allow unauthenticated users to access most areas of NetBox (but not make any changes). + +!!! info "Changed in NetBox v4.0.2" + Prior to NetBox v4.0.2, this setting was disabled by default. --- @@ -181,6 +184,30 @@ The view name or URL to which a user is redirected after logging out. --- +## SECURE_HSTS_INCLUDE_SUBDOMAINS + +Default: False + +If true, the `includeSubDomains` directive will be included in the HTTP Strict Transport Security (HSTS) header. This directive instructs the browser to apply the HSTS policy to all subdomains of the current domain. + +--- + +## SECURE_HSTS_PRELOAD + +Default: False + +If true, the `preload` directive will be included in the HTTP Strict Transport Security (HSTS) header. This directive instructs the browser to preload the site in HTTPS. Browsers that use the HSTS preload list will force the site to be accessed via HTTPS even if the user types HTTP in the address bar. + +--- + +## SECURE_HSTS_SECONDS + +Default: 0 + +If set to a non-zero integer value, the SecurityMiddleware sets the HTTP Strict Transport Security (HSTS) header on all responses that do not already have it. This will instruct the browser that the website must be accessed via HTTPS, blocking any HTTP request. + +--- + ## SECURE_SSL_REDIRECT Default: False diff --git a/docs/configuration/system.md b/docs/configuration/system.md index 806839778..a1e0ebb17 100644 --- a/docs/configuration/system.md +++ b/docs/configuration/system.md @@ -16,10 +16,7 @@ BASE_PATH = 'netbox/' Default: `en-us` (US English) -Defines the default preferred language/locale for requests that do not specify one. This is used to alter e.g. the display of dates and numbers to fit the user's locale. See [this list](http://www.i18nguy.com/unicode/language-identifiers.html) of standard language codes. (This parameter maps to Django's [`LANGUAGE_CODE`](https://docs.djangoproject.com/en/stable/ref/settings/#language-code) internal setting.) - -!!! note - Altering this parameter will *not* change the language used in NetBox. We hope to provide translation support in a future NetBox release. +Defines the default preferred language/locale for requests that do not specify one. (This parameter maps to Django's [`LANGUAGE_CODE`](https://docs.djangoproject.com/en/stable/ref/settings/#language-code) internal setting.) --- @@ -65,14 +62,6 @@ Email is sent from NetBox only for critical events or if configured for [logging --- -## ENABLE_LOCALIZATION - -Default: False - -Determines if localization features are enabled or not. This should only be enabled for development or testing purposes as netbox is not yet fully localized. Turning this on will localize numeric and date formats (overriding any configured [system defaults](./date-time.md#date-and-time-formatting)) based on the browser locale as well as translate certain strings from third party modules. - ---- - ## HTTP_PROXIES Default: None @@ -203,3 +192,17 @@ A dictionary of configuration parameters for the storage backend configured as ` If `STORAGE_BACKEND` is not defined, this setting will be ignored. --- + +## TIME_ZONE + +Default: UTC + +The time zone NetBox will use when dealing with dates and times. It is recommended to use UTC time unless you have a specific need to use a local time zone. Please see the [list of available time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + +--- + +## TRANSLATION_ENABLED + +Default: True + +Enables language translation for the user interface. (This parameter maps to Django's [USE_I18N](https://docs.djangoproject.com/en/stable/ref/settings/#std-setting-USE_I18N) setting.) diff --git a/docs/customization/custom-fields.md b/docs/customization/custom-fields.md index e9ff7bd9f..1f9a4a8bf 100644 --- a/docs/customization/custom-fields.md +++ b/docs/customization/custom-fields.md @@ -42,8 +42,6 @@ This parameter has no effect on the API representation of custom field data. ### Visibility & Editing -!!! info "This feature was improved in NetBox v3.7." - When creating a custom field, users can control the conditions under which it may be displayed and edited within the NetBox user interface. The following choices are available for controlling the display of a custom field on an object: * **Always** (default): The custom field is included when viewing an object. diff --git a/docs/customization/custom-scripts.md b/docs/customization/custom-scripts.md index bdc3f9104..2a8f252aa 100644 --- a/docs/customization/custom-scripts.md +++ b/docs/customization/custom-scripts.md @@ -65,12 +65,6 @@ class AnotherCustomScript(Script): script_order = (MyCustomScript, AnotherCustomScript) ``` -## Module Attributes - -### `name` - -You can define `name` within a script module (the Python file which contains one or more scripts) to set the module name. If `name` is not defined, the module's file name will be used. - ## Script Attributes Script attributes are defined under a class named `Meta` within the script. These are optional, but encouraged. @@ -371,6 +365,14 @@ An IPv4 or IPv6 network with a mask. Returns a `netaddr.IPNetwork` object. Two a * `min_prefix_length` - Minimum length of the mask * `max_prefix_length` - Maximum length of the mask +### DateVar + +A calendar date. Returns a `datetime.date` object. + +### DateTimeVar + +A complete date & time. Returns a `datetime.datetime` object. + ## Running Custom Scripts !!! note diff --git a/docs/development/adding-models.md b/docs/development/adding-models.md index 7de897a97..823789641 100644 --- a/docs/development/adding-models.md +++ b/docs/development/adding-models.md @@ -77,7 +77,7 @@ Create the following for each model: ## 13. GraphQL API components -Create a Graphene object type for the model in `graphql/types.py` by subclassing the appropriate class from `netbox.graphql.types`. +Create a GraphQL object type for the model in `graphql/types.py` by subclassing the appropriate class from `netbox.graphql.types`. Also extend the schema class defined in `graphql/schema.py` with the individual object and object list fields per the established convention. diff --git a/docs/development/release-checklist.md b/docs/development/release-checklist.md index 2af640546..4f6e2f25f 100644 --- a/docs/development/release-checklist.md +++ b/docs/development/release-checklist.md @@ -59,7 +59,7 @@ Notify the [`netbox-docker`](https://github.com/netbox-community/netbox-docker) * Increases in minimum versions for service dependencies (PostgreSQL, Redis, etc.) * Any changes to the reference installation -### Update Requirements +### Update Python Dependencies Before each release, update each of NetBox's Python dependencies to its most recent stable version. These are defined in `requirements.txt`, which is updated from `base_requirements.txt` using `pip`. To do this: @@ -70,6 +70,10 @@ Before each release, update each of NetBox's Python dependencies to its most rec In cases where upgrading a dependency to its most recent release is breaking, it should be constrained to its current minor version in `base_requirements.txt` with an explanatory comment and revisited for the next major NetBox release (see the [Address Constrained Dependencies](#address-constrained-dependencies) section above). +### Update UI Dependencies + +Check whether any UI dependencies (JavaScript packages, fonts, etc.) need to be updated by running `yarn outdated` from within the `project-static/` directory. [Upgrade these dependencies](./web-ui.md#updating-dependencies) as necessary, then run `yarn bundle` to generate the necessary files for distribution. + ### Rebuild the Device Type Definition Schema Run the following command to update the device type definition validation schema: @@ -82,15 +86,7 @@ This will automatically update the schema file at `contrib/generated_schema.json ### Update & Compile Translations -Log into [Transifex](https://app.transifex.com/netbox-community/netbox/dashboard/) to download the updated string maps. Download the resource (portable object, or `.po`) file for each language and save them to `netbox/translations/$lang/LC_MESSAGES/django.po`, overwriting the current files. (Be sure to click the **Download for use** link.) - -![Transifex download](../media/development/transifex_download.png) - -Once the resource files for all languages have been updated, compile the machine object (`.mo`) files using the `compilemessages` management command: - -```nohighlight -./manage.py compilemessages -``` +Updated language translations should be pulled from [Transifex](https://app.transifex.com/netbox-community/netbox/dashboard/) and re-compiled for each new release. Follow the documented process for [updating translated strings](./translations.md#updating-translated-strings) to do this. ### Update Version and Changelog diff --git a/docs/development/translations.md b/docs/development/translations.md index e40f996c5..b23e89d71 100644 --- a/docs/development/translations.md +++ b/docs/development/translations.md @@ -6,17 +6,38 @@ All language translations in NetBox are generated from the source file found at Reviewers log into Transifex and navigate to their designated language(s) to translate strings. The initial translation for most strings will be machine-generated via the AWS Translate service. Human reviewers are responsible for reviewing these translations and making corrections where necessary. -Immediately prior to each NetBox release, the translation maps for all completed languages will be downloaded from Transifex, compiled, and checked into the NetBox code base by a maintainer. - ## Updating Translation Sources -To update the English `.po` file from which all translations are derived, use the `makemessages` management command: +To update the English `.po` file from which all translations are derived, use the `makemessages` management command (ignoring the `project-static/` directory): ```nohighlight -./manage.py makemessages -l en +./manage.py makemessages -l en -i "project-static/*" ``` -Then, commit the change and push to the `develop` branch on GitHub. After some time, any new strings will appear for translation on Transifex automatically. +Then, commit the change and push to the `develop` branch on GitHub. Any new strings will appear for translation on Transifex automatically. + +## Updating Translated Strings + +Typically, translated strings need to be updated only as part of the NetBox [release process](./release-checklist.md). + +To update translated strings, start by initiating a sync from Transifex. From the Transifex dashboard, navigate to Settings > Integrations > GitHub > Manage, and click the **Manual Sync** button at top right. + +![Transifex manual sync](../media/development/transifex_sync.png) + +Enter a threshold percentage of 1 (to ensure all translations are captured) and select the `develop` branch, then click **Sync**. This will initiate a pull request to GitHub to update any newly modified translation (`.po`) files. + +!!! tip + The new PR should appear within a few minutes. If it does not, check that there are in fact new translations to be added. + +![Transifex pull request](../media/development/transifex_pull_request.png) + +Once the PR has been merged, the updated strings need to be compiled into new `.mo` files so they can be used by the application. Update the `develop` branch locally to pull in the changes from the Transifex PR, then run Django's [`compilemessages`](https://docs.djangoproject.com/en/stable/ref/django-admin/#django-admin-compilemessages) management command: + +```nohighlight +./manage.py compilemessages +``` + +Once any new `.mo` files have been generated, they need to be committed and pushed back up to GitHub. (Again, this is typically done as part of publishing a new NetBox release.) ## Proposing New Languages diff --git a/docs/development/user-preferences.md b/docs/development/user-preferences.md index ceb5321a9..deb469bfb 100644 --- a/docs/development/user-preferences.md +++ b/docs/development/user-preferences.md @@ -11,4 +11,3 @@ The `users.UserConfig` model holds individual preferences for each user in the f | pagination.placement | Where to display the paginator controls relative to the table | | tables.${table}.columns | The ordered list of columns to display when viewing the table | | tables.${table}.ordering | A list of column names by which the table should be ordered | -| ui.colormode | Light or dark mode in the user interface | diff --git a/docs/development/web-ui.md b/docs/development/web-ui.md index 8afbd96c1..b3b94bd06 100644 --- a/docs/development/web-ui.md +++ b/docs/development/web-ui.md @@ -1,25 +1,37 @@ # Web UI Development +## Code Structure + +Most static resources for the NetBox UI are housed within the `netbox/project-static/` directory. + +| Path | Description | +|-----------|----------------------------------------------------| +| `dist/` | Destination path for installed dependencies | +| `docs/` | Local build path for documentation | +| `img/` | Image files | +| `js/` | Miscellaneous JavaScript resources served directly | +| `src/` | TypeScript resources (to be compiled into JS) | +| `styles/` | Sass resources (to be compiled into CSS) | + ## Front End Technologies -The NetBox UI is built on languages and frameworks: +Front end scripting is written in [TypeScript](https://www.typescriptlang.org/), which is a strongly-typed extension to JavaScript. TypeScript is "transpiled" into JavaScript resources which are served to and executed by the client web browser. -### Styling & HTML Elements +All UI styling is written in [Sass](https://sass-lang.com/), which is an extension to browser-native [Cascading Stylesheets (CSS)](https://developer.mozilla.org/en-US/docs/Web/CSS). Similar to how TypeScript content is transpiled to JavaScript, Sass resources (`.scss` files) are compiled to CSS. -#### [Bootstrap](https://getbootstrap.com/) 5 +## Dependencies -The majority of the NetBox UI is made up of stock Bootstrap components, with some styling modifications and custom components added on an as-needed basis. Bootstrap uses [Sass](https://sass-lang.com/), and NetBox extends Bootstrap's core Sass files for theming and customization. +The following software is employed by the NetBox user interface. -### Client-side Scripting - -#### [TypeScript](https://www.typescriptlang.org/) - -All client-side scripting is transpiled from TypeScript to JavaScript and served by Django. In development, TypeScript is an _extremely_ effective tool for accurately describing and checking the code, which leads to significantly fewer bugs, a better development experience, and more predictable/readable code. - -As part of the [bundling](#bundling) process, Bootstrap's JavaScript plugins are imported and bundled alongside NetBox's front-end code. - -!!! danger "NetBox is jQuery-free" - Following the Bootstrap team's deprecation of jQuery in Bootstrap 5, NetBox also no longer uses jQuery in front-end code. +* [Bootstrap 5](https://getbootstrap.com/) - A popular CSS & JS framework +* [clipboard.js](https://clipboardjs.com/) - A lightweight package for enabling copy-to-clipboard functionality +* [flatpickr](https://flatpickr.js.org/) - A lightweight date & time selection widget +* [gridstack.js](https://gridstackjs.com/) - Enables interactive grid layouts (for the dashboard) +* [HTMX](https://htmx.org/) - Enables dynamic web interfaces through the use of HTML element attributes +* [Material Design Icons](https://pictogrammers.com/library/mdi/) - An extensive open source collection of graphical icons, delivered as a web font +* [query-string](https://www.npmjs.com/package/query-string) - Assists with parsing URL query strings +* [Tabler](https://tabler.io/) - A web application UI toolkit & theme based on Bootstrap 5 +* [Tom Select](https://tom-select.js.org/) - Provides dynamic selection form fields ## Guidance @@ -54,6 +66,41 @@ $ yarn !!! warning "Check Your Working Directory" You need to be in the `netbox/project-static` directory to run the below `yarn` commands. +### Updating Dependencies + +Run `yarn outdated` to identify outdated dependencies. + +``` +$ yarn outdated +yarn outdated v1.22.19 +info Color legend : + "" : Major Update backward-incompatible updates + "" : Minor Update backward-compatible features + "" : Patch Update backward-compatible bug fixes +Package Current Wanted Latest Workspace Package Type URL +bootstrap 5.3.1 5.3.1 5.3.3 netbox dependencies https://getbootstrap.com/ +``` + +Run `yarn upgrade --latest` to automatically upgrade these packages to their most recent versions. + +``` +$ yarn upgrade bootstrap --latest +yarn upgrade v1.22.19 +[1/4] Resolving packages... +[2/4] Fetching packages... +[3/4] Linking dependencies... +[4/4] Rebuilding all packages... +success Saved lockfile. +success Saved 1 new dependency. +info Direct dependencies +└─ bootstrap@5.3.3 +info All dependencies +└─ bootstrap@5.3.3 +Done in 0.95s. +``` + +`package.json` will be updated to reflect the new package versions automatically. + ### Bundling In order for the TypeScript and Sass (SCSS) source files to be usable by a browser, they must first be transpiled (TypeScript → JavaScript, Sass → CSS), bundled, and minified. After making changes to TypeScript or Sass source files, run `yarn bundle`. diff --git a/docs/installation/4b-uwsgi.md b/docs/installation/4b-uwsgi.md index 3b7b5f76c..c8d1437a0 100644 --- a/docs/installation/4b-uwsgi.md +++ b/docs/installation/4b-uwsgi.md @@ -17,7 +17,7 @@ pip3 install pyuwsgi Once installed, add the package to `local_requirements.txt` to ensure it is re-installed during future rebuilds of the virtual environment: ```no-highlight -sudo sh -c "echo 'pyuwgsi' >> /opt/netbox/local_requirements.txt" +sudo sh -c "echo 'pyuwsgi' >> /opt/netbox/local_requirements.txt" ``` ## Configuration diff --git a/docs/installation/index.md b/docs/installation/index.md index 6ad4aa79e..76160068a 100644 --- a/docs/installation/index.md +++ b/docs/installation/index.md @@ -12,7 +12,7 @@ The following sections detail how to set up a new instance of NetBox: 1. [PostgreSQL database](1-postgresql.md) 1. [Redis](2-redis.md) 3. [NetBox components](3-netbox.md) -4. [Gunicorn](4-gunicorn.md) +4. [Gunicorn](4a-gunicorn.md) or [uWSGI](4b-uwsgi.md) 5. [HTTP server](5-http-server.md) 6. [LDAP authentication](6-ldap.md) (optional) diff --git a/docs/integrations/graphql-api.md b/docs/integrations/graphql-api.md index 724e4e73d..3ccb4d4a1 100644 --- a/docs/integrations/graphql-api.md +++ b/docs/integrations/graphql-api.md @@ -1,6 +1,6 @@ # GraphQL API Overview -NetBox provides a read-only [GraphQL](https://graphql.org/) API to complement its REST API. This API is powered by the [Graphene](https://graphene-python.org/) library and [Graphene-Django](https://docs.graphene-python.org/projects/django/en/latest/). +NetBox provides a read-only [GraphQL](https://graphql.org/) API to complement its REST API. This API is powered by [Strawberry Django](https://strawberry-graphql.github.io/strawberry-django/). ## Queries @@ -47,7 +47,7 @@ NetBox provides both a singular and plural query field for each object type: For example, query `device(id:123)` to fetch a specific device (identified by its unique ID), and query `device_list` (with an optional set of filters) to fetch all devices. -For more detail on constructing GraphQL queries, see the [Graphene documentation](https://docs.graphene-python.org/en/latest/) as well as the [GraphQL queries documentation](https://graphql.org/learn/queries/). +For more detail on constructing GraphQL queries, see the [GraphQL queries documentation](https://graphql.org/learn/queries/). For filtering and lookup syntax, please refer to the [Strawberry Django documentation](https://strawberry-graphql.github.io/strawberry-django/guide/filters/). ## Filtering diff --git a/docs/integrations/rest-api.md b/docs/integrations/rest-api.md index 437f652b7..1ba00958f 100644 --- a/docs/integrations/rest-api.md +++ b/docs/integrations/rest-api.md @@ -85,13 +85,19 @@ Each model generally has two views associated with it: a list view and a detail * `/api/dcim/devices/` - List existing devices or create a new device * `/api/dcim/devices/123/` - Retrieve, update, or delete the device with ID 123 -Lists of objects can be filtered using a set of query parameters. For example, to find all interfaces belonging to the device with ID 123: +Lists of objects can be filtered and ordered using a set of query parameters. For example, to find all interfaces belonging to the device with ID 123: ``` GET /api/dcim/interfaces/?device_id=123 ``` -See the [filtering documentation](../reference/filtering.md) for more details. +An optional `ordering` parameter can be used to define how to sort the results. Building off the previous example, to sort all the interfaces in reverse order of creation (newest to oldest) for a device with ID 123: + +``` +GET /api/dcim/interfaces/?device_id=123&ordering=-created +``` + +See the [filtering documentation](../reference/filtering.md) for more details on topics related to filtering, ordering and lookup expressions. ## Serialization diff --git a/docs/media/development/transifex_download.png b/docs/media/development/transifex_download.png deleted file mode 100644 index 99429ce11..000000000 Binary files a/docs/media/development/transifex_download.png and /dev/null differ diff --git a/docs/media/development/transifex_pull_request.png b/docs/media/development/transifex_pull_request.png new file mode 100644 index 000000000..e3ae76991 Binary files /dev/null and b/docs/media/development/transifex_pull_request.png differ diff --git a/docs/media/development/transifex_sync.png b/docs/media/development/transifex_sync.png new file mode 100644 index 000000000..44022cc4d Binary files /dev/null and b/docs/media/development/transifex_sync.png differ diff --git a/docs/media/screenshots/cable-trace.png b/docs/media/screenshots/cable-trace.png index e228d1786..63cba056f 100644 Binary files a/docs/media/screenshots/cable-trace.png and b/docs/media/screenshots/cable-trace.png differ diff --git a/docs/media/screenshots/home-dark.png b/docs/media/screenshots/home-dark.png index 7b060785f..95a6468fe 100644 Binary files a/docs/media/screenshots/home-dark.png and b/docs/media/screenshots/home-dark.png differ diff --git a/docs/media/screenshots/home-light.png b/docs/media/screenshots/home-light.png index 1eaca3ef0..ed249cbdd 100644 Binary files a/docs/media/screenshots/home-light.png and b/docs/media/screenshots/home-light.png differ diff --git a/docs/media/screenshots/prefixes-list.png b/docs/media/screenshots/prefixes-list.png index 7220a8817..a5e5a4b8b 100644 Binary files a/docs/media/screenshots/prefixes-list.png and b/docs/media/screenshots/prefixes-list.png differ diff --git a/docs/media/screenshots/rack.png b/docs/media/screenshots/rack.png index 7179efda3..a5954d644 100644 Binary files a/docs/media/screenshots/rack.png and b/docs/media/screenshots/rack.png differ diff --git a/docs/models/virtualization/virtualmachine.md b/docs/models/virtualization/virtualmachine.md index 769d49154..7a801ca65 100644 --- a/docs/models/virtualization/virtualmachine.md +++ b/docs/models/virtualization/virtualmachine.md @@ -51,3 +51,8 @@ The amount of running memory provisioned, in megabytes. ### Disk The amount of disk storage provisioned, in gigabytes. + +### Serial Number + +Optional serial number assigned to this VM. + diff --git a/docs/plugins/development/forms.md b/docs/plugins/development/forms.md index 332544df7..209506172 100644 --- a/docs/plugins/development/forms.md +++ b/docs/plugins/development/forms.md @@ -89,13 +89,13 @@ This form facilitates editing multiple objects in bulk. Unlike a model form, thi from django import forms from django.utils.translation import gettext_lazy as _ from dcim.models import Site -from netbox.forms import NetBoxModelImportForm +from netbox.forms import NetBoxModelBulkEditForm from utilities.forms import CommentField, DynamicModelChoiceField from utilities.forms.rendering import FieldSet from .models import MyModel, MyModelStatusChoices -class MyModelEditForm(NetBoxModelImportForm): +class MyModelBulkEditForm(NetBoxModelBulkEditForm): name = forms.CharField( required=False ) diff --git a/docs/plugins/development/graphql-api.md b/docs/plugins/development/graphql-api.md index 5f960fa1b..603b0cead 100644 --- a/docs/plugins/development/graphql-api.md +++ b/docs/plugins/development/graphql-api.md @@ -2,13 +2,12 @@ ## Defining the Schema Class -A plugin can extend NetBox's GraphQL API by registering its own schema class. By default, NetBox will attempt to import `graphql.schema` from the plugin, if it exists. This path can be overridden by defining `graphql_schema` on the PluginConfig instance as the dotted path to the desired Python class. This class must be a subclass of `graphene.ObjectType`. +A plugin can extend NetBox's GraphQL API by registering its own schema class. By default, NetBox will attempt to import `graphql.schema` from the plugin, if it exists. This path can be overridden by defining `graphql_schema` on the PluginConfig instance as the dotted path to the desired Python class. ### Example ```python # graphql.py -from typing import List import strawberry import strawberry_django @@ -28,7 +27,7 @@ class MyQuery: @strawberry.field def dummymodel(self, id: int) -> DummyModelType: return None - dummymodel_list: List[DummyModelType] = strawberry_django.field() + dummymodel_list: list[DummyModelType] = strawberry_django.field() schema = [ diff --git a/docs/plugins/development/index.md b/docs/plugins/development/index.md index c6deb5958..c042be6ec 100644 --- a/docs/plugins/development/index.md +++ b/docs/plugins/development/index.md @@ -3,6 +3,9 @@ !!! tip "Plugins Development Tutorial" Just getting started with plugins? Check out our [**NetBox Plugin Tutorial**](https://github.com/netbox-community/netbox-plugin-tutorial) on GitHub! This in-depth guide will walk you through the process of creating an entire plugin from scratch. It even includes a companion [demo plugin repo](https://github.com/netbox-community/netbox-plugin-demo) to ensure you can jump in at any step along the way. This will get you up and running with plugins in no time! +!!! tip "Plugin Certification Program" + NetBox Labs offers a [**Plugin Certification Program**](https://github.com/netbox-community/netbox/wiki/Plugin-Certification-Program) for plugin developers interested in establishing a co-maintainer relationship. The program aims to assure ongoing compatibility, maintainability, and commercial supportability of key plugins. + NetBox can be extended to support additional data models and functionality through the use of plugins. A plugin is essentially a self-contained [Django app](https://docs.djangoproject.com/en/stable/) which gets installed alongside NetBox to provide custom functionality. Multiple plugins can be installed in a single NetBox instance, and each plugin can be enabled and configured independently. !!! info "Django Development" @@ -52,18 +55,20 @@ project-name/ - template_content.py - urls.py - views.py + - pyproject.toml - README.md - - setup.py ``` The top level is the project root, which can have any name that you like. Immediately within the root should exist several items: -* `setup.py` - This is a standard installation script used to install the plugin package within the Python environment. +* `pyproject.toml` - is a standard configuration file used to install the plugin package within the Python environment. * `README.md` - A brief introduction to your plugin, how to install and configure it, where to find help, and any other pertinent information. It is recommended to write `README` files using a markup language such as Markdown to enable human-friendly display. * The plugin source directory. This must be a valid Python package name, typically comprising only lowercase letters, numbers, and underscores. The plugin source directory contains all the actual Python code and other resources used by your plugin. Its structure is left to the author's discretion, however it is recommended to follow best practices as outlined in the [Django documentation](https://docs.djangoproject.com/en/stable/intro/reusable-apps/). At a minimum, this directory **must** contain an `__init__.py` file containing an instance of NetBox's `PluginConfig` class, discussed below. +**Note:** The [Cookiecutter NetBox Plugin](https://github.com/netbox-community/cookiecutter-netbox-plugin) can be used to auto-generate all the needed directories and files for a new plugin. + ## PluginConfig The `PluginConfig` class is a NetBox-specific wrapper around Django's built-in [`AppConfig`](https://docs.djangoproject.com/en/stable/ref/applications/) class. It is used to declare NetBox plugin functionality within a Python package. Each plugin should provide its own subclass, defining its name, metadata, and default and required configuration parameters. An example is below: @@ -133,31 +138,48 @@ Apps from this list are inserted *before* the plugin's `PluginConfig` in the ord Any additional apps must be installed within the same Python environment as NetBox or `ImproperlyConfigured` exceptions will be raised when loading the plugin. -## Create setup.py +## Create pyproject.toml -`setup.py` is the [setup script](https://docs.python.org/3.10/distutils/setupscript.html) used to package and install our plugin once it's finished. The primary function of this script is to call the setuptools library's `setup()` function to create a Python distribution package. We can pass a number of keyword arguments to control the package creation as well as to provide metadata about the plugin. An example `setup.py` is below: +`pyproject.toml` is the [configuration file](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/) used to package and install our plugin once it's finished. It is used by packaging tools, as well as other tools. The primary function of this file is to call the build system to create a Python distribution package. We can pass a number of keyword arguments to control the package creation as well as to provide metadata about the plugin. There are three possible TOML tables in this file: -```python -from setuptools import find_packages, setup +* `[build-system]` allows you to declare which build backend you use and which other dependencies (if any) are needed to build your project. +* `[project]` is the format that most build backends use to specify your project’s basic metadata, such as the author's name, project URL, etc. +* `[tool]` has tool-specific subtables, e.g., `[tool.black]`, `[tool.mypy]`. Consult the particular tool’s documentation for reference. + +An example `pyproject.toml` is below: + +``` +# See PEP 518 for the spec of this file +# https://www.python.org/dev/peps/pep-0518/ + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "my-example-plugin" +version = "0.1.0" +authors = [ + {name = "John Doe", email = "test@netboxlabs.com"}, +] +description = "An example NetBox plugin." +readme = "README.md" + +classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'Natural Language :: English', + "Programming Language :: Python :: 3 :: Only", + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', +] + +requires-python = ">=3.10.0" -setup( - name='my-example-plugin', - version='0.1', - description='An example NetBox plugin', - url='https://github.com/jeremystretch/my-example-plugin', - author='Jeremy Stretch', - license='Apache 2.0', - install_requires=[], - packages=find_packages(), - include_package_data=True, - zip_safe=False, -) ``` -Many of these are self-explanatory, but for more information, see the [setuptools documentation](https://setuptools.readthedocs.io/en/latest/setuptools.html). - -!!! info - `zip_safe=False` is **required** as the current plugin iteration is not zip safe due to upstream python issue [issue19699](https://bugs.python.org/issue19699) +Many of these are self-explanatory, but for more information, see the [pyproject.toml documentation](https://packaging.python.org/en/latest/specifications/pyproject-toml/). ## Create a Virtual Environment @@ -175,11 +197,12 @@ echo /opt/netbox/netbox > $VENV/lib/python3.10/site-packages/netbox.pth ## Development Installation -To ease development, it is recommended to go ahead and install the plugin at this point using setuptools' `develop` mode. This will create symbolic links within your Python environment to the plugin development directory. Call `setup.py` from the plugin's root directory with the `develop` argument (instead of `install`): +To ease development, it is recommended to go ahead and install the plugin at this point using setuptools' `develop` mode. This will create symbolic links within your Python environment to the plugin development directory. Call `pip` from the plugin's root directory with the `-e` flag: ```no-highlight -$ python setup.py develop +$ pip install -e . ``` +More information on editable builds can be found at [Editable installs for pyproject.toml ](https://peps.python.org/pep-0660/). ## Configure NetBox diff --git a/docs/plugins/development/migration-v4.md b/docs/plugins/development/migration-v4.md index 2ddd68cc1..9622fab30 100644 --- a/docs/plugins/development/migration-v4.md +++ b/docs/plugins/development/migration-v4.md @@ -85,7 +85,7 @@ from django import forms class MyForm(forms.Form): ``` -### Update Fieldset Definitions +### Update Fieldset definitions NetBox v4.0 introduces [several new classes](./forms.md#form-rendering) for advanced form rendering, including FieldSet. Fieldset definitions on forms should use this new class instead of a tuple or list. @@ -252,7 +252,7 @@ class SiteSerializer(NetBoxModelSerializer): ### Include description fields in brief mode -NetBox now includes the `description` the field in "brief" mode for all models which have one. This is not required for plugins, but you may opt to do the same for consistency. +NetBox now includes the `description` field in "brief" mode for all models which have one. This is not required for plugins, but you may opt to do the same for consistency. ## GraphQL @@ -260,7 +260,7 @@ NetBox has replaced [Graphene-Django](https://github.com/graphql-python/graphene ### Change schema.py -Strawberry uses [python typing](https://docs.python.org/3/library/typing.html) and generally only requires a small refactoring of the schema definition to update: +Strawberry uses [Python typing](https://docs.python.org/3/library/typing.html) and generally only requires a small refactoring of the schema definition to update: ```python title="Old" import graphene @@ -276,8 +276,6 @@ class CircuitsQuery(graphene.ObjectType): ``` ```python title="New" -from typing import List - import strawberry import strawberry_django @@ -286,7 +284,7 @@ class CircuitsQuery: @strawberry.field def circuit(self, id: int) -> CircuitType: return models.Circuit.objects.get(pk=id) - circuit_list: List[CircuitType] = strawberry_django.field() + circuit_list: list[CircuitType] = strawberry_django.field() ``` ### Change types.py @@ -307,7 +305,7 @@ class CircuitType(NetBoxObjectType, ContactsMixin): ``` ```python title="New" -from typing import Annotated, List +from typing import Annotated import strawberry import strawberry_django @@ -321,7 +319,7 @@ class CircuitTypeType(OrganizationalObjectType): color: str @strawberry_django.field - def circuits(self) -> List[Annotated["CircuitType", strawberry.lazy('circuits.graphql.types')]]: + def circuits(self) -> list[Annotated["CircuitType", strawberry.lazy('circuits.graphql.types')]]: return self.circuits.all() ``` diff --git a/docs/plugins/development/views.md b/docs/plugins/development/views.md index 1730b0ebd..f6624f42c 100644 --- a/docs/plugins/development/views.md +++ b/docs/plugins/development/views.md @@ -157,7 +157,7 @@ These views are provided to enable or enhance certain NetBox model features, suc ### Additional Tabs -Plugins can "attach" a custom view to a core NetBox model by registering it with `register_model_view()`. To include a tab for this view within the NetBox UI, declare a TabView instance named `tab`: +Plugins can "attach" a custom view to a core NetBox model by registering it with `register_model_view()`. To include a tab for this view within the NetBox UI, declare a TabView instance named `tab`, and add it to the template context dict: ```python from dcim.models import Site @@ -173,6 +173,16 @@ class MyView(generic.ObjectView): badge=lambda obj: Stuff.objects.filter(site=obj).count(), permission='myplugin.view_stuff' ) + + def get(self, request, pk): + ... + return render( + request, + "myplugin/mytabview.html", + context={ + "tab": self.tab, + }, + ) ``` ::: utilities.views.register_model_view @@ -185,12 +195,15 @@ Plugins can inject custom content into certain areas of core NetBox views. This | Method | View | Description | |---------------------|-------------|-----------------------------------------------------| +| `navbar()` | All | Inject content inside the top navigation bar | | `left_page()` | Object view | Inject content on the left side of the page | | `right_page()` | Object view | Inject content on the right side of the page | | `full_width_page()` | Object view | Inject content across the entire bottom of the page | | `buttons()` | Object view | Add buttons to the top of the page | | `list_buttons()` | List view | Add buttons to the top of the page | +!!! info "The `navbar()` method was introduced in NetBox v4.1." + Additionally, a `render()` method is available for convenience. This method accepts the name of a template to render, and any additional context data you want to pass. Its use is optional, however. When a PluginTemplateExtension is instantiated, context data is assigned to `self.context`. Available data include: diff --git a/docs/plugins/index.md b/docs/plugins/index.md index 39314187b..0f502c5d8 100644 --- a/docs/plugins/index.md +++ b/docs/plugins/index.md @@ -2,6 +2,8 @@ Plugins are packaged [Django](https://docs.djangoproject.com/) apps that can be installed alongside NetBox to provide custom functionality not present in the core application. Plugins can introduce their own models and views, but cannot interfere with existing components. A NetBox user may opt to install plugins provided by the community or build his or her own. +Please see the documented instructions for [installing a plugin](./installation.md) to get started. + ## Capabilities The NetBox plugin architecture allows for the following: @@ -23,122 +25,3 @@ Either by policy or by technical limitation, the interaction of plugins with Net * **Override core templates.** Plugins can inject additional content where supported, but may not manipulate or remove core content. * **Modify core settings.** A configuration registry is provided for plugins, however they cannot alter or delete the core configuration. * **Disable core components.** Plugins are not permitted to disable or hide core NetBox components. - -## Installing Plugins - -The instructions below detail the process for installing and enabling a NetBox plugin. - -### Install Package - -Download and install the plugin package per its installation instructions. Plugins published via PyPI are typically installed using pip. Be sure to install the plugin within NetBox's virtual environment. - -```no-highlight -$ source /opt/netbox/venv/bin/activate -(venv) $ pip install -``` - -Alternatively, you may wish to install the plugin manually by running `python setup.py install`. If you are developing a plugin and want to install it only temporarily, run `python setup.py develop` instead. - -### Enable the Plugin - -In `configuration.py`, add the plugin's name to the `PLUGINS` list: - -```python -PLUGINS = [ - 'plugin_name', -] -``` - -### Configure Plugin - -If the plugin requires any configuration, define it in `configuration.py` under the `PLUGINS_CONFIG` parameter. The available configuration parameters should be detailed in the plugin's README file. - -```no-highlight -PLUGINS_CONFIG = { - 'plugin_name': { - 'foo': 'bar', - 'buzz': 'bazz' - } -} -``` - -### Run Database Migrations - -If the plugin introduces new database models, run the provided schema migrations: - -```no-highlight -(venv) $ cd /opt/netbox/netbox/ -(venv) $ python3 manage.py migrate -``` - -### Collect Static Files - -Plugins may package static files to be served directly by the HTTP front end. Ensure that these are copied to the static root directory with the `collectstatic` management command: - -```no-highlight -(venv) $ cd /opt/netbox/netbox/ -(venv) $ python3 manage.py collectstatic -``` - -### Restart WSGI Service - -Restart the WSGI service and RQ workers to load the new plugin: - -```no-highlight -# sudo systemctl restart netbox netbox-rq -``` - -## Removing Plugins - -Follow these steps to completely remove a plugin. - -### Update Configuration - -Remove the plugin from the `PLUGINS` list in `configuration.py`. Also remove any relevant configuration parameters from `PLUGINS_CONFIG`. - -### Remove the Python Package - -Use `pip` to remove the installed plugin: - -```no-highlight -$ source /opt/netbox/venv/bin/activate -(venv) $ pip uninstall -``` - -### Restart WSGI Service - -Restart the WSGI service: - -```no-highlight -# sudo systemctl restart netbox -``` - -### Drop Database Tables - -!!! note - This step is necessary only for plugin which have created one or more database tables (generally through the introduction of new models). Check your plugin's documentation if unsure. - -Enter the PostgreSQL database shell to determine if the plugin has created any SQL tables. Substitute `pluginname` in the example below for the name of the plugin being removed. (You can also run the `\dt` command without a pattern to list _all_ tables.) - -```no-highlight -netbox=> \dt pluginname_* - List of relations - List of relations - Schema | Name | Type | Owner ---------+----------------+-------+-------- - public | pluginname_foo | table | netbox - public | pluginname_bar | table | netbox -(2 rows) -``` - -!!! warning - Exercise extreme caution when removing tables. Users are strongly encouraged to perform a backup of their database immediately before taking these actions. - -Drop each of the listed tables to remove it from the database: - -```no-highlight -netbox=> DROP TABLE pluginname_foo; -DROP TABLE -netbox=> DROP TABLE pluginname_bar; -DROP TABLE -``` diff --git a/docs/plugins/installation.md b/docs/plugins/installation.md new file mode 100644 index 000000000..ffea5d42d --- /dev/null +++ b/docs/plugins/installation.md @@ -0,0 +1,68 @@ +# Installing a Plugin + +!!! warning + The instructions below detail the general process for installing and configuring a NetBox plugin. However, each plugin is different and may require additional tasks or modifications to the steps below. Always consult the documentation for a specific plugin **before** attempting to install it. + +## Install the Python Package + +Download and install the plugin's Python package per its installation instructions. Plugins published via PyPI are typically installed using the [`pip`](https://packaging.python.org/en/latest/tutorials/installing-packages/) command line utility. Be sure to install the plugin within NetBox's virtual environment. + +```no-highlight +$ source /opt/netbox/venv/bin/activate +(venv) $ pip install +``` + +Alternatively, you may wish to install the plugin manually by running `python setup.py install`. If you are developing a plugin and want to install it only temporarily, run `python setup.py develop` instead. + +## Enable the Plugin + +In `configuration.py`, add the plugin's name to the `PLUGINS` list: + +```python +PLUGINS = [ + # ... + 'plugin_name', +] +``` + +## Configure the Plugin + +If the plugin requires any configuration, define it in `configuration.py` under the `PLUGINS_CONFIG` parameter. The available configuration parameters should be detailed in the plugin's `README` file or other documentation. + +```no-highlight +PLUGINS_CONFIG = { + 'plugin_name': { + 'foo': 'bar', + 'buzz': 'bazz' + } +} +``` + +## Run Database Migrations + +If the plugin introduces new database models, run the provided schema migrations: + +```no-highlight +(venv) $ cd /opt/netbox/netbox/ +(venv) $ python3 manage.py migrate +``` + +!!! tip + It's okay to run the `migrate` management command even if the plugin does not include any migration files. + +## Collect Static Files + +Plugins may package static resources like images or scripts to be served directly by the HTTP front end. Ensure that these are copied to the static root directory with the `collectstatic` management command: + +```no-highlight +(venv) $ cd /opt/netbox/netbox/ +(venv) $ python3 manage.py collectstatic +``` + +### Restart WSGI Service + +Finally, restart the WSGI service and RQ workers to load the new plugin: + +```no-highlight +# sudo systemctl restart netbox netbox-rq +``` diff --git a/docs/plugins/removal.md b/docs/plugins/removal.md new file mode 100644 index 000000000..f5e81bdc0 --- /dev/null +++ b/docs/plugins/removal.md @@ -0,0 +1,72 @@ +# Removing a Plugin + +!!! warning + The instructions below detail the general process for removing a NetBox plugin. However, each plugin is different and may require additional tasks or modifications to the steps below. Always consult the documentation for a specific plugin **before** attempting to remove it. + +## Disable the Plugin + +Disable the plugin by removing it from the `PLUGINS` list in `configuration.py`. + +## Remove its Configuration + +Delete the plugin's entry (if any) in the `PLUGINS_CONFIG` dictionary in `configuration.py`. + +!!! tip + If there's a chance you may reinstall the plugin, consider commenting out any configuration parameters instead of deleting them. + +## Re-index Search Entries + +Run the `reindex` management command to reindex the global search engine. This will remove any stale entries pertaining to objects provided by the plugin. + +```no-highlight +$ cd /opt/netbox/netbox/ +$ source /opt/netbox/venv/bin/activate +(venv) $ python3 manage.py reindex +``` + +## Uninstall its Python Package + +Use `pip` to remove the installed plugin: + +```no-highlight +$ source /opt/netbox/venv/bin/activate +(venv) $ pip uninstall +``` + +## Restart WSGI Service + +Restart the WSGI service: + +```no-highlight +# sudo systemctl restart netbox +``` + +## Drop Database Tables + +!!! note + This step is necessary only for plugins which have created one or more database tables (generally through the introduction of new models). Check your plugin's documentation if unsure. + +Enter the PostgreSQL database shell (`manage.py dbshell`) to determine if the plugin has created any SQL tables. Substitute `pluginname` in the example below for the name of the plugin being removed. (You can also run the `\dt` command without a pattern to list _all_ tables.) + +```no-highlight +netbox=> \dt pluginname_* + List of relations + List of relations + Schema | Name | Type | Owner +--------+----------------+-------+-------- + public | pluginname_foo | table | netbox + public | pluginname_bar | table | netbox +(2 rows) +``` + +!!! warning + Exercise extreme caution when removing tables. Users are strongly encouraged to perform a backup of their database immediately before taking these actions. + +Drop each of the listed tables to remove it from the database: + +```no-highlight +netbox=> DROP TABLE pluginname_foo; +DROP TABLE +netbox=> DROP TABLE pluginname_bar; +DROP TABLE +``` diff --git a/docs/release-notes/version-3.7.md b/docs/release-notes/version-3.7.md index 0e4bcfc5b..caf8b65e4 100644 --- a/docs/release-notes/version-3.7.md +++ b/docs/release-notes/version-3.7.md @@ -1,11 +1,93 @@ # NetBox v3.7 -## v3.7.5 (FUTURE) +## v3.7.8 (2024-05-06) + +### Enhancements + +* [#12127](https://github.com/netbox-community/netbox/issues/12127) - Enable adding new cables directly from navigation menu + +### Bug Fixes + +* [#15877](https://github.com/netbox-community/netbox/issues/15877) - Account for virtual chassis membership when assigning related interfaces via bulk edit +* [#15917](https://github.com/netbox-community/netbox/issues/15917) - Fix pagination through search results within dropdown fields +* [#15925](https://github.com/netbox-community/netbox/issues/15925) - Fix SVG rendering of cable traces to circuit terminations +* [#15948](https://github.com/netbox-community/netbox/issues/15948) - Fix cable trace SVG generation for cables with multiple terminations at both ends +* [#15960](https://github.com/netbox-community/netbox/issues/15960) - Replace CSV export formatting for several many-to-many fields +* [#15961](https://github.com/netbox-community/netbox/issues/15961) - Fix secret toggle button for IKE policies + +--- + +## v3.7.7 (2024-05-01) + +### Enhancements + +* [#15428](https://github.com/netbox-community/netbox/issues/15428) - Show usage counts for associated objects on config template list +* [#15812](https://github.com/netbox-community/netbox/issues/15812) - Add Date & DateTime variable types for custom scripts +* [#15894](https://github.com/netbox-community/netbox/issues/15894) - Cache the generated API schema definition for shorter loading times + +### Bug Fixes + +* [#11460](https://github.com/netbox-community/netbox/issues/11460) - Fix AttributeError exception when editing a cable with only one end terminated +* [#13712](https://github.com/netbox-community/netbox/issues/13712) - Fix row highlighting for device interface list display +* [#13806](https://github.com/netbox-community/netbox/issues/13806) - Fix "mark" button tooltip on button activation for device interface list display +* [#13922](https://github.com/netbox-community/netbox/issues/13922) - Fix SVG drawing error on multiple termination trace with multiple devices +* [#14241](https://github.com/netbox-community/netbox/issues/14241) - Fix random interface swap when performing cable trace with multiple termination +* [#14852](https://github.com/netbox-community/netbox/issues/14852) - Fix NoReverseMatch exception when viewing an event rule which references a deleted custom script +* [#15524](https://github.com/netbox-community/netbox/issues/15524) - Fix rounding error when reporting IP range utilization +* [#15548](https://github.com/netbox-community/netbox/issues/15548) - Ignore many-to-many mappings when checking dependencies of an object being deleted +* [#15845](https://github.com/netbox-community/netbox/issues/15845) - Avoid extraneous database queries when fetching assigned IP addresses via REST API +* [#15872](https://github.com/netbox-community/netbox/issues/15872) - `BANNER_MAINTENANCE` content should permit custom HTML +* [#15891](https://github.com/netbox-community/netbox/issues/15891) - Ensure deterministic ordering for scripts & reports +* [#15896](https://github.com/netbox-community/netbox/issues/15896) - Fix retention of default value when editing a custom JSON field +* [#15899](https://github.com/netbox-community/netbox/issues/15899) - Fix exception when enabling the tags column on the L2VPN terminations table + +--- + +## v3.7.6 (2024-04-22) + +!!! warning + If remote authentication is in use with Gunicorn v22.0 or later, it may be necessary to configure Gunicorn's [`header_map`](https://docs.gunicorn.org/en/stable/settings.html#header-map) setting to preserve authentication headers. + +### Enhancements + +* [#14690](https://github.com/netbox-community/netbox/issues/14690) - Improve rendering of JSON data in configuration form +* [#15427](https://github.com/netbox-community/netbox/issues/15427) - Enable compatibility with non-Amazon S3 providers for remote data sources +* [#15640](https://github.com/netbox-community/netbox/issues/15640) - Add global search support for L2VPN identifiers +* [#15644](https://github.com/netbox-community/netbox/issues/15644) - Introduce new configuration parameters for enabling HTTP Strict Transport Security (HSTS) + +### Bug Fixes + +* [#15541](https://github.com/netbox-community/netbox/issues/15541) - Restore ability to modify assigned component template when adding/modifying an inventory item template +* [#15582](https://github.com/netbox-community/netbox/issues/15582) - Fix permission constraints for synchronization of remote data sources +* [#15588](https://github.com/netbox-community/netbox/issues/15588) - Correct OpenAPI schema definitions for read-only fields which may return null values +* [#15635](https://github.com/netbox-community/netbox/issues/15635) - Extend plugin removal instruction to include reindexing the global search cache +* [#15654](https://github.com/netbox-community/netbox/issues/15654) - Fix `AttributeError` exception when attempting to save an incomplete tunnel termination +* [#15668](https://github.com/netbox-community/netbox/issues/15668) - Fix permission required to display virtual disks tab on virtual machine UI view +* [#15685](https://github.com/netbox-community/netbox/issues/15685) - Allow filtering cables by decimal values using UI filter form +* [#15761](https://github.com/netbox-community/netbox/issues/15761) - Add missing `ike_policy` & `ike_policy_id` filters for IKE proposals +* [#15771](https://github.com/netbox-community/netbox/issues/15771) - Include `id` in list of supported fields for all bulk import forms +* [#15790](https://github.com/netbox-community/netbox/issues/15790) - Fix live preview support for EventRule comments + +--- + +## v3.7.5 (2024-04-04) + +### Enhancements + +* [#14707](https://github.com/netbox-community/netbox/issues/14707) - Clarify interface designation when creating tunnel terminations +* [#15039](https://github.com/netbox-community/netbox/issues/15039) - Allow API tokens to be cloned ### Bug Fixes * [#14799](https://github.com/netbox-community/netbox/issues/14799) - Avoid caching modified reports & scripts +* [#15029](https://github.com/netbox-community/netbox/issues/15029) - Raise a clean validation error when attempting to make duplicate FHRP group assignments +* [#15102](https://github.com/netbox-community/netbox/issues/15102) - Fix usage of selector widget for form fields referencing users/groups +* [#15435](https://github.com/netbox-community/netbox/issues/15435) - Correct permissions name to allow adding a module bay to a device via the UI * [#15502](https://github.com/netbox-community/netbox/issues/15502) - Fix KeyError exception when modifying an IP address assigned to a virtual machine +* [#15597](https://github.com/netbox-community/netbox/issues/15597) - Restore help modal for `button_class` field on custom link bulk import form +* [#15598](https://github.com/netbox-community/netbox/issues/15598) - Fix exception when creating a device from a device type with one or more child inventory items +* [#15608](https://github.com/netbox-community/netbox/issues/15608) - Avoid caching values of null fields in search index +* [#15609](https://github.com/netbox-community/netbox/issues/15609) - Fix filtering of the providers list by assigned ASN --- diff --git a/docs/release-notes/version-4.0.md b/docs/release-notes/version-4.0.md index ad5304331..ae0578690 100644 --- a/docs/release-notes/version-4.0.md +++ b/docs/release-notes/version-4.0.md @@ -1,8 +1,122 @@ # NetBox v4.0 -## v4.0-beta2 (FUTURE) +## v4.0.6 (FUTURE) -**WARNING:** This is a beta release of NetBox intended for testing and evaluation. **Do not use this software in production.** Also be aware that no upgrade path is provided to future releases. +--- + +## v4.0.5 (2024-06-06) + +### Enhancements + +* [#14810](https://github.com/netbox-community/netbox/issues/14810) - Enable contact assignment for services +* [#15489](https://github.com/netbox-community/netbox/issues/15489) - Add 1000Base-TX interface type +* [#15873](https://github.com/netbox-community/netbox/issues/15873) - Improve readability of allocates resource numbers for clusters +* [#16290](https://github.com/netbox-community/netbox/issues/16290) - Capture entire object in changelog data (but continue to display only non-internal attributes) +* [#16353](https://github.com/netbox-community/netbox/issues/16353) - Enable plugins to extend object change view with custom content + +### Bug Fixes + +* [#13422](https://github.com/netbox-community/netbox/issues/13422) - Rebuild MPTT trees for applicable models after merging staged changes +* [#14567](https://github.com/netbox-community/netbox/issues/14567) - Apply active quicksearch value when exporting "current view" from object list +* [#15194](https://github.com/netbox-community/netbox/issues/15194) - Avoid enqueuing duplicate event triggers for a modified object +* [#16039](https://github.com/netbox-community/netbox/issues/16039) - Fix row highlighting for front & rear port connections under device view +* [#16050](https://github.com/netbox-community/netbox/issues/16050) - Fix display of names & descriptions defined for custom scripts +* [#16083](https://github.com/netbox-community/netbox/issues/16083) - Disable font ligatures to avoid peculiarities in rendered text +* [#16202](https://github.com/netbox-community/netbox/issues/16202) - Fix site map button URL for certain localizations +* [#16261](https://github.com/netbox-community/netbox/issues/16261) - Fix GraphQL filtering for certain multi-value filters +* [#16286](https://github.com/netbox-community/netbox/issues/16286) - Fix global search support for provider accounts +* [#16312](https://github.com/netbox-community/netbox/issues/16312) - Fix object list navigation for dashboard widgets +* [#16315](https://github.com/netbox-community/netbox/issues/16315) - Fix filtering change log & journal entries by object type in UI +* [#16376](https://github.com/netbox-community/netbox/issues/16376) - Update change log for the terminating object (e.g. interface) when attaching a cable +* [#16400](https://github.com/netbox-community/netbox/issues/16400) - Fix AttributeError when attempting to restore a previous configuration revision after deleting the current one + +--- + +## v4.0.3 (2024-05-22) + +### Enhancements + +* [#12984](https://github.com/netbox-community/netbox/issues/12984) - Add Molex Micro-Fit power port & outlet types +* [#13764](https://github.com/netbox-community/netbox/issues/13764) - Enable contact assignments for aggregates, prefixes, IP ranges, and IP addresses +* [#14639](https://github.com/netbox-community/netbox/issues/14639) - Add Ukrainian translation support +* [#14653](https://github.com/netbox-community/netbox/issues/14653) - Add an inventory items table column for all device components +* [#14686](https://github.com/netbox-community/netbox/issues/14686) - Add German translation support +* [#14855](https://github.com/netbox-community/netbox/issues/14855) - Add Chinese translation support +* [#14948](https://github.com/netbox-community/netbox/issues/14948) - Introduce the `has_virtual_device_context` filter for devices +* [#15353](https://github.com/netbox-community/netbox/issues/15353) - Improve error reporting when custom scripts fail to load +* [#15496](https://github.com/netbox-community/netbox/issues/15496) - Implement dedicated views for management of circuit terminations +* [#15603](https://github.com/netbox-community/netbox/issues/15603) - Add 4G & 5G cellular interface types +* [#15962](https://github.com/netbox-community/netbox/issues/15962) - Enable UNIX socket connections for Redis + +### Bug Fixes + +* [#13293](https://github.com/netbox-community/netbox/issues/13293) - Limit interface selector for IP address to current device/VM +* [#14953](https://github.com/netbox-community/netbox/issues/14953) - Ensure annotated count fields are present in REST API response data when creating new objects +* [#14982](https://github.com/netbox-community/netbox/issues/14982) - Fix OpenAPI schema definition for SerializedPKRelatedFields +* [#15082](https://github.com/netbox-community/netbox/issues/15082) - Strip whitespace from choice values & labels when creating a custom field choice set +* [#16138](https://github.com/netbox-community/netbox/issues/16138) - Fix support for referencing users & groups in object permissions +* [#16145](https://github.com/netbox-community/netbox/issues/16145) - Restore ability to reference custom scripts via module & name in REST API +* [#16164](https://github.com/netbox-community/netbox/issues/16164) - Correct display of selected values in UI when filtering object list by a null value +* [#16173](https://github.com/netbox-community/netbox/issues/16173) - Fix TypeError exception when viewing object list with no pagination preference defined +* [#16228](https://github.com/netbox-community/netbox/issues/16228) - Fix permissions enforcement for GraphQL queries of users & groups +* [#16232](https://github.com/netbox-community/netbox/issues/16232) - Preserve bulk action checkboxes on dynamic tables when using pagination +* [#16240](https://github.com/netbox-community/netbox/issues/16240) - Fixed NoReverseMatch exception when adding circuit terminations to an object counts dashboard widget + +--- + +## v4.0.2 (2024-05-14) + +!!! warning "Important" + This release includes an important security fix, and is a strongly recommended update for all users. More details will follow. + +### Enhancements + +* [#15119](https://github.com/netbox-community/netbox/issues/15119) - Add cluster & cluster group UI filter fields for VLAN groups +* [#16090](https://github.com/netbox-community/netbox/issues/16090) - Include current NetBox version when an unsupported plugin is detected +* [#16096](https://github.com/netbox-community/netbox/issues/16096) - Introduce the `ENABLE_TRANSLATION` configuration parameter +* [#16107](https://github.com/netbox-community/netbox/issues/16107) - Change the default value for `LOGIN_REQUIRED` to True +* [#16127](https://github.com/netbox-community/netbox/issues/16127) - Add integration point for unsupported settings + +### Bug Fixes + +* [#16077](https://github.com/netbox-community/netbox/issues/16077) - Fix display of parameter values when viewing configuration revisions +* [#16078](https://github.com/netbox-community/netbox/issues/16078) - Fix integer filters mistakenly marked as required for GraphQL API +* [#16101](https://github.com/netbox-community/netbox/issues/16101) - Fix initial loading of pagination widget for dynamic object tables +* [#16123](https://github.com/netbox-community/netbox/issues/16123) - Fix custom script execution via REST API +* [#16124](https://github.com/netbox-community/netbox/issues/16124) - Fix GraphQL API support for querying virtual machine interfaces + +--- + +## v4.0.1 (2024-05-09) + +### Enhancements + +* [#15148](https://github.com/netbox-community/netbox/issues/15148) - Add copy-to-clipboard button for config context data +* [#15328](https://github.com/netbox-community/netbox/issues/15328) - Add a virtual machines UI tab for host devices +* [#15451](https://github.com/netbox-community/netbox/issues/15451) - Add 2.5 and 5 Gbps backplane Ethernet interface types +* [#16010](https://github.com/netbox-community/netbox/issues/16010) - Enable Prometheus middleware only if metrics are enabled + +### Bug Fixes + +* [#15968](https://github.com/netbox-community/netbox/issues/15968) - Avoid resizing quick search field to display clear button +* [#15973](https://github.com/netbox-community/netbox/issues/15973) - Fix AttributeError exception when modifying cable termination type +* [#15977](https://github.com/netbox-community/netbox/issues/15977) - Hide all admin menu items for non-authenticated users +* [#15982](https://github.com/netbox-community/netbox/issues/15982) - Restore the "assign IP" tab for assigning existing IP addresses to interfaces +* [#15992](https://github.com/netbox-community/netbox/issues/15992) - Fix AttributeError exception when Sentry integration is enabled +* [#15995](https://github.com/netbox-community/netbox/issues/15995) - Permit nullable fields referenced by unique constraints to be omitted from REST API requests +* [#15999](https://github.com/netbox-community/netbox/issues/15999) - Fix layout of login form labels for certain languages +* [#16003](https://github.com/netbox-community/netbox/issues/16003) - Enable cache busting for `setmode.js` asset to avoid breaking dark mode support on upgrade +* [#16011](https://github.com/netbox-community/netbox/issues/16011) - Fix site tenant assignment by PK via REST API +* [#16020](https://github.com/netbox-community/netbox/issues/16020) - Include Python version in system UI view +* [#16022](https://github.com/netbox-community/netbox/issues/16022) - Fix database migration failure when encountering a script module which no longer exists on disk +* [#16025](https://github.com/netbox-community/netbox/issues/16025) - Fix execution of scripts via the `runscript` management command +* [#16031](https://github.com/netbox-community/netbox/issues/16031) - Render Markdown content in script log messages +* [#16051](https://github.com/netbox-community/netbox/issues/16051) - Translate "empty" text for object tables +* [#16061](https://github.com/netbox-community/netbox/issues/16061) - Omit hidden fields from display within event rule edit form + +--- + +## v4.0.0 (2024-05-06) !!! tip "Plugin Maintainers" Please see the dedicated [plugin migration guide](../plugins/development/migration-v4.md) for a checklist of changes that may be needed to ensure compatibility with NetBox v4.0. @@ -18,6 +132,7 @@ * The `object_type` field on the CustomField model has been renamed to `related_object_type`. * The `utilities.utils` module has been removed and its resources reorganized into separate modules organized by function. * The obsolete `NullableCharField` class has been removed. (Use Django's stock `CharField` class with `null=True` instead.) +* The `annotated_date` template filter and `annotated_now` template tag have been removed. ### New Features @@ -66,7 +181,7 @@ The legacy admin user interface is now disabled by default, and the few remainin ### Enhancements -* [#12776](https://github.com/netbox-community/netbox/issues/12776) - Introduce the `htmx_talble` template tag to simplify the rendering of embedded tables +* [#12776](https://github.com/netbox-community/netbox/issues/12776) - Introduce the `htmx_table` template tag to simplify the rendering of embedded tables * [#12851](https://github.com/netbox-community/netbox/issues/12851) - Replace the deprecated Bleach HTML sanitization library with nh3 * [#13283](https://github.com/netbox-community/netbox/issues/13283) - Display additional context on API-backed dropdown form fields (e.g. object descriptions) * [#13918](https://github.com/netbox-community/netbox/issues/13918) - Add `facility` field to Location model @@ -86,15 +201,26 @@ The legacy admin user interface is now disabled by default, and the few remainin * [#15383](https://github.com/netbox-community/netbox/issues/15383) - Standardize filtering logic for the parents of recursively-nested models (parent & ancestor filters) * [#15413](https://github.com/netbox-community/netbox/issues/15413) - The global search engine now supports caching of non-field object attributes * [#15490](https://github.com/netbox-community/netbox/issues/15490) - Custom validators can now reference related object attributes via dotted paths +* [#15547](https://github.com/netbox-community/netbox/issues/15547) - Add comments field to CustomField model +* [#15712](https://github.com/netbox-community/netbox/issues/15712) - Enable image attachments for virtual machines +* [#15735](https://github.com/netbox-community/netbox/issues/15735) - Display all dates & times in ISO 8601 format consistently +* [#15754](https://github.com/netbox-community/netbox/issues/15754) - Remove `is_staff` restriction on admin menu items +* [#15764](https://github.com/netbox-community/netbox/issues/15764) - Increase maximum value of Device `vc_position` field +* [#15915](https://github.com/netbox-community/netbox/issues/15915) - Provide a comprehensive system status view with export functionality -### Bug Fixes (from Beta1) +### Bug Fixes (from Beta2) -* [#15605](https://github.com/netbox-community/netbox/issues/15605) - Fix `ProgrammingError` exception when applying migrations to older databases -* [#15616](https://github.com/netbox-community/netbox/issues/15616) - Fix button style for invalid custom links -* [#15617](https://github.com/netbox-community/netbox/issues/15617) - Fix rack elevation styling under dark mode -* [#15619](https://github.com/netbox-community/netbox/issues/15619) - Enforce a minimum width for progress bars -* [#15637](https://github.com/netbox-community/netbox/issues/15637) - Correct nonfunctional links within embedded tables when HTMX enabled -* [#15638](https://github.com/netbox-community/netbox/issues/15638) - Correct parameter used to retrieve saved filters for a model +* [#15630](https://github.com/netbox-community/netbox/issues/15630) - Ensure consistent toggling between light & dark UI modes +* [#15802](https://github.com/netbox-community/netbox/issues/15802) - Improve hyperlink color contrast in dark mode +* [#15809](https://github.com/netbox-community/netbox/issues/15809) - Fix GraphQL union support for nullable fields +* [#15815](https://github.com/netbox-community/netbox/issues/15815) - Convert dashboard widgets referencing old user/group models +* [#15826](https://github.com/netbox-community/netbox/issues/15826) - Update `EXEMPT_EXCLUDE_MODELS` to reference new user & group models +* [#15831](https://github.com/netbox-community/netbox/issues/15831) - Fix LDAP group mirroring +* [#15838](https://github.com/netbox-community/netbox/issues/15838) - Fix AttributeError exception when rendering custom date fields +* [#15852](https://github.com/netbox-community/netbox/issues/15852) - Update total results count when filtering object lists +* [#15853](https://github.com/netbox-community/netbox/issues/15853) - Correct background color for cable trace SVG images in dark mode +* [#15855](https://github.com/netbox-community/netbox/issues/15855) - Fix AttributeError exception when creating an event rule tied to a custom script +* [#15944](https://github.com/netbox-community/netbox/issues/15944) - Fix styling of paginator when displayed above an object list ### Other Changes @@ -119,6 +245,10 @@ The legacy admin user interface is now disabled by default, and the few remainin * [#15401](https://github.com/netbox-community/netbox/issues/15401) - PostgreSQL indexes and sequence tables for the relocated L2VPN models (see [#14311](https://github.com/netbox-community/netbox/issues/14311)) have been renamed * [#15462](https://github.com/netbox-community/netbox/issues/15462) - Relocate resources from the `utilities.utils` module * [#15464](https://github.com/netbox-community/netbox/issues/15464) - The many-to-many relationships for ObjectPermission are now defined on the custom User and Group models +* [#15736](https://github.com/netbox-community/netbox/issues/15736) - Remove obsolete `annotated_date` template filter & `annotated_now` template tag +* [#15738](https://github.com/netbox-community/netbox/issues/15738) - Remove obsolete configuration parameters for date & time formatting +* [#15752](https://github.com/netbox-community/netbox/issues/15752) - Remove the obsolete `ENABLE_LOCALIZATION` configuration parameter +* [#15942](https://github.com/netbox-community/netbox/issues/15942) - Refactor `settings_and_registry()` context processor ### REST API Changes diff --git a/mkdocs.yml b/mkdocs.yml index 3db4734a4..cf1e66cea 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -42,6 +42,7 @@ plugins: show_root_toc_entry: false show_source: false extra: + build_public: !ENV BUILD_PUBLIC social: - icon: fontawesome/brands/github link: https://github.com/netbox-community/netbox @@ -112,7 +113,6 @@ nav: - Default Values: 'configuration/default-values.md' - Error Reporting: 'configuration/error-reporting.md' - Plugins: 'configuration/plugins.md' - - Date & Time: 'configuration/date-time.md' - Miscellaneous: 'configuration/miscellaneous.md' - Development: 'configuration/development.md' - Customization: @@ -129,7 +129,9 @@ nav: - Synchronized Data: 'integrations/synchronized-data.md' - Prometheus Metrics: 'integrations/prometheus-metrics.md' - Plugins: - - Using Plugins: 'plugins/index.md' + - About Plugins: 'plugins/index.md' + - Installing a Plugin: 'plugins/installation.md' + - Removing a Plugin: 'plugins/removal.md' - Developing Plugins: - Getting Started: 'plugins/development/index.md' - Models: 'plugins/development/models.md' diff --git a/netbox/account/tables.py b/netbox/account/tables.py index 6655a7f82..bcc0a0ccd 100644 --- a/netbox/account/tables.py +++ b/netbox/account/tables.py @@ -30,10 +30,12 @@ class UserTokenTable(NetBoxTable): write_enabled = columns.BooleanColumn( verbose_name=_('Write Enabled') ) - created = columns.DateColumn( + created = columns.DateTimeColumn( + timespec='minutes', verbose_name=_('Created'), ) - expires = columns.DateColumn( + expires = columns.DateTimeColumn( + timespec='minutes', verbose_name=_('Expires'), ) last_used = columns.DateTimeColumn( diff --git a/netbox/circuits/api/serializers_/circuits.py b/netbox/circuits/api/serializers_/circuits.py index b59c73f09..a0d0e5e13 100644 --- a/netbox/circuits/api/serializers_/circuits.py +++ b/netbox/circuits/api/serializers_/circuits.py @@ -48,7 +48,7 @@ class CircuitCircuitTerminationSerializer(WritableNestedSerializer): class CircuitSerializer(NetBoxModelSerializer): url = serializers.HyperlinkedIdentityField(view_name='circuits-api:circuit-detail') provider = ProviderSerializer(nested=True) - provider_account = ProviderAccountSerializer(nested=True, required=False, allow_null=True) + provider_account = ProviderAccountSerializer(nested=True, required=False, allow_null=True, default=None) status = ChoiceField(choices=CircuitStatusChoices, required=False) type = CircuitTypeSerializer(nested=True) tenant = TenantSerializer(nested=True, required=False, allow_null=True) diff --git a/netbox/circuits/api/serializers_/providers.py b/netbox/circuits/api/serializers_/providers.py index 302c2da5a..fa4489787 100644 --- a/netbox/circuits/api/serializers_/providers.py +++ b/netbox/circuits/api/serializers_/providers.py @@ -45,6 +45,7 @@ class ProviderSerializer(NetBoxModelSerializer): class ProviderAccountSerializer(NetBoxModelSerializer): url = serializers.HyperlinkedIdentityField(view_name='circuits-api:provideraccount-detail') provider = ProviderSerializer(nested=True) + name = serializers.CharField(allow_blank=True, max_length=100, required=False, default='') class Meta: model = ProviderAccount diff --git a/netbox/circuits/filtersets.py b/netbox/circuits/filtersets.py index cbf1fb82d..e52673874 100644 --- a/netbox/circuits/filtersets.py +++ b/netbox/circuits/filtersets.py @@ -64,6 +64,12 @@ class ProviderFilterSet(NetBoxModelFilterSet, ContactModelFilterSet): queryset=ASN.objects.all(), label=_('ASN (ID)'), ) + asn = django_filters.ModelMultipleChoiceFilter( + field_name='asns__asn', + queryset=ASN.objects.all(), + to_field_name='asn', + label=_('ASN'), + ) class Meta: model = Provider @@ -269,6 +275,17 @@ class CircuitTerminationFilterSet(NetBoxModelFilterSet, CabledObjectFilterSet): queryset=ProviderNetwork.objects.all(), label=_('ProviderNetwork (ID)'), ) + provider_id = django_filters.ModelMultipleChoiceFilter( + field_name='circuit__provider_id', + queryset=Provider.objects.all(), + label=_('Provider (ID)'), + ) + provider = django_filters.ModelMultipleChoiceFilter( + field_name='circuit__provider__slug', + queryset=Provider.objects.all(), + to_field_name='slug', + label=_('Provider (slug)'), + ) class Meta: model = CircuitTermination diff --git a/netbox/circuits/forms/bulk_edit.py b/netbox/circuits/forms/bulk_edit.py index 3ac311c56..ea15c3010 100644 --- a/netbox/circuits/forms/bulk_edit.py +++ b/netbox/circuits/forms/bulk_edit.py @@ -3,16 +3,18 @@ from django.utils.translation import gettext_lazy as _ from circuits.choices import CircuitCommitRateChoices, CircuitStatusChoices from circuits.models import * +from dcim.models import Site from ipam.models import ASN from netbox.forms import NetBoxModelBulkEditForm from tenancy.models import Tenant from utilities.forms import add_blank_choice from utilities.forms.fields import ColorField, CommentField, DynamicModelChoiceField, DynamicModelMultipleChoiceField -from utilities.forms.rendering import FieldSet -from utilities.forms.widgets import DatePicker, NumberWithOptions +from utilities.forms.rendering import FieldSet, TabbedGroups +from utilities.forms.widgets import BulkEditNullBooleanSelect, DatePicker, NumberWithOptions __all__ = ( 'CircuitBulkEditForm', + 'CircuitTerminationBulkEditForm', 'CircuitTypeBulkEditForm', 'ProviderBulkEditForm', 'ProviderAccountBulkEditForm', @@ -172,3 +174,48 @@ class CircuitBulkEditForm(NetBoxModelBulkEditForm): nullable_fields = ( 'tenant', 'commit_rate', 'description', 'comments', ) + + +class CircuitTerminationBulkEditForm(NetBoxModelBulkEditForm): + description = forms.CharField( + label=_('Description'), + max_length=200, + required=False + ) + site = DynamicModelChoiceField( + label=_('Site'), + queryset=Site.objects.all(), + required=False + ) + provider_network = DynamicModelChoiceField( + label=_('Provider Network'), + queryset=ProviderNetwork.objects.all(), + required=False + ) + port_speed = forms.IntegerField( + required=False, + label=_('Port speed (Kbps)'), + ) + upstream_speed = forms.IntegerField( + required=False, + label=_('Upstream speed (Kbps)'), + ) + mark_connected = forms.NullBooleanField( + label=_('Mark connected'), + required=False, + widget=BulkEditNullBooleanSelect + ) + + model = CircuitTermination + fieldsets = ( + FieldSet( + 'description', + TabbedGroups( + FieldSet('site', name=_('Site')), + FieldSet('provider_network', name=_('Provider Network')), + ), + 'mark_connected', name=_('Circuit Termination') + ), + FieldSet('port_speed', 'upstream_speed', name=_('Termination Details')), + ) + nullable_fields = ('description') diff --git a/netbox/circuits/forms/bulk_import.py b/netbox/circuits/forms/bulk_import.py index 8127d5bcb..1ceb44b60 100644 --- a/netbox/circuits/forms/bulk_import.py +++ b/netbox/circuits/forms/bulk_import.py @@ -1,10 +1,10 @@ from django import forms - -from circuits.choices import CircuitStatusChoices -from circuits.models import * -from dcim.models import Site from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ + +from circuits.choices import * +from circuits.models import * +from dcim.models import Site from netbox.forms import NetBoxModelImportForm from tenancy.models import Tenant from utilities.forms.fields import CSVChoiceField, CSVModelChoiceField, SlugField @@ -12,6 +12,7 @@ from utilities.forms.fields import CSVChoiceField, CSVModelChoiceField, SlugFiel __all__ = ( 'CircuitImportForm', 'CircuitTerminationImportForm', + 'CircuitTerminationImportRelatedForm', 'CircuitTypeImportForm', 'ProviderImportForm', 'ProviderAccountImportForm', @@ -111,7 +112,16 @@ class CircuitImportForm(NetBoxModelImportForm): ] -class CircuitTerminationImportForm(forms.ModelForm): +class BaseCircuitTerminationImportForm(forms.ModelForm): + circuit = CSVModelChoiceField( + label=_('Circuit'), + queryset=Circuit.objects.all(), + to_field_name='cid', + ) + term_side = CSVChoiceField( + label=_('Termination'), + choices=CircuitTerminationSideChoices, + ) site = CSVModelChoiceField( label=_('Site'), queryset=Site.objects.all(), @@ -125,9 +135,21 @@ class CircuitTerminationImportForm(forms.ModelForm): required=False ) + +class CircuitTerminationImportRelatedForm(BaseCircuitTerminationImportForm): class Meta: model = CircuitTermination fields = [ 'circuit', 'term_side', 'site', 'provider_network', 'port_speed', 'upstream_speed', 'xconnect_id', - 'pp_info', 'description', + 'pp_info', 'description' + ] + + +class CircuitTerminationImportForm(NetBoxModelImportForm, BaseCircuitTerminationImportForm): + + class Meta: + model = CircuitTermination + fields = [ + 'circuit', 'term_side', 'site', 'provider_network', 'port_speed', 'upstream_speed', 'xconnect_id', + 'pp_info', 'description', 'tags' ] diff --git a/netbox/circuits/forms/filtersets.py b/netbox/circuits/forms/filtersets.py index 01445ff6f..6f6473c3d 100644 --- a/netbox/circuits/forms/filtersets.py +++ b/netbox/circuits/forms/filtersets.py @@ -1,7 +1,7 @@ from django import forms from django.utils.translation import gettext as _ -from circuits.choices import CircuitCommitRateChoices, CircuitStatusChoices +from circuits.choices import CircuitCommitRateChoices, CircuitStatusChoices, CircuitTerminationSideChoices from circuits.models import * from dcim.models import Region, Site, SiteGroup from ipam.models import ASN @@ -13,6 +13,7 @@ from utilities.forms.widgets import DatePicker, NumberWithOptions __all__ = ( 'CircuitFilterForm', + 'CircuitTerminationFilterForm', 'CircuitTypeFilterForm', 'ProviderFilterForm', 'ProviderAccountFilterForm', @@ -25,7 +26,7 @@ class ProviderFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm): fieldsets = ( FieldSet('q', 'filter_id', 'tag'), FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')), - FieldSet('asn', name=_('ASN')), + FieldSet('asn_id', name=_('ASN')), FieldSet('contact', 'contact_role', 'contact_group', name=_('Contacts')), ) region_id = DynamicModelMultipleChoiceField( @@ -47,10 +48,6 @@ class ProviderFilterForm(ContactModelFilterForm, NetBoxModelFilterSetForm): }, label=_('Site') ) - asn = forms.IntegerField( - required=False, - label=_('ASN (legacy)') - ) asn_id = DynamicModelMultipleChoiceField( queryset=ASN.objects.all(), required=False, @@ -190,3 +187,46 @@ class CircuitFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFi ) ) tag = TagFilterField(model) + + +class CircuitTerminationFilterForm(NetBoxModelFilterSetForm): + model = CircuitTermination + fieldsets = ( + FieldSet('q', 'filter_id', 'tag'), + FieldSet('circuit_id', 'term_side', name=_('Circuit')), + FieldSet('provider_id', 'provider_network_id', name=_('Provider')), + FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')), + ) + site_id = DynamicModelMultipleChoiceField( + queryset=Site.objects.all(), + required=False, + query_params={ + 'region_id': '$region_id', + 'site_group_id': '$site_group_id', + }, + label=_('Site') + ) + circuit_id = DynamicModelMultipleChoiceField( + queryset=Circuit.objects.all(), + required=False, + label=_('Circuit') + ) + term_side = forms.MultipleChoiceField( + label=_('Term Side'), + choices=CircuitTerminationSideChoices, + required=False + ) + provider_network_id = DynamicModelMultipleChoiceField( + queryset=ProviderNetwork.objects.all(), + required=False, + query_params={ + 'provider_id': '$provider_id' + }, + label=_('Provider network') + ) + provider_id = DynamicModelMultipleChoiceField( + queryset=Provider.objects.all(), + required=False, + label=_('Provider') + ) + tag = TagFilterField(model) diff --git a/netbox/circuits/models/circuits.py b/netbox/circuits/models/circuits.py index 7b65d52ad..fa21d7cd3 100644 --- a/netbox/circuits/models/circuits.py +++ b/netbox/circuits/models/circuits.py @@ -227,7 +227,7 @@ class CircuitTermination( return f'{self.circuit}: Termination {self.term_side}' def get_absolute_url(self): - return self.circuit.get_absolute_url() + return reverse('circuits:circuittermination', args=[self.pk]) def clean(self): super().clean() diff --git a/netbox/circuits/search.py b/netbox/circuits/search.py index c22b400eb..f3fa359ba 100644 --- a/netbox/circuits/search.py +++ b/netbox/circuits/search.py @@ -48,6 +48,7 @@ class ProviderIndex(SearchIndex): display_attrs = ('description',) +@register_search class ProviderAccountIndex(SearchIndex): model = models.ProviderAccount fields = ( diff --git a/netbox/circuits/tables/circuits.py b/netbox/circuits/tables/circuits.py index 6ae727eca..5d650df61 100644 --- a/netbox/circuits/tables/circuits.py +++ b/netbox/circuits/tables/circuits.py @@ -10,6 +10,7 @@ from .columns import CommitRateColumn __all__ = ( 'CircuitTable', + 'CircuitTerminationTable', 'CircuitTypeTable', ) @@ -88,3 +89,31 @@ class CircuitTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable): default_columns = ( 'pk', 'cid', 'provider', 'type', 'status', 'tenant', 'termination_a', 'termination_z', 'description', ) + + +class CircuitTerminationTable(NetBoxTable): + circuit = tables.Column( + verbose_name=_('Circuit'), + linkify=True + ) + provider = tables.Column( + verbose_name=_('Provider'), + linkify=True, + accessor='circuit.provider' + ) + site = tables.Column( + verbose_name=_('Site'), + linkify=True + ) + provider_network = tables.Column( + verbose_name=_('Provider Network'), + linkify=True + ) + + class Meta(NetBoxTable.Meta): + model = CircuitTermination + fields = ( + 'pk', 'id', 'circuit', 'provider', 'term_side', 'site', 'provider_network', 'port_speed', 'upstream_speed', + 'xconnect_id', 'pp_info', 'description', 'created', 'last_updated', 'actions', + ) + default_columns = ('pk', 'id', 'circuit', 'provider', 'term_side', 'description') diff --git a/netbox/circuits/tests/test_api.py b/netbox/circuits/tests/test_api.py index c8ec08943..d3745f2b1 100644 --- a/netbox/circuits/tests/test_api.py +++ b/netbox/circuits/tests/test_api.py @@ -141,7 +141,7 @@ class CircuitTest(APIViewTestCases.APIViewTestCase): { 'cid': 'Circuit 6', 'provider': providers[1].pk, - 'provider_account': provider_accounts[1].pk, + # Omit provider account to test uniqueness constraint 'type': circuit_types[1].pk, }, ] @@ -237,7 +237,7 @@ class ProviderAccountTest(APIViewTestCases.APIViewTestCase): 'account': '5678', }, { - 'name': 'Provider Account 6', + # Omit name to test uniqueness constraint 'provider': providers[0].pk, 'account': '6789', }, diff --git a/netbox/circuits/tests/test_filtersets.py b/netbox/circuits/tests/test_filtersets.py index bbd2438d7..df10c3929 100644 --- a/netbox/circuits/tests/test_filtersets.py +++ b/netbox/circuits/tests/test_filtersets.py @@ -90,10 +90,12 @@ class ProviderTestCase(TestCase, ChangeLoggedFilterSetTests): params = {'description': ['foobar1', 'foobar2']} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) - def test_asn_id(self): # ASN object assignment + def test_asn(self): asns = ASN.objects.all()[:2] params = {'asn_id': [asns[0].pk, asns[1].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) + params = {'asn': [asns[0].asn, asns[1].asn]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) def test_region(self): regions = Region.objects.all()[:2] @@ -349,24 +351,26 @@ class CircuitTerminationTestCase(TestCase, ChangeLoggedFilterSetTests): providers = ( Provider(name='Provider 1', slug='provider-1'), + Provider(name='Provider 2', slug='provider-2'), + Provider(name='Provider 3', slug='provider-3'), ) Provider.objects.bulk_create(providers) provider_networks = ( ProviderNetwork(name='Provider Network 1', provider=providers[0]), - ProviderNetwork(name='Provider Network 2', provider=providers[0]), - ProviderNetwork(name='Provider Network 3', provider=providers[0]), + ProviderNetwork(name='Provider Network 2', provider=providers[1]), + ProviderNetwork(name='Provider Network 3', provider=providers[2]), ) ProviderNetwork.objects.bulk_create(provider_networks) circuits = ( Circuit(provider=providers[0], type=circuit_types[0], cid='Circuit 1'), - Circuit(provider=providers[0], type=circuit_types[0], cid='Circuit 2'), - Circuit(provider=providers[0], type=circuit_types[0], cid='Circuit 3'), + Circuit(provider=providers[1], type=circuit_types[0], cid='Circuit 2'), + Circuit(provider=providers[2], type=circuit_types[0], cid='Circuit 3'), Circuit(provider=providers[0], type=circuit_types[0], cid='Circuit 4'), - Circuit(provider=providers[0], type=circuit_types[0], cid='Circuit 5'), - Circuit(provider=providers[0], type=circuit_types[0], cid='Circuit 6'), - Circuit(provider=providers[0], type=circuit_types[0], cid='Circuit 7'), + Circuit(provider=providers[1], type=circuit_types[0], cid='Circuit 5'), + Circuit(provider=providers[2], type=circuit_types[0], cid='Circuit 6'), + Circuit(provider=providers[2], type=circuit_types[0], cid='Circuit 7'), ) Circuit.objects.bulk_create(circuits) @@ -411,10 +415,17 @@ class CircuitTerminationTestCase(TestCase, ChangeLoggedFilterSetTests): self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) def test_circuit_id(self): - circuits = Circuit.objects.all()[:2] + circuits = Circuit.objects.filter(cid__in=['Circuit 1', 'Circuit 2']) params = {'circuit_id': [circuits[0].pk, circuits[1].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 4) + def test_provider(self): + providers = Provider.objects.all()[:2] + params = {'provider_id': [providers[0].pk, providers[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 6) + params = {'provider': [providers[0].slug, providers[1].slug]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 6) + def test_site(self): sites = Site.objects.all()[:2] params = {'site_id': [sites[0].pk, sites[1].pk]} diff --git a/netbox/circuits/tests/test_views.py b/netbox/circuits/tests/test_views.py index 85e2304cf..577548703 100644 --- a/netbox/circuits/tests/test_views.py +++ b/netbox/circuits/tests/test_views.py @@ -5,8 +5,11 @@ from django.urls import reverse from circuits.choices import * from circuits.models import * +from core.models import ObjectType from dcim.models import Cable, Interface, Site from ipam.models import ASN, RIR +from netbox.choices import ImportFormatChoices +from users.models import ObjectPermission from utilities.testing import ViewTestCases, create_tags, create_test_device @@ -115,6 +118,7 @@ class CircuitTestCase(ViewTestCases.PrimaryObjectViewTestCase): @classmethod def setUpTestData(cls): + Site.objects.create(name='Site 1', slug='site-1') providers = ( Provider(name='Provider 1', slug='provider-1'), @@ -184,6 +188,51 @@ class CircuitTestCase(ViewTestCases.PrimaryObjectViewTestCase): 'comments': 'New comments', } + @override_settings(EXEMPT_VIEW_PERMISSIONS=['*'], EXEMPT_EXCLUDE_MODELS=[]) + def test_bulk_import_objects_with_terminations(self): + json_data = """ + [ + { + "cid": "Circuit 7", + "provider": "Provider 1", + "type": "Circuit Type 1", + "status": "active", + "description": "Testing Import", + "terminations": [ + { + "term_side": "A", + "site": "Site 1" + }, + { + "term_side": "Z", + "site": "Site 1" + } + ] + } + ] + """ + initial_count = self._get_queryset().count() + data = { + 'data': json_data, + 'format': ImportFormatChoices.JSON, + } + + # Assign model-level permission + obj_perm = ObjectPermission( + name='Test permission', + actions=['add'] + ) + obj_perm.save() + obj_perm.users.add(self.user) + obj_perm.object_types.add(ObjectType.objects.get_for_model(self.model)) + + # Try GET with model-level permission + self.assertHttpStatus(self.client.get(self._get_url('import')), 200) + + # Test POST with permission + self.assertHttpStatus(self.client.post(self._get_url('import'), data), 302) + self.assertEqual(self._get_queryset().count(), initial_count + 1) + class ProviderAccountTestCase(ViewTestCases.PrimaryObjectViewTestCase): model = ProviderAccount @@ -287,10 +336,7 @@ class ProviderNetworkTestCase(ViewTestCases.PrimaryObjectViewTestCase): } -class CircuitTerminationTestCase( - ViewTestCases.EditObjectViewTestCase, - ViewTestCases.DeleteObjectViewTestCase, -): +class CircuitTerminationTestCase(ViewTestCases.PrimaryObjectViewTestCase): model = CircuitTermination @classmethod @@ -327,6 +373,24 @@ class CircuitTerminationTestCase( 'description': 'New description', } + cls.csv_data = ( + "circuit,term_side,site,description", + "Circuit 3,A,Site 1,Foo", + "Circuit 3,Z,Site 1,Bar", + ) + + cls.csv_update_data = ( + "id,port_speed,description", + f"{circuit_terminations[0].pk},100,New description7", + f"{circuit_terminations[1].pk},200,New description8", + f"{circuit_terminations[2].pk},300,New description9", + ) + + cls.bulk_edit_data = { + 'port_speed': 400, + 'description': 'New description', + } + @override_settings(EXEMPT_VIEW_PERMISSIONS=['*']) def test_trace(self): device = create_test_device('Device 1') diff --git a/netbox/circuits/urls.py b/netbox/circuits/urls.py index 55a192c64..5c0ab99ee 100644 --- a/netbox/circuits/urls.py +++ b/netbox/circuits/urls.py @@ -48,7 +48,11 @@ urlpatterns = [ path('circuits//', include(get_model_urls('circuits', 'circuit'))), # Circuit terminations + path('circuit-terminations/', views.CircuitTerminationListView.as_view(), name='circuittermination_list'), path('circuit-terminations/add/', views.CircuitTerminationEditView.as_view(), name='circuittermination_add'), + path('circuit-terminations/import/', views.CircuitTerminationBulkImportView.as_view(), name='circuittermination_import'), + path('circuit-terminations/edit/', views.CircuitTerminationBulkEditView.as_view(), name='circuittermination_bulk_edit'), + path('circuit-terminations/delete/', views.CircuitTerminationBulkDeleteView.as_view(), name='circuittermination_bulk_delete'), path('circuit-terminations//', include(get_model_urls('circuits', 'circuittermination'))), ] diff --git a/netbox/circuits/views.py b/netbox/circuits/views.py index 54f875975..def9a3640 100644 --- a/netbox/circuits/views.py +++ b/netbox/circuits/views.py @@ -298,7 +298,7 @@ class CircuitBulkImportView(generic.BulkImportView): 'circuits.add_circuittermination', ] related_object_forms = { - 'terminations': forms.CircuitTerminationImportForm, + 'terminations': forms.CircuitTerminationImportRelatedForm, } def prep_related_object_data(self, parent, data): @@ -408,6 +408,18 @@ class CircuitContactsView(ObjectContactsView): # Circuit terminations # +class CircuitTerminationListView(generic.ObjectListView): + queryset = CircuitTermination.objects.all() + filterset = filtersets.CircuitTerminationFilterSet + filterset_form = forms.CircuitTerminationFilterForm + table = tables.CircuitTerminationTable + + +@register_model_view(CircuitTermination) +class CircuitTerminationView(generic.ObjectView): + queryset = CircuitTermination.objects.all() + + @register_model_view(CircuitTermination, 'edit') class CircuitTerminationEditView(generic.ObjectEditView): queryset = CircuitTermination.objects.all() @@ -419,5 +431,23 @@ class CircuitTerminationDeleteView(generic.ObjectDeleteView): queryset = CircuitTermination.objects.all() +class CircuitTerminationBulkImportView(generic.BulkImportView): + queryset = CircuitTermination.objects.all() + model_form = forms.CircuitTerminationImportForm + + +class CircuitTerminationBulkEditView(generic.BulkEditView): + queryset = CircuitTermination.objects.all() + filterset = filtersets.CircuitTerminationFilterSet + table = tables.CircuitTerminationTable + form = forms.CircuitTerminationBulkEditForm + + +class CircuitTerminationBulkDeleteView(generic.BulkDeleteView): + queryset = CircuitTermination.objects.all() + filterset = filtersets.CircuitTerminationFilterSet + table = tables.CircuitTerminationTable + + # Trace view register_model_view(CircuitTermination, 'trace', kwargs={'model': CircuitTermination})(PathTraceView) diff --git a/netbox/core/api/schema.py b/netbox/core/api/schema.py index 5f64dcc53..bcc49d3fc 100644 --- a/netbox/core/api/schema.py +++ b/netbox/core/api/schema.py @@ -255,3 +255,14 @@ class NetBoxAutoSchema(AutoSchema): if '{id}' in self.path: return f"{self.method.capitalize()} a {model_name} object." return f"{self.method.capitalize()} a list of {model_name} objects." + + +class FixSerializedPKRelatedField(OpenApiSerializerFieldExtension): + target_class = 'netbox.api.fields.SerializedPKRelatedField' + + def map_serializer_field(self, auto_schema, direction): + if direction == "response": + component = auto_schema.resolve_serializer(self.target.serializer, direction) + return component.ref if component else None + else: + return build_basic_type(OpenApiTypes.INT) diff --git a/netbox/core/api/views.py b/netbox/core/api/views.py index 3fddfd691..6338523d2 100644 --- a/netbox/core/api/views.py +++ b/netbox/core/api/views.py @@ -1,5 +1,5 @@ from django.shortcuts import get_object_or_404 - +from django.utils.translation import gettext_lazy as _ from rest_framework.decorators import action from rest_framework.exceptions import PermissionDenied from rest_framework.response import Response @@ -30,10 +30,11 @@ class DataSourceViewSet(NetBoxModelViewSet): """ Enqueue a job to synchronize the DataSource. """ - if not request.user.has_perm('core.sync_datasource'): - raise PermissionDenied("Syncing data sources requires the core.sync_datasource permission.") - datasource = get_object_or_404(DataSource, pk=pk) + + if not request.user.has_perm('core.sync_datasource', obj=datasource): + raise PermissionDenied(_("This user does not have permission to synchronize this data source.")) + datasource.enqueue_sync_job(request) serializer = serializers.DataSourceSerializer(datasource, context={'request': request}) diff --git a/netbox/core/data_backends.py b/netbox/core/data_backends.py index 15891a6f5..2d3a7d8c8 100644 --- a/netbox/core/data_backends.py +++ b/netbox/core/data_backends.py @@ -149,7 +149,8 @@ class S3Backend(DataBackend): region_name=self._region_name, aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key, - config=self.config + config=self.config, + endpoint_url=self._endpoint_url ) bucket = s3.Bucket(self._bucket_name) @@ -176,6 +177,11 @@ class S3Backend(DataBackend): url_path = urlparse(self.url).path.lstrip('/') return url_path.split('/')[0] + @property + def _endpoint_url(self): + url_path = urlparse(self.url) + return url_path._replace(params="", fragment="", query="", path="").geturl() + @property def _remote_path(self): url_path = urlparse(self.url).path.lstrip('/') diff --git a/netbox/core/forms/model_forms.py b/netbox/core/forms/model_forms.py index cbca0737a..a05377597 100644 --- a/netbox/core/forms/model_forms.py +++ b/netbox/core/forms/model_forms.py @@ -3,6 +3,7 @@ import json from django import forms from django.conf import settings +from django.forms.fields import JSONField as _JSONField from django.utils.translation import gettext_lazy as _ from core.forms.mixins import SyncedDataMixin @@ -12,7 +13,7 @@ from netbox.forms import NetBoxModelForm from netbox.registry import registry from netbox.utils import get_data_backend_choices from utilities.forms import get_field_value -from utilities.forms.fields import CommentField +from utilities.forms.fields import CommentField, JSONField from utilities.forms.rendering import FieldSet from utilities.forms.widgets import HTMXSelect @@ -133,6 +134,9 @@ class ConfigFormMetaclass(forms.models.ModelFormMetaclass): 'help_text': param.description, } field_kwargs.update(**param.field_kwargs) + if param.field is _JSONField: + # Replace with our own JSONField to get pretty JSON in config editor + param.field = JSONField param_fields[param.name] = param.field(**field_kwargs) attrs.update(param_fields) diff --git a/netbox/core/management/commands/nbshell.py b/netbox/core/management/commands/nbshell.py index b96870252..7270c005a 100644 --- a/netbox/core/management/commands/nbshell.py +++ b/netbox/core/management/commands/nbshell.py @@ -18,7 +18,7 @@ BANNER_TEXT = """### NetBox interactive shell ({node}) node=platform.node(), python=platform.python_version(), django=get_version(), - netbox=settings.VERSION + netbox=settings.RELEASE.name ) diff --git a/netbox/core/tables/plugins.py b/netbox/core/tables/plugins.py index 2e3c0a991..21e90cd6b 100644 --- a/netbox/core/tables/plugins.py +++ b/netbox/core/tables/plugins.py @@ -35,5 +35,5 @@ class PluginTable(BaseTable): 'name', 'version', 'package', 'author', 'author_email', 'description', ) default_columns = ( - 'name', 'version', 'package', 'author', 'author_email', 'description', + 'name', 'version', 'package', 'description', ) diff --git a/netbox/core/tables/tasks.py b/netbox/core/tables/tasks.py index 531ec6375..f53e598b5 100644 --- a/netbox/core/tables/tasks.py +++ b/netbox/core/tables/tasks.py @@ -3,7 +3,7 @@ from django.utils.translation import gettext_lazy as _ from django_tables2.utils import A from core.tables.columns import RQJobStatusColumn -from netbox.tables import BaseTable +from netbox.tables import BaseTable, columns class BackgroundQueueTable(BaseTable): @@ -75,13 +75,13 @@ class BackgroundTaskTable(BaseTable): linkify=("core:background_task", [A("id")]), verbose_name=_("ID") ) - created_at = tables.DateTimeColumn( + created_at = columns.DateTimeColumn( verbose_name=_("Created") ) - enqueued_at = tables.DateTimeColumn( + enqueued_at = columns.DateTimeColumn( verbose_name=_("Enqueued") ) - ended_at = tables.DateTimeColumn( + ended_at = columns.DateTimeColumn( verbose_name=_("Ended") ) status = RQJobStatusColumn( @@ -117,7 +117,7 @@ class WorkerTable(BaseTable): state = tables.Column( verbose_name=_("State") ) - birth_date = tables.DateTimeColumn( + birth_date = columns.DateTimeColumn( verbose_name=_("Birth") ) pid = tables.Column( diff --git a/netbox/core/urls.py b/netbox/core/urls.py index bac2eed37..59eead615 100644 --- a/netbox/core/urls.py +++ b/netbox/core/urls.py @@ -43,9 +43,6 @@ urlpatterns = ( path('config-revisions//restore/', views.ConfigRevisionRestoreView.as_view(), name='configrevision_restore'), path('config-revisions//', include(get_model_urls('core', 'configrevision'))), - # Configuration - path('config/', views.ConfigView.as_view(), name='config'), - - # Plugins - path('plugins/', views.PluginListView.as_view(), name='plugin_list'), + # System + path('system/', views.SystemView.as_view(), name='system'), ) diff --git a/netbox/core/views.py b/netbox/core/views.py index b19ab207b..af705c8d1 100644 --- a/netbox/core/views.py +++ b/netbox/core/views.py @@ -1,14 +1,19 @@ +import json +import platform + +from django import __version__ as DJANGO_VERSION from django.apps import apps from django.conf import settings from django.contrib import messages from django.contrib.auth.mixins import UserPassesTestMixin from django.core.cache import cache -from django.http import HttpResponseForbidden, Http404 +from django.db import connection, ProgrammingError +from django.http import HttpResponse, HttpResponseForbidden, Http404 from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import View -from django_rq.queues import get_queue_by_index, get_redis_connection +from django_rq.queues import get_connection, get_queue_by_index, get_redis_connection from django_rq.settings import QUEUES_MAP, QUEUES_LIST from django_rq.utils import get_jobs, get_statistics, stop_jobs from rq import requeue_job @@ -175,20 +180,6 @@ class JobBulkDeleteView(generic.BulkDeleteView): # Config Revisions # -class ConfigView(generic.ObjectView): - queryset = ConfigRevision.objects.all() - - def get_object(self, **kwargs): - revision_id = cache.get('config_version') - try: - return ConfigRevision.objects.get(pk=revision_id) - except ConfigRevision.DoesNotExist: - # Fall back to using the active config data if no record is found - return ConfigRevision( - data=get_config().defaults - ) - - class ConfigRevisionListView(generic.ObjectListView): queryset = ConfigRevision.objects.all() filterset = filtersets.ConfigRevisionFilterSet @@ -233,7 +224,7 @@ class ConfigRevisionRestoreView(ContentTypePermissionRequiredMixin, View): for param in PARAMS: params.append(( param.name, - current_config.data.get(param.name, None), + current_config.data.get(param.name, None) if current_config else None, candidate_config.data.get(param.name, None) )) @@ -527,21 +518,69 @@ class WorkerView(BaseRQView): # Plugins # -class PluginListView(UserPassesTestMixin, View): +class SystemView(UserPassesTestMixin, View): def test_func(self): return self.request.user.is_staff def get(self, request): + + # System stats + psql_version = db_name = db_size = None + try: + with connection.cursor() as cursor: + cursor.execute("SELECT version()") + psql_version = cursor.fetchone()[0] + psql_version = psql_version.split('(')[0].strip() + cursor.execute("SELECT current_database()") + db_name = cursor.fetchone()[0] + cursor.execute(f"SELECT pg_size_pretty(pg_database_size('{db_name}'))") + db_size = cursor.fetchone()[0] + except (ProgrammingError, IndexError): + pass + stats = { + 'netbox_release': settings.RELEASE, + 'django_version': DJANGO_VERSION, + 'python_version': platform.python_version(), + 'postgresql_version': psql_version, + 'database_name': db_name, + 'database_size': db_size, + 'rq_worker_count': Worker.count(get_connection('default')), + } + + # Plugins plugins = [ # Look up app config by package name apps.get_app_config(plugin.rsplit('.', 1)[-1]) for plugin in settings.PLUGINS ] - table = tables.PluginTable(plugins, user=request.user) - table.configure(request) - return render(request, 'core/plugin_list.html', { - 'plugins': plugins, - 'active_tab': 'api-tokens', - 'table': table, + # Configuration + try: + config = ConfigRevision.objects.get(pk=cache.get('config_version')) + except ConfigRevision.DoesNotExist: + # Fall back to using the active config data if no record is found + config = ConfigRevision(data=get_config().defaults) + + # Raw data export + if 'export' in request.GET: + data = { + **stats, + 'plugins': { + plugin.name: plugin.version for plugin in plugins + }, + 'config': { + k: config.data[k] for k in sorted(config.data) + }, + } + response = HttpResponse(json.dumps(data, indent=4), content_type='text/json') + response['Content-Disposition'] = 'attachment; filename="netbox.json"' + return response + + plugins_table = tables.PluginTable(plugins, orderable=False) + plugins_table.configure(request) + + return render(request, 'core/system.html', { + 'stats': stats, + 'plugins_table': plugins_table, + 'config': config, }) diff --git a/netbox/dcim/api/serializers_/device_components.py b/netbox/dcim/api/serializers_/device_components.py index 87d142978..fd32d95d0 100644 --- a/netbox/dcim/api/serializers_/device_components.py +++ b/netbox/dcim/api/serializers_/device_components.py @@ -347,7 +347,7 @@ class InventoryItemSerializer(NetBoxModelSerializer): required=False, allow_null=True ) - component = serializers.SerializerMethodField(read_only=True) + component = serializers.SerializerMethodField(read_only=True, allow_null=True) _depth = serializers.IntegerField(source='level', read_only=True) class Meta: diff --git a/netbox/dcim/api/serializers_/devices.py b/netbox/dcim/api/serializers_/devices.py index 303c35532..edfac3072 100644 --- a/netbox/dcim/api/serializers_/devices.py +++ b/netbox/dcim/api/serializers_/devices.py @@ -53,7 +53,7 @@ class DeviceSerializer(NetBoxModelSerializer): ) status = ChoiceField(choices=DeviceStatusChoices, required=False) airflow = ChoiceField(choices=DeviceAirflowChoices, allow_blank=True, required=False) - primary_ip = IPAddressSerializer(nested=True, read_only=True) + primary_ip = IPAddressSerializer(nested=True, read_only=True, allow_null=True) primary_ip4 = IPAddressSerializer(nested=True, required=False, allow_null=True) primary_ip6 = IPAddressSerializer(nested=True, required=False, allow_null=True) oob_ip = IPAddressSerializer(nested=True, required=False, allow_null=True) @@ -101,7 +101,7 @@ class DeviceSerializer(NetBoxModelSerializer): class DeviceWithConfigContextSerializer(DeviceSerializer): - config_context = serializers.SerializerMethodField(read_only=True) + config_context = serializers.SerializerMethodField(read_only=True, allow_null=True) class Meta(DeviceSerializer.Meta): fields = [ @@ -122,6 +122,7 @@ class DeviceWithConfigContextSerializer(DeviceSerializer): class VirtualDeviceContextSerializer(NetBoxModelSerializer): url = serializers.HyperlinkedIdentityField(view_name='dcim-api:virtualdevicecontext-detail') device = DeviceSerializer(nested=True) + identifier = serializers.IntegerField(allow_null=True, max_value=32767, min_value=0, required=False, default=None) tenant = TenantSerializer(nested=True, required=False, allow_null=True, default=None) primary_ip = IPAddressSerializer(nested=True, read_only=True, allow_null=True) primary_ip4 = IPAddressSerializer(nested=True, required=False, allow_null=True) diff --git a/netbox/dcim/api/serializers_/devicetype_components.py b/netbox/dcim/api/serializers_/devicetype_components.py index 259a5df27..ca737ce38 100644 --- a/netbox/dcim/api/serializers_/devicetype_components.py +++ b/netbox/dcim/api/serializers_/devicetype_components.py @@ -307,7 +307,7 @@ class InventoryItemTemplateSerializer(ValidatedModelSerializer): required=False, allow_null=True ) - component = serializers.SerializerMethodField(read_only=True) + component = serializers.SerializerMethodField(read_only=True, allow_null=True) _depth = serializers.IntegerField(source='level', read_only=True) class Meta: diff --git a/netbox/dcim/api/serializers_/sites.py b/netbox/dcim/api/serializers_/sites.py index 8063278a7..60e1477e5 100644 --- a/netbox/dcim/api/serializers_/sites.py +++ b/netbox/dcim/api/serializers_/sites.py @@ -21,7 +21,7 @@ __all__ = ( class RegionSerializer(NestedGroupModelSerializer): url = serializers.HyperlinkedIdentityField(view_name='dcim-api:region-detail') parent = NestedRegionSerializer(required=False, allow_null=True, default=None) - site_count = serializers.IntegerField(read_only=True) + site_count = serializers.IntegerField(read_only=True, default=0) class Meta: model = Region @@ -35,7 +35,7 @@ class RegionSerializer(NestedGroupModelSerializer): class SiteGroupSerializer(NestedGroupModelSerializer): url = serializers.HyperlinkedIdentityField(view_name='dcim-api:sitegroup-detail') parent = NestedSiteGroupSerializer(required=False, allow_null=True, default=None) - site_count = serializers.IntegerField(read_only=True) + site_count = serializers.IntegerField(read_only=True, default=0) class Meta: model = SiteGroup @@ -51,7 +51,7 @@ class SiteSerializer(NetBoxModelSerializer): status = ChoiceField(choices=SiteStatusChoices, required=False) region = RegionSerializer(nested=True, required=False, allow_null=True) group = SiteGroupSerializer(nested=True, required=False, allow_null=True) - tenant = TenantSerializer(required=False, allow_null=True) + tenant = TenantSerializer(nested=True, required=False, allow_null=True) time_zone = TimeZoneSerializerField(required=False, allow_null=True) asns = SerializedPKRelatedField( queryset=ASN.objects.all(), @@ -83,11 +83,11 @@ class SiteSerializer(NetBoxModelSerializer): class LocationSerializer(NestedGroupModelSerializer): url = serializers.HyperlinkedIdentityField(view_name='dcim-api:location-detail') site = SiteSerializer(nested=True) - parent = NestedLocationSerializer(required=False, allow_null=True) + parent = NestedLocationSerializer(required=False, allow_null=True, default=None) status = ChoiceField(choices=LocationStatusChoices, required=False) tenant = TenantSerializer(nested=True, required=False, allow_null=True) - rack_count = serializers.IntegerField(read_only=True) - device_count = serializers.IntegerField(read_only=True) + rack_count = serializers.IntegerField(read_only=True, default=0) + device_count = serializers.IntegerField(read_only=True, default=0) class Meta: model = Location diff --git a/netbox/dcim/choices.py b/netbox/dcim/choices.py index b00784265..fe8d8a158 100644 --- a/netbox/dcim/choices.py +++ b/netbox/dcim/choices.py @@ -399,6 +399,10 @@ class PowerPortTypeChoices(ChoiceSet): TYPE_USB_MICRO_AB = 'usb-micro-ab' TYPE_USB_3_B = 'usb-3-b' TYPE_USB_3_MICROB = 'usb-3-micro-b' + # Molex + TYPE_MOLEX_MICRO_FIT_1X2 = 'molex-micro-fit-1x2' + TYPE_MOLEX_MICRO_FIT_2X2 = 'molex-micro-fit-2x2' + TYPE_MOLEX_MICRO_FIT_2X4 = 'molex-micro-fit-2x4' # Direct current (DC) TYPE_DC = 'dc-terminal' # Proprietary @@ -520,6 +524,11 @@ class PowerPortTypeChoices(ChoiceSet): (TYPE_USB_3_B, 'USB 3.0 Type B'), (TYPE_USB_3_MICROB, 'USB 3.0 Micro B'), )), + ('Molex', ( + (TYPE_MOLEX_MICRO_FIT_1X2, 'Molex Micro-Fit 1x2'), + (TYPE_MOLEX_MICRO_FIT_2X2, 'Molex Micro-Fit 2x2'), + (TYPE_MOLEX_MICRO_FIT_2X4, 'Molex Micro-Fit 2x4'), + )), ('DC', ( (TYPE_DC, 'DC Terminal'), )), @@ -635,6 +644,10 @@ class PowerOutletTypeChoices(ChoiceSet): TYPE_USB_A = 'usb-a' TYPE_USB_MICROB = 'usb-micro-b' TYPE_USB_C = 'usb-c' + # Molex + TYPE_MOLEX_MICRO_FIT_1X2 = 'molex-micro-fit-1x2' + TYPE_MOLEX_MICRO_FIT_2X2 = 'molex-micro-fit-2x2' + TYPE_MOLEX_MICRO_FIT_2X4 = 'molex-micro-fit-2x4' # Direct current (DC) TYPE_DC = 'dc-terminal' # Proprietary @@ -749,6 +762,11 @@ class PowerOutletTypeChoices(ChoiceSet): (TYPE_USB_MICROB, 'USB Micro B'), (TYPE_USB_C, 'USB Type C'), )), + ('Molex', ( + (TYPE_MOLEX_MICRO_FIT_1X2, 'Molex Micro-Fit 1x2'), + (TYPE_MOLEX_MICRO_FIT_2X2, 'Molex Micro-Fit 2x2'), + (TYPE_MOLEX_MICRO_FIT_2X4, 'Molex Micro-Fit 2x4'), + )), ('DC', ( (TYPE_DC, 'DC Terminal'), )), @@ -810,6 +828,7 @@ class InterfaceTypeChoices(ChoiceSet): TYPE_100ME_FIXED = '100base-tx' TYPE_100ME_T1 = '100base-t1' TYPE_1GE_FIXED = '1000base-t' + TYPE_1GE_TX_FIXED = '1000base-tx' TYPE_1GE_GBIC = '1000base-x-gbic' TYPE_1GE_SFP = '1000base-x-sfp' TYPE_2GE_FIXED = '2.5gbase-t' @@ -848,6 +867,8 @@ class InterfaceTypeChoices(ChoiceSet): # Ethernet Backplane TYPE_1GE_KX = '1000base-kx' + TYPE_2GE_KX = '2.5gbase-kx' + TYPE_5GE_KR = '5gbase-kr' TYPE_10GE_KR = '10gbase-kr' TYPE_10GE_KX4 = '10gbase-kx4' TYPE_25GE_KR = '25gbase-kr' @@ -872,6 +893,8 @@ class InterfaceTypeChoices(ChoiceSet): TYPE_GSM = 'gsm' TYPE_CDMA = 'cdma' TYPE_LTE = 'lte' + TYPE_4G = '4g' + TYPE_5G = '5g' # SONET TYPE_SONET_OC3 = 'sonet-oc3' @@ -919,12 +942,15 @@ class InterfaceTypeChoices(ChoiceSet): TYPE_DOCSIS = 'docsis' # PON + TYPE_BPON = 'bpon' + TYPE_EPON = 'epon' + TYPE_10G_EPON = '10g-epon' TYPE_GPON = 'gpon' TYPE_XG_PON = 'xg-pon' TYPE_XGS_PON = 'xgs-pon' TYPE_NG_PON2 = 'ng-pon2' - TYPE_EPON = 'epon' - TYPE_10G_EPON = '10g-epon' + TYPE_25G_PON = '25g-pon' + TYPE_50G_PON = '50g-pon' # Stacking TYPE_STACKWISE = 'cisco-stackwise' @@ -962,6 +988,7 @@ class InterfaceTypeChoices(ChoiceSet): (TYPE_100ME_FIXED, '100BASE-TX (10/100ME)'), (TYPE_100ME_T1, '100BASE-T1 (10/100ME Single Pair)'), (TYPE_1GE_FIXED, '1000BASE-T (1GE)'), + (TYPE_1GE_TX_FIXED, '1000BASE-TX (1GE)'), (TYPE_2GE_FIXED, '2.5GBASE-T (2.5GE)'), (TYPE_5GE_FIXED, '5GBASE-T (5GE)'), (TYPE_10GE_FIXED, '10GBASE-T (10GE)'), @@ -1008,6 +1035,8 @@ class InterfaceTypeChoices(ChoiceSet): _('Ethernet (backplane)'), ( (TYPE_1GE_KX, '1000BASE-KX (1GE)'), + (TYPE_2GE_KX, '2.5GBASE-KX (2.5GE)'), + (TYPE_5GE_KR, '5GBASE-KR (5GE)'), (TYPE_10GE_KR, '10GBASE-KR (10GE)'), (TYPE_10GE_KX4, '10GBASE-KX4 (10GE)'), (TYPE_25GE_KR, '25GBASE-KR (25GE)'), @@ -1038,6 +1067,8 @@ class InterfaceTypeChoices(ChoiceSet): (TYPE_GSM, 'GSM'), (TYPE_CDMA, 'CDMA'), (TYPE_LTE, 'LTE'), + (TYPE_4G, '4G'), + (TYPE_5G, '5G'), ) ), ( @@ -1106,12 +1137,15 @@ class InterfaceTypeChoices(ChoiceSet): ( 'PON', ( - (TYPE_GPON, 'GPON (2.5 Gbps / 1.25 Gps)'), + (TYPE_BPON, 'BPON (622 Mbps / 155 Mbps)'), + (TYPE_EPON, 'EPON (1 Gbps)'), + (TYPE_10G_EPON, '10G-EPON (10 Gbps)'), + (TYPE_GPON, 'GPON (2.5 Gbps / 1.25 Gbps)'), (TYPE_XG_PON, 'XG-PON (10 Gbps / 2.5 Gbps)'), (TYPE_XGS_PON, 'XGS-PON (10 Gbps)'), (TYPE_NG_PON2, 'NG-PON2 (TWDM-PON) (4x10 Gbps)'), - (TYPE_EPON, 'EPON (1 Gbps)'), - (TYPE_10G_EPON, '10G-EPON (10 Gbps)'), + (TYPE_25G_PON, '25G-PON (25 Gbps)'), + (TYPE_50G_PON, '50G-PON (50 Gbps)'), ) ), ( diff --git a/netbox/dcim/filtersets.py b/netbox/dcim/filtersets.py index ad1e29f26..a4d75654e 100644 --- a/netbox/dcim/filtersets.py +++ b/netbox/dcim/filtersets.py @@ -698,9 +698,6 @@ class DeviceTypeComponentFilterSet(django_filters.FilterSet): label=_('Device type (ID)'), ) - # TODO: Remove in v4.1 - devicetype_id = device_type_id - def search(self, queryset, name, value): if not value.strip(): return queryset @@ -717,9 +714,6 @@ class ModularDeviceTypeComponentFilterSet(DeviceTypeComponentFilterSet): label=_('Module type (ID)'), ) - # TODO: Remove in v4.1 - moduletype_id = module_type_id - class ConsolePortTemplateFilterSet(ChangeLoggedModelFilterSet, ModularDeviceTypeComponentFilterSet): @@ -1100,6 +1094,10 @@ class DeviceFilterSet( queryset=IPAddress.objects.all(), label=_('OOB IP (ID)'), ) + has_virtual_device_context = django_filters.BooleanFilter( + method='_has_virtual_device_context', + label=_('Has virtual device context'), + ) class Meta: model = Device @@ -1176,6 +1174,12 @@ class DeviceFilterSet( def _device_bays(self, queryset, name, value): return queryset.exclude(devicebays__isnull=value) + def _has_virtual_device_context(self, queryset, name, value): + params = Q(vdcs__isnull=False) + if value: + return queryset.filter(params).distinct() + return queryset.exclude(params) + class VirtualDeviceContextFilterSet(NetBoxModelFilterSet, TenancyFilterSet, PrimaryIPFilterSet): device_id = django_filters.ModelMultipleChoiceFilter( diff --git a/netbox/dcim/forms/bulk_edit.py b/netbox/dcim/forms/bulk_edit.py index 978a5d0a1..25b049e6d 100644 --- a/netbox/dcim/forms/bulk_edit.py +++ b/netbox/dcim/forms/bulk_edit.py @@ -1420,9 +1420,9 @@ class InterfaceBulkEditForm( device = Device.objects.filter(pk=self.initial['device']).first() # Restrict parent/bridge/LAG interface assignment by device - self.fields['parent'].widget.add_query_param('device_id', device.pk) - self.fields['bridge'].widget.add_query_param('device_id', device.pk) - self.fields['lag'].widget.add_query_param('device_id', device.pk) + self.fields['parent'].widget.add_query_param('virtual_chassis_member_id', device.pk) + self.fields['bridge'].widget.add_query_param('virtual_chassis_member_id', device.pk) + self.fields['lag'].widget.add_query_param('virtual_chassis_member_id', device.pk) # Limit VLAN choices by device self.fields['untagged_vlan'].widget.add_query_param('available_on_device', device.pk) diff --git a/netbox/dcim/forms/bulk_import.py b/netbox/dcim/forms/bulk_import.py index d49973082..5a64cad02 100644 --- a/netbox/dcim/forms/bulk_import.py +++ b/netbox/dcim/forms/bulk_import.py @@ -1373,14 +1373,14 @@ class VirtualDeviceContextImportForm(NetBoxModelImportForm): label=_('Device'), queryset=Device.objects.all(), to_field_name='name', - help_text='Assigned role' + help_text=_('Assigned role') ) tenant = CSVModelChoiceField( label=_('Tenant'), queryset=Tenant.objects.all(), required=False, to_field_name='name', - help_text='Assigned tenant' + help_text=_('Assigned tenant') ) status = CSVChoiceField( label=_('Status'), diff --git a/netbox/dcim/forms/connections.py b/netbox/dcim/forms/connections.py index 67ef360fe..44bea047a 100644 --- a/netbox/dcim/forms/connections.py +++ b/netbox/dcim/forms/connections.py @@ -1,4 +1,5 @@ from django import forms +from django.contrib.contenttypes.models import ContentType from django.utils.translation import gettext_lazy as _ from circuits.models import Circuit, CircuitTermination @@ -88,25 +89,42 @@ def get_cable_form(a_type, b_type): class _CableForm(CableForm, metaclass=FormMetaclass): - def __init__(self, *args, **kwargs): + def __init__(self, *args, initial=None, **kwargs): + initial = initial or {} + + if a_type: + a_ct = ContentType.objects.get_for_model(a_type) + initial['a_terminations_type'] = f'{a_ct.app_label}.{a_ct.model}' + if b_type: + b_ct = ContentType.objects.get_for_model(b_type) + initial['b_terminations_type'] = f'{b_ct.app_label}.{b_ct.model}' # TODO: Temporary hack to work around list handling limitations with utils.normalize_querydict() for field_name in ('a_terminations', 'b_terminations'): - if field_name in kwargs.get('initial', {}) and type(kwargs['initial'][field_name]) is not list: - kwargs['initial'][field_name] = [kwargs['initial'][field_name]] + if field_name in initial and type(initial[field_name]) is not list: + initial[field_name] = [initial[field_name]] - super().__init__(*args, **kwargs) + super().__init__(*args, initial=initial, **kwargs) if self.instance and self.instance.pk: # Initialize A/B terminations when modifying an existing Cable instance - self.initial['a_terminations'] = self.instance.a_terminations - self.initial['b_terminations'] = self.instance.b_terminations + if a_type and self.instance.a_terminations and a_ct == ContentType.objects.get_for_model(self.instance.a_terminations[0]): + self.initial['a_terminations'] = self.instance.a_terminations + if b_type and self.instance.b_terminations and b_ct == ContentType.objects.get_for_model(self.instance.b_terminations[0]): + self.initial['b_terminations'] = self.instance.b_terminations + else: + # Need to clear terminations if swapped type - but need to do it only + # if not from instance + if a_type: + initial.pop('a_terminations', None) + if b_type: + initial.pop('b_terminations', None) def clean(self): super().clean() # Set the A/B terminations on the Cable instance - self.instance.a_terminations = self.cleaned_data['a_terminations'] - self.instance.b_terminations = self.cleaned_data['b_terminations'] + self.instance.a_terminations = self.cleaned_data.get('a_terminations', []) + self.instance.b_terminations = self.cleaned_data.get('b_terminations', []) return _CableForm diff --git a/netbox/dcim/forms/filtersets.py b/netbox/dcim/forms/filtersets.py index 4e8e3491c..0a28a4ec4 100644 --- a/netbox/dcim/forms/filtersets.py +++ b/netbox/dcim/forms/filtersets.py @@ -657,6 +657,7 @@ class DeviceFilterForm( ), FieldSet( 'has_primary_ip', 'has_oob_ip', 'virtual_chassis_member', 'config_template_id', 'local_context_data', + 'has_virtual_device_context', name=_('Miscellaneous') ) ) @@ -813,6 +814,13 @@ class DeviceFilterForm( choices=BOOLEAN_WITH_BLANK_CHOICES ) ) + has_virtual_device_context = forms.NullBooleanField( + required=False, + label=_('Has virtual device contexts'), + widget=forms.Select( + choices=BOOLEAN_WITH_BLANK_CHOICES + ) + ) tag = TagFilterField(model) @@ -975,9 +983,9 @@ class CableFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm): label=_('Color'), required=False ) - length = forms.IntegerField( + length = forms.DecimalField( label=_('Length'), - required=False + required=False, ) length_unit = forms.ChoiceField( label=_('Length unit'), diff --git a/netbox/dcim/forms/model_forms.py b/netbox/dcim/forms/model_forms.py index 3559aabc6..d5cc0e856 100644 --- a/netbox/dcim/forms/model_forms.py +++ b/netbox/dcim/forms/model_forms.py @@ -13,8 +13,7 @@ from netbox.forms import NetBoxModelForm from tenancy.forms import TenancyForm from utilities.forms import add_blank_choice from utilities.forms.fields import ( - CommentField, ContentTypeChoiceField, DynamicModelChoiceField, DynamicModelMultipleChoiceField, JSONField, - NumericArrayField, SlugField, + CommentField, DynamicModelChoiceField, DynamicModelMultipleChoiceField, JSONField, NumericArrayField, SlugField, ) from utilities.forms.rendering import FieldSet, InlineFields, TabbedGroups from utilities.forms.widgets import APISelect, ClearableFileInput, HTMXSelect, NumberWithOptions, SelectWithPK @@ -629,14 +628,33 @@ class ModuleForm(ModuleCommonForm, NetBoxModelForm): self.fields['adopt_components'].disabled = True +def get_termination_type_choices(): + return add_blank_choice([ + (f'{ct.app_label}.{ct.model}', ct.model_class()._meta.verbose_name.title()) + for ct in ContentType.objects.filter(CABLE_TERMINATION_MODELS) + ]) + + class CableForm(TenancyForm, NetBoxModelForm): + a_terminations_type = forms.ChoiceField( + choices=get_termination_type_choices, + required=False, + widget=HTMXSelect(), + label=_('Type') + ) + b_terminations_type = forms.ChoiceField( + choices=get_termination_type_choices, + required=False, + widget=HTMXSelect(), + label=_('Type') + ) comments = CommentField() class Meta: model = Cable fields = [ - 'type', 'status', 'tenant_group', 'tenant', 'label', 'color', 'length', 'length_unit', 'description', - 'comments', 'tags', + 'a_terminations_type', 'b_terminations_type', 'type', 'status', 'tenant_group', 'tenant', 'label', 'color', + 'length', 'length_unit', 'description', 'comments', 'tags', ] error_messages = { 'length': { @@ -1003,31 +1021,128 @@ class InventoryItemTemplateForm(ComponentTemplateForm): queryset=Manufacturer.objects.all(), required=False ) - component_type = ContentTypeChoiceField( - queryset=ContentType.objects.all(), - limit_choices_to=MODULAR_COMPONENT_TEMPLATE_MODELS, + + # Assigned component selectors + consoleporttemplate = DynamicModelChoiceField( + queryset=ConsolePortTemplate.objects.all(), required=False, - widget=forms.HiddenInput + query_params={ + 'device_type_id': '$device_type' + }, + label=_('Console port template') ) - component_id = forms.IntegerField( + consoleserverporttemplate = DynamicModelChoiceField( + queryset=ConsoleServerPortTemplate.objects.all(), required=False, - widget=forms.HiddenInput + query_params={ + 'device_type_id': '$device_type' + }, + label=_('Console server port template') + ) + frontporttemplate = DynamicModelChoiceField( + queryset=FrontPortTemplate.objects.all(), + required=False, + query_params={ + 'device_type_id': '$device_type' + }, + label=_('Front port template') + ) + interfacetemplate = DynamicModelChoiceField( + queryset=InterfaceTemplate.objects.all(), + required=False, + query_params={ + 'device_type_id': '$device_type' + }, + label=_('Interface template') + ) + poweroutlettemplate = DynamicModelChoiceField( + queryset=PowerOutletTemplate.objects.all(), + required=False, + query_params={ + 'device_type_id': '$device_type' + }, + label=_('Power outlet template') + ) + powerporttemplate = DynamicModelChoiceField( + queryset=PowerPortTemplate.objects.all(), + required=False, + query_params={ + 'device_type_id': '$device_type' + }, + label=_('Power port template') + ) + rearporttemplate = DynamicModelChoiceField( + queryset=RearPortTemplate.objects.all(), + required=False, + query_params={ + 'device_type_id': '$device_type' + }, + label=_('Rear port template') ) fieldsets = ( FieldSet( 'device_type', 'parent', 'name', 'label', 'role', 'manufacturer', 'part_id', 'description', - 'component_type', 'component_id', ), + FieldSet( + TabbedGroups( + FieldSet('interfacetemplate', name=_('Interface')), + FieldSet('consoleporttemplate', name=_('Console Port')), + FieldSet('consoleserverporttemplate', name=_('Console Server Port')), + FieldSet('frontporttemplate', name=_('Front Port')), + FieldSet('rearporttemplate', name=_('Rear Port')), + FieldSet('powerporttemplate', name=_('Power Port')), + FieldSet('poweroutlettemplate', name=_('Power Outlet')), + ), + name=_('Component Assignment') + ) ) class Meta: model = InventoryItemTemplate fields = [ 'device_type', 'parent', 'name', 'label', 'role', 'manufacturer', 'part_id', 'description', - 'component_type', 'component_id', ] + def __init__(self, *args, **kwargs): + instance = kwargs.get('instance') + initial = kwargs.get('initial', {}).copy() + component_type = initial.get('component_type') + component_id = initial.get('component_id') + + if instance: + # When editing set the initial value for component selection + for component_model in ContentType.objects.filter(MODULAR_COMPONENT_TEMPLATE_MODELS): + if type(instance.component) is component_model.model_class(): + initial[component_model.model] = instance.component + break + elif component_type and component_id: + # When adding the InventoryItem from a component page + if content_type := ContentType.objects.filter(MODULAR_COMPONENT_TEMPLATE_MODELS).filter(pk=component_type).first(): + if component := content_type.model_class().objects.filter(pk=component_id).first(): + initial[content_type.model] = component + + kwargs['initial'] = initial + + super().__init__(*args, **kwargs) + + def clean(self): + super().clean() + + # Handle object assignment + selected_objects = [ + field for field in ( + 'consoleporttemplate', 'consoleserverporttemplate', 'frontporttemplate', 'interfacetemplate', + 'poweroutlettemplate', 'powerporttemplate', 'rearporttemplate' + ) if self.cleaned_data[field] + ] + if len(selected_objects) > 1: + raise forms.ValidationError(_("An InventoryItem can only be assigned to a single component.")) + elif selected_objects: + self.instance.component = self.cleaned_data[selected_objects[0]] + else: + self.instance.component = None + # # Device components diff --git a/netbox/dcim/graphql/types.py b/netbox/dcim/graphql/types.py index 023f72be3..99a9106cb 100644 --- a/netbox/dcim/graphql/types.py +++ b/netbox/dcim/graphql/types.py @@ -130,7 +130,7 @@ class CableTerminationType(NetBoxObjectType): Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')], Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')], Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')], - ], strawberry.union("CableTerminationTerminationType")] + ], strawberry.union("CableTerminationTerminationType")] | None @strawberry_django.type( @@ -302,7 +302,7 @@ class InventoryItemTemplateType(ComponentTemplateType): Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')], Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')], Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')], - ], strawberry.union("InventoryItemTemplateComponentType")] + ], strawberry.union("InventoryItemTemplateComponentType")] | None @strawberry_django.type( @@ -431,7 +431,7 @@ class InventoryItemType(ComponentType): Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')], Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')], Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')], - ], strawberry.union("InventoryItemComponentType")] + ], strawberry.union("InventoryItemComponentType")] | None @strawberry_django.type( diff --git a/netbox/dcim/migrations/0187_alter_device_vc_position.py b/netbox/dcim/migrations/0187_alter_device_vc_position.py new file mode 100644 index 000000000..d4a42dc20 --- /dev/null +++ b/netbox/dcim/migrations/0187_alter_device_vc_position.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.3 on 2024-04-19 16:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dcim', '0186_location_facility'), + ] + + operations = [ + migrations.AlterField( + model_name='device', + name='vc_position', + field=models.PositiveIntegerField(blank=True, null=True), + ), + ] diff --git a/netbox/dcim/models/cables.py b/netbox/dcim/models/cables.py index 64f0b8560..7afead829 100644 --- a/netbox/dcim/models/cables.py +++ b/netbox/dcim/models/cables.py @@ -355,11 +355,11 @@ class CableTermination(ChangeLoggedModel): super().save(*args, **kwargs) # Set the cable on the terminating object - termination_model = self.termination._meta.model - termination_model.objects.filter(pk=self.termination_id).update( - cable=self.cable, - cable_end=self.cable_end - ) + termination = self.termination._meta.model.objects.get(pk=self.termination_id) + termination.snapshot() + termination.cable = self.cable + termination.cable_end = self.cable_end + termination.save() def delete(self, *args, **kwargs): diff --git a/netbox/dcim/models/devices.py b/netbox/dcim/models/devices.py index 10792e387..abc9e0b08 100644 --- a/netbox/dcim/models/devices.py +++ b/netbox/dcim/models/devices.py @@ -689,11 +689,10 @@ class Device( blank=True, null=True ) - vc_position = models.PositiveSmallIntegerField( + vc_position = models.PositiveIntegerField( verbose_name=_('VC position'), blank=True, null=True, - validators=[MaxValueValidator(255)], help_text=_('Virtual chassis position') ) vc_priority = models.PositiveSmallIntegerField( @@ -982,17 +981,16 @@ class Device( bulk_create: If True, bulk_create() will be called to create all components in a single query (default). Otherwise, save() will be called on each instance individually. """ - components = [obj.instantiate(device=self) for obj in queryset] - if not components: - return - - # Set default values for any applicable custom fields model = queryset.model.component_model - if cf_defaults := CustomField.objects.get_defaults_for_model(model): - for component in components: - component.custom_field_data = cf_defaults if bulk_create: + components = [obj.instantiate(device=self) for obj in queryset] + if not components: + return + # Set default values for any applicable custom fields + if cf_defaults := CustomField.objects.get_defaults_for_model(model): + for component in components: + component.custom_field_data = cf_defaults model.objects.bulk_create(components) # Manually send the post_save signal for each of the newly created components for component in components: @@ -1005,7 +1003,11 @@ class Device( update_fields=None ) else: - for component in components: + for obj in queryset: + component = obj.instantiate(device=self) + # Set default values for any applicable custom fields + if cf_defaults := CustomField.objects.get_defaults_for_model(model): + component.custom_field_data = cf_defaults component.save() def save(self, *args, **kwargs): diff --git a/netbox/dcim/svg/cables.py b/netbox/dcim/svg/cables.py index aaa9e24ed..9ce5d967b 100644 --- a/netbox/dcim/svg/cables.py +++ b/netbox/dcim/svg/cables.py @@ -8,17 +8,16 @@ from django.conf import settings from dcim.constants import CABLE_TRACE_SVG_DEFAULT_WIDTH from utilities.html import foreground_color - __all__ = ( 'CableTraceSVG', ) - OFFSET = 0.5 PADDING = 10 LINE_HEIGHT = 20 FANOUT_HEIGHT = 35 FANOUT_LEG_HEIGHT = 15 +CABLE_HEIGHT = 5 * LINE_HEIGHT + FANOUT_HEIGHT + FANOUT_LEG_HEIGHT class Node(Hyperlink): @@ -84,31 +83,38 @@ class Connector(Group): labels: Iterable of text labels """ - def __init__(self, start, url, color, labels=[], description=[], **extra): - super().__init__(class_='connector', **extra) + def __init__(self, start, url, color, wireless, labels=[], description=[], end=None, text_offset=0, **extra): + super().__init__(class_="connector", **extra) self.start = start self.height = PADDING * 2 + LINE_HEIGHT * len(labels) + PADDING * 2 - self.end = (start[0], start[1] + self.height) + # Allow to specify end-position or auto-calculate + self.end = end if end else (start[0], start[1] + self.height) self.color = color or '000000' - # Draw a "shadow" line to give the cable a border - cable_shadow = Line(start=self.start, end=self.end, class_='cable-shadow') - self.add(cable_shadow) + if wireless: + # Draw the cable + cable = Line(start=self.start, end=self.end, class_="wireless-link") + self.add(cable) + else: + # Draw a "shadow" line to give the cable a border + cable_shadow = Line(start=self.start, end=self.end, class_='cable-shadow') + self.add(cable_shadow) - # Draw the cable - cable = Line(start=self.start, end=self.end, style=f'stroke: #{self.color}') - self.add(cable) + # Draw the cable + cable = Line(start=self.start, end=self.end, style=f'stroke: #{self.color}') + self.add(cable) # Add link link = Hyperlink(href=url, target='_parent') # Add text label(s) - cursor = start[1] - cursor += PADDING * 2 + cursor = start[1] + text_offset + cursor += PADDING * 2 + LINE_HEIGHT * 2 + x_coord = (start[0] + end[0]) / 2 + PADDING for i, label in enumerate(labels): cursor += LINE_HEIGHT - text_coords = (start[0] + PADDING * 2, cursor - LINE_HEIGHT / 2) + text_coords = (x_coord, cursor - LINE_HEIGHT / 2) text = Text(label, insert=text_coords, class_='bold' if not i else []) link.add(text) if len(description) > 0: @@ -190,8 +196,9 @@ class CableTraceSVG: def draw_parent_objects(self, obj_list): """ - Draw a set of parent objects. + Draw a set of parent objects (eg hosts, switched, patchpanels) and return all created nodes """ + objects = [] width = self.width / len(obj_list) for i, obj in enumerate(obj_list): node = Node( @@ -199,23 +206,26 @@ class CableTraceSVG: width=width, url=f'{self.base_url}{obj.get_absolute_url()}', color=self._get_color(obj), - labels=self._get_labels(obj) + labels=self._get_labels(obj), + object=obj ) + objects.append(node) self.parent_objects.append(node) if i + 1 == len(obj_list): self.cursor += node.box['height'] + return objects - def draw_terminations(self, terminations): + def draw_object_terminations(self, terminations, offset_x, width): """ - Draw a row of terminating objects (e.g. interfaces), all of which are attached to the same end of a cable. + Draw all terminations belonging to an object with specified offset and width + Return all created nodes and their maximum height """ - nodes = [] nodes_height = 0 - width = self.width / len(terminations) - - for i, term in enumerate(terminations): + nodes = [] + # Sort them by name to make renders more readable + for i, term in enumerate(sorted(terminations, key=lambda x: str(x))): node = Node( - position=(i * width, self.cursor), + position=(offset_x + i * width, self.cursor), width=width, url=f'{self.base_url}{term.get_absolute_url()}', color=self._get_color(term), @@ -225,133 +235,89 @@ class CableTraceSVG: ) nodes_height = max(nodes_height, node.box['height']) nodes.append(node) + return nodes, nodes_height + + def draw_terminations(self, terminations, parent_object_nodes): + """ + Draw a row of terminating objects (e.g. interfaces) and return all created nodes + Attach them to previously created parent objects + """ + nodes = [] + nodes_height = 0 + + # Draw terminations for each parent object + for parent in parent_object_nodes: + parent_terms = [term for term in terminations if term.parent_object == parent.object] + + # Width and offset(position) for each termination box + width = parent.box['width'] / len(parent_terms) + offset_x = parent.box['x'] + + result, nodes_height = self.draw_object_terminations(parent_terms, offset_x, width) + nodes.extend(result) self.cursor += nodes_height self.terminations.extend(nodes) return nodes - def draw_fanin(self, node, connector): - points = ( - node.bottom_center, - (node.bottom_center[0], node.bottom_center[1] + FANOUT_LEG_HEIGHT), - connector.start, - ) - self.connectors.extend(( - Polyline(points=points, class_='cable-shadow'), - Polyline(points=points, style=f'stroke: #{connector.color}'), - )) - - def draw_fanout(self, node, connector): - points = ( - connector.end, - (node.top_center[0], node.top_center[1] - FANOUT_LEG_HEIGHT), - node.top_center, - ) - self.connectors.extend(( - Polyline(points=points, class_='cable-shadow'), - Polyline(points=points, style=f'stroke: #{connector.color}'), - )) - - def draw_cable(self, cable, terminations, cable_count=0): + def draw_far_objects(self, obj_list, terminations): """ - Draw a single cable. Terminations and cable count are passed for determining position and padding - - :param cable: The cable to draw - :param terminations: List of terminations to build positioning data off of - :param cable_count: Count of all cables on this layer for determining whether to collapse description into a - tooltip. + Draw the far-end objects and its terminations and return all created nodes """ + # Make sure elements are sorted by name for readability + objects = sorted(obj_list, key=lambda x: str(x)) + width = self.width / len(objects) - # If the cable count is higher than 2, collapse the description into a tooltip - if cable_count > 2: - # Use the cable __str__ function to denote the cable - labels = [f'{cable}'] + # Max-height of created terminations + terms_height = 0 + term_nodes = [] - # Include the label and the status description in the tooltip - description = [ - f'Cable {cable}', - cable.get_status_display() - ] + # Draw the terminations by per object first + for i, obj in enumerate(objects): + obj_terms = [term for term in terminations if term.parent_object == obj] + obj_pos = i * width + result, result_nodes_height = self.draw_object_terminations(obj_terms, obj_pos, width / len(obj_terms)) - if cable.type: - # Include the cable type in the tooltip - description.append(cable.get_type_display()) - if cable.length is not None and cable.length_unit: - # Include the cable length in the tooltip - description.append(f'{cable.length} {cable.get_length_unit_display()}') - else: - labels = [ - f'Cable {cable}', - cable.get_status_display() - ] - description = [] - if cable.type: - labels.append(cable.get_type_display()) - if cable.length is not None and cable.length_unit: - # Include the cable length in the tooltip - labels.append(f'{cable.length} {cable.get_length_unit_display()}') + terms_height = max(terms_height, result_nodes_height) + term_nodes.extend(result) - # If there is only one termination, center on that termination - # Otherwise average the center across the terminations - if len(terminations) == 1: - center = terminations[0].bottom_center[0] - else: - # Get a list of termination centers - termination_centers = [term.bottom_center[0] for term in terminations] - # Average the centers - center = sum(termination_centers) / len(termination_centers) + # Update cursor and draw the objects + self.cursor += terms_height + self.terminations.extend(term_nodes) + object_nodes = self.draw_parent_objects(objects) - # Create the connector - connector = Connector( - start=(center, self.cursor), - color=cable.color or '000000', - url=f'{self.base_url}{cable.get_absolute_url()}', - labels=labels, - description=description - ) + return object_nodes, term_nodes - # Set the cursor position - self.cursor += connector.height - - return connector - - def draw_wirelesslink(self, wirelesslink): + def draw_fanin(self, target, terminations, color): """ - Draw a line with labels representing a WirelessLink. + Draw the fan-in-lines from each of the terminations to the targetpoint """ - group = Group(class_='connector') + for term in terminations: + points = ( + term.bottom_center, + (term.bottom_center[0], term.bottom_center[1] + FANOUT_LEG_HEIGHT), + target, + ) + self.connectors.extend(( + Polyline(points=points, class_='cable-shadow'), + Polyline(points=points, style=f'stroke: #{color}'), + )) - labels = [ - f'Wireless link {wirelesslink}', - wirelesslink.get_status_display() - ] - if wirelesslink.ssid: - labels.append(wirelesslink.ssid) - - # Draw the wireless link - start = (OFFSET + self.center, self.cursor) - height = PADDING * 2 + LINE_HEIGHT * len(labels) + PADDING * 2 - end = (start[0], start[1] + height) - line = Line(start=start, end=end, class_='wireless-link') - group.add(line) - - self.cursor += PADDING * 2 - - # Add link - link = Hyperlink(href=f'{self.base_url}{wirelesslink.get_absolute_url()}', target='_parent') - - # Add text label(s) - for i, label in enumerate(labels): - self.cursor += LINE_HEIGHT - text_coords = (self.center + PADDING * 2, self.cursor - LINE_HEIGHT / 2) - text = Text(label, insert=text_coords, class_='bold' if not i else []) - link.add(text) - - group.add(link) - self.cursor += PADDING * 2 - - return group + def draw_fanout(self, start, terminations, color): + """ + Draw the fan-out-lines from the startpoint to each of the terminations + """ + for term in terminations: + points = ( + term.top_center, + (term.top_center[0], term.top_center[1] - FANOUT_LEG_HEIGHT), + start, + ) + self.connectors.extend(( + Polyline(points=points, class_='cable-shadow'), + Polyline(points=points, style=f'stroke: #{color}'), + )) def draw_attachment(self): """ @@ -378,86 +344,110 @@ class CableTraceSVG: traced_path = self.origin.trace() + parent_object_nodes = [] # Iterate through each (terms, cable, terms) segment in the path for i, segment in enumerate(traced_path): near_ends, links, far_ends = segment - # Near end parent + # This is segment number one. if i == 0: # If this is the first segment, draw the originating termination's parent object - self.draw_parent_objects(set(end.parent_object for end in near_ends)) + parent_object_nodes = self.draw_parent_objects(set(end.parent_object for end in near_ends)) + # Else: No need to draw parent objects (parent objects are drawn in last "round" as the far-end!) - # Near end termination(s) - terminations = self.draw_terminations(near_ends) + near_terminations = self.draw_terminations(near_ends, parent_object_nodes) + self.cursor += CABLE_HEIGHT # Connector (a Cable or WirelessLink) if links: - link_cables = {} - fanin = False - fanout = False - # Determine if we have fanins or fanouts - if len(near_ends) > len(set(links)): - self.cursor += FANOUT_HEIGHT - fanin = True - if len(far_ends) > len(set(links)): - fanout = True - cursor = self.cursor - for link in links: - # Cable - if type(link) is Cable and not link_cables.get(link.pk): - # Reset cursor - self.cursor = cursor - # Generate a list of terminations connected to this cable - near_end_link_terminations = [term for term in terminations if term.object.cable == link] - # Draw the cable - cable = self.draw_cable(link, near_end_link_terminations, cable_count=len(links)) - # Add cable to the list of cables - link_cables.update({link.pk: cable}) - # Add cable to drawing - self.connectors.append(cable) + obj_list = {end.parent_object for end in far_ends} + parent_object_nodes, far_terminations = self.draw_far_objects(obj_list, far_ends) + for cable in links: + # Fill in labels and description with all available data + description = [ + f"Link {cable}", + cable.get_status_display() + ] + near = [] + far = [] + color = '000000' + if cable.description: + description.append(f"{cable.description}") + if isinstance(cable, Cable): + labels = [f"{cable}"] if len(links) > 2 else [f"Cable {cable}", cable.get_status_display()] + if cable.type: + description.append(cable.get_type_display()) + if cable.length and cable.length_unit: + description.append(f"{cable.length} {cable.get_length_unit_display()}") + color = cable.color or '000000' - # Draw fan-ins - if len(near_ends) > 1 and fanin: - for term in terminations: - if term.object.cable == link: - self.draw_fanin(term, cable) + # Collect all connected nodes to this cable + near = [term for term in near_terminations if term.object in cable.a_terminations] + far = [term for term in far_terminations if term.object in cable.b_terminations] + if not (near and far): + # a and b terminations may be swapped + near = [term for term in near_terminations if term.object in cable.b_terminations] + far = [term for term in far_terminations if term.object in cable.a_terminations] + elif isinstance(cable, WirelessLink): + labels = [f"{cable}"] if len(links) > 2 else [f"Wireless {cable}", cable.get_status_display()] + if cable.ssid: + description.append(f"{cable.ssid}") + near = [term for term in near_terminations if term.object == cable.interface_a] + far = [term for term in far_terminations if term.object == cable.interface_b] + if not (near and far): + # a and b terminations may be swapped + near = [term for term in near_terminations if term.object == cable.interface_b] + far = [term for term in far_terminations if term.object == cable.interface_a] - # WirelessLink - elif type(link) is WirelessLink: - wirelesslink = self.draw_wirelesslink(link) - self.connectors.append(wirelesslink) + # Select most-probable start and end position + start = near[0].bottom_center + end = far[0].top_center + text_offset = 0 - # Far end termination(s) - if len(far_ends) > 1: - if fanout: - self.cursor += FANOUT_HEIGHT - terminations = self.draw_terminations(far_ends) - for term in terminations: - if hasattr(term.object, 'cable') and link_cables.get(term.object.cable.pk): - self.draw_fanout(term, link_cables.get(term.object.cable.pk)) - else: - self.draw_terminations(far_ends) - elif far_ends: - self.draw_terminations(far_ends) - else: - # Link is not connected to anything - break + if len(near) > 1 and len(far) > 1: + start_center = sum([pos.bottom_center[0] for pos in near]) / len(near) + end_center = sum([pos.bottom_center[0] for pos in far]) / len(far) + center_x = (start_center + end_center) / 2 - # Far end parent - parent_objects = set(end.parent_object for end in far_ends) - self.draw_parent_objects(parent_objects) + start = (center_x, start[1] + FANOUT_HEIGHT + FANOUT_LEG_HEIGHT) + end = (center_x, end[1] - FANOUT_HEIGHT - FANOUT_LEG_HEIGHT) + text_offset -= (FANOUT_HEIGHT + FANOUT_LEG_HEIGHT) + self.draw_fanin(start, near, color) + self.draw_fanout(end, far, color) + elif len(near) > 1: + # Handle Fan-In - change start position to be directly below start + start = (end[0], start[1] + FANOUT_HEIGHT + FANOUT_LEG_HEIGHT) + self.draw_fanin(start, near, color) + text_offset -= FANOUT_HEIGHT + FANOUT_LEG_HEIGHT + elif len(far) > 1: + # Handle Fan-Out - change end position to be directly above end + end = (start[0], end[1] - FANOUT_HEIGHT - FANOUT_LEG_HEIGHT) + self.draw_fanout(end, far, color) + text_offset -= FANOUT_HEIGHT + + # Create the connector + connector = Connector( + start=start, + end=end, + color=color, + wireless=isinstance(cable, WirelessLink), + url=f'{self.base_url}{cable.get_absolute_url()}', + text_offset=text_offset, + labels=labels, + description=description + ) + self.connectors.append(connector) # Render a far-end object not connected via a link (e.g. a ProviderNetwork or Site associated with # a CircuitTermination) elif far_ends: - # Attachment attachment = self.draw_attachment() self.connectors.append(attachment) # Object - self.draw_parent_objects(far_ends) + parent_object_nodes = self.draw_parent_objects(far_ends) # Determine drawing size self.drawing = svgwrite.Drawing( diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index 98dcfcb3c..7fa307bc8 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -43,42 +43,6 @@ MODULEBAY_STATUS = """ """ -def get_cabletermination_row_class(record): - if record.mark_connected: - return 'success' - elif record.cable: - return record.cable.get_status_color() - return '' - - -def get_interface_row_class(record): - if not record.enabled: - return 'danger' - elif record.is_virtual: - return 'primary' - return get_cabletermination_row_class(record) - - -def get_interface_state_attribute(record): - """ - Get interface enabled state as string to attach to DOM element. - """ - if record.enabled: - return 'enabled' - else: - return 'disabled' - - -def get_interface_connected_attribute(record): - """ - Get interface disconnected state as string to attach to DOM element. - """ - if record.mark_connected or record.cable: - return 'connected' - else: - return 'disconnected' - - # # Device roles # @@ -341,6 +305,10 @@ class ModularDeviceComponentTable(DeviceComponentTable): verbose_name=_('Module'), linkify=True ) + inventory_items = columns.ManyToManyColumn( + linkify_item=True, + verbose_name=_('Inventory Items'), + ) class CableTerminationTable(NetBoxTable): @@ -363,6 +331,14 @@ class CableTerminationTable(NetBoxTable): verbose_name=_('Mark Connected'), ) + class Meta: + row_attrs = { + 'data-name': lambda record: record.name, + 'data-mark-connected': lambda record: "true" if record.mark_connected else "false", + 'data-cable-status': lambda record: record.cable.status if record.cable else "", + 'data-type': lambda record: record.type + } + def value_link_peer(self, value): return ', '.join([ f"{termination.parent_object} > {termination}" for termination in value @@ -394,7 +370,7 @@ class ConsolePortTable(ModularDeviceComponentTable, PathEndpointTable): model = models.ConsolePort fields = ( 'pk', 'id', 'name', 'device', 'module_bay', 'module', 'label', 'type', 'speed', 'description', - 'mark_connected', 'cable', 'cable_color', 'link_peer', 'connection', 'tags', 'created', 'last_updated', + 'mark_connected', 'cable', 'cable_color', 'link_peer', 'connection', 'inventory_items', 'tags', 'created', 'last_updated', ) default_columns = ('pk', 'name', 'device', 'label', 'type', 'speed', 'description') @@ -410,16 +386,13 @@ class DeviceConsolePortTable(ConsolePortTable): extra_buttons=CONSOLEPORT_BUTTONS ) - class Meta(DeviceComponentTable.Meta): + class Meta(CableTerminationTable.Meta, DeviceComponentTable.Meta): model = models.ConsolePort fields = ( 'pk', 'id', 'name', 'module_bay', 'module', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color', 'link_peer', 'connection', 'tags', 'actions' ) default_columns = ('pk', 'name', 'label', 'type', 'speed', 'description', 'cable', 'connection') - row_attrs = { - 'class': get_cabletermination_row_class - } class ConsoleServerPortTable(ModularDeviceComponentTable, PathEndpointTable): @@ -438,7 +411,7 @@ class ConsoleServerPortTable(ModularDeviceComponentTable, PathEndpointTable): model = models.ConsoleServerPort fields = ( 'pk', 'id', 'name', 'device', 'module_bay', 'module', 'label', 'type', 'speed', 'description', - 'mark_connected', 'cable', 'cable_color', 'link_peer', 'connection', 'tags', 'created', 'last_updated', + 'mark_connected', 'cable', 'cable_color', 'link_peer', 'connection', 'inventory_items', 'tags', 'created', 'last_updated', ) default_columns = ('pk', 'name', 'device', 'label', 'type', 'speed', 'description') @@ -455,16 +428,13 @@ class DeviceConsoleServerPortTable(ConsoleServerPortTable): extra_buttons=CONSOLESERVERPORT_BUTTONS ) - class Meta(DeviceComponentTable.Meta): + class Meta(CableTerminationTable.Meta, DeviceComponentTable.Meta): model = models.ConsoleServerPort fields = ( 'pk', 'id', 'name', 'module_bay', 'module', 'label', 'type', 'speed', 'description', 'mark_connected', 'cable', 'cable_color', 'link_peer', 'connection', 'tags', 'actions', ) default_columns = ('pk', 'name', 'label', 'type', 'speed', 'description', 'cable', 'connection') - row_attrs = { - 'class': get_cabletermination_row_class - } class PowerPortTable(ModularDeviceComponentTable, PathEndpointTable): @@ -489,8 +459,8 @@ class PowerPortTable(ModularDeviceComponentTable, PathEndpointTable): model = models.PowerPort fields = ( 'pk', 'id', 'name', 'device', 'module_bay', 'module', 'label', 'type', 'description', 'mark_connected', - 'maximum_draw', 'allocated_draw', 'cable', 'cable_color', 'link_peer', 'connection', 'tags', 'created', - 'last_updated', + 'maximum_draw', 'allocated_draw', 'cable', 'cable_color', 'link_peer', 'connection', 'inventory_items', + 'tags', 'created', 'last_updated', ) default_columns = ('pk', 'name', 'device', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description') @@ -507,7 +477,7 @@ class DevicePowerPortTable(PowerPortTable): extra_buttons=POWERPORT_BUTTONS ) - class Meta(DeviceComponentTable.Meta): + class Meta(CableTerminationTable.Meta, DeviceComponentTable.Meta): model = models.PowerPort fields = ( 'pk', 'id', 'name', 'module_bay', 'module', 'label', 'type', 'maximum_draw', 'allocated_draw', @@ -516,9 +486,6 @@ class DevicePowerPortTable(PowerPortTable): default_columns = ( 'pk', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description', 'cable', 'connection', ) - row_attrs = { - 'class': get_cabletermination_row_class - } class PowerOutletTable(ModularDeviceComponentTable, PathEndpointTable): @@ -541,8 +508,8 @@ class PowerOutletTable(ModularDeviceComponentTable, PathEndpointTable): model = models.PowerOutlet fields = ( 'pk', 'id', 'name', 'device', 'module_bay', 'module', 'label', 'type', 'description', 'power_port', - 'feed_leg', 'mark_connected', 'cable', 'cable_color', 'link_peer', 'connection', 'tags', 'created', - 'last_updated', + 'feed_leg', 'mark_connected', 'cable', 'cable_color', 'link_peer', 'connection', 'inventory_items', + 'tags', 'created', 'last_updated', ) default_columns = ('pk', 'name', 'device', 'label', 'type', 'power_port', 'feed_leg', 'description') @@ -558,7 +525,7 @@ class DevicePowerOutletTable(PowerOutletTable): extra_buttons=POWEROUTLET_BUTTONS ) - class Meta(DeviceComponentTable.Meta): + class Meta(CableTerminationTable.Meta, DeviceComponentTable.Meta): model = models.PowerOutlet fields = ( 'pk', 'id', 'name', 'module_bay', 'module', 'label', 'type', 'power_port', 'feed_leg', 'description', @@ -567,9 +534,6 @@ class DevicePowerOutletTable(PowerOutletTable): default_columns = ( 'pk', 'name', 'label', 'type', 'power_port', 'feed_leg', 'description', 'cable', 'connection', ) - row_attrs = { - 'class': get_cabletermination_row_class - } class BaseInterfaceTable(NetBoxTable): @@ -646,10 +610,6 @@ class InterfaceTable(ModularDeviceComponentTable, BaseInterfaceTable, PathEndpoi verbose_name=_('VRF'), linkify=True ) - inventory_items = tables.ManyToManyColumn( - linkify_item=True, - verbose_name=_('Inventory Items'), - ) tags = columns.TagColumn( url_name='dcim:interface_list' ) @@ -706,11 +666,12 @@ class DeviceInterfaceTable(InterfaceTable): 'cable', 'connection', ) row_attrs = { - 'class': get_interface_row_class, 'data-name': lambda record: record.name, - 'data-enabled': get_interface_state_attribute, - 'data-type': lambda record: record.type, - 'data-connected': get_interface_connected_attribute + 'data-enabled': lambda record: "enabled" if record.enabled else "disabled", + 'data-virtual': lambda record: "true" if record.is_virtual else "false", + 'data-mark-connected': lambda record: "true" if record.mark_connected else "false", + 'data-cable-status': lambda record: record.cable.status if record.cable else "", + 'data-type': lambda record: record.type } @@ -740,8 +701,8 @@ class FrontPortTable(ModularDeviceComponentTable, CableTerminationTable): model = models.FrontPort fields = ( 'pk', 'id', 'name', 'device', 'module_bay', 'module', 'label', 'type', 'color', 'rear_port', - 'rear_port_position', 'description', 'mark_connected', 'cable', 'cable_color', 'link_peer', 'tags', - 'created', 'last_updated', + 'rear_port_position', 'description', 'mark_connected', 'cable', 'cable_color', 'link_peer', + 'inventory_items', 'tags', 'created', 'last_updated', ) default_columns = ( 'pk', 'name', 'device', 'label', 'type', 'color', 'rear_port', 'rear_port_position', 'description', @@ -760,7 +721,7 @@ class DeviceFrontPortTable(FrontPortTable): extra_buttons=FRONTPORT_BUTTONS ) - class Meta(DeviceComponentTable.Meta): + class Meta(CableTerminationTable.Meta, DeviceComponentTable.Meta): model = models.FrontPort fields = ( 'pk', 'id', 'name', 'module_bay', 'module', 'label', 'type', 'rear_port', 'rear_port_position', @@ -769,9 +730,6 @@ class DeviceFrontPortTable(FrontPortTable): default_columns = ( 'pk', 'name', 'label', 'type', 'rear_port', 'rear_port_position', 'description', 'cable', 'link_peer', ) - row_attrs = { - 'class': get_cabletermination_row_class - } class RearPortTable(ModularDeviceComponentTable, CableTerminationTable): @@ -793,7 +751,7 @@ class RearPortTable(ModularDeviceComponentTable, CableTerminationTable): model = models.RearPort fields = ( 'pk', 'id', 'name', 'device', 'module_bay', 'module', 'label', 'type', 'color', 'positions', 'description', - 'mark_connected', 'cable', 'cable_color', 'link_peer', 'tags', 'created', 'last_updated', + 'mark_connected', 'cable', 'cable_color', 'link_peer', 'inventory_items', 'tags', 'created', 'last_updated', ) default_columns = ('pk', 'name', 'device', 'label', 'type', 'color', 'description') @@ -810,7 +768,7 @@ class DeviceRearPortTable(RearPortTable): extra_buttons=REARPORT_BUTTONS ) - class Meta(DeviceComponentTable.Meta): + class Meta(CableTerminationTable.Meta, DeviceComponentTable.Meta): model = models.RearPort fields = ( 'pk', 'id', 'name', 'module_bay', 'module', 'label', 'type', 'positions', 'description', 'mark_connected', @@ -819,9 +777,6 @@ class DeviceRearPortTable(RearPortTable): default_columns = ( 'pk', 'name', 'label', 'type', 'positions', 'description', 'cable', 'link_peer', ) - row_attrs = { - 'class': get_cabletermination_row_class - } class DeviceBayTable(DeviceComponentTable): diff --git a/netbox/dcim/tests/test_api.py b/netbox/dcim/tests/test_api.py index 0a3931696..52b850b24 100644 --- a/netbox/dcim/tests/test_api.py +++ b/netbox/dcim/tests/test_api.py @@ -10,6 +10,7 @@ from dcim.models import * from extras.models import ConfigTemplate from ipam.models import ASN, RIR, VLAN, VRF from netbox.api.serializers import GenericObjectSerializer +from tenancy.models import Tenant from utilities.testing import APITestCase, APIViewTestCases, create_test_device from virtualization.models import Cluster, ClusterType from wireless.choices import WirelessChannelChoices @@ -152,6 +153,7 @@ class SiteTest(APIViewTestCases.APIViewTestCase): Site.objects.bulk_create(sites) rir = RIR.objects.create(name='RFC 6996', is_private=True) + tenant = Tenant.objects.create(name='Tenant 1', slug='tenant-1') asns = [ ASN(asn=65000 + i, rir=rir) for i in range(8) @@ -166,6 +168,7 @@ class SiteTest(APIViewTestCases.APIViewTestCase): 'group': groups[1].pk, 'status': SiteStatusChoices.STATUS_ACTIVE, 'asns': [asns[0].pk, asns[1].pk], + 'tenant': tenant.pk, }, { 'name': 'Site 5', @@ -230,7 +233,7 @@ class LocationTest(APIViewTestCases.APIViewTestCase): 'name': 'Test Location 6', 'slug': 'test-location-6', 'site': sites[1].pk, - 'parent': parent_locations[1].pk, + # Omit parent to test uniqueness constraint 'status': LocationStatusChoices.STATUS_PLANNED, }, ] @@ -2307,6 +2310,6 @@ class VirtualDeviceContextTest(APIViewTestCases.APIViewTestCase): 'device': devices[1].pk, 'status': 'active', 'name': 'VDC 3', - 'identifier': 3, + # Omit identifier to test uniqueness constraint }, ] diff --git a/netbox/dcim/tests/test_cablepaths.py b/netbox/dcim/tests/test_cablepaths.py index 49a71022e..cd7b0e6d7 100644 --- a/netbox/dcim/tests/test_cablepaths.py +++ b/netbox/dcim/tests/test_cablepaths.py @@ -394,6 +394,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 2) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 2 cable2.delete() path1 = self.assertPathExists( @@ -450,6 +453,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 2) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 2 cable2.delete() path1 = self.assertPathExists( @@ -558,6 +564,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 4) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 3 cable3.delete() @@ -673,6 +682,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 4) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 3 cable3.delete() @@ -804,6 +816,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 4) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 3 cable3.delete() @@ -931,6 +946,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 4) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 5 cable5.delete() @@ -1034,6 +1052,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 4) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 3 cable3.delete() @@ -1093,6 +1114,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 3) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 1 cable1.delete() @@ -1135,6 +1159,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 1) + # Test SVG generation + CableTraceSVG(interface1).render() + def test_210_interface_to_circuittermination(self): """ [IF1] --C1-- [CT1] @@ -1156,6 +1183,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 1) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 1 cable1.delete() self.assertEqual(CablePath.objects.count(), 0) @@ -1212,6 +1242,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 2) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 2 cable2.delete() path1 = self.assertPathExists( @@ -1277,6 +1310,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 2) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 2 cable2.delete() path1 = self.assertPathExists( @@ -1314,6 +1350,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 1) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 1 cable1.delete() self.assertEqual(CablePath.objects.count(), 0) @@ -1342,6 +1381,9 @@ class CablePathTestCase(TestCase): self.assertEqual(CablePath.objects.count(), 1) self.assertTrue(CablePath.objects.first().is_complete) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 1 cable1.delete() self.assertEqual(CablePath.objects.count(), 0) @@ -1439,6 +1481,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 4) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cables 3-4 cable3.delete() cable4.delete() @@ -1495,6 +1540,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 2) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 2 cable2.delete() path1 = self.assertPathExists( @@ -1578,6 +1626,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 2) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 2 cable2.delete() @@ -1697,6 +1748,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 4) + # Test SVG generation + CableTraceSVG(interface1).render() + # Delete cable 3 cable3.delete() @@ -1784,6 +1838,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 2) + # Test SVG generation + CableTraceSVG(interface1).render() + def test_220_interface_to_interface_duplex_via_multiple_front_and_rear_ports(self): """ [IF1] --C1-- [FP1] [RP1] --C2-- [RP2] [FP2] --C3-- [IF2] @@ -1877,6 +1934,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 3) + # Test SVG generation + CableTraceSVG(interface1).render() + def test_221_non_symmetric_paths(self): """ [IF1] --C1-- [FP1] [RP1] --C2-- [RP2] [FP2] --C3-- -------------------------------------- [IF2] @@ -1997,6 +2057,9 @@ class CablePathTestCase(TestCase): ) self.assertEqual(CablePath.objects.count(), 3) + # Test SVG generation + CableTraceSVG(interface1).render() + def test_301_create_path_via_existing_cable(self): """ [IF1] --C1-- [FP1] [RP1] --C2-- [RP2] [FP2] --C3-- [IF2] diff --git a/netbox/dcim/tests/test_filtersets.py b/netbox/dcim/tests/test_filtersets.py index 96ea020b3..df0dc7c7e 100644 --- a/netbox/dcim/tests/test_filtersets.py +++ b/netbox/dcim/tests/test_filtersets.py @@ -50,9 +50,9 @@ class DeviceComponentTemplateFilterSetTests: params = {'description': ['foobar1', 'foobar2']} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) - def test_devicetype_id(self): + def test_device_type_id(self): device_types = DeviceType.objects.all()[:2] - params = {'devicetype_id': [device_types[0].pk, device_types[1].pk]} + params = {'device_type_id': [device_types[0].pk, device_types[1].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) @@ -1753,9 +1753,9 @@ class InventoryItemTemplateTestCase(TestCase, DeviceComponentTemplateFilterSetTe params = {'name': ['Inventory Item 1', 'Inventory Item 2']} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) - def test_devicetype_id(self): + def test_device_type_id(self): device_types = DeviceType.objects.all()[:2] - params = {'devicetype_id': [device_types[0].pk, device_types[1].pk]} + params = {'device_type_id': [device_types[0].pk, device_types[1].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 4) def test_label(self): @@ -2103,6 +2103,9 @@ class DeviceTestCase(TestCase, ChangeLoggedFilterSetTests): Device.objects.filter(pk=devices[0].pk).update(virtual_chassis=virtual_chassis, vc_position=1, vc_priority=1) Device.objects.filter(pk=devices[1].pk).update(virtual_chassis=virtual_chassis, vc_position=2, vc_priority=2) + # VirtualDeviceContext assignment for filtering + VirtualDeviceContext.objects.create(device=devices[0], name="VDC 1", identifier=1, status='active') + def test_q(self): params = {'q': 'foobar1'} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) @@ -2336,6 +2339,12 @@ class DeviceTestCase(TestCase, ChangeLoggedFilterSetTests): params = {'tenant_group': [tenant_groups[0].slug, tenant_groups[1].slug]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) + def test_has_virtual_device_context(self): + params = {'has_virtual_device_context': 'true'} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + params = {'has_virtual_device_context': 'false'} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) + class ModuleTestCase(TestCase, ChangeLoggedFilterSetTests): queryset = Module.objects.all() diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index 120bbcb59..670995231 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -28,7 +28,9 @@ from utilities.permissions import get_permission_for_model from utilities.query import count_related from utilities.query_functions import CollateAsChar from utilities.views import GetReturnURLMixin, ObjectPermissionRequiredMixin, ViewTab, register_model_view +from virtualization.filtersets import VirtualMachineFilterSet from virtualization.models import VirtualMachine +from virtualization.tables import VirtualMachineTable from . import filtersets, forms, tables from .choices import DeviceFaceChoices from .models import * @@ -2085,6 +2087,24 @@ class DeviceRenderConfigView(generic.ObjectView): } +@register_model_view(Device, 'virtual-machines') +class DeviceVirtualMachinesView(generic.ObjectChildrenView): + queryset = Device.objects.all() + child_model = VirtualMachine + table = VirtualMachineTable + filterset = VirtualMachineFilterSet + tab = ViewTab( + label=_('Virtual Machines'), + badge=lambda obj: VirtualMachine.objects.filter(cluster=obj.cluster, device=obj).count(), + weight=2200, + hide_if_empty=True, + permission='virtualization.view_virtualmachine' + ) + + def get_children(self, request, parent): + return self.child_model.objects.restrict(request.user, 'view').filter(cluster=parent.cluster, device=parent) + + class DeviceBulkImportView(generic.BulkImportView): queryset = Device.objects.all() model_form = forms.DeviceImportForm @@ -2965,7 +2985,6 @@ class InventoryItemChildrenView(generic.ObjectChildrenView): child_model = InventoryItem table = tables.InventoryItemTable filterset = filtersets.InventoryItemFilterSet - template_name = 'generic/object_children.html' tab = ViewTab( label=_('Children'), badge=lambda obj: obj.child_items.count(), @@ -3160,12 +3179,6 @@ class CableListView(generic.ObjectListView): filterset = filtersets.CableFilterSet filterset_form = forms.CableFilterForm table = tables.CableTable - actions = { - 'import': {'add'}, - 'export': {'view'}, - 'bulk_edit': {'change'}, - 'bulk_delete': {'delete'}, - } @register_model_view(Cable) @@ -3177,34 +3190,29 @@ class CableView(generic.ObjectView): class CableEditView(generic.ObjectEditView): queryset = Cable.objects.all() template_name = 'dcim/cable_edit.html' + htmx_template_name = 'dcim/htmx/cable_edit.html' - def dispatch(self, request, *args, **kwargs): - - # If creating a new Cable, initialize the form class using URL query params - if 'pk' not in kwargs: - self.form = forms.get_cable_form( - a_type=CABLE_TERMINATION_TYPES.get(request.GET.get('a_terminations_type')), - b_type=CABLE_TERMINATION_TYPES.get(request.GET.get('b_terminations_type')) - ) - - return super().dispatch(request, *args, **kwargs) - - def get_object(self, **kwargs): + def alter_object(self, obj, request, url_args, url_kwargs): """ - Hack into get_object() to set the form class when editing an existing Cable, since ObjectEditView + Hack into alter_object() to set the form class when editing an existing Cable, since ObjectEditView doesn't currently provide a hook for dynamic class resolution. """ - obj = super().get_object(**kwargs) + a_terminations_type = CABLE_TERMINATION_TYPES.get( + request.GET.get('a_terminations_type') or request.POST.get('a_terminations_type') + ) + b_terminations_type = CABLE_TERMINATION_TYPES.get( + request.GET.get('b_terminations_type') or request.POST.get('b_terminations_type') + ) if obj.pk: - # TODO: Optimize this logic - termination_a = obj.terminations.filter(cable_end='A').first() - a_type = termination_a.termination._meta.model if termination_a else None - termination_b = obj.terminations.filter(cable_end='B').first() - b_type = termination_b.termination._meta.model if termination_b else None - self.form = forms.get_cable_form(a_type, b_type) + if not a_terminations_type and (termination_a := obj.terminations.filter(cable_end='A').first()): + a_terminations_type = termination_a.termination._meta.model + if not b_terminations_type and (termination_b := obj.terminations.filter(cable_end='B').first()): + b_terminations_type = termination_b.termination._meta.model - return obj + self.form = forms.get_cable_form(a_terminations_type, b_terminations_type) + + return super().alter_object(obj, request, url_args, url_kwargs) def get_extra_addanother_params(self, request): diff --git a/netbox/extras/api/serializers_/change_logging.py b/netbox/extras/api/serializers_/change_logging.py index 32585637c..46fb901ff 100644 --- a/netbox/extras/api/serializers_/change_logging.py +++ b/netbox/extras/api/serializers_/change_logging.py @@ -30,6 +30,16 @@ class ObjectChangeSerializer(BaseModelSerializer): changed_object = serializers.SerializerMethodField( read_only=True ) + prechange_data = serializers.JSONField( + source='prechange_data_clean', + read_only=True, + allow_null=True + ) + postchange_data = serializers.JSONField( + source='postchange_data_clean', + read_only=True, + allow_null=True + ) class Meta: model = ObjectChange diff --git a/netbox/extras/api/serializers_/customfields.py b/netbox/extras/api/serializers_/customfields.py index 79bb39557..082047e94 100644 --- a/netbox/extras/api/serializers_/customfields.py +++ b/netbox/extras/api/serializers_/customfields.py @@ -65,7 +65,7 @@ class CustomFieldSerializer(ValidatedModelSerializer): 'id', 'url', 'display', 'object_types', 'type', 'related_object_type', 'data_type', 'name', 'label', 'group_name', 'description', 'required', 'search_weight', 'filter_logic', 'ui_visible', 'ui_editable', 'is_cloneable', 'default', 'weight', 'validation_minimum', 'validation_maximum', 'validation_regex', - 'choice_set', 'created', 'last_updated', + 'choice_set', 'comments', 'created', 'last_updated', ] brief_fields = ('id', 'url', 'display', 'name', 'description') diff --git a/netbox/extras/api/serializers_/events.py b/netbox/extras/api/serializers_/events.py index 4285b12e6..469da3e8c 100644 --- a/netbox/extras/api/serializers_/events.py +++ b/netbox/extras/api/serializers_/events.py @@ -47,8 +47,7 @@ class EventRuleSerializer(NetBoxModelSerializer): # We need to manually instantiate the serializer for scripts if instance.action_type == EventRuleActionChoices.SCRIPT: script = instance.action_object - instance = script.python_class() if script.python_class else None - return ScriptSerializer(instance, nested=True, context=context).data + return ScriptSerializer(script, nested=True, context=context).data else: serializer = get_serializer_for_model(instance.action_object_type.model_class()) return serializer(instance.action_object, nested=True, context=context).data diff --git a/netbox/extras/api/serializers_/journaling.py b/netbox/extras/api/serializers_/journaling.py index 46ab0477b..1a44e7e2e 100644 --- a/netbox/extras/api/serializers_/journaling.py +++ b/netbox/extras/api/serializers_/journaling.py @@ -43,7 +43,7 @@ class JournalEntrySerializer(NetBoxModelSerializer): def validate(self, data): # Validate that the parent object exists - if 'assigned_object_type' in data and 'assigned_object_id' in data: + if not self.nested and 'assigned_object_type' in data and 'assigned_object_id' in data: try: data['assigned_object_type'].get_object_for_this_type(id=data['assigned_object_id']) except ObjectDoesNotExist: @@ -51,10 +51,7 @@ class JournalEntrySerializer(NetBoxModelSerializer): f"Invalid assigned_object: {data['assigned_object_type']} ID {data['assigned_object_id']}" ) - # Enforce model validation - super().validate(data) - - return data + return super().validate(data) @extend_schema_field(serializers.JSONField(allow_null=True)) def get_assigned_object(self, instance): diff --git a/netbox/extras/api/views.py b/netbox/extras/api/views.py index 0a5303741..05087b2d5 100644 --- a/netbox/extras/api/views.py +++ b/netbox/extras/api/views.py @@ -1,3 +1,4 @@ +from django.http import Http404 from django.shortcuts import get_object_or_404 from django_rq.queues import get_connection from rest_framework import status @@ -215,21 +216,32 @@ class ScriptViewSet(ModelViewSet): _ignore_model_permissions = True lookup_value_regex = '[^/]+' # Allow dots + def _get_script(self, pk): + # If pk is numeric, retrieve script by ID + if pk.isnumeric(): + return get_object_or_404(self.queryset, pk=pk) + + # Default to retrieval by module & name + try: + module_name, script_name = pk.split('.', maxsplit=1) + except ValueError: + raise Http404 + return get_object_or_404(self.queryset, module__file_path=f'{module_name}.py', name=script_name) + def retrieve(self, request, pk): - script = get_object_or_404(self.queryset, pk=pk) + script = self._get_script(pk) serializer = serializers.ScriptDetailSerializer(script, context={'request': request}) return Response(serializer.data) def post(self, request, pk): """ - Run a Script identified by the id and return the pending Job as the result + Run a Script identified by its numeric PK or module & name and return the pending Job as the result """ - if not request.user.has_perm('extras.run_script'): raise PermissionDenied("This user does not have permission to run scripts.") - script = get_object_or_404(self.queryset, pk=pk) + script = self._get_script(pk) input_serializer = serializers.ScriptInputSerializer( data=request.data, context={'script': script} @@ -240,9 +252,9 @@ class ScriptViewSet(ModelViewSet): raise RQWorkerNotRunningException() if input_serializer.is_valid(): - script.result = Job.enqueue( + Job.enqueue( run_script, - instance=script.module, + instance=script, name=script.python_class.class_name, user=request.user, data=input_serializer.data['data'], diff --git a/netbox/extras/context_managers.py b/netbox/extras/context_managers.py index 8de47465e..e72cb8cc2 100644 --- a/netbox/extras/context_managers.py +++ b/netbox/extras/context_managers.py @@ -13,13 +13,14 @@ def event_tracking(request): :param request: WSGIRequest object with a unique `id` set """ current_request.set(request) - events_queue.set([]) + events_queue.set({}) yield # Flush queued webhooks to RQ - flush_events(events_queue.get()) + if events := list(events_queue.get().values()): + flush_events(events) # Clear context vars current_request.set(None) - events_queue.set([]) + events_queue.set({}) diff --git a/netbox/extras/dashboard/widgets.py b/netbox/extras/dashboard/widgets.py index 23f082ce2..cc11664e6 100644 --- a/netbox/extras/dashboard/widgets.py +++ b/netbox/extras/dashboard/widgets.py @@ -1,3 +1,4 @@ +import logging import uuid from functools import cached_property from hashlib import sha256 @@ -32,6 +33,8 @@ __all__ = ( 'WidgetConfigForm', ) +logger = logging.getLogger('netbox.data_backends') + def get_object_type_choices(): return [ @@ -54,8 +57,15 @@ def get_models_from_content_types(content_types): models = [] for content_type_id in content_types: app_label, model_name = content_type_id.split('.') - content_type = ObjectType.objects.get_by_natural_key(app_label, model_name) - models.append(content_type.model_class()) + try: + content_type = ObjectType.objects.get_by_natural_key(app_label, model_name) + if content_type.model_class(): + models.append(content_type.model_class()) + else: + logger.debug(f"Dashboard Widget model_class not found: {app_label}:{model_name}") + except ObjectType.DoesNotExist: + logger.debug(f"Dashboard Widget ObjectType not found: {app_label}:{model_name}") + return models @@ -255,6 +265,7 @@ class ObjectListWidget(DashboardWidget): parameters = self.config.get('url_params') or {} if page_size := self.config.get('page_size'): parameters['per_page'] = page_size + parameters['embedded'] = True if parameters: try: @@ -318,7 +329,7 @@ class RSSFeedWidget(DashboardWidget): try: response = requests.get( url=self.config['feed_url'], - headers={'User-Agent': f'NetBox/{settings.VERSION}'}, + headers={'User-Agent': f'NetBox/{settings.RELEASE.version}'}, proxies=settings.HTTP_PROXIES, timeout=3 ) diff --git a/netbox/extras/events.py b/netbox/extras/events.py index a33ac213c..22ce26ba9 100644 --- a/netbox/extras/events.py +++ b/netbox/extras/events.py @@ -58,15 +58,21 @@ def enqueue_object(queue, instance, user, request_id, action): if model_name not in registry['model_features']['event_rules'].get(app_label, []): return - queue.append({ - 'content_type': ContentType.objects.get_for_model(instance), - 'object_id': instance.pk, - 'event': action, - 'data': serialize_for_event(instance), - 'snapshots': get_snapshots(instance, action), - 'username': user.username, - 'request_id': request_id - }) + assert instance.pk is not None + key = f'{app_label}.{model_name}:{instance.pk}' + if key in queue: + queue[key]['data'] = serialize_for_event(instance) + queue[key]['snapshots']['postchange'] = get_snapshots(instance, action)['postchange'] + else: + queue[key] = { + 'content_type': ContentType.objects.get_for_model(instance), + 'object_id': instance.pk, + 'event': action, + 'data': serialize_for_event(instance), + 'snapshots': get_snapshots(instance, action), + 'username': user.username, + 'request_id': request_id + } def process_event_rules(event_rules, model_name, event, data, username=None, snapshots=None, request_id=None): @@ -118,7 +124,7 @@ def process_event_rules(event_rules, model_name, event, data, username=None, sna # Enqueue a Job to record the script's execution Job.enqueue( "extras.scripts.run_script", - instance=script.module, + instance=event_rule.action_object, name=script.name, user=user, data=data @@ -163,14 +169,14 @@ def process_event_queue(events): ) -def flush_events(queue): +def flush_events(events): """ - Flush a list of object representation to RQ for webhook processing. + Flush a list of object representations to RQ for event processing. """ - if queue: + if events: for name in settings.EVENTS_PIPELINE: try: func = import_string(name) - func(queue) + func(events) except Exception as e: logger.error(_("Cannot import events pipeline {name} error: {error}").format(name=name, error=e)) diff --git a/netbox/extras/filtersets.py b/netbox/extras/filtersets.py index 4674335c9..c3ac3e6ab 100644 --- a/netbox/extras/filtersets.py +++ b/netbox/extras/filtersets.py @@ -165,7 +165,8 @@ class CustomFieldFilterSet(ChangeLoggedModelFilterSet): Q(name__icontains=value) | Q(label__icontains=value) | Q(group_name__icontains=value) | - Q(description__icontains=value) + Q(description__icontains=value) | + Q(comments__icontains=value) ) @@ -588,10 +589,6 @@ class ConfigContextFilterSet(ChangeLoggedModelFilterSet): label=_('Data file (ID)'), ) - # TODO: Remove in v4.1 - role = device_role - role_id = device_role_id - class Meta: model = ConfigContext fields = ('id', 'name', 'is_active', 'description', 'weight', 'auto_sync_enabled', 'data_synced') diff --git a/netbox/extras/forms/bulk_edit.py b/netbox/extras/forms/bulk_edit.py index 9479fef99..7e9f452e8 100644 --- a/netbox/extras/forms/bulk_edit.py +++ b/netbox/extras/forms/bulk_edit.py @@ -5,7 +5,7 @@ from extras.choices import * from extras.models import * from netbox.forms import NetBoxModelBulkEditForm from utilities.forms import BulkEditForm, add_blank_choice -from utilities.forms.fields import ColorField, DynamicModelChoiceField +from utilities.forms.fields import ColorField, CommentField, DynamicModelChoiceField from utilities.forms.widgets import BulkEditNullBooleanSelect __all__ = ( @@ -64,6 +64,7 @@ class CustomFieldBulkEditForm(BulkEditForm): required=False, widget=BulkEditNullBooleanSelect() ) + comments = CommentField() nullable_fields = ('group_name', 'description', 'choice_set') @@ -316,8 +317,4 @@ class JournalEntryBulkEditForm(BulkEditForm): choices=add_blank_choice(JournalEntryKindChoices), required=False ) - comments = forms.CharField( - label=_('Comments'), - required=False, - widget=forms.Textarea() - ) + comments = CommentField() diff --git a/netbox/extras/forms/bulk_import.py b/netbox/extras/forms/bulk_import.py index 55f71dbd2..c09eed3da 100644 --- a/netbox/extras/forms/bulk_import.py +++ b/netbox/extras/forms/bulk_import.py @@ -71,7 +71,7 @@ class CustomFieldImportForm(CSVModelForm): fields = ( 'name', 'label', 'group_name', 'type', 'object_types', 'related_object_type', 'required', 'description', 'search_weight', 'filter_logic', 'default', 'choice_set', 'weight', 'validation_minimum', - 'validation_maximum', 'validation_regex', 'ui_visible', 'ui_editable', 'is_cloneable', + 'validation_maximum', 'validation_regex', 'ui_visible', 'ui_editable', 'is_cloneable', 'comments', ) @@ -116,6 +116,12 @@ class CustomLinkImportForm(CSVModelForm): queryset=ObjectType.objects.with_feature('custom_links'), help_text=_("One or more assigned object types") ) + button_class = CSVChoiceField( + label=_('button class'), + required=False, + choices=CustomLinkButtonClassChoices, + help_text=_('The class of the first link in a group will be used for the dropdown button') + ) class Meta: model = CustomLink diff --git a/netbox/extras/forms/filtersets.py b/netbox/extras/forms/filtersets.py index d4235c465..e6b001f2c 100644 --- a/netbox/extras/forms/filtersets.py +++ b/netbox/extras/forms/filtersets.py @@ -464,13 +464,10 @@ class JournalEntryFilterForm(NetBoxModelFilterSetForm): required=False, label=_('User') ) - assigned_object_type_id = DynamicModelMultipleChoiceField( - queryset=ObjectType.objects.all(), + assigned_object_type_id = ContentTypeMultipleChoiceField( + queryset=ObjectType.objects.with_feature('journaling'), required=False, label=_('Object Type'), - widget=APISelectMultiple( - api_url='/api/extras/content-types/', - ) ) kind = forms.ChoiceField( label=_('Kind'), @@ -507,11 +504,8 @@ class ObjectChangeFilterForm(SavedFiltersMixin, FilterForm): required=False, label=_('User') ) - changed_object_type_id = DynamicModelMultipleChoiceField( - queryset=ObjectType.objects.all(), + changed_object_type_id = ContentTypeMultipleChoiceField( + queryset=ObjectType.objects.with_feature('change_logging'), required=False, label=_('Object Type'), - widget=APISelectMultiple( - api_url='/api/extras/content-types/', - ) ) diff --git a/netbox/extras/forms/model_forms.py b/netbox/extras/forms/model_forms.py index 680bec1e4..ebd6e6c08 100644 --- a/netbox/extras/forms/model_forms.py +++ b/netbox/extras/forms/model_forms.py @@ -53,6 +53,7 @@ class CustomFieldForm(forms.ModelForm): queryset=CustomFieldChoiceSet.objects.all(), required=False ) + comments = CommentField() fieldsets = ( FieldSet( @@ -121,7 +122,7 @@ class CustomFieldChoiceSetForm(forms.ModelForm): label = label.replace('\\:', ':') except ValueError: value, label = line, line - data.append((value, label)) + data.append((value.strip(), label.strip())) return data @@ -272,15 +273,13 @@ class EventRuleForm(NetBoxModelForm): required=False, help_text=_('Enter parameters to pass to the action in JSON format.') ) + comments = CommentField() fieldsets = ( FieldSet('name', 'description', 'object_types', 'enabled', 'tags', name=_('Event Rule')), FieldSet('type_create', 'type_update', 'type_delete', 'type_job_start', 'type_job_end', name=_('Events')), FieldSet('conditions', name=_('Conditions')), - FieldSet( - 'action_type', 'action_choice', 'action_object_type', 'action_object_id', 'action_data', - name=_('Action') - ), + FieldSet('action_type', 'action_choice', 'action_data', name=_('Action')), ) class Meta: diff --git a/netbox/extras/management/commands/runscript.py b/netbox/extras/management/commands/runscript.py index 160e8813f..ef1bd5141 100644 --- a/netbox/extras/management/commands/runscript.py +++ b/netbox/extras/management/commands/runscript.py @@ -85,6 +85,7 @@ class Command(BaseCommand): module_name, script_name = script.split('.', 1) module, script = get_module_and_script(module_name, script_name) + script = script.python_class # Take user from command line if provided and exists, other if options['user']: diff --git a/netbox/extras/migrations/0087_squashed_0098.py b/netbox/extras/migrations/0087_squashed_0098.py index 57ad3af00..55f276ecd 100644 --- a/netbox/extras/migrations/0087_squashed_0098.py +++ b/netbox/extras/migrations/0087_squashed_0098.py @@ -68,6 +68,7 @@ class Migration(migrations.Migration): ], options={ 'proxy': True, + 'ordering': ('file_root', 'file_path'), 'indexes': [], 'constraints': [], }, @@ -79,6 +80,7 @@ class Migration(migrations.Migration): ], options={ 'proxy': True, + 'ordering': ('file_root', 'file_path'), 'indexes': [], 'constraints': [], }, diff --git a/netbox/extras/migrations/0109_script_model.py b/netbox/extras/migrations/0109_script_model.py index 7570077a7..6bfd2c14c 100644 --- a/netbox/extras/migrations/0109_script_model.py +++ b/netbox/extras/migrations/0109_script_model.py @@ -60,7 +60,10 @@ def get_module_scripts(scriptmodule): return cls.full_name.split(".", maxsplit=1)[1] loader = SourceFileLoader(get_python_name(scriptmodule), get_full_path(scriptmodule)) - module = loader.load_module() + try: + module = loader.load_module() + except FileNotFoundError: + return {} scripts = {} ordered = getattr(module, 'script_order', []) diff --git a/netbox/extras/migrations/0114_customfield_add_comments.py b/netbox/extras/migrations/0114_customfield_add_comments.py new file mode 100644 index 000000000..cd85db1ba --- /dev/null +++ b/netbox/extras/migrations/0114_customfield_add_comments.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.3 on 2024-04-19 18:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('extras', '0113_customfield_rename_object_type'), + ] + + operations = [ + migrations.AddField( + model_name='customfield', + name='comments', + field=models.TextField(blank=True), + ), + ] diff --git a/netbox/extras/migrations/0115_convert_dashboard_widgets.py b/netbox/extras/migrations/0115_convert_dashboard_widgets.py new file mode 100644 index 000000000..c85c83ecf --- /dev/null +++ b/netbox/extras/migrations/0115_convert_dashboard_widgets.py @@ -0,0 +1,29 @@ +# Generated by Django 5.0.4 on 2024-04-24 20:09 + +from django.db import migrations + + +def update_dashboard_widgets(apps, schema_editor): + Dashboard = apps.get_model('extras', 'Dashboard') + + for dashboard in Dashboard.objects.all(): + for key, widget in dashboard.config.items(): + if models := widget['config'].get('models'): + models = list(map(lambda x: x.replace('users.netboxgroup', 'users.group'), models)) + models = list(map(lambda x: x.replace('users.netboxuser', 'users.user'), models)) + dashboard.config[key]['config']['models'] = models + dashboard.save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('extras', '0114_customfield_add_comments'), + ] + + operations = [ + migrations.RunPython( + code=update_dashboard_widgets, + reverse_code=migrations.RunPython.noop + ), + ] diff --git a/netbox/extras/models/change_logging.py b/netbox/extras/models/change_logging.py index ebcebc09a..8451a0d15 100644 --- a/netbox/extras/models/change_logging.py +++ b/netbox/extras/models/change_logging.py @@ -1,12 +1,17 @@ +from functools import cached_property + from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey from django.core.exceptions import ValidationError from django.db import models from django.urls import reverse from django.utils.translation import gettext_lazy as _ +from mptt.models import MPTTModel from core.models import ObjectType from extras.choices import * +from netbox.models.features import ChangeLoggingMixin +from utilities.data import shallow_compare_dict from ..querysets import ObjectChangeQuerySet __all__ = ( @@ -136,6 +141,71 @@ class ObjectChange(models.Model): def get_action_color(self): return ObjectChangeActionChoices.colors.get(self.action) - @property + @cached_property def has_changes(self): return self.prechange_data != self.postchange_data + + @cached_property + def diff_exclude_fields(self): + """ + Return a set of attributes which should be ignored when calculating a diff + between the pre- and post-change data. (For instance, it would not make + sense to compare the "last updated" times as these are expected to differ.) + """ + model = self.changed_object_type.model_class() + attrs = set() + + # Exclude auto-populated change tracking fields + if issubclass(model, ChangeLoggingMixin): + attrs.update({'created', 'last_updated'}) + + # Exclude MPTT-internal fields + if issubclass(model, MPTTModel): + attrs.update({'level', 'lft', 'rght', 'tree_id'}) + + return attrs + + def get_clean_data(self, prefix): + """ + Return only the pre-/post-change attributes which are relevant for calculating a diff. + """ + ret = {} + change_data = getattr(self, f'{prefix}_data') or {} + for k, v in change_data.items(): + if k not in self.diff_exclude_fields and not k.startswith('_'): + ret[k] = v + return ret + + @cached_property + def prechange_data_clean(self): + return self.get_clean_data('prechange') + + @cached_property + def postchange_data_clean(self): + return self.get_clean_data('postchange') + + def diff(self): + """ + Return a dictionary of pre- and post-change values for attributes which have changed. + """ + prechange_data = self.prechange_data_clean + postchange_data = self.postchange_data_clean + + # Determine which attributes have changed + if self.action == ObjectChangeActionChoices.ACTION_CREATE: + changed_attrs = sorted(postchange_data.keys()) + elif self.action == ObjectChangeActionChoices.ACTION_DELETE: + changed_attrs = sorted(prechange_data.keys()) + else: + # TODO: Support deep (recursive) comparison + changed_data = shallow_compare_dict(prechange_data, postchange_data) + changed_attrs = sorted(changed_data.keys()) + + return { + 'pre': { + k: prechange_data.get(k) for k in changed_attrs + }, + 'post': { + k: postchange_data.get(k) for k in changed_attrs + }, + } diff --git a/netbox/extras/models/customfields.py b/netbox/extras/models/customfields.py index a14c71c63..974affb2e 100644 --- a/netbox/extras/models/customfields.py +++ b/netbox/extras/models/customfields.py @@ -1,4 +1,5 @@ import decimal +import json import re from datetime import datetime, date @@ -205,6 +206,10 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel): verbose_name=_('is cloneable'), help_text=_('Replicate this value when cloning objects') ) + comments = models.TextField( + verbose_name=_('comments'), + blank=True + ) objects = CustomFieldManager() @@ -484,7 +489,7 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel): # JSON elif self.type == CustomFieldTypeChoices.TYPE_JSON: - field = JSONField(required=required, initial=initial) + field = JSONField(required=required, initial=json.dumps(initial) if initial else '') # Object elif self.type == CustomFieldTypeChoices.TYPE_OBJECT: diff --git a/netbox/extras/models/models.py b/netbox/extras/models/models.py index 16f10b485..49249eaa0 100644 --- a/netbox/extras/models/models.py +++ b/netbox/extras/models/models.py @@ -732,7 +732,7 @@ class JournalEntry(CustomFieldsMixin, CustomLinksMixin, TagsMixin, ExportTemplat def __str__(self): created = timezone.localtime(self.created) - return f"{date_format(created, format='SHORT_DATETIME_FORMAT')} ({self.get_kind_display()})" + return f"{created.date().isoformat()} {created.time().isoformat(timespec='minutes')} ({self.get_kind_display()})" def get_absolute_url(self): return reverse('extras:journalentry', args=[self.pk]) diff --git a/netbox/extras/models/scripts.py b/netbox/extras/models/scripts.py index 551a8b4f0..98d79c53c 100644 --- a/netbox/extras/models/scripts.py +++ b/netbox/extras/models/scripts.py @@ -96,9 +96,18 @@ class ScriptModule(PythonModuleMixin, JobsMixin, ManagedFile): Proxy model for script module files. """ objects = ScriptModuleManager() + error = None + + event_rules = GenericRelation( + to='extras.EventRule', + content_type_field='action_object_type', + object_id_field='action_object_id', + for_concrete_model=False + ) class Meta: proxy = True + ordering = ('file_root', 'file_path') verbose_name = _('script module') verbose_name_plural = _('script modules') @@ -118,6 +127,7 @@ class ScriptModule(PythonModuleMixin, JobsMixin, ManagedFile): try: module = self.get_module() except Exception as e: + self.error = e logger.debug(f"Failed to load script: {self.python_name} error: {e}") module = None @@ -165,8 +175,8 @@ class ScriptModule(PythonModuleMixin, JobsMixin, ManagedFile): def save(self, *args, **kwargs): self.file_root = ManagedFileRootPathChoices.SCRIPTS + super().save(*args, **kwargs) self.sync_classes() - return super().save(*args, **kwargs) @receiver(post_save, sender=ScriptModule) diff --git a/netbox/extras/models/staging.py b/netbox/extras/models/staging.py index 6e381ce70..7ffbde089 100644 --- a/netbox/extras/models/staging.py +++ b/netbox/extras/models/staging.py @@ -4,6 +4,7 @@ from django.contrib.auth import get_user_model from django.contrib.contenttypes.fields import GenericForeignKey from django.db import models, transaction from django.utils.translation import gettext_lazy as _ +from mptt.models import MPTTModel from extras.choices import ChangeActionChoices from netbox.models import ChangeLoggedModel @@ -124,6 +125,11 @@ class StagedChange(CustomValidationMixin, EventRulesMixin, models.Model): instance = self.model.objects.get(pk=self.object_id) logger.info(f'Deleting {self.model._meta.verbose_name} {instance}') instance.delete() + + # Rebuild the MPTT tree where applicable + if issubclass(self.model, MPTTModel): + self.model.objects.rebuild() + apply.alters_data = True def get_action_color(self): diff --git a/netbox/extras/scripts.py b/netbox/extras/scripts.py index 71faa47e2..0e74c3f0d 100644 --- a/netbox/extras/scripts.py +++ b/netbox/extras/scripts.py @@ -24,6 +24,7 @@ from ipam.validators import MaxPrefixLengthValidator, MinPrefixLengthValidator, from utilities.exceptions import AbortScript, AbortTransaction from utilities.forms import add_blank_choice from utilities.forms.fields import DynamicModelChoiceField, DynamicModelMultipleChoiceField +from utilities.forms.widgets import DatePicker, DateTimePicker from .context_managers import event_tracking from .forms import ScriptForm from .utils import is_report @@ -33,6 +34,8 @@ __all__ = ( 'BaseScript', 'BooleanVar', 'ChoiceVar', + 'DateVar', + 'DateTimeVar', 'FileVar', 'IntegerVar', 'IPAddressVar', @@ -174,6 +177,28 @@ class ChoiceVar(ScriptVariable): self.field_attrs['choices'] = add_blank_choice(choices) +class DateVar(ScriptVariable): + """ + A date. + """ + form_field = forms.DateField + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.form_field.widget = DatePicker() + + +class DateTimeVar(ScriptVariable): + """ + A date and a time. + """ + form_field = forms.DateTimeField + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.form_field.widget = DateTimePicker() + + class MultiChoiceVar(ScriptVariable): """ Like ChoiceVar, but allows for the selection of multiple choices. diff --git a/netbox/extras/search.py b/netbox/extras/search.py index fff59fa77..9203b9144 100644 --- a/netbox/extras/search.py +++ b/netbox/extras/search.py @@ -2,6 +2,18 @@ from netbox.search import SearchIndex, register_search from . import models +@register_search +class CustomFieldIndex(SearchIndex): + model = models.CustomField + fields = ( + ('name', 100), + ('label', 100), + ('description', 500), + ('comments', 5000), + ) + display_attrs = ('description',) + + @register_search class JournalEntryIndex(SearchIndex): model = models.JournalEntry diff --git a/netbox/extras/signals.py b/netbox/extras/signals.py index 2813ed7ae..9d439ace9 100644 --- a/netbox/extras/signals.py +++ b/netbox/extras/signals.py @@ -55,18 +55,6 @@ def run_validators(instance, validators): clear_events = Signal() -def is_same_object(instance, webhook_data, request_id): - """ - Compare the given instance to the most recent queued webhook object, returning True - if they match. This check is used to avoid creating duplicate webhook entries. - """ - return ( - ContentType.objects.get_for_model(instance) == webhook_data['content_type'] and - instance.pk == webhook_data['object_id'] and - request_id == webhook_data['request_id'] - ) - - @receiver((post_save, m2m_changed)) def handle_changed_object(sender, instance, **kwargs): """ @@ -112,14 +100,13 @@ def handle_changed_object(sender, instance, **kwargs): objectchange.request_id = request.id objectchange.save() - # If this is an M2M change, update the previously queued webhook (from post_save) + # Ensure that we're working with fresh M2M assignments + if m2m_changed: + instance.refresh_from_db() + + # Enqueue the object for event processing queue = events_queue.get() - if m2m_changed and queue and is_same_object(instance, queue[-1], request.id): - instance.refresh_from_db() # Ensure that we're working with fresh M2M assignments - queue[-1]['data'] = serialize_for_event(instance) - queue[-1]['snapshots']['postchange'] = get_snapshots(instance, action)['postchange'] - else: - enqueue_object(queue, instance, request.user, request.id, action) + enqueue_object(queue, instance, request.user, request.id, action) events_queue.set(queue) # Increment metric counters @@ -179,7 +166,7 @@ def handle_deleted_object(sender, instance, **kwargs): obj.snapshot() # Ensure the change record includes the "before" state getattr(obj, related_field_name).remove(instance) - # Enqueue webhooks + # Enqueue the object for event processing queue = events_queue.get() enqueue_object(queue, instance, request.user, request.id, ObjectChangeActionChoices.ACTION_DELETE) events_queue.set(queue) @@ -195,7 +182,7 @@ def clear_events_queue(sender, **kwargs): """ logger = logging.getLogger('events') logger.info(f"Clearing {len(events_queue.get())} queued events ({sender})") - events_queue.set([]) + events_queue.set({}) # diff --git a/netbox/extras/tables/tables.py b/netbox/extras/tables/tables.py index a0f504931..8c78ad0de 100644 --- a/netbox/extras/tables/tables.py +++ b/netbox/extras/tables/tables.py @@ -1,10 +1,10 @@ import json import django_tables2 as tables -from django.conf import settings from django.utils.translation import gettext_lazy as _ from extras.models import * +from netbox.constants import EMPTY_TABLE_TEXT from netbox.tables import BaseTable, NetBoxTable, columns from .template_code import * @@ -78,7 +78,7 @@ class CustomFieldTable(NetBoxTable): fields = ( 'pk', 'id', 'name', 'object_types', 'label', 'type', 'related_object_type', 'group_name', 'required', 'default', 'description', 'search_weight', 'filter_logic', 'ui_visible', 'ui_editable', 'is_cloneable', - 'weight', 'choice_set', 'choices', 'created', 'last_updated', + 'weight', 'choice_set', 'choices', 'comments', 'created', 'last_updated', ) default_columns = ('pk', 'name', 'object_types', 'label', 'group_name', 'type', 'required', 'description') @@ -419,23 +419,43 @@ class ConfigTemplateTable(NetBoxTable): tags = columns.TagColumn( url_name='extras:configtemplate_list' ) + role_count = columns.LinkedCountColumn( + viewname='dcim:devicerole_list', + url_params={'config_template_id': 'pk'}, + verbose_name=_('Device Roles') + ) + platform_count = columns.LinkedCountColumn( + viewname='dcim:platform_list', + url_params={'config_template_id': 'pk'}, + verbose_name=_('Platforms') + ) + device_count = columns.LinkedCountColumn( + viewname='dcim:device_list', + url_params={'config_template_id': 'pk'}, + verbose_name=_('Devices') + ) + vm_count = columns.LinkedCountColumn( + viewname='virtualization:virtualmachine_list', + url_params={'config_template_id': 'pk'}, + verbose_name=_('Virtual Machines') + ) class Meta(NetBoxTable.Meta): model = ConfigTemplate fields = ( - 'pk', 'id', 'name', 'description', 'data_source', 'data_file', 'data_synced', 'created', 'last_updated', - 'tags', + 'pk', 'id', 'name', 'description', 'data_source', 'data_file', 'data_synced', 'role_count', + 'platform_count', 'device_count', 'vm_count', 'created', 'last_updated', 'tags', ) default_columns = ( - 'pk', 'name', 'description', 'is_synced', + 'pk', 'name', 'description', 'is_synced', 'device_count', 'vm_count', ) class ObjectChangeTable(NetBoxTable): - time = tables.DateTimeColumn( + time = columns.DateTimeColumn( verbose_name=_('Time'), - linkify=True, - format=settings.SHORT_DATETIME_FORMAT + timespec='minutes', + linkify=True ) user_name = tables.Column( verbose_name=_('Username') @@ -475,10 +495,10 @@ class ObjectChangeTable(NetBoxTable): class JournalEntryTable(NetBoxTable): - created = tables.DateTimeColumn( + created = columns.DateTimeColumn( verbose_name=_('Created'), - linkify=True, - format=settings.SHORT_DATETIME_FORMAT + timespec='minutes', + linkify=True ) assigned_object_type = columns.ContentTypeColumn( verbose_name=_('Object Type') @@ -525,12 +545,12 @@ class ScriptResultsTable(BaseTable): template_code="""{% load log_levels %}{% log_level record.status %}""", verbose_name=_('Level') ) - message = tables.Column( + message = columns.MarkdownColumn( verbose_name=_('Message') ) class Meta(BaseTable.Meta): - empty_text = _('No results found') + empty_text = _(EMPTY_TABLE_TEXT) fields = ( 'index', 'time', 'status', 'message', ) @@ -546,27 +566,22 @@ class ReportResultsTable(BaseTable): time = tables.Column( verbose_name=_('Time') ) - status = tables.Column( - empty_values=(), - verbose_name=_('Level') - ) status = tables.TemplateColumn( template_code="""{% load log_levels %}{% log_level record.status %}""", verbose_name=_('Level') ) - object = tables.Column( verbose_name=_('Object') ) url = tables.Column( verbose_name=_('URL') ) - message = tables.Column( + message = columns.MarkdownColumn( verbose_name=_('Message') ) class Meta(BaseTable.Meta): - empty_text = _('No results found') + empty_text = _(EMPTY_TABLE_TEXT) fields = ( 'index', 'method', 'time', 'status', 'object', 'url', 'message', ) diff --git a/netbox/extras/tests/test_changelog.py b/netbox/extras/tests/test_changelog.py index d9d6f1f45..aac526e0f 100644 --- a/netbox/extras/tests/test_changelog.py +++ b/netbox/extras/tests/test_changelog.py @@ -75,6 +75,10 @@ class ChangeLogViewTest(ModelViewTestCase): self.assertEqual(oc.postchange_data['custom_fields']['cf2'], form_data['cf_cf2']) self.assertEqual(oc.postchange_data['tags'], ['Tag 1', 'Tag 2']) + # Check that private attributes were included in raw data but not display data + self.assertIn('_name', oc.postchange_data) + self.assertNotIn('_name', oc.postchange_data_clean) + def test_update_object(self): site = Site(name='Site 1', slug='site-1') site.save() @@ -112,6 +116,12 @@ class ChangeLogViewTest(ModelViewTestCase): self.assertEqual(oc.postchange_data['custom_fields']['cf2'], form_data['cf_cf2']) self.assertEqual(oc.postchange_data['tags'], ['Tag 3']) + # Check that private attributes were included in raw data but not display data + self.assertIn('_name', oc.prechange_data) + self.assertNotIn('_name', oc.prechange_data_clean) + self.assertIn('_name', oc.postchange_data) + self.assertNotIn('_name', oc.postchange_data_clean) + def test_delete_object(self): site = Site( name='Site 1', @@ -142,6 +152,10 @@ class ChangeLogViewTest(ModelViewTestCase): self.assertEqual(oc.prechange_data['tags'], ['Tag 1', 'Tag 2']) self.assertEqual(oc.postchange_data, None) + # Check that private attributes were included in raw data but not display data + self.assertIn('_name', oc.prechange_data) + self.assertNotIn('_name', oc.prechange_data_clean) + def test_bulk_update_objects(self): sites = ( Site(name='Site 1', slug='site-1', status=SiteStatusChoices.STATUS_ACTIVE), @@ -338,6 +352,10 @@ class ChangeLogAPITest(APITestCase): self.assertEqual(oc.postchange_data['custom_fields'], data['custom_fields']) self.assertEqual(oc.postchange_data['tags'], ['Tag 1', 'Tag 2']) + # Check that private attributes were included in raw data but not display data + self.assertIn('_name', oc.postchange_data) + self.assertNotIn('_name', oc.postchange_data_clean) + def test_update_object(self): site = Site(name='Site 1', slug='site-1') site.save() @@ -370,6 +388,12 @@ class ChangeLogAPITest(APITestCase): self.assertEqual(oc.postchange_data['custom_fields'], data['custom_fields']) self.assertEqual(oc.postchange_data['tags'], ['Tag 3']) + # Check that private attributes were included in raw data but not display data + self.assertIn('_name', oc.prechange_data) + self.assertNotIn('_name', oc.prechange_data_clean) + self.assertIn('_name', oc.postchange_data) + self.assertNotIn('_name', oc.postchange_data_clean) + def test_delete_object(self): site = Site( name='Site 1', @@ -398,6 +422,10 @@ class ChangeLogAPITest(APITestCase): self.assertEqual(oc.prechange_data['tags'], ['Tag 1', 'Tag 2']) self.assertEqual(oc.postchange_data, None) + # Check that private attributes were included in raw data but not display data + self.assertIn('_name', oc.prechange_data) + self.assertNotIn('_name', oc.prechange_data_clean) + def test_bulk_create_objects(self): data = ( { diff --git a/netbox/extras/tests/test_event_rules.py b/netbox/extras/tests/test_event_rules.py index 8cea2078a..a1dd8b48e 100644 --- a/netbox/extras/tests/test_event_rules.py +++ b/netbox/extras/tests/test_event_rules.py @@ -4,6 +4,7 @@ from unittest.mock import patch import django_rq from django.http import HttpResponse +from django.test import RequestFactory from django.urls import reverse from requests import Session from rest_framework import status @@ -12,6 +13,7 @@ from core.models import ObjectType from dcim.choices import SiteStatusChoices from dcim.models import Site from extras.choices import EventRuleActionChoices, ObjectChangeActionChoices +from extras.context_managers import event_tracking from extras.events import enqueue_object, flush_events, serialize_for_event from extras.models import EventRule, Tag, Webhook from extras.webhooks import generate_signature, send_webhook @@ -360,7 +362,7 @@ class EventRuleTest(APITestCase): return HttpResponse() # Enqueue a webhook for processing - webhooks_queue = [] + webhooks_queue = {} site = Site.objects.create(name='Site 1', slug='site-1') enqueue_object( webhooks_queue, @@ -369,7 +371,7 @@ class EventRuleTest(APITestCase): request_id=request_id, action=ObjectChangeActionChoices.ACTION_CREATE ) - flush_events(webhooks_queue) + flush_events(list(webhooks_queue.values())) # Retrieve the job from queue job = self.queue.jobs[0] @@ -377,3 +379,24 @@ class EventRuleTest(APITestCase): # Patch the Session object with our dummy_send() method, then process the webhook for sending with patch.object(Session, 'send', dummy_send) as mock_send: send_webhook(**job.kwargs) + + def test_duplicate_triggers(self): + """ + Test for erroneous duplicate event triggers resulting from saving an object multiple times + within the span of a single request. + """ + url = reverse('dcim:site_add') + request = RequestFactory().get(url) + request.id = uuid.uuid4() + request.user = self.user + + self.assertEqual(self.queue.count, 0, msg="Unexpected jobs found in queue") + + with event_tracking(request): + site = Site(name='Site 1', slug='site-1') + site.save() + + # Save the site a second time + site.save() + + self.assertEqual(self.queue.count, 1, msg="Duplicate jobs found in queue") diff --git a/netbox/extras/tests/test_scripts.py b/netbox/extras/tests/test_scripts.py index 64971f1dc..bed8f0fc5 100644 --- a/netbox/extras/tests/test_scripts.py +++ b/netbox/extras/tests/test_scripts.py @@ -1,4 +1,5 @@ import tempfile +from datetime import date, datetime, timezone from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase @@ -322,3 +323,47 @@ class ScriptVariablesTest(TestCase): form = TestScript().as_form(data, None) self.assertTrue(form.is_valid()) self.assertEqual(form.cleaned_data['var1'], IPNetwork(data['var1'])) + + def test_datevar(self): + + class TestScript(Script): + + var1 = DateVar() + var2 = DateVar(required=False) + + # Test date validation + data = {'var1': 'not a date'} + form = TestScript().as_form(data, None) + self.assertFalse(form.is_valid()) + self.assertIn('var1', form.errors) + + # Validate valid data + input_date = date(2024, 4, 1) + data = {'var1': input_date} + form = TestScript().as_form(data, None) + self.assertTrue(form.is_valid()) + self.assertEqual(form.cleaned_data['var1'], input_date) + # Validate required=False works for this Var type + self.assertEqual(form.cleaned_data['var2'], None) + + def test_datetimevar(self): + + class TestScript(Script): + + var1 = DateTimeVar() + var2 = DateTimeVar(required=False) + + # Test datetime validation + data = {'var1': 'not a datetime'} + form = TestScript().as_form(data, None) + self.assertFalse(form.is_valid()) + self.assertIn('var1', form.errors) + + # Validate valid data + input_datetime = datetime(2024, 4, 1, 8, 0, 0, 0, timezone.utc) + data = {'var1': input_datetime} + form = TestScript().as_form(data, None) + self.assertTrue(form.is_valid()) + self.assertEqual(form.cleaned_data['var1'], input_datetime) + # Validate required=False works for this Var type + self.assertEqual(form.cleaned_data['var2'], None) diff --git a/netbox/extras/views.py b/netbox/extras/views.py index be3937512..82f519c00 100644 --- a/netbox/extras/views.py +++ b/netbox/extras/views.py @@ -13,6 +13,7 @@ from core.choices import ManagedFileRootPathChoices from core.forms import ManagedFileForm from core.models import Job from core.tables import JobTable +from dcim.models import Device, DeviceRole, Platform from extras.dashboard.forms import DashboardWidgetAddForm, DashboardWidgetForm from extras.dashboard.utils import get_widget_class from netbox.constants import DEFAULT_ACTION_PERMISSIONS @@ -28,6 +29,7 @@ from utilities.request import copy_safe_request from utilities.rqworker import get_workers_for_queue from utilities.templatetags.builtins.filters import render_markdown from utilities.views import ContentTypePermissionRequiredMixin, get_viewname, register_model_view +from virtualization.models import VirtualMachine from . import filtersets, forms, tables from .models import * from .scripts import run_script @@ -627,7 +629,12 @@ class ObjectConfigContextView(generic.ObjectView): # class ConfigTemplateListView(generic.ObjectListView): - queryset = ConfigTemplate.objects.all() + queryset = ConfigTemplate.objects.annotate( + device_count=count_related(Device, 'config_template'), + vm_count=count_related(VirtualMachine, 'config_template'), + role_count=count_related(DeviceRole, 'config_template'), + platform_count=count_related(Platform, 'config_template'), + ) filterset = filtersets.ConfigTemplateFilterSet filterset_form = forms.ConfigTemplateFilterForm table = tables.ConfigTemplateTable @@ -716,15 +723,15 @@ class ObjectChangeView(generic.ObjectView): if not instance.prechange_data and instance.action in ['update', 'delete'] and prev_change: non_atomic_change = True - prechange_data = prev_change.postchange_data + prechange_data = prev_change.postchange_data_clean else: non_atomic_change = False - prechange_data = instance.prechange_data + prechange_data = instance.prechange_data_clean if prechange_data and instance.postchange_data: diff_added = shallow_compare_dict( prechange_data or dict(), - instance.postchange_data or dict(), + instance.postchange_data_clean or dict(), exclude=['last_updated'], ) diff_removed = { @@ -1035,7 +1042,9 @@ class ScriptListView(ContentTypePermissionRequiredMixin, View): return 'extras.view_script' def get(self, request): - script_modules = ScriptModule.objects.restrict(request.user).prefetch_related('jobs') + script_modules = ScriptModule.objects.restrict(request.user).prefetch_related( + 'data_source', 'data_file', 'jobs' + ) return render(request, 'extras/script_list.html', { 'model': ScriptModule, @@ -1043,12 +1052,27 @@ class ScriptListView(ContentTypePermissionRequiredMixin, View): }) -class ScriptView(generic.ObjectView): +class BaseScriptView(generic.ObjectView): queryset = Script.objects.all() + def _get_script_class(self, script): + """ + Return an instance of the Script's Python class + """ + if script_class := script.python_class: + return script_class() + + +class ScriptView(BaseScriptView): + def get(self, request, **kwargs): script = self.get_object(**kwargs) - script_class = script.python_class() + script_class = self._get_script_class(script) + if not script_class: + return render(request, 'extras/script.html', { + 'script': script, + }) + form = script_class.as_form(initial=normalize_querydict(request.GET)) return render(request, 'extras/script.html', { @@ -1060,11 +1084,16 @@ class ScriptView(generic.ObjectView): def post(self, request, **kwargs): script = self.get_object(**kwargs) - script_class = script.python_class() if not request.user.has_perm('extras.run_script', obj=script): return HttpResponseForbidden() + script_class = self._get_script_class(script) + if not script_class: + return render(request, 'extras/script.html', { + 'script': script, + }) + form = script_class.as_form(request.POST, request.FILES) # Allow execution only if RQ worker process is running @@ -1094,21 +1123,22 @@ class ScriptView(generic.ObjectView): }) -class ScriptSourceView(generic.ObjectView): +class ScriptSourceView(BaseScriptView): queryset = Script.objects.all() def get(self, request, **kwargs): script = self.get_object(**kwargs) + script_class = self._get_script_class(script) return render(request, 'extras/script/source.html', { 'script': script, - 'script_class': script.python_class(), + 'script_class': script_class, 'job_count': script.jobs.count(), 'tab': 'source', }) -class ScriptJobsView(generic.ObjectView): +class ScriptJobsView(BaseScriptView): queryset = Script.objects.all() def get(self, request, **kwargs): diff --git a/netbox/ipam/api/serializers_/ip.py b/netbox/ipam/api/serializers_/ip.py index e5fa81314..7c53d68ca 100644 --- a/netbox/ipam/api/serializers_/ip.py +++ b/netbox/ipam/api/serializers_/ip.py @@ -100,7 +100,7 @@ class AvailablePrefixSerializer(serializers.Serializer): """ family = serializers.IntegerField(read_only=True) prefix = serializers.CharField(read_only=True) - vrf = VRFSerializer(nested=True, read_only=True) + vrf = VRFSerializer(nested=True, read_only=True, allow_null=True) def to_representation(self, instance): if self.context.get('vrf'): @@ -183,7 +183,7 @@ class AvailableIPSerializer(serializers.Serializer): """ family = serializers.IntegerField(read_only=True) address = serializers.CharField(read_only=True) - vrf = VRFSerializer(nested=True, read_only=True) + vrf = VRFSerializer(nested=True, read_only=True, allow_null=True) description = serializers.CharField(required=False) def to_representation(self, instance): diff --git a/netbox/ipam/api/serializers_/vlans.py b/netbox/ipam/api/serializers_/vlans.py index a400f949b..f35d294cf 100644 --- a/netbox/ipam/api/serializers_/vlans.py +++ b/netbox/ipam/api/serializers_/vlans.py @@ -82,7 +82,7 @@ class AvailableVLANSerializer(serializers.Serializer): Representation of a VLAN which does not exist in the database. """ vid = serializers.IntegerField(read_only=True) - group = VLANGroupSerializer(nested=True, read_only=True) + group = VLANGroupSerializer(nested=True, read_only=True, allow_null=True) def to_representation(self, instance): return { diff --git a/netbox/ipam/filtersets.py b/netbox/ipam/filtersets.py index d58f5bfc9..5cdfac34e 100644 --- a/netbox/ipam/filtersets.py +++ b/netbox/ipam/filtersets.py @@ -912,10 +912,6 @@ class VLANGroupFilterSet(OrganizationalModelFilterSet): method='filter_scope' ) - # TODO: Remove in v4.1 - sitegroup = site_group - clustergroup = cluster_group - class Meta: model = VLANGroup fields = ('id', 'name', 'slug', 'min_vid', 'max_vid', 'description', 'scope_id') @@ -1106,10 +1102,6 @@ class ServiceFilterSet(NetBoxModelFilterSet): lookup_expr='contains' ) - # TODO: Remove in v4.1 - ipaddress = ip_address - ipaddress_id = ip_address_id - class Meta: model = Service fields = ('id', 'name', 'protocol', 'description') diff --git a/netbox/ipam/forms/filtersets.py b/netbox/ipam/forms/filtersets.py index 6610bcaf3..80fb04226 100644 --- a/netbox/ipam/forms/filtersets.py +++ b/netbox/ipam/forms/filtersets.py @@ -10,7 +10,7 @@ from tenancy.forms import TenancyFilterForm from utilities.forms import BOOLEAN_WITH_BLANK_CHOICES, add_blank_choice from utilities.forms.fields import DynamicModelChoiceField, DynamicModelMultipleChoiceField, TagFilterField from utilities.forms.rendering import FieldSet -from virtualization.models import VirtualMachine +from virtualization.models import VirtualMachine, ClusterGroup, Cluster from vpn.models import L2VPN __all__ = ( @@ -168,6 +168,7 @@ class PrefixFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm): 'within_include', 'family', 'status', 'role_id', 'mask_length', 'is_pool', 'mark_utilized', name=_('Addressing') ), + FieldSet('vlan_id', name=_('VLAN Assignment')), FieldSet('vrf_id', 'present_in_vrf_id', name=_('VRF')), FieldSet('region_id', 'site_group_id', 'site_id', name=_('Location')), FieldSet('tenant_group_id', 'tenant_id', name=_('Tenant')), @@ -249,6 +250,12 @@ class PrefixFilterForm(TenancyFilterForm, NetBoxModelFilterSetForm): choices=BOOLEAN_WITH_BLANK_CHOICES ) ) + vlan_id = DynamicModelMultipleChoiceField( + queryset=VLAN.objects.all(), + required=False, + label=_('VLAN'), + ) + tag = TagFilterField(model) @@ -405,6 +412,7 @@ class VLANGroupFilterForm(NetBoxModelFilterSetForm): fieldsets = ( FieldSet('q', 'filter_id', 'tag'), FieldSet('region', 'sitegroup', 'site', 'location', 'rack', name=_('Location')), + FieldSet('cluster_group', 'cluster', name=_('Cluster')), FieldSet('min_vid', 'max_vid', name=_('VLAN ID')), ) model = VLANGroup @@ -445,6 +453,17 @@ class VLANGroupFilterForm(NetBoxModelFilterSetForm): max_value=VLAN_VID_MAX, label=_('Maximum VID') ) + cluster = DynamicModelMultipleChoiceField( + queryset=Cluster.objects.all(), + required=False, + label=_('Cluster') + ) + cluster_group = DynamicModelMultipleChoiceField( + queryset=ClusterGroup.objects.all(), + required=False, + label=_('Cluster group') + ) + tag = TagFilterField(model) diff --git a/netbox/ipam/forms/model_forms.py b/netbox/ipam/forms/model_forms.py index 0db9576f1..4e405a035 100644 --- a/netbox/ipam/forms/model_forms.py +++ b/netbox/ipam/forms/model_forms.py @@ -355,6 +355,15 @@ class IPAddressForm(TenancyForm, NetBoxModelForm): ): self.initial['primary_for_parent'] = True + if type(instance.assigned_object) is Interface: + self.fields['interface'].widget.add_query_params({ + 'device_id': instance.assigned_object.device.pk, + }) + elif type(instance.assigned_object) is VMInterface: + self.fields['vminterface'].widget.add_query_params({ + 'virtual_machine_id': instance.assigned_object.virtual_machine.pk, + }) + # Disable object assignment fields if the IP address is designated as primary if self.initial.get('primary_for_parent'): self.fields['interface'].disabled = True @@ -533,6 +542,24 @@ class FHRPGroupAssignmentForm(forms.ModelForm): for ipaddress in ipaddresses: self.fields['group'].widget.add_query_param('related_ip', ipaddress.pk) + def clean_group(self): + group = self.cleaned_data['group'] + + conflicting_assignments = FHRPGroupAssignment.objects.filter( + interface_type=self.instance.interface_type, + interface_id=self.instance.interface_id, + group=group + ) + if self.instance.id: + conflicting_assignments = conflicting_assignments.exclude(id=self.instance.id) + + if conflicting_assignments.exists(): + raise forms.ValidationError( + _('Assignment already exists') + ) + + return group + class VLANGroupForm(NetBoxModelForm): scope_type = ContentTypeChoiceField( diff --git a/netbox/ipam/graphql/types.py b/netbox/ipam/graphql/types.py index 6c269721e..36e09eaac 100644 --- a/netbox/ipam/graphql/types.py +++ b/netbox/ipam/graphql/types.py @@ -133,7 +133,7 @@ class IPAddressType(NetBoxObjectType, BaseIPAddressFamilyType): Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')], Annotated["FHRPGroupType", strawberry.lazy('ipam.graphql.types')], Annotated["VMInterfaceType", strawberry.lazy('virtualization.graphql.types')], - ], strawberry.union("IPAddressAssignmentType")]: + ], strawberry.union("IPAddressAssignmentType")] | None: return self.assigned_object @@ -261,7 +261,7 @@ class VLANGroupType(OrganizationalObjectType): Annotated["RegionType", strawberry.lazy('dcim.graphql.types')], Annotated["SiteType", strawberry.lazy('dcim.graphql.types')], Annotated["SiteGroupType", strawberry.lazy('dcim.graphql.types')], - ], strawberry.union("VLANGroupScopeType")]: + ], strawberry.union("VLANGroupScopeType")] | None: return self.scope diff --git a/netbox/ipam/models/ip.py b/netbox/ipam/models/ip.py index 422c5ba37..0b8e3a8df 100644 --- a/netbox/ipam/models/ip.py +++ b/netbox/ipam/models/ip.py @@ -18,6 +18,7 @@ from ipam.querysets import PrefixQuerySet from ipam.validators import DNSValidator from netbox.config import get_config from netbox.models import OrganizationalModel, PrimaryModel +from netbox.models.features import ContactsMixin __all__ = ( 'Aggregate', @@ -74,7 +75,7 @@ class RIR(OrganizationalModel): return reverse('ipam:rir', args=[self.pk]) -class Aggregate(GetAvailablePrefixesMixin, PrimaryModel): +class Aggregate(ContactsMixin, GetAvailablePrefixesMixin, PrimaryModel): """ An aggregate exists at the root level of the IP address space hierarchy in NetBox. Aggregates are used to organize the hierarchy and track the overall utilization of available address space. Each Aggregate is assigned to a RIR. @@ -206,7 +207,7 @@ class Role(OrganizationalModel): return reverse('ipam:role', args=[self.pk]) -class Prefix(GetAvailablePrefixesMixin, PrimaryModel): +class Prefix(ContactsMixin, GetAvailablePrefixesMixin, PrimaryModel): """ A Prefix represents an IPv4 or IPv6 network, including mask length. Prefixes can optionally be assigned to Sites and VRFs. A Prefix must be assigned a status and may optionally be assigned a used-define Role. A Prefix can also be @@ -486,7 +487,7 @@ class Prefix(GetAvailablePrefixesMixin, PrimaryModel): return min(utilization, 100) -class IPRange(PrimaryModel): +class IPRange(ContactsMixin, PrimaryModel): """ A range of IP addresses, defined by start and end addresses. """ @@ -574,7 +575,7 @@ class IPRange(PrimaryModel): if not self.end_address > self.start_address: raise ValidationError({ 'end_address': _( - "Ending address must be lower than the starting address ({start_address})" + "Ending address must be greater than the starting address ({start_address})" ).format(start_address=self.start_address) }) @@ -692,10 +693,10 @@ class IPRange(PrimaryModel): ip.address.ip for ip in self.get_child_ips() ]).size - return int(float(child_count) / self.size * 100) + return min(float(child_count) / self.size * 100, 100) -class IPAddress(PrimaryModel): +class IPAddress(ContactsMixin, PrimaryModel): """ An IPAddress represents an individual IPv4 or IPv6 address and its mask. The mask length should match what is configured in the real world. (Typically, only loopback interfaces are configured with /32 or /128 masks.) Like diff --git a/netbox/ipam/models/services.py b/netbox/ipam/models/services.py index 37b559801..71f34c66c 100644 --- a/netbox/ipam/models/services.py +++ b/netbox/ipam/models/services.py @@ -8,6 +8,7 @@ from django.utils.translation import gettext_lazy as _ from ipam.choices import * from ipam.constants import * from netbox.models import PrimaryModel +from netbox.models.features import ContactsMixin from utilities.data import array_to_string __all__ = ( @@ -62,7 +63,7 @@ class ServiceTemplate(ServiceBase, PrimaryModel): return reverse('ipam:servicetemplate', args=[self.pk]) -class Service(ServiceBase, PrimaryModel): +class Service(ContactsMixin, ServiceBase, PrimaryModel): """ A Service represents a layer-four service (e.g. HTTP or SSH) running on a Device or VirtualMachine. A Service may optionally be tied to one or more specific IPAddresses belonging to its parent. diff --git a/netbox/ipam/tables/ip.py b/netbox/ipam/tables/ip.py index 9e940ae9e..10dea3a92 100644 --- a/netbox/ipam/tables/ip.py +++ b/netbox/ipam/tables/ip.py @@ -378,7 +378,7 @@ class IPAddressTable(TenancyColumnsMixin, NetBoxTable): orderable=False, verbose_name=_('NAT (Inside)') ) - nat_outside = tables.ManyToManyColumn( + nat_outside = columns.ManyToManyColumn( linkify_item=True, orderable=False, verbose_name=_('NAT (Outside)') diff --git a/netbox/ipam/tests/test_api.py b/netbox/ipam/tests/test_api.py index 16ee7bbf0..2cf7a2f1c 100644 --- a/netbox/ipam/tests/test_api.py +++ b/netbox/ipam/tests/test_api.py @@ -648,6 +648,9 @@ class IPAddressTest(APIViewTestCases.APIViewTestCase): bulk_update_data = { 'description': 'New description', } + graphql_filter = { + 'address': {'lookup': 'i_exact', 'value': '192.168.0.1/24'}, + } @classmethod def setUpTestData(cls): diff --git a/netbox/ipam/tests/test_filtersets.py b/netbox/ipam/tests/test_filtersets.py index 3a46423a5..8f07a241a 100644 --- a/netbox/ipam/tests/test_filtersets.py +++ b/netbox/ipam/tests/test_filtersets.py @@ -1525,8 +1525,8 @@ class VLANGroupTestCase(TestCase, ChangeLoggedFilterSetTests): params = {'region': Region.objects.first().pk} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) - def test_sitegroup(self): - params = {'sitegroup': SiteGroup.objects.first().pk} + def test_site_group(self): + params = {'site_group': SiteGroup.objects.first().pk} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) def test_site(self): @@ -1541,8 +1541,8 @@ class VLANGroupTestCase(TestCase, ChangeLoggedFilterSetTests): params = {'rack': Rack.objects.first().pk} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) - def test_clustergroup(self): - params = {'clustergroup': ClusterGroup.objects.first().pk} + def test_cluster_group(self): + params = {'cluster_group': ClusterGroup.objects.first().pk} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) def test_cluster(self): diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index 24d82d186..f94c3c6d7 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -9,6 +9,7 @@ from circuits.models import Provider from dcim.filtersets import InterfaceFilterSet from dcim.models import Interface, Site from netbox.views import generic +from tenancy.views import ObjectContactsView from utilities.query import count_related from utilities.tables import get_table_ordering from utilities.views import ViewTab, register_model_view @@ -214,7 +215,6 @@ class ASNRangeASNsView(generic.ObjectChildrenView): child_model = ASN table = tables.ASNTable filterset = filtersets.ASNFilterSet - template_name = 'generic/object_children.html' tab = ViewTab( label=_('ASNs'), badge=lambda x: x.get_child_asns().count(), @@ -406,6 +406,11 @@ class AggregateBulkDeleteView(generic.BulkDeleteView): table = tables.AggregateTable +@register_model_view(Aggregate, 'contacts') +class AggregateContactsView(ObjectContactsView): + queryset = Aggregate.objects.all() + + # # Prefix/VLAN roles # @@ -644,6 +649,11 @@ class PrefixBulkDeleteView(generic.BulkDeleteView): table = tables.PrefixTable +@register_model_view(Prefix, 'contacts') +class PrefixContactsView(ObjectContactsView): + queryset = Prefix.objects.all() + + # # IP Ranges # @@ -727,6 +737,11 @@ class IPRangeBulkDeleteView(generic.BulkDeleteView): table = tables.IPRangeTable +@register_model_view(IPRange, 'contacts') +class IPRangeContactsView(ObjectContactsView): + queryset = IPRange.objects.all() + + # # IP addresses # @@ -781,6 +796,7 @@ class IPAddressView(generic.ObjectView): class IPAddressEditView(generic.ObjectEditView): queryset = IPAddress.objects.all() form = forms.IPAddressForm + template_name = 'ipam/ipaddress_edit.html' def alter_object(self, obj, request, url_args, url_kwargs): @@ -882,7 +898,6 @@ class IPAddressRelatedIPsView(generic.ObjectChildrenView): child_model = IPAddress table = tables.IPAddressTable filterset = filtersets.IPAddressFilterSet - template_name = 'generic/object_children.html' tab = ViewTab( label=_('Related IPs'), badge=lambda x: x.get_related_ips().count(), @@ -894,6 +909,11 @@ class IPAddressRelatedIPsView(generic.ObjectChildrenView): return parent.get_related_ips().restrict(request.user, 'view') +@register_model_view(IPAddress, 'contacts') +class IPAddressContactsView(ObjectContactsView): + queryset = IPAddress.objects.all() + + # # VLAN groups # @@ -954,7 +974,6 @@ class VLANGroupVLANsView(generic.ObjectChildrenView): child_model = VLAN table = tables.VLANTable filterset = filtersets.VLANFilterSet - template_name = 'generic/object_children.html' tab = ViewTab( label=_('VLANs'), badge=lambda x: x.get_child_vlans().count(), @@ -1110,7 +1129,6 @@ class VLANInterfacesView(generic.ObjectChildrenView): child_model = Interface table = tables.VLANDevicesTable filterset = InterfaceFilterSet - template_name = 'generic/object_children.html' tab = ViewTab( label=_('Device Interfaces'), badge=lambda x: x.get_interfaces().count(), @@ -1128,7 +1146,6 @@ class VLANVMInterfacesView(generic.ObjectChildrenView): child_model = VMInterface table = tables.VLANVirtualMachinesTable filterset = VMInterfaceFilterSet - template_name = 'generic/object_children.html' tab = ViewTab( label=_('VM Interfaces'), badge=lambda x: x.get_vminterfaces().count(), @@ -1263,3 +1280,8 @@ class ServiceBulkDeleteView(generic.BulkDeleteView): queryset = Service.objects.prefetch_related('device', 'virtual_machine') filterset = filtersets.ServiceFilterSet table = tables.ServiceTable + + +@register_model_view(Service, 'contacts') +class ServiceContactsView(ObjectContactsView): + queryset = Service.objects.all() diff --git a/netbox/netbox/api/views.py b/netbox/netbox/api/views.py index cfbe82f14..d58d1affe 100644 --- a/netbox/netbox/api/views.py +++ b/netbox/netbox/api/views.py @@ -66,7 +66,7 @@ class StatusView(APIView): return Response({ 'django-version': DJANGO_VERSION, 'installed-apps': installed_apps, - 'netbox-version': settings.VERSION, + 'netbox-version': settings.RELEASE.full_version, 'plugins': get_installed_plugins(), 'python-version': platform.python_version(), 'rq-workers-running': Worker.count(get_connection('default')), diff --git a/netbox/netbox/authentication.py b/netbox/netbox/authentication/__init__.py similarity index 98% rename from netbox/netbox/authentication.py rename to netbox/netbox/authentication/__init__.py index 2b66639c8..55fd91d4d 100644 --- a/netbox/netbox/authentication.py +++ b/netbox/netbox/authentication/__init__.py @@ -14,6 +14,7 @@ from users.models import Group, ObjectPermission from utilities.permissions import ( permission_is_exempt, qs_filter_from_constraints, resolve_permission, resolve_permission_type, ) +from .misc import _mirror_groups UserModel = get_user_model() @@ -313,7 +314,7 @@ class RemoteUserBackend(_RemoteUserBackend): # Create a new instance of django-auth-ldap's LDAPBackend with our own ObjectPermissions try: - from django_auth_ldap.backend import LDAPBackend as LDAPBackend_ + from django_auth_ldap.backend import _LDAPUser, LDAPBackend as LDAPBackend_ class NBLDAPBackend(ObjectPermissionMixin, LDAPBackend_): def get_permission_filter(self, user_obj): @@ -323,6 +324,10 @@ try: hasattr(user_obj.ldap_user, "group_names")): permission_filter = permission_filter | Q(groups__name__in=user_obj.ldap_user.group_names) return permission_filter + + # Patch with our modified _mirror_groups() method to support our custom Group model + _LDAPUser._mirror_groups = _mirror_groups + except ModuleNotFoundError: pass diff --git a/netbox/netbox/authentication/misc.py b/netbox/netbox/authentication/misc.py new file mode 100644 index 000000000..fe89b8e39 --- /dev/null +++ b/netbox/netbox/authentication/misc.py @@ -0,0 +1,67 @@ +# Copyright (c) 2009, Peter Sagerson +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +from users.models import Group + + +# Copied from django_auth_ldap.backend._LDAPUser and modified to support our +# custom Group model. +def _mirror_groups(self): + """ + Mirrors the user's LDAP groups in the Django database and updates the + user's membership. + """ + target_group_names = frozenset(self._get_groups().get_group_names()) + current_group_names = frozenset( + self._user.groups.values_list("name", flat=True).iterator() + ) + + # These were normalized to sets above. + MIRROR_GROUPS_EXCEPT = self.settings.MIRROR_GROUPS_EXCEPT + MIRROR_GROUPS = self.settings.MIRROR_GROUPS + + # If the settings are white- or black-listing groups, we'll update + # target_group_names such that we won't modify the membership of groups + # beyond our purview. + if isinstance(MIRROR_GROUPS_EXCEPT, (set, frozenset)): + target_group_names = (target_group_names - MIRROR_GROUPS_EXCEPT) | ( + current_group_names & MIRROR_GROUPS_EXCEPT + ) + elif isinstance(MIRROR_GROUPS, (set, frozenset)): + target_group_names = (target_group_names & MIRROR_GROUPS) | ( + current_group_names - MIRROR_GROUPS + ) + + if target_group_names != current_group_names: + existing_groups = list( + Group.objects.filter(name__in=target_group_names).iterator() + ) + existing_group_names = frozenset(group.name for group in existing_groups) + + new_groups = [ + Group.objects.get_or_create(name=name)[0] + for name in target_group_names + if name not in existing_group_names + ] + + self._user.groups.set(existing_groups + new_groups) diff --git a/netbox/netbox/configuration_example.py b/netbox/netbox/configuration_example.py index f415ca42f..84ead5339 100644 --- a/netbox/netbox/configuration_example.py +++ b/netbox/netbox/configuration_example.py @@ -131,9 +131,6 @@ EMAIL = { 'FROM_EMAIL': '', } -# Localization -ENABLE_LOCALIZATION = False - # Exempt certain models from the enforcement of view permissions. Models listed here will be viewable by all users and # by anonymous users. List models in the form `.`. Add '*' to this list to exempt all models. EXEMPT_VIEW_PERMISSIONS = [ @@ -160,9 +157,8 @@ LOGGING = {} # authenticated to NetBox indefinitely. LOGIN_PERSISTENCE = False -# Setting this to True will permit only authenticated users to access any part of NetBox. By default, anonymous users -# are permitted to access most data in NetBox but not make any changes. -LOGIN_REQUIRED = False +# Setting this to False will permit unauthenticated users to access most areas of NetBox (but not make any changes). +LOGIN_REQUIRED = True # The length of time (in seconds) for which a user will remain logged into the web UI before being prompted to # re-authenticate. (Default: 1209600 [14 days]) @@ -237,12 +233,3 @@ SESSION_FILE_PATH = None # Time zone (default: UTC) TIME_ZONE = 'UTC' - -# Date/time formatting. See the following link for supported formats: -# https://docs.djangoproject.com/en/stable/ref/templates/builtins/#date -DATE_FORMAT = 'N j, Y' -SHORT_DATE_FORMAT = 'Y-m-d' -TIME_FORMAT = 'g:i a' -SHORT_TIME_FORMAT = 'H:i:s' -DATETIME_FORMAT = 'N j, Y g:i a' -SHORT_DATETIME_FORMAT = 'Y-m-d H:i' diff --git a/netbox/netbox/constants.py b/netbox/netbox/constants.py index 6a6928021..e797f4f29 100644 --- a/netbox/netbox/constants.py +++ b/netbox/netbox/constants.py @@ -41,3 +41,6 @@ DEFAULT_ACTION_PERMISSIONS = { # General-purpose tokens CENSOR_TOKEN = '********' CENSOR_TOKEN_CHANGED = '***CHANGED***' + +# Placeholder text for empty tables +EMPTY_TABLE_TEXT = 'No results found' diff --git a/netbox/netbox/context.py b/netbox/netbox/context.py index 56e41cb63..744c36df4 100644 --- a/netbox/netbox/context.py +++ b/netbox/netbox/context.py @@ -7,4 +7,4 @@ __all__ = ( current_request = ContextVar('current_request', default=None) -events_queue = ContextVar('events_queue', default=[]) +events_queue = ContextVar('events_queue', default=dict()) diff --git a/netbox/netbox/context_processors.py b/netbox/netbox/context_processors.py index ce4f8c45e..3065855e6 100644 --- a/netbox/netbox/context_processors.py +++ b/netbox/netbox/context_processors.py @@ -1,18 +1,50 @@ from django.conf import settings as django_settings from netbox.config import get_config -from netbox.registry import registry +from netbox.registry import registry as registry_ + +__all__ = ( + 'config', + 'preferences', + 'registry', + 'settings', +) -def settings_and_registry(request): +def config(request): """ - Expose Django settings and NetBox registry stores in the template context. Example: {{ settings.DEBUG }} + Adds NetBox configuration parameters to the template context. Example: {{ config.BANNER_LOGIN }} + """ + return { + 'config': get_config(), + } + + +def preferences(request): + """ + Adds preferences for the current user (if authenticated) to the template context. + Example: {{ preferences|get_key:"pagination.placement" }} """ user_preferences = request.user.config if request.user.is_authenticated else {} return { - 'settings': django_settings, - 'config': get_config(), - 'registry': registry, 'preferences': user_preferences, 'htmx_navigation': user_preferences.get('ui.htmx_navigation', False) == 'true' } + + +def registry(request): + """ + Adds NetBox registry items to the template context. Example: {{ registry.models.core }} + """ + return { + 'registry': registry_, + } + + +def settings(request): + """ + Adds Django settings to the template context. Example: {{ settings.DEBUG }} + """ + return { + 'settings': django_settings, + } diff --git a/netbox/netbox/forms/base.py b/netbox/netbox/forms/base.py index d177ce1d8..d59f61ef9 100644 --- a/netbox/netbox/forms/base.py +++ b/netbox/netbox/forms/base.py @@ -1,3 +1,5 @@ +import json + from django import forms from django.contrib.contenttypes.models import ContentType from django.db.models import Q @@ -35,7 +37,11 @@ class NetBoxModelForm(CheckLastUpdatedMixin, CustomFieldsMixin, TagsMixin, forms def _get_form_field(self, customfield): if self.instance.pk: form_field = customfield.to_form_field(set_initial=False) - form_field.initial = self.instance.custom_field_data.get(customfield.name, None) + initial = self.instance.custom_field_data.get(customfield.name) + if customfield.type == CustomFieldTypeChoices.TYPE_JSON: + form_field.initial = json.dumps(initial) + else: + form_field.initial = initial return form_field return customfield.to_form_field() @@ -74,17 +80,12 @@ class NetBoxModelImportForm(CSVModelForm, NetBoxModelForm): """ Base form for creating a NetBox objects from CSV data. Used for bulk importing. """ - id = forms.IntegerField( - label=_('Id'), - required=False, - help_text='Numeric ID of an existing object to update (if not creating a new object)' - ) tags = CSVModelMultipleChoiceField( label=_('Tags'), queryset=Tag.objects.all(), required=False, to_field_name='slug', - help_text='Tag slugs separated by commas, encased with double quotes (e.g. "tag1,tag2,tag3")' + help_text=_('Tag slugs separated by commas, encased with double quotes (e.g. "tag1,tag2,tag3")') ) def _get_custom_fields(self, content_type): diff --git a/netbox/netbox/graphql/filter_mixins.py b/netbox/netbox/graphql/filter_mixins.py index 3103b06c6..5075e9aa2 100644 --- a/netbox/netbox/graphql/filter_mixins.py +++ b/netbox/netbox/graphql/filter_mixins.py @@ -4,6 +4,7 @@ from typing import List import django_filters import strawberry import strawberry_django +from django.core.exceptions import FieldDoesNotExist from strawberry import auto from ipam.fields import ASNField from netbox.graphql.scalars import BigInt @@ -22,8 +23,9 @@ def map_strawberry_type(field): elif isinstance(field, MultiValueArrayFilter): pass elif isinstance(field, MultiValueCharFilter): - should_create_function = True - attr_type = List[str] | None + # Note: Need to use the legacy FilterLookup from filters, not from + # strawberry_django.FilterLookup as we currently have USE_DEPRECATED_FILTERS + attr_type = strawberry_django.filters.FilterLookup[str] | None elif isinstance(field, MultiValueDateFilter): attr_type = auto elif isinstance(field, MultiValueDateTimeFilter): @@ -86,7 +88,7 @@ def map_strawberry_type(field): pass elif issubclass(type(field), django_filters.NumberFilter): should_create_function = True - attr_type = int + attr_type = int | None elif issubclass(type(field), django_filters.ModelMultipleChoiceFilter): should_create_function = True attr_type = List[str] | None @@ -164,7 +166,11 @@ def autotype_decorator(filterset): should_create_function = False attr_type = auto if fieldname not in cls.__annotations__: - field = model._meta.get_field(fieldname) + try: + field = model._meta.get_field(fieldname) + except FieldDoesNotExist: + continue + if isinstance(field, CounterCacheField): should_create_function = True attr_type = BigInt | None diff --git a/netbox/netbox/navigation/__init__.py b/netbox/netbox/navigation/__init__.py index d13282f7e..b4f7dbd9f 100644 --- a/netbox/netbox/navigation/__init__.py +++ b/netbox/netbox/navigation/__init__.py @@ -32,6 +32,7 @@ class MenuItem: link: str link_text: str permissions: Optional[Sequence[str]] = () + auth_required: Optional[bool] = False staff_only: Optional[bool] = False buttons: Optional[Sequence[MenuItemButton]] = () diff --git a/netbox/netbox/navigation/menu.py b/netbox/netbox/navigation/menu.py index 688c5a3ad..002dfd98a 100644 --- a/netbox/netbox/navigation/menu.py +++ b/netbox/netbox/navigation/menu.py @@ -101,7 +101,7 @@ CONNECTIONS_MENU = Menu( MenuGroup( label=_('Connections'), items=( - get_model_item('dcim', 'cable', _('Cables'), actions=['import']), + get_model_item('dcim', 'cable', _('Cables')), get_model_item('wireless', 'wirelesslink', _('Wireless Links')), MenuItem( link='dcim:interface_connections_list', @@ -258,6 +258,7 @@ CIRCUITS_MENU = Menu( items=( get_model_item('circuits', 'circuit', _('Circuits')), get_model_item('circuits', 'circuittype', _('Circuit Types')), + get_model_item('circuits', 'circuittermination', _('Circuit Terminations')), ), ), MenuGroup( @@ -368,93 +369,80 @@ ADMIN_MENU = Menu( MenuGroup( label=_('Authentication'), items=( - # Proxy model for auth.User MenuItem( link=f'users:user_list', link_text=_('Users'), - permissions=[f'auth.view_user'], - staff_only=True, + auth_required=True, + permissions=[f'users.view_user'], buttons=( MenuItemButton( link=f'users:user_add', title='Add', icon_class='mdi mdi-plus-thick', - permissions=[f'auth.add_user'] + permissions=[f'users.add_user'] ), MenuItemButton( link=f'users:user_import', title='Import', icon_class='mdi mdi-upload', - permissions=[f'auth.add_user'] + permissions=[f'users.add_user'] ) ) ), - # Proxy model for auth.Group MenuItem( link=f'users:group_list', link_text=_('Groups'), - permissions=[f'auth.view_group'], - staff_only=True, + auth_required=True, + permissions=[f'users.view_group'], buttons=( MenuItemButton( link=f'users:group_add', title='Add', icon_class='mdi mdi-plus-thick', - permissions=[f'auth.add_group'] + permissions=[f'users.add_group'] ), MenuItemButton( link=f'users:group_import', title='Import', icon_class='mdi mdi-upload', - permissions=[f'auth.add_group'] + permissions=[f'users.add_group'] ) ) ), MenuItem( link=f'users:token_list', link_text=_('API Tokens'), + auth_required=True, permissions=[f'users.view_token'], - staff_only=True, buttons=get_model_buttons('users', 'token') ), MenuItem( link=f'users:objectpermission_list', link_text=_('Permissions'), + auth_required=True, permissions=[f'users.view_objectpermission'], - staff_only=True, buttons=get_model_buttons('users', 'objectpermission', actions=['add']) ), ), ), - MenuGroup( - label=_('Configuration'), - items=( - MenuItem( - link='core:config', - link_text=_('Current Config'), - permissions=['core.view_configrevision'], - staff_only=True - ), - MenuItem( - link='core:configrevision_list', - link_text=_('Config Revisions'), - permissions=['core.view_configrevision'], - staff_only=True - ), - ), - ), MenuGroup( label=_('System'), items=( MenuItem( - link='core:plugin_list', - link_text=_('Plugins'), - staff_only=True + link='core:system', + link_text=_('System'), + auth_required=True + ), + MenuItem( + link='core:configrevision_list', + link_text=_('Configuration History'), + auth_required=True, + permissions=['core.view_configrevision'] ), MenuItem( link='core:background_queue_list', link_text=_('Background Tasks'), - staff_only=True + auth_required=True ), ), ), diff --git a/netbox/netbox/plugins/__init__.py b/netbox/netbox/plugins/__init__.py index 8db945e74..e2f0f22fc 100644 --- a/netbox/netbox/plugins/__init__.py +++ b/netbox/netbox/plugins/__init__.py @@ -138,13 +138,15 @@ class PluginConfig(AppConfig): min_version = version.parse(cls.min_version) if current_version < min_version: raise ImproperlyConfigured( - f"Plugin {cls.__module__} requires NetBox minimum version {cls.min_version}." + f"Plugin {cls.__module__} requires NetBox minimum version {cls.min_version} (current: " + f"{netbox_version})." ) if cls.max_version is not None: max_version = version.parse(cls.max_version) if current_version > max_version: raise ImproperlyConfigured( - f"Plugin {cls.__module__} requires NetBox maximum version {cls.max_version}." + f"Plugin {cls.__module__} requires NetBox maximum version {cls.max_version} (current: " + f"{netbox_version})." ) # Verify required configuration settings diff --git a/netbox/netbox/plugins/registration.py b/netbox/netbox/plugins/registration.py index d27bb67ca..fbece12e5 100644 --- a/netbox/netbox/plugins/registration.py +++ b/netbox/netbox/plugins/registration.py @@ -32,21 +32,13 @@ def register_template_extensions(class_list): template_extension=template_extension ) ) - if template_extension.model is None: - raise TypeError( - _("PluginTemplateExtension class {template_extension} does not define a valid model!").format( - template_extension=template_extension - ) - ) registry['plugins']['template_extensions'][template_extension.model].append(template_extension) def register_menu(menu): if not isinstance(menu, PluginMenu): - raise TypeError(_("{item} must be an instance of netbox.plugins.PluginMenuItem").format( - item=menu_link - )) + raise TypeError(_("{item} must be an instance of netbox.plugins.PluginMenuItem").format(item=menu)) registry['plugins']['menus'].append(menu) diff --git a/netbox/netbox/plugins/templates.py b/netbox/netbox/plugins/templates.py index 85229dbaf..ccd549160 100644 --- a/netbox/netbox/plugins/templates.py +++ b/netbox/netbox/plugins/templates.py @@ -14,7 +14,8 @@ class PluginTemplateExtension: The `model` attribute on the class defines the which model detail page this class renders content for. It should be set as a string in the form '.'. render() provides the following context data: - * object - The object being viewed + * object - The object being viewed (object views only) + * model - The type of object being viewed (list views only) * request - The current request * settings - Global NetBox settings * config - Plugin-specific configuration parameters @@ -36,6 +37,13 @@ class PluginTemplateExtension: return get_template(template_name).render({**self.context, **extra_context}) + def navbar(self): + """ + Content that will be rendered inside the top navigation menu. Content should be returned as an HTML + string. Note that content does not need to be marked as safe because this is automatically handled. + """ + raise NotImplementedError + def left_page(self): """ Content that will be rendered on the left of the detail page view. Content should be returned as an diff --git a/netbox/netbox/preferences.py b/netbox/netbox/preferences.py index 1414ea850..d911aabb0 100644 --- a/netbox/netbox/preferences.py +++ b/netbox/netbox/preferences.py @@ -15,27 +15,27 @@ def get_page_lengths(): PREFERENCES = { # User interface - 'ui.colormode': UserPreference( - label=_('Color mode'), - choices=( - ('light', _('Light')), - ('dark', _('Dark')), - ), - default='light', - ), 'ui.htmx_navigation': UserPreference( label=_('HTMX Navigation'), choices=( ('', _('Disabled')), ('true', _('Enabled')), ), - default=False + description=_('Enable dynamic UI navigation'), + default=False, + warning=_('Experimental feature') ), 'locale.language': UserPreference( label=_('Language'), choices=( ('', _('Auto')), *settings.LANGUAGES, + ), + description=_('Forces UI translation to the specified language'), + warning=( + _("Support for translation has been disabled locally") + if not settings.TRANSLATION_ENABLED + else '' ) ), 'pagination.per_page': UserPreference( @@ -51,8 +51,8 @@ PREFERENCES = { ('top', _('Top')), ('both', _('Both')), ), - description=_('Where the paginator controls will be displayed relative to a table'), - default='bottom' + default='bottom', + description=_('Where the paginator controls will be displayed relative to a table') ), # Miscellaneous @@ -62,6 +62,7 @@ PREFERENCES = { ('json', 'JSON'), ('yaml', 'YAML'), ), + description=_('The preferred syntax for displaying generic data within the UI') ), } diff --git a/netbox/netbox/search/__init__.py b/netbox/netbox/search/__init__.py index 76898be13..a024f93ea 100644 --- a/netbox/netbox/search/__init__.py +++ b/netbox/netbox/search/__init__.py @@ -80,9 +80,10 @@ class SearchIndex: @staticmethod def get_field_value(instance, field_name): """ - Return the value of the specified model field as a string. + Return the value of the specified model field as a string (or None). """ - return str(getattr(instance, field_name)) + if value := getattr(instance, field_name): + return str(value) @classmethod def get_category(cls): diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 18feee262..40cfc3b39 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -18,13 +18,16 @@ from django.utils.translation import gettext_lazy as _ from netbox.config import PARAMS as CONFIG_PARAMS from netbox.constants import RQ_QUEUE_DEFAULT, RQ_QUEUE_HIGH, RQ_QUEUE_LOW from netbox.plugins import PluginConfig +from utilities.release import load_release_data from utilities.string import trailing_slash + # # Environment setup # -VERSION = '4.0-beta1' +RELEASE = load_release_data() +VERSION = RELEASE.full_version # Retained for backward compatibility HOSTNAME = platform.node() # Set the base directory two levels up BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -73,8 +76,6 @@ CSRF_COOKIE_SECURE = getattr(configuration, 'CSRF_COOKIE_SECURE', False) CSRF_TRUSTED_ORIGINS = getattr(configuration, 'CSRF_TRUSTED_ORIGINS', []) DATA_UPLOAD_MAX_MEMORY_SIZE = getattr(configuration, 'DATA_UPLOAD_MAX_MEMORY_SIZE', 2621440) DATABASE = getattr(configuration, 'DATABASE') # Required -DATE_FORMAT = getattr(configuration, 'DATE_FORMAT', 'N j, Y') -DATETIME_FORMAT = getattr(configuration, 'DATETIME_FORMAT', 'N j, Y g:i a') DEBUG = getattr(configuration, 'DEBUG', False) DEFAULT_DASHBOARD = getattr(configuration, 'DEFAULT_DASHBOARD', None) DEFAULT_PERMISSIONS = getattr(configuration, 'DEFAULT_PERMISSIONS', { @@ -93,7 +94,6 @@ DEVELOPER = getattr(configuration, 'DEVELOPER', False) DJANGO_ADMIN_ENABLED = getattr(configuration, 'DJANGO_ADMIN_ENABLED', False) DOCS_ROOT = getattr(configuration, 'DOCS_ROOT', os.path.join(os.path.dirname(BASE_DIR), 'docs')) EMAIL = getattr(configuration, 'EMAIL', {}) -ENABLE_LOCALIZATION = getattr(configuration, 'ENABLE_LOCALIZATION', False) EVENTS_PIPELINE = getattr(configuration, 'EVENTS_PIPELINE', ( 'extras.events.process_event_queue', )) @@ -107,7 +107,7 @@ LANGUAGE_CODE = getattr(configuration, 'DEFAULT_LANGUAGE', 'en-us') LANGUAGE_COOKIE_PATH = CSRF_COOKIE_PATH LOGGING = getattr(configuration, 'LOGGING', {}) LOGIN_PERSISTENCE = getattr(configuration, 'LOGIN_PERSISTENCE', False) -LOGIN_REQUIRED = getattr(configuration, 'LOGIN_REQUIRED', False) +LOGIN_REQUIRED = getattr(configuration, 'LOGIN_REQUIRED', True) LOGIN_TIMEOUT = getattr(configuration, 'LOGIN_TIMEOUT', None) LOGOUT_REDIRECT_URL = getattr(configuration, 'LOGOUT_REDIRECT_URL', 'home') MEDIA_ROOT = getattr(configuration, 'MEDIA_ROOT', os.path.join(BASE_DIR, 'media')).rstrip('/') @@ -142,6 +142,9 @@ RQ_RETRY_MAX = getattr(configuration, 'RQ_RETRY_MAX', 0) SCRIPTS_ROOT = getattr(configuration, 'SCRIPTS_ROOT', os.path.join(BASE_DIR, 'scripts')).rstrip('/') SEARCH_BACKEND = getattr(configuration, 'SEARCH_BACKEND', 'netbox.search.backends.CachedValueSearchBackend') SECRET_KEY = getattr(configuration, 'SECRET_KEY') # Required +SECURE_HSTS_INCLUDE_SUBDOMAINS = getattr(configuration, 'SECURE_HSTS_INCLUDE_SUBDOMAINS', False) +SECURE_HSTS_PRELOAD = getattr(configuration, 'SECURE_HSTS_PRELOAD', False) +SECURE_HSTS_SECONDS = getattr(configuration, 'SECURE_HSTS_SECONDS', 0) SECURE_SSL_REDIRECT = getattr(configuration, 'SECURE_SSL_REDIRECT', False) SENTRY_DSN = getattr(configuration, 'SENTRY_DSN', None) SENTRY_ENABLED = getattr(configuration, 'SENTRY_ENABLED', False) @@ -152,13 +155,10 @@ SESSION_COOKIE_NAME = getattr(configuration, 'SESSION_COOKIE_NAME', 'sessionid') SESSION_COOKIE_PATH = CSRF_COOKIE_PATH SESSION_COOKIE_SECURE = getattr(configuration, 'SESSION_COOKIE_SECURE', False) SESSION_FILE_PATH = getattr(configuration, 'SESSION_FILE_PATH', None) -SHORT_DATE_FORMAT = getattr(configuration, 'SHORT_DATE_FORMAT', 'Y-m-d') -SHORT_DATETIME_FORMAT = getattr(configuration, 'SHORT_DATETIME_FORMAT', 'Y-m-d H:i') -SHORT_TIME_FORMAT = getattr(configuration, 'SHORT_TIME_FORMAT', 'H:i:s') STORAGE_BACKEND = getattr(configuration, 'STORAGE_BACKEND', None) STORAGE_CONFIG = getattr(configuration, 'STORAGE_CONFIG', {}) -TIME_FORMAT = getattr(configuration, 'TIME_FORMAT', 'g:i a') TIME_ZONE = getattr(configuration, 'TIME_ZONE', 'UTC') +TRANSLATION_ENABLED = getattr(configuration, 'TRANSLATION_ENABLED', True) # Load any dynamic configuration parameters which have been hard-coded in the configuration file for param in CONFIG_PARAMS: @@ -244,6 +244,7 @@ if 'tasks' not in REDIS: TASKS_REDIS = REDIS['tasks'] TASKS_REDIS_HOST = TASKS_REDIS.get('HOST', 'localhost') TASKS_REDIS_PORT = TASKS_REDIS.get('PORT', 6379) +TASKS_REDIS_URL = TASKS_REDIS.get('URL') TASKS_REDIS_SENTINELS = TASKS_REDIS.get('SENTINELS', []) TASKS_REDIS_USING_SENTINEL = all([ isinstance(TASKS_REDIS_SENTINELS, (list, tuple)), @@ -272,7 +273,7 @@ CACHING_REDIS_SENTINEL_SERVICE = REDIS['caching'].get('SENTINEL_SERVICE', 'defau CACHING_REDIS_PROTO = 'rediss' if REDIS['caching'].get('SSL', False) else 'redis' CACHING_REDIS_SKIP_TLS_VERIFY = REDIS['caching'].get('INSECURE_SKIP_TLS_VERIFY', False) CACHING_REDIS_CA_CERT_PATH = REDIS['caching'].get('CA_CERT_PATH', False) -CACHING_REDIS_URL = f'{CACHING_REDIS_PROTO}://{CACHING_REDIS_USERNAME_HOST}:{CACHING_REDIS_PORT}/{CACHING_REDIS_DATABASE}' +CACHING_REDIS_URL = REDIS['caching'].get('URL', f'{CACHING_REDIS_PROTO}://{CACHING_REDIS_USERNAME_HOST}:{CACHING_REDIS_PORT}/{CACHING_REDIS_DATABASE}') # Configure Django's default cache to use Redis CACHES = { @@ -369,13 +370,14 @@ INSTALLED_APPS = [ 'drf_spectacular', 'drf_spectacular_sidecar', ] +if not DEBUG: + INSTALLED_APPS.remove('debug_toolbar') if not DJANGO_ADMIN_ENABLED: INSTALLED_APPS.remove('django.contrib.admin') # Middleware MIDDLEWARE = [ "strawberry_django.middlewares.debug_toolbar.DebugToolbarMiddleware", - 'django_prometheus.middleware.PrometheusBeforeMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', @@ -389,10 +391,14 @@ MIDDLEWARE = [ 'netbox.middleware.RemoteUserMiddleware', 'netbox.middleware.CoreMiddleware', 'netbox.middleware.MaintenanceModeMiddleware', - 'django_prometheus.middleware.PrometheusAfterMiddleware', ] -if not ENABLE_LOCALIZATION: - MIDDLEWARE.remove('django.middleware.locale.LocaleMiddleware') +if METRICS_ENABLED: + # If metrics are enabled, add the before & after Prometheus middleware + MIDDLEWARE = [ + 'django_prometheus.middleware.PrometheusBeforeMiddleware', + *MIDDLEWARE, + 'django_prometheus.middleware.PrometheusAfterMiddleware', + ] # URLs ROOT_URLCONF = 'netbox.urls' @@ -415,7 +421,10 @@ TEMPLATES = [ 'django.template.context_processors.media', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', - 'netbox.context_processors.settings_and_registry', + 'netbox.context_processors.settings', + 'netbox.context_processors.config', + 'netbox.context_processors.registry', + 'netbox.context_processors.preferences', ], }, }, @@ -442,6 +451,9 @@ LOGIN_REDIRECT_URL = f'/{BASE_PATH}' # Use timezone-aware datetime objects USE_TZ = True +# Toggle language translation support +USE_I18N = TRANSLATION_ENABLED + # WSGI WSGI_APPLICATION = 'netbox.wsgi.application' SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') @@ -483,11 +495,11 @@ SERIALIZATION_MODULES = { # Exclude potentially sensitive models from wildcard view exemption. These may still be exempted # by specifying the model individually in the EXEMPT_VIEW_PERMISSIONS configuration parameter. EXEMPT_EXCLUDE_MODELS = ( - ('auth', 'group'), - ('auth', 'user'), ('extras', 'configrevision'), + ('users', 'group'), ('users', 'objectpermission'), ('users', 'token'), + ('users', 'user'), ) # All URLs starting with a string listed here are exempt from login enforcement @@ -523,8 +535,7 @@ if SENTRY_ENABLED: # Initialize the SDK sentry_sdk.init( dsn=SENTRY_DSN, - release=VERSION, - integrations=[sentry_sdk.integrations.django.DjangoIntegration()], + release=RELEASE.full_version, sample_rate=SENTRY_SAMPLE_RATE, traces_sample_rate=SENTRY_TRACES_SAMPLE_RATE, send_default_pii=True, @@ -544,7 +555,7 @@ if SENTRY_ENABLED: DEPLOYMENT_ID = hashlib.sha256(SECRET_KEY.encode('utf-8')).hexdigest()[:16] CENSUS_URL = 'https://census.netbox.dev/api/v1/' CENSUS_PARAMS = { - 'version': VERSION, + 'version': RELEASE.full_version, 'python_version': sys.version.split()[0], 'deployment_id': DEPLOYMENT_ID, } @@ -602,7 +613,7 @@ FILTERS_NULL_CHOICE_VALUE = 'null' # Django REST framework (API) # -REST_FRAMEWORK_VERSION = '.'.join(VERSION.split('-')[0].split('.')[:2]) # Use major.minor as API version +REST_FRAMEWORK_VERSION = '.'.join(RELEASE.version.split('-')[0].split('.')[:2]) # Use major.minor as API version REST_FRAMEWORK = { 'ALLOWED_VERSIONS': [REST_FRAMEWORK_VERSION], 'COERCE_DECIMAL_TO_STRING': False, @@ -647,7 +658,7 @@ REST_FRAMEWORK = { SPECTACULAR_SETTINGS = { 'TITLE': 'NetBox REST API', 'LICENSE': {'name': 'Apache v2 License'}, - 'VERSION': VERSION, + 'VERSION': RELEASE.full_version, 'COMPONENT_SPLIT_REQUEST': True, 'REDOC_DIST': 'SIDECAR', 'SERVERS': [{ @@ -672,6 +683,12 @@ if TASKS_REDIS_USING_SENTINEL: 'socket_connect_timeout': TASKS_REDIS_SENTINEL_TIMEOUT }, } +elif TASKS_REDIS_URL: + RQ_PARAMS = { + 'URL': TASKS_REDIS_URL, + 'SSL': TASKS_REDIS_SSL, + 'SSL_CERT_REQS': None if TASKS_REDIS_SKIP_TLS_VERIFY else 'required', + } else: RQ_PARAMS = { 'HOST': TASKS_REDIS_HOST, @@ -706,6 +723,7 @@ RQ_QUEUES.update({ # Supported translation languages LANGUAGES = ( + ('de', _('German')), ('en', _('English')), ('es', _('Spanish')), ('fr', _('French')), @@ -713,18 +731,19 @@ LANGUAGES = ( ('pt', _('Portuguese')), ('ru', _('Russian')), ('tr', _('Turkish')), + ('uk', _('Ukrainian')), + ('zh', _('Chinese')), ) LOCALE_PATHS = ( BASE_DIR + '/translations', ) -if not ENABLE_LOCALIZATION: - USE_I18N = False # # Strawberry (GraphQL) # STRAWBERRY_DJANGO = { "TYPE_DESCRIPTION_FROM_MODEL_DOCSTRING": True, + "USE_DEPRECATED_FILTERS": True, } # @@ -785,7 +804,7 @@ for plugin_name in PLUGINS: # Validate user-provided configuration settings and assign defaults if plugin_name not in PLUGINS_CONFIG: PLUGINS_CONFIG[plugin_name] = {} - plugin_config.validate(PLUGINS_CONFIG[plugin_name], VERSION) + plugin_config.validate(PLUGINS_CONFIG[plugin_name], RELEASE.version) # Add middleware plugin_middleware = plugin_config.middleware @@ -800,3 +819,10 @@ for plugin_name in PLUGINS: RQ_QUEUES.update({ f"{plugin_name}.{queue}": RQ_PARAMS for queue in plugin_config.queues }) + +# UNSUPPORTED FUNCTIONALITY: Import any local overrides. +try: + from .local_settings import * + _UNSUPPORTED_SETTINGS = True +except ImportError: + pass diff --git a/netbox/netbox/tables/columns.py b/netbox/netbox/tables/columns.py index 193bf8a17..c37bb1b0d 100644 --- a/netbox/netbox/tables/columns.py +++ b/netbox/netbox/tables/columns.py @@ -10,7 +10,6 @@ from django.db.models import DateField, DateTimeField from django.template import Context, Template from django.urls import reverse from django.utils.dateparse import parse_date -from django.utils.formats import date_format from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ @@ -52,18 +51,17 @@ __all__ = ( # @library.register -class DateColumn(tables.DateColumn): +class DateColumn(tables.Column): """ - Overrides the default implementation of DateColumn to better handle null values, returning a default value for - tables and null when exporting data. It is registered in the tables library to use this class instead of the - default, making this behavior consistent in all fields of type DateField. + Render a datetime.date in ISO 8601 format. """ def render(self, value): if value: - return date_format(value, format="SHORT_DATE_FORMAT") + return value.isoformat() def value(self, value): - return value + if value: + return value.isoformat() @classmethod def from_field(cls, field, **kwargs): @@ -72,16 +70,24 @@ class DateColumn(tables.DateColumn): @library.register -class DateTimeColumn(tables.DateTimeColumn): +class DateTimeColumn(tables.Column): """ - Overrides the default implementation of DateTimeColumn to better handle null values, returning a default value for - tables and null when exporting data. It is registered in the tables library to use this class instead of the - default, making this behavior consistent in all fields of type DateTimeField. + Render a datetime.datetime in ISO 8601 format. + + Args: + timespec: Granularity specification; passed through to datetime.isoformat() """ + def __init__(self, *args, timespec='seconds', **kwargs): + self.timespec = timespec + super().__init__(*args, **kwargs) + + def render(self, value): + if value: + return f"{value.date().isoformat()} {value.time().isoformat(timespec=self.timespec)}" + def value(self, value): if value: - return date_format(value, format="SHORT_DATETIME_FORMAT") - return None + return value.isoformat() @classmethod def from_field(cls, field, **kwargs): @@ -498,7 +504,7 @@ class CustomFieldColumn(tables.Column): if self.customfield.type == CustomFieldTypeChoices.TYPE_LONGTEXT and value: return render_markdown(value) if self.customfield.type == CustomFieldTypeChoices.TYPE_DATE and value: - return date_format(parse_date(value), format="SHORT_DATE_FORMAT") + return parse_date(value).isoformat() if value is not None: obj = self.customfield.deserialize(value) return mark_safe(self._linkify_item(obj)) diff --git a/netbox/netbox/tables/tables.py b/netbox/netbox/tables/tables.py index a87d66664..00e08d4c4 100644 --- a/netbox/netbox/tables/tables.py +++ b/netbox/netbox/tables/tables.py @@ -1,4 +1,5 @@ from copy import deepcopy +from functools import cached_property import django_tables2 as tables from django.contrib.auth.models import AnonymousUser @@ -14,6 +15,7 @@ from django_tables2.data import TableQuerysetData from core.models import ObjectType from extras.choices import * from extras.models import CustomField, CustomLink +from netbox.constants import EMPTY_TABLE_TEXT from netbox.registry import registry from netbox.tables import columns from utilities.paginator import EnhancedPaginator, get_paginate_count @@ -53,7 +55,7 @@ class BaseTable(tables.Table): # Set default empty_text if none was provided if self.empty_text is None: - self.empty_text = f"No {self._meta.model._meta.verbose_name_plural} found" + self.empty_text = _("No {model_name} found").format(model_name=self._meta.model._meta.verbose_name_plural) # Determine the table columns to display by checking the following: # 1. User's configuration for the table @@ -189,6 +191,7 @@ class NetBoxTable(BaseTable): actions = columns.ActionsColumn() exempt_columns = ('pk', 'actions') + embedded = False class Meta(BaseTable.Meta): pass @@ -218,12 +221,12 @@ class NetBoxTable(BaseTable): super().__init__(*args, extra_columns=extra_columns, **kwargs) - @property + @cached_property def htmx_url(self): """ Return the base HTML request URL for embedded tables. """ - if getattr(self, 'embedded', False): + if self.embedded: viewname = get_viewname(self._meta.model, action='list') try: return reverse(viewname) @@ -259,7 +262,7 @@ class SearchTable(tables.Table): attrs = { 'class': 'table table-hover object-list', } - empty_text = _('No results found') + empty_text = _(EMPTY_TABLE_TEXT) def __init__(self, data, highlight=None, **kwargs): self.highlight = highlight diff --git a/netbox/netbox/tests/dummy_plugin/template_content.py b/netbox/netbox/tests/dummy_plugin/template_content.py index b63338f2f..764faa60e 100644 --- a/netbox/netbox/tests/dummy_plugin/template_content.py +++ b/netbox/netbox/tests/dummy_plugin/template_content.py @@ -1,6 +1,12 @@ from netbox.plugins.templates import PluginTemplateExtension +class GlobalContent(PluginTemplateExtension): + + def navbar(self): + return "GLOBAL CONTENT - NAVBAR" + + class SiteContent(PluginTemplateExtension): model = 'dcim.site' @@ -20,4 +26,4 @@ class SiteContent(PluginTemplateExtension): return "SITE CONTENT - LIST BUTTONS" -template_extensions = [SiteContent] +template_extensions = [GlobalContent, SiteContent] diff --git a/netbox/netbox/tests/test_plugins.py b/netbox/netbox/tests/test_plugins.py index 24bc53005..351fef9e2 100644 --- a/netbox/netbox/tests/test_plugins.py +++ b/netbox/netbox/tests/test_plugins.py @@ -42,6 +42,7 @@ class PluginTest(TestCase): url = reverse('admin:dummy_plugin_dummymodel_add') self.assertEqual(url, '/admin/dummy_plugin/dummymodel/add/') + @override_settings(LOGIN_REQUIRED=False) def test_views(self): # Test URL resolution @@ -53,7 +54,7 @@ class PluginTest(TestCase): response = client.get(url) self.assertEqual(response.status_code, 200) - @override_settings(EXEMPT_VIEW_PERMISSIONS=['*']) + @override_settings(EXEMPT_VIEW_PERMISSIONS=['*'], LOGIN_REQUIRED=False) def test_api_views(self): # Test URL resolution @@ -65,6 +66,7 @@ class PluginTest(TestCase): response = client.get(url) self.assertEqual(response.status_code, 200) + @override_settings(LOGIN_REQUIRED=False) def test_registered_views(self): # Test URL resolution @@ -97,8 +99,9 @@ class PluginTest(TestCase): """ Check that plugin TemplateExtensions are registered. """ - from netbox.tests.dummy_plugin.template_content import SiteContent + from netbox.tests.dummy_plugin.template_content import GlobalContent, SiteContent + self.assertIn(GlobalContent, registry['plugins']['template_extensions'][None]) self.assertIn(SiteContent, registry['plugins']['template_extensions']['dcim.site']) def test_registered_columns(self): @@ -163,11 +166,11 @@ class PluginTest(TestCase): required_settings = ['foo'] # Validation should pass when all required settings are present - DummyConfigWithRequiredSettings.validate({'foo': True}, settings.VERSION) + DummyConfigWithRequiredSettings.validate({'foo': True}, settings.RELEASE.version) # Validation should fail when a required setting is missing with self.assertRaises(ImproperlyConfigured): - DummyConfigWithRequiredSettings.validate({}, settings.VERSION) + DummyConfigWithRequiredSettings.validate({}, settings.RELEASE.version) def test_default_settings(self): """ @@ -180,12 +183,12 @@ class PluginTest(TestCase): # Populate the default value if setting has not been specified user_config = {} - DummyConfigWithDefaultSettings.validate(user_config, settings.VERSION) + DummyConfigWithDefaultSettings.validate(user_config, settings.RELEASE.version) self.assertEqual(user_config['bar'], 123) # Don't overwrite specified values user_config = {'bar': 456} - DummyConfigWithDefaultSettings.validate(user_config, settings.VERSION) + DummyConfigWithDefaultSettings.validate(user_config, settings.RELEASE.version) self.assertEqual(user_config['bar'], 456) def test_graphql(self): diff --git a/netbox/netbox/tests/test_views.py b/netbox/netbox/tests/test_views.py index 1942471b0..ccba73baa 100644 --- a/netbox/netbox/tests/test_views.py +++ b/netbox/netbox/tests/test_views.py @@ -1,24 +1,76 @@ import urllib.parse -from utilities.testing import TestCase from django.urls import reverse +from django.test import override_settings + +from dcim.models import Site +from netbox.constants import EMPTY_TABLE_TEXT +from netbox.search.backends import search_backend +from utilities.testing import TestCase class HomeViewTestCase(TestCase): def test_home(self): - url = reverse('home') - response = self.client.get(url) self.assertHttpStatus(response, 200) - def test_search(self): +class SearchViewTestCase(TestCase): + + @classmethod + def setUpTestData(cls): + sites = ( + Site(name='Site Alpha', slug='alpha', description='Red'), + Site(name='Site Bravo', slug='bravo', description='Red'), + Site(name='Site Charlie', slug='charlie', description='Green'), + Site(name='Site Delta', slug='delta', description='Green'), + Site(name='Site Echo', slug='echo', description='Blue'), + Site(name='Site Foxtrot', slug='foxtrot', description='Blue'), + ) + Site.objects.bulk_create(sites) + search_backend.cache(sites) + + def test_search(self): + url = reverse('search') + response = self.client.get(url) + self.assertHttpStatus(response, 200) + + def test_search_query(self): url = reverse('search') params = { - 'q': 'foo', + 'q': 'red', } + query = urllib.parse.urlencode(params) - response = self.client.get('{}?{}'.format(url, urllib.parse.urlencode(params))) + # Test without view permission + response = self.client.get(f'{url}?{query}') self.assertHttpStatus(response, 200) + content = str(response.content) + self.assertIn(EMPTY_TABLE_TEXT, content) + + # Add view permissions & query again. Only matching objects should be listed + self.add_permissions('dcim.view_site') + response = self.client.get(f'{url}?{query}') + self.assertHttpStatus(response, 200) + content = str(response.content) + self.assertIn('Site Alpha', content) + self.assertIn('Site Bravo', content) + self.assertNotIn('Site Charlie', content) + self.assertNotIn('Site Delta', content) + self.assertNotIn('Site Echo', content) + self.assertNotIn('Site Foxtrot', content) + + @override_settings(EXEMPT_VIEW_PERMISSIONS=['*']) + def test_search_no_results(self): + url = reverse('search') + params = { + 'q': 'xxxxxxxxx', # Matches nothing + } + query = urllib.parse.urlencode(params) + + response = self.client.get(f'{url}?{query}') + self.assertHttpStatus(response, 200) + content = str(response.content) + self.assertIn(EMPTY_TABLE_TEXT, content) diff --git a/netbox/netbox/urls.py b/netbox/netbox/urls.py index 1ce929513..b0175ec04 100644 --- a/netbox/netbox/urls.py +++ b/netbox/netbox/urls.py @@ -1,6 +1,7 @@ from django.conf import settings from django.conf.urls import include from django.urls import path +from django.views.decorators.cache import cache_page from django.views.static import serve from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView @@ -10,7 +11,6 @@ from netbox.graphql.schema import schema from netbox.graphql.views import NetBoxGraphQLView from netbox.plugins.urls import plugin_patterns, plugin_api_patterns from netbox.views import HomeView, StaticMediaFailureView, SearchView, htmx -from strawberry.django.views import GraphQLView _patterns = [ @@ -55,7 +55,13 @@ _patterns = [ path('api/wireless/', include('wireless.api.urls')), path('api/status/', StatusView.as_view(), name='api-status'), - path('api/schema/', SpectacularAPIView.as_view(), name='schema'), + path( + "api/schema/", + cache_page(timeout=86400, key_prefix=f"api_schema_{settings.RELEASE.version}")( + SpectacularAPIView.as_view() + ), + name="schema", + ), path('api/schema/swagger-ui/', SpectacularSwaggerView.as_view(url_name='schema'), name='api_docs'), path('api/schema/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='api_redocs'), diff --git a/netbox/netbox/views/errors.py b/netbox/netbox/views/errors.py index a0f783ed6..9e8ed5a3a 100644 --- a/netbox/netbox/views/errors.py +++ b/netbox/netbox/views/errors.py @@ -54,7 +54,7 @@ def handler_500(request, template_name=ERROR_500_TEMPLATE_NAME): return HttpResponseServerError(template.render({ 'error': error, 'exception': str(type_), - 'netbox_version': settings.VERSION, + 'netbox_version': settings.RELEASE.full_version, 'python_version': platform.python_version(), 'plugins': get_installed_plugins(), })) diff --git a/netbox/netbox/views/generic/bulk_views.py b/netbox/netbox/views/generic/bulk_views.py index f025de9df..4e0e9cbdd 100644 --- a/netbox/netbox/views/generic/bulk_views.py +++ b/netbox/netbox/views/generic/bulk_views.py @@ -184,7 +184,7 @@ class ObjectListView(BaseMultiObjectView, ActionsMixin, TableMixin): # If this is an HTMX request, return only the rendered table HTML if htmx_partial(request): - if not request.htmx.target: + if request.GET.get('embedded', False): table.embedded = True # Hide selection checkboxes if 'pk' in table.base_columns: @@ -340,11 +340,20 @@ class BulkImportView(GetReturnURLMixin, BaseMultiObjectView): return data def _get_form_fields(self): - # Exclude any fields which use a HiddenInput widget - return { - name: field for name, field in self.model_form().fields.items() - if type(field.widget) is not HiddenInput - } + form = self.model_form() + required_fields = {} + optional_fields = {} + + # Return only visible fields, with required fields listed first + for field in form.visible_fields(): + if field.is_hidden: + continue + elif field.field.required: + required_fields[field.name] = field.field + else: + optional_fields[field.name] = field.field + + return {**required_fields, **optional_fields} def _save_object(self, import_form, model_form, request): diff --git a/netbox/netbox/views/generic/object_views.py b/netbox/netbox/views/generic/object_views.py index d9ac2e9ff..243ae2547 100644 --- a/netbox/netbox/views/generic/object_views.py +++ b/netbox/netbox/views/generic/object_views.py @@ -93,6 +93,7 @@ class ObjectChildrenView(ObjectView, ActionsMixin, TableMixin): child_model = None table = None filterset = None + template_name = 'generic/object_children.html' def get_children(self, request, parent): """ @@ -167,6 +168,7 @@ class ObjectEditView(GetReturnURLMixin, BaseObjectView): """ template_name = 'generic/object_edit.html' form = None + htmx_template_name = 'htmx/form.html' def dispatch(self, request, *args, **kwargs): # Determine required permission based on whether we are editing an existing object @@ -228,7 +230,7 @@ class ObjectEditView(GetReturnURLMixin, BaseObjectView): # If this is an HTMX request, return only the rendered form HTML if htmx_partial(request): - return render(request, 'htmx/form.html', { + return render(request, self.htmx_template_name, { 'form': form, }) @@ -339,10 +341,14 @@ class ObjectDeleteView(GetReturnURLMixin, BaseObjectView): # Compile a mapping of models to instances dependent_objects = defaultdict(list) - for model, instance in collector.instances_with_model(): + for model, instances in collector.instances_with_model(): + # Ignore relations to auto-created models (e.g. many-to-many mappings) + if model._meta.auto_created: + continue # Omit the root object - if instance != obj: - dependent_objects[model].append(instance) + if instances == obj: + continue + dependent_objects[model].append(instances) return dict(dependent_objects) diff --git a/netbox/netbox/views/misc.py b/netbox/netbox/views/misc.py index 9678b71e3..569fcf728 100644 --- a/netbox/netbox/views/misc.py +++ b/netbox/netbox/views/misc.py @@ -50,7 +50,7 @@ class HomeView(View): latest_release = cache.get('latest_release') if latest_release: release_version, release_url = latest_release - if release_version > version.parse(settings.VERSION): + if release_version > version.parse(settings.RELEASE.version): new_release = { 'version': str(release_version), 'url': release_url, diff --git a/netbox/project-static/dist/cable_trace.css b/netbox/project-static/dist/cable_trace.css index 54f01c3f7..3b9fe7504 100644 Binary files a/netbox/project-static/dist/cable_trace.css and b/netbox/project-static/dist/cable_trace.css differ diff --git a/netbox/project-static/dist/graphiql/graphiql.min.js b/netbox/project-static/dist/graphiql/graphiql.min.js index b7f9a866d..ceac0a1c4 100644 --- a/netbox/project-static/dist/graphiql/graphiql.min.js +++ b/netbox/project-static/dist/graphiql/graphiql.min.js @@ -11593,6 +11593,1382 @@ exports.isNode = isNode; /***/ }), +/***/ "../../../node_modules/entities/lib/decode.js": +/*!****************************************************!*\ + !*** ../../../node_modules/entities/lib/decode.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function () { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}); +var __importStar = void 0 && (void 0).__importStar || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTMLAttribute = exports.decodeHTML = exports.determineBranch = exports.EntityDecoder = exports.DecodingMode = exports.BinTrieFlags = exports.fromCodePoint = exports.replaceCodePoint = exports.decodeCodePoint = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0; +var decode_data_html_js_1 = __importDefault(__webpack_require__(/*! ./generated/decode-data-html.js */ "../../../node_modules/entities/lib/generated/decode-data-html.js")); +exports.htmlDecodeTree = decode_data_html_js_1.default; +var decode_data_xml_js_1 = __importDefault(__webpack_require__(/*! ./generated/decode-data-xml.js */ "../../../node_modules/entities/lib/generated/decode-data-xml.js")); +exports.xmlDecodeTree = decode_data_xml_js_1.default; +var decode_codepoint_js_1 = __importStar(__webpack_require__(/*! ./decode_codepoint.js */ "../../../node_modules/entities/lib/decode_codepoint.js")); +exports.decodeCodePoint = decode_codepoint_js_1.default; +var decode_codepoint_js_2 = __webpack_require__(/*! ./decode_codepoint.js */ "../../../node_modules/entities/lib/decode_codepoint.js"); +Object.defineProperty(exports, "replaceCodePoint", ({ + enumerable: true, + get: function () { + return decode_codepoint_js_2.replaceCodePoint; + } +})); +Object.defineProperty(exports, "fromCodePoint", ({ + enumerable: true, + get: function () { + return decode_codepoint_js_2.fromCodePoint; + } +})); +var CharCodes; +(function (CharCodes) { + CharCodes[CharCodes["NUM"] = 35] = "NUM"; + CharCodes[CharCodes["SEMI"] = 59] = "SEMI"; + CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS"; + CharCodes[CharCodes["ZERO"] = 48] = "ZERO"; + CharCodes[CharCodes["NINE"] = 57] = "NINE"; + CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A"; + CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F"; + CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X"; + CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z"; + CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A"; + CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F"; + CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z"; +})(CharCodes || (CharCodes = {})); +/** Bit that needs to be set to convert an upper case ASCII character to lower case */ +var TO_LOWER_BIT = 32; +var BinTrieFlags; +(function (BinTrieFlags) { + BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; + BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; + BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE"; +})(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {})); +function isNumber(code) { + return code >= CharCodes.ZERO && code <= CharCodes.NINE; +} +function isHexadecimalCharacter(code) { + return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F; +} +function isAsciiAlphaNumeric(code) { + return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code); +} +/** + * Checks if the given character is a valid end character for an entity in an attribute. + * + * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error. + * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state + */ +function isEntityInAttributeInvalidEnd(code) { + return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code); +} +var EntityDecoderState; +(function (EntityDecoderState) { + EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart"; + EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart"; + EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal"; + EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex"; + EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity"; +})(EntityDecoderState || (EntityDecoderState = {})); +var DecodingMode; +(function (DecodingMode) { + /** Entities in text nodes that can end with any character. */ + DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy"; + /** Only allow entities terminated with a semicolon. */ + DecodingMode[DecodingMode["Strict"] = 1] = "Strict"; + /** Entities in attributes have limitations on ending characters. */ + DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute"; +})(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {})); +/** + * Token decoder with support of writing partial entities. + */ +var EntityDecoder = /** @class */function () { + function EntityDecoder( /** The tree used to decode entities. */ + decodeTree, + /** + * The function that is called when a codepoint is decoded. + * + * For multi-byte named entities, this will be called multiple times, + * with the second codepoint, and the same `consumed` value. + * + * @param codepoint The decoded codepoint. + * @param consumed The number of bytes consumed by the decoder. + */ + emitCodePoint, /** An object that is used to produce errors. */ + errors) { + this.decodeTree = decodeTree; + this.emitCodePoint = emitCodePoint; + this.errors = errors; + /** The current state of the decoder. */ + this.state = EntityDecoderState.EntityStart; + /** Characters that were consumed while parsing an entity. */ + this.consumed = 1; + /** + * The result of the entity. + * + * Either the result index of a numeric entity, or the codepoint of a + * numeric entity. + */ + this.result = 0; + /** The current index in the decode tree. */ + this.treeIndex = 0; + /** The number of characters that were consumed in excess. */ + this.excess = 1; + /** The mode in which the decoder is operating. */ + this.decodeMode = DecodingMode.Strict; + } + /** Resets the instance to make it reusable. */ + EntityDecoder.prototype.startEntity = function (decodeMode) { + this.decodeMode = decodeMode; + this.state = EntityDecoderState.EntityStart; + this.result = 0; + this.treeIndex = 0; + this.excess = 1; + this.consumed = 1; + }; + /** + * Write an entity to the decoder. This can be called multiple times with partial entities. + * If the entity is incomplete, the decoder will return -1. + * + * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the + * entity is incomplete, and resume when the next string is written. + * + * @param string The string containing the entity (or a continuation of the entity). + * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.write = function (str, offset) { + switch (this.state) { + case EntityDecoderState.EntityStart: + { + if (str.charCodeAt(offset) === CharCodes.NUM) { + this.state = EntityDecoderState.NumericStart; + this.consumed += 1; + return this.stateNumericStart(str, offset + 1); + } + this.state = EntityDecoderState.NamedEntity; + return this.stateNamedEntity(str, offset); + } + case EntityDecoderState.NumericStart: + { + return this.stateNumericStart(str, offset); + } + case EntityDecoderState.NumericDecimal: + { + return this.stateNumericDecimal(str, offset); + } + case EntityDecoderState.NumericHex: + { + return this.stateNumericHex(str, offset); + } + case EntityDecoderState.NamedEntity: + { + return this.stateNamedEntity(str, offset); + } + } + }; + /** + * Switches between the numeric decimal and hexadecimal states. + * + * Equivalent to the `Numeric character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.stateNumericStart = function (str, offset) { + if (offset >= str.length) { + return -1; + } + if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { + this.state = EntityDecoderState.NumericHex; + this.consumed += 1; + return this.stateNumericHex(str, offset + 1); + } + this.state = EntityDecoderState.NumericDecimal; + return this.stateNumericDecimal(str, offset); + }; + EntityDecoder.prototype.addToNumericResult = function (str, start, end, base) { + if (start !== end) { + var digitCount = end - start; + this.result = this.result * Math.pow(base, digitCount) + parseInt(str.substr(start, digitCount), base); + this.consumed += digitCount; + } + }; + /** + * Parses a hexadecimal numeric entity. + * + * Equivalent to the `Hexademical character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.stateNumericHex = function (str, offset) { + var startIdx = offset; + while (offset < str.length) { + var char = str.charCodeAt(offset); + if (isNumber(char) || isHexadecimalCharacter(char)) { + offset += 1; + } else { + this.addToNumericResult(str, startIdx, offset, 16); + return this.emitNumericEntity(char, 3); + } + } + this.addToNumericResult(str, startIdx, offset, 16); + return -1; + }; + /** + * Parses a decimal numeric entity. + * + * Equivalent to the `Decimal character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.stateNumericDecimal = function (str, offset) { + var startIdx = offset; + while (offset < str.length) { + var char = str.charCodeAt(offset); + if (isNumber(char)) { + offset += 1; + } else { + this.addToNumericResult(str, startIdx, offset, 10); + return this.emitNumericEntity(char, 2); + } + } + this.addToNumericResult(str, startIdx, offset, 10); + return -1; + }; + /** + * Validate and emit a numeric entity. + * + * Implements the logic from the `Hexademical character reference start + * state` and `Numeric character reference end state` in the HTML spec. + * + * @param lastCp The last code point of the entity. Used to see if the + * entity was terminated with a semicolon. + * @param expectedLength The minimum number of characters that should be + * consumed. Used to validate that at least one digit + * was consumed. + * @returns The number of characters that were consumed. + */ + EntityDecoder.prototype.emitNumericEntity = function (lastCp, expectedLength) { + var _a; + // Ensure we consumed at least one digit. + if (this.consumed <= expectedLength) { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + // Figure out if this is a legit end of the entity + if (lastCp === CharCodes.SEMI) { + this.consumed += 1; + } else if (this.decodeMode === DecodingMode.Strict) { + return 0; + } + this.emitCodePoint((0, decode_codepoint_js_1.replaceCodePoint)(this.result), this.consumed); + if (this.errors) { + if (lastCp !== CharCodes.SEMI) { + this.errors.missingSemicolonAfterCharacterReference(); + } + this.errors.validateNumericCharacterReference(this.result); + } + return this.consumed; + }; + /** + * Parses a named entity. + * + * Equivalent to the `Named character reference state` in the HTML spec. + * + * @param str The string containing the entity (or a continuation of the entity). + * @param offset The current offset. + * @returns The number of characters that were consumed, or -1 if the entity is incomplete. + */ + EntityDecoder.prototype.stateNamedEntity = function (str, offset) { + var decodeTree = this.decodeTree; + var current = decodeTree[this.treeIndex]; + // The mask is the number of bytes of the value, including the current byte. + var valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + for (; offset < str.length; offset++, this.excess++) { + var char = str.charCodeAt(offset); + this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); + if (this.treeIndex < 0) { + return this.result === 0 || + // If we are parsing an attribute + this.decodeMode === DecodingMode.Attribute && ( + // We shouldn't have consumed any characters after the entity, + valueLength === 0 || + // And there should be no invalid characters. + isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity(); + } + current = decodeTree[this.treeIndex]; + valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; + // If the branch is a value, store it and continue + if (valueLength !== 0) { + // If the entity is terminated by a semicolon, we are done. + if (char === CharCodes.SEMI) { + return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); + } + // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it. + if (this.decodeMode !== DecodingMode.Strict) { + this.result = this.treeIndex; + this.consumed += this.excess; + this.excess = 0; + } + } + } + return -1; + }; + /** + * Emit a named entity that was not terminated with a semicolon. + * + * @returns The number of characters consumed. + */ + EntityDecoder.prototype.emitNotTerminatedNamedEntity = function () { + var _a; + var _b = this, + result = _b.result, + decodeTree = _b.decodeTree; + var valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; + this.emitNamedEntityData(result, valueLength, this.consumed); + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference(); + return this.consumed; + }; + /** + * Emit a named entity. + * + * @param result The index of the entity in the decode tree. + * @param valueLength The number of bytes in the entity. + * @param consumed The number of characters consumed. + * + * @returns The number of characters consumed. + */ + EntityDecoder.prototype.emitNamedEntityData = function (result, valueLength, consumed) { + var decodeTree = this.decodeTree; + this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed); + if (valueLength === 3) { + // For multi-byte values, we need to emit the second byte. + this.emitCodePoint(decodeTree[result + 2], consumed); + } + return consumed; + }; + /** + * Signal to the parser that the end of the input was reached. + * + * Remaining data will be emitted and relevant errors will be produced. + * + * @returns The number of characters consumed. + */ + EntityDecoder.prototype.end = function () { + var _a; + switch (this.state) { + case EntityDecoderState.NamedEntity: + { + // Emit a named entity if we have one. + return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0; + } + // Otherwise, emit a numeric entity if we have one. + case EntityDecoderState.NumericDecimal: + { + return this.emitNumericEntity(0, 2); + } + case EntityDecoderState.NumericHex: + { + return this.emitNumericEntity(0, 3); + } + case EntityDecoderState.NumericStart: + { + (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); + return 0; + } + case EntityDecoderState.EntityStart: + { + // Return 0 if we have no entity. + return 0; + } + } + }; + return EntityDecoder; +}(); +exports.EntityDecoder = EntityDecoder; +/** + * Creates a function that decodes entities in a string. + * + * @param decodeTree The decode tree. + * @returns A function that decodes entities in a string. + */ +function getDecoder(decodeTree) { + var ret = ""; + var decoder = new EntityDecoder(decodeTree, function (str) { + return ret += (0, decode_codepoint_js_1.fromCodePoint)(str); + }); + return function decodeWithTrie(str, decodeMode) { + var lastIndex = 0; + var offset = 0; + while ((offset = str.indexOf("&", offset)) >= 0) { + ret += str.slice(lastIndex, offset); + decoder.startEntity(decodeMode); + var len = decoder.write(str, + // Skip the "&" + offset + 1); + if (len < 0) { + lastIndex = offset + decoder.end(); + break; + } + lastIndex = offset + len; + // If `len` is 0, skip the current `&` and continue. + offset = len === 0 ? lastIndex + 1 : lastIndex; + } + var result = ret + str.slice(lastIndex); + // Make sure we don't keep a reference to the final string. + ret = ""; + return result; + }; +} +/** + * Determines the branch of the current node that is taken given the current + * character. This function is used to traverse the trie. + * + * @param decodeTree The trie. + * @param current The current node. + * @param nodeIdx The index right after the current node and its value. + * @param char The current character. + * @returns The index of the next node, or -1 if no branch is taken. + */ +function determineBranch(decodeTree, current, nodeIdx, char) { + var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; + var jumpOffset = current & BinTrieFlags.JUMP_TABLE; + // Case 1: Single branch encoded in jump offset + if (branchCount === 0) { + return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; + } + // Case 2: Multiple branches encoded in jump table + if (jumpOffset) { + var value = char - jumpOffset; + return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1; + } + // Case 3: Multiple branches encoded in dictionary + // Binary search for the character. + var lo = nodeIdx; + var hi = lo + branchCount - 1; + while (lo <= hi) { + var mid = lo + hi >>> 1; + var midVal = decodeTree[mid]; + if (midVal < char) { + lo = mid + 1; + } else if (midVal > char) { + hi = mid - 1; + } else { + return decodeTree[mid + branchCount]; + } + } + return -1; +} +exports.determineBranch = determineBranch; +var htmlDecoder = getDecoder(decode_data_html_js_1.default); +var xmlDecoder = getDecoder(decode_data_xml_js_1.default); +/** + * Decodes an HTML string. + * + * @param str The string to decode. + * @param mode The decoding mode. + * @returns The decoded string. + */ +function decodeHTML(str, mode) { + if (mode === void 0) { + mode = DecodingMode.Legacy; + } + return htmlDecoder(str, mode); +} +exports.decodeHTML = decodeHTML; +/** + * Decodes an HTML string in an attribute. + * + * @param str The string to decode. + * @returns The decoded string. + */ +function decodeHTMLAttribute(str) { + return htmlDecoder(str, DecodingMode.Attribute); +} +exports.decodeHTMLAttribute = decodeHTMLAttribute; +/** + * Decodes an HTML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +function decodeHTMLStrict(str) { + return htmlDecoder(str, DecodingMode.Strict); +} +exports.decodeHTMLStrict = decodeHTMLStrict; +/** + * Decodes an XML string, requiring all entities to be terminated by a semicolon. + * + * @param str The string to decode. + * @returns The decoded string. + */ +function decodeXML(str) { + return xmlDecoder(str, DecodingMode.Strict); +} +exports.decodeXML = decodeXML; + +/***/ }), + +/***/ "../../../node_modules/entities/lib/decode_codepoint.js": +/*!**************************************************************!*\ + !*** ../../../node_modules/entities/lib/decode_codepoint.js ***! + \**************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134 +var _a; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.replaceCodePoint = exports.fromCodePoint = void 0; +var decodeMap = new Map([[0, 65533], +// C1 Unicode control character reference replacements +[128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376]]); +/** + * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. + */ +exports.fromCodePoint = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins +(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) { + var output = ""; + if (codePoint > 0xffff) { + codePoint -= 0x10000; + output += String.fromCharCode(codePoint >>> 10 & 0x3ff | 0xd800); + codePoint = 0xdc00 | codePoint & 0x3ff; + } + output += String.fromCharCode(codePoint); + return output; +}; +/** + * Replace the given code point with a replacement character if it is a + * surrogate or is outside the valid range. Otherwise return the code + * point unchanged. + */ +function replaceCodePoint(codePoint) { + var _a; + if (codePoint >= 0xd800 && codePoint <= 0xdfff || codePoint > 0x10ffff) { + return 0xfffd; + } + return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint; +} +exports.replaceCodePoint = replaceCodePoint; +/** + * Replace the code point if relevant, then convert it to a string. + * + * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead. + * @param codePoint The code point to decode. + * @returns The decoded code point. + */ +function decodeCodePoint(codePoint) { + return (0, exports.fromCodePoint)(replaceCodePoint(codePoint)); +} +exports["default"] = decodeCodePoint; + +/***/ }), + +/***/ "../../../node_modules/entities/lib/encode.js": +/*!****************************************************!*\ + !*** ../../../node_modules/entities/lib/encode.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.encodeNonAsciiHTML = exports.encodeHTML = void 0; +var encode_html_js_1 = __importDefault(__webpack_require__(/*! ./generated/encode-html.js */ "../../../node_modules/entities/lib/generated/encode-html.js")); +var escape_js_1 = __webpack_require__(/*! ./escape.js */ "../../../node_modules/entities/lib/escape.js"); +var htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g; +/** + * Encodes all characters in the input using HTML entities. This includes + * characters that are valid ASCII characters in HTML documents, such as `#`. + * + * To get a more compact output, consider using the `encodeNonAsciiHTML` + * function, which will only encode characters that are not valid in HTML + * documents, as well as non-ASCII characters. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +function encodeHTML(data) { + return encodeHTMLTrieRe(htmlReplacer, data); +} +exports.encodeHTML = encodeHTML; +/** + * Encodes all non-ASCII characters, as well as characters not valid in HTML + * documents using HTML entities. This function will not encode characters that + * are valid in HTML documents, such as `#`. + * + * If a character has no equivalent entity, a numeric hexadecimal reference + * (eg. `ü`) will be used. + */ +function encodeNonAsciiHTML(data) { + return encodeHTMLTrieRe(escape_js_1.xmlReplacer, data); +} +exports.encodeNonAsciiHTML = encodeNonAsciiHTML; +function encodeHTMLTrieRe(regExp, str) { + var ret = ""; + var lastIdx = 0; + var match; + while ((match = regExp.exec(str)) !== null) { + var i = match.index; + ret += str.substring(lastIdx, i); + var char = str.charCodeAt(i); + var next = encode_html_js_1.default.get(char); + if (typeof next === "object") { + // We are in a branch. Try to match the next char. + if (i + 1 < str.length) { + var nextChar = str.charCodeAt(i + 1); + var value = typeof next.n === "number" ? next.n === nextChar ? next.o : undefined : next.n.get(nextChar); + if (value !== undefined) { + ret += value; + lastIdx = regExp.lastIndex += 1; + continue; + } + } + next = next.v; + } + // We might have a tree node without a value; skip and use a numeric entity. + if (next !== undefined) { + ret += next; + lastIdx = i + 1; + } else { + var cp = (0, escape_js_1.getCodePoint)(str, i); + ret += "&#x".concat(cp.toString(16), ";"); + // Increase by 1 if we have a surrogate pair + lastIdx = regExp.lastIndex += Number(cp !== char); + } + } + return ret + str.substr(lastIdx); +} + +/***/ }), + +/***/ "../../../node_modules/entities/lib/escape.js": +/*!****************************************************!*\ + !*** ../../../node_modules/entities/lib/escape.js ***! + \****************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.getCodePoint = exports.xmlReplacer = void 0; +exports.xmlReplacer = /["&'<>$\x80-\uFFFF]/g; +var xmlCodeMap = new Map([[34, """], [38, "&"], [39, "'"], [60, "<"], [62, ">"]]); +// For compatibility with node < 4, we wrap `codePointAt` +exports.getCodePoint = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition +String.prototype.codePointAt != null ? function (str, index) { + return str.codePointAt(index); +} : +// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae +function (c, index) { + return (c.charCodeAt(index) & 0xfc00) === 0xd800 ? (c.charCodeAt(index) - 0xd800) * 0x400 + c.charCodeAt(index + 1) - 0xdc00 + 0x10000 : c.charCodeAt(index); +}; +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using XML entities. + * + * If a character has no equivalent entity, a + * numeric hexadecimal reference (eg. `ü`) will be used. + */ +function encodeXML(str) { + var ret = ""; + var lastIdx = 0; + var match; + while ((match = exports.xmlReplacer.exec(str)) !== null) { + var i = match.index; + var char = str.charCodeAt(i); + var next = xmlCodeMap.get(char); + if (next !== undefined) { + ret += str.substring(lastIdx, i) + next; + lastIdx = i + 1; + } else { + ret += "".concat(str.substring(lastIdx, i), "&#x").concat((0, exports.getCodePoint)(str, i).toString(16), ";"); + // Increase by 1 if we have a surrogate pair + lastIdx = exports.xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800); + } + } + return ret + str.substr(lastIdx); +} +exports.encodeXML = encodeXML; +/** + * Encodes all non-ASCII characters, as well as characters not valid in XML + * documents using numeric hexadecimal reference (eg. `ü`). + * + * Have a look at `escapeUTF8` if you want a more concise output at the expense + * of reduced transportability. + * + * @param data String to escape. + */ +exports.escape = encodeXML; +/** + * Creates a function that escapes all characters matched by the given regular + * expression using the given map of characters to escape to their entities. + * + * @param regex Regular expression to match characters to escape. + * @param map Map of characters to escape to their entities. + * + * @returns Function that escapes all characters matched by the given regular + * expression using the given map of characters to escape to their entities. + */ +function getEscaper(regex, map) { + return function escape(data) { + var match; + var lastIdx = 0; + var result = ""; + while (match = regex.exec(data)) { + if (lastIdx !== match.index) { + result += data.substring(lastIdx, match.index); + } + // We know that this character will be in the map. + result += map.get(match[0].charCodeAt(0)); + // Every match will be of length 1 + lastIdx = match.index + 1; + } + return result + data.substring(lastIdx); + }; +} +/** + * Encodes all characters not valid in XML documents using XML entities. + * + * Note that the output will be character-set dependent. + * + * @param data String to escape. + */ +exports.escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap); +/** + * Encodes all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +exports.escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([[34, """], [38, "&"], [160, " "]])); +/** + * Encodes all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + * + * @param data String to escape. + */ +exports.escapeText = getEscaper(/[&<>\u00A0]/g, new Map([[38, "&"], [60, "<"], [62, ">"], [160, " "]])); + +/***/ }), + +/***/ "../../../node_modules/entities/lib/generated/decode-data-html.js": +/*!************************************************************************!*\ + !*** ../../../node_modules/entities/lib/generated/decode-data-html.js ***! + \************************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +// Generated using scripts/write-decode-map.ts +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = new Uint16Array( +// prettier-ignore +"\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b\"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c".split("").map(function (c) { + return c.charCodeAt(0); +})); + +/***/ }), + +/***/ "../../../node_modules/entities/lib/generated/decode-data-xml.js": +/*!***********************************************************************!*\ + !*** ../../../node_modules/entities/lib/generated/decode-data-xml.js ***! + \***********************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +// Generated using scripts/write-decode-map.ts +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = new Uint16Array( +// prettier-ignore +"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022".split("").map(function (c) { + return c.charCodeAt(0); +})); + +/***/ }), + +/***/ "../../../node_modules/entities/lib/generated/encode-html.js": +/*!*******************************************************************!*\ + !*** ../../../node_modules/entities/lib/generated/encode-html.js ***! + \*******************************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +// Generated using scripts/write-encode-map.ts +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +function restoreDiff(arr) { + for (var i = 1; i < arr.length; i++) { + arr[i][0] += arr[i - 1][0] + 1; + } + return arr; +} +// prettier-ignore +exports["default"] = new Map( /* #__PURE__ */restoreDiff([[9, " "], [0, " "], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { + v: "<", + n: 8402, + o: "<⃒" +}], [0, { + v: "=", + n: 8421, + o: "=⃥" +}], [0, { + v: ">", + n: 8402, + o: ">⃒" +}], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { + n: 106, + o: "fj" +}], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "¬"], [0, "­"], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, "‌"], [0, "‍"], [0, "‎"], [0, "‏"], [0, "‐"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { + v: " ", + n: 8202, + o: "  " +}], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { + v: "↝", + n: 824, + o: "↝̸" +}], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { + v: "∂", + n: 824, + o: "∂̸" +}], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { + v: "∠", + n: 8402, + o: "∠⃒" +}], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { + v: "∩", + n: 65024, + o: "∩︀" +}], [0, { + v: "∪", + n: 65024, + o: "∪︀" +}], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { + v: "∼", + n: 8402, + o: "∼⃒" +}], [0, { + v: "∽", + n: 817, + o: "∽̱" +}], [0, { + v: "∾", + n: 819, + o: "∾̳" +}], [0, "∿"], [0, "≀"], [0, "≁"], [0, { + v: "≂", + n: 824, + o: "≂̸" +}], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { + v: "≋", + n: 824, + o: "≋̸" +}], [0, "≌"], [0, { + v: "≍", + n: 8402, + o: "≍⃒" +}], [0, { + v: "≎", + n: 824, + o: "≎̸" +}], [0, { + v: "≏", + n: 824, + o: "≏̸" +}], [0, { + v: "≐", + n: 824, + o: "≐̸" +}], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { + v: "≡", + n: 8421, + o: "≡⃥" +}], [0, "≢"], [1, { + v: "≤", + n: 8402, + o: "≤⃒" +}], [0, { + v: "≥", + n: 8402, + o: "≥⃒" +}], [0, { + v: "≦", + n: 824, + o: "≦̸" +}], [0, { + v: "≧", + n: 824, + o: "≧̸" +}], [0, { + v: "≨", + n: 65024, + o: "≨︀" +}], [0, { + v: "≩", + n: 65024, + o: "≩︀" +}], [0, { + v: "≪", + n: new Map( /* #__PURE__ */restoreDiff([[824, "≪̸"], [7577, "≪⃒"]])) +}], [0, { + v: "≫", + n: new Map( /* #__PURE__ */restoreDiff([[824, "≫̸"], [7577, "≫⃒"]])) +}], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { + v: "≿", + n: 824, + o: "≿̸" +}], [0, "⊀"], [0, "⊁"], [0, { + v: "⊂", + n: 8402, + o: "⊂⃒" +}], [0, { + v: "⊃", + n: 8402, + o: "⊃⃒" +}], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { + v: "⊊", + n: 65024, + o: "⊊︀" +}], [0, { + v: "⊋", + n: 65024, + o: "⊋︀" +}], [1, "⊍"], [0, "⊎"], [0, { + v: "⊏", + n: 824, + o: "⊏̸" +}], [0, { + v: "⊐", + n: 824, + o: "⊐̸" +}], [0, "⊑"], [0, "⊒"], [0, { + v: "⊓", + n: 65024, + o: "⊓︀" +}], [0, { + v: "⊔", + n: 65024, + o: "⊔︀" +}], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { + v: "⊴", + n: 8402, + o: "⊴⃒" +}], [0, { + v: "⊵", + n: 8402, + o: "⊵⃒" +}], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { + v: "⋘", + n: 824, + o: "⋘̸" +}], [0, { + v: "⋙", + n: 824, + o: "⋙̸" +}], [0, { + v: "⋚", + n: 65024, + o: "⋚︀" +}], [0, { + v: "⋛", + n: 65024, + o: "⋛︀" +}], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { + v: "⋵", + n: 824, + o: "⋵̸" +}], [0, "⋶"], [0, "⋷"], [1, { + v: "⋹", + n: 824, + o: "⋹̸" +}], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "⟨"], [0, "⟩"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { + v: "⤳", + n: 824, + o: "⤳̸" +}], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { + v: "⧏", + n: 824, + o: "⧏̸" +}], [0, { + v: "⧐", + n: 824, + o: "⧐̸" +}], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { + v: "⩭", + n: 824, + o: "⩭̸" +}], [0, "⩮"], [0, "⩯"], [0, { + v: "⩰", + n: 824, + o: "⩰̸" +}], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { + v: "⩽", + n: 824, + o: "⩽̸" +}], [0, { + v: "⩾", + n: 824, + o: "⩾̸" +}], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { + v: "⪡", + n: 824, + o: "⪡̸" +}], [0, { + v: "⪢", + n: 824, + o: "⪢̸" +}], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { + v: "⪬", + n: 65024, + o: "⪬︀" +}], [0, { + v: "⪭", + n: 65024, + o: "⪭︀" +}], [0, "⪮"], [0, { + v: "⪯", + n: 824, + o: "⪯̸" +}], [0, { + v: "⪰", + n: 824, + o: "⪰̸" +}], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { + v: "⫅", + n: 824, + o: "⫅̸" +}], [0, { + v: "⫆", + n: 824, + o: "⫆̸" +}], [0, "⫇"], [0, "⫈"], [2, { + v: "⫋", + n: 65024, + o: "⫋︀" +}], [0, { + v: "⫌", + n: 65024, + o: "⫌︀" +}], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { + v: "⫽", + n: 8421, + o: "⫽⃥" +}], [44343, { + n: new Map( /* #__PURE__ */restoreDiff([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) +}], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]])); + +/***/ }), + +/***/ "../../../node_modules/entities/lib/index.js": +/*!***************************************************!*\ + !*** ../../../node_modules/entities/lib/index.js ***! + \***************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLAttribute = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.DecodingMode = exports.EntityDecoder = exports.encodeHTML5 = exports.encodeHTML4 = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.EntityLevel = void 0; +var decode_js_1 = __webpack_require__(/*! ./decode.js */ "../../../node_modules/entities/lib/decode.js"); +var encode_js_1 = __webpack_require__(/*! ./encode.js */ "../../../node_modules/entities/lib/encode.js"); +var escape_js_1 = __webpack_require__(/*! ./escape.js */ "../../../node_modules/entities/lib/escape.js"); +/** The level of entities to support. */ +var EntityLevel; +(function (EntityLevel) { + /** Support only XML entities. */ + EntityLevel[EntityLevel["XML"] = 0] = "XML"; + /** Support HTML entities, which are a superset of XML entities. */ + EntityLevel[EntityLevel["HTML"] = 1] = "HTML"; +})(EntityLevel = exports.EntityLevel || (exports.EntityLevel = {})); +var EncodingMode; +(function (EncodingMode) { + /** + * The output is UTF-8 encoded. Only characters that need escaping within + * XML will be escaped. + */ + EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8"; + /** + * The output consists only of ASCII characters. Characters that need + * escaping within HTML, and characters that aren't ASCII characters will + * be escaped. + */ + EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII"; + /** + * Encode all characters that have an equivalent entity, as well as all + * characters that are not ASCII characters. + */ + EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive"; + /** + * Encode all characters that have to be escaped in HTML attributes, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute"; + /** + * Encode all characters that have to be escaped in HTML text, + * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. + */ + EncodingMode[EncodingMode["Text"] = 4] = "Text"; +})(EncodingMode = exports.EncodingMode || (exports.EncodingMode = {})); +/** + * Decodes a string with entities. + * + * @param data String to decode. + * @param options Decoding options. + */ +function decode(data, options) { + if (options === void 0) { + options = EntityLevel.XML; + } + var level = typeof options === "number" ? options : options.level; + if (level === EntityLevel.HTML) { + var mode = typeof options === "object" ? options.mode : undefined; + return (0, decode_js_1.decodeHTML)(data, mode); + } + return (0, decode_js_1.decodeXML)(data); +} +exports.decode = decode; +/** + * Decodes a string with entities. Does not allow missing trailing semicolons for entities. + * + * @param data String to decode. + * @param options Decoding options. + * @deprecated Use `decode` with the `mode` set to `Strict`. + */ +function decodeStrict(data, options) { + var _a; + if (options === void 0) { + options = EntityLevel.XML; + } + var opts = typeof options === "number" ? { + level: options + } : options; + (_a = opts.mode) !== null && _a !== void 0 ? _a : opts.mode = decode_js_1.DecodingMode.Strict; + return decode(data, opts); +} +exports.decodeStrict = decodeStrict; +/** + * Encodes a string with entities. + * + * @param data String to encode. + * @param options Encoding options. + */ +function encode(data, options) { + if (options === void 0) { + options = EntityLevel.XML; + } + var opts = typeof options === "number" ? { + level: options + } : options; + // Mode `UTF8` just escapes XML entities + if (opts.mode === EncodingMode.UTF8) return (0, escape_js_1.escapeUTF8)(data); + if (opts.mode === EncodingMode.Attribute) return (0, escape_js_1.escapeAttribute)(data); + if (opts.mode === EncodingMode.Text) return (0, escape_js_1.escapeText)(data); + if (opts.level === EntityLevel.HTML) { + if (opts.mode === EncodingMode.ASCII) { + return (0, encode_js_1.encodeNonAsciiHTML)(data); + } + return (0, encode_js_1.encodeHTML)(data); + } + // ASCII and Extensive are equivalent + return (0, escape_js_1.encodeXML)(data); +} +exports.encode = encode; +var escape_js_2 = __webpack_require__(/*! ./escape.js */ "../../../node_modules/entities/lib/escape.js"); +Object.defineProperty(exports, "encodeXML", ({ + enumerable: true, + get: function () { + return escape_js_2.encodeXML; + } +})); +Object.defineProperty(exports, "escape", ({ + enumerable: true, + get: function () { + return escape_js_2.escape; + } +})); +Object.defineProperty(exports, "escapeUTF8", ({ + enumerable: true, + get: function () { + return escape_js_2.escapeUTF8; + } +})); +Object.defineProperty(exports, "escapeAttribute", ({ + enumerable: true, + get: function () { + return escape_js_2.escapeAttribute; + } +})); +Object.defineProperty(exports, "escapeText", ({ + enumerable: true, + get: function () { + return escape_js_2.escapeText; + } +})); +var encode_js_2 = __webpack_require__(/*! ./encode.js */ "../../../node_modules/entities/lib/encode.js"); +Object.defineProperty(exports, "encodeHTML", ({ + enumerable: true, + get: function () { + return encode_js_2.encodeHTML; + } +})); +Object.defineProperty(exports, "encodeNonAsciiHTML", ({ + enumerable: true, + get: function () { + return encode_js_2.encodeNonAsciiHTML; + } +})); +// Legacy aliases (deprecated) +Object.defineProperty(exports, "encodeHTML4", ({ + enumerable: true, + get: function () { + return encode_js_2.encodeHTML; + } +})); +Object.defineProperty(exports, "encodeHTML5", ({ + enumerable: true, + get: function () { + return encode_js_2.encodeHTML; + } +})); +var decode_js_2 = __webpack_require__(/*! ./decode.js */ "../../../node_modules/entities/lib/decode.js"); +Object.defineProperty(exports, "EntityDecoder", ({ + enumerable: true, + get: function () { + return decode_js_2.EntityDecoder; + } +})); +Object.defineProperty(exports, "DecodingMode", ({ + enumerable: true, + get: function () { + return decode_js_2.DecodingMode; + } +})); +Object.defineProperty(exports, "decodeXML", ({ + enumerable: true, + get: function () { + return decode_js_2.decodeXML; + } +})); +Object.defineProperty(exports, "decodeHTML", ({ + enumerable: true, + get: function () { + return decode_js_2.decodeHTML; + } +})); +Object.defineProperty(exports, "decodeHTMLStrict", ({ + enumerable: true, + get: function () { + return decode_js_2.decodeHTMLStrict; + } +})); +Object.defineProperty(exports, "decodeHTMLAttribute", ({ + enumerable: true, + get: function () { + return decode_js_2.decodeHTMLAttribute; + } +})); +// Legacy aliases (deprecated) +Object.defineProperty(exports, "decodeHTML4", ({ + enumerable: true, + get: function () { + return decode_js_2.decodeHTML; + } +})); +Object.defineProperty(exports, "decodeHTML5", ({ + enumerable: true, + get: function () { + return decode_js_2.decodeHTML; + } +})); +Object.defineProperty(exports, "decodeHTML4Strict", ({ + enumerable: true, + get: function () { + return decode_js_2.decodeHTMLStrict; + } +})); +Object.defineProperty(exports, "decodeHTML5Strict", ({ + enumerable: true, + get: function () { + return decode_js_2.decodeHTMLStrict; + } +})); +Object.defineProperty(exports, "decodeXMLStrict", ({ + enumerable: true, + get: function () { + return decode_js_2.decodeXML; + } +})); + +/***/ }), + /***/ "../../../node_modules/framer-motion/dist/cjs/index.js": /*!*************************************************************!*\ !*** ../../../node_modules/framer-motion/dist/cjs/index.js ***! @@ -22158,15 +23534,25 @@ function executeFieldsSerially(exeContext, parentType, sourceValue, path, fields function executeFields(exeContext, parentType, sourceValue, path, fields) { const results = Object.create(null); let containsPromise = false; - for (const [responseName, fieldNodes] of fields.entries()) { - const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name); - const result = executeField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); - if (result !== undefined) { - results[responseName] = result; - if ((0, _isPromise.isPromise)(result)) { - containsPromise = true; + try { + for (const [responseName, fieldNodes] of fields.entries()) { + const fieldPath = (0, _Path.addPath)(path, responseName, parentType.name); + const result = executeField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); + if (result !== undefined) { + results[responseName] = result; + if ((0, _isPromise.isPromise)(result)) { + containsPromise = true; + } } } + } catch (error) { + if (containsPromise) { + // Ensure that any promises returned by other fields are handled, as they may also reject. + return (0, _promiseForObject.promiseForObject)(results).finally(() => { + throw error; + }); + } + throw error; } // If there are no promises, we can just return the object if (!containsPromise) { @@ -22723,17 +24109,7 @@ var _values = __webpack_require__(/*! ./values.mjs */ "../../../node_modules/gra async function subscribe(args) { // Temporary for v15 to v16 migration. Remove in v17 arguments.length < 2 || (0, _devAssert.devAssert)(false, 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.'); - const { - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - fieldResolver, - subscribeFieldResolver - } = args; - const resultOrStream = await createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, subscribeFieldResolver); + const resultOrStream = await createSourceEventStream(args); if (!(0, _isAsyncIterable.isAsyncIterable)(resultOrStream)) { return resultOrStream; } // For each payload yielded from a subscription, map it over the normal @@ -22744,17 +24120,28 @@ async function subscribe(args) { // "ExecuteQuery" algorithm, for which `execute` is also used. const mapSourceToResponse = payload => (0, _execute.execute)({ - schema, - document, - rootValue: payload, - contextValue, - variableValues, - operationName, - fieldResolver + ...args, + rootValue: payload }); // Map every source value to a ExecutionResult value as described above. return (0, _mapAsyncIterator.mapAsyncIterator)(resultOrStream, mapSourceToResponse); } +function toNormalizedArgs(args) { + const firstArg = args[0]; + if (firstArg && 'document' in firstArg) { + return firstArg; + } + return { + schema: firstArg, + // FIXME: when underlying TS bug fixed, see https://github.com/microsoft/TypeScript/issues/31613 + document: args[1], + rootValue: args[2], + contextValue: args[3], + variableValues: args[4], + operationName: args[5], + subscribeFieldResolver: args[6] + }; +} /** * Implements the "CreateSourceEventStream" algorithm described in the * GraphQL specification, resolving the subscription source event stream. @@ -22784,21 +24171,22 @@ async function subscribe(args) { * "Supporting Subscriptions at Scale" information in the GraphQL specification. */ -async function createSourceEventStream(schema, document, rootValue, contextValue, variableValues, operationName, subscribeFieldResolver) { - // If arguments are missing or incorrectly typed, this is an internal +async function createSourceEventStream() { + for (var _len = arguments.length, rawArgs = new Array(_len), _key = 0; _key < _len; _key++) { + rawArgs[_key] = arguments[_key]; + } + const args = toNormalizedArgs(rawArgs); + const { + schema, + document, + variableValues + } = args; // If arguments are missing or incorrectly typed, this is an internal // developer mistake which should throw an early error. + (0, _execute.assertValidExecutionArguments)(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments, // a "Response" with only errors is returned. - const exeContext = (0, _execute.buildExecutionContext)({ - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - subscribeFieldResolver - }); // Return early errors if execution context failed. + const exeContext = (0, _execute.buildExecutionContext)(args); // Return early errors if execution context failed. if (!('schema' in exeContext)) { return { @@ -22970,7 +24358,7 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) { } onError(new _GraphQLError.GraphQLError(prefix + '; ' + error.message, { nodes: varDefNode, - originalError: error.originalError + originalError: error })); }); } @@ -24740,8 +26128,9 @@ var _inspect = __webpack_require__(/*! ./inspect.mjs */ "../../../node_modules/g const instanceOf = /* c8 ignore next 6 */ // FIXME: https://github.com/graphql/graphql-js/issues/2317 -// eslint-disable-next-line no-undef - false ? 0 : function instanceOf(value, constructor) { +globalThis.process && globalThis.process.env.NODE_ENV === 'production' ? function instanceOf(value, constructor) { + return value instanceof constructor; +} : function instanceOf(value, constructor) { if (value instanceof constructor) { return true; } @@ -25564,7 +26953,7 @@ function isNode(maybeNode) { } /** Name */ -let OperationTypeNode; +var OperationTypeNode; exports.OperationTypeNode = OperationTypeNode; (function (OperationTypeNode) { OperationTypeNode['QUERY'] = 'query'; @@ -25832,12 +27221,7 @@ exports.DirectiveLocation = void 0; /** * The set of allowed directive location values. */ -let DirectiveLocation; -/** - * The enum type representing the directive location values. - * - * @deprecated Please use `DirectiveLocation`. Will be remove in v17. - */ +var DirectiveLocation; exports.DirectiveLocation = DirectiveLocation; (function (DirectiveLocation) { DirectiveLocation['QUERY'] = 'QUERY'; @@ -25861,6 +27245,12 @@ exports.DirectiveLocation = DirectiveLocation; DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION'; })(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {})); +/** + * The enum type representing the directive location values. + * + * @deprecated Please use `DirectiveLocation`. Will be remove in v17. + */ + /***/ }), /***/ "../../../node_modules/graphql/language/index.mjs": @@ -26090,12 +27480,7 @@ exports.Kind = void 0; /** * The set of allowed kind values for AST nodes. */ -let Kind; -/** - * The enum type representing the possible kind values of AST nodes. - * - * @deprecated Please use `Kind`. Will be remove in v17. - */ +var Kind; exports.Kind = Kind; (function (Kind) { Kind['NAME'] = 'Name'; @@ -26143,6 +27528,12 @@ exports.Kind = Kind; Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension'; })(Kind || (exports.Kind = Kind = {})); +/** + * The enum type representing the possible kind values of AST nodes. + * + * @deprecated Please use `Kind`. Will be remove in v17. + */ + /***/ }), /***/ "../../../node_modules/graphql/language/lexer.mjs": @@ -27010,10 +28401,12 @@ function parseType(source, options) { */ class Parser { - constructor(source, options) { + constructor(source) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const sourceObj = (0, _source.isSource)(source) ? source : new _source.Source(source); this._lexer = new _lexer.Lexer(sourceObj); this._options = options; + this._tokenCounter = 0; } /** * Converts a name lex token into a name parse node. @@ -27293,13 +28686,12 @@ class Parser { */ parseFragmentDefinition() { - var _this$_options; const start = this._lexer.token; this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes // the grammar of FragmentDefinition: // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet - if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.allowLegacyFragmentVariables) === true) { + if (this._options.allowLegacyFragmentVariables === true) { return this.node(start, { kind: _kinds.Kind.FRAGMENT_DEFINITION, name: this.parseFragmentName(), @@ -27355,13 +28747,13 @@ class Parser { case _tokenKind.TokenKind.BRACE_L: return this.parseObject(isConst); case _tokenKind.TokenKind.INT: - this._lexer.advance(); + this.advanceLexer(); return this.node(token, { kind: _kinds.Kind.INT, value: token.value }); case _tokenKind.TokenKind.FLOAT: - this._lexer.advance(); + this.advanceLexer(); return this.node(token, { kind: _kinds.Kind.FLOAT, value: token.value @@ -27370,7 +28762,7 @@ class Parser { case _tokenKind.TokenKind.BLOCK_STRING: return this.parseStringLiteral(); case _tokenKind.TokenKind.NAME: - this._lexer.advance(); + this.advanceLexer(); switch (token.value) { case 'true': return this.node(token, { @@ -27412,7 +28804,7 @@ class Parser { } parseStringLiteral() { const token = this._lexer.token; - this._lexer.advance(); + this.advanceLexer(); return this.node(token, { kind: _kinds.Kind.STRING, value: token.value, @@ -28103,8 +29495,7 @@ class Parser { */ node(startToken, node) { - var _this$_options2; - if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.noLocation) !== true) { + if (this._options.noLocation !== true) { node.loc = new _ast.Location(startToken, this._lexer.lastToken, this._lexer.source); } return node; @@ -28124,7 +29515,7 @@ class Parser { expectToken(kind) { const token = this._lexer.token; if (token.kind === kind) { - this._lexer.advance(); + this.advanceLexer(); return token; } throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`); @@ -28137,7 +29528,7 @@ class Parser { expectOptionalToken(kind) { const token = this._lexer.token; if (token.kind === kind) { - this._lexer.advance(); + this.advanceLexer(); return true; } return false; @@ -28150,7 +29541,7 @@ class Parser { expectKeyword(value) { const token = this._lexer.token; if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { - this._lexer.advance(); + this.advanceLexer(); } else { throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Expected "${value}", found ${getTokenDesc(token)}.`); } @@ -28163,7 +29554,7 @@ class Parser { expectOptionalKeyword(value) { const token = this._lexer.token; if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { - this._lexer.advance(); + this.advanceLexer(); return true; } return false; @@ -28235,6 +29626,18 @@ class Parser { } while (this.expectOptionalToken(delimiterKind)); return nodes; } + advanceLexer() { + const { + maxTokens + } = this._options; + const token = this._lexer.advance(); + if (maxTokens !== undefined && token.kind !== _tokenKind.TokenKind.EOF) { + ++this._tokenCounter; + if (this._tokenCounter > maxTokens) { + throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, `Document contains more that ${maxTokens} tokens. Parsing aborted.`); + } + } + } } /** * A helper function to describe a token as a string for debugging. @@ -28956,12 +30359,7 @@ exports.TokenKind = void 0; * An exported enum describing the different kinds of tokens that the * lexer emits. */ -let TokenKind; -/** - * The enum type representing the token kinds values. - * - * @deprecated Please use `TokenKind`. Will be remove in v17. - */ +var TokenKind; exports.TokenKind = TokenKind; (function (TokenKind) { TokenKind['SOF'] = ''; @@ -28988,6 +30386,12 @@ exports.TokenKind = TokenKind; TokenKind['COMMENT'] = 'Comment'; })(TokenKind || (exports.TokenKind = TokenKind = {})); +/** + * The enum type representing the token kinds values. + * + * @deprecated Please use `TokenKind`. Will be remove in v17. + */ + /***/ }), /***/ "../../../node_modules/graphql/language/visitor.mjs": @@ -31466,7 +32870,7 @@ const __EnumValue = new _definition.GraphQLObjectType({ }) }); exports.__EnumValue = __EnumValue; -let TypeKind; +var TypeKind; exports.TypeKind = TypeKind; (function (TypeKind) { TypeKind['SCALAR'] = 'SCALAR'; @@ -34126,7 +35530,7 @@ var _definition = __webpack_require__(/*! ../type/definition.mjs */ "../../../no var _scalars = __webpack_require__(/*! ../type/scalars.mjs */ "../../../node_modules/graphql/type/scalars.mjs"); var _astFromValue = __webpack_require__(/*! ./astFromValue.mjs */ "../../../node_modules/graphql/utilities/astFromValue.mjs"); var _sortValueNode = __webpack_require__(/*! ./sortValueNode.mjs */ "../../../node_modules/graphql/utilities/sortValueNode.mjs"); -let BreakingChangeType; +var BreakingChangeType; exports.BreakingChangeType = BreakingChangeType; (function (BreakingChangeType) { BreakingChangeType['TYPE_REMOVED'] = 'TYPE_REMOVED'; @@ -34146,7 +35550,7 @@ exports.BreakingChangeType = BreakingChangeType; BreakingChangeType['DIRECTIVE_REPEATABLE_REMOVED'] = 'DIRECTIVE_REPEATABLE_REMOVED'; BreakingChangeType['DIRECTIVE_LOCATION_REMOVED'] = 'DIRECTIVE_LOCATION_REMOVED'; })(BreakingChangeType || (exports.BreakingChangeType = BreakingChangeType = {})); -let DangerousChangeType; +var DangerousChangeType; exports.DangerousChangeType = DangerousChangeType; (function (DangerousChangeType) { DangerousChangeType['VALUE_ADDED_TO_ENUM'] = 'VALUE_ADDED_TO_ENUM'; @@ -34156,7 +35560,6 @@ exports.DangerousChangeType = DangerousChangeType; DangerousChangeType['IMPLEMENTED_INTERFACE_ADDED'] = 'IMPLEMENTED_INTERFACE_ADDED'; DangerousChangeType['ARG_DEFAULT_VALUE_CHANGE'] = 'ARG_DEFAULT_VALUE_CHANGE'; })(DangerousChangeType || (exports.DangerousChangeType = DangerousChangeType = {})); - /** * Given two schemas, returns an Array containing descriptions of all the types * of breaking changes covered by the other functions down below. @@ -34630,6 +36033,14 @@ function getIntrospectionQuery(options) { ofType { kind name + ofType { + kind + name + ofType { + kind + name + } + } } } } @@ -37569,7 +38980,7 @@ function findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPai return [[responseName, `"${name1}" and "${name2}" are different fields`], [node1], [node2]]; } // Two field calls must have the same arguments. - if (stringifyArguments(node1) !== stringifyArguments(node2)) { + if (!sameArguments(node1, node2)) { return [[responseName, 'they have differing arguments'], [node1], [node2]]; } } // The return type for each field. @@ -37589,21 +39000,41 @@ function findConflict(context, cachedFieldsAndFragmentNames, comparedFragmentPai return subfieldConflicts(conflicts, responseName, node1, node2); } } -function stringifyArguments(fieldNode) { - var _fieldNode$arguments; +function sameArguments(node1, node2) { + const args1 = node1.arguments; + const args2 = node2.arguments; + if (args1 === undefined || args1.length === 0) { + return args2 === undefined || args2.length === 0; + } + if (args2 === undefined || args2.length === 0) { + return false; + } + /* c8 ignore next */ - // FIXME https://github.com/graphql/graphql-js/issues/2203 - const args = /* c8 ignore next */ - (_fieldNode$arguments = fieldNode.arguments) !== null && _fieldNode$arguments !== void 0 ? _fieldNode$arguments : []; - const inputObjectWithArgs = { - kind: _kinds.Kind.OBJECT, - fields: args.map(argNode => ({ - kind: _kinds.Kind.OBJECT_FIELD, - name: argNode.name, - value: argNode.value - })) - }; - return (0, _printer.print)((0, _sortValueNode.sortValueNode)(inputObjectWithArgs)); + if (args1.length !== args2.length) { + /* c8 ignore next */ + return false; + /* c8 ignore next */ + } + + const values2 = new Map(args2.map(_ref2 => { + let { + name, + value + } = _ref2; + return [name.value, value]; + })); + return args1.every(arg1 => { + const value1 = arg1.value; + const value2 = values2.get(arg1.name.value); + if (value2 === undefined) { + return false; + } + return stringifyValue(value1) === stringifyValue(value2); + }); +} +function stringifyValue(value) { + return (0, _printer.print)((0, _sortValueNode.sortValueNode)(value)); } // Two types conflict if both types could not apply to a value simultaneously. // Composite types are ignored as their individual field types will be compared // later recursively. However List and Non-Null types must match. @@ -37686,14 +39117,14 @@ function _collectFieldsAndFragmentNames(context, parentType, selectionSet, nodeA function subfieldConflicts(conflicts, responseName, node1, node2) { if (conflicts.length > 0) { - return [[responseName, conflicts.map(_ref2 => { - let [reason] = _ref2; + return [[responseName, conflicts.map(_ref3 => { + let [reason] = _ref3; return reason; - })], [node1, ...conflicts.map(_ref3 => { - let [, fields1] = _ref3; + })], [node1, ...conflicts.map(_ref4 => { + let [, fields1] = _ref4; return fields1; - }).flat()], [node2, ...conflicts.map(_ref4 => { - let [,, fields2] = _ref4; + }).flat()], [node2, ...conflicts.map(_ref5 => { + let [,, fields2] = _ref5; return fields2; }).flat()]]; } @@ -39425,15 +40856,15 @@ exports.versionInfo = exports.version = void 0; /** * A string containing the version of the GraphQL.js library */ -const version = '16.5.0'; +const version = '16.8.1'; /** * An object containing the components of the GraphQL.js version string */ exports.version = version; const versionInfo = Object.freeze({ major: 16, - minor: 5, - patch: 0, + minor: 8, + patch: 1, preReleaseTag: null }); exports.versionInfo = versionInfo; @@ -39574,7433 +41005,6 @@ module.exports = function isObject(val) { /***/ }), -/***/ "../../../node_modules/linkify-it/index.js": -/*!*************************************************!*\ - !*** ../../../node_modules/linkify-it/index.js ***! - \*************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - - -//////////////////////////////////////////////////////////////////////////////// -// Helpers - -// Merge objects -// -function assign(obj /*from1, from2, from3, ...*/) { - var sources = Array.prototype.slice.call(arguments, 1); - sources.forEach(function (source) { - if (!source) { - return; - } - Object.keys(source).forEach(function (key) { - obj[key] = source[key]; - }); - }); - return obj; -} -function _class(obj) { - return Object.prototype.toString.call(obj); -} -function isString(obj) { - return _class(obj) === '[object String]'; -} -function isObject(obj) { - return _class(obj) === '[object Object]'; -} -function isRegExp(obj) { - return _class(obj) === '[object RegExp]'; -} -function isFunction(obj) { - return _class(obj) === '[object Function]'; -} -function escapeRE(str) { - return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); -} - -//////////////////////////////////////////////////////////////////////////////// - -var defaultOptions = { - fuzzyLink: true, - fuzzyEmail: true, - fuzzyIP: false -}; -function isOptionsObj(obj) { - return Object.keys(obj || {}).reduce(function (acc, k) { - return acc || defaultOptions.hasOwnProperty(k); - }, false); -} -var defaultSchemas = { - 'http:': { - validate: function (text, pos, self) { - var tail = text.slice(pos); - if (!self.re.http) { - // compile lazily, because "host"-containing variables can change on tlds update. - self.re.http = new RegExp('^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'); - } - if (self.re.http.test(tail)) { - return tail.match(self.re.http)[0].length; - } - return 0; - } - }, - 'https:': 'http:', - 'ftp:': 'http:', - '//': { - validate: function (text, pos, self) { - var tail = text.slice(pos); - if (!self.re.no_http) { - // compile lazily, because "host"-containing variables can change on tlds update. - self.re.no_http = new RegExp('^' + self.re.src_auth + - // Don't allow single-level domains, because of false positives like '//test' - // with code comments - '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' + self.re.src_port + self.re.src_host_terminator + self.re.src_path, 'i'); - } - if (self.re.no_http.test(tail)) { - // should not be `://` & `///`, that protects from errors in protocol name - if (pos >= 3 && text[pos - 3] === ':') { - return 0; - } - if (pos >= 3 && text[pos - 3] === '/') { - return 0; - } - return tail.match(self.re.no_http)[0].length; - } - return 0; - } - }, - 'mailto:': { - validate: function (text, pos, self) { - var tail = text.slice(pos); - if (!self.re.mailto) { - self.re.mailto = new RegExp('^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'); - } - if (self.re.mailto.test(tail)) { - return tail.match(self.re.mailto)[0].length; - } - return 0; - } - } -}; - -/*eslint-disable max-len*/ - -// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js) -var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'; - -// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead -var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|'); - -/*eslint-enable max-len*/ - -//////////////////////////////////////////////////////////////////////////////// - -function resetScanCache(self) { - self.__index__ = -1; - self.__text_cache__ = ''; -} -function createValidator(re) { - return function (text, pos) { - var tail = text.slice(pos); - if (re.test(tail)) { - return tail.match(re)[0].length; - } - return 0; - }; -} -function createNormalizer() { - return function (match, self) { - self.normalize(match); - }; -} - -// Schemas compiler. Build regexps. -// -function compile(self) { - // Load & clone RE patterns. - var re = self.re = __webpack_require__(/*! ./lib/re */ "../../../node_modules/linkify-it/lib/re.js")(self.__opts__); - - // Define dynamic patterns - var tlds = self.__tlds__.slice(); - self.onCompile(); - if (!self.__tlds_replaced__) { - tlds.push(tlds_2ch_src_re); - } - tlds.push(re.src_xn); - re.src_tlds = tlds.join('|'); - function untpl(tpl) { - return tpl.replace('%TLDS%', re.src_tlds); - } - re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i'); - re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i'); - re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i'); - re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i'); - - // - // Compile each schema - // - - var aliases = []; - self.__compiled__ = {}; // Reset compiled data - - function schemaError(name, val) { - throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); - } - Object.keys(self.__schemas__).forEach(function (name) { - var val = self.__schemas__[name]; - - // skip disabled methods - if (val === null) { - return; - } - var compiled = { - validate: null, - link: null - }; - self.__compiled__[name] = compiled; - if (isObject(val)) { - if (isRegExp(val.validate)) { - compiled.validate = createValidator(val.validate); - } else if (isFunction(val.validate)) { - compiled.validate = val.validate; - } else { - schemaError(name, val); - } - if (isFunction(val.normalize)) { - compiled.normalize = val.normalize; - } else if (!val.normalize) { - compiled.normalize = createNormalizer(); - } else { - schemaError(name, val); - } - return; - } - if (isString(val)) { - aliases.push(name); - return; - } - schemaError(name, val); - }); - - // - // Compile postponed aliases - // - - aliases.forEach(function (alias) { - if (!self.__compiled__[self.__schemas__[alias]]) { - // Silently fail on missed schemas to avoid errons on disable. - // schemaError(alias, self.__schemas__[alias]); - return; - } - self.__compiled__[alias].validate = self.__compiled__[self.__schemas__[alias]].validate; - self.__compiled__[alias].normalize = self.__compiled__[self.__schemas__[alias]].normalize; - }); - - // - // Fake record for guessed links - // - self.__compiled__[''] = { - validate: null, - normalize: createNormalizer() - }; - - // - // Build schema condition - // - var slist = Object.keys(self.__compiled__).filter(function (name) { - // Filter disabled & fake schemas - return name.length > 0 && self.__compiled__[name]; - }).map(escapeRE).join('|'); - // (?!_) cause 1.5x slowdown - self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); - self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); - self.re.pretest = RegExp('(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', 'i'); - - // - // Cleanup - // - - resetScanCache(self); -} - -/** - * class Match - * - * Match result. Single element of array, returned by [[LinkifyIt#match]] - **/ -function Match(self, shift) { - var start = self.__index__, - end = self.__last_index__, - text = self.__text_cache__.slice(start, end); - - /** - * Match#schema -> String - * - * Prefix (protocol) for matched string. - **/ - this.schema = self.__schema__.toLowerCase(); - /** - * Match#index -> Number - * - * First position of matched string. - **/ - this.index = start + shift; - /** - * Match#lastIndex -> Number - * - * Next position after matched string. - **/ - this.lastIndex = end + shift; - /** - * Match#raw -> String - * - * Matched string. - **/ - this.raw = text; - /** - * Match#text -> String - * - * Notmalized text of matched string. - **/ - this.text = text; - /** - * Match#url -> String - * - * Normalized url of matched string. - **/ - this.url = text; -} -function createMatch(self, shift) { - var match = new Match(self, shift); - self.__compiled__[match.schema].normalize(match, self); - return match; -} - -/** - * class LinkifyIt - **/ - -/** - * new LinkifyIt(schemas, options) - * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) - * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } - * - * Creates new linkifier instance with optional additional schemas. - * Can be called without `new` keyword for convenience. - * - * By default understands: - * - * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links - * - "fuzzy" links and emails (example.com, foo@bar.com). - * - * `schemas` is an object, where each key/value describes protocol/rule: - * - * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` - * for example). `linkify-it` makes shure that prefix is not preceeded with - * alphanumeric char and symbols. Only whitespaces and punctuation allowed. - * - __value__ - rule to check tail after link prefix - * - _String_ - just alias to existing rule - * - _Object_ - * - _validate_ - validator function (should return matched length on success), - * or `RegExp`. - * - _normalize_ - optional function to normalize text & url of matched result - * (for example, for @twitter mentions). - * - * `options`: - * - * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`. - * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts - * like version numbers. Default `false`. - * - __fuzzyEmail__ - recognize emails without `mailto:` prefix. - * - **/ -function LinkifyIt(schemas, options) { - if (!(this instanceof LinkifyIt)) { - return new LinkifyIt(schemas, options); - } - if (!options) { - if (isOptionsObj(schemas)) { - options = schemas; - schemas = {}; - } - } - this.__opts__ = assign({}, defaultOptions, options); - - // Cache last tested result. Used to skip repeating steps on next `match` call. - this.__index__ = -1; - this.__last_index__ = -1; // Next scan position - this.__schema__ = ''; - this.__text_cache__ = ''; - this.__schemas__ = assign({}, defaultSchemas, schemas); - this.__compiled__ = {}; - this.__tlds__ = tlds_default; - this.__tlds_replaced__ = false; - this.re = {}; - compile(this); -} - -/** chainable - * LinkifyIt#add(schema, definition) - * - schema (String): rule name (fixed pattern prefix) - * - definition (String|RegExp|Object): schema definition - * - * Add new rule definition. See constructor description for details. - **/ -LinkifyIt.prototype.add = function add(schema, definition) { - this.__schemas__[schema] = definition; - compile(this); - return this; -}; - -/** chainable - * LinkifyIt#set(options) - * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } - * - * Set recognition options for links without schema. - **/ -LinkifyIt.prototype.set = function set(options) { - this.__opts__ = assign(this.__opts__, options); - return this; -}; - -/** - * LinkifyIt#test(text) -> Boolean - * - * Searches linkifiable pattern and returns `true` on success or `false` on fail. - **/ -LinkifyIt.prototype.test = function test(text) { - // Reset scan cache - this.__text_cache__ = text; - this.__index__ = -1; - if (!text.length) { - return false; - } - var m, ml, me, len, shift, next, re, tld_pos, at_pos; - - // try to scan for link with schema - that's the most simple rule - if (this.re.schema_test.test(text)) { - re = this.re.schema_search; - re.lastIndex = 0; - while ((m = re.exec(text)) !== null) { - len = this.testSchemaAt(text, m[2], re.lastIndex); - if (len) { - this.__schema__ = m[2]; - this.__index__ = m.index + m[1].length; - this.__last_index__ = m.index + m[0].length + len; - break; - } - } - } - if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { - // guess schemaless links - tld_pos = text.search(this.re.host_fuzzy_test); - if (tld_pos >= 0) { - // if tld is located after found link - no need to check fuzzy pattern - if (this.__index__ < 0 || tld_pos < this.__index__) { - if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { - shift = ml.index + ml[1].length; - if (this.__index__ < 0 || shift < this.__index__) { - this.__schema__ = ''; - this.__index__ = shift; - this.__last_index__ = ml.index + ml[0].length; - } - } - } - } - } - if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { - // guess schemaless emails - at_pos = text.indexOf('@'); - if (at_pos >= 0) { - // We can't skip this check, because this cases are possible: - // 192.168.1.1@gmail.com, my.in@example.com - if ((me = text.match(this.re.email_fuzzy)) !== null) { - shift = me.index + me[1].length; - next = me.index + me[0].length; - if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) { - this.__schema__ = 'mailto:'; - this.__index__ = shift; - this.__last_index__ = next; - } - } - } - } - return this.__index__ >= 0; -}; - -/** - * LinkifyIt#pretest(text) -> Boolean - * - * Very quick check, that can give false positives. Returns true if link MAY BE - * can exists. Can be used for speed optimization, when you need to check that - * link NOT exists. - **/ -LinkifyIt.prototype.pretest = function pretest(text) { - return this.re.pretest.test(text); -}; - -/** - * LinkifyIt#testSchemaAt(text, name, position) -> Number - * - text (String): text to scan - * - name (String): rule (schema) name - * - position (Number): text offset to check from - * - * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly - * at given position. Returns length of found pattern (0 on fail). - **/ -LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) { - // If not supported schema check requested - terminate - if (!this.__compiled__[schema.toLowerCase()]) { - return 0; - } - return this.__compiled__[schema.toLowerCase()].validate(text, pos, this); -}; - -/** - * LinkifyIt#match(text) -> Array|null - * - * Returns array of found link descriptions or `null` on fail. We strongly - * recommend to use [[LinkifyIt#test]] first, for best speed. - * - * ##### Result match description - * - * - __schema__ - link schema, can be empty for fuzzy links, or `//` for - * protocol-neutral links. - * - __index__ - offset of matched text - * - __lastIndex__ - index of next char after mathch end - * - __raw__ - matched text - * - __text__ - normalized text - * - __url__ - link, generated from matched text - **/ -LinkifyIt.prototype.match = function match(text) { - var shift = 0, - result = []; - - // Try to take previous element from cache, if .test() called before - if (this.__index__ >= 0 && this.__text_cache__ === text) { - result.push(createMatch(this, shift)); - shift = this.__last_index__; - } - - // Cut head if cache was used - var tail = shift ? text.slice(shift) : text; - - // Scan string until end reached - while (this.test(tail)) { - result.push(createMatch(this, shift)); - tail = tail.slice(this.__last_index__); - shift += this.__last_index__; - } - if (result.length) { - return result; - } - return null; -}; - -/** chainable - * LinkifyIt#tlds(list [, keepOld]) -> this - * - list (Array): list of tlds - * - keepOld (Boolean): merge with current list if `true` (`false` by default) - * - * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) - * to avoid false positives. By default this algorythm used: - * - * - hostname with any 2-letter root zones are ok. - * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф - * are ok. - * - encoded (`xn--...`) root zones are ok. - * - * If list is replaced, then exact match for 2-chars root zones will be checked. - **/ -LinkifyIt.prototype.tlds = function tlds(list, keepOld) { - list = Array.isArray(list) ? list : [list]; - if (!keepOld) { - this.__tlds__ = list.slice(); - this.__tlds_replaced__ = true; - compile(this); - return this; - } - this.__tlds__ = this.__tlds__.concat(list).sort().filter(function (el, idx, arr) { - return el !== arr[idx - 1]; - }).reverse(); - compile(this); - return this; -}; - -/** - * LinkifyIt#normalize(match) - * - * Default normalizer (if schema does not define it's own). - **/ -LinkifyIt.prototype.normalize = function normalize(match) { - // Do minimal possible changes by default. Need to collect feedback prior - // to move forward https://github.com/markdown-it/linkify-it/issues/1 - - if (!match.schema) { - match.url = 'http://' + match.url; - } - if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { - match.url = 'mailto:' + match.url; - } -}; - -/** - * LinkifyIt#onCompile() - * - * Override to modify basic RegExp-s. - **/ -LinkifyIt.prototype.onCompile = function onCompile() {}; -module.exports = LinkifyIt; - -/***/ }), - -/***/ "../../../node_modules/linkify-it/lib/re.js": -/*!**************************************************!*\ - !*** ../../../node_modules/linkify-it/lib/re.js ***! - \**************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - - -module.exports = function (opts) { - var re = {}; - - // Use direct extract instead of `regenerate` to reduse browserified size - re.src_Any = (__webpack_require__(/*! uc.micro/properties/Any/regex */ "../../../node_modules/uc.micro/properties/Any/regex.js").source); - re.src_Cc = (__webpack_require__(/*! uc.micro/categories/Cc/regex */ "../../../node_modules/uc.micro/categories/Cc/regex.js").source); - re.src_Z = (__webpack_require__(/*! uc.micro/categories/Z/regex */ "../../../node_modules/uc.micro/categories/Z/regex.js").source); - re.src_P = (__webpack_require__(/*! uc.micro/categories/P/regex */ "../../../node_modules/uc.micro/categories/P/regex.js").source); - - // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation) - re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|'); - - // \p{\Z\Cc} (white spaces + control) - re.src_ZCc = [re.src_Z, re.src_Cc].join('|'); - - // Experimental. List of chars, completely prohibited in links - // because can separate it from other part of text - var text_separators = '[><\uff5c]'; - - // All possible word characters (everything without punctuation, spaces & controls) - // Defined via punctuation & spaces to save space - // Should be something like \p{\L\N\S\M} (\w but without `_`) - re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'; - // The same as abothe but without [0-9] - // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')'; - - //////////////////////////////////////////////////////////////////////////////// - - re.src_ip4 = '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; - - // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch. - re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?'; - re.src_port = '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'; - re.src_host_terminator = '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; - re.src_path = '(?:' + '[/?#]' + '(?:' + '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-;]).|' + '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + - // allow `I'm_king` if no pair found - '\\.{2,}[a-zA-Z0-9%/&]|' + - // google has many dots in "google search" links (#66, #81). - // github has ... in commit range links, - // Restrict to - // - english - // - percent-encoded - // - parts of file path - // - params separator - // until more examples found. - '\\.(?!' + re.src_ZCc + '|[.]).|' + (opts && opts['---'] ? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate - : '\\-+|') + ',(?!' + re.src_ZCc + ').|' + - // allow `,,,` in paths - ';(?!' + re.src_ZCc + ').|' + - // allow `;` if not followed by space-like char - '\\!+(?!' + re.src_ZCc + '|[!]).|' + - // allow `!!!` in paths, but not at the end - '\\?(?!' + re.src_ZCc + '|[?]).' + ')+' + '|\\/' + ')?'; - - // Allow anything in markdown spec, forbid quote (") at the first position - // because emails enclosed in quotes are far more common - re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; - re.src_xn = 'xn--[a-z0-9\\-]{1,59}'; - - // More to read about domain names - // http://serverfault.com/questions/638260/ - - re.src_domain_root = - // Allow letters & digits (http://test1) - '(?:' + re.src_xn + '|' + re.src_pseudo_letter + '{1,63}' + ')'; - re.src_domain = '(?:' + re.src_xn + '|' + '(?:' + re.src_pseudo_letter + ')' + '|' + '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' + ')'; - re.src_host = '(?:' + - // Don't need IP check, because digits are already allowed in normal domain names - // src_ip4 + - // '|' + - '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain /*_root*/ + ')' + ')'; - re.tpl_host_fuzzy = '(?:' + re.src_ip4 + '|' + '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' + ')'; - re.tpl_host_no_ip_fuzzy = '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))'; - re.src_host_strict = re.src_host + re.src_host_terminator; - re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator; - re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator; - re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator; - re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator; - - //////////////////////////////////////////////////////////////////////////////// - // Main rules - - // Rude test fuzzy links by host, for quick deny - re.tpl_host_fuzzy_test = 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'; - re.tpl_email_fuzzy = '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' + '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; - re.tpl_link_fuzzy = - // Fuzzy link can't be prepended with .:/\- and non punctuation. - // but can start with > (markdown blockquote) - '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; - re.tpl_link_no_ip_fuzzy = - // Fuzzy link can't be prepended with .:/\- and non punctuation. - // but can start with > (markdown blockquote) - '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; - return re; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/index.js": -/*!**************************************************!*\ - !*** ../../../node_modules/markdown-it/index.js ***! - \**************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - - -module.exports = __webpack_require__(/*! ./lib/ */ "../../../node_modules/markdown-it/lib/index.js"); - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/common/entities.js": -/*!****************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/common/entities.js ***! - \****************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// HTML5 entities map: { name -> utf16string } -// - - -/*eslint quotes:0*/ -module.exports = __webpack_require__(/*! entities/lib/maps/entities.json */ "../../../node_modules/entities/lib/maps/entities.json"); - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/common/html_blocks.js": -/*!*******************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/common/html_blocks.js ***! - \*******************************************************************/ -/***/ (function(module) { - -// List of valid html blocks names, accorting to commonmark spec -// http://jgm.github.io/CommonMark/spec.html#html-blocks - - - -module.exports = ['address', 'article', 'aside', 'base', 'basefont', 'blockquote', 'body', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dialog', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'iframe', 'legend', 'li', 'link', 'main', 'menu', 'menuitem', 'nav', 'noframes', 'ol', 'optgroup', 'option', 'p', 'param', 'section', 'source', 'summary', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul']; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/common/html_re.js": -/*!***************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/common/html_re.js ***! - \***************************************************************/ -/***/ (function(module) { - -// Regexps to match html elements - - - -var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; -var unquoted = '[^"\'=<>`\\x00-\\x20]+'; -var single_quoted = "'[^']*'"; -var double_quoted = '"[^"]*"'; -var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; -var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; -var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; -var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; -var comment = '|'; -var processing = '<[?][\\s\\S]*?[?]>'; -var declaration = ']*>'; -var cdata = ''; -var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + '|' + processing + '|' + declaration + '|' + cdata + ')'); -var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); -module.exports.HTML_TAG_RE = HTML_TAG_RE; -module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/common/utils.js": -/*!*************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/common/utils.js ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -// Utilities -// - - -function _class(obj) { - return Object.prototype.toString.call(obj); -} -function isString(obj) { - return _class(obj) === '[object String]'; -} -var _hasOwnProperty = Object.prototype.hasOwnProperty; -function has(object, key) { - return _hasOwnProperty.call(object, key); -} - -// Merge objects -// -function assign(obj /*from1, from2, from3, ...*/) { - var sources = Array.prototype.slice.call(arguments, 1); - sources.forEach(function (source) { - if (!source) { - return; - } - if (typeof source !== 'object') { - throw new TypeError(source + 'must be object'); - } - Object.keys(source).forEach(function (key) { - obj[key] = source[key]; - }); - }); - return obj; -} - -// Remove element from array and put another array at those position. -// Useful for some operations with tokens -function arrayReplaceAt(src, pos, newElements) { - return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); -} - -//////////////////////////////////////////////////////////////////////////////// - -function isValidEntityCode(c) { - /*eslint no-bitwise:0*/ - // broken sequence - if (c >= 0xD800 && c <= 0xDFFF) { - return false; - } - // never used - if (c >= 0xFDD0 && c <= 0xFDEF) { - return false; - } - if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { - return false; - } - // control codes - if (c >= 0x00 && c <= 0x08) { - return false; - } - if (c === 0x0B) { - return false; - } - if (c >= 0x0E && c <= 0x1F) { - return false; - } - if (c >= 0x7F && c <= 0x9F) { - return false; - } - // out of range - if (c > 0x10FFFF) { - return false; - } - return true; -} -function fromCodePoint(c) { - /*eslint no-bitwise:0*/ - if (c > 0xffff) { - c -= 0x10000; - var surrogate1 = 0xd800 + (c >> 10), - surrogate2 = 0xdc00 + (c & 0x3ff); - return String.fromCharCode(surrogate1, surrogate2); - } - return String.fromCharCode(c); -} -var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g; -var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; -var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi'); -var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i; -var entities = __webpack_require__(/*! ./entities */ "../../../node_modules/markdown-it/lib/common/entities.js"); -function replaceEntityPattern(match, name) { - var code = 0; - if (has(entities, name)) { - return entities[name]; - } - if (name.charCodeAt(0) === 0x23 /* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { - code = name[1].toLowerCase() === 'x' ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10); - if (isValidEntityCode(code)) { - return fromCodePoint(code); - } - } - return match; -} - -/*function replaceEntities(str) { - if (str.indexOf('&') < 0) { return str; } - - return str.replace(ENTITY_RE, replaceEntityPattern); -}*/ - -function unescapeMd(str) { - if (str.indexOf('\\') < 0) { - return str; - } - return str.replace(UNESCAPE_MD_RE, '$1'); -} -function unescapeAll(str) { - if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { - return str; - } - return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) { - if (escaped) { - return escaped; - } - return replaceEntityPattern(match, entity); - }); -} - -//////////////////////////////////////////////////////////////////////////////// - -var HTML_ESCAPE_TEST_RE = /[&<>"]/; -var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; -var HTML_REPLACEMENTS = { - '&': '&', - '<': '<', - '>': '>', - '"': '"' -}; -function replaceUnsafeChar(ch) { - return HTML_REPLACEMENTS[ch]; -} -function escapeHtml(str) { - if (HTML_ESCAPE_TEST_RE.test(str)) { - return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); - } - return str; -} - -//////////////////////////////////////////////////////////////////////////////// - -var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; -function escapeRE(str) { - return str.replace(REGEXP_ESCAPE_RE, '\\$&'); -} - -//////////////////////////////////////////////////////////////////////////////// - -function isSpace(code) { - switch (code) { - case 0x09: - case 0x20: - return true; - } - return false; -} - -// Zs (unicode class) || [\t\f\v\r\n] -function isWhiteSpace(code) { - if (code >= 0x2000 && code <= 0x200A) { - return true; - } - switch (code) { - case 0x09: // \t - case 0x0A: // \n - case 0x0B: // \v - case 0x0C: // \f - case 0x0D: // \r - case 0x20: - case 0xA0: - case 0x1680: - case 0x202F: - case 0x205F: - case 0x3000: - return true; - } - return false; -} - -//////////////////////////////////////////////////////////////////////////////// - -/*eslint-disable max-len*/ -var UNICODE_PUNCT_RE = __webpack_require__(/*! uc.micro/categories/P/regex */ "../../../node_modules/uc.micro/categories/P/regex.js"); - -// Currently without astral characters support. -function isPunctChar(ch) { - return UNICODE_PUNCT_RE.test(ch); -} - -// Markdown ASCII punctuation characters. -// -// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ -// http://spec.commonmark.org/0.15/#ascii-punctuation-character -// -// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. -// -function isMdAsciiPunct(ch) { - switch (ch) { - case 0x21 /* ! */: - case 0x22 /* " */: - case 0x23 /* # */: - case 0x24 /* $ */: - case 0x25 /* % */: - case 0x26 /* & */: - case 0x27 /* ' */: - case 0x28 /* ( */: - case 0x29 /* ) */: - case 0x2A /* * */: - case 0x2B /* + */: - case 0x2C /* , */: - case 0x2D /* - */: - case 0x2E /* . */: - case 0x2F /* / */: - case 0x3A /* : */: - case 0x3B /* ; */: - case 0x3C /* < */: - case 0x3D /* = */: - case 0x3E /* > */: - case 0x3F /* ? */: - case 0x40 /* @ */: - case 0x5B /* [ */: - case 0x5C /* \ */: - case 0x5D /* ] */: - case 0x5E /* ^ */: - case 0x5F /* _ */: - case 0x60 /* ` */: - case 0x7B /* { */: - case 0x7C /* | */: - case 0x7D /* } */: - case 0x7E /* ~ */: - return true; - default: - return false; - } -} - -// Hepler to unify [reference labels]. -// -function normalizeReference(str) { - // Trim and collapse whitespace - // - str = str.trim().replace(/\s+/g, ' '); - - // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug - // fixed in v12 (couldn't find any details). - // - // So treat this one as a special case - // (remove this when node v10 is no longer supported). - // - if ('ẞ'.toLowerCase() === 'Ṿ') { - str = str.replace(/ẞ/g, 'ß'); - } - - // .toLowerCase().toUpperCase() should get rid of all differences - // between letter variants. - // - // Simple .toLowerCase() doesn't normalize 125 code points correctly, - // and .toUpperCase doesn't normalize 6 of them (list of exceptions: - // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently - // uppercased versions). - // - // Here's an example showing how it happens. Lets take greek letter omega: - // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ) - // - // Unicode entries: - // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8; - // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 - // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 - // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8; - // - // Case-insensitive comparison should treat all of them as equivalent. - // - // But .toLowerCase() doesn't change ϑ (it's already lowercase), - // and .toUpperCase() doesn't change ϴ (already uppercase). - // - // Applying first lower then upper case normalizes any character: - // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398' - // - // Note: this is equivalent to unicode case folding; unicode normalization - // is a different step that is not required here. - // - // Final result should be uppercased, because it's later stored in an object - // (this avoid a conflict with Object.prototype members, - // most notably, `__proto__`) - // - return str.toLowerCase().toUpperCase(); -} - -//////////////////////////////////////////////////////////////////////////////// - -// Re-export libraries commonly used in both markdown-it and its plugins, -// so plugins won't have to depend on them explicitly, which reduces their -// bundled size (e.g. a browser build). -// -exports.lib = {}; -exports.lib.mdurl = __webpack_require__(/*! mdurl */ "../../../node_modules/mdurl/index.js"); -exports.lib.ucmicro = __webpack_require__(/*! uc.micro */ "../../../node_modules/uc.micro/index.js"); -exports.assign = assign; -exports.isString = isString; -exports.has = has; -exports.unescapeMd = unescapeMd; -exports.unescapeAll = unescapeAll; -exports.isValidEntityCode = isValidEntityCode; -exports.fromCodePoint = fromCodePoint; -// exports.replaceEntities = replaceEntities; -exports.escapeHtml = escapeHtml; -exports.arrayReplaceAt = arrayReplaceAt; -exports.isSpace = isSpace; -exports.isWhiteSpace = isWhiteSpace; -exports.isMdAsciiPunct = isMdAsciiPunct; -exports.isPunctChar = isPunctChar; -exports.escapeRE = escapeRE; -exports.normalizeReference = normalizeReference; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/helpers/index.js": -/*!**************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/helpers/index.js ***! - \**************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -// Just a shortcut for bulk export - - -exports.parseLinkLabel = __webpack_require__(/*! ./parse_link_label */ "../../../node_modules/markdown-it/lib/helpers/parse_link_label.js"); -exports.parseLinkDestination = __webpack_require__(/*! ./parse_link_destination */ "../../../node_modules/markdown-it/lib/helpers/parse_link_destination.js"); -exports.parseLinkTitle = __webpack_require__(/*! ./parse_link_title */ "../../../node_modules/markdown-it/lib/helpers/parse_link_title.js"); - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/helpers/parse_link_destination.js": -/*!*******************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/helpers/parse_link_destination.js ***! - \*******************************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Parse link destination -// - - -var unescapeAll = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").unescapeAll); -module.exports = function parseLinkDestination(str, pos, max) { - var code, - level, - lines = 0, - start = pos, - result = { - ok: false, - pos: 0, - lines: 0, - str: '' - }; - if (str.charCodeAt(pos) === 0x3C /* < */) { - pos++; - while (pos < max) { - code = str.charCodeAt(pos); - if (code === 0x0A /* \n */) { - return result; - } - if (code === 0x3C /* < */) { - return result; - } - if (code === 0x3E /* > */) { - result.pos = pos + 1; - result.str = unescapeAll(str.slice(start + 1, pos)); - result.ok = true; - return result; - } - if (code === 0x5C /* \ */ && pos + 1 < max) { - pos += 2; - continue; - } - pos++; - } - - // no closing '>' - return result; - } - - // this should be ... } else { ... branch - - level = 0; - while (pos < max) { - code = str.charCodeAt(pos); - if (code === 0x20) { - break; - } - - // ascii control characters - if (code < 0x20 || code === 0x7F) { - break; - } - if (code === 0x5C /* \ */ && pos + 1 < max) { - if (str.charCodeAt(pos + 1) === 0x20) { - break; - } - pos += 2; - continue; - } - if (code === 0x28 /* ( */) { - level++; - if (level > 32) { - return result; - } - } - if (code === 0x29 /* ) */) { - if (level === 0) { - break; - } - level--; - } - pos++; - } - if (start === pos) { - return result; - } - if (level !== 0) { - return result; - } - result.str = unescapeAll(str.slice(start, pos)); - result.lines = lines; - result.pos = pos; - result.ok = true; - return result; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/helpers/parse_link_label.js": -/*!*************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/helpers/parse_link_label.js ***! - \*************************************************************************/ -/***/ (function(module) { - -// Parse link label -// -// this function assumes that first character ("[") already matches; -// returns the end of the label -// - - -module.exports = function parseLinkLabel(state, start, disableNested) { - var level, - found, - marker, - prevPos, - labelEnd = -1, - max = state.posMax, - oldPos = state.pos; - state.pos = start + 1; - level = 1; - while (state.pos < max) { - marker = state.src.charCodeAt(state.pos); - if (marker === 0x5D /* ] */) { - level--; - if (level === 0) { - found = true; - break; - } - } - prevPos = state.pos; - state.md.inline.skipToken(state); - if (marker === 0x5B /* [ */) { - if (prevPos === state.pos - 1) { - // increase level if we find text `[`, which is not a part of any token - level++; - } else if (disableNested) { - state.pos = oldPos; - return -1; - } - } - } - if (found) { - labelEnd = state.pos; - } - - // restore old state - state.pos = oldPos; - return labelEnd; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/helpers/parse_link_title.js": -/*!*************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/helpers/parse_link_title.js ***! - \*************************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Parse link title -// - - -var unescapeAll = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").unescapeAll); -module.exports = function parseLinkTitle(str, pos, max) { - var code, - marker, - lines = 0, - start = pos, - result = { - ok: false, - pos: 0, - lines: 0, - str: '' - }; - if (pos >= max) { - return result; - } - marker = str.charCodeAt(pos); - if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { - return result; - } - pos++; - - // if opening marker is "(", switch it to closing marker ")" - if (marker === 0x28) { - marker = 0x29; - } - while (pos < max) { - code = str.charCodeAt(pos); - if (code === marker) { - result.pos = pos + 1; - result.lines = lines; - result.str = unescapeAll(str.slice(start + 1, pos)); - result.ok = true; - return result; - } else if (code === 0x28 /* ( */ && marker === 0x29 /* ) */) { - return result; - } else if (code === 0x0A) { - lines++; - } else if (code === 0x5C /* \ */ && pos + 1 < max) { - pos++; - if (str.charCodeAt(pos) === 0x0A) { - lines++; - } - } - pos++; - } - return result; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/index.js": -/*!******************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/index.js ***! - \******************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Main parser class - - - -var utils = __webpack_require__(/*! ./common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js"); -var helpers = __webpack_require__(/*! ./helpers */ "../../../node_modules/markdown-it/lib/helpers/index.js"); -var Renderer = __webpack_require__(/*! ./renderer */ "../../../node_modules/markdown-it/lib/renderer.js"); -var ParserCore = __webpack_require__(/*! ./parser_core */ "../../../node_modules/markdown-it/lib/parser_core.js"); -var ParserBlock = __webpack_require__(/*! ./parser_block */ "../../../node_modules/markdown-it/lib/parser_block.js"); -var ParserInline = __webpack_require__(/*! ./parser_inline */ "../../../node_modules/markdown-it/lib/parser_inline.js"); -var LinkifyIt = __webpack_require__(/*! linkify-it */ "../../../node_modules/linkify-it/index.js"); -var mdurl = __webpack_require__(/*! mdurl */ "../../../node_modules/mdurl/index.js"); -var punycode = __webpack_require__(/*! punycode */ "../../../node_modules/punycode/punycode.es6.js"); -var config = { - default: __webpack_require__(/*! ./presets/default */ "../../../node_modules/markdown-it/lib/presets/default.js"), - zero: __webpack_require__(/*! ./presets/zero */ "../../../node_modules/markdown-it/lib/presets/zero.js"), - commonmark: __webpack_require__(/*! ./presets/commonmark */ "../../../node_modules/markdown-it/lib/presets/commonmark.js") -}; - -//////////////////////////////////////////////////////////////////////////////// -// -// This validator can prohibit more than really needed to prevent XSS. It's a -// tradeoff to keep code simple and to be secure by default. -// -// If you need different setup - override validator method as you wish. Or -// replace it with dummy function and use external sanitizer. -// - -var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/; -var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/; -function validateLink(url) { - // url should be normalized at this point, and existing entities are decoded - var str = url.trim().toLowerCase(); - return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) ? true : false : true; -} - -//////////////////////////////////////////////////////////////////////////////// - -var RECODE_HOSTNAME_FOR = ['http:', 'https:', 'mailto:']; -function normalizeLink(url) { - var parsed = mdurl.parse(url, true); - if (parsed.hostname) { - // Encode hostnames in urls like: - // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` - // - // We don't encode unknown schemas, because it's likely that we encode - // something we shouldn't (e.g. `skype:name` treated as `skype:host`) - // - if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { - try { - parsed.hostname = punycode.toASCII(parsed.hostname); - } catch (er) {/**/} - } - } - return mdurl.encode(mdurl.format(parsed)); -} -function normalizeLinkText(url) { - var parsed = mdurl.parse(url, true); - if (parsed.hostname) { - // Encode hostnames in urls like: - // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` - // - // We don't encode unknown schemas, because it's likely that we encode - // something we shouldn't (e.g. `skype:name` treated as `skype:host`) - // - if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { - try { - parsed.hostname = punycode.toUnicode(parsed.hostname); - } catch (er) {/**/} - } - } - - // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720 - return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + '%'); -} - -/** - * class MarkdownIt - * - * Main parser/renderer class. - * - * ##### Usage - * - * ```javascript - * // node.js, "classic" way: - * var MarkdownIt = require('markdown-it'), - * md = new MarkdownIt(); - * var result = md.render('# markdown-it rulezz!'); - * - * // node.js, the same, but with sugar: - * var md = require('markdown-it')(); - * var result = md.render('# markdown-it rulezz!'); - * - * // browser without AMD, added to "window" on script load - * // Note, there are no dash. - * var md = window.markdownit(); - * var result = md.render('# markdown-it rulezz!'); - * ``` - * - * Single line rendering, without paragraph wrap: - * - * ```javascript - * var md = require('markdown-it')(); - * var result = md.renderInline('__markdown-it__ rulezz!'); - * ``` - **/ - -/** - * new MarkdownIt([presetName, options]) - * - presetName (String): optional, `commonmark` / `zero` - * - options (Object) - * - * Creates parser instanse with given config. Can be called without `new`. - * - * ##### presetName - * - * MarkdownIt provides named presets as a convenience to quickly - * enable/disable active syntax rules and options for common use cases. - * - * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) - - * configures parser to strict [CommonMark](http://commonmark.org/) mode. - * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) - - * similar to GFM, used when no preset name given. Enables all available rules, - * but still without html, typographer & autolinker. - * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) - - * all rules disabled. Useful to quickly setup your config via `.enable()`. - * For example, when you need only `bold` and `italic` markup and nothing else. - * - * ##### options: - * - * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful! - * That's not safe! You may need external sanitizer to protect output from XSS. - * It's better to extend features via plugins, instead of enabling HTML. - * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags - * (`
`). This is needed only for full CommonMark compatibility. In real - * world you will need HTML output. - * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `
`. - * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks. - * Can be useful for external highlighters. - * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links. - * - __typographer__ - `false`. Set `true` to enable [some language-neutral - * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) + - * quotes beautification (smartquotes). - * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement - * pairs, when typographer enabled and smartquotes on. For example, you can - * use `'«»„“'` for Russian, `'„“‚‘'` for German, and - * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp). - * - __highlight__ - `null`. Highlighter function for fenced code blocks. - * Highlighter `function (str, lang)` should return escaped HTML. It can also - * return empty string if the source was not changed and should be escaped - * externaly. If result starts with `): - * - * ```javascript - * var hljs = require('highlight.js') // https://highlightjs.org/ - * - * // Actual default values - * var md = require('markdown-it')({ - * highlight: function (str, lang) { - * if (lang && hljs.getLanguage(lang)) { - * try { - * return '

' +
- *                hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
- *                '
'; - * } catch (__) {} - * } - * - * return '
' + md.utils.escapeHtml(str) + '
'; - * } - * }); - * ``` - * - **/ -function MarkdownIt(presetName, options) { - if (!(this instanceof MarkdownIt)) { - return new MarkdownIt(presetName, options); - } - if (!options) { - if (!utils.isString(presetName)) { - options = presetName || {}; - presetName = 'default'; - } - } - - /** - * MarkdownIt#inline -> ParserInline - * - * Instance of [[ParserInline]]. You may need it to add new rules when - * writing plugins. For simple rules control use [[MarkdownIt.disable]] and - * [[MarkdownIt.enable]]. - **/ - this.inline = new ParserInline(); - - /** - * MarkdownIt#block -> ParserBlock - * - * Instance of [[ParserBlock]]. You may need it to add new rules when - * writing plugins. For simple rules control use [[MarkdownIt.disable]] and - * [[MarkdownIt.enable]]. - **/ - this.block = new ParserBlock(); - - /** - * MarkdownIt#core -> Core - * - * Instance of [[Core]] chain executor. You may need it to add new rules when - * writing plugins. For simple rules control use [[MarkdownIt.disable]] and - * [[MarkdownIt.enable]]. - **/ - this.core = new ParserCore(); - - /** - * MarkdownIt#renderer -> Renderer - * - * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering - * rules for new token types, generated by plugins. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * function myToken(tokens, idx, options, env, self) { - * //... - * return result; - * }; - * - * md.renderer.rules['my_token'] = myToken - * ``` - * - * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js). - **/ - this.renderer = new Renderer(); - - /** - * MarkdownIt#linkify -> LinkifyIt - * - * [linkify-it](https://github.com/markdown-it/linkify-it) instance. - * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js) - * rule. - **/ - this.linkify = new LinkifyIt(); - - /** - * MarkdownIt#validateLink(url) -> Boolean - * - * Link validation function. CommonMark allows too much in links. By default - * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas - * except some embedded image types. - * - * You can change this behaviour: - * - * ```javascript - * var md = require('markdown-it')(); - * // enable everything - * md.validateLink = function () { return true; } - * ``` - **/ - this.validateLink = validateLink; - - /** - * MarkdownIt#normalizeLink(url) -> String - * - * Function used to encode link url to a machine-readable format, - * which includes url-encoding, punycode, etc. - **/ - this.normalizeLink = normalizeLink; - - /** - * MarkdownIt#normalizeLinkText(url) -> String - * - * Function used to decode link url to a human-readable format` - **/ - this.normalizeLinkText = normalizeLinkText; - - // Expose utils & helpers for easy acces from plugins - - /** - * MarkdownIt#utils -> utils - * - * Assorted utility functions, useful to write plugins. See details - * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js). - **/ - this.utils = utils; - - /** - * MarkdownIt#helpers -> helpers - * - * Link components parser functions, useful to write plugins. See details - * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers). - **/ - this.helpers = utils.assign({}, helpers); - this.options = {}; - this.configure(presetName); - if (options) { - this.set(options); - } -} - -/** chainable - * MarkdownIt.set(options) - * - * Set parser options (in the same format as in constructor). Probably, you - * will never need it, but you can change options after constructor call. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')() - * .set({ html: true, breaks: true }) - * .set({ typographer, true }); - * ``` - * - * __Note:__ To achieve the best possible performance, don't modify a - * `markdown-it` instance options on the fly. If you need multiple configurations - * it's best to create multiple instances and initialize each with separate - * config. - **/ -MarkdownIt.prototype.set = function (options) { - utils.assign(this.options, options); - return this; -}; - -/** chainable, internal - * MarkdownIt.configure(presets) - * - * Batch load of all options and compenent settings. This is internal method, - * and you probably will not need it. But if you will - see available presets - * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets) - * - * We strongly recommend to use presets instead of direct config loads. That - * will give better compatibility with next versions. - **/ -MarkdownIt.prototype.configure = function (presets) { - var self = this, - presetName; - if (utils.isString(presets)) { - presetName = presets; - presets = config[presetName]; - if (!presets) { - throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); - } - } - if (!presets) { - throw new Error('Wrong `markdown-it` preset, can\'t be empty'); - } - if (presets.options) { - self.set(presets.options); - } - if (presets.components) { - Object.keys(presets.components).forEach(function (name) { - if (presets.components[name].rules) { - self[name].ruler.enableOnly(presets.components[name].rules); - } - if (presets.components[name].rules2) { - self[name].ruler2.enableOnly(presets.components[name].rules2); - } - }); - } - return this; -}; - -/** chainable - * MarkdownIt.enable(list, ignoreInvalid) - * - list (String|Array): rule name or list of rule names to enable - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * Enable list or rules. It will automatically find appropriate components, - * containing rules with given names. If rule not found, and `ignoreInvalid` - * not set - throws exception. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')() - * .enable(['sub', 'sup']) - * .disable('smartquotes'); - * ``` - **/ -MarkdownIt.prototype.enable = function (list, ignoreInvalid) { - var result = []; - if (!Array.isArray(list)) { - list = [list]; - } - ['core', 'block', 'inline'].forEach(function (chain) { - result = result.concat(this[chain].ruler.enable(list, true)); - }, this); - result = result.concat(this.inline.ruler2.enable(list, true)); - var missed = list.filter(function (name) { - return result.indexOf(name) < 0; - }); - if (missed.length && !ignoreInvalid) { - throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed); - } - return this; -}; - -/** chainable - * MarkdownIt.disable(list, ignoreInvalid) - * - list (String|Array): rule name or list of rule names to disable. - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * The same as [[MarkdownIt.enable]], but turn specified rules off. - **/ -MarkdownIt.prototype.disable = function (list, ignoreInvalid) { - var result = []; - if (!Array.isArray(list)) { - list = [list]; - } - ['core', 'block', 'inline'].forEach(function (chain) { - result = result.concat(this[chain].ruler.disable(list, true)); - }, this); - result = result.concat(this.inline.ruler2.disable(list, true)); - var missed = list.filter(function (name) { - return result.indexOf(name) < 0; - }); - if (missed.length && !ignoreInvalid) { - throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed); - } - return this; -}; - -/** chainable - * MarkdownIt.use(plugin, params) - * - * Load specified plugin with given params into current parser instance. - * It's just a sugar to call `plugin(md, params)` with curring. - * - * ##### Example - * - * ```javascript - * var iterator = require('markdown-it-for-inline'); - * var md = require('markdown-it')() - * .use(iterator, 'foo_replace', 'text', function (tokens, idx) { - * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); - * }); - * ``` - **/ -MarkdownIt.prototype.use = function (plugin /*, params, ... */) { - var args = [this].concat(Array.prototype.slice.call(arguments, 1)); - plugin.apply(plugin, args); - return this; -}; - -/** internal - * MarkdownIt.parse(src, env) -> Array - * - src (String): source string - * - env (Object): environment sandbox - * - * Parse input string and return list of block tokens (special token type - * "inline" will contain list of inline tokens). You should not call this - * method directly, until you write custom renderer (for example, to produce - * AST). - * - * `env` is used to pass data between "distributed" rules and return additional - * metadata like reference info, needed for the renderer. It also can be used to - * inject data in specific cases. Usually, you will be ok to pass `{}`, - * and then pass updated object to renderer. - **/ -MarkdownIt.prototype.parse = function (src, env) { - if (typeof src !== 'string') { - throw new Error('Input data should be a String'); - } - var state = new this.core.State(src, this, env); - this.core.process(state); - return state.tokens; -}; - -/** - * MarkdownIt.render(src [, env]) -> String - * - src (String): source string - * - env (Object): environment sandbox - * - * Render markdown string into html. It does all magic for you :). - * - * `env` can be used to inject additional metadata (`{}` by default). - * But you will not need it with high probability. See also comment - * in [[MarkdownIt.parse]]. - **/ -MarkdownIt.prototype.render = function (src, env) { - env = env || {}; - return this.renderer.render(this.parse(src, env), this.options, env); -}; - -/** internal - * MarkdownIt.parseInline(src, env) -> Array - * - src (String): source string - * - env (Object): environment sandbox - * - * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the - * block tokens list with the single `inline` element, containing parsed inline - * tokens in `children` property. Also updates `env` object. - **/ -MarkdownIt.prototype.parseInline = function (src, env) { - var state = new this.core.State(src, this, env); - state.inlineMode = true; - this.core.process(state); - return state.tokens; -}; - -/** - * MarkdownIt.renderInline(src [, env]) -> String - * - src (String): source string - * - env (Object): environment sandbox - * - * Similar to [[MarkdownIt.render]] but for single paragraph content. Result - * will NOT be wrapped into `

` tags. - **/ -MarkdownIt.prototype.renderInline = function (src, env) { - env = env || {}; - return this.renderer.render(this.parseInline(src, env), this.options, env); -}; -module.exports = MarkdownIt; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/parser_block.js": -/*!*************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/parser_block.js ***! - \*************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -/** internal - * class ParserBlock - * - * Block-level tokenizer. - **/ - - -var Ruler = __webpack_require__(/*! ./ruler */ "../../../node_modules/markdown-it/lib/ruler.js"); -var _rules = [ -// First 2 params - rule name & source. Secondary array - list of rules, -// which can be terminated by this one. -['table', __webpack_require__(/*! ./rules_block/table */ "../../../node_modules/markdown-it/lib/rules_block/table.js"), ['paragraph', 'reference']], ['code', __webpack_require__(/*! ./rules_block/code */ "../../../node_modules/markdown-it/lib/rules_block/code.js")], ['fence', __webpack_require__(/*! ./rules_block/fence */ "../../../node_modules/markdown-it/lib/rules_block/fence.js"), ['paragraph', 'reference', 'blockquote', 'list']], ['blockquote', __webpack_require__(/*! ./rules_block/blockquote */ "../../../node_modules/markdown-it/lib/rules_block/blockquote.js"), ['paragraph', 'reference', 'blockquote', 'list']], ['hr', __webpack_require__(/*! ./rules_block/hr */ "../../../node_modules/markdown-it/lib/rules_block/hr.js"), ['paragraph', 'reference', 'blockquote', 'list']], ['list', __webpack_require__(/*! ./rules_block/list */ "../../../node_modules/markdown-it/lib/rules_block/list.js"), ['paragraph', 'reference', 'blockquote']], ['reference', __webpack_require__(/*! ./rules_block/reference */ "../../../node_modules/markdown-it/lib/rules_block/reference.js")], ['html_block', __webpack_require__(/*! ./rules_block/html_block */ "../../../node_modules/markdown-it/lib/rules_block/html_block.js"), ['paragraph', 'reference', 'blockquote']], ['heading', __webpack_require__(/*! ./rules_block/heading */ "../../../node_modules/markdown-it/lib/rules_block/heading.js"), ['paragraph', 'reference', 'blockquote']], ['lheading', __webpack_require__(/*! ./rules_block/lheading */ "../../../node_modules/markdown-it/lib/rules_block/lheading.js")], ['paragraph', __webpack_require__(/*! ./rules_block/paragraph */ "../../../node_modules/markdown-it/lib/rules_block/paragraph.js")]]; - -/** - * new ParserBlock() - **/ -function ParserBlock() { - /** - * ParserBlock#ruler -> Ruler - * - * [[Ruler]] instance. Keep configuration of block rules. - **/ - this.ruler = new Ruler(); - for (var i = 0; i < _rules.length; i++) { - this.ruler.push(_rules[i][0], _rules[i][1], { - alt: (_rules[i][2] || []).slice() - }); - } -} - -// Generate tokens for input range -// -ParserBlock.prototype.tokenize = function (state, startLine, endLine) { - var ok, - i, - rules = this.ruler.getRules(''), - len = rules.length, - line = startLine, - hasEmptyLines = false, - maxNesting = state.md.options.maxNesting; - while (line < endLine) { - state.line = line = state.skipEmptyLines(line); - if (line >= endLine) { - break; - } - - // Termination condition for nested calls. - // Nested calls currently used for blockquotes & lists - if (state.sCount[line] < state.blkIndent) { - break; - } - - // If nesting level exceeded - skip tail to the end. That's not ordinary - // situation and we should not care about content. - if (state.level >= maxNesting) { - state.line = endLine; - break; - } - - // Try all possible rules. - // On success, rule should: - // - // - update `state.line` - // - update `state.tokens` - // - return true - - for (i = 0; i < len; i++) { - ok = rules[i](state, line, endLine, false); - if (ok) { - break; - } - } - - // set state.tight if we had an empty line before current tag - // i.e. latest empty line should not count - state.tight = !hasEmptyLines; - - // paragraph might "eat" one newline after it in nested lists - if (state.isEmpty(state.line - 1)) { - hasEmptyLines = true; - } - line = state.line; - if (line < endLine && state.isEmpty(line)) { - hasEmptyLines = true; - line++; - state.line = line; - } - } -}; - -/** - * ParserBlock.parse(str, md, env, outTokens) - * - * Process input string and push block tokens into `outTokens` - **/ -ParserBlock.prototype.parse = function (src, md, env, outTokens) { - var state; - if (!src) { - return; - } - state = new this.State(src, md, env, outTokens); - this.tokenize(state, state.line, state.lineMax); -}; -ParserBlock.prototype.State = __webpack_require__(/*! ./rules_block/state_block */ "../../../node_modules/markdown-it/lib/rules_block/state_block.js"); -module.exports = ParserBlock; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/parser_core.js": -/*!************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/parser_core.js ***! - \************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -/** internal - * class Core - * - * Top-level rules executor. Glues block/inline parsers and does intermediate - * transformations. - **/ - - -var Ruler = __webpack_require__(/*! ./ruler */ "../../../node_modules/markdown-it/lib/ruler.js"); -var _rules = [['normalize', __webpack_require__(/*! ./rules_core/normalize */ "../../../node_modules/markdown-it/lib/rules_core/normalize.js")], ['block', __webpack_require__(/*! ./rules_core/block */ "../../../node_modules/markdown-it/lib/rules_core/block.js")], ['inline', __webpack_require__(/*! ./rules_core/inline */ "../../../node_modules/markdown-it/lib/rules_core/inline.js")], ['linkify', __webpack_require__(/*! ./rules_core/linkify */ "../../../node_modules/markdown-it/lib/rules_core/linkify.js")], ['replacements', __webpack_require__(/*! ./rules_core/replacements */ "../../../node_modules/markdown-it/lib/rules_core/replacements.js")], ['smartquotes', __webpack_require__(/*! ./rules_core/smartquotes */ "../../../node_modules/markdown-it/lib/rules_core/smartquotes.js")]]; - -/** - * new Core() - **/ -function Core() { - /** - * Core#ruler -> Ruler - * - * [[Ruler]] instance. Keep configuration of core rules. - **/ - this.ruler = new Ruler(); - for (var i = 0; i < _rules.length; i++) { - this.ruler.push(_rules[i][0], _rules[i][1]); - } -} - -/** - * Core.process(state) - * - * Executes core chain rules. - **/ -Core.prototype.process = function (state) { - var i, l, rules; - rules = this.ruler.getRules(''); - for (i = 0, l = rules.length; i < l; i++) { - rules[i](state); - } -}; -Core.prototype.State = __webpack_require__(/*! ./rules_core/state_core */ "../../../node_modules/markdown-it/lib/rules_core/state_core.js"); -module.exports = Core; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/parser_inline.js": -/*!**************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/parser_inline.js ***! - \**************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -/** internal - * class ParserInline - * - * Tokenizes paragraph content. - **/ - - -var Ruler = __webpack_require__(/*! ./ruler */ "../../../node_modules/markdown-it/lib/ruler.js"); - -//////////////////////////////////////////////////////////////////////////////// -// Parser rules - -var _rules = [['text', __webpack_require__(/*! ./rules_inline/text */ "../../../node_modules/markdown-it/lib/rules_inline/text.js")], ['newline', __webpack_require__(/*! ./rules_inline/newline */ "../../../node_modules/markdown-it/lib/rules_inline/newline.js")], ['escape', __webpack_require__(/*! ./rules_inline/escape */ "../../../node_modules/markdown-it/lib/rules_inline/escape.js")], ['backticks', __webpack_require__(/*! ./rules_inline/backticks */ "../../../node_modules/markdown-it/lib/rules_inline/backticks.js")], ['strikethrough', (__webpack_require__(/*! ./rules_inline/strikethrough */ "../../../node_modules/markdown-it/lib/rules_inline/strikethrough.js").tokenize)], ['emphasis', (__webpack_require__(/*! ./rules_inline/emphasis */ "../../../node_modules/markdown-it/lib/rules_inline/emphasis.js").tokenize)], ['link', __webpack_require__(/*! ./rules_inline/link */ "../../../node_modules/markdown-it/lib/rules_inline/link.js")], ['image', __webpack_require__(/*! ./rules_inline/image */ "../../../node_modules/markdown-it/lib/rules_inline/image.js")], ['autolink', __webpack_require__(/*! ./rules_inline/autolink */ "../../../node_modules/markdown-it/lib/rules_inline/autolink.js")], ['html_inline', __webpack_require__(/*! ./rules_inline/html_inline */ "../../../node_modules/markdown-it/lib/rules_inline/html_inline.js")], ['entity', __webpack_require__(/*! ./rules_inline/entity */ "../../../node_modules/markdown-it/lib/rules_inline/entity.js")]]; -var _rules2 = [['balance_pairs', __webpack_require__(/*! ./rules_inline/balance_pairs */ "../../../node_modules/markdown-it/lib/rules_inline/balance_pairs.js")], ['strikethrough', (__webpack_require__(/*! ./rules_inline/strikethrough */ "../../../node_modules/markdown-it/lib/rules_inline/strikethrough.js").postProcess)], ['emphasis', (__webpack_require__(/*! ./rules_inline/emphasis */ "../../../node_modules/markdown-it/lib/rules_inline/emphasis.js").postProcess)], ['text_collapse', __webpack_require__(/*! ./rules_inline/text_collapse */ "../../../node_modules/markdown-it/lib/rules_inline/text_collapse.js")]]; - -/** - * new ParserInline() - **/ -function ParserInline() { - var i; - - /** - * ParserInline#ruler -> Ruler - * - * [[Ruler]] instance. Keep configuration of inline rules. - **/ - this.ruler = new Ruler(); - for (i = 0; i < _rules.length; i++) { - this.ruler.push(_rules[i][0], _rules[i][1]); - } - - /** - * ParserInline#ruler2 -> Ruler - * - * [[Ruler]] instance. Second ruler used for post-processing - * (e.g. in emphasis-like rules). - **/ - this.ruler2 = new Ruler(); - for (i = 0; i < _rules2.length; i++) { - this.ruler2.push(_rules2[i][0], _rules2[i][1]); - } -} - -// Skip single token by running all rules in validation mode; -// returns `true` if any rule reported success -// -ParserInline.prototype.skipToken = function (state) { - var ok, - i, - pos = state.pos, - rules = this.ruler.getRules(''), - len = rules.length, - maxNesting = state.md.options.maxNesting, - cache = state.cache; - if (typeof cache[pos] !== 'undefined') { - state.pos = cache[pos]; - return; - } - if (state.level < maxNesting) { - for (i = 0; i < len; i++) { - // Increment state.level and decrement it later to limit recursion. - // It's harmless to do here, because no tokens are created. But ideally, - // we'd need a separate private state variable for this purpose. - // - state.level++; - ok = rules[i](state, true); - state.level--; - if (ok) { - break; - } - } - } else { - // Too much nesting, just skip until the end of the paragraph. - // - // NOTE: this will cause links to behave incorrectly in the following case, - // when an amount of `[` is exactly equal to `maxNesting + 1`: - // - // [[[[[[[[[[[[[[[[[[[[[foo]() - // - // TODO: remove this workaround when CM standard will allow nested links - // (we can replace it by preventing links from being parsed in - // validation mode) - // - state.pos = state.posMax; - } - if (!ok) { - state.pos++; - } - cache[pos] = state.pos; -}; - -// Generate tokens for input range -// -ParserInline.prototype.tokenize = function (state) { - var ok, - i, - rules = this.ruler.getRules(''), - len = rules.length, - end = state.posMax, - maxNesting = state.md.options.maxNesting; - while (state.pos < end) { - // Try all possible rules. - // On success, rule should: - // - // - update `state.pos` - // - update `state.tokens` - // - return true - - if (state.level < maxNesting) { - for (i = 0; i < len; i++) { - ok = rules[i](state, false); - if (ok) { - break; - } - } - } - if (ok) { - if (state.pos >= end) { - break; - } - continue; - } - state.pending += state.src[state.pos++]; - } - if (state.pending) { - state.pushPending(); - } -}; - -/** - * ParserInline.parse(str, md, env, outTokens) - * - * Process input string and push inline tokens into `outTokens` - **/ -ParserInline.prototype.parse = function (str, md, env, outTokens) { - var i, rules, len; - var state = new this.State(str, md, env, outTokens); - this.tokenize(state); - rules = this.ruler2.getRules(''); - len = rules.length; - for (i = 0; i < len; i++) { - rules[i](state); - } -}; -ParserInline.prototype.State = __webpack_require__(/*! ./rules_inline/state_inline */ "../../../node_modules/markdown-it/lib/rules_inline/state_inline.js"); -module.exports = ParserInline; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/presets/commonmark.js": -/*!*******************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/presets/commonmark.js ***! - \*******************************************************************/ -/***/ (function(module) { - -// Commonmark default options - - - -module.exports = { - options: { - html: true, - // Enable HTML tags in source - xhtmlOut: true, - // Use '/' to close single tags (
) - breaks: false, - // Convert '\n' in paragraphs into
- langPrefix: 'language-', - // CSS language prefix for fenced blocks - linkify: false, - // autoconvert URL-like texts to links - - // Enable some language-neutral replacements + quotes beautification - typographer: false, - // Double + single quotes replacement pairs, when typographer enabled, - // and smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). - quotes: '\u201c\u201d\u2018\u2019', - /* “”‘’ */ - - // Highlighter function. Should return escaped HTML, - // or '' if the source string is not changed and should be escaped externaly. - // If result starts with ) - breaks: false, - // Convert '\n' in paragraphs into
- langPrefix: 'language-', - // CSS language prefix for fenced blocks - linkify: false, - // autoconvert URL-like texts to links - - // Enable some language-neutral replacements + quotes beautification - typographer: false, - // Double + single quotes replacement pairs, when typographer enabled, - // and smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). - quotes: '\u201c\u201d\u2018\u2019', - /* “”‘’ */ - - // Highlighter function. Should return escaped HTML, - // or '' if the source string is not changed and should be escaped externaly. - // If result starts with ) - breaks: false, - // Convert '\n' in paragraphs into
- langPrefix: 'language-', - // CSS language prefix for fenced blocks - linkify: false, - // autoconvert URL-like texts to links - - // Enable some language-neutral replacements + quotes beautification - typographer: false, - // Double + single quotes replacement pairs, when typographer enabled, - // and smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). - quotes: '\u201c\u201d\u2018\u2019', - /* “”‘’ */ - - // Highlighter function. Should return escaped HTML, - // or '' if the source string is not changed and should be escaped externaly. - // If result starts with ' + escapeHtml(tokens[idx].content) + ''; -}; -default_rules.code_block = function (tokens, idx, options, env, slf) { - var token = tokens[idx]; - return '' + escapeHtml(tokens[idx].content) + '\n'; -}; -default_rules.fence = function (tokens, idx, options, env, slf) { - var token = tokens[idx], - info = token.info ? unescapeAll(token.info).trim() : '', - langName = '', - langAttrs = '', - highlighted, - i, - arr, - tmpAttrs, - tmpToken; - if (info) { - arr = info.split(/(\s+)/g); - langName = arr[0]; - langAttrs = arr.slice(2).join(''); - } - if (options.highlight) { - highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content); - } else { - highlighted = escapeHtml(token.content); - } - if (highlighted.indexOf('' + highlighted + '\n'; - } - return '

' + highlighted + '
\n'; -}; -default_rules.image = function (tokens, idx, options, env, slf) { - var token = tokens[idx]; - - // "alt" attr MUST be set, even if empty. Because it's mandatory and - // should be placed on proper position for tests. - // - // Replace content with actual value - - token.attrs[token.attrIndex('alt')][1] = slf.renderInlineAsText(token.children, options, env); - return slf.renderToken(tokens, idx, options); -}; -default_rules.hardbreak = function (tokens, idx, options /*, env */) { - return options.xhtmlOut ? '
\n' : '
\n'; -}; -default_rules.softbreak = function (tokens, idx, options /*, env */) { - return options.breaks ? options.xhtmlOut ? '
\n' : '
\n' : '\n'; -}; -default_rules.text = function (tokens, idx /*, options, env */) { - return escapeHtml(tokens[idx].content); -}; -default_rules.html_block = function (tokens, idx /*, options, env */) { - return tokens[idx].content; -}; -default_rules.html_inline = function (tokens, idx /*, options, env */) { - return tokens[idx].content; -}; - -/** - * new Renderer() - * - * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults. - **/ -function Renderer() { - /** - * Renderer#rules -> Object - * - * Contains render rules for tokens. Can be updated and extended. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.renderer.rules.strong_open = function () { return ''; }; - * md.renderer.rules.strong_close = function () { return ''; }; - * - * var result = md.renderInline(...); - * ``` - * - * Each rule is called as independent static function with fixed signature: - * - * ```javascript - * function my_token_render(tokens, idx, options, env, renderer) { - * // ... - * return renderedHTML; - * } - * ``` - * - * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js) - * for more details and examples. - **/ - this.rules = assign({}, default_rules); -} - -/** - * Renderer.renderAttrs(token) -> String - * - * Render token attributes to string. - **/ -Renderer.prototype.renderAttrs = function renderAttrs(token) { - var i, l, result; - if (!token.attrs) { - return ''; - } - result = ''; - for (i = 0, l = token.attrs.length; i < l; i++) { - result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"'; - } - return result; -}; - -/** - * Renderer.renderToken(tokens, idx, options) -> String - * - tokens (Array): list of tokens - * - idx (Numbed): token index to render - * - options (Object): params of parser instance - * - * Default token renderer. Can be overriden by custom function - * in [[Renderer#rules]]. - **/ -Renderer.prototype.renderToken = function renderToken(tokens, idx, options) { - var nextToken, - result = '', - needLf = false, - token = tokens[idx]; - - // Tight list paragraphs - if (token.hidden) { - return ''; - } - - // Insert a newline between hidden paragraph and subsequent opening - // block-level tag. - // - // For example, here we should insert a newline before blockquote: - // - a - // > - // - if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) { - result += '\n'; - } - - // Add token name, e.g. ``. - // - needLf = false; - } - } - } - } - result += needLf ? '>\n' : '>'; - return result; -}; - -/** - * Renderer.renderInline(tokens, options, env) -> String - * - tokens (Array): list on block tokens to renter - * - options (Object): params of parser instance - * - env (Object): additional data from parsed input (references, for example) - * - * The same as [[Renderer.render]], but for single token of `inline` type. - **/ -Renderer.prototype.renderInline = function (tokens, options, env) { - var type, - result = '', - rules = this.rules; - for (var i = 0, len = tokens.length; i < len; i++) { - type = tokens[i].type; - if (typeof rules[type] !== 'undefined') { - result += rules[type](tokens, i, options, env, this); - } else { - result += this.renderToken(tokens, i, options); - } - } - return result; -}; - -/** internal - * Renderer.renderInlineAsText(tokens, options, env) -> String - * - tokens (Array): list on block tokens to renter - * - options (Object): params of parser instance - * - env (Object): additional data from parsed input (references, for example) - * - * Special kludge for image `alt` attributes to conform CommonMark spec. - * Don't try to use it! Spec requires to show `alt` content with stripped markup, - * instead of simple escaping. - **/ -Renderer.prototype.renderInlineAsText = function (tokens, options, env) { - var result = ''; - for (var i = 0, len = tokens.length; i < len; i++) { - if (tokens[i].type === 'text') { - result += tokens[i].content; - } else if (tokens[i].type === 'image') { - result += this.renderInlineAsText(tokens[i].children, options, env); - } else if (tokens[i].type === 'softbreak') { - result += '\n'; - } - } - return result; -}; - -/** - * Renderer.render(tokens, options, env) -> String - * - tokens (Array): list on block tokens to renter - * - options (Object): params of parser instance - * - env (Object): additional data from parsed input (references, for example) - * - * Takes token stream and generates HTML. Probably, you will never need to call - * this method directly. - **/ -Renderer.prototype.render = function (tokens, options, env) { - var i, - len, - type, - result = '', - rules = this.rules; - for (i = 0, len = tokens.length; i < len; i++) { - type = tokens[i].type; - if (type === 'inline') { - result += this.renderInline(tokens[i].children, options, env); - } else if (typeof rules[type] !== 'undefined') { - result += rules[tokens[i].type](tokens, i, options, env, this); - } else { - result += this.renderToken(tokens, i, options, env); - } - } - return result; -}; -module.exports = Renderer; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/ruler.js": -/*!******************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/ruler.js ***! - \******************************************************/ -/***/ (function(module) { - -/** - * class Ruler - * - * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and - * [[MarkdownIt#inline]] to manage sequences of functions (rules): - * - * - keep rules in defined order - * - assign the name to each rule - * - enable/disable rules - * - add/replace rules - * - allow assign rules to additional named chains (in the same) - * - cacheing lists of active rules - * - * You will not need use this class directly until write plugins. For simple - * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and - * [[MarkdownIt.use]]. - **/ - - -/** - * new Ruler() - **/ -function Ruler() { - // List of added rules. Each element is: - // - // { - // name: XXX, - // enabled: Boolean, - // fn: Function(), - // alt: [ name2, name3 ] - // } - // - this.__rules__ = []; - - // Cached rule chains. - // - // First level - chain name, '' for default. - // Second level - diginal anchor for fast filtering by charcodes. - // - this.__cache__ = null; -} - -//////////////////////////////////////////////////////////////////////////////// -// Helper methods, should not be used directly - -// Find rule index by name -// -Ruler.prototype.__find__ = function (name) { - for (var i = 0; i < this.__rules__.length; i++) { - if (this.__rules__[i].name === name) { - return i; - } - } - return -1; -}; - -// Build rules lookup cache -// -Ruler.prototype.__compile__ = function () { - var self = this; - var chains = ['']; - - // collect unique names - self.__rules__.forEach(function (rule) { - if (!rule.enabled) { - return; - } - rule.alt.forEach(function (altName) { - if (chains.indexOf(altName) < 0) { - chains.push(altName); - } - }); - }); - self.__cache__ = {}; - chains.forEach(function (chain) { - self.__cache__[chain] = []; - self.__rules__.forEach(function (rule) { - if (!rule.enabled) { - return; - } - if (chain && rule.alt.indexOf(chain) < 0) { - return; - } - self.__cache__[chain].push(rule.fn); - }); - }); -}; - -/** - * Ruler.at(name, fn [, options]) - * - name (String): rule name to replace. - * - fn (Function): new rule function. - * - options (Object): new rule options (not mandatory). - * - * Replace rule by name with new function & options. Throws error if name not - * found. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * Replace existing typographer replacement rule with new one: - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.core.ruler.at('replacements', function replace(state) { - * //... - * }); - * ``` - **/ -Ruler.prototype.at = function (name, fn, options) { - var index = this.__find__(name); - var opt = options || {}; - if (index === -1) { - throw new Error('Parser rule not found: ' + name); - } - this.__rules__[index].fn = fn; - this.__rules__[index].alt = opt.alt || []; - this.__cache__ = null; -}; - -/** - * Ruler.before(beforeName, ruleName, fn [, options]) - * - beforeName (String): new rule will be added before this one. - * - ruleName (String): name of added rule. - * - fn (Function): rule function. - * - options (Object): rule options (not mandatory). - * - * Add new rule to chain before one with given name. See also - * [[Ruler.after]], [[Ruler.push]]. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.block.ruler.before('paragraph', 'my_rule', function replace(state) { - * //... - * }); - * ``` - **/ -Ruler.prototype.before = function (beforeName, ruleName, fn, options) { - var index = this.__find__(beforeName); - var opt = options || {}; - if (index === -1) { - throw new Error('Parser rule not found: ' + beforeName); - } - this.__rules__.splice(index, 0, { - name: ruleName, - enabled: true, - fn: fn, - alt: opt.alt || [] - }); - this.__cache__ = null; -}; - -/** - * Ruler.after(afterName, ruleName, fn [, options]) - * - afterName (String): new rule will be added after this one. - * - ruleName (String): name of added rule. - * - fn (Function): rule function. - * - options (Object): rule options (not mandatory). - * - * Add new rule to chain after one with given name. See also - * [[Ruler.before]], [[Ruler.push]]. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.inline.ruler.after('text', 'my_rule', function replace(state) { - * //... - * }); - * ``` - **/ -Ruler.prototype.after = function (afterName, ruleName, fn, options) { - var index = this.__find__(afterName); - var opt = options || {}; - if (index === -1) { - throw new Error('Parser rule not found: ' + afterName); - } - this.__rules__.splice(index + 1, 0, { - name: ruleName, - enabled: true, - fn: fn, - alt: opt.alt || [] - }); - this.__cache__ = null; -}; - -/** - * Ruler.push(ruleName, fn [, options]) - * - ruleName (String): name of added rule. - * - fn (Function): rule function. - * - options (Object): rule options (not mandatory). - * - * Push new rule to the end of chain. See also - * [[Ruler.before]], [[Ruler.after]]. - * - * ##### Options: - * - * - __alt__ - array with names of "alternate" chains. - * - * ##### Example - * - * ```javascript - * var md = require('markdown-it')(); - * - * md.core.ruler.push('my_rule', function replace(state) { - * //... - * }); - * ``` - **/ -Ruler.prototype.push = function (ruleName, fn, options) { - var opt = options || {}; - this.__rules__.push({ - name: ruleName, - enabled: true, - fn: fn, - alt: opt.alt || [] - }); - this.__cache__ = null; -}; - -/** - * Ruler.enable(list [, ignoreInvalid]) -> Array - * - list (String|Array): list of rule names to enable. - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * Enable rules with given names. If any rule name not found - throw Error. - * Errors can be disabled by second param. - * - * Returns list of found rule names (if no exception happened). - * - * See also [[Ruler.disable]], [[Ruler.enableOnly]]. - **/ -Ruler.prototype.enable = function (list, ignoreInvalid) { - if (!Array.isArray(list)) { - list = [list]; - } - var result = []; - - // Search by name and enable - list.forEach(function (name) { - var idx = this.__find__(name); - if (idx < 0) { - if (ignoreInvalid) { - return; - } - throw new Error('Rules manager: invalid rule name ' + name); - } - this.__rules__[idx].enabled = true; - result.push(name); - }, this); - this.__cache__ = null; - return result; -}; - -/** - * Ruler.enableOnly(list [, ignoreInvalid]) - * - list (String|Array): list of rule names to enable (whitelist). - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * Enable rules with given names, and disable everything else. If any rule name - * not found - throw Error. Errors can be disabled by second param. - * - * See also [[Ruler.disable]], [[Ruler.enable]]. - **/ -Ruler.prototype.enableOnly = function (list, ignoreInvalid) { - if (!Array.isArray(list)) { - list = [list]; - } - this.__rules__.forEach(function (rule) { - rule.enabled = false; - }); - this.enable(list, ignoreInvalid); -}; - -/** - * Ruler.disable(list [, ignoreInvalid]) -> Array - * - list (String|Array): list of rule names to disable. - * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. - * - * Disable rules with given names. If any rule name not found - throw Error. - * Errors can be disabled by second param. - * - * Returns list of found rule names (if no exception happened). - * - * See also [[Ruler.enable]], [[Ruler.enableOnly]]. - **/ -Ruler.prototype.disable = function (list, ignoreInvalid) { - if (!Array.isArray(list)) { - list = [list]; - } - var result = []; - - // Search by name and disable - list.forEach(function (name) { - var idx = this.__find__(name); - if (idx < 0) { - if (ignoreInvalid) { - return; - } - throw new Error('Rules manager: invalid rule name ' + name); - } - this.__rules__[idx].enabled = false; - result.push(name); - }, this); - this.__cache__ = null; - return result; -}; - -/** - * Ruler.getRules(chainName) -> Array - * - * Return array of active functions (rules) for given chain name. It analyzes - * rules configuration, compiles caches if not exists and returns result. - * - * Default chain name is `''` (empty string). It can't be skipped. That's - * done intentionally, to keep signature monomorphic for high speed. - **/ -Ruler.prototype.getRules = function (chainName) { - if (this.__cache__ === null) { - this.__compile__(); - } - - // Chain can be empty, if rules disabled. But we still have to return Array. - return this.__cache__[chainName] || []; -}; -module.exports = Ruler; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/blockquote.js": -/*!***********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/blockquote.js ***! - \***********************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Block quotes - - - -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -module.exports = function blockquote(state, startLine, endLine, silent) { - var adjustTab, - ch, - i, - initial, - l, - lastLineEmpty, - lines, - nextLine, - offset, - oldBMarks, - oldBSCount, - oldIndent, - oldParentType, - oldSCount, - oldTShift, - spaceAfterMarker, - terminate, - terminatorRules, - token, - isOutdented, - oldLineMax = state.lineMax, - pos = state.bMarks[startLine] + state.tShift[startLine], - max = state.eMarks[startLine]; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - - // check the block quote marker - if (state.src.charCodeAt(pos++) !== 0x3E /* > */) { - return false; - } - - // we know that it's going to be a valid blockquote, - // so no point trying to find the end of it in silent mode - if (silent) { - return true; - } - - // set offset past spaces and ">" - initial = offset = state.sCount[startLine] + 1; - - // skip one optional space after '>' - if (state.src.charCodeAt(pos) === 0x20 /* space */) { - // ' > test ' - // ^ -- position start of line here: - pos++; - initial++; - offset++; - adjustTab = false; - spaceAfterMarker = true; - } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { - spaceAfterMarker = true; - if ((state.bsCount[startLine] + offset) % 4 === 3) { - // ' >\t test ' - // ^ -- position start of line here (tab has width===1) - pos++; - initial++; - offset++; - adjustTab = false; - } else { - // ' >\t test ' - // ^ -- position start of line here + shift bsCount slightly - // to make extra space appear - adjustTab = true; - } - } else { - spaceAfterMarker = false; - } - oldBMarks = [state.bMarks[startLine]]; - state.bMarks[startLine] = pos; - while (pos < max) { - ch = state.src.charCodeAt(pos); - if (isSpace(ch)) { - if (ch === 0x09) { - offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4; - } else { - offset++; - } - } else { - break; - } - pos++; - } - oldBSCount = [state.bsCount[startLine]]; - state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0); - lastLineEmpty = pos >= max; - oldSCount = [state.sCount[startLine]]; - state.sCount[startLine] = offset - initial; - oldTShift = [state.tShift[startLine]]; - state.tShift[startLine] = pos - state.bMarks[startLine]; - terminatorRules = state.md.block.ruler.getRules('blockquote'); - oldParentType = state.parentType; - state.parentType = 'blockquote'; - - // Search the end of the block - // - // Block ends with either: - // 1. an empty line outside: - // ``` - // > test - // - // ``` - // 2. an empty line inside: - // ``` - // > - // test - // ``` - // 3. another tag: - // ``` - // > test - // - - - - // ``` - for (nextLine = startLine + 1; nextLine < endLine; nextLine++) { - // check if it's outdented, i.e. it's inside list item and indented - // less than said list item: - // - // ``` - // 1. anything - // > current blockquote - // 2. checking this line - // ``` - isOutdented = state.sCount[nextLine] < state.blkIndent; - pos = state.bMarks[nextLine] + state.tShift[nextLine]; - max = state.eMarks[nextLine]; - if (pos >= max) { - // Case 1: line is not inside the blockquote, and this line is empty. - break; - } - if (state.src.charCodeAt(pos++) === 0x3E /* > */ && !isOutdented) { - // This line is inside the blockquote. - - // set offset past spaces and ">" - initial = offset = state.sCount[nextLine] + 1; - - // skip one optional space after '>' - if (state.src.charCodeAt(pos) === 0x20 /* space */) { - // ' > test ' - // ^ -- position start of line here: - pos++; - initial++; - offset++; - adjustTab = false; - spaceAfterMarker = true; - } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { - spaceAfterMarker = true; - if ((state.bsCount[nextLine] + offset) % 4 === 3) { - // ' >\t test ' - // ^ -- position start of line here (tab has width===1) - pos++; - initial++; - offset++; - adjustTab = false; - } else { - // ' >\t test ' - // ^ -- position start of line here + shift bsCount slightly - // to make extra space appear - adjustTab = true; - } - } else { - spaceAfterMarker = false; - } - oldBMarks.push(state.bMarks[nextLine]); - state.bMarks[nextLine] = pos; - while (pos < max) { - ch = state.src.charCodeAt(pos); - if (isSpace(ch)) { - if (ch === 0x09) { - offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4; - } else { - offset++; - } - } else { - break; - } - pos++; - } - lastLineEmpty = pos >= max; - oldBSCount.push(state.bsCount[nextLine]); - state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0); - oldSCount.push(state.sCount[nextLine]); - state.sCount[nextLine] = offset - initial; - oldTShift.push(state.tShift[nextLine]); - state.tShift[nextLine] = pos - state.bMarks[nextLine]; - continue; - } - - // Case 2: line is not inside the blockquote, and the last line was empty. - if (lastLineEmpty) { - break; - } - - // Case 3: another tag found. - terminate = false; - for (i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - // Quirk to enforce "hard termination mode" for paragraphs; - // normally if you call `tokenize(state, startLine, nextLine)`, - // paragraphs will look below nextLine for paragraph continuation, - // but if blockquote is terminated by another tag, they shouldn't - state.lineMax = nextLine; - if (state.blkIndent !== 0) { - // state.blkIndent was non-zero, we now set it to zero, - // so we need to re-calculate all offsets to appear as - // if indent wasn't changed - oldBMarks.push(state.bMarks[nextLine]); - oldBSCount.push(state.bsCount[nextLine]); - oldTShift.push(state.tShift[nextLine]); - oldSCount.push(state.sCount[nextLine]); - state.sCount[nextLine] -= state.blkIndent; - } - break; - } - oldBMarks.push(state.bMarks[nextLine]); - oldBSCount.push(state.bsCount[nextLine]); - oldTShift.push(state.tShift[nextLine]); - oldSCount.push(state.sCount[nextLine]); - - // A negative indentation means that this is a paragraph continuation - // - state.sCount[nextLine] = -1; - } - oldIndent = state.blkIndent; - state.blkIndent = 0; - token = state.push('blockquote_open', 'blockquote', 1); - token.markup = '>'; - token.map = lines = [startLine, 0]; - state.md.block.tokenize(state, startLine, nextLine); - token = state.push('blockquote_close', 'blockquote', -1); - token.markup = '>'; - state.lineMax = oldLineMax; - state.parentType = oldParentType; - lines[1] = state.line; - - // Restore original tShift; this might not be necessary since the parser - // has already been here, but just to make sure we can do that. - for (i = 0; i < oldTShift.length; i++) { - state.bMarks[i + startLine] = oldBMarks[i]; - state.tShift[i + startLine] = oldTShift[i]; - state.sCount[i + startLine] = oldSCount[i]; - state.bsCount[i + startLine] = oldBSCount[i]; - } - state.blkIndent = oldIndent; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/code.js": -/*!*****************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/code.js ***! - \*****************************************************************/ -/***/ (function(module) { - -// Code block (4 spaces padded) - - - -module.exports = function code(state, startLine, endLine /*, silent*/) { - var nextLine, last, token; - if (state.sCount[startLine] - state.blkIndent < 4) { - return false; - } - last = nextLine = startLine + 1; - while (nextLine < endLine) { - if (state.isEmpty(nextLine)) { - nextLine++; - continue; - } - if (state.sCount[nextLine] - state.blkIndent >= 4) { - nextLine++; - last = nextLine; - continue; - } - break; - } - state.line = last; - token = state.push('code_block', 'code', 0); - token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n'; - token.map = [startLine, state.line]; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/fence.js": -/*!******************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/fence.js ***! - \******************************************************************/ -/***/ (function(module) { - -// fences (``` lang, ~~~ lang) - - - -module.exports = function fence(state, startLine, endLine, silent) { - var marker, - len, - params, - nextLine, - mem, - token, - markup, - haveEndMarker = false, - pos = state.bMarks[startLine] + state.tShift[startLine], - max = state.eMarks[startLine]; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - if (pos + 3 > max) { - return false; - } - marker = state.src.charCodeAt(pos); - if (marker !== 0x7E /* ~ */ && marker !== 0x60 /* ` */) { - return false; - } - - // scan marker length - mem = pos; - pos = state.skipChars(pos, marker); - len = pos - mem; - if (len < 3) { - return false; - } - markup = state.src.slice(mem, pos); - params = state.src.slice(pos, max); - if (marker === 0x60 /* ` */) { - if (params.indexOf(String.fromCharCode(marker)) >= 0) { - return false; - } - } - - // Since start is found, we can report success here in validation mode - if (silent) { - return true; - } - - // search end of block - nextLine = startLine; - for (;;) { - nextLine++; - if (nextLine >= endLine) { - // unclosed block should be autoclosed by end of document. - // also block seems to be autoclosed by end of parent - break; - } - pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]; - max = state.eMarks[nextLine]; - if (pos < max && state.sCount[nextLine] < state.blkIndent) { - // non-empty line with negative indent should stop the list: - // - ``` - // test - break; - } - if (state.src.charCodeAt(pos) !== marker) { - continue; - } - if (state.sCount[nextLine] - state.blkIndent >= 4) { - // closing fence should be indented less than 4 spaces - continue; - } - pos = state.skipChars(pos, marker); - - // closing code fence must be at least as long as the opening one - if (pos - mem < len) { - continue; - } - - // make sure tail has spaces only - pos = state.skipSpaces(pos); - if (pos < max) { - continue; - } - haveEndMarker = true; - // found! - break; - } - - // If a fence has heading spaces, they should be removed from its inner block - len = state.sCount[startLine]; - state.line = nextLine + (haveEndMarker ? 1 : 0); - token = state.push('fence', 'code', 0); - token.info = params; - token.content = state.getLines(startLine + 1, nextLine, len, true); - token.markup = markup; - token.map = [startLine, state.line]; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/heading.js": -/*!********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/heading.js ***! - \********************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// heading (#, ##, ...) - - - -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -module.exports = function heading(state, startLine, endLine, silent) { - var ch, - level, - tmp, - token, - pos = state.bMarks[startLine] + state.tShift[startLine], - max = state.eMarks[startLine]; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - ch = state.src.charCodeAt(pos); - if (ch !== 0x23 /* # */ || pos >= max) { - return false; - } - - // count heading level - level = 1; - ch = state.src.charCodeAt(++pos); - while (ch === 0x23 /* # */ && pos < max && level <= 6) { - level++; - ch = state.src.charCodeAt(++pos); - } - if (level > 6 || pos < max && !isSpace(ch)) { - return false; - } - if (silent) { - return true; - } - - // Let's cut tails like ' ### ' from the end of string - - max = state.skipSpacesBack(max, pos); - tmp = state.skipCharsBack(max, 0x23, pos); // # - if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) { - max = tmp; - } - state.line = startLine + 1; - token = state.push('heading_open', 'h' + String(level), 1); - token.markup = '########'.slice(0, level); - token.map = [startLine, state.line]; - token = state.push('inline', '', 0); - token.content = state.src.slice(pos, max).trim(); - token.map = [startLine, state.line]; - token.children = []; - token = state.push('heading_close', 'h' + String(level), -1); - token.markup = '########'.slice(0, level); - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/hr.js": -/*!***************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/hr.js ***! - \***************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Horizontal rule - - - -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -module.exports = function hr(state, startLine, endLine, silent) { - var marker, - cnt, - ch, - token, - pos = state.bMarks[startLine] + state.tShift[startLine], - max = state.eMarks[startLine]; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - marker = state.src.charCodeAt(pos++); - - // Check hr marker - if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x5F /* _ */) { - return false; - } - - // markers can be mixed with spaces, but there should be at least 3 of them - - cnt = 1; - while (pos < max) { - ch = state.src.charCodeAt(pos++); - if (ch !== marker && !isSpace(ch)) { - return false; - } - if (ch === marker) { - cnt++; - } - } - if (cnt < 3) { - return false; - } - if (silent) { - return true; - } - state.line = startLine + 1; - token = state.push('hr', 'hr', 0); - token.map = [startLine, state.line]; - token.markup = Array(cnt + 1).join(String.fromCharCode(marker)); - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/html_block.js": -/*!***********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/html_block.js ***! - \***********************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// HTML block - - - -var block_names = __webpack_require__(/*! ../common/html_blocks */ "../../../node_modules/markdown-it/lib/common/html_blocks.js"); -var HTML_OPEN_CLOSE_TAG_RE = (__webpack_require__(/*! ../common/html_re */ "../../../node_modules/markdown-it/lib/common/html_re.js").HTML_OPEN_CLOSE_TAG_RE); - -// An array of opening and corresponding closing sequences for html tags, -// last argument defines whether it can terminate a paragraph or not -// -var HTML_SEQUENCES = [[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true], [/^/, true], [/^<\?/, /\?>/, true], [/^/, true], [/^/, true], [new RegExp('^|$))', 'i'), /^$/, true], [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false]]; -module.exports = function html_block(state, startLine, endLine, silent) { - var i, - nextLine, - token, - lineText, - pos = state.bMarks[startLine] + state.tShift[startLine], - max = state.eMarks[startLine]; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - if (!state.md.options.html) { - return false; - } - if (state.src.charCodeAt(pos) !== 0x3C /* < */) { - return false; - } - lineText = state.src.slice(pos, max); - for (i = 0; i < HTML_SEQUENCES.length; i++) { - if (HTML_SEQUENCES[i][0].test(lineText)) { - break; - } - } - if (i === HTML_SEQUENCES.length) { - return false; - } - if (silent) { - // true if this sequence can be a terminator, false otherwise - return HTML_SEQUENCES[i][2]; - } - nextLine = startLine + 1; - - // If we are here - we detected HTML block. - // Let's roll down till block end. - if (!HTML_SEQUENCES[i][1].test(lineText)) { - for (; nextLine < endLine; nextLine++) { - if (state.sCount[nextLine] < state.blkIndent) { - break; - } - pos = state.bMarks[nextLine] + state.tShift[nextLine]; - max = state.eMarks[nextLine]; - lineText = state.src.slice(pos, max); - if (HTML_SEQUENCES[i][1].test(lineText)) { - if (lineText.length !== 0) { - nextLine++; - } - break; - } - } - } - state.line = nextLine; - token = state.push('html_block', '', 0); - token.map = [startLine, nextLine]; - token.content = state.getLines(startLine, nextLine, state.blkIndent, true); - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/lheading.js": -/*!*********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/lheading.js ***! - \*********************************************************************/ -/***/ (function(module) { - -// lheading (---, ===) - - - -module.exports = function lheading(state, startLine, endLine /*, silent*/) { - var content, - terminate, - i, - l, - token, - pos, - max, - level, - marker, - nextLine = startLine + 1, - oldParentType, - terminatorRules = state.md.block.ruler.getRules('paragraph'); - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - oldParentType = state.parentType; - state.parentType = 'paragraph'; // use paragraph to match terminatorRules - - // jump line-by-line until empty one or EOF - for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { - // this would be a code block normally, but after paragraph - // it's considered a lazy continuation regardless of what's there - if (state.sCount[nextLine] - state.blkIndent > 3) { - continue; - } - - // - // Check for underline in setext header - // - if (state.sCount[nextLine] >= state.blkIndent) { - pos = state.bMarks[nextLine] + state.tShift[nextLine]; - max = state.eMarks[nextLine]; - if (pos < max) { - marker = state.src.charCodeAt(pos); - if (marker === 0x2D /* - */ || marker === 0x3D /* = */) { - pos = state.skipChars(pos, marker); - pos = state.skipSpaces(pos); - if (pos >= max) { - level = marker === 0x3D /* = */ ? 1 : 2; - break; - } - } - } - } - - // quirk for blockquotes, this line should already be checked by that rule - if (state.sCount[nextLine] < 0) { - continue; - } - - // Some tags can terminate paragraph without empty line. - terminate = false; - for (i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - } - if (!level) { - // Didn't find valid underline - return false; - } - content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); - state.line = nextLine + 1; - token = state.push('heading_open', 'h' + String(level), 1); - token.markup = String.fromCharCode(marker); - token.map = [startLine, state.line]; - token = state.push('inline', '', 0); - token.content = content; - token.map = [startLine, state.line - 1]; - token.children = []; - token = state.push('heading_close', 'h' + String(level), -1); - token.markup = String.fromCharCode(marker); - state.parentType = oldParentType; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/list.js": -/*!*****************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/list.js ***! - \*****************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Lists - - - -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); - -// Search `[-+*][\n ]`, returns next pos after marker on success -// or -1 on fail. -function skipBulletListMarker(state, startLine) { - var marker, pos, max, ch; - pos = state.bMarks[startLine] + state.tShift[startLine]; - max = state.eMarks[startLine]; - marker = state.src.charCodeAt(pos++); - // Check bullet - if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x2B /* + */) { - return -1; - } - if (pos < max) { - ch = state.src.charCodeAt(pos); - if (!isSpace(ch)) { - // " -test " - is not a list item - return -1; - } - } - return pos; -} - -// Search `\d+[.)][\n ]`, returns next pos after marker on success -// or -1 on fail. -function skipOrderedListMarker(state, startLine) { - var ch, - start = state.bMarks[startLine] + state.tShift[startLine], - pos = start, - max = state.eMarks[startLine]; - - // List marker should have at least 2 chars (digit + dot) - if (pos + 1 >= max) { - return -1; - } - ch = state.src.charCodeAt(pos++); - if (ch < 0x30 /* 0 */ || ch > 0x39 /* 9 */) { - return -1; - } - for (;;) { - // EOL -> fail - if (pos >= max) { - return -1; - } - ch = state.src.charCodeAt(pos++); - if (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) { - // List marker should have no more than 9 digits - // (prevents integer overflow in browsers) - if (pos - start >= 10) { - return -1; - } - continue; - } - - // found valid marker - if (ch === 0x29 /* ) */ || ch === 0x2e /* . */) { - break; - } - return -1; - } - if (pos < max) { - ch = state.src.charCodeAt(pos); - if (!isSpace(ch)) { - // " 1.test " - is not a list item - return -1; - } - } - return pos; -} -function markTightParagraphs(state, idx) { - var i, - l, - level = state.level + 2; - for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) { - if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') { - state.tokens[i + 2].hidden = true; - state.tokens[i].hidden = true; - i += 2; - } - } -} -module.exports = function list(state, startLine, endLine, silent) { - var ch, - contentStart, - i, - indent, - indentAfterMarker, - initial, - isOrdered, - itemLines, - l, - listLines, - listTokIdx, - markerCharCode, - markerValue, - max, - nextLine, - offset, - oldListIndent, - oldParentType, - oldSCount, - oldTShift, - oldTight, - pos, - posAfterMarker, - prevEmptyEnd, - start, - terminate, - terminatorRules, - token, - isTerminatingParagraph = false, - tight = true; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - - // Special case: - // - item 1 - // - item 2 - // - item 3 - // - item 4 - // - this one is a paragraph continuation - if (state.listIndent >= 0 && state.sCount[startLine] - state.listIndent >= 4 && state.sCount[startLine] < state.blkIndent) { - return false; - } - - // limit conditions when list can interrupt - // a paragraph (validation mode only) - if (silent && state.parentType === 'paragraph') { - // Next list item should still terminate previous list item; - // - // This code can fail if plugins use blkIndent as well as lists, - // but I hope the spec gets fixed long before that happens. - // - if (state.tShift[startLine] >= state.blkIndent) { - isTerminatingParagraph = true; - } - } - - // Detect list type and position after marker - if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) { - isOrdered = true; - start = state.bMarks[startLine] + state.tShift[startLine]; - markerValue = Number(state.src.slice(start, posAfterMarker - 1)); - - // If we're starting a new ordered list right after - // a paragraph, it should start with 1. - if (isTerminatingParagraph && markerValue !== 1) return false; - } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) { - isOrdered = false; - } else { - return false; - } - - // If we're starting a new unordered list right after - // a paragraph, first line should not be empty. - if (isTerminatingParagraph) { - if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false; - } - - // We should terminate list on style change. Remember first one to compare. - markerCharCode = state.src.charCodeAt(posAfterMarker - 1); - - // For validation mode we can terminate immediately - if (silent) { - return true; - } - - // Start list - listTokIdx = state.tokens.length; - if (isOrdered) { - token = state.push('ordered_list_open', 'ol', 1); - if (markerValue !== 1) { - token.attrs = [['start', markerValue]]; - } - } else { - token = state.push('bullet_list_open', 'ul', 1); - } - token.map = listLines = [startLine, 0]; - token.markup = String.fromCharCode(markerCharCode); - - // - // Iterate list items - // - - nextLine = startLine; - prevEmptyEnd = false; - terminatorRules = state.md.block.ruler.getRules('list'); - oldParentType = state.parentType; - state.parentType = 'list'; - while (nextLine < endLine) { - pos = posAfterMarker; - max = state.eMarks[nextLine]; - initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]); - while (pos < max) { - ch = state.src.charCodeAt(pos); - if (ch === 0x09) { - offset += 4 - (offset + state.bsCount[nextLine]) % 4; - } else if (ch === 0x20) { - offset++; - } else { - break; - } - pos++; - } - contentStart = pos; - if (contentStart >= max) { - // trimming space in "- \n 3" case, indent is 1 here - indentAfterMarker = 1; - } else { - indentAfterMarker = offset - initial; - } - - // If we have more than 4 spaces, the indent is 1 - // (the rest is just indented code block) - if (indentAfterMarker > 4) { - indentAfterMarker = 1; - } - - // " - test" - // ^^^^^ - calculating total length of this thing - indent = initial + indentAfterMarker; - - // Run subparser & write tokens - token = state.push('list_item_open', 'li', 1); - token.markup = String.fromCharCode(markerCharCode); - token.map = itemLines = [startLine, 0]; - if (isOrdered) { - token.info = state.src.slice(start, posAfterMarker - 1); - } - - // change current state, then restore it after parser subcall - oldTight = state.tight; - oldTShift = state.tShift[startLine]; - oldSCount = state.sCount[startLine]; - - // - example list - // ^ listIndent position will be here - // ^ blkIndent position will be here - // - oldListIndent = state.listIndent; - state.listIndent = state.blkIndent; - state.blkIndent = indent; - state.tight = true; - state.tShift[startLine] = contentStart - state.bMarks[startLine]; - state.sCount[startLine] = offset; - if (contentStart >= max && state.isEmpty(startLine + 1)) { - // workaround for this case - // (list item is empty, list terminates before "foo"): - // ~~~~~~~~ - // - - // - // foo - // ~~~~~~~~ - state.line = Math.min(state.line + 2, endLine); - } else { - state.md.block.tokenize(state, startLine, endLine, true); - } - - // If any of list item is tight, mark list as tight - if (!state.tight || prevEmptyEnd) { - tight = false; - } - // Item become loose if finish with empty line, - // but we should filter last element, because it means list finish - prevEmptyEnd = state.line - startLine > 1 && state.isEmpty(state.line - 1); - state.blkIndent = state.listIndent; - state.listIndent = oldListIndent; - state.tShift[startLine] = oldTShift; - state.sCount[startLine] = oldSCount; - state.tight = oldTight; - token = state.push('list_item_close', 'li', -1); - token.markup = String.fromCharCode(markerCharCode); - nextLine = startLine = state.line; - itemLines[1] = nextLine; - contentStart = state.bMarks[startLine]; - if (nextLine >= endLine) { - break; - } - - // - // Try to check if list is terminated or continued. - // - if (state.sCount[nextLine] < state.blkIndent) { - break; - } - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - break; - } - - // fail if terminating block found - terminate = false; - for (i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - - // fail if list has another type - if (isOrdered) { - posAfterMarker = skipOrderedListMarker(state, nextLine); - if (posAfterMarker < 0) { - break; - } - start = state.bMarks[nextLine] + state.tShift[nextLine]; - } else { - posAfterMarker = skipBulletListMarker(state, nextLine); - if (posAfterMarker < 0) { - break; - } - } - if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { - break; - } - } - - // Finalize list - if (isOrdered) { - token = state.push('ordered_list_close', 'ol', -1); - } else { - token = state.push('bullet_list_close', 'ul', -1); - } - token.markup = String.fromCharCode(markerCharCode); - listLines[1] = nextLine; - state.line = nextLine; - state.parentType = oldParentType; - - // mark paragraphs tight if needed - if (tight) { - markTightParagraphs(state, listTokIdx); - } - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/paragraph.js": -/*!**********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/paragraph.js ***! - \**********************************************************************/ -/***/ (function(module) { - -// Paragraph - - - -module.exports = function paragraph(state, startLine /*, endLine*/) { - var content, - terminate, - i, - l, - token, - oldParentType, - nextLine = startLine + 1, - terminatorRules = state.md.block.ruler.getRules('paragraph'), - endLine = state.lineMax; - oldParentType = state.parentType; - state.parentType = 'paragraph'; - - // jump line-by-line until empty one or EOF - for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { - // this would be a code block normally, but after paragraph - // it's considered a lazy continuation regardless of what's there - if (state.sCount[nextLine] - state.blkIndent > 3) { - continue; - } - - // quirk for blockquotes, this line should already be checked by that rule - if (state.sCount[nextLine] < 0) { - continue; - } - - // Some tags can terminate paragraph without empty line. - terminate = false; - for (i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - } - content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); - state.line = nextLine; - token = state.push('paragraph_open', 'p', 1); - token.map = [startLine, state.line]; - token = state.push('inline', '', 0); - token.content = content; - token.map = [startLine, state.line]; - token.children = []; - token = state.push('paragraph_close', 'p', -1); - state.parentType = oldParentType; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/reference.js": -/*!**********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/reference.js ***! - \**********************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - - -var normalizeReference = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").normalizeReference); -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -module.exports = function reference(state, startLine, _endLine, silent) { - var ch, - destEndPos, - destEndLineNo, - endLine, - href, - i, - l, - label, - labelEnd, - oldParentType, - res, - start, - str, - terminate, - terminatorRules, - title, - lines = 0, - pos = state.bMarks[startLine] + state.tShift[startLine], - max = state.eMarks[startLine], - nextLine = startLine + 1; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - if (state.src.charCodeAt(pos) !== 0x5B /* [ */) { - return false; - } - - // Simple check to quickly interrupt scan on [link](url) at the start of line. - // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54 - while (++pos < max) { - if (state.src.charCodeAt(pos) === 0x5D /* ] */ && state.src.charCodeAt(pos - 1) !== 0x5C /* \ */) { - if (pos + 1 === max) { - return false; - } - if (state.src.charCodeAt(pos + 1) !== 0x3A /* : */) { - return false; - } - break; - } - } - endLine = state.lineMax; - - // jump line-by-line until empty one or EOF - terminatorRules = state.md.block.ruler.getRules('reference'); - oldParentType = state.parentType; - state.parentType = 'reference'; - for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { - // this would be a code block normally, but after paragraph - // it's considered a lazy continuation regardless of what's there - if (state.sCount[nextLine] - state.blkIndent > 3) { - continue; - } - - // quirk for blockquotes, this line should already be checked by that rule - if (state.sCount[nextLine] < 0) { - continue; - } - - // Some tags can terminate paragraph without empty line. - terminate = false; - for (i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - } - str = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); - max = str.length; - for (pos = 1; pos < max; pos++) { - ch = str.charCodeAt(pos); - if (ch === 0x5B /* [ */) { - return false; - } else if (ch === 0x5D /* ] */) { - labelEnd = pos; - break; - } else if (ch === 0x0A /* \n */) { - lines++; - } else if (ch === 0x5C /* \ */) { - pos++; - if (pos < max && str.charCodeAt(pos) === 0x0A) { - lines++; - } - } - } - if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A /* : */) { - return false; - } - - // [label]: destination 'title' - // ^^^ skip optional whitespace here - for (pos = labelEnd + 2; pos < max; pos++) { - ch = str.charCodeAt(pos); - if (ch === 0x0A) { - lines++; - } else if (isSpace(ch)) { - /*eslint no-empty:0*/ - } else { - break; - } - } - - // [label]: destination 'title' - // ^^^^^^^^^^^ parse this - res = state.md.helpers.parseLinkDestination(str, pos, max); - if (!res.ok) { - return false; - } - href = state.md.normalizeLink(res.str); - if (!state.md.validateLink(href)) { - return false; - } - pos = res.pos; - lines += res.lines; - - // save cursor state, we could require to rollback later - destEndPos = pos; - destEndLineNo = lines; - - // [label]: destination 'title' - // ^^^ skipping those spaces - start = pos; - for (; pos < max; pos++) { - ch = str.charCodeAt(pos); - if (ch === 0x0A) { - lines++; - } else if (isSpace(ch)) { - /*eslint no-empty:0*/ - } else { - break; - } - } - - // [label]: destination 'title' - // ^^^^^^^ parse this - res = state.md.helpers.parseLinkTitle(str, pos, max); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; - lines += res.lines; - } else { - title = ''; - pos = destEndPos; - lines = destEndLineNo; - } - - // skip trailing spaces until the rest of the line - while (pos < max) { - ch = str.charCodeAt(pos); - if (!isSpace(ch)) { - break; - } - pos++; - } - if (pos < max && str.charCodeAt(pos) !== 0x0A) { - if (title) { - // garbage at the end of the line after title, - // but it could still be a valid reference if we roll back - title = ''; - pos = destEndPos; - lines = destEndLineNo; - while (pos < max) { - ch = str.charCodeAt(pos); - if (!isSpace(ch)) { - break; - } - pos++; - } - } - } - if (pos < max && str.charCodeAt(pos) !== 0x0A) { - // garbage at the end of the line - return false; - } - label = normalizeReference(str.slice(1, labelEnd)); - if (!label) { - // CommonMark 0.20 disallows empty labels - return false; - } - - // Reference can not terminate anything. This check is for safety only. - /*istanbul ignore if*/ - if (silent) { - return true; - } - if (typeof state.env.references === 'undefined') { - state.env.references = {}; - } - if (typeof state.env.references[label] === 'undefined') { - state.env.references[label] = { - title: title, - href: href - }; - } - state.parentType = oldParentType; - state.line = startLine + lines + 1; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/state_block.js": -/*!************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/state_block.js ***! - \************************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Parser state class - - - -var Token = __webpack_require__(/*! ../token */ "../../../node_modules/markdown-it/lib/token.js"); -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -function StateBlock(src, md, env, tokens) { - var ch, s, start, pos, len, indent, offset, indent_found; - this.src = src; - - // link to parser instance - this.md = md; - this.env = env; - - // - // Internal state vartiables - // - - this.tokens = tokens; - this.bMarks = []; // line begin offsets for fast jumps - this.eMarks = []; // line end offsets for fast jumps - this.tShift = []; // offsets of the first non-space characters (tabs not expanded) - this.sCount = []; // indents for each line (tabs expanded) - - // An amount of virtual spaces (tabs expanded) between beginning - // of each line (bMarks) and real beginning of that line. - // - // It exists only as a hack because blockquotes override bMarks - // losing information in the process. - // - // It's used only when expanding tabs, you can think about it as - // an initial tab length, e.g. bsCount=21 applied to string `\t123` - // means first tab should be expanded to 4-21%4 === 3 spaces. - // - this.bsCount = []; - - // block parser variables - this.blkIndent = 0; // required block content indent (for example, if we are - // inside a list, it would be positioned after list marker) - this.line = 0; // line index in src - this.lineMax = 0; // lines count - this.tight = false; // loose/tight mode for lists - this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any) - this.listIndent = -1; // indent of the current list block (-1 if there isn't any) - - // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' - // used in lists to determine if they interrupt a paragraph - this.parentType = 'root'; - this.level = 0; - - // renderer - this.result = ''; - - // Create caches - // Generate markers. - s = this.src; - indent_found = false; - for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) { - ch = s.charCodeAt(pos); - if (!indent_found) { - if (isSpace(ch)) { - indent++; - if (ch === 0x09) { - offset += 4 - offset % 4; - } else { - offset++; - } - continue; - } else { - indent_found = true; - } - } - if (ch === 0x0A || pos === len - 1) { - if (ch !== 0x0A) { - pos++; - } - this.bMarks.push(start); - this.eMarks.push(pos); - this.tShift.push(indent); - this.sCount.push(offset); - this.bsCount.push(0); - indent_found = false; - indent = 0; - offset = 0; - start = pos + 1; - } - } - - // Push fake entry to simplify cache bounds checks - this.bMarks.push(s.length); - this.eMarks.push(s.length); - this.tShift.push(0); - this.sCount.push(0); - this.bsCount.push(0); - this.lineMax = this.bMarks.length - 1; // don't count last fake line -} - -// Push new token to "stream". -// -StateBlock.prototype.push = function (type, tag, nesting) { - var token = new Token(type, tag, nesting); - token.block = true; - if (nesting < 0) this.level--; // closing tag - token.level = this.level; - if (nesting > 0) this.level++; // opening tag - - this.tokens.push(token); - return token; -}; -StateBlock.prototype.isEmpty = function isEmpty(line) { - return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]; -}; -StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) { - for (var max = this.lineMax; from < max; from++) { - if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { - break; - } - } - return from; -}; - -// Skip spaces from given position. -StateBlock.prototype.skipSpaces = function skipSpaces(pos) { - var ch; - for (var max = this.src.length; pos < max; pos++) { - ch = this.src.charCodeAt(pos); - if (!isSpace(ch)) { - break; - } - } - return pos; -}; - -// Skip spaces from given position in reverse. -StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) { - if (pos <= min) { - return pos; - } - while (pos > min) { - if (!isSpace(this.src.charCodeAt(--pos))) { - return pos + 1; - } - } - return pos; -}; - -// Skip char codes from given position -StateBlock.prototype.skipChars = function skipChars(pos, code) { - for (var max = this.src.length; pos < max; pos++) { - if (this.src.charCodeAt(pos) !== code) { - break; - } - } - return pos; -}; - -// Skip char codes reverse from given position - 1 -StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) { - if (pos <= min) { - return pos; - } - while (pos > min) { - if (code !== this.src.charCodeAt(--pos)) { - return pos + 1; - } - } - return pos; -}; - -// cut lines range from source. -StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) { - var i, - lineIndent, - ch, - first, - last, - queue, - lineStart, - line = begin; - if (begin >= end) { - return ''; - } - queue = new Array(end - begin); - for (i = 0; line < end; line++, i++) { - lineIndent = 0; - lineStart = first = this.bMarks[line]; - if (line + 1 < end || keepLastLF) { - // No need for bounds check because we have fake entry on tail. - last = this.eMarks[line] + 1; - } else { - last = this.eMarks[line]; - } - while (first < last && lineIndent < indent) { - ch = this.src.charCodeAt(first); - if (isSpace(ch)) { - if (ch === 0x09) { - lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4; - } else { - lineIndent++; - } - } else if (first - lineStart < this.tShift[line]) { - // patched tShift masked characters to look like spaces (blockquotes, list markers) - lineIndent++; - } else { - break; - } - first++; - } - if (lineIndent > indent) { - // partially expanding tabs in code blocks, e.g '\t\tfoobar' - // with indent=2 becomes ' \tfoobar' - queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last); - } else { - queue[i] = this.src.slice(first, last); - } - } - return queue.join(''); -}; - -// re-export Token class to use in block rules -StateBlock.prototype.Token = Token; -module.exports = StateBlock; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_block/table.js": -/*!******************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_block/table.js ***! - \******************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// GFM table, https://github.github.com/gfm/#tables-extension- - - - -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -function getLine(state, line) { - var pos = state.bMarks[line] + state.tShift[line], - max = state.eMarks[line]; - return state.src.substr(pos, max - pos); -} -function escapedSplit(str) { - var result = [], - pos = 0, - max = str.length, - ch, - isEscaped = false, - lastPos = 0, - current = ''; - ch = str.charCodeAt(pos); - while (pos < max) { - if (ch === 0x7c /* | */) { - if (!isEscaped) { - // pipe separating cells, '|' - result.push(current + str.substring(lastPos, pos)); - current = ''; - lastPos = pos + 1; - } else { - // escaped pipe, '\|' - current += str.substring(lastPos, pos - 1); - lastPos = pos; - } - } - isEscaped = ch === 0x5c /* \ */; - pos++; - ch = str.charCodeAt(pos); - } - result.push(current + str.substring(lastPos)); - return result; -} -module.exports = function table(state, startLine, endLine, silent) { - var ch, lineText, pos, i, l, nextLine, columns, columnCount, token, aligns, t, tableLines, tbodyLines, oldParentType, terminate, terminatorRules, firstCh, secondCh; - - // should have at least two lines - if (startLine + 2 > endLine) { - return false; - } - nextLine = startLine + 1; - if (state.sCount[nextLine] < state.blkIndent) { - return false; - } - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[nextLine] - state.blkIndent >= 4) { - return false; - } - - // first character of the second line should be '|', '-', ':', - // and no other characters are allowed but spaces; - // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp - - pos = state.bMarks[nextLine] + state.tShift[nextLine]; - if (pos >= state.eMarks[nextLine]) { - return false; - } - firstCh = state.src.charCodeAt(pos++); - if (firstCh !== 0x7C /* | */ && firstCh !== 0x2D /* - */ && firstCh !== 0x3A /* : */) { - return false; - } - if (pos >= state.eMarks[nextLine]) { - return false; - } - secondCh = state.src.charCodeAt(pos++); - if (secondCh !== 0x7C /* | */ && secondCh !== 0x2D /* - */ && secondCh !== 0x3A /* : */ && !isSpace(secondCh)) { - return false; - } - - // if first character is '-', then second character must not be a space - // (due to parsing ambiguity with list) - if (firstCh === 0x2D /* - */ && isSpace(secondCh)) { - return false; - } - while (pos < state.eMarks[nextLine]) { - ch = state.src.charCodeAt(pos); - if (ch !== 0x7C /* | */ && ch !== 0x2D /* - */ && ch !== 0x3A /* : */ && !isSpace(ch)) { - return false; - } - pos++; - } - lineText = getLine(state, startLine + 1); - columns = lineText.split('|'); - aligns = []; - for (i = 0; i < columns.length; i++) { - t = columns[i].trim(); - if (!t) { - // allow empty columns before and after table, but not in between columns; - // e.g. allow ` |---| `, disallow ` ---||--- ` - if (i === 0 || i === columns.length - 1) { - continue; - } else { - return false; - } - } - if (!/^:?-+:?$/.test(t)) { - return false; - } - if (t.charCodeAt(t.length - 1) === 0x3A /* : */) { - aligns.push(t.charCodeAt(0) === 0x3A /* : */ ? 'center' : 'right'); - } else if (t.charCodeAt(0) === 0x3A /* : */) { - aligns.push('left'); - } else { - aligns.push(''); - } - } - lineText = getLine(state, startLine).trim(); - if (lineText.indexOf('|') === -1) { - return false; - } - if (state.sCount[startLine] - state.blkIndent >= 4) { - return false; - } - columns = escapedSplit(lineText); - if (columns.length && columns[0] === '') columns.shift(); - if (columns.length && columns[columns.length - 1] === '') columns.pop(); - - // header row will define an amount of columns in the entire table, - // and align row should be exactly the same (the rest of the rows can differ) - columnCount = columns.length; - if (columnCount === 0 || columnCount !== aligns.length) { - return false; - } - if (silent) { - return true; - } - oldParentType = state.parentType; - state.parentType = 'table'; - - // use 'blockquote' lists for termination because it's - // the most similar to tables - terminatorRules = state.md.block.ruler.getRules('blockquote'); - token = state.push('table_open', 'table', 1); - token.map = tableLines = [startLine, 0]; - token = state.push('thead_open', 'thead', 1); - token.map = [startLine, startLine + 1]; - token = state.push('tr_open', 'tr', 1); - token.map = [startLine, startLine + 1]; - for (i = 0; i < columns.length; i++) { - token = state.push('th_open', 'th', 1); - if (aligns[i]) { - token.attrs = [['style', 'text-align:' + aligns[i]]]; - } - token = state.push('inline', '', 0); - token.content = columns[i].trim(); - token.children = []; - token = state.push('th_close', 'th', -1); - } - token = state.push('tr_close', 'tr', -1); - token = state.push('thead_close', 'thead', -1); - for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { - if (state.sCount[nextLine] < state.blkIndent) { - break; - } - terminate = false; - for (i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { - break; - } - lineText = getLine(state, nextLine).trim(); - if (!lineText) { - break; - } - if (state.sCount[nextLine] - state.blkIndent >= 4) { - break; - } - columns = escapedSplit(lineText); - if (columns.length && columns[0] === '') columns.shift(); - if (columns.length && columns[columns.length - 1] === '') columns.pop(); - if (nextLine === startLine + 2) { - token = state.push('tbody_open', 'tbody', 1); - token.map = tbodyLines = [startLine + 2, 0]; - } - token = state.push('tr_open', 'tr', 1); - token.map = [nextLine, nextLine + 1]; - for (i = 0; i < columnCount; i++) { - token = state.push('td_open', 'td', 1); - if (aligns[i]) { - token.attrs = [['style', 'text-align:' + aligns[i]]]; - } - token = state.push('inline', '', 0); - token.content = columns[i] ? columns[i].trim() : ''; - token.children = []; - token = state.push('td_close', 'td', -1); - } - token = state.push('tr_close', 'tr', -1); - } - if (tbodyLines) { - token = state.push('tbody_close', 'tbody', -1); - tbodyLines[1] = nextLine; - } - token = state.push('table_close', 'table', -1); - tableLines[1] = nextLine; - state.parentType = oldParentType; - state.line = nextLine; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_core/block.js": -/*!*****************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_core/block.js ***! - \*****************************************************************/ -/***/ (function(module) { - - - -module.exports = function block(state) { - var token; - if (state.inlineMode) { - token = new state.Token('inline', '', 0); - token.content = state.src; - token.map = [0, 1]; - token.children = []; - state.tokens.push(token); - } else { - state.md.block.parse(state.src, state.md, state.env, state.tokens); - } -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_core/inline.js": -/*!******************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_core/inline.js ***! - \******************************************************************/ -/***/ (function(module) { - - - -module.exports = function inline(state) { - var tokens = state.tokens, - tok, - i, - l; - - // Parse inlines - for (i = 0, l = tokens.length; i < l; i++) { - tok = tokens[i]; - if (tok.type === 'inline') { - state.md.inline.parse(tok.content, state.md, state.env, tok.children); - } - } -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_core/linkify.js": -/*!*******************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_core/linkify.js ***! - \*******************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Replace link-like texts with link nodes. -// -// Currently restricted by `md.validateLink()` to http/https/ftp -// - - -var arrayReplaceAt = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").arrayReplaceAt); -function isLinkOpen(str) { - return /^\s]/i.test(str); -} -function isLinkClose(str) { - return /^<\/a\s*>/i.test(str); -} -module.exports = function linkify(state) { - var i, - j, - l, - tokens, - token, - currentToken, - nodes, - ln, - text, - pos, - lastPos, - level, - htmlLinkLevel, - url, - fullUrl, - urlText, - blockTokens = state.tokens, - links; - if (!state.md.options.linkify) { - return; - } - for (j = 0, l = blockTokens.length; j < l; j++) { - if (blockTokens[j].type !== 'inline' || !state.md.linkify.pretest(blockTokens[j].content)) { - continue; - } - tokens = blockTokens[j].children; - htmlLinkLevel = 0; - - // We scan from the end, to keep position when new tags added. - // Use reversed logic in links start/end match - for (i = tokens.length - 1; i >= 0; i--) { - currentToken = tokens[i]; - - // Skip content of markdown links - if (currentToken.type === 'link_close') { - i--; - while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') { - i--; - } - continue; - } - - // Skip content of html tag links - if (currentToken.type === 'html_inline') { - if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) { - htmlLinkLevel--; - } - if (isLinkClose(currentToken.content)) { - htmlLinkLevel++; - } - } - if (htmlLinkLevel > 0) { - continue; - } - if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) { - text = currentToken.content; - links = state.md.linkify.match(text); - - // Now split string to nodes - nodes = []; - level = currentToken.level; - lastPos = 0; - for (ln = 0; ln < links.length; ln++) { - url = links[ln].url; - fullUrl = state.md.normalizeLink(url); - if (!state.md.validateLink(fullUrl)) { - continue; - } - urlText = links[ln].text; - - // Linkifier might send raw hostnames like "example.com", where url - // starts with domain name. So we prepend http:// in those cases, - // and remove it afterwards. - // - if (!links[ln].schema) { - urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, ''); - } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) { - urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, ''); - } else { - urlText = state.md.normalizeLinkText(urlText); - } - pos = links[ln].index; - if (pos > lastPos) { - token = new state.Token('text', '', 0); - token.content = text.slice(lastPos, pos); - token.level = level; - nodes.push(token); - } - token = new state.Token('link_open', 'a', 1); - token.attrs = [['href', fullUrl]]; - token.level = level++; - token.markup = 'linkify'; - token.info = 'auto'; - nodes.push(token); - token = new state.Token('text', '', 0); - token.content = urlText; - token.level = level; - nodes.push(token); - token = new state.Token('link_close', 'a', -1); - token.level = --level; - token.markup = 'linkify'; - token.info = 'auto'; - nodes.push(token); - lastPos = links[ln].lastIndex; - } - if (lastPos < text.length) { - token = new state.Token('text', '', 0); - token.content = text.slice(lastPos); - token.level = level; - nodes.push(token); - } - - // replace current node - blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes); - } - } - } -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_core/normalize.js": -/*!*********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_core/normalize.js ***! - \*********************************************************************/ -/***/ (function(module) { - -// Normalize input string - - - -// https://spec.commonmark.org/0.29/#line-ending -var NEWLINES_RE = /\r\n?|\n/g; -var NULL_RE = /\0/g; -module.exports = function normalize(state) { - var str; - - // Normalize newlines - str = state.src.replace(NEWLINES_RE, '\n'); - - // Replace NULL characters - str = str.replace(NULL_RE, '\uFFFD'); - state.src = str; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_core/replacements.js": -/*!************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_core/replacements.js ***! - \************************************************************************/ -/***/ (function(module) { - -// Simple typographic replacements -// -// (c) (C) → © -// (tm) (TM) → ™ -// (r) (R) → ® -// +- → ± -// (p) (P) -> § -// ... → … (also ?.... → ?.., !.... → !..) -// ???????? → ???, !!!!! → !!!, `,,` → `,` -// -- → –, --- → — -// - - -// TODO: -// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾ -// - miltiplication 2 x 4 -> 2 × 4 -var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/; - -// Workaround for phantomjs - need regex without /g flag, -// or root check will fail every second time -var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i; -var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig; -var SCOPED_ABBR = { - c: '©', - r: '®', - p: '§', - tm: '™' -}; -function replaceFn(match, name) { - return SCOPED_ABBR[name.toLowerCase()]; -} -function replace_scoped(inlineTokens) { - var i, - token, - inside_autolink = 0; - for (i = inlineTokens.length - 1; i >= 0; i--) { - token = inlineTokens[i]; - if (token.type === 'text' && !inside_autolink) { - token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn); - } - if (token.type === 'link_open' && token.info === 'auto') { - inside_autolink--; - } - if (token.type === 'link_close' && token.info === 'auto') { - inside_autolink++; - } - } -} -function replace_rare(inlineTokens) { - var i, - token, - inside_autolink = 0; - for (i = inlineTokens.length - 1; i >= 0; i--) { - token = inlineTokens[i]; - if (token.type === 'text' && !inside_autolink) { - if (RARE_RE.test(token.content)) { - token.content = token.content.replace(/\+-/g, '±') - // .., ..., ....... -> … - // but ?..... & !..... -> ?.. & !.. - .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..').replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',') - // em-dash - .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\u2014') - // en-dash - .replace(/(^|\s)--(?=\s|$)/mg, '$1\u2013').replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, '$1\u2013'); - } - } - if (token.type === 'link_open' && token.info === 'auto') { - inside_autolink--; - } - if (token.type === 'link_close' && token.info === 'auto') { - inside_autolink++; - } - } -} -module.exports = function replace(state) { - var blkIdx; - if (!state.md.options.typographer) { - return; - } - for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { - if (state.tokens[blkIdx].type !== 'inline') { - continue; - } - if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) { - replace_scoped(state.tokens[blkIdx].children); - } - if (RARE_RE.test(state.tokens[blkIdx].content)) { - replace_rare(state.tokens[blkIdx].children); - } - } -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_core/smartquotes.js": -/*!***********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_core/smartquotes.js ***! - \***********************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Convert straight quotation marks to typographic ones -// - - -var isWhiteSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isWhiteSpace); -var isPunctChar = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isPunctChar); -var isMdAsciiPunct = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isMdAsciiPunct); -var QUOTE_TEST_RE = /['"]/; -var QUOTE_RE = /['"]/g; -var APOSTROPHE = '\u2019'; /* ’ */ - -function replaceAt(str, index, ch) { - return str.substr(0, index) + ch + str.substr(index + 1); -} -function process_inlines(tokens, state) { - var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar, isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace, canOpen, canClose, j, isSingle, stack, openQuote, closeQuote; - stack = []; - for (i = 0; i < tokens.length; i++) { - token = tokens[i]; - thisLevel = tokens[i].level; - for (j = stack.length - 1; j >= 0; j--) { - if (stack[j].level <= thisLevel) { - break; - } - } - stack.length = j + 1; - if (token.type !== 'text') { - continue; - } - text = token.content; - pos = 0; - max = text.length; - - /*eslint no-labels:0,block-scoped-var:0*/ - OUTER: while (pos < max) { - QUOTE_RE.lastIndex = pos; - t = QUOTE_RE.exec(text); - if (!t) { - break; - } - canOpen = canClose = true; - pos = t.index + 1; - isSingle = t[0] === "'"; - - // Find previous character, - // default to space if it's the beginning of the line - // - lastChar = 0x20; - if (t.index - 1 >= 0) { - lastChar = text.charCodeAt(t.index - 1); - } else { - for (j = i - 1; j >= 0; j--) { - if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20 - if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' - - lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1); - break; - } - } - - // Find next character, - // default to space if it's the end of the line - // - nextChar = 0x20; - if (pos < max) { - nextChar = text.charCodeAt(pos); - } else { - for (j = i + 1; j < tokens.length; j++) { - if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20 - if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' - - nextChar = tokens[j].content.charCodeAt(0); - break; - } - } - isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); - isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); - isLastWhiteSpace = isWhiteSpace(lastChar); - isNextWhiteSpace = isWhiteSpace(nextChar); - if (isNextWhiteSpace) { - canOpen = false; - } else if (isNextPunctChar) { - if (!(isLastWhiteSpace || isLastPunctChar)) { - canOpen = false; - } - } - if (isLastWhiteSpace) { - canClose = false; - } else if (isLastPunctChar) { - if (!(isNextWhiteSpace || isNextPunctChar)) { - canClose = false; - } - } - if (nextChar === 0x22 /* " */ && t[0] === '"') { - if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) { - // special case: 1"" - count first quote as an inch - canClose = canOpen = false; - } - } - if (canOpen && canClose) { - // Replace quotes in the middle of punctuation sequence, but not - // in the middle of the words, i.e.: - // - // 1. foo " bar " baz - not replaced - // 2. foo-"-bar-"-baz - replaced - // 3. foo"bar"baz - not replaced - // - canOpen = isLastPunctChar; - canClose = isNextPunctChar; - } - if (!canOpen && !canClose) { - // middle of word - if (isSingle) { - token.content = replaceAt(token.content, t.index, APOSTROPHE); - } - continue; - } - if (canClose) { - // this could be a closing quote, rewind the stack to get a match - for (j = stack.length - 1; j >= 0; j--) { - item = stack[j]; - if (stack[j].level < thisLevel) { - break; - } - if (item.single === isSingle && stack[j].level === thisLevel) { - item = stack[j]; - if (isSingle) { - openQuote = state.md.options.quotes[2]; - closeQuote = state.md.options.quotes[3]; - } else { - openQuote = state.md.options.quotes[0]; - closeQuote = state.md.options.quotes[1]; - } - - // replace token.content *before* tokens[item.token].content, - // because, if they are pointing at the same token, replaceAt - // could mess up indices when quote length != 1 - token.content = replaceAt(token.content, t.index, closeQuote); - tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote); - pos += closeQuote.length - 1; - if (item.token === i) { - pos += openQuote.length - 1; - } - text = token.content; - max = text.length; - stack.length = j; - continue OUTER; - } - } - } - if (canOpen) { - stack.push({ - token: i, - pos: t.index, - single: isSingle, - level: thisLevel - }); - } else if (canClose && isSingle) { - token.content = replaceAt(token.content, t.index, APOSTROPHE); - } - } - } -} -module.exports = function smartquotes(state) { - /*eslint max-depth:0*/ - var blkIdx; - if (!state.md.options.typographer) { - return; - } - for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { - if (state.tokens[blkIdx].type !== 'inline' || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) { - continue; - } - process_inlines(state.tokens[blkIdx].children, state); - } -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_core/state_core.js": -/*!**********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_core/state_core.js ***! - \**********************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Core state object -// - - -var Token = __webpack_require__(/*! ../token */ "../../../node_modules/markdown-it/lib/token.js"); -function StateCore(src, md, env) { - this.src = src; - this.env = env; - this.tokens = []; - this.inlineMode = false; - this.md = md; // link to parser instance -} - -// re-export Token class to use in core rules -StateCore.prototype.Token = Token; -module.exports = StateCore; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/autolink.js": -/*!**********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/autolink.js ***! - \**********************************************************************/ -/***/ (function(module) { - -// Process autolinks '' - - - -/*eslint max-len:0*/ -var EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/; -var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/; -module.exports = function autolink(state, silent) { - var url, - fullUrl, - token, - ch, - start, - max, - pos = state.pos; - if (state.src.charCodeAt(pos) !== 0x3C /* < */) { - return false; - } - start = state.pos; - max = state.posMax; - for (;;) { - if (++pos >= max) return false; - ch = state.src.charCodeAt(pos); - if (ch === 0x3C /* < */) return false; - if (ch === 0x3E /* > */) break; - } - url = state.src.slice(start + 1, pos); - if (AUTOLINK_RE.test(url)) { - fullUrl = state.md.normalizeLink(url); - if (!state.md.validateLink(fullUrl)) { - return false; - } - if (!silent) { - token = state.push('link_open', 'a', 1); - token.attrs = [['href', fullUrl]]; - token.markup = 'autolink'; - token.info = 'auto'; - token = state.push('text', '', 0); - token.content = state.md.normalizeLinkText(url); - token = state.push('link_close', 'a', -1); - token.markup = 'autolink'; - token.info = 'auto'; - } - state.pos += url.length + 2; - return true; - } - if (EMAIL_RE.test(url)) { - fullUrl = state.md.normalizeLink('mailto:' + url); - if (!state.md.validateLink(fullUrl)) { - return false; - } - if (!silent) { - token = state.push('link_open', 'a', 1); - token.attrs = [['href', fullUrl]]; - token.markup = 'autolink'; - token.info = 'auto'; - token = state.push('text', '', 0); - token.content = state.md.normalizeLinkText(url); - token = state.push('link_close', 'a', -1); - token.markup = 'autolink'; - token.info = 'auto'; - } - state.pos += url.length + 2; - return true; - } - return false; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/backticks.js": -/*!***********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/backticks.js ***! - \***********************************************************************/ -/***/ (function(module) { - -// Parse backticks - - - -module.exports = function backtick(state, silent) { - var start, - max, - marker, - token, - matchStart, - matchEnd, - openerLength, - closerLength, - pos = state.pos, - ch = state.src.charCodeAt(pos); - if (ch !== 0x60 /* ` */) { - return false; - } - start = pos; - pos++; - max = state.posMax; - - // scan marker length - while (pos < max && state.src.charCodeAt(pos) === 0x60 /* ` */) { - pos++; - } - marker = state.src.slice(start, pos); - openerLength = marker.length; - if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) { - if (!silent) state.pending += marker; - state.pos += openerLength; - return true; - } - matchStart = matchEnd = pos; - - // Nothing found in the cache, scan until the end of the line (or until marker is found) - while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) { - matchEnd = matchStart + 1; - - // scan marker length - while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60 /* ` */) { - matchEnd++; - } - closerLength = matchEnd - matchStart; - if (closerLength === openerLength) { - // Found matching closer length. - if (!silent) { - token = state.push('code_inline', 'code', 0); - token.markup = marker; - token.content = state.src.slice(pos, matchStart).replace(/\n/g, ' ').replace(/^ (.+) $/, '$1'); - } - state.pos = matchEnd; - return true; - } - - // Some different length found, put it in cache as upper limit of where closer can be found - state.backticks[closerLength] = matchStart; - } - - // Scanned through the end, didn't find anything - state.backticksScanned = true; - if (!silent) state.pending += marker; - state.pos += openerLength; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/balance_pairs.js": -/*!***************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/balance_pairs.js ***! - \***************************************************************************/ -/***/ (function(module) { - -// For each opening emphasis-like marker find a matching closing one -// - - -function processDelimiters(state, delimiters) { - var closerIdx, - openerIdx, - closer, - opener, - minOpenerIdx, - newMinOpenerIdx, - isOddMatch, - lastJump, - openersBottom = {}, - max = delimiters.length; - for (closerIdx = 0; closerIdx < max; closerIdx++) { - closer = delimiters[closerIdx]; - - // Length is only used for emphasis-specific "rule of 3", - // if it's not defined (in strikethrough or 3rd party plugins), - // we can default it to 0 to disable those checks. - // - closer.length = closer.length || 0; - if (!closer.close) continue; - - // Previously calculated lower bounds (previous fails) - // for each marker, each delimiter length modulo 3, - // and for whether this closer can be an opener; - // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460 - if (!openersBottom.hasOwnProperty(closer.marker)) { - openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]; - } - minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3]; - openerIdx = closerIdx - closer.jump - 1; - - // avoid crash if `closer.jump` is pointing outside of the array, see #742 - if (openerIdx < -1) openerIdx = -1; - newMinOpenerIdx = openerIdx; - for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) { - opener = delimiters[openerIdx]; - if (opener.marker !== closer.marker) continue; - if (opener.open && opener.end < 0) { - isOddMatch = false; - - // from spec: - // - // If one of the delimiters can both open and close emphasis, then the - // sum of the lengths of the delimiter runs containing the opening and - // closing delimiters must not be a multiple of 3 unless both lengths - // are multiples of 3. - // - if (opener.close || closer.open) { - if ((opener.length + closer.length) % 3 === 0) { - if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { - isOddMatch = true; - } - } - } - if (!isOddMatch) { - // If previous delimiter cannot be an opener, we can safely skip - // the entire sequence in future checks. This is required to make - // sure algorithm has linear complexity (see *_*_*_*_*_... case). - // - lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? delimiters[openerIdx - 1].jump + 1 : 0; - closer.jump = closerIdx - openerIdx + lastJump; - closer.open = false; - opener.end = closerIdx; - opener.jump = lastJump; - opener.close = false; - newMinOpenerIdx = -1; - break; - } - } - } - if (newMinOpenerIdx !== -1) { - // If match for this delimiter run failed, we want to set lower bound for - // future lookups. This is required to make sure algorithm has linear - // complexity. - // - // See details here: - // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442 - // - openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx; - } - } -} -module.exports = function link_pairs(state) { - var curr, - tokens_meta = state.tokens_meta, - max = state.tokens_meta.length; - processDelimiters(state, state.delimiters); - for (curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - processDelimiters(state, tokens_meta[curr].delimiters); - } - } -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/emphasis.js": -/*!**********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/emphasis.js ***! - \**********************************************************************/ -/***/ (function(module) { - -// Process *this* and _that_ -// - - -// Insert each marker as a separate text token, and add it to delimiter list -// -module.exports.tokenize = function emphasis(state, silent) { - var i, - scanned, - token, - start = state.pos, - marker = state.src.charCodeAt(start); - if (silent) { - return false; - } - if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { - return false; - } - scanned = state.scanDelims(state.pos, marker === 0x2A); - for (i = 0; i < scanned.length; i++) { - token = state.push('text', '', 0); - token.content = String.fromCharCode(marker); - state.delimiters.push({ - // Char code of the starting marker (number). - // - marker: marker, - // Total length of these series of delimiters. - // - length: scanned.length, - // An amount of characters before this one that's equivalent to - // current one. In plain English: if this delimiter does not open - // an emphasis, neither do previous `jump` characters. - // - // Used to skip sequences like "*****" in one step, for 1st asterisk - // value will be 0, for 2nd it's 1 and so on. - // - jump: i, - // A position of the token this delimiter corresponds to. - // - token: state.tokens.length - 1, - // If this delimiter is matched as a valid opener, `end` will be - // equal to its position, otherwise it's `-1`. - // - end: -1, - // Boolean flags that determine if this delimiter could open or close - // an emphasis. - // - open: scanned.can_open, - close: scanned.can_close - }); - } - state.pos += scanned.length; - return true; -}; -function postProcess(state, delimiters) { - var i, - startDelim, - endDelim, - token, - ch, - isStrong, - max = delimiters.length; - for (i = max - 1; i >= 0; i--) { - startDelim = delimiters[i]; - if (startDelim.marker !== 0x5F /* _ */ && startDelim.marker !== 0x2A /* * */) { - continue; - } - - // Process only opening markers - if (startDelim.end === -1) { - continue; - } - endDelim = delimiters[startDelim.end]; - - // If the previous delimiter has the same marker and is adjacent to this one, - // merge those into one strong delimiter. - // - // `whatever` -> `whatever` - // - isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1 && delimiters[i - 1].marker === startDelim.marker; - ch = String.fromCharCode(startDelim.marker); - token = state.tokens[startDelim.token]; - token.type = isStrong ? 'strong_open' : 'em_open'; - token.tag = isStrong ? 'strong' : 'em'; - token.nesting = 1; - token.markup = isStrong ? ch + ch : ch; - token.content = ''; - token = state.tokens[endDelim.token]; - token.type = isStrong ? 'strong_close' : 'em_close'; - token.tag = isStrong ? 'strong' : 'em'; - token.nesting = -1; - token.markup = isStrong ? ch + ch : ch; - token.content = ''; - if (isStrong) { - state.tokens[delimiters[i - 1].token].content = ''; - state.tokens[delimiters[startDelim.end + 1].token].content = ''; - i--; - } - } -} - -// Walk through delimiter list and replace text tokens with tags -// -module.exports.postProcess = function emphasis(state) { - var curr, - tokens_meta = state.tokens_meta, - max = state.tokens_meta.length; - postProcess(state, state.delimiters); - for (curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - postProcess(state, tokens_meta[curr].delimiters); - } - } -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/entity.js": -/*!********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/entity.js ***! - \********************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Process html entity - {, ¯, ", ... - - - -var entities = __webpack_require__(/*! ../common/entities */ "../../../node_modules/markdown-it/lib/common/entities.js"); -var has = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").has); -var isValidEntityCode = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isValidEntityCode); -var fromCodePoint = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").fromCodePoint); -var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i; -var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i; -module.exports = function entity(state, silent) { - var ch, - code, - match, - pos = state.pos, - max = state.posMax; - if (state.src.charCodeAt(pos) !== 0x26 /* & */) { - return false; - } - if (pos + 1 < max) { - ch = state.src.charCodeAt(pos + 1); - if (ch === 0x23 /* # */) { - match = state.src.slice(pos).match(DIGITAL_RE); - if (match) { - if (!silent) { - code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10); - state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD); - } - state.pos += match[0].length; - return true; - } - } else { - match = state.src.slice(pos).match(NAMED_RE); - if (match) { - if (has(entities, match[1])) { - if (!silent) { - state.pending += entities[match[1]]; - } - state.pos += match[0].length; - return true; - } - } - } - } - if (!silent) { - state.pending += '&'; - } - state.pos++; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/escape.js": -/*!********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/escape.js ***! - \********************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Process escaped chars and hardbreaks - - - -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -var ESCAPED = []; -for (var i = 0; i < 256; i++) { - ESCAPED.push(0); -} -'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'.split('').forEach(function (ch) { - ESCAPED[ch.charCodeAt(0)] = 1; -}); -module.exports = function escape(state, silent) { - var ch, - pos = state.pos, - max = state.posMax; - if (state.src.charCodeAt(pos) !== 0x5C /* \ */) { - return false; - } - pos++; - if (pos < max) { - ch = state.src.charCodeAt(pos); - if (ch < 256 && ESCAPED[ch] !== 0) { - if (!silent) { - state.pending += state.src[pos]; - } - state.pos += 2; - return true; - } - if (ch === 0x0A) { - if (!silent) { - state.push('hardbreak', 'br', 0); - } - pos++; - // skip leading whitespaces from next line - while (pos < max) { - ch = state.src.charCodeAt(pos); - if (!isSpace(ch)) { - break; - } - pos++; - } - state.pos = pos; - return true; - } - } - if (!silent) { - state.pending += '\\'; - } - state.pos++; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/html_inline.js": -/*!*************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/html_inline.js ***! - \*************************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Process html tags - - - -var HTML_TAG_RE = (__webpack_require__(/*! ../common/html_re */ "../../../node_modules/markdown-it/lib/common/html_re.js").HTML_TAG_RE); -function isLetter(ch) { - /*eslint no-bitwise:0*/ - var lc = ch | 0x20; // to lower case - return lc >= 0x61 /* a */ && lc <= 0x7a /* z */; -} - -module.exports = function html_inline(state, silent) { - var ch, - match, - max, - token, - pos = state.pos; - if (!state.md.options.html) { - return false; - } - - // Check start - max = state.posMax; - if (state.src.charCodeAt(pos) !== 0x3C /* < */ || pos + 2 >= max) { - return false; - } - - // Quick fail on second char - ch = state.src.charCodeAt(pos + 1); - if (ch !== 0x21 /* ! */ && ch !== 0x3F /* ? */ && ch !== 0x2F /* / */ && !isLetter(ch)) { - return false; - } - match = state.src.slice(pos).match(HTML_TAG_RE); - if (!match) { - return false; - } - if (!silent) { - token = state.push('html_inline', '', 0); - token.content = state.src.slice(pos, pos + match[0].length); - } - state.pos += match[0].length; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/image.js": -/*!*******************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/image.js ***! - \*******************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Process ![image]( "title") - - - -var normalizeReference = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").normalizeReference); -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -module.exports = function image(state, silent) { - var attrs, - code, - content, - label, - labelEnd, - labelStart, - pos, - ref, - res, - title, - token, - tokens, - start, - href = '', - oldPos = state.pos, - max = state.posMax; - if (state.src.charCodeAt(state.pos) !== 0x21 /* ! */) { - return false; - } - if (state.src.charCodeAt(state.pos + 1) !== 0x5B /* [ */) { - return false; - } - labelStart = state.pos + 2; - labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false); - - // parser failed to find ']', so it's not a valid link - if (labelEnd < 0) { - return false; - } - pos = labelEnd + 1; - if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { - // - // Inline link - // - - // [link]( "title" ) - // ^^ skipping these spaces - pos++; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } - if (pos >= max) { - return false; - } - - // [link]( "title" ) - // ^^^^^^ parsing link destination - start = pos; - res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); - if (res.ok) { - href = state.md.normalizeLink(res.str); - if (state.md.validateLink(href)) { - pos = res.pos; - } else { - href = ''; - } - } - - // [link]( "title" ) - // ^^ skipping these spaces - start = pos; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } - - // [link]( "title" ) - // ^^^^^^^ parsing link title - res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; - - // [link]( "title" ) - // ^^ skipping these spaces - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } - } else { - title = ''; - } - if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { - state.pos = oldPos; - return false; - } - pos++; - } else { - // - // Link reference - // - if (typeof state.env.references === 'undefined') { - return false; - } - if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { - start = pos + 1; - pos = state.md.helpers.parseLinkLabel(state, pos); - if (pos >= 0) { - label = state.src.slice(start, pos++); - } else { - pos = labelEnd + 1; - } - } else { - pos = labelEnd + 1; - } - - // covers label === '' and label === undefined - // (collapsed reference link and shortcut reference link respectively) - if (!label) { - label = state.src.slice(labelStart, labelEnd); - } - ref = state.env.references[normalizeReference(label)]; - if (!ref) { - state.pos = oldPos; - return false; - } - href = ref.href; - title = ref.title; - } - - // - // We found the end of the link, and know for a fact it's a valid link; - // so all that's left to do is to call tokenizer. - // - if (!silent) { - content = state.src.slice(labelStart, labelEnd); - state.md.inline.parse(content, state.md, state.env, tokens = []); - token = state.push('image', 'img', 0); - token.attrs = attrs = [['src', href], ['alt', '']]; - token.children = tokens; - token.content = content; - if (title) { - attrs.push(['title', title]); - } - } - state.pos = pos; - state.posMax = max; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/link.js": -/*!******************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/link.js ***! - \******************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Process [link]( "stuff") - - - -var normalizeReference = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").normalizeReference); -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -module.exports = function link(state, silent) { - var attrs, - code, - label, - labelEnd, - labelStart, - pos, - res, - ref, - token, - href = '', - title = '', - oldPos = state.pos, - max = state.posMax, - start = state.pos, - parseReference = true; - if (state.src.charCodeAt(state.pos) !== 0x5B /* [ */) { - return false; - } - labelStart = state.pos + 1; - labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true); - - // parser failed to find ']', so it's not a valid link - if (labelEnd < 0) { - return false; - } - pos = labelEnd + 1; - if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { - // - // Inline link - // - - // might have found a valid shortcut link, disable reference parsing - parseReference = false; - - // [link]( "title" ) - // ^^ skipping these spaces - pos++; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } - if (pos >= max) { - return false; - } - - // [link]( "title" ) - // ^^^^^^ parsing link destination - start = pos; - res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); - if (res.ok) { - href = state.md.normalizeLink(res.str); - if (state.md.validateLink(href)) { - pos = res.pos; - } else { - href = ''; - } - - // [link]( "title" ) - // ^^ skipping these spaces - start = pos; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } - - // [link]( "title" ) - // ^^^^^^^ parsing link title - res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; - - // [link]( "title" ) - // ^^ skipping these spaces - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { - break; - } - } - } - } - if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { - // parsing a valid shortcut link failed, fallback to reference - parseReference = true; - } - pos++; - } - if (parseReference) { - // - // Link reference - // - if (typeof state.env.references === 'undefined') { - return false; - } - if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { - start = pos + 1; - pos = state.md.helpers.parseLinkLabel(state, pos); - if (pos >= 0) { - label = state.src.slice(start, pos++); - } else { - pos = labelEnd + 1; - } - } else { - pos = labelEnd + 1; - } - - // covers label === '' and label === undefined - // (collapsed reference link and shortcut reference link respectively) - if (!label) { - label = state.src.slice(labelStart, labelEnd); - } - ref = state.env.references[normalizeReference(label)]; - if (!ref) { - state.pos = oldPos; - return false; - } - href = ref.href; - title = ref.title; - } - - // - // We found the end of the link, and know for a fact it's a valid link; - // so all that's left to do is to call tokenizer. - // - if (!silent) { - state.pos = labelStart; - state.posMax = labelEnd; - token = state.push('link_open', 'a', 1); - token.attrs = attrs = [['href', href]]; - if (title) { - attrs.push(['title', title]); - } - state.md.inline.tokenize(state); - token = state.push('link_close', 'a', -1); - } - state.pos = pos; - state.posMax = max; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/newline.js": -/*!*********************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/newline.js ***! - \*********************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Proceess '\n' - - - -var isSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isSpace); -module.exports = function newline(state, silent) { - var pmax, - max, - pos = state.pos; - if (state.src.charCodeAt(pos) !== 0x0A /* \n */) { - return false; - } - pmax = state.pending.length - 1; - max = state.posMax; - - // ' \n' -> hardbreak - // Lookup in pending chars is bad practice! Don't copy to other rules! - // Pending string is stored in concat mode, indexed lookups will cause - // convertion to flat mode. - if (!silent) { - if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) { - if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) { - state.pending = state.pending.replace(/ +$/, ''); - state.push('hardbreak', 'br', 0); - } else { - state.pending = state.pending.slice(0, -1); - state.push('softbreak', 'br', 0); - } - } else { - state.push('softbreak', 'br', 0); - } - } - pos++; - - // skip heading spaces for next line - while (pos < max && isSpace(state.src.charCodeAt(pos))) { - pos++; - } - state.pos = pos; - return true; -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/state_inline.js": -/*!**************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/state_inline.js ***! - \**************************************************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - -// Inline parser state - - - -var Token = __webpack_require__(/*! ../token */ "../../../node_modules/markdown-it/lib/token.js"); -var isWhiteSpace = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isWhiteSpace); -var isPunctChar = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isPunctChar); -var isMdAsciiPunct = (__webpack_require__(/*! ../common/utils */ "../../../node_modules/markdown-it/lib/common/utils.js").isMdAsciiPunct); -function StateInline(src, md, env, outTokens) { - this.src = src; - this.env = env; - this.md = md; - this.tokens = outTokens; - this.tokens_meta = Array(outTokens.length); - this.pos = 0; - this.posMax = this.src.length; - this.level = 0; - this.pending = ''; - this.pendingLevel = 0; - - // Stores { start: end } pairs. Useful for backtrack - // optimization of pairs parse (emphasis, strikes). - this.cache = {}; - - // List of emphasis-like delimiters for current tag - this.delimiters = []; - - // Stack of delimiter lists for upper level tags - this._prev_delimiters = []; - - // backtick length => last seen position - this.backticks = {}; - this.backticksScanned = false; -} - -// Flush pending text -// -StateInline.prototype.pushPending = function () { - var token = new Token('text', '', 0); - token.content = this.pending; - token.level = this.pendingLevel; - this.tokens.push(token); - this.pending = ''; - return token; -}; - -// Push new token to "stream". -// If pending text exists - flush it as text token -// -StateInline.prototype.push = function (type, tag, nesting) { - if (this.pending) { - this.pushPending(); - } - var token = new Token(type, tag, nesting); - var token_meta = null; - if (nesting < 0) { - // closing tag - this.level--; - this.delimiters = this._prev_delimiters.pop(); - } - token.level = this.level; - if (nesting > 0) { - // opening tag - this.level++; - this._prev_delimiters.push(this.delimiters); - this.delimiters = []; - token_meta = { - delimiters: this.delimiters - }; - } - this.pendingLevel = this.level; - this.tokens.push(token); - this.tokens_meta.push(token_meta); - return token; -}; - -// Scan a sequence of emphasis-like markers, and determine whether -// it can start an emphasis sequence or end an emphasis sequence. -// -// - start - position to scan from (it should point at a valid marker); -// - canSplitWord - determine if these markers can be found inside a word -// -StateInline.prototype.scanDelims = function (start, canSplitWord) { - var pos = start, - lastChar, - nextChar, - count, - can_open, - can_close, - isLastWhiteSpace, - isLastPunctChar, - isNextWhiteSpace, - isNextPunctChar, - left_flanking = true, - right_flanking = true, - max = this.posMax, - marker = this.src.charCodeAt(start); - - // treat beginning of the line as a whitespace - lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20; - while (pos < max && this.src.charCodeAt(pos) === marker) { - pos++; - } - count = pos - start; - - // treat end of the line as a whitespace - nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20; - isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); - isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); - isLastWhiteSpace = isWhiteSpace(lastChar); - isNextWhiteSpace = isWhiteSpace(nextChar); - if (isNextWhiteSpace) { - left_flanking = false; - } else if (isNextPunctChar) { - if (!(isLastWhiteSpace || isLastPunctChar)) { - left_flanking = false; - } - } - if (isLastWhiteSpace) { - right_flanking = false; - } else if (isLastPunctChar) { - if (!(isNextWhiteSpace || isNextPunctChar)) { - right_flanking = false; - } - } - if (!canSplitWord) { - can_open = left_flanking && (!right_flanking || isLastPunctChar); - can_close = right_flanking && (!left_flanking || isNextPunctChar); - } else { - can_open = left_flanking; - can_close = right_flanking; - } - return { - can_open: can_open, - can_close: can_close, - length: count - }; -}; - -// re-export Token class to use in block rules -StateInline.prototype.Token = Token; -module.exports = StateInline; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/strikethrough.js": -/*!***************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/strikethrough.js ***! - \***************************************************************************/ -/***/ (function(module) { - -// ~~strike through~~ -// - - -// Insert each marker as a separate text token, and add it to delimiter list -// -module.exports.tokenize = function strikethrough(state, silent) { - var i, - scanned, - token, - len, - ch, - start = state.pos, - marker = state.src.charCodeAt(start); - if (silent) { - return false; - } - if (marker !== 0x7E /* ~ */) { - return false; - } - scanned = state.scanDelims(state.pos, true); - len = scanned.length; - ch = String.fromCharCode(marker); - if (len < 2) { - return false; - } - if (len % 2) { - token = state.push('text', '', 0); - token.content = ch; - len--; - } - for (i = 0; i < len; i += 2) { - token = state.push('text', '', 0); - token.content = ch + ch; - state.delimiters.push({ - marker: marker, - length: 0, - // disable "rule of 3" length checks meant for emphasis - jump: i / 2, - // for `~~` 1 marker = 2 characters - token: state.tokens.length - 1, - end: -1, - open: scanned.can_open, - close: scanned.can_close - }); - } - state.pos += scanned.length; - return true; -}; -function postProcess(state, delimiters) { - var i, - j, - startDelim, - endDelim, - token, - loneMarkers = [], - max = delimiters.length; - for (i = 0; i < max; i++) { - startDelim = delimiters[i]; - if (startDelim.marker !== 0x7E /* ~ */) { - continue; - } - if (startDelim.end === -1) { - continue; - } - endDelim = delimiters[startDelim.end]; - token = state.tokens[startDelim.token]; - token.type = 's_open'; - token.tag = 's'; - token.nesting = 1; - token.markup = '~~'; - token.content = ''; - token = state.tokens[endDelim.token]; - token.type = 's_close'; - token.tag = 's'; - token.nesting = -1; - token.markup = '~~'; - token.content = ''; - if (state.tokens[endDelim.token - 1].type === 'text' && state.tokens[endDelim.token - 1].content === '~') { - loneMarkers.push(endDelim.token - 1); - } - } - - // If a marker sequence has an odd number of characters, it's splitted - // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the - // start of the sequence. - // - // So, we have to move all those markers after subsequent s_close tags. - // - while (loneMarkers.length) { - i = loneMarkers.pop(); - j = i + 1; - while (j < state.tokens.length && state.tokens[j].type === 's_close') { - j++; - } - j--; - if (i !== j) { - token = state.tokens[j]; - state.tokens[j] = state.tokens[i]; - state.tokens[i] = token; - } - } -} - -// Walk through delimiter list and replace text tokens with tags -// -module.exports.postProcess = function strikethrough(state) { - var curr, - tokens_meta = state.tokens_meta, - max = state.tokens_meta.length; - postProcess(state, state.delimiters); - for (curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - postProcess(state, tokens_meta[curr].delimiters); - } - } -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/text.js": -/*!******************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/text.js ***! - \******************************************************************/ -/***/ (function(module) { - -// Skip text characters for text token, place those to pending buffer -// and increment current pos - - - -// Rule to skip pure text -// '{}$%@~+=:' reserved for extentions - -// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ - -// !!!! Don't confuse with "Markdown ASCII Punctuation" chars -// http://spec.commonmark.org/0.15/#ascii-punctuation-character -function isTerminatorChar(ch) { - switch (ch) { - case 0x0A /* \n */: - case 0x21 /* ! */: - case 0x23 /* # */: - case 0x24 /* $ */: - case 0x25 /* % */: - case 0x26 /* & */: - case 0x2A /* * */: - case 0x2B /* + */: - case 0x2D /* - */: - case 0x3A /* : */: - case 0x3C /* < */: - case 0x3D /* = */: - case 0x3E /* > */: - case 0x40 /* @ */: - case 0x5B /* [ */: - case 0x5C /* \ */: - case 0x5D /* ] */: - case 0x5E /* ^ */: - case 0x5F /* _ */: - case 0x60 /* ` */: - case 0x7B /* { */: - case 0x7D /* } */: - case 0x7E /* ~ */: - return true; - default: - return false; - } -} -module.exports = function text(state, silent) { - var pos = state.pos; - while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) { - pos++; - } - if (pos === state.pos) { - return false; - } - if (!silent) { - state.pending += state.src.slice(state.pos, pos); - } - state.pos = pos; - return true; -}; - -// Alternative implementation, for memory. -// -// It costs 10% of performance, but allows extend terminators list, if place it -// to `ParcerInline` property. Probably, will switch to it sometime, such -// flexibility required. - -/* -var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/; - -module.exports = function text(state, silent) { - var pos = state.pos, - idx = state.src.slice(pos).search(TERMINATOR_RE); - - // first char is terminator -> empty text - if (idx === 0) { return false; } - - // no terminator -> text till end of string - if (idx < 0) { - if (!silent) { state.pending += state.src.slice(pos); } - state.pos = state.src.length; - return true; - } - - if (!silent) { state.pending += state.src.slice(pos, pos + idx); } - - state.pos += idx; - - return true; -};*/ - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/rules_inline/text_collapse.js": -/*!***************************************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/rules_inline/text_collapse.js ***! - \***************************************************************************/ -/***/ (function(module) { - -// Clean up tokens after emphasis and strikethrough postprocessing: -// merge adjacent text nodes into one and re-calculate all token levels -// -// This is necessary because initially emphasis delimiter markers (*, _, ~) -// are treated as their own separate text tokens. Then emphasis rule either -// leaves them as text (needed to merge with adjacent text) or turns them -// into opening/closing tags (which messes up levels inside). -// - - -module.exports = function text_collapse(state) { - var curr, - last, - level = 0, - tokens = state.tokens, - max = state.tokens.length; - for (curr = last = 0; curr < max; curr++) { - // re-calculate levels after emphasis/strikethrough turns some text nodes - // into opening/closing tags - if (tokens[curr].nesting < 0) level--; // closing tag - tokens[curr].level = level; - if (tokens[curr].nesting > 0) level++; // opening tag - - if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { - // collapse two adjacent text nodes - tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; - } else { - if (curr !== last) { - tokens[last] = tokens[curr]; - } - last++; - } - } - if (curr !== last) { - tokens.length = last; - } -}; - -/***/ }), - -/***/ "../../../node_modules/markdown-it/lib/token.js": -/*!******************************************************!*\ - !*** ../../../node_modules/markdown-it/lib/token.js ***! - \******************************************************/ -/***/ (function(module) { - -// Token class - - - -/** - * class Token - **/ - -/** - * new Token(type, tag, nesting) - * - * Create new token and fill passed properties. - **/ -function Token(type, tag, nesting) { - /** - * Token#type -> String - * - * Type of the token (string, e.g. "paragraph_open") - **/ - this.type = type; - - /** - * Token#tag -> String - * - * html tag name, e.g. "p" - **/ - this.tag = tag; - - /** - * Token#attrs -> Array - * - * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` - **/ - this.attrs = null; - - /** - * Token#map -> Array - * - * Source map info. Format: `[ line_begin, line_end ]` - **/ - this.map = null; - - /** - * Token#nesting -> Number - * - * Level change (number in {-1, 0, 1} set), where: - * - * - `1` means the tag is opening - * - `0` means the tag is self-closing - * - `-1` means the tag is closing - **/ - this.nesting = nesting; - - /** - * Token#level -> Number - * - * nesting level, the same as `state.level` - **/ - this.level = 0; - - /** - * Token#children -> Array - * - * An array of child nodes (inline and img tokens) - **/ - this.children = null; - - /** - * Token#content -> String - * - * In a case of self-closing tag (code, html, fence, etc.), - * it has contents of this tag. - **/ - this.content = ''; - - /** - * Token#markup -> String - * - * '*' or '_' for emphasis, fence string for fence, etc. - **/ - this.markup = ''; - - /** - * Token#info -> String - * - * Additional information: - * - * - Info string for "fence" tokens - * - The value "auto" for autolink "link_open" and "link_close" tokens - * - The string value of the item marker for ordered-list "list_item_open" tokens - **/ - this.info = ''; - - /** - * Token#meta -> Object - * - * A place for plugins to store an arbitrary data - **/ - this.meta = null; - - /** - * Token#block -> Boolean - * - * True for block-level tokens, false for inline tokens. - * Used in renderer to calculate line breaks - **/ - this.block = false; - - /** - * Token#hidden -> Boolean - * - * If it's true, ignore this element when rendering. Used for tight lists - * to hide paragraphs. - **/ - this.hidden = false; -} - -/** - * Token.attrIndex(name) -> Number - * - * Search attribute index by name. - **/ -Token.prototype.attrIndex = function attrIndex(name) { - var attrs, i, len; - if (!this.attrs) { - return -1; - } - attrs = this.attrs; - for (i = 0, len = attrs.length; i < len; i++) { - if (attrs[i][0] === name) { - return i; - } - } - return -1; -}; - -/** - * Token.attrPush(attrData) - * - * Add `[ name, value ]` attribute to list. Init attrs if necessary - **/ -Token.prototype.attrPush = function attrPush(attrData) { - if (this.attrs) { - this.attrs.push(attrData); - } else { - this.attrs = [attrData]; - } -}; - -/** - * Token.attrSet(name, value) - * - * Set `name` attribute to `value`. Override old value if exists. - **/ -Token.prototype.attrSet = function attrSet(name, value) { - var idx = this.attrIndex(name), - attrData = [name, value]; - if (idx < 0) { - this.attrPush(attrData); - } else { - this.attrs[idx] = attrData; - } -}; - -/** - * Token.attrGet(name) - * - * Get the value of attribute `name`, or null if it does not exist. - **/ -Token.prototype.attrGet = function attrGet(name) { - var idx = this.attrIndex(name), - value = null; - if (idx >= 0) { - value = this.attrs[idx][1]; - } - return value; -}; - -/** - * Token.attrJoin(name, value) - * - * Join value to existing attribute via space. Or create new attribute if not - * exists. Useful to operate with token classes. - **/ -Token.prototype.attrJoin = function attrJoin(name, value) { - var idx = this.attrIndex(name); - if (idx < 0) { - this.attrPush([name, value]); - } else { - this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value; - } -}; -module.exports = Token; - -/***/ }), - -/***/ "../../../node_modules/mdurl/decode.js": -/*!*********************************************!*\ - !*** ../../../node_modules/mdurl/decode.js ***! - \*********************************************/ -/***/ (function(module) { - - - -/* eslint-disable no-bitwise */ -var decodeCache = {}; -function getDecodeCache(exclude) { - var i, - ch, - cache = decodeCache[exclude]; - if (cache) { - return cache; - } - cache = decodeCache[exclude] = []; - for (i = 0; i < 128; i++) { - ch = String.fromCharCode(i); - cache.push(ch); - } - for (i = 0; i < exclude.length; i++) { - ch = exclude.charCodeAt(i); - cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2); - } - return cache; -} - -// Decode percent-encoded string. -// -function decode(string, exclude) { - var cache; - if (typeof exclude !== 'string') { - exclude = decode.defaultChars; - } - cache = getDecodeCache(exclude); - return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) { - var i, - l, - b1, - b2, - b3, - b4, - chr, - result = ''; - for (i = 0, l = seq.length; i < l; i += 3) { - b1 = parseInt(seq.slice(i + 1, i + 3), 16); - if (b1 < 0x80) { - result += cache[b1]; - continue; - } - if ((b1 & 0xE0) === 0xC0 && i + 3 < l) { - // 110xxxxx 10xxxxxx - b2 = parseInt(seq.slice(i + 4, i + 6), 16); - if ((b2 & 0xC0) === 0x80) { - chr = b1 << 6 & 0x7C0 | b2 & 0x3F; - if (chr < 0x80) { - result += '\ufffd\ufffd'; - } else { - result += String.fromCharCode(chr); - } - i += 3; - continue; - } - } - if ((b1 & 0xF0) === 0xE0 && i + 6 < l) { - // 1110xxxx 10xxxxxx 10xxxxxx - b2 = parseInt(seq.slice(i + 4, i + 6), 16); - b3 = parseInt(seq.slice(i + 7, i + 9), 16); - if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) { - chr = b1 << 12 & 0xF000 | b2 << 6 & 0xFC0 | b3 & 0x3F; - if (chr < 0x800 || chr >= 0xD800 && chr <= 0xDFFF) { - result += '\ufffd\ufffd\ufffd'; - } else { - result += String.fromCharCode(chr); - } - i += 6; - continue; - } - } - if ((b1 & 0xF8) === 0xF0 && i + 9 < l) { - // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx - b2 = parseInt(seq.slice(i + 4, i + 6), 16); - b3 = parseInt(seq.slice(i + 7, i + 9), 16); - b4 = parseInt(seq.slice(i + 10, i + 12), 16); - if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) { - chr = b1 << 18 & 0x1C0000 | b2 << 12 & 0x3F000 | b3 << 6 & 0xFC0 | b4 & 0x3F; - if (chr < 0x10000 || chr > 0x10FFFF) { - result += '\ufffd\ufffd\ufffd\ufffd'; - } else { - chr -= 0x10000; - result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF)); - } - i += 9; - continue; - } - } - result += '\ufffd'; - } - return result; - }); -} -decode.defaultChars = ';/?:@&=+$,#'; -decode.componentChars = ''; -module.exports = decode; - -/***/ }), - -/***/ "../../../node_modules/mdurl/encode.js": -/*!*********************************************!*\ - !*** ../../../node_modules/mdurl/encode.js ***! - \*********************************************/ -/***/ (function(module) { - - - -var encodeCache = {}; - -// Create a lookup array where anything but characters in `chars` string -// and alphanumeric chars is percent-encoded. -// -function getEncodeCache(exclude) { - var i, - ch, - cache = encodeCache[exclude]; - if (cache) { - return cache; - } - cache = encodeCache[exclude] = []; - for (i = 0; i < 128; i++) { - ch = String.fromCharCode(i); - if (/^[0-9a-z]$/i.test(ch)) { - // always allow unencoded alphanumeric characters - cache.push(ch); - } else { - cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2)); - } - } - for (i = 0; i < exclude.length; i++) { - cache[exclude.charCodeAt(i)] = exclude[i]; - } - return cache; -} - -// Encode unsafe characters with percent-encoding, skipping already -// encoded sequences. -// -// - string - string to encode -// - exclude - list of characters to ignore (in addition to a-zA-Z0-9) -// - keepEscaped - don't encode '%' in a correct escape sequence (default: true) -// -function encode(string, exclude, keepEscaped) { - var i, - l, - code, - nextCode, - cache, - result = ''; - if (typeof exclude !== 'string') { - // encode(string, keepEscaped) - keepEscaped = exclude; - exclude = encode.defaultChars; - } - if (typeof keepEscaped === 'undefined') { - keepEscaped = true; - } - cache = getEncodeCache(exclude); - for (i = 0, l = string.length; i < l; i++) { - code = string.charCodeAt(i); - if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) { - if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { - result += string.slice(i, i + 3); - i += 2; - continue; - } - } - if (code < 128) { - result += cache[code]; - continue; - } - if (code >= 0xD800 && code <= 0xDFFF) { - if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) { - nextCode = string.charCodeAt(i + 1); - if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { - result += encodeURIComponent(string[i] + string[i + 1]); - i++; - continue; - } - } - result += '%EF%BF%BD'; - continue; - } - result += encodeURIComponent(string[i]); - } - return result; -} -encode.defaultChars = ";/?:@&=+$,-_.!~*'()#"; -encode.componentChars = "-_.!~*'()"; -module.exports = encode; - -/***/ }), - -/***/ "../../../node_modules/mdurl/format.js": -/*!*********************************************!*\ - !*** ../../../node_modules/mdurl/format.js ***! - \*********************************************/ -/***/ (function(module) { - - - -module.exports = function format(url) { - var result = ''; - result += url.protocol || ''; - result += url.slashes ? '//' : ''; - result += url.auth ? url.auth + '@' : ''; - if (url.hostname && url.hostname.indexOf(':') !== -1) { - // ipv6 address - result += '[' + url.hostname + ']'; - } else { - result += url.hostname || ''; - } - result += url.port ? ':' + url.port : ''; - result += url.pathname || ''; - result += url.search || ''; - result += url.hash || ''; - return result; -}; - -/***/ }), - -/***/ "../../../node_modules/mdurl/index.js": -/*!********************************************!*\ - !*** ../../../node_modules/mdurl/index.js ***! - \********************************************/ -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - - -module.exports.encode = __webpack_require__(/*! ./encode */ "../../../node_modules/mdurl/encode.js"); -module.exports.decode = __webpack_require__(/*! ./decode */ "../../../node_modules/mdurl/decode.js"); -module.exports.format = __webpack_require__(/*! ./format */ "../../../node_modules/mdurl/format.js"); -module.exports.parse = __webpack_require__(/*! ./parse */ "../../../node_modules/mdurl/parse.js"); - -/***/ }), - -/***/ "../../../node_modules/mdurl/parse.js": -/*!********************************************!*\ - !*** ../../../node_modules/mdurl/parse.js ***! - \********************************************/ -/***/ (function(module) { - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -// -// Changes from joyent/node: -// -// 1. No leading slash in paths, -// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/` -// -// 2. Backslashes are not replaced with slashes, -// so `http:\\example.org\` is treated like a relative path -// -// 3. Trailing colon is treated like a part of the path, -// i.e. in `http://example.org:foo` pathname is `:foo` -// -// 4. Nothing is URL-encoded in the resulting object, -// (in joyent/node some chars in auth and paths are encoded) -// -// 5. `url.parse()` does not have `parseQueryString` argument -// -// 6. Removed extraneous result properties: `host`, `path`, `query`, etc., -// which can be constructed using other parts of the url. -// -function Url() { - this.protocol = null; - this.slashes = null; - this.auth = null; - this.port = null; - this.hostname = null; - this.hash = null; - this.search = null; - this.pathname = null; -} - -// Reference: RFC 3986, RFC 1808, RFC 2396 - -// define these here so at least they only have to be -// compiled once on the first module load. -var protocolPattern = /^([a-z0-9.+-]+:)/i, - portPattern = /:[0-9]*$/, - // Special case for a simple path URL - simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, - // RFC 2396: characters reserved for delimiting URLs. - // We actually just auto-escape these. - delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], - // RFC 2396: characters not allowed for various reasons. - unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), - // Allowed by RFCs, but cause of XSS attacks. Always escape these. - autoEscape = ['\''].concat(unwise), - // Characters that are never ever allowed in a hostname. - // Note that any invalid chars are also handled, but these - // are the ones that are *expected* to be seen, so we fast-path - // them. - nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), - hostEndingChars = ['/', '?', '#'], - hostnameMaxLen = 255, - hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, - hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, - // protocols that can allow "unsafe" and "unwise" chars. - /* eslint-disable no-script-url */ - // protocols that never have a hostname. - hostlessProtocol = { - 'javascript': true, - 'javascript:': true - }, - // protocols that always contain a // bit. - slashedProtocol = { - 'http': true, - 'https': true, - 'ftp': true, - 'gopher': true, - 'file': true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true - }; -/* eslint-enable no-script-url */ - -function urlParse(url, slashesDenoteHost) { - if (url && url instanceof Url) { - return url; - } - var u = new Url(); - u.parse(url, slashesDenoteHost); - return u; -} -Url.prototype.parse = function (url, slashesDenoteHost) { - var i, - l, - lowerProto, - hec, - slashes, - rest = url; - - // trim before proceeding. - // This is to support parse stuff like " http://foo.com \n" - rest = rest.trim(); - if (!slashesDenoteHost && url.split('#').length === 1) { - // Try fast path regexp - var simplePath = simplePathPattern.exec(rest); - if (simplePath) { - this.pathname = simplePath[1]; - if (simplePath[2]) { - this.search = simplePath[2]; - } - return this; - } - } - var proto = protocolPattern.exec(rest); - if (proto) { - proto = proto[0]; - lowerProto = proto.toLowerCase(); - this.protocol = proto; - rest = rest.substr(proto.length); - } - - // figure out if it's got a host - // user@server is *always* interpreted as a hostname, and url - // resolution will treat //foo/bar as host=foo,path=bar because that's - // how the browser resolves relative URLs. - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { - slashes = rest.substr(0, 2) === '//'; - if (slashes && !(proto && hostlessProtocol[proto])) { - rest = rest.substr(2); - this.slashes = true; - } - } - if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) { - // there's a hostname. - // the first instance of /, ?, ;, or # ends the host. - // - // If there is an @ in the hostname, then non-host chars *are* allowed - // to the left of the last @ sign, unless some host-ending character - // comes *before* the @-sign. - // URLs are obnoxious. - // - // ex: - // http://a@b@c/ => user:a@b host:c - // http://a@b?@c => user:a host:c path:/?@c - - // v0.12 TODO(isaacs): This is not quite how Chrome does things. - // Review our test case against browsers more comprehensively. - - // find the first instance of any hostEndingChars - var hostEnd = -1; - for (i = 0; i < hostEndingChars.length; i++) { - hec = rest.indexOf(hostEndingChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { - hostEnd = hec; - } - } - - // at this point, either we have an explicit point where the - // auth portion cannot go past, or the last @ char is the decider. - var auth, atSign; - if (hostEnd === -1) { - // atSign can be anywhere. - atSign = rest.lastIndexOf('@'); - } else { - // atSign must be in auth portion. - // http://a@b/c@d => host:b auth:a path:/c@d - atSign = rest.lastIndexOf('@', hostEnd); - } - - // Now we have a portion which is definitely the auth. - // Pull that off. - if (atSign !== -1) { - auth = rest.slice(0, atSign); - rest = rest.slice(atSign + 1); - this.auth = auth; - } - - // the host is the remaining to the left of the first non-host char - hostEnd = -1; - for (i = 0; i < nonHostChars.length; i++) { - hec = rest.indexOf(nonHostChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { - hostEnd = hec; - } - } - // if we still have not hit it, then the entire thing is a host. - if (hostEnd === -1) { - hostEnd = rest.length; - } - if (rest[hostEnd - 1] === ':') { - hostEnd--; - } - var host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); - - // pull out port. - this.parseHost(host); - - // we've indicated that there is a hostname, - // so even if it's empty, it has to be present. - this.hostname = this.hostname || ''; - - // if hostname begins with [ and ends with ] - // assume that it's an IPv6 address. - var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; - - // validate a little. - if (!ipv6Hostname) { - var hostparts = this.hostname.split(/\./); - for (i = 0, l = hostparts.length; i < l; i++) { - var part = hostparts[i]; - if (!part) { - continue; - } - if (!part.match(hostnamePartPattern)) { - var newpart = ''; - for (var j = 0, k = part.length; j < k; j++) { - if (part.charCodeAt(j) > 127) { - // we replace non-ASCII char with a temporary placeholder - // we need this to make sure size of hostname is not - // broken by replacing non-ASCII by nothing - newpart += 'x'; - } else { - newpart += part[j]; - } - } - // we test again with ASCII char only - if (!newpart.match(hostnamePartPattern)) { - var validParts = hostparts.slice(0, i); - var notHost = hostparts.slice(i + 1); - var bit = part.match(hostnamePartStart); - if (bit) { - validParts.push(bit[1]); - notHost.unshift(bit[2]); - } - if (notHost.length) { - rest = notHost.join('.') + rest; - } - this.hostname = validParts.join('.'); - break; - } - } - } - } - if (this.hostname.length > hostnameMaxLen) { - this.hostname = ''; - } - - // strip [ and ] from the hostname - // the host field still retains them, though - if (ipv6Hostname) { - this.hostname = this.hostname.substr(1, this.hostname.length - 2); - } - } - - // chop off from the tail first. - var hash = rest.indexOf('#'); - if (hash !== -1) { - // got a fragment string. - this.hash = rest.substr(hash); - rest = rest.slice(0, hash); - } - var qm = rest.indexOf('?'); - if (qm !== -1) { - this.search = rest.substr(qm); - rest = rest.slice(0, qm); - } - if (rest) { - this.pathname = rest; - } - if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { - this.pathname = ''; - } - return this; -}; -Url.prototype.parseHost = function (host) { - var port = portPattern.exec(host); - if (port) { - port = port[0]; - if (port !== ':') { - this.port = port.substr(1); - } - host = host.substr(0, host.length - port.length); - } - if (host) { - this.hostname = host; - } -}; -module.exports = urlParse; - -/***/ }), - /***/ "../../../node_modules/meros/browser/index.mjs": /*!*****************************************************!*\ !*** ../../../node_modules/meros/browser/index.mjs ***! @@ -48118,10 +42122,10 @@ exports.wrap = wrap; /***/ }), -/***/ "../../../node_modules/punycode/punycode.es6.js": -/*!******************************************************!*\ - !*** ../../../node_modules/punycode/punycode.es6.js ***! - \******************************************************/ +/***/ "../../../node_modules/punycode.js/punycode.es6.js": +/*!*********************************************************!*\ + !*** ../../../node_modules/punycode.js/punycode.es6.js ***! + \*********************************************************/ /***/ (function(__unused_webpack_module, exports) { @@ -48147,7 +42151,7 @@ const delimiter = '-'; // '\x2D' /** Regular expressions */ const regexPunycode = /^xn--/; -const regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators /** Error messages */ @@ -48182,11 +42186,11 @@ function error(type) { * item. * @returns {Array} A new array of values returned by the callback function. */ -function map(array, fn) { +function map(array, callback) { const result = []; let length = array.length; while (length--) { - result[length] = fn(array[length]); + result[length] = callback(array[length]); } return result; } @@ -48198,22 +42202,22 @@ function map(array, fn) { * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. - * @returns {Array} A new string of characters returned by the callback + * @returns {String} A new string of characters returned by the callback * function. */ -function mapDomain(string, fn) { - const parts = string.split('@'); +function mapDomain(domain, callback) { + const parts = domain.split('@'); let result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; - string = parts[1]; + domain = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - const labels = string.split('.'); - const encoded = map(labels, fn).join('.'); + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); return result + encoded; } @@ -48263,7 +42267,7 @@ function ucs2decode(string) { * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ -const ucs2encode = array => String.fromCodePoint(...array); +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); /** * Converts a basic code point into a digit/integer. @@ -48276,13 +42280,13 @@ const ucs2encode = array => String.fromCodePoint(...array); */ exports.ucs2encode = ucs2encode; const basicToDigit = function (codePoint) { - if (codePoint - 0x30 < 0x0A) { - return codePoint - 0x16; + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); } - if (codePoint - 0x41 < 0x1A) { + if (codePoint >= 0x41 && codePoint < 0x5B) { return codePoint - 0x41; } - if (codePoint - 0x61 < 0x1A) { + if (codePoint >= 0x61 && codePoint < 0x7B) { return codePoint - 0x61; } return base; @@ -48362,14 +42366,17 @@ const decode = function (input) { // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. - let oldi = i; + const oldi = i; for /* no condition */ (let w = 1, k = base;; k += base) { if (index >= inputLength) { error('invalid-input'); } const digit = basicToDigit(input.charCodeAt(index++)); - if (digit >= base || digit > floor((maxInt - i) / w)) { + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { error('overflow'); } i += digit * w; @@ -48415,7 +42422,7 @@ const encode = function (input) { input = ucs2decode(input); // Cache the length. - let inputLength = input.length; + const inputLength = input.length; // Initialize the state. let n = initialN; @@ -48428,7 +42435,7 @@ const encode = function (input) { output.push(stringFromCharCode(currentValue)); } } - let basicLength = output.length; + const basicLength = output.length; let handledCPCount = basicLength; // `handledCPCount` is the number of code points that have been handled; @@ -48462,7 +42469,7 @@ const encode = function (input) { if (currentValue < n && ++delta > maxInt) { error('overflow'); } - if (currentValue == n) { + if (currentValue === n) { // Represent delta as a generalized variable-length integer. let q = delta; for /* no condition */ @@ -48477,7 +42484,7 @@ const encode = function (input) { q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); delta = 0; ++handledCPCount; } @@ -48534,7 +42541,7 @@ const punycode = { * @memberOf punycode * @type String */ - 'version': '2.1.0', + 'version': '2.3.1', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. @@ -51424,82 +45431,6 @@ function __classPrivateFieldIn(state, receiver) { /***/ }), -/***/ "../../../node_modules/uc.micro/categories/Cc/regex.js": -/*!*************************************************************!*\ - !*** ../../../node_modules/uc.micro/categories/Cc/regex.js ***! - \*************************************************************/ -/***/ (function(module) { - - - -module.exports = /[\0-\x1F\x7F-\x9F]/; - -/***/ }), - -/***/ "../../../node_modules/uc.micro/categories/Cf/regex.js": -/*!*************************************************************!*\ - !*** ../../../node_modules/uc.micro/categories/Cf/regex.js ***! - \*************************************************************/ -/***/ (function(module) { - - - -module.exports = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/; - -/***/ }), - -/***/ "../../../node_modules/uc.micro/categories/P/regex.js": -/*!************************************************************!*\ - !*** ../../../node_modules/uc.micro/categories/P/regex.js ***! - \************************************************************/ -/***/ (function(module) { - - - -module.exports = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/; - -/***/ }), - -/***/ "../../../node_modules/uc.micro/categories/Z/regex.js": -/*!************************************************************!*\ - !*** ../../../node_modules/uc.micro/categories/Z/regex.js ***! - \************************************************************/ -/***/ (function(module) { - - - -module.exports = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; - -/***/ }), - -/***/ "../../../node_modules/uc.micro/index.js": -/*!***********************************************!*\ - !*** ../../../node_modules/uc.micro/index.js ***! - \***********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -exports.Any = __webpack_require__(/*! ./properties/Any/regex */ "../../../node_modules/uc.micro/properties/Any/regex.js"); -exports.Cc = __webpack_require__(/*! ./categories/Cc/regex */ "../../../node_modules/uc.micro/categories/Cc/regex.js"); -exports.Cf = __webpack_require__(/*! ./categories/Cf/regex */ "../../../node_modules/uc.micro/categories/Cf/regex.js"); -exports.P = __webpack_require__(/*! ./categories/P/regex */ "../../../node_modules/uc.micro/categories/P/regex.js"); -exports.Z = __webpack_require__(/*! ./categories/Z/regex */ "../../../node_modules/uc.micro/categories/Z/regex.js"); - -/***/ }), - -/***/ "../../../node_modules/uc.micro/properties/Any/regex.js": -/*!**************************************************************!*\ - !*** ../../../node_modules/uc.micro/properties/Any/regex.js ***! - \**************************************************************/ -/***/ (function(module) { - - - -module.exports = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; - -/***/ }), - /***/ "../../../node_modules/use-callback-ref/dist/es2015/assignRef.js": /*!***********************************************************************!*\ !*** ../../../node_modules/use-callback-ref/dist/es2015/assignRef.js ***! @@ -62028,141 +55959,119 @@ exports.comment = Q; -var l = Object.defineProperty; -var n = (e, o) => l(e, "name", { - value: o, +var E = Object.defineProperty; +var g = (v, m) => E(v, "name", { + value: m, configurable: !0 }); -const s = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), - g = __webpack_require__(/*! ./dialog.cjs2.js */ "../../graphiql-react/dist/dialog.cjs2.js"); -function u(e, o) { - for (var i = 0; i < o.length; i++) { - const r = o[i]; +const b = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); +function O(v, m) { + for (var n = 0; n < m.length; n++) { + const r = m[n]; if (typeof r != "string" && !Array.isArray(r)) { - for (const t in r) if (t !== "default" && !(t in e)) { - const a = Object.getOwnPropertyDescriptor(r, t); - a && Object.defineProperty(e, t, a.get ? a : { + for (const c in r) if (c !== "default" && !(c in v)) { + const u = Object.getOwnPropertyDescriptor(r, c); + u && Object.defineProperty(v, c, u.get ? u : { enumerable: !0, - get: () => r[t] + get: () => r[c] }); } } } - return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { + return Object.freeze(Object.defineProperty(v, Symbol.toStringTag, { value: "Module" })); } -n(u, "_mergeNamespaces"); -var c = g.requireDialog(); -const f = s.getDefaultExportFromCjs(c), - d = u({ - __proto__: null, - default: f - }, [c]); -exports.dialog = d; - -/***/ }), - -/***/ "../../graphiql-react/dist/dialog.cjs2.js": -/*!************************************************!*\ - !*** ../../graphiql-react/dist/dialog.cjs2.js ***! - \************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -var D = Object.defineProperty; -var r = (m, p) => D(m, "name", { - value: p, - configurable: !0 -}); -const E = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); -var h = { - exports: {} - }, - y; -function T() { - return y || (y = 1, function (m, p) { - (function (n) { - n(E.requireCodemirror()); - })(function (n) { - function d(f, o, e) { - var i = f.getWrapperElement(), - a; - return a = i.appendChild(document.createElement("div")), e ? a.className = "CodeMirror-dialog CodeMirror-dialog-bottom" : a.className = "CodeMirror-dialog CodeMirror-dialog-top", typeof o == "string" ? a.innerHTML = o : a.appendChild(o), n.addClass(i, "dialog-opened"), a; - } - r(d, "dialogDiv"); - function g(f, o) { - f.state.currentNotificationClose && f.state.currentNotificationClose(), f.state.currentNotificationClose = o; - } - r(g, "closeNotification"), n.defineExtension("openDialog", function (f, o, e) { - e || (e = {}), g(this, null); - var i = d(this, f, e.bottom), - a = !1, - c = this; - function l(t) { - if (typeof t == "string") u.value = t;else { - if (a) return; - a = !0, n.rmClass(i.parentNode, "dialog-opened"), i.parentNode.removeChild(i), c.focus(), e.onClose && e.onClose(i); - } +g(O, "_mergeNamespaces"); +var T = { + exports: {} +}; +(function (v, m) { + (function (n) { + n(b.requireCodemirror()); + })(function (n) { + function r(u, f, e) { + var a = u.getWrapperElement(), + l; + return l = a.appendChild(document.createElement("div")), e ? l.className = "CodeMirror-dialog CodeMirror-dialog-bottom" : l.className = "CodeMirror-dialog CodeMirror-dialog-top", typeof f == "string" ? l.innerHTML = f : l.appendChild(f), n.addClass(a, "dialog-opened"), l; + } + g(r, "dialogDiv"); + function c(u, f) { + u.state.currentNotificationClose && u.state.currentNotificationClose(), u.state.currentNotificationClose = f; + } + g(c, "closeNotification"), n.defineExtension("openDialog", function (u, f, e) { + e || (e = {}), c(this, null); + var a = r(this, u, e.bottom), + l = !1, + s = this; + function i(t) { + if (typeof t == "string") o.value = t;else { + if (l) return; + l = !0, n.rmClass(a.parentNode, "dialog-opened"), a.parentNode.removeChild(a), s.focus(), e.onClose && e.onClose(a); } - r(l, "close"); - var u = i.getElementsByTagName("input")[0], - s; - return u ? (u.focus(), e.value && (u.value = e.value, e.selectValueOnOpen !== !1 && u.select()), e.onInput && n.on(u, "input", function (t) { - e.onInput(t, u.value, l); - }), e.onKeyUp && n.on(u, "keyup", function (t) { - e.onKeyUp(t, u.value, l); - }), n.on(u, "keydown", function (t) { - e && e.onKeyDown && e.onKeyDown(t, u.value, l) || ((t.keyCode == 27 || e.closeOnEnter !== !1 && t.keyCode == 13) && (u.blur(), n.e_stop(t), l()), t.keyCode == 13 && o(u.value, t)); - }), e.closeOnBlur !== !1 && n.on(i, "focusout", function (t) { - t.relatedTarget !== null && l(); - })) : (s = i.getElementsByTagName("button")[0]) && (n.on(s, "click", function () { - l(), c.focus(); - }), e.closeOnBlur !== !1 && n.on(s, "blur", l), s.focus()), l; - }), n.defineExtension("openConfirm", function (f, o, e) { - g(this, null); - var i = d(this, f, e && e.bottom), - a = i.getElementsByTagName("button"), - c = !1, - l = this, - u = 1; - function s() { - c || (c = !0, n.rmClass(i.parentNode, "dialog-opened"), i.parentNode.removeChild(i), l.focus()); - } - r(s, "close"), a[0].focus(); - for (var t = 0; t < a.length; ++t) { - var v = a[t]; - (function (N) { - n.on(v, "click", function (b) { - n.e_preventDefault(b), s(), N && N(l); - }); - })(o[t]), n.on(v, "blur", function () { - --u, setTimeout(function () { - u <= 0 && s(); - }, 200); - }), n.on(v, "focus", function () { - ++u; + } + g(i, "close"); + var o = a.getElementsByTagName("input")[0], + d; + return o ? (o.focus(), e.value && (o.value = e.value, e.selectValueOnOpen !== !1 && o.select()), e.onInput && n.on(o, "input", function (t) { + e.onInput(t, o.value, i); + }), e.onKeyUp && n.on(o, "keyup", function (t) { + e.onKeyUp(t, o.value, i); + }), n.on(o, "keydown", function (t) { + e && e.onKeyDown && e.onKeyDown(t, o.value, i) || ((t.keyCode == 27 || e.closeOnEnter !== !1 && t.keyCode == 13) && (o.blur(), n.e_stop(t), i()), t.keyCode == 13 && f(o.value, t)); + }), e.closeOnBlur !== !1 && n.on(a, "focusout", function (t) { + t.relatedTarget !== null && i(); + })) : (d = a.getElementsByTagName("button")[0]) && (n.on(d, "click", function () { + i(), s.focus(); + }), e.closeOnBlur !== !1 && n.on(d, "blur", i), d.focus()), i; + }), n.defineExtension("openConfirm", function (u, f, e) { + c(this, null); + var a = r(this, u, e && e.bottom), + l = a.getElementsByTagName("button"), + s = !1, + i = this, + o = 1; + function d() { + s || (s = !0, n.rmClass(a.parentNode, "dialog-opened"), a.parentNode.removeChild(a), i.focus()); + } + g(d, "close"), l[0].focus(); + for (var t = 0; t < l.length; ++t) { + var p = l[t]; + (function (N) { + n.on(p, "click", function (h) { + n.e_preventDefault(h), d(), N && N(i); }); - } - }), n.defineExtension("openNotification", function (f, o) { - g(this, l); - var e = d(this, f, o && o.bottom), - i = !1, - a, - c = o && typeof o.duration < "u" ? o.duration : 5e3; - function l() { - i || (i = !0, clearTimeout(a), n.rmClass(e.parentNode, "dialog-opened"), e.parentNode.removeChild(e)); - } - return r(l, "close"), n.on(e, "click", function (u) { - n.e_preventDefault(u), l(); - }), c && (a = setTimeout(l, c)), l; - }); + })(f[t]), n.on(p, "blur", function () { + --o, setTimeout(function () { + o <= 0 && d(); + }, 200); + }), n.on(p, "focus", function () { + ++o; + }); + } + }), n.defineExtension("openNotification", function (u, f) { + c(this, i); + var e = r(this, u, f && f.bottom), + a = !1, + l, + s = f && typeof f.duration < "u" ? f.duration : 5e3; + function i() { + a || (a = !0, clearTimeout(l), n.rmClass(e.parentNode, "dialog-opened"), e.parentNode.removeChild(e)); + } + return g(i, "close"), n.on(e, "click", function (o) { + n.e_preventDefault(o), i(); + }), s && (l = setTimeout(i, s)), i; }); - }()), h.exports; -} -r(T, "requireDialog"); -exports.requireDialog = T; + }); +})(); +var y = T.exports; +const x = b.getDefaultExportFromCjs(y), + k = O({ + __proto__: null, + default: x + }, [y]); +exports.dialog = k; +exports.dialogExports = y; /***/ }), @@ -62704,7 +56613,7 @@ const r = __webpack_require__(/*! react/jsx-runtime */ "../../../node_modules/re Pn = __webpack_require__(/*! @radix-ui/react-dialog */ "../../../node_modules/@radix-ui/react-dialog/dist/index.js"), qn = __webpack_require__(/*! @radix-ui/react-visually-hidden */ "../../../node_modules/@radix-ui/react-visually-hidden/dist/index.js"), xe = __webpack_require__(/*! @radix-ui/react-dropdown-menu */ "../../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js"), - Vn = __webpack_require__(/*! markdown-it */ "../../../node_modules/markdown-it/index.js"), + Vn = __webpack_require__(/*! markdown-it */ "../node_modules/markdown-it/dist/index.cjs.js"), Nt = __webpack_require__(/*! framer-motion */ "../../../node_modules/framer-motion/dist/cjs/index.js"), In = __webpack_require__(/*! @radix-ui/react-tooltip */ "../../../node_modules/@radix-ui/react-tooltip/dist/index.js"), ae = __webpack_require__(/*! @headlessui/react */ "../../../node_modules/@headlessui/react/dist/index.cjs"), @@ -62727,7 +56636,7 @@ function nt(e) { return t.default = e, Object.freeze(t); } a(nt, "_interopNamespaceDefault"); -const c = nt(l), +const u = nt(l), re = nt(Pn), pe = nt(In); function le(e) { @@ -62766,20 +56675,20 @@ const se = ie(rt), titleId: t, ...n } = _ref; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M5.0484 1.40838C6.12624 0.33054 7.87376 0.330541 8.9516 1.40838L12.5916 5.0484C13.6695 6.12624 13.6695 7.87376 12.5916 8.9516L8.9516 12.5916C7.87376 13.6695 6.12624 13.6695 5.0484 12.5916L1.40838 8.9516C0.33054 7.87376 0.330541 6.12624 1.40838 5.0484L5.0484 1.40838Z", stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("rect", { + }), u.createElement("rect", { x: 6, y: 6, width: 2, @@ -62794,16 +56703,16 @@ const se = ie(rt), titleId: t, ...n } = _ref2; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 14 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M1 1L7 7L13 1", stroke: "currentColor", strokeWidth: 1.5 @@ -62815,16 +56724,16 @@ const se = ie(rt), titleId: t, ...n } = _ref3; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M6 1.04819L2 5.04819L6 9.04819", stroke: "currentColor", strokeWidth: 1.75 @@ -62836,16 +56745,16 @@ const se = ie(rt), titleId: t, ...n } = _ref4; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 14 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M13 8L7 2L1 8", stroke: "currentColor", strokeWidth: 1.5 @@ -62857,20 +56766,20 @@ const se = ie(rt), titleId: t, ...n } = _ref5; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M1 1L12.9998 12.9997", stroke: "currentColor", strokeWidth: 1.5 - }), c.createElement("path", { + }), u.createElement("path", { d: "M13 1L1.00079 13.0003", stroke: "currentColor", strokeWidth: 1.5 @@ -62882,20 +56791,20 @@ const se = ie(rt), titleId: t, ...n } = _ref6; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "-2 -2 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M11.25 14.2105V15.235C11.25 16.3479 10.3479 17.25 9.23501 17.25H2.76499C1.65214 17.25 0.75 16.3479 0.75 15.235L0.75 8.76499C0.75 7.65214 1.65214 6.75 2.76499 6.75L3.78947 6.75", stroke: "currentColor", strokeWidth: 1.5 - }), c.createElement("rect", { + }), u.createElement("rect", { x: 6.75, y: .75, width: 10.5, @@ -62911,24 +56820,24 @@ const se = ie(rt), titleId: t, ...n } = _ref7; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M5.0484 1.40838C6.12624 0.33054 7.87376 0.330541 8.9516 1.40838L12.5916 5.0484C13.6695 6.12624 13.6695 7.87376 12.5916 8.9516L8.9516 12.5916C7.87376 13.6695 6.12624 13.6695 5.0484 12.5916L1.40838 8.9516C0.33054 7.87376 0.330541 6.12624 1.40838 5.0484L5.0484 1.40838Z", stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("path", { + }), u.createElement("path", { d: "M5 9L9 5", stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("path", { + }), u.createElement("path", { d: "M5 5L9 9", stroke: "currentColor", strokeWidth: 1.2 @@ -62940,24 +56849,24 @@ const se = ie(rt), titleId: t, ...n } = _ref8; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M4 8L8 4", stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("path", { + }), u.createElement("path", { d: "M4 4L8 8", stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("path", { + }), u.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.5 1.2H9C9.99411 1.2 10.8 2.00589 10.8 3V9C10.8 9.99411 9.99411 10.8 9 10.8H8.5V12H9C10.6569 12 12 10.6569 12 9V3C12 1.34315 10.6569 0 9 0H8.5V1.2ZM3.5 1.2V0H3C1.34315 0 0 1.34315 0 3V9C0 10.6569 1.34315 12 3 12H3.5V10.8H3C2.00589 10.8 1.2 9.99411 1.2 9V3C1.2 2.00589 2.00589 1.2 3 1.2H3.5Z", @@ -62970,16 +56879,16 @@ const se = ie(rt), titleId: t, ...n } = _ref9; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("rect", { + }, e) : null, u.createElement("rect", { x: .6, y: .6, width: 10.8, @@ -62987,11 +56896,11 @@ const se = ie(rt), rx: 3.4, stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("path", { + }), u.createElement("path", { d: "M4 8L8 4", stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("path", { + }), u.createElement("path", { d: "M4 4L8 8", stroke: "currentColor", strokeWidth: 1.2 @@ -63003,15 +56912,15 @@ const se = ie(rt), titleId: t, ...n } = _ref10; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0.5 12 12", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("rect", { + }, e) : null, u.createElement("rect", { x: 7, y: 5.5, width: 2, @@ -63019,7 +56928,7 @@ const se = ie(rt), rx: 1, transform: "rotate(90 7 5.5)", fill: "currentColor" - }), c.createElement("path", { + }), u.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.8 9L10.8 9.5C10.8 10.4941 9.99411 11.3 9 11.3L3 11.3C2.00589 11.3 1.2 10.4941 1.2 9.5L1.2 9L-3.71547e-07 9L-3.93402e-07 9.5C-4.65826e-07 11.1569 1.34314 12.5 3 12.5L9 12.5C10.6569 12.5 12 11.1569 12 9.5L12 9L10.8 9ZM10.8 4L12 4L12 3.5C12 1.84315 10.6569 0.5 9 0.5L3 0.5C1.34315 0.5 -5.87117e-08 1.84315 -1.31135e-07 3.5L-1.5299e-07 4L1.2 4L1.2 3.5C1.2 2.50589 2.00589 1.7 3 1.7L9 1.7C9.99411 1.7 10.8 2.50589 10.8 3.5L10.8 4Z", @@ -63032,24 +56941,24 @@ const se = ie(rt), titleId: t, ...n } = _ref11; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 20 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M0.75 3C0.75 1.75736 1.75736 0.75 3 0.75H17.25C17.8023 0.75 18.25 1.19772 18.25 1.75V5.25", stroke: "currentColor", strokeWidth: 1.5 - }), c.createElement("path", { + }), u.createElement("path", { d: "M0.75 3C0.75 4.24264 1.75736 5.25 3 5.25H18.25C18.8023 5.25 19.25 5.69771 19.25 6.25V22.25C19.25 22.8023 18.8023 23.25 18.25 23.25H3C1.75736 23.25 0.75 22.2426 0.75 21V3Z", stroke: "currentColor", strokeWidth: 1.5 - }), c.createElement("path", { + }), u.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3 5.25C1.75736 5.25 0.75 4.24264 0.75 3V21C0.75 22.2426 1.75736 23.25 3 23.25H18.25C18.8023 23.25 19.25 22.8023 19.25 22.25V6.25C19.25 5.69771 18.8023 5.25 18.25 5.25H3ZM13 11L6 11V12.5L13 12.5V11Z", @@ -63062,20 +56971,20 @@ const se = ie(rt), titleId: t, ...n } = _ref12; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 20 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M0.75 3C0.75 4.24264 1.75736 5.25 3 5.25H17.25M0.75 3C0.75 1.75736 1.75736 0.75 3 0.75H16.25C16.8023 0.75 17.25 1.19772 17.25 1.75V5.25M0.75 3V21C0.75 22.2426 1.75736 23.25 3 23.25H18.25C18.8023 23.25 19.25 22.8023 19.25 22.25V6.25C19.25 5.69771 18.8023 5.25 18.25 5.25H17.25", stroke: "currentColor", strokeWidth: 1.5 - }), c.createElement("line", { + }), u.createElement("line", { x1: 13, y1: 11.75, x2: 6, @@ -63090,23 +56999,23 @@ const se = ie(rt), titleId: t, ...n } = _ref13; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("rect", { + }, e) : null, u.createElement("rect", { x: 5, y: 5, width: 2, height: 2, rx: 1, fill: "currentColor" - }), c.createElement("path", { + }), u.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.5 1.2H9C9.99411 1.2 10.8 2.00589 10.8 3V9C10.8 9.99411 9.99411 10.8 9 10.8H8.5V12H9C10.6569 12 12 10.6569 12 9V3C12 1.34315 10.6569 0 9 0H8.5V1.2ZM3.5 1.2V0H3C1.34315 0 0 1.34315 0 3V9C0 10.6569 1.34315 12 3 12H3.5V10.8H3C2.00589 10.8 1.2 9.99411 1.2 9V3C1.2 2.00589 2.00589 1.2 3 1.2H3.5Z", @@ -63119,16 +57028,16 @@ const se = ie(rt), titleId: t, ...n } = _ref14; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 12 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("rect", { + }, e) : null, u.createElement("rect", { x: .6, y: 1.1, width: 10.8, @@ -63136,7 +57045,7 @@ const se = ie(rt), rx: 2.4, stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("rect", { + }), u.createElement("rect", { x: 5, y: 5.5, width: 2, @@ -63151,26 +57060,26 @@ const se = ie(rt), titleId: t, ...n } = _ref15; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 24 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M1.59375 9.52344L4.87259 12.9944L8.07872 9.41249", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "square" - }), c.createElement("path", { + }), u.createElement("path", { d: "M13.75 5.25V10.75H18.75", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "square" - }), c.createElement("path", { + }), u.createElement("path", { d: "M4.95427 11.9332C4.55457 10.0629 4.74441 8.11477 5.49765 6.35686C6.25089 4.59894 7.5305 3.11772 9.16034 2.11709C10.7902 1.11647 12.6901 0.645626 14.5986 0.769388C16.5071 0.893151 18.3303 1.60543 19.8172 2.80818C21.3042 4.01093 22.3818 5.64501 22.9017 7.48548C23.4216 9.32595 23.3582 11.2823 22.7203 13.0853C22.0824 14.8883 20.9013 16.4492 19.3396 17.5532C17.778 18.6572 15.9125 19.25 14 19.25", stroke: "currentColor", strokeWidth: 1.5 @@ -63182,16 +57091,16 @@ const se = ie(rt), titleId: t, ...n } = _ref16; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("circle", { + }, e) : null, u.createElement("circle", { cx: 6, cy: 6, r: 5.4, @@ -63200,7 +57109,7 @@ const se = ie(rt), strokeDasharray: "4.241025 4.241025", transform: "rotate(22.5)", "transform-origin": "center" - }), c.createElement("circle", { + }), u.createElement("circle", { cx: 6, cy: 6, r: 1, @@ -63213,40 +57122,40 @@ const se = ie(rt), titleId: t, ...n } = _ref17; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 19 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M1.5 14.5653C1.5 15.211 1.75652 15.8303 2.21314 16.2869C2.66975 16.7435 3.28905 17 3.9348 17C4.58054 17 5.19984 16.7435 5.65646 16.2869C6.11307 15.8303 6.36959 15.211 6.36959 14.5653V12.1305H3.9348C3.28905 12.1305 2.66975 12.387 2.21314 12.8437C1.75652 13.3003 1.5 13.9195 1.5 14.5653Z", stroke: "currentColor", strokeWidth: 1.125, strokeLinecap: "round", strokeLinejoin: "round" - }), c.createElement("path", { + }), u.createElement("path", { d: "M3.9348 1.00063C3.28905 1.00063 2.66975 1.25715 2.21314 1.71375C1.75652 2.17035 1.5 2.78964 1.5 3.43537C1.5 4.0811 1.75652 4.70038 2.21314 5.15698C2.66975 5.61358 3.28905 5.8701 3.9348 5.8701H6.36959V3.43537C6.36959 2.78964 6.11307 2.17035 5.65646 1.71375C5.19984 1.25715 4.58054 1.00063 3.9348 1.00063Z", stroke: "currentColor", strokeWidth: 1.125, strokeLinecap: "round", strokeLinejoin: "round" - }), c.createElement("path", { + }), u.createElement("path", { d: "M15.0652 12.1305H12.6304V14.5653C12.6304 15.0468 12.7732 15.5175 13.0407 15.9179C13.3083 16.3183 13.6885 16.6304 14.1334 16.8147C14.5783 16.9989 15.0679 17.0472 15.5402 16.9532C16.0125 16.8593 16.4464 16.6274 16.7869 16.2869C17.1274 15.9464 17.3593 15.5126 17.4532 15.0403C17.5472 14.568 17.4989 14.0784 17.3147 13.6335C17.1304 13.1886 16.8183 12.8084 16.4179 12.5409C16.0175 12.2733 15.5468 12.1305 15.0652 12.1305Z", stroke: "currentColor", strokeWidth: 1.125, strokeLinecap: "round", strokeLinejoin: "round" - }), c.createElement("path", { + }), u.createElement("path", { d: "M12.6318 5.86775H6.36955V12.1285H12.6318V5.86775Z", stroke: "currentColor", strokeWidth: 1.125, strokeLinecap: "round", strokeLinejoin: "round" - }), c.createElement("path", { + }), u.createElement("path", { d: "M17.5 3.43473C17.5 2.789 17.2435 2.16972 16.7869 1.71312C16.3303 1.25652 15.711 1 15.0652 1C14.4195 1 13.8002 1.25652 13.3435 1.71312C12.8869 2.16972 12.6304 2.789 12.6304 3.43473V5.86946H15.0652C15.711 5.86946 16.3303 5.61295 16.7869 5.15635C17.2435 4.69975 17.5 4.08046 17.5 3.43473Z", stroke: "currentColor", strokeWidth: 1.125, @@ -63260,22 +57169,22 @@ const se = ie(rt), titleId: t, ...n } = _ref18; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 13 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("circle", { + }, e) : null, u.createElement("circle", { cx: 5, cy: 5, r: 4.35, stroke: "currentColor", strokeWidth: 1.3 - }), c.createElement("line", { + }), u.createElement("line", { x1: 8.45962, y1: 8.54038, x2: 11.7525, @@ -63290,28 +57199,28 @@ const se = ie(rt), titleId: t, ...n } = _ref19; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "-2 -2 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M17.2492 6V2.9569C17.2492 1.73806 16.2611 0.75 15.0423 0.75L2.9569 0.75C1.73806 0.75 0.75 1.73806 0.75 2.9569L0.75 6", stroke: "currentColor", strokeWidth: 1.5 - }), c.createElement("path", { + }), u.createElement("path", { d: "M0.749873 12V15.0431C0.749873 16.2619 1.73794 17.25 2.95677 17.25H15.0421C16.261 17.25 17.249 16.2619 17.249 15.0431V12", stroke: "currentColor", strokeWidth: 1.5 - }), c.createElement("path", { + }), u.createElement("path", { d: "M6 4.5L9 7.5L12 4.5", stroke: "currentColor", strokeWidth: 1.5 - }), c.createElement("path", { + }), u.createElement("path", { d: "M12 13.5L9 10.5L6 13.5", stroke: "currentColor", strokeWidth: 1.5 @@ -63323,25 +57232,25 @@ const se = ie(rt), titleId: t, ...n } = _ref20; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M0.75 13.25L0.0554307 12.967C-0.0593528 13.2488 0.00743073 13.5719 0.224488 13.7851C0.441545 13.9983 0.765869 14.0592 1.04549 13.9393L0.75 13.25ZM12.8214 1.83253L12.2911 2.36286L12.2911 2.36286L12.8214 1.83253ZM12.8214 3.90194L13.3517 4.43227L12.8214 3.90194ZM10.0981 1.17859L9.56773 0.648259L10.0981 1.17859ZM12.1675 1.17859L12.6978 0.648258L12.6978 0.648257L12.1675 1.17859ZM2.58049 8.75697L3.27506 9.03994L2.58049 8.75697ZM2.70066 8.57599L3.23099 9.10632L2.70066 8.57599ZM5.2479 11.4195L4.95355 10.7297L5.2479 11.4195ZM5.42036 11.303L4.89003 10.7727L5.42036 11.303ZM4.95355 10.7297C4.08882 11.0987 3.41842 11.362 2.73535 11.6308C2.05146 11.9 1.35588 12.1743 0.454511 12.5607L1.04549 13.9393C1.92476 13.5624 2.60256 13.2951 3.28469 13.0266C3.96762 12.7578 4.65585 12.4876 5.54225 12.1093L4.95355 10.7297ZM1.44457 13.533L3.27506 9.03994L1.88592 8.474L0.0554307 12.967L1.44457 13.533ZM3.23099 9.10632L10.6284 1.70892L9.56773 0.648259L2.17033 8.04566L3.23099 9.10632ZM11.6371 1.70892L12.2911 2.36286L13.3517 1.3022L12.6978 0.648258L11.6371 1.70892ZM12.2911 3.37161L4.89003 10.7727L5.95069 11.8333L13.3517 4.43227L12.2911 3.37161ZM12.2911 2.36286C12.5696 2.64142 12.5696 3.09305 12.2911 3.37161L13.3517 4.43227C14.2161 3.56792 14.2161 2.16654 13.3517 1.3022L12.2911 2.36286ZM10.6284 1.70892C10.9069 1.43036 11.3586 1.43036 11.6371 1.70892L12.6978 0.648257C11.8335 -0.216088 10.4321 -0.216084 9.56773 0.648259L10.6284 1.70892ZM3.27506 9.03994C3.26494 9.06479 3.24996 9.08735 3.23099 9.10632L2.17033 8.04566C2.04793 8.16806 1.95123 8.31369 1.88592 8.474L3.27506 9.03994ZM5.54225 12.1093C5.69431 12.0444 5.83339 11.9506 5.95069 11.8333L4.89003 10.7727C4.90863 10.7541 4.92988 10.7398 4.95355 10.7297L5.54225 12.1093Z", fill: "currentColor" - }), c.createElement("path", { + }), u.createElement("path", { d: "M11.5 4.5L9.5 2.5", stroke: "currentColor", strokeWidth: 1.4026, strokeLinecap: "round", strokeLinejoin: "round" - }), c.createElement("path", { + }), u.createElement("path", { d: "M5.5 10.5L3.5 8.5", stroke: "currentColor", strokeWidth: 1.4026, @@ -63355,16 +57264,16 @@ const se = ie(rt), titleId: t, ...n } = _ref21; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 16 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M1.32226e-07 1.6609C7.22332e-08 0.907329 0.801887 0.424528 1.46789 0.777117L15.3306 8.11621C16.0401 8.49182 16.0401 9.50818 15.3306 9.88379L1.46789 17.2229C0.801886 17.5755 1.36076e-06 17.0927 1.30077e-06 16.3391L1.32226e-07 1.6609Z", fill: "currentColor" })); @@ -63375,16 +57284,16 @@ const se = ie(rt), titleId: t, ...n } = _ref22; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 10 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.25 9.25V13.5H5.75V9.25L10 9.25V7.75L5.75 7.75V3.5H4.25V7.75L0 7.75V9.25L4.25 9.25Z", @@ -63397,7 +57306,7 @@ const se = ie(rt), titleId: t, ...n } = _ref23; - return c.createElement("svg", { + return u.createElement("svg", { width: 25, height: 25, viewBox: "0 0 25 25", @@ -63405,26 +57314,26 @@ const se = ie(rt), xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M10.2852 24.0745L13.7139 18.0742", stroke: "currentColor", strokeWidth: 1.5625 - }), c.createElement("path", { + }), u.createElement("path", { d: "M14.5742 24.0749L17.1457 19.7891", stroke: "currentColor", strokeWidth: 1.5625 - }), c.createElement("path", { + }), u.createElement("path", { d: "M19.4868 24.0735L20.7229 21.7523C21.3259 20.6143 21.5457 19.3122 21.3496 18.0394C21.1535 16.7666 20.5519 15.591 19.6342 14.6874L23.7984 6.87853C24.0123 6.47728 24.0581 6.00748 23.9256 5.57249C23.7932 5.1375 23.4933 4.77294 23.0921 4.55901C22.6908 4.34509 22.221 4.29932 21.7861 4.43178C21.3511 4.56424 20.9865 4.86408 20.7726 5.26533L16.6084 13.0742C15.3474 12.8142 14.0362 12.9683 12.8699 13.5135C11.7035 14.0586 10.7443 14.9658 10.135 16.1L6 24.0735", stroke: "currentColor", strokeWidth: 1.5625 - }), c.createElement("path", { + }), u.createElement("path", { d: "M4 15L5 13L7 12L5 11L4 9L3 11L1 12L3 13L4 15Z", stroke: "currentColor", strokeWidth: 1.5625, strokeLinejoin: "round" - }), c.createElement("path", { + }), u.createElement("path", { d: "M11.5 8L12.6662 5.6662L15 4.5L12.6662 3.3338L11.5 1L10.3338 3.3338L8 4.5L10.3338 5.6662L11.5 8Z", stroke: "currentColor", strokeWidth: 1.5625, @@ -63437,30 +57346,30 @@ const se = ie(rt), titleId: t, ...n } = _ref24; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M4.75 9.25H1.25V12.75", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "square" - }), c.createElement("path", { + }), u.createElement("path", { d: "M11.25 6.75H14.75V3.25", stroke: "currentColor", strokeWidth: 1, strokeLinecap: "square" - }), c.createElement("path", { + }), u.createElement("path", { d: "M14.1036 6.65539C13.8 5.27698 13.0387 4.04193 11.9437 3.15131C10.8487 2.26069 9.48447 1.76694 8.0731 1.75043C6.66173 1.73392 5.28633 2.19563 4.17079 3.0604C3.05526 3.92516 2.26529 5.14206 1.92947 6.513", stroke: "currentColor", strokeWidth: 1 - }), c.createElement("path", { + }), u.createElement("path", { d: "M1.89635 9.34461C2.20001 10.723 2.96131 11.9581 4.05631 12.8487C5.15131 13.7393 6.51553 14.2331 7.9269 14.2496C9.33827 14.2661 10.7137 13.8044 11.8292 12.9396C12.9447 12.0748 13.7347 10.8579 14.0705 9.487", stroke: "currentColor", strokeWidth: 1 @@ -63472,16 +57381,16 @@ const se = ie(rt), titleId: t, ...n } = _ref25; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 13 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("rect", { + }, e) : null, u.createElement("rect", { x: .6, y: .6, width: 11.8, @@ -63489,7 +57398,7 @@ const se = ie(rt), rx: 5.9, stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("path", { + }), u.createElement("path", { d: "M4.25 7.5C4.25 6 5.75 5 6.5 6.5C7.25 8 8.75 7 8.75 5.5", stroke: "currentColor", strokeWidth: 1.2 @@ -63501,16 +57410,16 @@ const se = ie(rt), titleId: t, ...n } = _ref26; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.29186 1.92702C9.06924 1.82745 8.87014 1.68202 8.70757 1.50024L7.86631 0.574931C7.62496 0.309957 7.30773 0.12592 6.95791 0.0479385C6.60809 -0.0300431 6.24274 0.00182978 5.91171 0.139208C5.58068 0.276585 5.3001 0.512774 5.10828 0.815537C4.91645 1.1183 4.82272 1.47288 4.83989 1.83089L4.90388 3.08019C4.91612 3.32348 4.87721 3.56662 4.78968 3.79394C4.70215 4.02126 4.56794 4.2277 4.39571 4.39994C4.22347 4.57219 4.01704 4.7064 3.78974 4.79394C3.56243 4.88147 3.3193 4.92038 3.07603 4.90814L1.8308 4.84414C1.47162 4.82563 1.11553 4.91881 0.811445 5.11086C0.507359 5.30292 0.270203 5.58443 0.132561 5.91671C-0.00508149 6.249 -0.0364554 6.61576 0.0427496 6.9666C0.121955 7.31744 0.307852 7.63514 0.5749 7.87606L1.50016 8.71204C1.68193 8.87461 1.82735 9.07373 1.92692 9.29636C2.02648 9.51898 2.07794 9.76012 2.07794 10.004C2.07794 10.2479 2.02648 10.489 1.92692 10.7116C1.82735 10.9343 1.68193 11.1334 1.50016 11.296L0.5749 12.1319C0.309856 12.3729 0.125575 12.6898 0.0471809 13.0393C-0.0312128 13.3888 9.64098e-05 13.754 0.13684 14.0851C0.273583 14.4162 0.509106 14.6971 0.811296 14.8894C1.11349 15.0817 1.46764 15.1762 1.82546 15.1599L3.0707 15.0959C3.31397 15.0836 3.5571 15.1225 3.7844 15.2101C4.01171 15.2976 4.21814 15.4318 4.39037 15.6041C4.56261 15.7763 4.69682 15.9827 4.78435 16.2101C4.87188 16.4374 4.91078 16.6805 4.89855 16.9238L4.83455 18.1691C4.81605 18.5283 4.90921 18.8844 5.10126 19.1885C5.2933 19.4926 5.5748 19.7298 5.90707 19.8674C6.23934 20.0051 6.60608 20.0365 6.9569 19.9572C7.30772 19.878 7.6254 19.6921 7.86631 19.4251L8.7129 18.4998C8.87547 18.318 9.07458 18.1725 9.29719 18.073C9.51981 17.9734 9.76093 17.9219 10.0048 17.9219C10.2487 17.9219 10.4898 17.9734 10.7124 18.073C10.935 18.1725 11.1341 18.318 11.2967 18.4998L12.1326 19.4251C12.3735 19.6921 12.6912 19.878 13.042 19.9572C13.3929 20.0365 13.7596 20.0051 14.0919 19.8674C14.4241 19.7298 14.7056 19.4926 14.8977 19.1885C15.0897 18.8844 15.1829 18.5283 15.1644 18.1691L15.1004 16.9238C15.0882 16.6805 15.1271 16.4374 15.2146 16.2101C15.3021 15.9827 15.4363 15.7763 15.6086 15.6041C15.7808 15.4318 15.9872 15.2976 16.2145 15.2101C16.4418 15.1225 16.685 15.0836 16.9282 15.0959L18.1735 15.1599C18.5326 15.1784 18.8887 15.0852 19.1928 14.8931C19.4969 14.7011 19.7341 14.4196 19.8717 14.0873C20.0093 13.755 20.0407 13.3882 19.9615 13.0374C19.8823 12.6866 19.6964 12.3689 19.4294 12.1279L18.5041 11.292C18.3223 11.1294 18.1769 10.9303 18.0774 10.7076C17.9778 10.485 17.9263 10.2439 17.9263 10C17.9263 9.75612 17.9778 9.51499 18.0774 9.29236C18.1769 9.06973 18.3223 8.87062 18.5041 8.70804L19.4294 7.87206C19.6964 7.63114 19.8823 7.31344 19.9615 6.9626C20.0407 6.61176 20.0093 6.245 19.8717 5.91271C19.7341 5.58043 19.4969 5.29892 19.1928 5.10686C18.8887 4.91481 18.5326 4.82163 18.1735 4.84014L16.9282 4.90414C16.685 4.91638 16.4418 4.87747 16.2145 4.78994C15.9872 4.7024 15.7808 4.56818 15.6086 4.39594C15.4363 4.2237 15.3021 4.01726 15.2146 3.78994C15.1271 3.56262 15.0882 3.31948 15.1004 3.07619L15.1644 1.83089C15.1829 1.4717 15.0897 1.11559 14.8977 0.811487C14.7056 0.507385 14.4241 0.270217 14.0919 0.132568C13.7596 -0.00508182 13.3929 -0.0364573 13.042 0.0427519C12.6912 0.121961 12.3735 0.307869 12.1326 0.574931L11.2914 1.50024C11.1288 1.68202 10.9297 1.82745 10.7071 1.92702C10.4845 2.02659 10.2433 2.07805 9.99947 2.07805C9.7556 2.07805 9.51448 2.02659 9.29186 1.92702ZM14.3745 10C14.3745 12.4162 12.4159 14.375 9.99977 14.375C7.58365 14.375 5.625 12.4162 5.625 10C5.625 7.58375 7.58365 5.625 9.99977 5.625C12.4159 5.625 14.3745 7.58375 14.3745 10Z", @@ -63523,16 +57432,16 @@ const se = ie(rt), titleId: t, ...n } = _ref27; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z", fill: "currentColor", stroke: "currentColor" @@ -63544,16 +57453,16 @@ const se = ie(rt), titleId: t, ...n } = _ref28; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M6.5782 1.07092C6.71096 0.643026 7.28904 0.643027 7.4218 1.07092L8.59318 4.84622C8.65255 5.03758 8.82284 5.16714 9.01498 5.16714L12.8056 5.16714C13.2353 5.16714 13.4139 5.74287 13.0663 6.00732L9.99962 8.34058C9.84418 8.45885 9.77913 8.66848 9.83851 8.85984L11.0099 12.6351C11.1426 13.063 10.675 13.4189 10.3274 13.1544L7.26069 10.8211C7.10524 10.7029 6.89476 10.7029 6.73931 10.8211L3.6726 13.1544C3.32502 13.4189 2.85735 13.063 2.99012 12.6351L4.16149 8.85984C4.22087 8.66848 4.15582 8.45885 4.00038 8.34058L0.933671 6.00732C0.586087 5.74287 0.764722 5.16714 1.19436 5.16714L4.98502 5.16714C5.17716 5.16714 5.34745 5.03758 5.40682 4.84622L6.5782 1.07092Z", stroke: "currentColor", strokeWidth: 1.5 @@ -63565,16 +57474,16 @@ const se = ie(rt), titleId: t, ...n } = _ref29; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("rect", { + }, e) : null, u.createElement("rect", { width: 16, height: 16, rx: 2, @@ -63587,7 +57496,7 @@ const se = ie(rt), titleId: t, ...n } = _ref30; - return c.createElement("svg", { + return u.createElement("svg", { width: "1em", height: "5em", xmlns: "http://www.w3.org/2000/svg", @@ -63600,11 +57509,11 @@ const se = ie(rt), clipRule: "evenodd", "aria-labelledby": t, ...n - }, e === void 0 ? c.createElement("title", { + }, e === void 0 ? u.createElement("title", { id: t - }, "trash icon") : e ? c.createElement("title", { + }, "trash icon") : e ? u.createElement("title", { id: t - }, e) : null, c.createElement("path", { + }, e) : null, u.createElement("path", { d: "M19 24h-14c-1.104 0-2-.896-2-2v-17h-1v-2h6v-1.5c0-.827.673-1.5 1.5-1.5h5c.825 0 1.5.671 1.5 1.5v1.5h6v2h-1v17c0 1.104-.896 2-2 2zm0-19h-14v16.5c0 .276.224.5.5.5h13c.276 0 .5-.224.5-.5v-16.5zm-7 7.586l3.293-3.293 1.414 1.414-3.293 3.293 3.293 3.293-1.414 1.414-3.293-3.293-3.293 3.293-1.414-1.414 3.293-3.293-3.293-3.293 1.414-1.414 3.293 3.293zm2-10.586h-4v1h4v-1z", fill: "currentColor", strokeWidth: .25, @@ -63617,16 +57526,16 @@ const se = ie(rt), titleId: t, ...n } = _ref31; - return c.createElement("svg", { + return u.createElement("svg", { height: "1em", viewBox: "0 0 13 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n - }, e ? c.createElement("title", { + }, e ? u.createElement("title", { id: t - }, e) : null, c.createElement("rect", { + }, e) : null, u.createElement("rect", { x: .6, y: .6, width: 11.8, @@ -63634,7 +57543,7 @@ const se = ie(rt), rx: 5.9, stroke: "currentColor", strokeWidth: 1.2 - }), c.createElement("rect", { + }), u.createElement("rect", { x: 5.5, y: 5.5, width: 2, @@ -63842,7 +57751,7 @@ a(en, "TooltipRoot"); const J = ye(en, { Provider: pe.Provider }); -const tn = l.forwardRef((_ref38, u) => { +const tn = l.forwardRef((_ref38, c) => { let { isActive: e, value: t, @@ -63852,7 +57761,7 @@ const tn = l.forwardRef((_ref38, u) => { } = _ref38; return r.jsx(Nt.Reorder.Item, { ...o, - ref: u, + ref: c, value: t, "aria-selected": e ? "true" : void 0, role: "tab", @@ -63885,7 +57794,7 @@ const Lr = ye(tn, { Button: nn, Close: rn }), - sn = l.forwardRef((_ref39, u) => { + sn = l.forwardRef((_ref39, c) => { let { values: e, onReorder: t, @@ -63895,7 +57804,7 @@ const Lr = ye(tn, { } = _ref39; return r.jsx(Nt.Reorder.Group, { ...o, - ref: u, + ref: c, values: e, onReorder: t, axis: "x", @@ -63911,7 +57820,7 @@ function on(e) { const t = se(), n = l.useRef(new B.HistoryStore(t || new B.StorageAPI(null), e.maxHistoryLength || jr)), [s, o] = l.useState(((y = n.current) == null ? void 0 : y.queries) || []), - u = l.useCallback(h => { + c = l.useCallback(h => { var x; (x = n.current) == null || x.updateHistory(h), o(n.current.queries); }, []), @@ -63927,13 +57836,13 @@ function on(e) { n.current.deleteHistory(h, x), o(n.current.queries); }, []), p = l.useMemo(() => ({ - addToHistory: u, + addToHistory: c, editLabel: i, items: s, toggleFavorite: d, setActive: g, deleteFromHistory: m - }), [u, i, s, d, g, m]); + }), [c, i, s, d, g, m]); return r.jsx(ot.Provider, { value: p, children: e.children @@ -63955,18 +57864,18 @@ function ln() { })).reverse(); const s = n.filter(d => d.favorite); s.length && (n = n.filter(d => !d.favorite)); - const [o, u] = l.useState(null); + const [o, c] = l.useState(null); l.useEffect(() => { o && setTimeout(() => { - u(null); + c(null); }, 2e3); }, [o]); const i = l.useCallback(() => { try { for (const d of n) t(d, !0); - u("success"); + c("success"); } catch { - u("error"); + c("error"); } }, [t, n]); return r.jsxs("section", { @@ -64011,7 +57920,7 @@ function Pe(e) { caller: Pe }), { - headerEditor: u, + headerEditor: c, queryEditor: i, variableEditor: d } = Z({ @@ -64050,8 +57959,8 @@ function Pe(e) { variables: w, headers: T } = e.item; - i == null || i.setValue(b !== null && b !== void 0 ? b : ""), d == null || d.setValue(w !== null && w !== void 0 ? w : ""), u == null || u.setValue(T !== null && T !== void 0 ? T : ""), o(e.item); - }, [u, e.item, i, o, d]), + i == null || i.setValue(b !== null && b !== void 0 ? b : ""), d == null || d.setValue(w !== null && w !== void 0 ? w : ""), c == null || c.setValue(T !== null && T !== void 0 ? T : ""), o(e.item); + }, [c, e.item, i, o, d]), k = l.useCallback(b => { b.stopPropagation(), s(e.item); }, [e.item, s]), @@ -64149,7 +58058,7 @@ function qe(_ref40) { if (!e) throw new TypeError("The `ExecutionContextProvider` component requires a `fetcher` function to be passed as prop."); const { externalFragments: o, - headerEditor: u, + headerEditor: c, queryEditor: i, responseEditor: d, variableEditor: g, @@ -64196,7 +58105,7 @@ function qe(_ref40) { T(N instanceof Error ? N.message : `${N}`); return; } - const O = u == null ? void 0 : u.getValue(); + const O = c == null ? void 0 : c.getValue(); let D; try { D = bt({ @@ -64240,7 +58149,7 @@ function qe(_ref40) { const { path: vt, data: Le, - errors: hs, + errors: ms, ...Nn } = z; if (vt) { @@ -64292,7 +58201,7 @@ function qe(_ref40) { } catch (N) { x(!1), T(B.formatError(N)), C(null); } - }, [y, o, e, u, p, s, i, d, k, f, m, g]), + }, [y, o, e, c, p, s, i, d, k, f, m, g]), b = !!f, w = l.useMemo(() => ({ isFetching: h, @@ -64317,8 +58226,8 @@ function bt(_ref42) { let s; try { s = e && e.trim() !== "" ? JSON.parse(e) : void 0; - } catch (u) { - throw new Error(`${t}: ${u instanceof Error ? u.message : u}.`); + } catch (c) { + throw new Error(`${t}: ${c instanceof Error ? c.message : c}.`); } const o = typeof s == "object" && s !== null && !Array.isArray(s); if (s !== void 0 && !o) throw new Error(n); @@ -64369,7 +58278,7 @@ function ct(e) { caller: ct }), [s, o] = l.useState(), - [u, i] = l.useState(!1), + [c, i] = l.useState(!1), [d, g] = l.useState(null), m = l.useRef(0); l.useEffect(() => { @@ -64453,10 +58362,10 @@ function ct(e) { w = l.useMemo(() => ({ fetchError: d, introspect: L, - isFetching: u, + isFetching: c, schema: s, validationErrors: b - }), [d, L, u, s, b]); + }), [d, L, c, s, b]); return r.jsx(at.Provider, { value: w, children: k @@ -64477,11 +58386,11 @@ function Tr(_ref44) { schemaDescription: n }); t && (o = o.replace("query IntrospectionQuery", `query ${s}`)); - const u = o.replace("subscriptionType { name }", ""); + const c = o.replace("subscriptionType { name }", ""); return { introspectionQueryName: s, introspectionQuery: o, - introspectionQuerySansSubscriptions: u + introspectionQuerySansSubscriptions: c }; }, [e, t, n]); } @@ -64513,7 +58422,7 @@ function dt(e) { caller: dt }), [s, o] = l.useState([je]), - u = l.useCallback(m => { + c = l.useCallback(m => { o(p => p.at(-1).def === m.def ? p : [...p, m]); }, []), i = l.useCallback(() => { @@ -64559,10 +58468,10 @@ function dt(e) { }, [d, t, n]); const g = l.useMemo(() => ({ explorerNavStack: s, - push: u, + push: c, pop: i, reset: d - }), [s, u, i, d]); + }), [s, c, i, d]); return r.jsx(ut.Provider, { value: g, children: e.children @@ -64716,17 +58625,17 @@ function Pr(_ref47) { }, []); if (!("args" in e)) return null; const o = [], - u = []; - for (const i of e.args) i.deprecationReason ? u.push(i) : o.push(i); + c = []; + for (const i of e.args) i.deprecationReason ? c.push(i) : o.push(i); return r.jsxs(r.Fragment, { children: [o.length > 0 ? r.jsx(G, { title: "Arguments", children: o.map(i => r.jsx(Ce, { arg: i }, i.name)) - }) : null, u.length > 0 ? t || o.length === 0 ? r.jsx(G, { + }) : null, c.length > 0 ? t || o.length === 0 ? r.jsx(G, { title: "Deprecated Arguments", - children: u.map(i => r.jsx(Ce, { + children: c.map(i => r.jsx(Ce, { arg: i }, i.name)) }) : r.jsx(me, { @@ -64759,7 +58668,7 @@ function dn(e) { n = (d = (i = e.schema).getMutationType) == null ? void 0 : d.call(i), s = (m = (g = e.schema).getSubscriptionType) == null ? void 0 : m.call(g), o = e.schema.getTypeMap(), - u = [t == null ? void 0 : t.name, n == null ? void 0 : n.name, s == null ? void 0 : s.name]; + c = [t == null ? void 0 : t.name, n == null ? void 0 : n.name, s == null ? void 0 : s.name]; return r.jsxs(r.Fragment, { children: [r.jsx(K, { type: "description", @@ -64791,7 +58700,7 @@ function dn(e) { }), r.jsx(G, { title: "All Schema Types", children: o && r.jsx("div", { - children: Object.values(o).map(p => u.includes(p.name) || p.name.startsWith("__") ? null : r.jsx("div", { + children: Object.values(o).map(p => c.includes(p.name) || p.name.startsWith("__") ? null : r.jsx("div", { children: r.jsx(U, { type: p }) @@ -64823,7 +58732,7 @@ function mt() { }), n = l.useRef(null), s = Ke(), - [o, u] = l.useState(""), + [o, c] = l.useState(""), [i, d] = l.useState(s(o)), g = l.useMemo(() => ue(200, f => { d(s(f)); @@ -64867,7 +58776,7 @@ function mt() { autoComplete: "off", onFocus: h, onBlur: h, - onChange: f => u(f.target.value), + onChange: f => c(f.target.value), placeholder: "⌘ K", ref: n, value: o, @@ -64923,20 +58832,20 @@ function Ke(e) { }), s = t.at(-1); return l.useCallback(o => { - const u = { + const c = { within: [], types: [], fields: [] }; - if (!n) return u; + if (!n) return c; const i = s.def, d = n.getTypeMap(); let g = Object.keys(d); i && (g = g.filter(m => m !== i.name), g.unshift(i.name)); for (const m of g) { - if (u.within.length + u.types.length + u.fields.length >= 100) break; + if (c.within.length + c.types.length + c.fields.length >= 100) break; const p = d[m]; - if (i !== p && Qe(m, o) && u.types.push({ + if (i !== p && Qe(m, o) && c.types.push({ type: p }), !M.isObjectType(p) && !M.isInterfaceType(p) && !M.isInputObjectType(p)) continue; const y = p.getFields(); @@ -64946,7 +58855,7 @@ function Ke(e) { if (!Qe(h, o)) if ("args" in x) { if (f = x.args.filter(C => Qe(C.name, o)), f.length === 0) continue; } else continue; - u[i === p ? "within" : "fields"].push(...(f ? f.map(C => ({ + c[i === p ? "within" : "fields"].push(...(f ? f.map(C => ({ type: p, field: x, argument: C @@ -64956,7 +58865,7 @@ function Ke(e) { }])); } } - return u; + return c; }, [s.def, n]); } a(Ke, "useSearchResults"); @@ -65056,16 +58965,16 @@ function Ir(_ref51) { }, []); if (!M.isObjectType(e) && !M.isInterfaceType(e) && !M.isInputObjectType(e)) return null; const o = e.getFields(), - u = [], + c = [], i = []; - for (const d of Object.keys(o).map(g => o[g])) d.deprecationReason ? i.push(d) : u.push(d); + for (const d of Object.keys(o).map(g => o[g])) d.deprecationReason ? i.push(d) : c.push(d); return r.jsxs(r.Fragment, { - children: [u.length > 0 ? r.jsx(G, { + children: [c.length > 0 ? r.jsx(G, { title: "Fields", - children: u.map(d => r.jsx(Et, { + children: c.map(d => r.jsx(Et, { field: d }, d.name)) - }) : null, i.length > 0 ? t || u.length === 0 ? r.jsx(G, { + }) : null, i.length > 0 ? t || c.length === 0 ? r.jsx(G, { title: "Deprecated Fields", children: i.map(d => r.jsx(Et, { field: d @@ -65126,17 +59035,17 @@ function Hr(_ref53) { }, []); if (!M.isEnumType(e)) return null; const o = [], - u = []; - for (const i of e.getValues()) i.deprecationReason ? u.push(i) : o.push(i); + c = []; + for (const i of e.getValues()) i.deprecationReason ? c.push(i) : o.push(i); return r.jsxs(r.Fragment, { children: [o.length > 0 ? r.jsx(G, { title: "Enum Values", children: o.map(i => r.jsx(St, { value: i }, i.name)) - }) : null, u.length > 0 ? t || o.length === 0 ? r.jsx(G, { + }) : null, c.length > 0 ? t || o.length === 0 ? r.jsx(G, { title: "Deprecated Enum Values", - children: u.map(i => r.jsx(St, { + children: c.map(i => r.jsx(St, { value: i }, i.name)) }) : r.jsx(me, { @@ -65197,7 +59106,7 @@ function Ie() { }), { explorerNavStack: o, - pop: u + pop: c } = te({ nonNull: !0, caller: Ie @@ -65232,7 +59141,7 @@ function Ie() { href: "#", className: "graphiql-doc-explorer-back", onClick: m => { - m.preventDefault(), u(); + m.preventDefault(), c(); }, "aria-label": `Go back to ${g}`, children: [r.jsx(Rt, {}), g] @@ -65267,18 +59176,18 @@ function fn(e) { n = te(), s = be(), o = !!n, - u = !!s, + c = !!s, i = l.useMemo(() => { const x = [], f = {}; - o && (x.push(de), f[de.title] = !0), u && (x.push(Ye), f[Ye.title] = !0); + o && (x.push(de), f[de.title] = !0), c && (x.push(Ye), f[Ye.title] = !0); for (const C of e.plugins || []) { if (typeof C.title != "string" || !C.title) throw new Error("All GraphiQL plugins must have a unique title"); if (f[C.title]) throw new Error(`All GraphiQL plugins must have a unique title, found two plugins with the title '${C.title}'`); x.push(C), f[C.title] = !0; } return x; - }, [o, u, e.plugins]), + }, [o, c, e.plugins]), [d, g] = l.useState(() => { const x = t == null ? void 0 : t.get(Lt), f = i.find(C => C.title === x); @@ -65308,7 +59217,7 @@ function fn(e) { a(fn, "PluginContextProvider"); const Ze = ie(ft), Lt = "visiblePlugin"; -function Ar(e, t, n, s, o, u) { +function Ar(e, t, n, s, o, c) { Ee([], { useCommonAddons: !1 }).then(d => { @@ -65349,7 +59258,7 @@ function Ar(e, t, n, s, o, u) { m && (o.setVisiblePlugin(de), s.push({ name: m.name, def: m - }), u == null || u(m)); + }), c == null || c(m)); } a(i, "onClickHintInformation"); } @@ -65368,7 +59277,7 @@ function $e(e, t, n) { a($e, "useSynchronizeOption"); function pn(e, t, n, s, o) { const { - updateActiveTabValues: u + updateActiveTabValues: c } = Z({ nonNull: !0, caller: o @@ -65380,7 +59289,7 @@ function pn(e, t, n, s, o) { !i || n === null || i.set(n, p); }), g = ue(100, p => { - u({ + c({ [s]: p }); }), @@ -65390,7 +59299,7 @@ function pn(e, t, n, s, o) { d(h), g(h), t == null || t(h); }, "handleChange"); return e.on("change", m), () => e.off("change", m); - }, [t, e, i, n, s, u]); + }, [t, e, i, n, s, c]); } a(pn, "useChangeHandler"); function gn(e, t, n) { @@ -65401,11 +59310,11 @@ function gn(e, t, n) { caller: n }), o = te(), - u = Ze(); + c = Ze(); l.useEffect(() => { if (!e) return; const i = a((d, g) => { - Ar(d, g, s, o, u, m => { + Ar(d, g, s, o, c, m => { t == null || t({ kind: "Type", type: m, @@ -65414,7 +59323,7 @@ function gn(e, t, n) { }); }, "handleCompletion"); return e.on("hasCompletion", i), () => e.off("hasCompletion", i); - }, [t, e, o, u, s]); + }, [t, e, o, c, s]); } a(gn, "useCompletion"); function Y(e, t, n) { @@ -65487,21 +59396,21 @@ function Se() { if (s) { const o = s.getValue(); try { - const u = JSON.stringify(JSON.parse(o), null, 2); - u !== o && s.setValue(u); + const c = JSON.stringify(JSON.parse(o), null, 2); + c !== o && s.setValue(c); } catch {} } if (n) { const o = n.getValue(); try { - const u = JSON.stringify(JSON.parse(o), null, 2); - u !== o && n.setValue(u); + const c = JSON.stringify(JSON.parse(o), null, 2); + c !== o && n.setValue(c); } catch {} } if (t) { const o = t.getValue(), - u = M.print(M.parse(o)); - u !== o && t.setValue(u); + c = M.print(M.parse(o)); + c !== o && t.setValue(c); } }, [t, s, n]); } @@ -65527,15 +59436,15 @@ function He() { if (!s) return; const o = s.getValue(), { - insertions: u, + insertions: c, result: i } = B.fillLeafs(n, o, e); - return u && u.length > 0 && s.operation(() => { + return c && c.length > 0 && s.operation(() => { const d = s.getCursor(), g = s.indexFromPos(d); s.setValue(i || ""); let m = 0; - const p = u.map(_ref56 => { + const p = c.map(_ref56 => { let { index: h, string: x @@ -65553,7 +59462,7 @@ function He() { for (const { index: h, string: x - } of u) h < g && (y += x.length); + } of c) h < g && (y += x.length); s.setCursor(s.posFromIndex(y)); }), i; }, [e, s, n]); @@ -65567,12 +59476,28 @@ const Ge = a(e => { let s = ""; const o = (_ref57 = n == null ? void 0 : n.getValue()) !== null && _ref57 !== void 0 ? _ref57 : !1; o && o.length > 0 && (s = o); - const u = l.useCallback(i => n == null ? void 0 : n.setValue(i), [n]); - return l.useMemo(() => [s, u], [s, u]); + const c = l.useCallback(i => n == null ? void 0 : n.setValue(i), [n]); + return l.useMemo(() => [s, c], [s, c]); }, "useEditorState"), Or = a(() => Ge("query"), "useOperationsEditorState"), Fr = a(() => Ge("variable"), "useVariablesEditorState"), Br = a(() => Ge("header"), "useHeadersEditorState"); +function Wr(_ref58) { + let [e, t] = _ref58; + const n = l.useRef({ + pending: null, + last: e + }), + [s, o] = l.useState(e); + l.useEffect(() => { + n.current.last === e || (n.current.last = e, n.current.pending === null ? o(e) : n.current.pending === e ? (n.current.pending = null, e !== s && (n.current.pending = s, t(s))) : (n.current.pending = null, o(e))); + }, [e, s, t]); + const c = l.useCallback(i => { + o(i), n.current.pending === null && n.current.last !== i && (n.current.pending = i, t(i)); + }, [t]); + return l.useMemo(() => [s, c], [s, c]); +} +a(Wr, "useOptimisticState"); function ce() { let { editorTheme: e = Be, @@ -65582,7 +59507,7 @@ function ce() { } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; let o = arguments.length > 1 ? arguments[1] : undefined; const { - initialHeaders: u, + initialHeaders: c, headerEditor: i, setHeaderEditor: d, shouldPersistHeaders: g @@ -65605,7 +59530,7 @@ function ce() { const C = h.current; if (!C) return; const E = f(C, { - value: u, + value: c, lineNumbers: !0, tabSize: 2, mode: { @@ -65659,18 +59584,18 @@ function ce() { }), () => { x = !1; }; - }, [e, u, s, d]), $e(i, "keyMap", t), pn(i, n, g ? Me : null, "headers", ce), Y(i, ["Cmd-Enter", "Ctrl-Enter"], m == null ? void 0 : m.run), Y(i, ["Shift-Ctrl-P"], y), Y(i, ["Shift-Ctrl-M"], p), h; + }, [e, c, s, d]), $e(i, "keyMap", t), pn(i, n, g ? Me : null, "headers", ce), Y(i, ["Cmd-Enter", "Ctrl-Enter"], m == null ? void 0 : m.run), Y(i, ["Shift-Ctrl-P"], y), Y(i, ["Shift-Ctrl-M"], p), h; } a(ce, "useHeaderEditor"); const Me = "headers", - Wr = Array.from({ + _r = Array.from({ length: 11 }, (e, t) => String.fromCharCode(8192 + t)).concat(["\u2028", "\u2029", " ", " "]), - _r = new RegExp("[" + Wr.join("") + "]", "g"); -function Zr(e) { - return e.replace(_r, " "); + Zr = new RegExp("[" + _r.join("") + "]", "g"); +function $r(e) { + return e.replace(Zr, " "); } -a(Zr, "normalizeWhitespace"); +a($r, "normalizeWhitespace"); function ne() { let { editorTheme: e = Be, @@ -65678,7 +59603,7 @@ function ne() { onClickReference: n, onCopyQuery: s, onEdit: o, - readOnly: u = !1 + readOnly: c = !1 } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; let i = arguments.length > 1 ? arguments[1] : undefined; const { @@ -65774,7 +59699,7 @@ function ne() { autoCloseBrackets: !0, matchBrackets: !0, showCursorWhenSelecting: !0, - readOnly: u ? "nocursor" : !1, + readOnly: c ? "nocursor" : !1, lint: { schema: void 0, validationRules: null, @@ -65839,7 +59764,7 @@ function ne() { }); } }), S.on("keyup", (v, j) => { - zr.test(j.key) && v.execCommand("autocomplete"); + Ur.test(j.key) && v.execCommand("autocomplete"); }); let W = !1; S.on("startCompletion", () => { @@ -65851,39 +59776,39 @@ function ne() { }), S.on("beforeChange", (v, j) => { var R; if (j.origin === "paste") { - const $ = j.text.map(Zr); + const $ = j.text.map($r); (R = j.update) == null || R.call(j, j.from, j.to, $); } }), S.documentAST = null, S.operationName = null, S.operations = null, S.variableToType = null, h(S); }), () => { q = !1; }; - }, [e, m, u, h]), $e(p, "keyMap", t), l.useEffect(() => { + }, [e, m, c, h]), $e(p, "keyMap", t), l.useEffect(() => { if (!p) return; function q(P) { - var _P$operations, _P$operationName, _ref58, _ref59; + var _P$operations, _P$operationName, _ref59, _ref60; var v; const S = kt.getOperationFacts(d, P.getValue()), W = B.getSelectedOperationName((_P$operations = P.operations) !== null && _P$operations !== void 0 ? _P$operations : void 0, (_P$operationName = P.operationName) !== null && _P$operationName !== void 0 ? _P$operationName : void 0, S == null ? void 0 : S.operations); - return P.documentAST = (_ref58 = S == null ? void 0 : S.documentAST) !== null && _ref58 !== void 0 ? _ref58 : null, P.operationName = W !== null && W !== void 0 ? W : null, P.operations = (_ref59 = S == null ? void 0 : S.operations) !== null && _ref59 !== void 0 ? _ref59 : null, f && (f.state.lint.linterOptions.variableToType = S == null ? void 0 : S.variableToType, f.options.lint.variableToType = S == null ? void 0 : S.variableToType, f.options.hintOptions.variableToType = S == null ? void 0 : S.variableToType, (v = I.current) == null || v.signal(f, "change", f)), S ? { + return P.documentAST = (_ref59 = S == null ? void 0 : S.documentAST) !== null && _ref59 !== void 0 ? _ref59 : null, P.operationName = W !== null && W !== void 0 ? W : null, P.operations = (_ref60 = S == null ? void 0 : S.operations) !== null && _ref60 !== void 0 ? _ref60 : null, f && (f.state.lint.linterOptions.variableToType = S == null ? void 0 : S.variableToType, f.options.lint.variableToType = S == null ? void 0 : S.variableToType, f.options.hintOptions.variableToType = S == null ? void 0 : S.variableToType, (v = I.current) == null || v.signal(f, "change", f)), S ? { ...S, operationName: W } : null; } a(q, "getAndUpdateOperationFacts"); const N = ue(100, P => { - var _ref60; + var _ref61; const S = P.getValue(); k == null || k.set(xn, S); const W = P.operationName, v = q(P); - (v == null ? void 0 : v.operationName) !== void 0 && (k == null || k.set(Ur, v.operationName)), o == null || o(S, v == null ? void 0 : v.documentAST), v != null && v.operationName && W !== v.operationName && y(v.operationName), C({ + (v == null ? void 0 : v.operationName) !== void 0 && (k == null || k.set(Kr, v.operationName)), o == null || o(S, v == null ? void 0 : v.documentAST), v != null && v.operationName && W !== v.operationName && y(v.operationName), C({ query: S, - operationName: (_ref60 = v == null ? void 0 : v.operationName) !== null && _ref60 !== void 0 ? _ref60 : null + operationName: (_ref61 = v == null ? void 0 : v.operationName) !== null && _ref61 !== void 0 ? _ref61 : null }); }); return q(p), p.on("change", N), () => p.off("change", N); - }, [o, p, d, y, k, f, C]), $r(p, d !== null && d !== void 0 ? d : null, I), Gr(p, x !== null && x !== void 0 ? x : null, I), Qr(p, g, I), gn(p, n || null, ne); + }, [o, p, d, y, k, f, C]), Gr(p, d !== null && d !== void 0 ? d : null, I), Qr(p, x !== null && x !== void 0 ? x : null, I), zr(p, g, I), gn(p, n || null, ne); const O = E == null ? void 0 : E.run, D = l.useCallback(() => { var P; @@ -65899,23 +59824,23 @@ function ne() { return Y(p, ["Cmd-Enter", "Ctrl-Enter"], D), Y(p, ["Shift-Ctrl-C"], w), Y(p, ["Shift-Ctrl-P", "Shift-Ctrl-F"], A), Y(p, ["Shift-Ctrl-M"], T), F; } a(ne, "useQueryEditor"); -function $r(e, t, n) { +function Gr(e, t, n) { l.useEffect(() => { if (!e) return; const s = e.options.lint.schema !== t; e.state.lint.linterOptions.schema = t, e.options.lint.schema = t, e.options.hintOptions.schema = t, e.options.info.schema = t, e.options.jump.schema = t, s && n.current && n.current.signal(e, "change", e); }, [e, t, n]); } -a($r, "useSynchronizeSchema"); -function Gr(e, t, n) { +a(Gr, "useSynchronizeSchema"); +function Qr(e, t, n) { l.useEffect(() => { if (!e) return; const s = e.options.lint.validationRules !== t; e.state.lint.linterOptions.validationRules = t, e.options.lint.validationRules = t, s && n.current && n.current.signal(e, "change", e); }, [e, t, n]); } -a(Gr, "useSynchronizeValidationRules"); -function Qr(e, t, n) { +a(Qr, "useSynchronizeValidationRules"); +function zr(e, t, n) { const s = l.useMemo(() => [...t.values()], [t]); l.useEffect(() => { if (!e) return; @@ -65923,30 +59848,30 @@ function Qr(e, t, n) { e.state.lint.linterOptions.externalFragments = s, e.options.lint.externalFragments = s, e.options.hintOptions.externalFragments = s, o && n.current && n.current.signal(e, "change", e); }, [e, s, n]); } -a(Qr, "useSynchronizeExternalFragments"); -const zr = /^[a-zA-Z0-9_@(]$/, +a(zr, "useSynchronizeExternalFragments"); +const Ur = /^[a-zA-Z0-9_@(]$/, xn = "query", - Ur = "operationName"; -function Kr(_ref61) { + Kr = "operationName"; +function Jr(_ref62) { let { defaultQuery: e, defaultHeaders: t, headers: n, defaultTabs: s, query: o, - variables: u, + variables: c, storage: i, shouldPersistHeaders: d - } = _ref61; + } = _ref62; const g = i == null ? void 0 : i.get(ve); try { if (!g) throw new Error("Storage for tabs is empty"); const m = JSON.parse(g), p = d ? n : void 0; - if (Jr(m)) { + if (Yr(m)) { const y = De({ query: o, - variables: u, + variables: c, headers: p }); let h = -1; @@ -65965,7 +59890,7 @@ function Kr(_ref61) { hash: y, title: x || xt, query: o, - variables: u, + variables: c, headers: n, operationName: x, response: null @@ -65979,25 +59904,25 @@ function Kr(_ref61) { activeTabIndex: 0, tabs: (s || [{ query: o !== null && o !== void 0 ? o : e, - variables: u, + variables: c, headers: n !== null && n !== void 0 ? n : t }]).map(vn) }; } } -a(Kr, "getDefaultTabState"); -function Jr(e) { - return e && typeof e == "object" && !Array.isArray(e) && Xr(e, "activeTabIndex") && "tabs" in e && Array.isArray(e.tabs) && e.tabs.every(Yr); -} -a(Jr, "isTabsState"); +a(Jr, "getDefaultTabState"); function Yr(e) { + return e && typeof e == "object" && !Array.isArray(e) && es(e, "activeTabIndex") && "tabs" in e && Array.isArray(e.tabs) && e.tabs.every(Xr); +} +a(Yr, "isTabsState"); +function Xr(e) { return e && typeof e == "object" && !Array.isArray(e) && jt(e, "id") && jt(e, "title") && fe(e, "query") && fe(e, "variables") && fe(e, "headers") && fe(e, "operationName") && fe(e, "response"); } -a(Yr, "isTabState"); -function Xr(e, t) { +a(Xr, "isTabState"); +function es(e, t) { return t in e && typeof e[t] == "number"; } -a(Xr, "hasNumberKey"); +a(es, "hasNumberKey"); function jt(e, t) { return t in e && typeof e[t] == "string"; } @@ -66006,22 +59931,22 @@ function fe(e, t) { return t in e && (typeof e[t] == "string" || e[t] === null); } a(fe, "hasStringOrNullKey"); -function es(_ref62) { +function ts(_ref63) { let { queryEditor: e, variableEditor: t, headerEditor: n, responseEditor: s - } = _ref62; + } = _ref63; return l.useCallback(o => { - var _ref63, _ref64, _ref65, _ref66, _ref67; - const u = (_ref63 = e == null ? void 0 : e.getValue()) !== null && _ref63 !== void 0 ? _ref63 : null, - i = (_ref64 = t == null ? void 0 : t.getValue()) !== null && _ref64 !== void 0 ? _ref64 : null, - d = (_ref65 = n == null ? void 0 : n.getValue()) !== null && _ref65 !== void 0 ? _ref65 : null, - g = (_ref66 = e == null ? void 0 : e.operationName) !== null && _ref66 !== void 0 ? _ref66 : null, - m = (_ref67 = s == null ? void 0 : s.getValue()) !== null && _ref67 !== void 0 ? _ref67 : null; + var _ref64, _ref65, _ref66, _ref67, _ref68; + const c = (_ref64 = e == null ? void 0 : e.getValue()) !== null && _ref64 !== void 0 ? _ref64 : null, + i = (_ref65 = t == null ? void 0 : t.getValue()) !== null && _ref65 !== void 0 ? _ref65 : null, + d = (_ref66 = n == null ? void 0 : n.getValue()) !== null && _ref66 !== void 0 ? _ref66 : null, + g = (_ref67 = e == null ? void 0 : e.operationName) !== null && _ref67 !== void 0 ? _ref67 : null, + m = (_ref68 = s == null ? void 0 : s.getValue()) !== null && _ref68 !== void 0 ? _ref68 : null; return yn(o, { - query: u, + query: c, variables: i, headers: d, response: m, @@ -66029,17 +59954,17 @@ function es(_ref62) { }); }, [e, t, n, s]); } -a(es, "useSynchronizeActiveTabValues"); +a(ts, "useSynchronizeActiveTabValues"); function Cn(e) { let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1; return JSON.stringify(e, (n, s) => n === "hash" || n === "response" || !t && n === "headers" ? null : s); } a(Cn, "serializeTabState"); -function ts(_ref68) { +function ns(_ref69) { let { storage: e, shouldPersistHeaders: t - } = _ref68; + } = _ref69; const n = l.useMemo(() => ue(500, s => { e == null || e.set(ve, s); }), [e]); @@ -66047,25 +59972,25 @@ function ts(_ref68) { n(Cn(s, t)); }, [t, n]); } -a(ts, "useStoreTabs"); -function ns(_ref69) { +a(ns, "useStoreTabs"); +function rs(_ref70) { let { queryEditor: e, variableEditor: t, headerEditor: n, responseEditor: s - } = _ref69; - return l.useCallback(_ref70 => { + } = _ref70; + return l.useCallback(_ref71 => { let { query: o, - variables: u, + variables: c, headers: i, response: d - } = _ref70; - e == null || e.setValue(o !== null && o !== void 0 ? o : ""), t == null || t.setValue(u !== null && u !== void 0 ? u : ""), n == null || n.setValue(i !== null && i !== void 0 ? i : ""), s == null || s.setValue(d !== null && d !== void 0 ? d : ""); + } = _ref71; + e == null || e.setValue(o !== null && o !== void 0 ? o : ""), t == null || t.setValue(c !== null && c !== void 0 ? c : ""), n == null || n.setValue(i !== null && i !== void 0 ? i : ""), s == null || s.setValue(d !== null && d !== void 0 ? d : ""); }, [n, e, s, t]); } -a(ns, "useSetEditorValues"); +a(rs, "useSetEditorValues"); function vn() { let { query: e = null, @@ -66117,19 +60042,19 @@ function De(e) { } a(De, "hashFromTabContents"); function gt(e) { - var _ref71; + var _ref72; const n = /^(?!#).*(query|subscription|mutation)\s+([a-zA-Z0-9_]+)/m.exec(e); - return (_ref71 = n == null ? void 0 : n[2]) !== null && _ref71 !== void 0 ? _ref71 : null; + return (_ref72 = n == null ? void 0 : n[2]) !== null && _ref72 !== void 0 ? _ref72 : null; } a(gt, "fuzzyExtractOperationName"); -function rs(e) { +function ss(e) { const t = e == null ? void 0 : e.get(ve); if (t) { const n = JSON.parse(t); e == null || e.set(ve, JSON.stringify(n, (s, o) => s === "headers" ? null : o)); } } -a(rs, "clearHeadersFromTabs"); +a(ss, "clearHeadersFromTabs"); const xt = "", ve = "tabState"; function oe() { @@ -66140,21 +60065,21 @@ function oe() { onEdit: s, readOnly: o = !1 } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - let u = arguments.length > 1 ? arguments[1] : undefined; + let c = arguments.length > 1 ? arguments[1] : undefined; const { initialVariables: i, variableEditor: d, setVariableEditor: g } = Z({ nonNull: !0, - caller: u || oe + caller: c || oe }), m = we(), p = he({ - caller: u || oe + caller: c || oe }), y = Se({ - caller: u || oe + caller: c || oe }), h = l.useRef(null), x = l.useRef(); @@ -66234,7 +60159,7 @@ const wn = "variables", function En(e) { const t = se(), [n, s] = l.useState(null), - [o, u] = l.useState(null), + [o, c] = l.useState(null), [i, d] = l.useState(null), [g, m] = l.useState(null), [p, y] = l.useState(() => { @@ -66242,30 +60167,30 @@ function En(e) { return e.shouldPersistHeaders !== !1 && v ? (t == null ? void 0 : t.get(ze)) === "true" : !!e.shouldPersistHeaders; }); ke(n, e.headers), ke(o, e.query), ke(i, e.response), ke(g, e.variables); - const h = ts({ + const h = ns({ storage: t, shouldPersistHeaders: p }), [x] = l.useState(() => { - var _ref72, _e$query2, _ref73, _e$variables2, _ref74, _e$headers2, _e$response, _ref75, _ref76; - const v = (_ref72 = (_e$query2 = e.query) !== null && _e$query2 !== void 0 ? _e$query2 : t == null ? void 0 : t.get(xn)) !== null && _ref72 !== void 0 ? _ref72 : null, - j = (_ref73 = (_e$variables2 = e.variables) !== null && _e$variables2 !== void 0 ? _e$variables2 : t == null ? void 0 : t.get(wn)) !== null && _ref73 !== void 0 ? _ref73 : null, - R = (_ref74 = (_e$headers2 = e.headers) !== null && _e$headers2 !== void 0 ? _e$headers2 : t == null ? void 0 : t.get(Me)) !== null && _ref74 !== void 0 ? _ref74 : null, + var _ref73, _e$query2, _ref74, _e$variables2, _ref75, _e$headers2, _e$response, _ref76, _ref77; + const v = (_ref73 = (_e$query2 = e.query) !== null && _e$query2 !== void 0 ? _e$query2 : t == null ? void 0 : t.get(xn)) !== null && _ref73 !== void 0 ? _ref73 : null, + j = (_ref74 = (_e$variables2 = e.variables) !== null && _e$variables2 !== void 0 ? _e$variables2 : t == null ? void 0 : t.get(wn)) !== null && _ref74 !== void 0 ? _ref74 : null, + R = (_ref75 = (_e$headers2 = e.headers) !== null && _e$headers2 !== void 0 ? _e$headers2 : t == null ? void 0 : t.get(Me)) !== null && _ref75 !== void 0 ? _ref75 : null, $ = (_e$response = e.response) !== null && _e$response !== void 0 ? _e$response : "", - z = Kr({ + z = Jr({ query: v, variables: j, headers: R, defaultTabs: e.defaultTabs, - defaultQuery: e.defaultQuery || ss, + defaultQuery: e.defaultQuery || os, defaultHeaders: e.defaultHeaders, storage: t, shouldPersistHeaders: p }); return h(z), { - query: (_ref75 = v !== null && v !== void 0 ? v : z.activeTabIndex === 0 ? z.tabs[0].query : null) !== null && _ref75 !== void 0 ? _ref75 : "", + query: (_ref76 = v !== null && v !== void 0 ? v : z.activeTabIndex === 0 ? z.tabs[0].query : null) !== null && _ref76 !== void 0 ? _ref76 : "", variables: j !== null && j !== void 0 ? j : "", - headers: (_ref76 = R !== null && R !== void 0 ? R : e.defaultHeaders) !== null && _ref76 !== void 0 ? _ref76 : "", + headers: (_ref77 = R !== null && R !== void 0 ? R : e.defaultHeaders) !== null && _ref77 !== void 0 ? _ref77 : "", response: $, tabState: z }; @@ -66273,11 +60198,11 @@ function En(e) { [f, C] = l.useState(x.tabState), E = l.useCallback(v => { if (v) { - var _ref77; - t == null || t.set(Me, (_ref77 = n == null ? void 0 : n.getValue()) !== null && _ref77 !== void 0 ? _ref77 : ""); + var _ref78; + t == null || t.set(Me, (_ref78 = n == null ? void 0 : n.getValue()) !== null && _ref78 !== void 0 ? _ref78 : ""); const j = Cn(f, !0); t == null || t.set(ve, j); - } else t == null || t.set(Me, ""), rs(t); + } else t == null || t.set(Me, ""), ss(t); y(v), t == null || t.set(ze, v.toString()); }, [t, f, n]), k = l.useRef(); @@ -66285,13 +60210,13 @@ function En(e) { const v = !!e.shouldPersistHeaders; (k == null ? void 0 : k.current) !== v && (E(v), k.current = v); }, [e.shouldPersistHeaders, E]); - const L = es({ + const L = ts({ queryEditor: o, variableEditor: g, headerEditor: n, responseEditor: i }), - b = ns({ + b = rs({ queryEditor: o, variableEditor: g, headerEditor: n, @@ -66378,7 +60303,7 @@ function En(e) { responseEditor: i, variableEditor: g, setHeaderEditor: s, - setQueryEditor: u, + setQueryEditor: c, setResponseEditor: d, setVariableEditor: m, setOperationName: N, @@ -66399,7 +60324,7 @@ function En(e) { a(En, "EditorContextProvider"); const Z = ie(Ct), ze = "shouldPersistHeaders", - ss = `# Welcome to GraphiQL + os = `# Welcome to GraphiQL # # GraphiQL is an in-browser tool for writing, validating, and # testing GraphQL queries. @@ -66431,11 +60356,11 @@ const Z = ie(Ct), # `; -function Xe(_ref78) { +function Xe(_ref79) { let { isHidden: e, ...t - } = _ref78; + } = _ref79; const { headerEditor: n } = Z({ @@ -66458,10 +60383,10 @@ function Ae(e) { height: null }), [s, o] = l.useState(null), - u = l.useRef(null), + c = l.useRef(null), i = (g = Sn(e.token)) == null ? void 0 : g.href; l.useEffect(() => { - if (u.current) { + if (c.current) { if (!i) { n({ width: null, @@ -66484,14 +60409,14 @@ function Ae(e) { return r.jsxs("div", { children: [r.jsx("img", { onLoad: () => { - var _ref79, _ref80; + var _ref80, _ref81; var m, p; n({ - width: (_ref79 = (m = u.current) == null ? void 0 : m.naturalWidth) !== null && _ref79 !== void 0 ? _ref79 : null, - height: (_ref80 = (p = u.current) == null ? void 0 : p.naturalHeight) !== null && _ref80 !== void 0 ? _ref80 : null + width: (_ref80 = (m = c.current) == null ? void 0 : m.naturalWidth) !== null && _ref80 !== void 0 ? _ref80 : null, + height: (_ref81 = (p = c.current) == null ? void 0 : p.naturalHeight) !== null && _ref81 !== void 0 ? _ref81 : null }); }, - ref: u, + ref: c, src: i }), d] }); @@ -66499,7 +60424,7 @@ function Ae(e) { a(Ae, "ImagePreview"); Ae.shouldRender = a(function (t) { const n = Sn(t); - return n ? os(n) : !1; + return n ? ls(n) : !1; }, "shouldRender"); function Sn(e) { if (e.type !== "string") return; @@ -66514,10 +60439,10 @@ function Sn(e) { } } a(Sn, "tokenToURL"); -function os(e) { +function ls(e) { return /(bmp|gif|jpeg|jpg|png|svg)$/.test(e.pathname); } -a(os, "isImageURL"); +a(ls, "isImageURL"); function Ln(e) { const t = ne(e, Ln); return r.jsx("div", { @@ -66535,7 +60460,7 @@ function Oe() { let s = arguments.length > 1 ? arguments[1] : undefined; const { fetchError: o, - validationErrors: u + validationErrors: c } = X({ nonNull: !0, caller: s || Oe @@ -66587,8 +60512,8 @@ function Oe() { y = !1; }; }, [t, i, g]), $e(d, "keyMap", n), l.useEffect(() => { - o && (d == null || d.setValue(o)), u.length > 0 && (d == null || d.setValue(B.formatError(u))); - }, [d, o, u]), m; + o && (d == null || d.setValue(o)), c.length > 0 && (d == null || d.setValue(B.formatError(c))); + }, [d, o, c]), m; } a(Oe, "useResponseEditor"); function jn(e) { @@ -66602,11 +60527,11 @@ function jn(e) { }); } a(jn, "ResponseEditor"); -function et(_ref81) { +function et(_ref82) { let { isHidden: e, ...t - } = _ref81; + } = _ref82; const { variableEditor: n } = Z({ @@ -66622,14 +60547,14 @@ function et(_ref81) { }); } a(et, "VariableEditor"); -function ls(_ref82) { +function is(_ref83) { let { children: e, dangerouslyAssumeSchemaIsValid: t, defaultQuery: n, defaultHeaders: s, defaultTabs: o, - externalFragments: u, + externalFragments: c, fetcher: i, getDefaultFieldNames: d, headers: g, @@ -66651,7 +60576,7 @@ function ls(_ref82) { validationRules: I, variables: H, visiblePlugin: O - } = _ref82; + } = _ref83; return r.jsx(Tt, { storage: F, children: r.jsx(on, { @@ -66660,7 +60585,7 @@ function ls(_ref82) { defaultQuery: n, defaultHeaders: s, defaultTabs: o, - externalFragments: u, + externalFragments: c, headers: g, onEditOperationName: h, onTabChange: f, @@ -66695,8 +60620,8 @@ function ls(_ref82) { }) }); } -a(ls, "GraphiQLProvider"); -function is() { +a(is, "GraphiQLProvider"); +function as() { const e = se(), [t, n] = l.useState(() => { if (!e) return null; @@ -66721,18 +60646,18 @@ function is() { setTheme: s }), [t, s]); } -a(is, "useTheme"); +a(as, "useTheme"); const Ue = "theme"; -function as(_ref83) { +function cs(_ref84) { let { - defaultSizeRelation: e = cs, + defaultSizeRelation: e = us, direction: t, initiallyHidden: n, onHiddenElementChange: s, sizeThresholdFirst: o = 100, - sizeThresholdSecond: u = 100, + sizeThresholdSecond: c = 100, storageKey: i - } = _ref83; + } = _ref84; const d = se(), g = l.useMemo(() => ue(500, L => { i && (d == null || d.set(i, L)); @@ -66784,7 +60709,7 @@ function as(_ref83) { if (S.buttons === 0) return P(); const W = S[T] - w.getBoundingClientRect()[A] - q, v = w.getBoundingClientRect()[F] - S[T] + q - L[I]; - if (W < o) y("first"), g(Ne);else if (v < u) y("second"), g(Te);else { + if (W < o) y("first"), g(Ne);else if (v < c) y("second"), g(Te);else { y(null); const j = `${W / v}`; b.style.flex = j, g(j); @@ -66803,7 +60728,7 @@ function as(_ref83) { return a(O, "reset"), L.addEventListener("dblclick", O), () => { L.removeEventListener("mousedown", H), L.removeEventListener("dblclick", O); }; - }, [t, y, o, u, g]), l.useMemo(() => ({ + }, [t, y, o, c, g]), l.useMemo(() => ({ dragBarRef: x, hiddenElement: m, firstRef: h, @@ -66811,22 +60736,22 @@ function as(_ref83) { secondRef: f }), [m, p]); } -a(as, "useDragResize"); -const cs = 1, +a(cs, "useDragResize"); +const us = 1, Ne = "hide-first", Te = "hide-second"; -const kn = l.forwardRef((_ref84, s) => { +const kn = l.forwardRef((_ref85, s) => { let { label: e, onClick: t, ...n - } = _ref84; - const [o, u] = l.useState(null), + } = _ref85; + const [o, c] = l.useState(null), i = l.useCallback(d => { try { - t == null || t(d), u(null); + t == null || t(d), c(null); } catch (g) { - u(g instanceof Error ? g : new Error(`Toolbar button click failed: ${g}`)); + c(g instanceof Error ? g : new Error(`Toolbar button click failed: ${g}`)); } }, [t]); return r.jsx(J, { @@ -66855,7 +60780,7 @@ function tt() { isFetching: n, isSubscribed: s, operationName: o, - run: u, + run: c, stop: i } = we({ nonNull: !0, @@ -66884,7 +60809,7 @@ function tt() { onSelect: () => { var E; const C = (E = h.name) == null ? void 0 : E.value; - e && C && C !== e.operationName && t(C), u(); + e && C && C !== e.operationName && t(C), c(); }, children: f }, `${f}-${x}`); @@ -66895,19 +60820,19 @@ function tt() { children: r.jsx("button", { ...y, onClick: () => { - m ? i() : u(); + m ? i() : c(); } }) }); } a(tt, "ExecuteButton"); -const us = a(_ref85 => { +const ds = a(_ref86 => { let { button: e, children: t, label: n, ...s - } = _ref85; + } = _ref86; return r.jsxs(ee, { ...s, children: [r.jsx(J, { @@ -66922,7 +60847,7 @@ const us = a(_ref85 => { })] }); }, "ToolbarMenuRoot"), - ds = ye(us, { + hs = ye(ds, { Item: ee.Item }); exports.Argument = Ce; @@ -66960,7 +60885,7 @@ exports.ExplorerSection = G; exports.FieldDocumentation = un; exports.FieldIcon = Ot; exports.FieldLink = hn; -exports.GraphiQLProvider = ls; +exports.GraphiQLProvider = is; exports.HISTORY_PLUGIN = Ye; exports.HeaderEditor = Xe; exports.History = ln; @@ -66997,7 +60922,7 @@ exports.StorageContextProvider = Tt; exports.Tab = Lr; exports.Tabs = sn; exports.ToolbarButton = kn; -exports.ToolbarMenu = ds; +exports.ToolbarMenu = hs; exports.Tooltip = J; exports.TooltipRoot = en; exports.TrashIcon = Ut; @@ -67008,7 +60933,7 @@ exports.UnStyledButton = Q; exports.VariableEditor = et; exports.useAutoCompleteLeafs = He; exports.useCopyQuery = pt; -exports.useDragResize = as; +exports.useDragResize = cs; exports.useEditorContext = Z; exports.useEditorState = Ge; exports.useExecutionContext = we; @@ -67018,13 +60943,14 @@ exports.useHeadersEditorState = Br; exports.useHistoryContext = be; exports.useMergeQuery = he; exports.useOperationsEditorState = Or; +exports.useOptimisticState = Wr; exports.usePluginContext = Ze; exports.usePrettifyEditors = Se; exports.useQueryEditor = ne; exports.useResponseEditor = Oe; exports.useSchemaContext = X; exports.useStorageContext = se; -exports.useTheme = is; +exports.useTheme = as; exports.useVariableEditor = oe; exports.useVariablesEditorState = Fr; @@ -67194,7 +61120,7 @@ D.CodeMirror.registerHelper("info", "graphql", (a, e) => { } }); function E(a, e, c) { - N(a, e, c), f(a, e, c, e.type); + N(a, e, c), p(a, e, c, e.type); } l(E, "renderField"); function N(a, e, c) { @@ -67212,7 +61138,7 @@ l(h, "renderDirective"); function T(a, e, c) { var n; const r = ((n = e.argDef) === null || n === void 0 ? void 0 : n.name) || ""; - t(a, r, "arg-name", c, m.getArgumentReference(e)), f(a, e, c, e.inputType); + t(a, r, "arg-name", c, m.getArgumentReference(e)), p(a, e, c, e.inputType); } l(T, "renderArg"); function g(a, e, c) { @@ -67221,11 +61147,11 @@ function g(a, e, c) { u(a, e, c, e.inputType), t(a, "."), t(a, r, "enum-value", c, m.getEnumValueReference(e)); } l(g, "renderEnumValue"); -function f(a, e, c, n) { +function p(a, e, c, n) { const r = document.createElement("span"); r.className = "type-name-pill", n instanceof s.GraphQLNonNull ? (u(r, e, c, n.ofType), t(r, "!")) : n instanceof s.GraphQLList ? (t(r, "["), u(r, e, c, n.ofType), t(r, "]")) : t(r, (n == null ? void 0 : n.name) || "", "type-name", c, m.getTypeReference(e, n)), a.append(r); } -l(f, "renderTypeAnnotation"); +l(p, "renderTypeAnnotation"); function u(a, e, c, n) { n instanceof s.GraphQLNonNull ? (u(a, e, c, n.ofType), t(a, "!")) : n instanceof s.GraphQLList ? (t(a, "["), u(a, e, c, n.ofType), t(a, "]")) : t(a, (n == null ? void 0 : n.name) || "", "type-name", c, m.getTypeReference(e, n)); } @@ -67264,8 +61190,8 @@ function t(a, e) { onClick: i } = n; let d; - i ? (d = document.createElement("a"), d.href = "javascript:void 0", d.addEventListener("click", p => { - i(r, p); + i ? (d = document.createElement("a"), d.href = "javascript:void 0", d.addEventListener("click", f => { + f.preventDefault(), i(r, f); })) : d = document.createElement("span"), d.className = c, d.append(document.createTextNode(e)), a.append(d); } else a.append(document.createTextNode(e)); } @@ -68087,7 +62013,7 @@ var c = (u, p) => m(u, "name", { configurable: !0 }); const f = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), - g = __webpack_require__(/*! ./dialog.cjs2.js */ "../../graphiql-react/dist/dialog.cjs2.js"); + g = __webpack_require__(/*! ./dialog.cjs.js */ "../../graphiql-react/dist/dialog.cjs.js"); function h(u, p) { for (var o = 0; o < p.length; o++) { const s = p[o]; @@ -68111,36 +62037,36 @@ var b = { }; (function (u, p) { (function (o) { - o(f.requireCodemirror(), g.requireDialog()); + o(f.requireCodemirror(), g.dialogExports); })(function (o) { o.defineOption("search", { bottom: !1 }); - function s(e, t, n, r, l) { - e.openDialog ? e.openDialog(t, l, { - value: r, + function s(e, r, n, t, l) { + e.openDialog ? e.openDialog(r, l, { + value: t, selectValueOnOpen: !0, bottom: e.options.search.bottom - }) : l(prompt(n, r)); + }) : l(prompt(n, t)); } c(s, "dialog"); function i(e) { return e.phrase("Jump to line:") + ' ' + e.phrase("(Use line:column or scroll% syntax)") + ""; } c(i, "getJumpDialog"); - function a(e, t) { - var n = Number(t); - return /^[-+]/.test(t) ? e.getCursor().line + n : n - 1; + function a(e, r) { + var n = Number(r); + return /^[-+]/.test(r) ? e.getCursor().line + n : n - 1; } c(a, "interpretLine"), o.commands.jumpToLine = function (e) { - var t = e.getCursor(); - s(e, i(e), e.phrase("Jump to line:"), t.line + 1 + ":" + t.ch, function (n) { + var r = e.getCursor(); + s(e, i(e), e.phrase("Jump to line:"), r.line + 1 + ":" + r.ch, function (n) { if (n) { - var r; - if (r = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(n)) e.setCursor(a(e, r[1]), Number(r[2]));else if (r = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(n)) { - var l = Math.round(e.lineCount() * Number(r[1]) / 100); - /^[-+]/.test(r[1]) && (l = t.line + l + 1), e.setCursor(l - 1, t.ch); - } else (r = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(n)) && e.setCursor(a(e, r[1]), t.ch); + var t; + if (t = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(n)) e.setCursor(a(e, t[1]), Number(t[2]));else if (t = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(n)) { + var l = Math.round(e.lineCount() * Number(t[1]) / 100); + /^[-+]/.test(t[1]) && (l = r.line + l + 1), e.setCursor(l - 1, r.ch); + } else (t = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(n)) && e.setCursor(a(e, t[1]), r.ch); } }); }, o.keyMap.default["Alt-G"] = "jumpToLine"; @@ -69288,7 +63214,7 @@ var a = (S, O) => K(S, "name", { }); const Q = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), L = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"), - z = __webpack_require__(/*! ./dialog.cjs2.js */ "../../graphiql-react/dist/dialog.cjs2.js"); + z = __webpack_require__(/*! ./dialog.cjs.js */ "../../graphiql-react/dist/dialog.cjs.js"); function U(S, O) { for (var i = 0; i < O.length; i++) { const y = O[i]; @@ -69312,7 +63238,7 @@ var B = { }; (function (S, O) { (function (i) { - i(Q.requireCodemirror(), L.requireSearchcursor(), z.requireDialog()); + i(Q.requireCodemirror(), L.requireSearchcursor(), z.dialogExports); })(function (i) { i.defineOption("search", { bottom: !1 @@ -69360,14 +63286,14 @@ var B = { }); } a(j, "persistentDialog"); - function R(e, n, t, o, r) { + function D(e, n, t, o, r) { e.openDialog ? e.openDialog(n, r, { value: o, selectValueOnOpen: !0, bottom: e.options.search.bottom }) : r(prompt(t, o)); } - a(R, "dialog"); + a(D, "dialog"); function k(e, n, t, o) { e.openConfirm ? e.openConfirm(n, o) : confirm(t) && o[0](); } @@ -69387,36 +63313,36 @@ var B = { return (typeof e == "string" ? e == "" : e.test("")) && (e = /x^/), e; } a(T, "parseQuery"); - function D(e, n, t) { + function P(e, n, t) { n.queryText = t, n.query = T(t), e.removeOverlay(n.overlay, m(n.query)), n.overlay = y(n.query, m(n.query)), e.addOverlay(n.overlay), e.showMatchesOnScrollbar && (n.annotate && (n.annotate.clear(), n.annotate = null), n.annotate = e.showMatchesOnScrollbar(n.query, m(n.query))); } - a(D, "startSearch"); + a(P, "startSearch"); function b(e, n, t, o) { var r = h(e); - if (r.query) return P(e, n); + if (r.query) return R(e, n); var s = e.getSelection() || r.lastQuery; if (s instanceof RegExp && s.source == "x^" && (s = null), t && e.openDialog) { var c = null, u = a(function (f, x) { - i.e_stop(x), f && (f != r.queryText && (D(e, r, f), r.posFrom = r.posTo = e.getCursor()), c && (c.style.opacity = 1), P(e, x.shiftKey, function (d, g) { + i.e_stop(x), f && (f != r.queryText && (P(e, r, f), r.posFrom = r.posTo = e.getCursor()), c && (c.style.opacity = 1), R(e, x.shiftKey, function (d, g) { var p; g.line < 3 && document.querySelector && (p = e.display.wrapper.querySelector(".CodeMirror-dialog")) && p.getBoundingClientRect().bottom - 4 > e.cursorCoords(g, "window").top && ((c = p).style.opacity = .4); })); }, "searchNext"); - j(e, _(e), s, u, function (f, x) { + j(e, E(e), s, u, function (f, x) { var d = i.keyName(f), g = e.getOption("extraKeys"), p = g && g[d] || i.keyMap[e.getOption("keyMap")][d]; - p == "findNext" || p == "findPrev" || p == "findPersistentNext" || p == "findPersistentPrev" ? (i.e_stop(f), D(e, h(e), x), e.execCommand(p)) : (p == "find" || p == "findPersistent") && (i.e_stop(f), u(x, f)); - }), o && s && (D(e, r, s), P(e, n)); - } else R(e, _(e), "Search for:", s, function (f) { + p == "findNext" || p == "findPrev" || p == "findPersistentNext" || p == "findPersistentPrev" ? (i.e_stop(f), P(e, h(e), x), e.execCommand(p)) : (p == "find" || p == "findPersistent") && (i.e_stop(f), u(x, f)); + }), o && s && (P(e, r, s), R(e, n)); + } else D(e, E(e), "Search for:", s, function (f) { f && !r.query && e.operation(function () { - D(e, r, f), r.posFrom = r.posTo = e.getCursor(), P(e, n); + P(e, r, f), r.posFrom = r.posTo = e.getCursor(), R(e, n); }); }); } a(b, "doSearch"); - function P(e, n, t) { + function R(e, n, t) { e.operation(function () { var o = h(e), r = N(e, o.query, n ? o.posFrom : o.posTo); @@ -69426,7 +63352,7 @@ var B = { }, 20), o.posFrom = r.from(), o.posTo = r.to(), t && t(r.from(), r.to())); }); } - a(P, "findNext"); + a(R, "findNext"); function w(e) { e.operation(function () { var n = h(e); @@ -69444,7 +63370,7 @@ var B = { return t; } a(l, "el"); - function _(e) { + function E(e) { return l("", null, l("span", { className: "CodeMirror-search-label" }, e.phrase("Search:")), " ", l("input", { @@ -69456,7 +63382,7 @@ var B = { className: "CodeMirror-search-hint" }, e.phrase("(Use /re/ syntax for regexp search)"))); } - a(_, "getQueryDialog"); + a(E, "getQueryDialog"); function A(e) { return l("", null, " ", l("input", { type: "text", @@ -69484,7 +63410,7 @@ var B = { }, e.phrase("Replace?")), " ", l("button", {}, e.phrase("Yes")), " ", l("button", {}, e.phrase("No")), " ", l("button", {}, e.phrase("All")), " ", l("button", {}, e.phrase("Stop"))); } a(V, "getDoReplaceConfirm"); - function E(e, n, t) { + function _(e, n, t) { e.operation(function () { for (var o = N(e, n); o.findNext();) if (typeof n != "string") { var r = e.getRange(o.from(), o.to()).match(n); @@ -69494,7 +63420,7 @@ var B = { } else o.replace(t); }); } - a(E, "replaceAll"); + a(_, "replaceAll"); function F(e, n) { if (!e.getOption("readOnly")) { var t = e.getSelection() || h(e).lastQuery, @@ -69502,9 +63428,9 @@ var B = { r = l("", null, l("span", { className: "CodeMirror-search-label" }, o), A(e)); - R(e, r, o, t, function (s) { - s && (s = T(s), R(e, I(e), e.phrase("Replace with:"), "", function (c) { - if (c = C(c), n) E(e, s, c);else { + D(e, r, o, t, function (s) { + s && (s = T(s), D(e, I(e), e.phrase("Replace with:"), "", function (c) { + if (c = C(c), n) _(e, s, c);else { w(e); var u = N(e, s, e.getCursor("from")), f = a(function () { @@ -69516,7 +63442,7 @@ var B = { }), k(e, V(e), e.phrase("Replace?"), [function () { x(g); }, f, function () { - E(e, s, c); + _(e, s, c); }])); }, "advance"), x = a(function (d) { @@ -72218,6 +66144,6759 @@ exports.QueryStore = QueryStore; /***/ }), +/***/ "../node_modules/linkify-it/build/index.cjs.js": +/*!*****************************************************!*\ + !*** ../node_modules/linkify-it/build/index.cjs.js ***! + \*****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var uc_micro = __webpack_require__(/*! uc.micro */ "../node_modules/uc.micro/build/index.cjs.js"); +function reFactory(opts) { + const re = {}; + opts = opts || {}; + re.src_Any = uc_micro.Any.source; + re.src_Cc = uc_micro.Cc.source; + re.src_Z = uc_micro.Z.source; + re.src_P = uc_micro.P.source; + + // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation) + re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|'); + + // \p{\Z\Cc} (white spaces + control) + re.src_ZCc = [re.src_Z, re.src_Cc].join('|'); + + // Experimental. List of chars, completely prohibited in links + // because can separate it from other part of text + const text_separators = '[><\uff5c]'; + + // All possible word characters (everything without punctuation, spaces & controls) + // Defined via punctuation & spaces to save space + // Should be something like \p{\L\N\S\M} (\w but without `_`) + re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'; + // The same as abothe but without [0-9] + // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')'; + + re.src_ip4 = '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; + + // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch. + re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?'; + re.src_port = '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'; + re.src_host_terminator = '(?=$|' + text_separators + '|' + re.src_ZPCc + ')' + '(?!' + (opts['---'] ? '-(?!--)|' : '-|') + '_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; + re.src_path = '(?:' + '[/?#]' + '(?:' + '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-;]).|' + '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + + // allow `I'm_king` if no pair found + "\\'(?=" + re.src_pseudo_letter + '|[-])|' + + // google has many dots in "google search" links (#66, #81). + // github has ... in commit range links, + // Restrict to + // - english + // - percent-encoded + // - parts of file path + // - params separator + // until more examples found. + '\\.{2,}[a-zA-Z0-9%/&]|' + '\\.(?!' + re.src_ZCc + '|[.]|$)|' + (opts['---'] ? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate + : '\\-+|') + + // allow `,,,` in paths + ',(?!' + re.src_ZCc + '|$)|' + + // allow `;` if not followed by space-like char + ';(?!' + re.src_ZCc + '|$)|' + + // allow `!!!` in paths, but not at the end + '\\!+(?!' + re.src_ZCc + '|[!]|$)|' + '\\?(?!' + re.src_ZCc + '|[?]|$)' + ')+' + '|\\/' + ')?'; + + // Allow anything in markdown spec, forbid quote (") at the first position + // because emails enclosed in quotes are far more common + re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; + re.src_xn = 'xn--[a-z0-9\\-]{1,59}'; + + // More to read about domain names + // http://serverfault.com/questions/638260/ + + re.src_domain_root = + // Allow letters & digits (http://test1) + '(?:' + re.src_xn + '|' + re.src_pseudo_letter + '{1,63}' + ')'; + re.src_domain = '(?:' + re.src_xn + '|' + '(?:' + re.src_pseudo_letter + ')' + '|' + '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' + ')'; + re.src_host = '(?:' + + // Don't need IP check, because digits are already allowed in normal domain names + // src_ip4 + + // '|' + + '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain /* _root */ + ')' + ')'; + re.tpl_host_fuzzy = '(?:' + re.src_ip4 + '|' + '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' + ')'; + re.tpl_host_no_ip_fuzzy = '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))'; + re.src_host_strict = re.src_host + re.src_host_terminator; + re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator; + re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator; + re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator; + re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator; + + // + // Main rules + // + + // Rude test fuzzy links by host, for quick deny + re.tpl_host_fuzzy_test = 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'; + re.tpl_email_fuzzy = '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' + '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; + re.tpl_link_fuzzy = + // Fuzzy link can't be prepended with .:/\- and non punctuation. + // but can start with > (markdown blockquote) + '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; + re.tpl_link_no_ip_fuzzy = + // Fuzzy link can't be prepended with .:/\- and non punctuation. + // but can start with > (markdown blockquote) + '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; + return re; +} + +// +// Helpers +// + +// Merge objects +// +function assign(obj /* from1, from2, from3, ... */) { + const sources = Array.prototype.slice.call(arguments, 1); + sources.forEach(function (source) { + if (!source) { + return; + } + Object.keys(source).forEach(function (key) { + obj[key] = source[key]; + }); + }); + return obj; +} +function _class(obj) { + return Object.prototype.toString.call(obj); +} +function isString(obj) { + return _class(obj) === '[object String]'; +} +function isObject(obj) { + return _class(obj) === '[object Object]'; +} +function isRegExp(obj) { + return _class(obj) === '[object RegExp]'; +} +function isFunction(obj) { + return _class(obj) === '[object Function]'; +} +function escapeRE(str) { + return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); +} + +// + +const defaultOptions = { + fuzzyLink: true, + fuzzyEmail: true, + fuzzyIP: false +}; +function isOptionsObj(obj) { + return Object.keys(obj || {}).reduce(function (acc, k) { + /* eslint-disable-next-line no-prototype-builtins */ + return acc || defaultOptions.hasOwnProperty(k); + }, false); +} +const defaultSchemas = { + 'http:': { + validate: function (text, pos, self) { + const tail = text.slice(pos); + if (!self.re.http) { + // compile lazily, because "host"-containing variables can change on tlds update. + self.re.http = new RegExp('^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'); + } + if (self.re.http.test(tail)) { + return tail.match(self.re.http)[0].length; + } + return 0; + } + }, + 'https:': 'http:', + 'ftp:': 'http:', + '//': { + validate: function (text, pos, self) { + const tail = text.slice(pos); + if (!self.re.no_http) { + // compile lazily, because "host"-containing variables can change on tlds update. + self.re.no_http = new RegExp('^' + self.re.src_auth + + // Don't allow single-level domains, because of false positives like '//test' + // with code comments + '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' + self.re.src_port + self.re.src_host_terminator + self.re.src_path, 'i'); + } + if (self.re.no_http.test(tail)) { + // should not be `://` & `///`, that protects from errors in protocol name + if (pos >= 3 && text[pos - 3] === ':') { + return 0; + } + if (pos >= 3 && text[pos - 3] === '/') { + return 0; + } + return tail.match(self.re.no_http)[0].length; + } + return 0; + } + }, + 'mailto:': { + validate: function (text, pos, self) { + const tail = text.slice(pos); + if (!self.re.mailto) { + self.re.mailto = new RegExp('^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'); + } + if (self.re.mailto.test(tail)) { + return tail.match(self.re.mailto)[0].length; + } + return 0; + } + } +}; + +// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js) +/* eslint-disable-next-line max-len */ +const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'; + +// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead +const tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|'); +function resetScanCache(self) { + self.__index__ = -1; + self.__text_cache__ = ''; +} +function createValidator(re) { + return function (text, pos) { + const tail = text.slice(pos); + if (re.test(tail)) { + return tail.match(re)[0].length; + } + return 0; + }; +} +function createNormalizer() { + return function (match, self) { + self.normalize(match); + }; +} + +// Schemas compiler. Build regexps. +// +function compile(self) { + // Load & clone RE patterns. + const re = self.re = reFactory(self.__opts__); + + // Define dynamic patterns + const tlds = self.__tlds__.slice(); + self.onCompile(); + if (!self.__tlds_replaced__) { + tlds.push(tlds_2ch_src_re); + } + tlds.push(re.src_xn); + re.src_tlds = tlds.join('|'); + function untpl(tpl) { + return tpl.replace('%TLDS%', re.src_tlds); + } + re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i'); + re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i'); + re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i'); + re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i'); + + // + // Compile each schema + // + + const aliases = []; + self.__compiled__ = {}; // Reset compiled data + + function schemaError(name, val) { + throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); + } + Object.keys(self.__schemas__).forEach(function (name) { + const val = self.__schemas__[name]; + + // skip disabled methods + if (val === null) { + return; + } + const compiled = { + validate: null, + link: null + }; + self.__compiled__[name] = compiled; + if (isObject(val)) { + if (isRegExp(val.validate)) { + compiled.validate = createValidator(val.validate); + } else if (isFunction(val.validate)) { + compiled.validate = val.validate; + } else { + schemaError(name, val); + } + if (isFunction(val.normalize)) { + compiled.normalize = val.normalize; + } else if (!val.normalize) { + compiled.normalize = createNormalizer(); + } else { + schemaError(name, val); + } + return; + } + if (isString(val)) { + aliases.push(name); + return; + } + schemaError(name, val); + }); + + // + // Compile postponed aliases + // + + aliases.forEach(function (alias) { + if (!self.__compiled__[self.__schemas__[alias]]) { + // Silently fail on missed schemas to avoid errons on disable. + // schemaError(alias, self.__schemas__[alias]); + return; + } + self.__compiled__[alias].validate = self.__compiled__[self.__schemas__[alias]].validate; + self.__compiled__[alias].normalize = self.__compiled__[self.__schemas__[alias]].normalize; + }); + + // + // Fake record for guessed links + // + self.__compiled__[''] = { + validate: null, + normalize: createNormalizer() + }; + + // + // Build schema condition + // + const slist = Object.keys(self.__compiled__).filter(function (name) { + // Filter disabled & fake schemas + return name.length > 0 && self.__compiled__[name]; + }).map(escapeRE).join('|'); + // (?!_) cause 1.5x slowdown + self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); + self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); + self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i'); + self.re.pretest = RegExp('(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', 'i'); + + // + // Cleanup + // + + resetScanCache(self); +} + +/** + * class Match + * + * Match result. Single element of array, returned by [[LinkifyIt#match]] + **/ +function Match(self, shift) { + const start = self.__index__; + const end = self.__last_index__; + const text = self.__text_cache__.slice(start, end); + + /** + * Match#schema -> String + * + * Prefix (protocol) for matched string. + **/ + this.schema = self.__schema__.toLowerCase(); + /** + * Match#index -> Number + * + * First position of matched string. + **/ + this.index = start + shift; + /** + * Match#lastIndex -> Number + * + * Next position after matched string. + **/ + this.lastIndex = end + shift; + /** + * Match#raw -> String + * + * Matched string. + **/ + this.raw = text; + /** + * Match#text -> String + * + * Notmalized text of matched string. + **/ + this.text = text; + /** + * Match#url -> String + * + * Normalized url of matched string. + **/ + this.url = text; +} +function createMatch(self, shift) { + const match = new Match(self, shift); + self.__compiled__[match.schema].normalize(match, self); + return match; +} + +/** + * class LinkifyIt + **/ + +/** + * new LinkifyIt(schemas, options) + * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) + * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } + * + * Creates new linkifier instance with optional additional schemas. + * Can be called without `new` keyword for convenience. + * + * By default understands: + * + * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links + * - "fuzzy" links and emails (example.com, foo@bar.com). + * + * `schemas` is an object, where each key/value describes protocol/rule: + * + * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` + * for example). `linkify-it` makes shure that prefix is not preceeded with + * alphanumeric char and symbols. Only whitespaces and punctuation allowed. + * - __value__ - rule to check tail after link prefix + * - _String_ - just alias to existing rule + * - _Object_ + * - _validate_ - validator function (should return matched length on success), + * or `RegExp`. + * - _normalize_ - optional function to normalize text & url of matched result + * (for example, for @twitter mentions). + * + * `options`: + * + * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`. + * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts + * like version numbers. Default `false`. + * - __fuzzyEmail__ - recognize emails without `mailto:` prefix. + * + **/ +function LinkifyIt(schemas, options) { + if (!(this instanceof LinkifyIt)) { + return new LinkifyIt(schemas, options); + } + if (!options) { + if (isOptionsObj(schemas)) { + options = schemas; + schemas = {}; + } + } + this.__opts__ = assign({}, defaultOptions, options); + + // Cache last tested result. Used to skip repeating steps on next `match` call. + this.__index__ = -1; + this.__last_index__ = -1; // Next scan position + this.__schema__ = ''; + this.__text_cache__ = ''; + this.__schemas__ = assign({}, defaultSchemas, schemas); + this.__compiled__ = {}; + this.__tlds__ = tlds_default; + this.__tlds_replaced__ = false; + this.re = {}; + compile(this); +} + +/** chainable + * LinkifyIt#add(schema, definition) + * - schema (String): rule name (fixed pattern prefix) + * - definition (String|RegExp|Object): schema definition + * + * Add new rule definition. See constructor description for details. + **/ +LinkifyIt.prototype.add = function add(schema, definition) { + this.__schemas__[schema] = definition; + compile(this); + return this; +}; + +/** chainable + * LinkifyIt#set(options) + * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } + * + * Set recognition options for links without schema. + **/ +LinkifyIt.prototype.set = function set(options) { + this.__opts__ = assign(this.__opts__, options); + return this; +}; + +/** + * LinkifyIt#test(text) -> Boolean + * + * Searches linkifiable pattern and returns `true` on success or `false` on fail. + **/ +LinkifyIt.prototype.test = function test(text) { + // Reset scan cache + this.__text_cache__ = text; + this.__index__ = -1; + if (!text.length) { + return false; + } + let m, ml, me, len, shift, next, re, tld_pos, at_pos; + + // try to scan for link with schema - that's the most simple rule + if (this.re.schema_test.test(text)) { + re = this.re.schema_search; + re.lastIndex = 0; + while ((m = re.exec(text)) !== null) { + len = this.testSchemaAt(text, m[2], re.lastIndex); + if (len) { + this.__schema__ = m[2]; + this.__index__ = m.index + m[1].length; + this.__last_index__ = m.index + m[0].length + len; + break; + } + } + } + if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { + // guess schemaless links + tld_pos = text.search(this.re.host_fuzzy_test); + if (tld_pos >= 0) { + // if tld is located after found link - no need to check fuzzy pattern + if (this.__index__ < 0 || tld_pos < this.__index__) { + if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { + shift = ml.index + ml[1].length; + if (this.__index__ < 0 || shift < this.__index__) { + this.__schema__ = ''; + this.__index__ = shift; + this.__last_index__ = ml.index + ml[0].length; + } + } + } + } + } + if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { + // guess schemaless emails + at_pos = text.indexOf('@'); + if (at_pos >= 0) { + // We can't skip this check, because this cases are possible: + // 192.168.1.1@gmail.com, my.in@example.com + if ((me = text.match(this.re.email_fuzzy)) !== null) { + shift = me.index + me[1].length; + next = me.index + me[0].length; + if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) { + this.__schema__ = 'mailto:'; + this.__index__ = shift; + this.__last_index__ = next; + } + } + } + } + return this.__index__ >= 0; +}; + +/** + * LinkifyIt#pretest(text) -> Boolean + * + * Very quick check, that can give false positives. Returns true if link MAY BE + * can exists. Can be used for speed optimization, when you need to check that + * link NOT exists. + **/ +LinkifyIt.prototype.pretest = function pretest(text) { + return this.re.pretest.test(text); +}; + +/** + * LinkifyIt#testSchemaAt(text, name, position) -> Number + * - text (String): text to scan + * - name (String): rule (schema) name + * - position (Number): text offset to check from + * + * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly + * at given position. Returns length of found pattern (0 on fail). + **/ +LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) { + // If not supported schema check requested - terminate + if (!this.__compiled__[schema.toLowerCase()]) { + return 0; + } + return this.__compiled__[schema.toLowerCase()].validate(text, pos, this); +}; + +/** + * LinkifyIt#match(text) -> Array|null + * + * Returns array of found link descriptions or `null` on fail. We strongly + * recommend to use [[LinkifyIt#test]] first, for best speed. + * + * ##### Result match description + * + * - __schema__ - link schema, can be empty for fuzzy links, or `//` for + * protocol-neutral links. + * - __index__ - offset of matched text + * - __lastIndex__ - index of next char after mathch end + * - __raw__ - matched text + * - __text__ - normalized text + * - __url__ - link, generated from matched text + **/ +LinkifyIt.prototype.match = function match(text) { + const result = []; + let shift = 0; + + // Try to take previous element from cache, if .test() called before + if (this.__index__ >= 0 && this.__text_cache__ === text) { + result.push(createMatch(this, shift)); + shift = this.__last_index__; + } + + // Cut head if cache was used + let tail = shift ? text.slice(shift) : text; + + // Scan string until end reached + while (this.test(tail)) { + result.push(createMatch(this, shift)); + tail = tail.slice(this.__last_index__); + shift += this.__last_index__; + } + if (result.length) { + return result; + } + return null; +}; + +/** + * LinkifyIt#matchAtStart(text) -> Match|null + * + * Returns fully-formed (not fuzzy) link if it starts at the beginning + * of the string, and null otherwise. + **/ +LinkifyIt.prototype.matchAtStart = function matchAtStart(text) { + // Reset scan cache + this.__text_cache__ = text; + this.__index__ = -1; + if (!text.length) return null; + const m = this.re.schema_at_start.exec(text); + if (!m) return null; + const len = this.testSchemaAt(text, m[2], m[0].length); + if (!len) return null; + this.__schema__ = m[2]; + this.__index__ = m.index + m[1].length; + this.__last_index__ = m.index + m[0].length + len; + return createMatch(this, 0); +}; + +/** chainable + * LinkifyIt#tlds(list [, keepOld]) -> this + * - list (Array): list of tlds + * - keepOld (Boolean): merge with current list if `true` (`false` by default) + * + * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) + * to avoid false positives. By default this algorythm used: + * + * - hostname with any 2-letter root zones are ok. + * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф + * are ok. + * - encoded (`xn--...`) root zones are ok. + * + * If list is replaced, then exact match for 2-chars root zones will be checked. + **/ +LinkifyIt.prototype.tlds = function tlds(list, keepOld) { + list = Array.isArray(list) ? list : [list]; + if (!keepOld) { + this.__tlds__ = list.slice(); + this.__tlds_replaced__ = true; + compile(this); + return this; + } + this.__tlds__ = this.__tlds__.concat(list).sort().filter(function (el, idx, arr) { + return el !== arr[idx - 1]; + }).reverse(); + compile(this); + return this; +}; + +/** + * LinkifyIt#normalize(match) + * + * Default normalizer (if schema does not define it's own). + **/ +LinkifyIt.prototype.normalize = function normalize(match) { + // Do minimal possible changes by default. Need to collect feedback prior + // to move forward https://github.com/markdown-it/linkify-it/issues/1 + + if (!match.schema) { + match.url = 'http://' + match.url; + } + if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { + match.url = 'mailto:' + match.url; + } +}; + +/** + * LinkifyIt#onCompile() + * + * Override to modify basic RegExp-s. + **/ +LinkifyIt.prototype.onCompile = function onCompile() {}; +module.exports = LinkifyIt; + +/***/ }), + +/***/ "../node_modules/markdown-it/dist/index.cjs.js": +/*!*****************************************************!*\ + !*** ../node_modules/markdown-it/dist/index.cjs.js ***! + \*****************************************************/ +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + + + +var mdurl = __webpack_require__(/*! mdurl */ "../node_modules/mdurl/build/index.cjs.js"); +var ucmicro = __webpack_require__(/*! uc.micro */ "../node_modules/uc.micro/build/index.cjs.js"); +var entities = __webpack_require__(/*! entities */ "../../../node_modules/entities/lib/index.js"); +var LinkifyIt = __webpack_require__(/*! linkify-it */ "../node_modules/linkify-it/build/index.cjs.js"); +var punycode = __webpack_require__(/*! punycode.js */ "../../../node_modules/punycode.js/punycode.es6.js"); +function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) { + Object.keys(e).forEach(function (k) { + if (k !== 'default') { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { + return e[k]; + } + }); + } + }); + } + n.default = e; + return Object.freeze(n); +} +var mdurl__namespace = /*#__PURE__*/_interopNamespaceDefault(mdurl); +var ucmicro__namespace = /*#__PURE__*/_interopNamespaceDefault(ucmicro); + +// Utilities +// + +function _class(obj) { + return Object.prototype.toString.call(obj); +} +function isString(obj) { + return _class(obj) === '[object String]'; +} +const _hasOwnProperty = Object.prototype.hasOwnProperty; +function has(object, key) { + return _hasOwnProperty.call(object, key); +} + +// Merge objects +// +function assign(obj /* from1, from2, from3, ... */) { + const sources = Array.prototype.slice.call(arguments, 1); + sources.forEach(function (source) { + if (!source) { + return; + } + if (typeof source !== 'object') { + throw new TypeError(source + 'must be object'); + } + Object.keys(source).forEach(function (key) { + obj[key] = source[key]; + }); + }); + return obj; +} + +// Remove element from array and put another array at those position. +// Useful for some operations with tokens +function arrayReplaceAt(src, pos, newElements) { + return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); +} +function isValidEntityCode(c) { + /* eslint no-bitwise:0 */ + // broken sequence + if (c >= 0xD800 && c <= 0xDFFF) { + return false; + } + // never used + if (c >= 0xFDD0 && c <= 0xFDEF) { + return false; + } + if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { + return false; + } + // control codes + if (c >= 0x00 && c <= 0x08) { + return false; + } + if (c === 0x0B) { + return false; + } + if (c >= 0x0E && c <= 0x1F) { + return false; + } + if (c >= 0x7F && c <= 0x9F) { + return false; + } + // out of range + if (c > 0x10FFFF) { + return false; + } + return true; +} +function fromCodePoint(c) { + /* eslint no-bitwise:0 */ + if (c > 0xffff) { + c -= 0x10000; + const surrogate1 = 0xd800 + (c >> 10); + const surrogate2 = 0xdc00 + (c & 0x3ff); + return String.fromCharCode(surrogate1, surrogate2); + } + return String.fromCharCode(c); +} +const UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g; +const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; +const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi'); +const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i; +function replaceEntityPattern(match, name) { + if (name.charCodeAt(0) === 0x23 /* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { + const code = name[1].toLowerCase() === 'x' ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10); + if (isValidEntityCode(code)) { + return fromCodePoint(code); + } + return match; + } + const decoded = entities.decodeHTML(match); + if (decoded !== match) { + return decoded; + } + return match; +} + +/* function replaceEntities(str) { + if (str.indexOf('&') < 0) { return str; } + + return str.replace(ENTITY_RE, replaceEntityPattern); +} */ + +function unescapeMd(str) { + if (str.indexOf('\\') < 0) { + return str; + } + return str.replace(UNESCAPE_MD_RE, '$1'); +} +function unescapeAll(str) { + if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { + return str; + } + return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) { + if (escaped) { + return escaped; + } + return replaceEntityPattern(match, entity); + }); +} +const HTML_ESCAPE_TEST_RE = /[&<>"]/; +const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; +const HTML_REPLACEMENTS = { + '&': '&', + '<': '<', + '>': '>', + '"': '"' +}; +function replaceUnsafeChar(ch) { + return HTML_REPLACEMENTS[ch]; +} +function escapeHtml(str) { + if (HTML_ESCAPE_TEST_RE.test(str)) { + return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); + } + return str; +} +const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; +function escapeRE(str) { + return str.replace(REGEXP_ESCAPE_RE, '\\$&'); +} +function isSpace(code) { + switch (code) { + case 0x09: + case 0x20: + return true; + } + return false; +} + +// Zs (unicode class) || [\t\f\v\r\n] +function isWhiteSpace(code) { + if (code >= 0x2000 && code <= 0x200A) { + return true; + } + switch (code) { + case 0x09: // \t + case 0x0A: // \n + case 0x0B: // \v + case 0x0C: // \f + case 0x0D: // \r + case 0x20: + case 0xA0: + case 0x1680: + case 0x202F: + case 0x205F: + case 0x3000: + return true; + } + return false; +} + +/* eslint-disable max-len */ + +// Currently without astral characters support. +function isPunctChar(ch) { + return ucmicro__namespace.P.test(ch) || ucmicro__namespace.S.test(ch); +} + +// Markdown ASCII punctuation characters. +// +// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ +// http://spec.commonmark.org/0.15/#ascii-punctuation-character +// +// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. +// +function isMdAsciiPunct(ch) { + switch (ch) { + case 0x21 /* ! */: + case 0x22 /* " */: + case 0x23 /* # */: + case 0x24 /* $ */: + case 0x25 /* % */: + case 0x26 /* & */: + case 0x27 /* ' */: + case 0x28 /* ( */: + case 0x29 /* ) */: + case 0x2A /* * */: + case 0x2B /* + */: + case 0x2C /* , */: + case 0x2D /* - */: + case 0x2E /* . */: + case 0x2F /* / */: + case 0x3A /* : */: + case 0x3B /* ; */: + case 0x3C /* < */: + case 0x3D /* = */: + case 0x3E /* > */: + case 0x3F /* ? */: + case 0x40 /* @ */: + case 0x5B /* [ */: + case 0x5C /* \ */: + case 0x5D /* ] */: + case 0x5E /* ^ */: + case 0x5F /* _ */: + case 0x60 /* ` */: + case 0x7B /* { */: + case 0x7C /* | */: + case 0x7D /* } */: + case 0x7E /* ~ */: + return true; + default: + return false; + } +} + +// Hepler to unify [reference labels]. +// +function normalizeReference(str) { + // Trim and collapse whitespace + // + str = str.trim().replace(/\s+/g, ' '); + + // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug + // fixed in v12 (couldn't find any details). + // + // So treat this one as a special case + // (remove this when node v10 is no longer supported). + // + if ('ẞ'.toLowerCase() === 'Ṿ') { + str = str.replace(/ẞ/g, 'ß'); + } + + // .toLowerCase().toUpperCase() should get rid of all differences + // between letter variants. + // + // Simple .toLowerCase() doesn't normalize 125 code points correctly, + // and .toUpperCase doesn't normalize 6 of them (list of exceptions: + // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently + // uppercased versions). + // + // Here's an example showing how it happens. Lets take greek letter omega: + // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ) + // + // Unicode entries: + // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8; + // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 + // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 + // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8; + // + // Case-insensitive comparison should treat all of them as equivalent. + // + // But .toLowerCase() doesn't change ϑ (it's already lowercase), + // and .toUpperCase() doesn't change ϴ (already uppercase). + // + // Applying first lower then upper case normalizes any character: + // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398' + // + // Note: this is equivalent to unicode case folding; unicode normalization + // is a different step that is not required here. + // + // Final result should be uppercased, because it's later stored in an object + // (this avoid a conflict with Object.prototype members, + // most notably, `__proto__`) + // + return str.toLowerCase().toUpperCase(); +} + +// Re-export libraries commonly used in both markdown-it and its plugins, +// so plugins won't have to depend on them explicitly, which reduces their +// bundled size (e.g. a browser build). +// +const lib = { + mdurl: mdurl__namespace, + ucmicro: ucmicro__namespace +}; +var utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + arrayReplaceAt: arrayReplaceAt, + assign: assign, + escapeHtml: escapeHtml, + escapeRE: escapeRE, + fromCodePoint: fromCodePoint, + has: has, + isMdAsciiPunct: isMdAsciiPunct, + isPunctChar: isPunctChar, + isSpace: isSpace, + isString: isString, + isValidEntityCode: isValidEntityCode, + isWhiteSpace: isWhiteSpace, + lib: lib, + normalizeReference: normalizeReference, + unescapeAll: unescapeAll, + unescapeMd: unescapeMd +}); + +// Parse link label +// +// this function assumes that first character ("[") already matches; +// returns the end of the label +// + +function parseLinkLabel(state, start, disableNested) { + let level, found, marker, prevPos; + const max = state.posMax; + const oldPos = state.pos; + state.pos = start + 1; + level = 1; + while (state.pos < max) { + marker = state.src.charCodeAt(state.pos); + if (marker === 0x5D /* ] */) { + level--; + if (level === 0) { + found = true; + break; + } + } + prevPos = state.pos; + state.md.inline.skipToken(state); + if (marker === 0x5B /* [ */) { + if (prevPos === state.pos - 1) { + // increase level if we find text `[`, which is not a part of any token + level++; + } else if (disableNested) { + state.pos = oldPos; + return -1; + } + } + } + let labelEnd = -1; + if (found) { + labelEnd = state.pos; + } + + // restore old state + state.pos = oldPos; + return labelEnd; +} + +// Parse link destination +// + +function parseLinkDestination(str, start, max) { + let code; + let pos = start; + const result = { + ok: false, + pos: 0, + str: '' + }; + if (str.charCodeAt(pos) === 0x3C /* < */) { + pos++; + while (pos < max) { + code = str.charCodeAt(pos); + if (code === 0x0A /* \n */) { + return result; + } + if (code === 0x3C /* < */) { + return result; + } + if (code === 0x3E /* > */) { + result.pos = pos + 1; + result.str = unescapeAll(str.slice(start + 1, pos)); + result.ok = true; + return result; + } + if (code === 0x5C /* \ */ && pos + 1 < max) { + pos += 2; + continue; + } + pos++; + } + + // no closing '>' + return result; + } + + // this should be ... } else { ... branch + + let level = 0; + while (pos < max) { + code = str.charCodeAt(pos); + if (code === 0x20) { + break; + } + + // ascii control characters + if (code < 0x20 || code === 0x7F) { + break; + } + if (code === 0x5C /* \ */ && pos + 1 < max) { + if (str.charCodeAt(pos + 1) === 0x20) { + break; + } + pos += 2; + continue; + } + if (code === 0x28 /* ( */) { + level++; + if (level > 32) { + return result; + } + } + if (code === 0x29 /* ) */) { + if (level === 0) { + break; + } + level--; + } + pos++; + } + if (start === pos) { + return result; + } + if (level !== 0) { + return result; + } + result.str = unescapeAll(str.slice(start, pos)); + result.pos = pos; + result.ok = true; + return result; +} + +// Parse link title +// + +// Parse link title within `str` in [start, max] range, +// or continue previous parsing if `prev_state` is defined (equal to result of last execution). +// +function parseLinkTitle(str, start, max, prev_state) { + let code; + let pos = start; + const state = { + // if `true`, this is a valid link title + ok: false, + // if `true`, this link can be continued on the next line + can_continue: false, + // if `ok`, it's the position of the first character after the closing marker + pos: 0, + // if `ok`, it's the unescaped title + str: '', + // expected closing marker character code + marker: 0 + }; + if (prev_state) { + // this is a continuation of a previous parseLinkTitle call on the next line, + // used in reference links only + state.str = prev_state.str; + state.marker = prev_state.marker; + } else { + if (pos >= max) { + return state; + } + let marker = str.charCodeAt(pos); + if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { + return state; + } + start++; + pos++; + + // if opening marker is "(", switch it to closing marker ")" + if (marker === 0x28) { + marker = 0x29; + } + state.marker = marker; + } + while (pos < max) { + code = str.charCodeAt(pos); + if (code === state.marker) { + state.pos = pos + 1; + state.str += unescapeAll(str.slice(start, pos)); + state.ok = true; + return state; + } else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) { + return state; + } else if (code === 0x5C /* \ */ && pos + 1 < max) { + pos++; + } + pos++; + } + + // no closing marker found, but this link title may continue on the next line (for references) + state.can_continue = true; + state.str += unescapeAll(str.slice(start, pos)); + return state; +} + +// Just a shortcut for bulk export + +var helpers = /*#__PURE__*/Object.freeze({ + __proto__: null, + parseLinkDestination: parseLinkDestination, + parseLinkLabel: parseLinkLabel, + parseLinkTitle: parseLinkTitle +}); + +/** + * class Renderer + * + * Generates HTML from parsed token stream. Each instance has independent + * copy of rules. Those can be rewritten with ease. Also, you can add new + * rules if you create plugin and adds new token types. + **/ + +const default_rules = {}; +default_rules.code_inline = function (tokens, idx, options, env, slf) { + const token = tokens[idx]; + return '' + escapeHtml(token.content) + ''; +}; +default_rules.code_block = function (tokens, idx, options, env, slf) { + const token = tokens[idx]; + return '' + escapeHtml(tokens[idx].content) + '\n'; +}; +default_rules.fence = function (tokens, idx, options, env, slf) { + const token = tokens[idx]; + const info = token.info ? unescapeAll(token.info).trim() : ''; + let langName = ''; + let langAttrs = ''; + if (info) { + const arr = info.split(/(\s+)/g); + langName = arr[0]; + langAttrs = arr.slice(2).join(''); + } + let highlighted; + if (options.highlight) { + highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content); + } else { + highlighted = escapeHtml(token.content); + } + if (highlighted.indexOf('${highlighted}\n`; + } + return `
${highlighted}
\n`; +}; +default_rules.image = function (tokens, idx, options, env, slf) { + const token = tokens[idx]; + + // "alt" attr MUST be set, even if empty. Because it's mandatory and + // should be placed on proper position for tests. + // + // Replace content with actual value + + token.attrs[token.attrIndex('alt')][1] = slf.renderInlineAsText(token.children, options, env); + return slf.renderToken(tokens, idx, options); +}; +default_rules.hardbreak = function (tokens, idx, options /*, env */) { + return options.xhtmlOut ? '
\n' : '
\n'; +}; +default_rules.softbreak = function (tokens, idx, options /*, env */) { + return options.breaks ? options.xhtmlOut ? '
\n' : '
\n' : '\n'; +}; +default_rules.text = function (tokens, idx /*, options, env */) { + return escapeHtml(tokens[idx].content); +}; +default_rules.html_block = function (tokens, idx /*, options, env */) { + return tokens[idx].content; +}; +default_rules.html_inline = function (tokens, idx /*, options, env */) { + return tokens[idx].content; +}; + +/** + * new Renderer() + * + * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults. + **/ +function Renderer() { + /** + * Renderer#rules -> Object + * + * Contains render rules for tokens. Can be updated and extended. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.renderer.rules.strong_open = function () { return ''; }; + * md.renderer.rules.strong_close = function () { return ''; }; + * + * var result = md.renderInline(...); + * ``` + * + * Each rule is called as independent static function with fixed signature: + * + * ```javascript + * function my_token_render(tokens, idx, options, env, renderer) { + * // ... + * return renderedHTML; + * } + * ``` + * + * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs) + * for more details and examples. + **/ + this.rules = assign({}, default_rules); +} + +/** + * Renderer.renderAttrs(token) -> String + * + * Render token attributes to string. + **/ +Renderer.prototype.renderAttrs = function renderAttrs(token) { + let i, l, result; + if (!token.attrs) { + return ''; + } + result = ''; + for (i = 0, l = token.attrs.length; i < l; i++) { + result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"'; + } + return result; +}; + +/** + * Renderer.renderToken(tokens, idx, options) -> String + * - tokens (Array): list of tokens + * - idx (Numbed): token index to render + * - options (Object): params of parser instance + * + * Default token renderer. Can be overriden by custom function + * in [[Renderer#rules]]. + **/ +Renderer.prototype.renderToken = function renderToken(tokens, idx, options) { + const token = tokens[idx]; + let result = ''; + + // Tight list paragraphs + if (token.hidden) { + return ''; + } + + // Insert a newline between hidden paragraph and subsequent opening + // block-level tag. + // + // For example, here we should insert a newline before blockquote: + // - a + // > + // + if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) { + result += '\n'; + } + + // Add token name, e.g. ``. + // + needLf = false; + } + } + } + } + result += needLf ? '>\n' : '>'; + return result; +}; + +/** + * Renderer.renderInline(tokens, options, env) -> String + * - tokens (Array): list on block tokens to render + * - options (Object): params of parser instance + * - env (Object): additional data from parsed input (references, for example) + * + * The same as [[Renderer.render]], but for single token of `inline` type. + **/ +Renderer.prototype.renderInline = function (tokens, options, env) { + let result = ''; + const rules = this.rules; + for (let i = 0, len = tokens.length; i < len; i++) { + const type = tokens[i].type; + if (typeof rules[type] !== 'undefined') { + result += rules[type](tokens, i, options, env, this); + } else { + result += this.renderToken(tokens, i, options); + } + } + return result; +}; + +/** internal + * Renderer.renderInlineAsText(tokens, options, env) -> String + * - tokens (Array): list on block tokens to render + * - options (Object): params of parser instance + * - env (Object): additional data from parsed input (references, for example) + * + * Special kludge for image `alt` attributes to conform CommonMark spec. + * Don't try to use it! Spec requires to show `alt` content with stripped markup, + * instead of simple escaping. + **/ +Renderer.prototype.renderInlineAsText = function (tokens, options, env) { + let result = ''; + for (let i = 0, len = tokens.length; i < len; i++) { + switch (tokens[i].type) { + case 'text': + result += tokens[i].content; + break; + case 'image': + result += this.renderInlineAsText(tokens[i].children, options, env); + break; + case 'html_inline': + case 'html_block': + result += tokens[i].content; + break; + case 'softbreak': + case 'hardbreak': + result += '\n'; + break; + // all other tokens are skipped + } + } + + return result; +}; + +/** + * Renderer.render(tokens, options, env) -> String + * - tokens (Array): list on block tokens to render + * - options (Object): params of parser instance + * - env (Object): additional data from parsed input (references, for example) + * + * Takes token stream and generates HTML. Probably, you will never need to call + * this method directly. + **/ +Renderer.prototype.render = function (tokens, options, env) { + let result = ''; + const rules = this.rules; + for (let i = 0, len = tokens.length; i < len; i++) { + const type = tokens[i].type; + if (type === 'inline') { + result += this.renderInline(tokens[i].children, options, env); + } else if (typeof rules[type] !== 'undefined') { + result += rules[type](tokens, i, options, env, this); + } else { + result += this.renderToken(tokens, i, options, env); + } + } + return result; +}; + +/** + * class Ruler + * + * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and + * [[MarkdownIt#inline]] to manage sequences of functions (rules): + * + * - keep rules in defined order + * - assign the name to each rule + * - enable/disable rules + * - add/replace rules + * - allow assign rules to additional named chains (in the same) + * - cacheing lists of active rules + * + * You will not need use this class directly until write plugins. For simple + * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and + * [[MarkdownIt.use]]. + **/ + +/** + * new Ruler() + **/ +function Ruler() { + // List of added rules. Each element is: + // + // { + // name: XXX, + // enabled: Boolean, + // fn: Function(), + // alt: [ name2, name3 ] + // } + // + this.__rules__ = []; + + // Cached rule chains. + // + // First level - chain name, '' for default. + // Second level - diginal anchor for fast filtering by charcodes. + // + this.__cache__ = null; +} + +// Helper methods, should not be used directly + +// Find rule index by name +// +Ruler.prototype.__find__ = function (name) { + for (let i = 0; i < this.__rules__.length; i++) { + if (this.__rules__[i].name === name) { + return i; + } + } + return -1; +}; + +// Build rules lookup cache +// +Ruler.prototype.__compile__ = function () { + const self = this; + const chains = ['']; + + // collect unique names + self.__rules__.forEach(function (rule) { + if (!rule.enabled) { + return; + } + rule.alt.forEach(function (altName) { + if (chains.indexOf(altName) < 0) { + chains.push(altName); + } + }); + }); + self.__cache__ = {}; + chains.forEach(function (chain) { + self.__cache__[chain] = []; + self.__rules__.forEach(function (rule) { + if (!rule.enabled) { + return; + } + if (chain && rule.alt.indexOf(chain) < 0) { + return; + } + self.__cache__[chain].push(rule.fn); + }); + }); +}; + +/** + * Ruler.at(name, fn [, options]) + * - name (String): rule name to replace. + * - fn (Function): new rule function. + * - options (Object): new rule options (not mandatory). + * + * Replace rule by name with new function & options. Throws error if name not + * found. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * Replace existing typographer replacement rule with new one: + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.core.ruler.at('replacements', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.at = function (name, fn, options) { + const index = this.__find__(name); + const opt = options || {}; + if (index === -1) { + throw new Error('Parser rule not found: ' + name); + } + this.__rules__[index].fn = fn; + this.__rules__[index].alt = opt.alt || []; + this.__cache__ = null; +}; + +/** + * Ruler.before(beforeName, ruleName, fn [, options]) + * - beforeName (String): new rule will be added before this one. + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Add new rule to chain before one with given name. See also + * [[Ruler.after]], [[Ruler.push]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.block.ruler.before('paragraph', 'my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.before = function (beforeName, ruleName, fn, options) { + const index = this.__find__(beforeName); + const opt = options || {}; + if (index === -1) { + throw new Error('Parser rule not found: ' + beforeName); + } + this.__rules__.splice(index, 0, { + name: ruleName, + enabled: true, + fn, + alt: opt.alt || [] + }); + this.__cache__ = null; +}; + +/** + * Ruler.after(afterName, ruleName, fn [, options]) + * - afterName (String): new rule will be added after this one. + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Add new rule to chain after one with given name. See also + * [[Ruler.before]], [[Ruler.push]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.inline.ruler.after('text', 'my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.after = function (afterName, ruleName, fn, options) { + const index = this.__find__(afterName); + const opt = options || {}; + if (index === -1) { + throw new Error('Parser rule not found: ' + afterName); + } + this.__rules__.splice(index + 1, 0, { + name: ruleName, + enabled: true, + fn, + alt: opt.alt || [] + }); + this.__cache__ = null; +}; + +/** + * Ruler.push(ruleName, fn [, options]) + * - ruleName (String): name of added rule. + * - fn (Function): rule function. + * - options (Object): rule options (not mandatory). + * + * Push new rule to the end of chain. See also + * [[Ruler.before]], [[Ruler.after]]. + * + * ##### Options: + * + * - __alt__ - array with names of "alternate" chains. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * md.core.ruler.push('my_rule', function replace(state) { + * //... + * }); + * ``` + **/ +Ruler.prototype.push = function (ruleName, fn, options) { + const opt = options || {}; + this.__rules__.push({ + name: ruleName, + enabled: true, + fn, + alt: opt.alt || [] + }); + this.__cache__ = null; +}; + +/** + * Ruler.enable(list [, ignoreInvalid]) -> Array + * - list (String|Array): list of rule names to enable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable rules with given names. If any rule name not found - throw Error. + * Errors can be disabled by second param. + * + * Returns list of found rule names (if no exception happened). + * + * See also [[Ruler.disable]], [[Ruler.enableOnly]]. + **/ +Ruler.prototype.enable = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + const result = []; + + // Search by name and enable + list.forEach(function (name) { + const idx = this.__find__(name); + if (idx < 0) { + if (ignoreInvalid) { + return; + } + throw new Error('Rules manager: invalid rule name ' + name); + } + this.__rules__[idx].enabled = true; + result.push(name); + }, this); + this.__cache__ = null; + return result; +}; + +/** + * Ruler.enableOnly(list [, ignoreInvalid]) + * - list (String|Array): list of rule names to enable (whitelist). + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable rules with given names, and disable everything else. If any rule name + * not found - throw Error. Errors can be disabled by second param. + * + * See also [[Ruler.disable]], [[Ruler.enable]]. + **/ +Ruler.prototype.enableOnly = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + this.__rules__.forEach(function (rule) { + rule.enabled = false; + }); + this.enable(list, ignoreInvalid); +}; + +/** + * Ruler.disable(list [, ignoreInvalid]) -> Array + * - list (String|Array): list of rule names to disable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Disable rules with given names. If any rule name not found - throw Error. + * Errors can be disabled by second param. + * + * Returns list of found rule names (if no exception happened). + * + * See also [[Ruler.enable]], [[Ruler.enableOnly]]. + **/ +Ruler.prototype.disable = function (list, ignoreInvalid) { + if (!Array.isArray(list)) { + list = [list]; + } + const result = []; + + // Search by name and disable + list.forEach(function (name) { + const idx = this.__find__(name); + if (idx < 0) { + if (ignoreInvalid) { + return; + } + throw new Error('Rules manager: invalid rule name ' + name); + } + this.__rules__[idx].enabled = false; + result.push(name); + }, this); + this.__cache__ = null; + return result; +}; + +/** + * Ruler.getRules(chainName) -> Array + * + * Return array of active functions (rules) for given chain name. It analyzes + * rules configuration, compiles caches if not exists and returns result. + * + * Default chain name is `''` (empty string). It can't be skipped. That's + * done intentionally, to keep signature monomorphic for high speed. + **/ +Ruler.prototype.getRules = function (chainName) { + if (this.__cache__ === null) { + this.__compile__(); + } + + // Chain can be empty, if rules disabled. But we still have to return Array. + return this.__cache__[chainName] || []; +}; + +// Token class + +/** + * class Token + **/ + +/** + * new Token(type, tag, nesting) + * + * Create new token and fill passed properties. + **/ +function Token(type, tag, nesting) { + /** + * Token#type -> String + * + * Type of the token (string, e.g. "paragraph_open") + **/ + this.type = type; + + /** + * Token#tag -> String + * + * html tag name, e.g. "p" + **/ + this.tag = tag; + + /** + * Token#attrs -> Array + * + * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` + **/ + this.attrs = null; + + /** + * Token#map -> Array + * + * Source map info. Format: `[ line_begin, line_end ]` + **/ + this.map = null; + + /** + * Token#nesting -> Number + * + * Level change (number in {-1, 0, 1} set), where: + * + * - `1` means the tag is opening + * - `0` means the tag is self-closing + * - `-1` means the tag is closing + **/ + this.nesting = nesting; + + /** + * Token#level -> Number + * + * nesting level, the same as `state.level` + **/ + this.level = 0; + + /** + * Token#children -> Array + * + * An array of child nodes (inline and img tokens) + **/ + this.children = null; + + /** + * Token#content -> String + * + * In a case of self-closing tag (code, html, fence, etc.), + * it has contents of this tag. + **/ + this.content = ''; + + /** + * Token#markup -> String + * + * '*' or '_' for emphasis, fence string for fence, etc. + **/ + this.markup = ''; + + /** + * Token#info -> String + * + * Additional information: + * + * - Info string for "fence" tokens + * - The value "auto" for autolink "link_open" and "link_close" tokens + * - The string value of the item marker for ordered-list "list_item_open" tokens + **/ + this.info = ''; + + /** + * Token#meta -> Object + * + * A place for plugins to store an arbitrary data + **/ + this.meta = null; + + /** + * Token#block -> Boolean + * + * True for block-level tokens, false for inline tokens. + * Used in renderer to calculate line breaks + **/ + this.block = false; + + /** + * Token#hidden -> Boolean + * + * If it's true, ignore this element when rendering. Used for tight lists + * to hide paragraphs. + **/ + this.hidden = false; +} + +/** + * Token.attrIndex(name) -> Number + * + * Search attribute index by name. + **/ +Token.prototype.attrIndex = function attrIndex(name) { + if (!this.attrs) { + return -1; + } + const attrs = this.attrs; + for (let i = 0, len = attrs.length; i < len; i++) { + if (attrs[i][0] === name) { + return i; + } + } + return -1; +}; + +/** + * Token.attrPush(attrData) + * + * Add `[ name, value ]` attribute to list. Init attrs if necessary + **/ +Token.prototype.attrPush = function attrPush(attrData) { + if (this.attrs) { + this.attrs.push(attrData); + } else { + this.attrs = [attrData]; + } +}; + +/** + * Token.attrSet(name, value) + * + * Set `name` attribute to `value`. Override old value if exists. + **/ +Token.prototype.attrSet = function attrSet(name, value) { + const idx = this.attrIndex(name); + const attrData = [name, value]; + if (idx < 0) { + this.attrPush(attrData); + } else { + this.attrs[idx] = attrData; + } +}; + +/** + * Token.attrGet(name) + * + * Get the value of attribute `name`, or null if it does not exist. + **/ +Token.prototype.attrGet = function attrGet(name) { + const idx = this.attrIndex(name); + let value = null; + if (idx >= 0) { + value = this.attrs[idx][1]; + } + return value; +}; + +/** + * Token.attrJoin(name, value) + * + * Join value to existing attribute via space. Or create new attribute if not + * exists. Useful to operate with token classes. + **/ +Token.prototype.attrJoin = function attrJoin(name, value) { + const idx = this.attrIndex(name); + if (idx < 0) { + this.attrPush([name, value]); + } else { + this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value; + } +}; + +// Core state object +// + +function StateCore(src, md, env) { + this.src = src; + this.env = env; + this.tokens = []; + this.inlineMode = false; + this.md = md; // link to parser instance +} + +// re-export Token class to use in core rules +StateCore.prototype.Token = Token; + +// Normalize input string + +// https://spec.commonmark.org/0.29/#line-ending +const NEWLINES_RE = /\r\n?|\n/g; +const NULL_RE = /\0/g; +function normalize(state) { + let str; + + // Normalize newlines + str = state.src.replace(NEWLINES_RE, '\n'); + + // Replace NULL characters + str = str.replace(NULL_RE, '\uFFFD'); + state.src = str; +} +function block(state) { + let token; + if (state.inlineMode) { + token = new state.Token('inline', '', 0); + token.content = state.src; + token.map = [0, 1]; + token.children = []; + state.tokens.push(token); + } else { + state.md.block.parse(state.src, state.md, state.env, state.tokens); + } +} +function inline(state) { + const tokens = state.tokens; + + // Parse inlines + for (let i = 0, l = tokens.length; i < l; i++) { + const tok = tokens[i]; + if (tok.type === 'inline') { + state.md.inline.parse(tok.content, state.md, state.env, tok.children); + } + } +} + +// Replace link-like texts with link nodes. +// +// Currently restricted by `md.validateLink()` to http/https/ftp +// + +function isLinkOpen$1(str) { + return /^\s]/i.test(str); +} +function isLinkClose$1(str) { + return /^<\/a\s*>/i.test(str); +} +function linkify$1(state) { + const blockTokens = state.tokens; + if (!state.md.options.linkify) { + return; + } + for (let j = 0, l = blockTokens.length; j < l; j++) { + if (blockTokens[j].type !== 'inline' || !state.md.linkify.pretest(blockTokens[j].content)) { + continue; + } + let tokens = blockTokens[j].children; + let htmlLinkLevel = 0; + + // We scan from the end, to keep position when new tags added. + // Use reversed logic in links start/end match + for (let i = tokens.length - 1; i >= 0; i--) { + const currentToken = tokens[i]; + + // Skip content of markdown links + if (currentToken.type === 'link_close') { + i--; + while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') { + i--; + } + continue; + } + + // Skip content of html tag links + if (currentToken.type === 'html_inline') { + if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) { + htmlLinkLevel--; + } + if (isLinkClose$1(currentToken.content)) { + htmlLinkLevel++; + } + } + if (htmlLinkLevel > 0) { + continue; + } + if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) { + const text = currentToken.content; + let links = state.md.linkify.match(text); + + // Now split string to nodes + const nodes = []; + let level = currentToken.level; + let lastPos = 0; + + // forbid escape sequence at the start of the string, + // this avoids http\://example.com/ from being linkified as + // http://example.com/ + if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === 'text_special') { + links = links.slice(1); + } + for (let ln = 0; ln < links.length; ln++) { + const url = links[ln].url; + const fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) { + continue; + } + let urlText = links[ln].text; + + // Linkifier might send raw hostnames like "example.com", where url + // starts with domain name. So we prepend http:// in those cases, + // and remove it afterwards. + // + if (!links[ln].schema) { + urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, ''); + } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) { + urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, ''); + } else { + urlText = state.md.normalizeLinkText(urlText); + } + const pos = links[ln].index; + if (pos > lastPos) { + const token = new state.Token('text', '', 0); + token.content = text.slice(lastPos, pos); + token.level = level; + nodes.push(token); + } + const token_o = new state.Token('link_open', 'a', 1); + token_o.attrs = [['href', fullUrl]]; + token_o.level = level++; + token_o.markup = 'linkify'; + token_o.info = 'auto'; + nodes.push(token_o); + const token_t = new state.Token('text', '', 0); + token_t.content = urlText; + token_t.level = level; + nodes.push(token_t); + const token_c = new state.Token('link_close', 'a', -1); + token_c.level = --level; + token_c.markup = 'linkify'; + token_c.info = 'auto'; + nodes.push(token_c); + lastPos = links[ln].lastIndex; + } + if (lastPos < text.length) { + const token = new state.Token('text', '', 0); + token.content = text.slice(lastPos); + token.level = level; + nodes.push(token); + } + + // replace current node + blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes); + } + } + } +} + +// Simple typographic replacements +// +// (c) (C) → © +// (tm) (TM) → ™ +// (r) (R) → ® +// +- → ± +// ... → … (also ?.... → ?.., !.... → !..) +// ???????? → ???, !!!!! → !!!, `,,` → `,` +// -- → –, --- → — +// + +// TODO: +// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾ +// - multiplications 2 x 4 -> 2 × 4 + +const RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/; + +// Workaround for phantomjs - need regex without /g flag, +// or root check will fail every second time +const SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i; +const SCOPED_ABBR_RE = /\((c|tm|r)\)/ig; +const SCOPED_ABBR = { + c: '©', + r: '®', + tm: '™' +}; +function replaceFn(match, name) { + return SCOPED_ABBR[name.toLowerCase()]; +} +function replace_scoped(inlineTokens) { + let inside_autolink = 0; + for (let i = inlineTokens.length - 1; i >= 0; i--) { + const token = inlineTokens[i]; + if (token.type === 'text' && !inside_autolink) { + token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn); + } + if (token.type === 'link_open' && token.info === 'auto') { + inside_autolink--; + } + if (token.type === 'link_close' && token.info === 'auto') { + inside_autolink++; + } + } +} +function replace_rare(inlineTokens) { + let inside_autolink = 0; + for (let i = inlineTokens.length - 1; i >= 0; i--) { + const token = inlineTokens[i]; + if (token.type === 'text' && !inside_autolink) { + if (RARE_RE.test(token.content)) { + token.content = token.content.replace(/\+-/g, '±') + // .., ..., ....... -> … + // but ?..... & !..... -> ?.. & !.. + .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..').replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',') + // em-dash + .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\u2014') + // en-dash + .replace(/(^|\s)--(?=\s|$)/mg, '$1\u2013').replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, '$1\u2013'); + } + } + if (token.type === 'link_open' && token.info === 'auto') { + inside_autolink--; + } + if (token.type === 'link_close' && token.info === 'auto') { + inside_autolink++; + } + } +} +function replace(state) { + let blkIdx; + if (!state.md.options.typographer) { + return; + } + for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { + if (state.tokens[blkIdx].type !== 'inline') { + continue; + } + if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) { + replace_scoped(state.tokens[blkIdx].children); + } + if (RARE_RE.test(state.tokens[blkIdx].content)) { + replace_rare(state.tokens[blkIdx].children); + } + } +} + +// Convert straight quotation marks to typographic ones +// + +const QUOTE_TEST_RE = /['"]/; +const QUOTE_RE = /['"]/g; +const APOSTROPHE = '\u2019'; /* ’ */ + +function replaceAt(str, index, ch) { + return str.slice(0, index) + ch + str.slice(index + 1); +} +function process_inlines(tokens, state) { + let j; + const stack = []; + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + const thisLevel = tokens[i].level; + for (j = stack.length - 1; j >= 0; j--) { + if (stack[j].level <= thisLevel) { + break; + } + } + stack.length = j + 1; + if (token.type !== 'text') { + continue; + } + let text = token.content; + let pos = 0; + let max = text.length; + + /* eslint no-labels:0,block-scoped-var:0 */ + OUTER: while (pos < max) { + QUOTE_RE.lastIndex = pos; + const t = QUOTE_RE.exec(text); + if (!t) { + break; + } + let canOpen = true; + let canClose = true; + pos = t.index + 1; + const isSingle = t[0] === "'"; + + // Find previous character, + // default to space if it's the beginning of the line + // + let lastChar = 0x20; + if (t.index - 1 >= 0) { + lastChar = text.charCodeAt(t.index - 1); + } else { + for (j = i - 1; j >= 0; j--) { + if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20 + if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' + + lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1); + break; + } + } + + // Find next character, + // default to space if it's the end of the line + // + let nextChar = 0x20; + if (pos < max) { + nextChar = text.charCodeAt(pos); + } else { + for (j = i + 1; j < tokens.length; j++) { + if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20 + if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' + + nextChar = tokens[j].content.charCodeAt(0); + break; + } + } + const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); + const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); + const isLastWhiteSpace = isWhiteSpace(lastChar); + const isNextWhiteSpace = isWhiteSpace(nextChar); + if (isNextWhiteSpace) { + canOpen = false; + } else if (isNextPunctChar) { + if (!(isLastWhiteSpace || isLastPunctChar)) { + canOpen = false; + } + } + if (isLastWhiteSpace) { + canClose = false; + } else if (isLastPunctChar) { + if (!(isNextWhiteSpace || isNextPunctChar)) { + canClose = false; + } + } + if (nextChar === 0x22 /* " */ && t[0] === '"') { + if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) { + // special case: 1"" - count first quote as an inch + canClose = canOpen = false; + } + } + if (canOpen && canClose) { + // Replace quotes in the middle of punctuation sequence, but not + // in the middle of the words, i.e.: + // + // 1. foo " bar " baz - not replaced + // 2. foo-"-bar-"-baz - replaced + // 3. foo"bar"baz - not replaced + // + canOpen = isLastPunctChar; + canClose = isNextPunctChar; + } + if (!canOpen && !canClose) { + // middle of word + if (isSingle) { + token.content = replaceAt(token.content, t.index, APOSTROPHE); + } + continue; + } + if (canClose) { + // this could be a closing quote, rewind the stack to get a match + for (j = stack.length - 1; j >= 0; j--) { + let item = stack[j]; + if (stack[j].level < thisLevel) { + break; + } + if (item.single === isSingle && stack[j].level === thisLevel) { + item = stack[j]; + let openQuote; + let closeQuote; + if (isSingle) { + openQuote = state.md.options.quotes[2]; + closeQuote = state.md.options.quotes[3]; + } else { + openQuote = state.md.options.quotes[0]; + closeQuote = state.md.options.quotes[1]; + } + + // replace token.content *before* tokens[item.token].content, + // because, if they are pointing at the same token, replaceAt + // could mess up indices when quote length != 1 + token.content = replaceAt(token.content, t.index, closeQuote); + tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote); + pos += closeQuote.length - 1; + if (item.token === i) { + pos += openQuote.length - 1; + } + text = token.content; + max = text.length; + stack.length = j; + continue OUTER; + } + } + } + if (canOpen) { + stack.push({ + token: i, + pos: t.index, + single: isSingle, + level: thisLevel + }); + } else if (canClose && isSingle) { + token.content = replaceAt(token.content, t.index, APOSTROPHE); + } + } + } +} +function smartquotes(state) { + /* eslint max-depth:0 */ + if (!state.md.options.typographer) { + return; + } + for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { + if (state.tokens[blkIdx].type !== 'inline' || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) { + continue; + } + process_inlines(state.tokens[blkIdx].children, state); + } +} + +// Join raw text tokens with the rest of the text +// +// This is set as a separate rule to provide an opportunity for plugins +// to run text replacements after text join, but before escape join. +// +// For example, `\:)` shouldn't be replaced with an emoji. +// + +function text_join(state) { + let curr, last; + const blockTokens = state.tokens; + const l = blockTokens.length; + for (let j = 0; j < l; j++) { + if (blockTokens[j].type !== 'inline') continue; + const tokens = blockTokens[j].children; + const max = tokens.length; + for (curr = 0; curr < max; curr++) { + if (tokens[curr].type === 'text_special') { + tokens[curr].type = 'text'; + } + } + for (curr = last = 0; curr < max; curr++) { + if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { + // collapse two adjacent text nodes + tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; + } else { + if (curr !== last) { + tokens[last] = tokens[curr]; + } + last++; + } + } + if (curr !== last) { + tokens.length = last; + } + } +} + +/** internal + * class Core + * + * Top-level rules executor. Glues block/inline parsers and does intermediate + * transformations. + **/ + +const _rules$2 = [['normalize', normalize], ['block', block], ['inline', inline], ['linkify', linkify$1], ['replacements', replace], ['smartquotes', smartquotes], +// `text_join` finds `text_special` tokens (for escape sequences) +// and joins them with the rest of the text +['text_join', text_join]]; + +/** + * new Core() + **/ +function Core() { + /** + * Core#ruler -> Ruler + * + * [[Ruler]] instance. Keep configuration of core rules. + **/ + this.ruler = new Ruler(); + for (let i = 0; i < _rules$2.length; i++) { + this.ruler.push(_rules$2[i][0], _rules$2[i][1]); + } +} + +/** + * Core.process(state) + * + * Executes core chain rules. + **/ +Core.prototype.process = function (state) { + const rules = this.ruler.getRules(''); + for (let i = 0, l = rules.length; i < l; i++) { + rules[i](state); + } +}; +Core.prototype.State = StateCore; + +// Parser state class + +function StateBlock(src, md, env, tokens) { + this.src = src; + + // link to parser instance + this.md = md; + this.env = env; + + // + // Internal state vartiables + // + + this.tokens = tokens; + this.bMarks = []; // line begin offsets for fast jumps + this.eMarks = []; // line end offsets for fast jumps + this.tShift = []; // offsets of the first non-space characters (tabs not expanded) + this.sCount = []; // indents for each line (tabs expanded) + + // An amount of virtual spaces (tabs expanded) between beginning + // of each line (bMarks) and real beginning of that line. + // + // It exists only as a hack because blockquotes override bMarks + // losing information in the process. + // + // It's used only when expanding tabs, you can think about it as + // an initial tab length, e.g. bsCount=21 applied to string `\t123` + // means first tab should be expanded to 4-21%4 === 3 spaces. + // + this.bsCount = []; + + // block parser variables + + // required block content indent (for example, if we are + // inside a list, it would be positioned after list marker) + this.blkIndent = 0; + this.line = 0; // line index in src + this.lineMax = 0; // lines count + this.tight = false; // loose/tight mode for lists + this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any) + this.listIndent = -1; // indent of the current list block (-1 if there isn't any) + + // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' + // used in lists to determine if they interrupt a paragraph + this.parentType = 'root'; + this.level = 0; + + // Create caches + // Generate markers. + const s = this.src; + for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) { + const ch = s.charCodeAt(pos); + if (!indent_found) { + if (isSpace(ch)) { + indent++; + if (ch === 0x09) { + offset += 4 - offset % 4; + } else { + offset++; + } + continue; + } else { + indent_found = true; + } + } + if (ch === 0x0A || pos === len - 1) { + if (ch !== 0x0A) { + pos++; + } + this.bMarks.push(start); + this.eMarks.push(pos); + this.tShift.push(indent); + this.sCount.push(offset); + this.bsCount.push(0); + indent_found = false; + indent = 0; + offset = 0; + start = pos + 1; + } + } + + // Push fake entry to simplify cache bounds checks + this.bMarks.push(s.length); + this.eMarks.push(s.length); + this.tShift.push(0); + this.sCount.push(0); + this.bsCount.push(0); + this.lineMax = this.bMarks.length - 1; // don't count last fake line +} + +// Push new token to "stream". +// +StateBlock.prototype.push = function (type, tag, nesting) { + const token = new Token(type, tag, nesting); + token.block = true; + if (nesting < 0) this.level--; // closing tag + token.level = this.level; + if (nesting > 0) this.level++; // opening tag + + this.tokens.push(token); + return token; +}; +StateBlock.prototype.isEmpty = function isEmpty(line) { + return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]; +}; +StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) { + for (let max = this.lineMax; from < max; from++) { + if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { + break; + } + } + return from; +}; + +// Skip spaces from given position. +StateBlock.prototype.skipSpaces = function skipSpaces(pos) { + for (let max = this.src.length; pos < max; pos++) { + const ch = this.src.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + } + return pos; +}; + +// Skip spaces from given position in reverse. +StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) { + if (pos <= min) { + return pos; + } + while (pos > min) { + if (!isSpace(this.src.charCodeAt(--pos))) { + return pos + 1; + } + } + return pos; +}; + +// Skip char codes from given position +StateBlock.prototype.skipChars = function skipChars(pos, code) { + for (let max = this.src.length; pos < max; pos++) { + if (this.src.charCodeAt(pos) !== code) { + break; + } + } + return pos; +}; + +// Skip char codes reverse from given position - 1 +StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) { + if (pos <= min) { + return pos; + } + while (pos > min) { + if (code !== this.src.charCodeAt(--pos)) { + return pos + 1; + } + } + return pos; +}; + +// cut lines range from source. +StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) { + if (begin >= end) { + return ''; + } + const queue = new Array(end - begin); + for (let i = 0, line = begin; line < end; line++, i++) { + let lineIndent = 0; + const lineStart = this.bMarks[line]; + let first = lineStart; + let last; + if (line + 1 < end || keepLastLF) { + // No need for bounds check because we have fake entry on tail. + last = this.eMarks[line] + 1; + } else { + last = this.eMarks[line]; + } + while (first < last && lineIndent < indent) { + const ch = this.src.charCodeAt(first); + if (isSpace(ch)) { + if (ch === 0x09) { + lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4; + } else { + lineIndent++; + } + } else if (first - lineStart < this.tShift[line]) { + // patched tShift masked characters to look like spaces (blockquotes, list markers) + lineIndent++; + } else { + break; + } + first++; + } + if (lineIndent > indent) { + // partially expanding tabs in code blocks, e.g '\t\tfoobar' + // with indent=2 becomes ' \tfoobar' + queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last); + } else { + queue[i] = this.src.slice(first, last); + } + } + return queue.join(''); +}; + +// re-export Token class to use in block rules +StateBlock.prototype.Token = Token; + +// GFM table, https://github.github.com/gfm/#tables-extension- + +// Limit the amount of empty autocompleted cells in a table, +// see https://github.com/markdown-it/markdown-it/issues/1000, +// +// Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k. +// We set it to 65k, which can expand user input by a factor of x370 +// (256x256 square is 1.8kB expanded into 650kB). +const MAX_AUTOCOMPLETED_CELLS = 0x10000; +function getLine(state, line) { + const pos = state.bMarks[line] + state.tShift[line]; + const max = state.eMarks[line]; + return state.src.slice(pos, max); +} +function escapedSplit(str) { + const result = []; + const max = str.length; + let pos = 0; + let ch = str.charCodeAt(pos); + let isEscaped = false; + let lastPos = 0; + let current = ''; + while (pos < max) { + if (ch === 0x7c /* | */) { + if (!isEscaped) { + // pipe separating cells, '|' + result.push(current + str.substring(lastPos, pos)); + current = ''; + lastPos = pos + 1; + } else { + // escaped pipe, '\|' + current += str.substring(lastPos, pos - 1); + lastPos = pos; + } + } + isEscaped = ch === 0x5c /* \ */; + pos++; + ch = str.charCodeAt(pos); + } + result.push(current + str.substring(lastPos)); + return result; +} +function table(state, startLine, endLine, silent) { + // should have at least two lines + if (startLine + 2 > endLine) { + return false; + } + let nextLine = startLine + 1; + if (state.sCount[nextLine] < state.blkIndent) { + return false; + } + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[nextLine] - state.blkIndent >= 4) { + return false; + } + + // first character of the second line should be '|', '-', ':', + // and no other characters are allowed but spaces; + // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp + + let pos = state.bMarks[nextLine] + state.tShift[nextLine]; + if (pos >= state.eMarks[nextLine]) { + return false; + } + const firstCh = state.src.charCodeAt(pos++); + if (firstCh !== 0x7C /* | */ && firstCh !== 0x2D /* - */ && firstCh !== 0x3A /* : */) { + return false; + } + if (pos >= state.eMarks[nextLine]) { + return false; + } + const secondCh = state.src.charCodeAt(pos++); + if (secondCh !== 0x7C /* | */ && secondCh !== 0x2D /* - */ && secondCh !== 0x3A /* : */ && !isSpace(secondCh)) { + return false; + } + + // if first character is '-', then second character must not be a space + // (due to parsing ambiguity with list) + if (firstCh === 0x2D /* - */ && isSpace(secondCh)) { + return false; + } + while (pos < state.eMarks[nextLine]) { + const ch = state.src.charCodeAt(pos); + if (ch !== 0x7C /* | */ && ch !== 0x2D /* - */ && ch !== 0x3A /* : */ && !isSpace(ch)) { + return false; + } + pos++; + } + let lineText = getLine(state, startLine + 1); + let columns = lineText.split('|'); + const aligns = []; + for (let i = 0; i < columns.length; i++) { + const t = columns[i].trim(); + if (!t) { + // allow empty columns before and after table, but not in between columns; + // e.g. allow ` |---| `, disallow ` ---||--- ` + if (i === 0 || i === columns.length - 1) { + continue; + } else { + return false; + } + } + if (!/^:?-+:?$/.test(t)) { + return false; + } + if (t.charCodeAt(t.length - 1) === 0x3A /* : */) { + aligns.push(t.charCodeAt(0) === 0x3A /* : */ ? 'center' : 'right'); + } else if (t.charCodeAt(0) === 0x3A /* : */) { + aligns.push('left'); + } else { + aligns.push(''); + } + } + lineText = getLine(state, startLine).trim(); + if (lineText.indexOf('|') === -1) { + return false; + } + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + columns = escapedSplit(lineText); + if (columns.length && columns[0] === '') columns.shift(); + if (columns.length && columns[columns.length - 1] === '') columns.pop(); + + // header row will define an amount of columns in the entire table, + // and align row should be exactly the same (the rest of the rows can differ) + const columnCount = columns.length; + if (columnCount === 0 || columnCount !== aligns.length) { + return false; + } + if (silent) { + return true; + } + const oldParentType = state.parentType; + state.parentType = 'table'; + + // use 'blockquote' lists for termination because it's + // the most similar to tables + const terminatorRules = state.md.block.ruler.getRules('blockquote'); + const token_to = state.push('table_open', 'table', 1); + const tableLines = [startLine, 0]; + token_to.map = tableLines; + const token_tho = state.push('thead_open', 'thead', 1); + token_tho.map = [startLine, startLine + 1]; + const token_htro = state.push('tr_open', 'tr', 1); + token_htro.map = [startLine, startLine + 1]; + for (let i = 0; i < columns.length; i++) { + const token_ho = state.push('th_open', 'th', 1); + if (aligns[i]) { + token_ho.attrs = [['style', 'text-align:' + aligns[i]]]; + } + const token_il = state.push('inline', '', 0); + token_il.content = columns[i].trim(); + token_il.children = []; + state.push('th_close', 'th', -1); + } + state.push('tr_close', 'tr', -1); + state.push('thead_close', 'thead', -1); + let tbodyLines; + let autocompletedCells = 0; + for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + lineText = getLine(state, nextLine).trim(); + if (!lineText) { + break; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + break; + } + columns = escapedSplit(lineText); + if (columns.length && columns[0] === '') columns.shift(); + if (columns.length && columns[columns.length - 1] === '') columns.pop(); + + // note: autocomplete count can be negative if user specifies more columns than header, + // but that does not affect intended use (which is limiting expansion) + autocompletedCells += columnCount - columns.length; + if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) { + break; + } + if (nextLine === startLine + 2) { + const token_tbo = state.push('tbody_open', 'tbody', 1); + token_tbo.map = tbodyLines = [startLine + 2, 0]; + } + const token_tro = state.push('tr_open', 'tr', 1); + token_tro.map = [nextLine, nextLine + 1]; + for (let i = 0; i < columnCount; i++) { + const token_tdo = state.push('td_open', 'td', 1); + if (aligns[i]) { + token_tdo.attrs = [['style', 'text-align:' + aligns[i]]]; + } + const token_il = state.push('inline', '', 0); + token_il.content = columns[i] ? columns[i].trim() : ''; + token_il.children = []; + state.push('td_close', 'td', -1); + } + state.push('tr_close', 'tr', -1); + } + if (tbodyLines) { + state.push('tbody_close', 'tbody', -1); + tbodyLines[1] = nextLine; + } + state.push('table_close', 'table', -1); + tableLines[1] = nextLine; + state.parentType = oldParentType; + state.line = nextLine; + return true; +} + +// Code block (4 spaces padded) + +function code(state, startLine, endLine /*, silent */) { + if (state.sCount[startLine] - state.blkIndent < 4) { + return false; + } + let nextLine = startLine + 1; + let last = nextLine; + while (nextLine < endLine) { + if (state.isEmpty(nextLine)) { + nextLine++; + continue; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + nextLine++; + last = nextLine; + continue; + } + break; + } + state.line = last; + const token = state.push('code_block', 'code', 0); + token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n'; + token.map = [startLine, state.line]; + return true; +} + +// fences (``` lang, ~~~ lang) + +function fence(state, startLine, endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (pos + 3 > max) { + return false; + } + const marker = state.src.charCodeAt(pos); + if (marker !== 0x7E /* ~ */ && marker !== 0x60 /* ` */) { + return false; + } + + // scan marker length + let mem = pos; + pos = state.skipChars(pos, marker); + let len = pos - mem; + if (len < 3) { + return false; + } + const markup = state.src.slice(mem, pos); + const params = state.src.slice(pos, max); + if (marker === 0x60 /* ` */) { + if (params.indexOf(String.fromCharCode(marker)) >= 0) { + return false; + } + } + + // Since start is found, we can report success here in validation mode + if (silent) { + return true; + } + + // search end of block + let nextLine = startLine; + let haveEndMarker = false; + for (;;) { + nextLine++; + if (nextLine >= endLine) { + // unclosed block should be autoclosed by end of document. + // also block seems to be autoclosed by end of parent + break; + } + pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos < max && state.sCount[nextLine] < state.blkIndent) { + // non-empty line with negative indent should stop the list: + // - ``` + // test + break; + } + if (state.src.charCodeAt(pos) !== marker) { + continue; + } + if (state.sCount[nextLine] - state.blkIndent >= 4) { + // closing fence should be indented less than 4 spaces + continue; + } + pos = state.skipChars(pos, marker); + + // closing code fence must be at least as long as the opening one + if (pos - mem < len) { + continue; + } + + // make sure tail has spaces only + pos = state.skipSpaces(pos); + if (pos < max) { + continue; + } + haveEndMarker = true; + // found! + break; + } + + // If a fence has heading spaces, they should be removed from its inner block + len = state.sCount[startLine]; + state.line = nextLine + (haveEndMarker ? 1 : 0); + const token = state.push('fence', 'code', 0); + token.info = params; + token.content = state.getLines(startLine + 1, nextLine, len, true); + token.markup = markup; + token.map = [startLine, state.line]; + return true; +} + +// Block quotes + +function blockquote(state, startLine, endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + const oldLineMax = state.lineMax; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + + // check the block quote marker + if (state.src.charCodeAt(pos) !== 0x3E /* > */) { + return false; + } + + // we know that it's going to be a valid blockquote, + // so no point trying to find the end of it in silent mode + if (silent) { + return true; + } + const oldBMarks = []; + const oldBSCount = []; + const oldSCount = []; + const oldTShift = []; + const terminatorRules = state.md.block.ruler.getRules('blockquote'); + const oldParentType = state.parentType; + state.parentType = 'blockquote'; + let lastLineEmpty = false; + let nextLine; + + // Search the end of the block + // + // Block ends with either: + // 1. an empty line outside: + // ``` + // > test + // + // ``` + // 2. an empty line inside: + // ``` + // > + // test + // ``` + // 3. another tag: + // ``` + // > test + // - - - + // ``` + for (nextLine = startLine; nextLine < endLine; nextLine++) { + // check if it's outdented, i.e. it's inside list item and indented + // less than said list item: + // + // ``` + // 1. anything + // > current blockquote + // 2. checking this line + // ``` + const isOutdented = state.sCount[nextLine] < state.blkIndent; + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + if (pos >= max) { + // Case 1: line is not inside the blockquote, and this line is empty. + break; + } + if (state.src.charCodeAt(pos++) === 0x3E /* > */ && !isOutdented) { + // This line is inside the blockquote. + + // set offset past spaces and ">" + let initial = state.sCount[nextLine] + 1; + let spaceAfterMarker; + let adjustTab; + + // skip one optional space after '>' + if (state.src.charCodeAt(pos) === 0x20 /* space */) { + // ' > test ' + // ^ -- position start of line here: + pos++; + initial++; + adjustTab = false; + spaceAfterMarker = true; + } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { + spaceAfterMarker = true; + if ((state.bsCount[nextLine] + initial) % 4 === 3) { + // ' >\t test ' + // ^ -- position start of line here (tab has width===1) + pos++; + initial++; + adjustTab = false; + } else { + // ' >\t test ' + // ^ -- position start of line here + shift bsCount slightly + // to make extra space appear + adjustTab = true; + } + } else { + spaceAfterMarker = false; + } + let offset = initial; + oldBMarks.push(state.bMarks[nextLine]); + state.bMarks[nextLine] = pos; + while (pos < max) { + const ch = state.src.charCodeAt(pos); + if (isSpace(ch)) { + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4; + } else { + offset++; + } + } else { + break; + } + pos++; + } + lastLineEmpty = pos >= max; + oldBSCount.push(state.bsCount[nextLine]); + state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] = offset - initial; + oldTShift.push(state.tShift[nextLine]); + state.tShift[nextLine] = pos - state.bMarks[nextLine]; + continue; + } + + // Case 2: line is not inside the blockquote, and the last line was empty. + if (lastLineEmpty) { + break; + } + + // Case 3: another tag found. + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + // Quirk to enforce "hard termination mode" for paragraphs; + // normally if you call `tokenize(state, startLine, nextLine)`, + // paragraphs will look below nextLine for paragraph continuation, + // but if blockquote is terminated by another tag, they shouldn't + state.lineMax = nextLine; + if (state.blkIndent !== 0) { + // state.blkIndent was non-zero, we now set it to zero, + // so we need to re-calculate all offsets to appear as + // if indent wasn't changed + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + state.sCount[nextLine] -= state.blkIndent; + } + break; + } + oldBMarks.push(state.bMarks[nextLine]); + oldBSCount.push(state.bsCount[nextLine]); + oldTShift.push(state.tShift[nextLine]); + oldSCount.push(state.sCount[nextLine]); + + // A negative indentation means that this is a paragraph continuation + // + state.sCount[nextLine] = -1; + } + const oldIndent = state.blkIndent; + state.blkIndent = 0; + const token_o = state.push('blockquote_open', 'blockquote', 1); + token_o.markup = '>'; + const lines = [startLine, 0]; + token_o.map = lines; + state.md.block.tokenize(state, startLine, nextLine); + const token_c = state.push('blockquote_close', 'blockquote', -1); + token_c.markup = '>'; + state.lineMax = oldLineMax; + state.parentType = oldParentType; + lines[1] = state.line; + + // Restore original tShift; this might not be necessary since the parser + // has already been here, but just to make sure we can do that. + for (let i = 0; i < oldTShift.length; i++) { + state.bMarks[i + startLine] = oldBMarks[i]; + state.tShift[i + startLine] = oldTShift[i]; + state.sCount[i + startLine] = oldSCount[i]; + state.bsCount[i + startLine] = oldBSCount[i]; + } + state.blkIndent = oldIndent; + return true; +} + +// Horizontal rule + +function hr(state, startLine, endLine, silent) { + const max = state.eMarks[startLine]; + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + let pos = state.bMarks[startLine] + state.tShift[startLine]; + const marker = state.src.charCodeAt(pos++); + + // Check hr marker + if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x5F /* _ */) { + return false; + } + + // markers can be mixed with spaces, but there should be at least 3 of them + + let cnt = 1; + while (pos < max) { + const ch = state.src.charCodeAt(pos++); + if (ch !== marker && !isSpace(ch)) { + return false; + } + if (ch === marker) { + cnt++; + } + } + if (cnt < 3) { + return false; + } + if (silent) { + return true; + } + state.line = startLine + 1; + const token = state.push('hr', 'hr', 0); + token.map = [startLine, state.line]; + token.markup = Array(cnt + 1).join(String.fromCharCode(marker)); + return true; +} + +// Lists + +// Search `[-+*][\n ]`, returns next pos after marker on success +// or -1 on fail. +function skipBulletListMarker(state, startLine) { + const max = state.eMarks[startLine]; + let pos = state.bMarks[startLine] + state.tShift[startLine]; + const marker = state.src.charCodeAt(pos++); + // Check bullet + if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x2B /* + */) { + return -1; + } + if (pos < max) { + const ch = state.src.charCodeAt(pos); + if (!isSpace(ch)) { + // " -test " - is not a list item + return -1; + } + } + return pos; +} + +// Search `\d+[.)][\n ]`, returns next pos after marker on success +// or -1 on fail. +function skipOrderedListMarker(state, startLine) { + const start = state.bMarks[startLine] + state.tShift[startLine]; + const max = state.eMarks[startLine]; + let pos = start; + + // List marker should have at least 2 chars (digit + dot) + if (pos + 1 >= max) { + return -1; + } + let ch = state.src.charCodeAt(pos++); + if (ch < 0x30 /* 0 */ || ch > 0x39 /* 9 */) { + return -1; + } + for (;;) { + // EOL -> fail + if (pos >= max) { + return -1; + } + ch = state.src.charCodeAt(pos++); + if (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) { + // List marker should have no more than 9 digits + // (prevents integer overflow in browsers) + if (pos - start >= 10) { + return -1; + } + continue; + } + + // found valid marker + if (ch === 0x29 /* ) */ || ch === 0x2e /* . */) { + break; + } + return -1; + } + if (pos < max) { + ch = state.src.charCodeAt(pos); + if (!isSpace(ch)) { + // " 1.test " - is not a list item + return -1; + } + } + return pos; +} +function markTightParagraphs(state, idx) { + const level = state.level + 2; + for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) { + if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') { + state.tokens[i + 2].hidden = true; + state.tokens[i].hidden = true; + i += 2; + } + } +} +function list(state, startLine, endLine, silent) { + let max, pos, start, token; + let nextLine = startLine; + let tight = true; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[nextLine] - state.blkIndent >= 4) { + return false; + } + + // Special case: + // - item 1 + // - item 2 + // - item 3 + // - item 4 + // - this one is a paragraph continuation + if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) { + return false; + } + let isTerminatingParagraph = false; + + // limit conditions when list can interrupt + // a paragraph (validation mode only) + if (silent && state.parentType === 'paragraph') { + // Next list item should still terminate previous list item; + // + // This code can fail if plugins use blkIndent as well as lists, + // but I hope the spec gets fixed long before that happens. + // + if (state.sCount[nextLine] >= state.blkIndent) { + isTerminatingParagraph = true; + } + } + + // Detect list type and position after marker + let isOrdered; + let markerValue; + let posAfterMarker; + if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) { + isOrdered = true; + start = state.bMarks[nextLine] + state.tShift[nextLine]; + markerValue = Number(state.src.slice(start, posAfterMarker - 1)); + + // If we're starting a new ordered list right after + // a paragraph, it should start with 1. + if (isTerminatingParagraph && markerValue !== 1) return false; + } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) { + isOrdered = false; + } else { + return false; + } + + // If we're starting a new unordered list right after + // a paragraph, first line should not be empty. + if (isTerminatingParagraph) { + if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false; + } + + // For validation mode we can terminate immediately + if (silent) { + return true; + } + + // We should terminate list on style change. Remember first one to compare. + const markerCharCode = state.src.charCodeAt(posAfterMarker - 1); + + // Start list + const listTokIdx = state.tokens.length; + if (isOrdered) { + token = state.push('ordered_list_open', 'ol', 1); + if (markerValue !== 1) { + token.attrs = [['start', markerValue]]; + } + } else { + token = state.push('bullet_list_open', 'ul', 1); + } + const listLines = [nextLine, 0]; + token.map = listLines; + token.markup = String.fromCharCode(markerCharCode); + + // + // Iterate list items + // + + let prevEmptyEnd = false; + const terminatorRules = state.md.block.ruler.getRules('list'); + const oldParentType = state.parentType; + state.parentType = 'list'; + while (nextLine < endLine) { + pos = posAfterMarker; + max = state.eMarks[nextLine]; + const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]); + let offset = initial; + while (pos < max) { + const ch = state.src.charCodeAt(pos); + if (ch === 0x09) { + offset += 4 - (offset + state.bsCount[nextLine]) % 4; + } else if (ch === 0x20) { + offset++; + } else { + break; + } + pos++; + } + const contentStart = pos; + let indentAfterMarker; + if (contentStart >= max) { + // trimming space in "- \n 3" case, indent is 1 here + indentAfterMarker = 1; + } else { + indentAfterMarker = offset - initial; + } + + // If we have more than 4 spaces, the indent is 1 + // (the rest is just indented code block) + if (indentAfterMarker > 4) { + indentAfterMarker = 1; + } + + // " - test" + // ^^^^^ - calculating total length of this thing + const indent = initial + indentAfterMarker; + + // Run subparser & write tokens + token = state.push('list_item_open', 'li', 1); + token.markup = String.fromCharCode(markerCharCode); + const itemLines = [nextLine, 0]; + token.map = itemLines; + if (isOrdered) { + token.info = state.src.slice(start, posAfterMarker - 1); + } + + // change current state, then restore it after parser subcall + const oldTight = state.tight; + const oldTShift = state.tShift[nextLine]; + const oldSCount = state.sCount[nextLine]; + + // - example list + // ^ listIndent position will be here + // ^ blkIndent position will be here + // + const oldListIndent = state.listIndent; + state.listIndent = state.blkIndent; + state.blkIndent = indent; + state.tight = true; + state.tShift[nextLine] = contentStart - state.bMarks[nextLine]; + state.sCount[nextLine] = offset; + if (contentStart >= max && state.isEmpty(nextLine + 1)) { + // workaround for this case + // (list item is empty, list terminates before "foo"): + // ~~~~~~~~ + // - + // + // foo + // ~~~~~~~~ + state.line = Math.min(state.line + 2, endLine); + } else { + state.md.block.tokenize(state, nextLine, endLine, true); + } + + // If any of list item is tight, mark list as tight + if (!state.tight || prevEmptyEnd) { + tight = false; + } + // Item become loose if finish with empty line, + // but we should filter last element, because it means list finish + prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1); + state.blkIndent = state.listIndent; + state.listIndent = oldListIndent; + state.tShift[nextLine] = oldTShift; + state.sCount[nextLine] = oldSCount; + state.tight = oldTight; + token = state.push('list_item_close', 'li', -1); + token.markup = String.fromCharCode(markerCharCode); + nextLine = state.line; + itemLines[1] = nextLine; + if (nextLine >= endLine) { + break; + } + + // + // Try to check if list is terminated or continued. + // + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[nextLine] - state.blkIndent >= 4) { + break; + } + + // fail if terminating block found + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + + // fail if list has another type + if (isOrdered) { + posAfterMarker = skipOrderedListMarker(state, nextLine); + if (posAfterMarker < 0) { + break; + } + start = state.bMarks[nextLine] + state.tShift[nextLine]; + } else { + posAfterMarker = skipBulletListMarker(state, nextLine); + if (posAfterMarker < 0) { + break; + } + } + if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { + break; + } + } + + // Finalize list + if (isOrdered) { + token = state.push('ordered_list_close', 'ol', -1); + } else { + token = state.push('bullet_list_close', 'ul', -1); + } + token.markup = String.fromCharCode(markerCharCode); + listLines[1] = nextLine; + state.line = nextLine; + state.parentType = oldParentType; + + // mark paragraphs tight if needed + if (tight) { + markTightParagraphs(state, listTokIdx); + } + return true; +} +function reference(state, startLine, _endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + let nextLine = startLine + 1; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (state.src.charCodeAt(pos) !== 0x5B /* [ */) { + return false; + } + function getNextLine(nextLine) { + const endLine = state.lineMax; + if (nextLine >= endLine || state.isEmpty(nextLine)) { + // empty line or end of input + return null; + } + let isContinuation = false; + + // this would be a code block normally, but after paragraph + // it's considered a lazy continuation regardless of what's there + if (state.sCount[nextLine] - state.blkIndent > 3) { + isContinuation = true; + } + + // quirk for blockquotes, this line should already be checked by that rule + if (state.sCount[nextLine] < 0) { + isContinuation = true; + } + if (!isContinuation) { + const terminatorRules = state.md.block.ruler.getRules('reference'); + const oldParentType = state.parentType; + state.parentType = 'reference'; + + // Some tags can terminate paragraph without empty line. + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + state.parentType = oldParentType; + if (terminate) { + // terminated by another block + return null; + } + } + const pos = state.bMarks[nextLine] + state.tShift[nextLine]; + const max = state.eMarks[nextLine]; + + // max + 1 explicitly includes the newline + return state.src.slice(pos, max + 1); + } + let str = state.src.slice(pos, max + 1); + max = str.length; + let labelEnd = -1; + for (pos = 1; pos < max; pos++) { + const ch = str.charCodeAt(pos); + if (ch === 0x5B /* [ */) { + return false; + } else if (ch === 0x5D /* ] */) { + labelEnd = pos; + break; + } else if (ch === 0x0A /* \n */) { + const lineContent = getNextLine(nextLine); + if (lineContent !== null) { + str += lineContent; + max = str.length; + nextLine++; + } + } else if (ch === 0x5C /* \ */) { + pos++; + if (pos < max && str.charCodeAt(pos) === 0x0A) { + const lineContent = getNextLine(nextLine); + if (lineContent !== null) { + str += lineContent; + max = str.length; + nextLine++; + } + } + } + } + if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A /* : */) { + return false; + } + + // [label]: destination 'title' + // ^^^ skip optional whitespace here + for (pos = labelEnd + 2; pos < max; pos++) { + const ch = str.charCodeAt(pos); + if (ch === 0x0A) { + const lineContent = getNextLine(nextLine); + if (lineContent !== null) { + str += lineContent; + max = str.length; + nextLine++; + } + } else if (isSpace(ch)) ;else { + break; + } + } + + // [label]: destination 'title' + // ^^^^^^^^^^^ parse this + const destRes = state.md.helpers.parseLinkDestination(str, pos, max); + if (!destRes.ok) { + return false; + } + const href = state.md.normalizeLink(destRes.str); + if (!state.md.validateLink(href)) { + return false; + } + pos = destRes.pos; + + // save cursor state, we could require to rollback later + const destEndPos = pos; + const destEndLineNo = nextLine; + + // [label]: destination 'title' + // ^^^ skipping those spaces + const start = pos; + for (; pos < max; pos++) { + const ch = str.charCodeAt(pos); + if (ch === 0x0A) { + const lineContent = getNextLine(nextLine); + if (lineContent !== null) { + str += lineContent; + max = str.length; + nextLine++; + } + } else if (isSpace(ch)) ;else { + break; + } + } + + // [label]: destination 'title' + // ^^^^^^^ parse this + let titleRes = state.md.helpers.parseLinkTitle(str, pos, max); + while (titleRes.can_continue) { + const lineContent = getNextLine(nextLine); + if (lineContent === null) break; + str += lineContent; + pos = max; + max = str.length; + nextLine++; + titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes); + } + let title; + if (pos < max && start !== pos && titleRes.ok) { + title = titleRes.str; + pos = titleRes.pos; + } else { + title = ''; + pos = destEndPos; + nextLine = destEndLineNo; + } + + // skip trailing spaces until the rest of the line + while (pos < max) { + const ch = str.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + pos++; + } + if (pos < max && str.charCodeAt(pos) !== 0x0A) { + if (title) { + // garbage at the end of the line after title, + // but it could still be a valid reference if we roll back + title = ''; + pos = destEndPos; + nextLine = destEndLineNo; + while (pos < max) { + const ch = str.charCodeAt(pos); + if (!isSpace(ch)) { + break; + } + pos++; + } + } + } + if (pos < max && str.charCodeAt(pos) !== 0x0A) { + // garbage at the end of the line + return false; + } + const label = normalizeReference(str.slice(1, labelEnd)); + if (!label) { + // CommonMark 0.20 disallows empty labels + return false; + } + + // Reference can not terminate anything. This check is for safety only. + /* istanbul ignore if */ + if (silent) { + return true; + } + if (typeof state.env.references === 'undefined') { + state.env.references = {}; + } + if (typeof state.env.references[label] === 'undefined') { + state.env.references[label] = { + title, + href + }; + } + state.line = nextLine; + return true; +} + +// List of valid html blocks names, according to commonmark spec +// https://spec.commonmark.org/0.30/#html-blocks + +var block_names = ['address', 'article', 'aside', 'base', 'basefont', 'blockquote', 'body', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dialog', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'iframe', 'legend', 'li', 'link', 'main', 'menu', 'menuitem', 'nav', 'noframes', 'ol', 'optgroup', 'option', 'p', 'param', 'search', 'section', 'summary', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul']; + +// Regexps to match html elements + +const attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; +const unquoted = '[^"\'=<>`\\x00-\\x20]+'; +const single_quoted = "'[^']*'"; +const double_quoted = '"[^"]*"'; +const attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; +const attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; +const open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; +const close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; +const comment = ''; +const processing = '<[?][\\s\\S]*?[?]>'; +const declaration = ']*>'; +const cdata = ''; +const HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + '|' + processing + '|' + declaration + '|' + cdata + ')'); +const HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); + +// HTML block + +// An array of opening and corresponding closing sequences for html tags, +// last argument defines whether it can terminate a paragraph or not +// +const HTML_SEQUENCES = [[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true], [/^/, true], [/^<\?/, /\?>/, true], [/^/, true], [/^/, true], [new RegExp('^|$))', 'i'), /^$/, true], [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false]]; +function html_block(state, startLine, endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + if (!state.md.options.html) { + return false; + } + if (state.src.charCodeAt(pos) !== 0x3C /* < */) { + return false; + } + let lineText = state.src.slice(pos, max); + let i = 0; + for (; i < HTML_SEQUENCES.length; i++) { + if (HTML_SEQUENCES[i][0].test(lineText)) { + break; + } + } + if (i === HTML_SEQUENCES.length) { + return false; + } + if (silent) { + // true if this sequence can be a terminator, false otherwise + return HTML_SEQUENCES[i][2]; + } + let nextLine = startLine + 1; + + // If we are here - we detected HTML block. + // Let's roll down till block end. + if (!HTML_SEQUENCES[i][1].test(lineText)) { + for (; nextLine < endLine; nextLine++) { + if (state.sCount[nextLine] < state.blkIndent) { + break; + } + pos = state.bMarks[nextLine] + state.tShift[nextLine]; + max = state.eMarks[nextLine]; + lineText = state.src.slice(pos, max); + if (HTML_SEQUENCES[i][1].test(lineText)) { + if (lineText.length !== 0) { + nextLine++; + } + break; + } + } + } + state.line = nextLine; + const token = state.push('html_block', '', 0); + token.map = [startLine, nextLine]; + token.content = state.getLines(startLine, nextLine, state.blkIndent, true); + return true; +} + +// heading (#, ##, ...) + +function heading(state, startLine, endLine, silent) { + let pos = state.bMarks[startLine] + state.tShift[startLine]; + let max = state.eMarks[startLine]; + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + let ch = state.src.charCodeAt(pos); + if (ch !== 0x23 /* # */ || pos >= max) { + return false; + } + + // count heading level + let level = 1; + ch = state.src.charCodeAt(++pos); + while (ch === 0x23 /* # */ && pos < max && level <= 6) { + level++; + ch = state.src.charCodeAt(++pos); + } + if (level > 6 || pos < max && !isSpace(ch)) { + return false; + } + if (silent) { + return true; + } + + // Let's cut tails like ' ### ' from the end of string + + max = state.skipSpacesBack(max, pos); + const tmp = state.skipCharsBack(max, 0x23, pos); // # + if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) { + max = tmp; + } + state.line = startLine + 1; + const token_o = state.push('heading_open', 'h' + String(level), 1); + token_o.markup = '########'.slice(0, level); + token_o.map = [startLine, state.line]; + const token_i = state.push('inline', '', 0); + token_i.content = state.src.slice(pos, max).trim(); + token_i.map = [startLine, state.line]; + token_i.children = []; + const token_c = state.push('heading_close', 'h' + String(level), -1); + token_c.markup = '########'.slice(0, level); + return true; +} + +// lheading (---, ===) + +function lheading(state, startLine, endLine /*, silent */) { + const terminatorRules = state.md.block.ruler.getRules('paragraph'); + + // if it's indented more than 3 spaces, it should be a code block + if (state.sCount[startLine] - state.blkIndent >= 4) { + return false; + } + const oldParentType = state.parentType; + state.parentType = 'paragraph'; // use paragraph to match terminatorRules + + // jump line-by-line until empty one or EOF + let level = 0; + let marker; + let nextLine = startLine + 1; + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + // this would be a code block normally, but after paragraph + // it's considered a lazy continuation regardless of what's there + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + + // + // Check for underline in setext header + // + if (state.sCount[nextLine] >= state.blkIndent) { + let pos = state.bMarks[nextLine] + state.tShift[nextLine]; + const max = state.eMarks[nextLine]; + if (pos < max) { + marker = state.src.charCodeAt(pos); + if (marker === 0x2D /* - */ || marker === 0x3D /* = */) { + pos = state.skipChars(pos, marker); + pos = state.skipSpaces(pos); + if (pos >= max) { + level = marker === 0x3D /* = */ ? 1 : 2; + break; + } + } + } + } + + // quirk for blockquotes, this line should already be checked by that rule + if (state.sCount[nextLine] < 0) { + continue; + } + + // Some tags can terminate paragraph without empty line. + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + } + if (!level) { + // Didn't find valid underline + return false; + } + const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + state.line = nextLine + 1; + const token_o = state.push('heading_open', 'h' + String(level), 1); + token_o.markup = String.fromCharCode(marker); + token_o.map = [startLine, state.line]; + const token_i = state.push('inline', '', 0); + token_i.content = content; + token_i.map = [startLine, state.line - 1]; + token_i.children = []; + const token_c = state.push('heading_close', 'h' + String(level), -1); + token_c.markup = String.fromCharCode(marker); + state.parentType = oldParentType; + return true; +} + +// Paragraph + +function paragraph(state, startLine, endLine) { + const terminatorRules = state.md.block.ruler.getRules('paragraph'); + const oldParentType = state.parentType; + let nextLine = startLine + 1; + state.parentType = 'paragraph'; + + // jump line-by-line until empty one or EOF + for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { + // this would be a code block normally, but after paragraph + // it's considered a lazy continuation regardless of what's there + if (state.sCount[nextLine] - state.blkIndent > 3) { + continue; + } + + // quirk for blockquotes, this line should already be checked by that rule + if (state.sCount[nextLine] < 0) { + continue; + } + + // Some tags can terminate paragraph without empty line. + let terminate = false; + for (let i = 0, l = terminatorRules.length; i < l; i++) { + if (terminatorRules[i](state, nextLine, endLine, true)) { + terminate = true; + break; + } + } + if (terminate) { + break; + } + } + const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); + state.line = nextLine; + const token_o = state.push('paragraph_open', 'p', 1); + token_o.map = [startLine, state.line]; + const token_i = state.push('inline', '', 0); + token_i.content = content; + token_i.map = [startLine, state.line]; + token_i.children = []; + state.push('paragraph_close', 'p', -1); + state.parentType = oldParentType; + return true; +} + +/** internal + * class ParserBlock + * + * Block-level tokenizer. + **/ + +const _rules$1 = [ +// First 2 params - rule name & source. Secondary array - list of rules, +// which can be terminated by this one. +['table', table, ['paragraph', 'reference']], ['code', code], ['fence', fence, ['paragraph', 'reference', 'blockquote', 'list']], ['blockquote', blockquote, ['paragraph', 'reference', 'blockquote', 'list']], ['hr', hr, ['paragraph', 'reference', 'blockquote', 'list']], ['list', list, ['paragraph', 'reference', 'blockquote']], ['reference', reference], ['html_block', html_block, ['paragraph', 'reference', 'blockquote']], ['heading', heading, ['paragraph', 'reference', 'blockquote']], ['lheading', lheading], ['paragraph', paragraph]]; + +/** + * new ParserBlock() + **/ +function ParserBlock() { + /** + * ParserBlock#ruler -> Ruler + * + * [[Ruler]] instance. Keep configuration of block rules. + **/ + this.ruler = new Ruler(); + for (let i = 0; i < _rules$1.length; i++) { + this.ruler.push(_rules$1[i][0], _rules$1[i][1], { + alt: (_rules$1[i][2] || []).slice() + }); + } +} + +// Generate tokens for input range +// +ParserBlock.prototype.tokenize = function (state, startLine, endLine) { + const rules = this.ruler.getRules(''); + const len = rules.length; + const maxNesting = state.md.options.maxNesting; + let line = startLine; + let hasEmptyLines = false; + while (line < endLine) { + state.line = line = state.skipEmptyLines(line); + if (line >= endLine) { + break; + } + + // Termination condition for nested calls. + // Nested calls currently used for blockquotes & lists + if (state.sCount[line] < state.blkIndent) { + break; + } + + // If nesting level exceeded - skip tail to the end. That's not ordinary + // situation and we should not care about content. + if (state.level >= maxNesting) { + state.line = endLine; + break; + } + + // Try all possible rules. + // On success, rule should: + // + // - update `state.line` + // - update `state.tokens` + // - return true + const prevLine = state.line; + let ok = false; + for (let i = 0; i < len; i++) { + ok = rules[i](state, line, endLine, false); + if (ok) { + if (prevLine >= state.line) { + throw new Error("block rule didn't increment state.line"); + } + break; + } + } + + // this can only happen if user disables paragraph rule + if (!ok) throw new Error('none of the block rules matched'); + + // set state.tight if we had an empty line before current tag + // i.e. latest empty line should not count + state.tight = !hasEmptyLines; + + // paragraph might "eat" one newline after it in nested lists + if (state.isEmpty(state.line - 1)) { + hasEmptyLines = true; + } + line = state.line; + if (line < endLine && state.isEmpty(line)) { + hasEmptyLines = true; + line++; + state.line = line; + } + } +}; + +/** + * ParserBlock.parse(str, md, env, outTokens) + * + * Process input string and push block tokens into `outTokens` + **/ +ParserBlock.prototype.parse = function (src, md, env, outTokens) { + if (!src) { + return; + } + const state = new this.State(src, md, env, outTokens); + this.tokenize(state, state.line, state.lineMax); +}; +ParserBlock.prototype.State = StateBlock; + +// Inline parser state + +function StateInline(src, md, env, outTokens) { + this.src = src; + this.env = env; + this.md = md; + this.tokens = outTokens; + this.tokens_meta = Array(outTokens.length); + this.pos = 0; + this.posMax = this.src.length; + this.level = 0; + this.pending = ''; + this.pendingLevel = 0; + + // Stores { start: end } pairs. Useful for backtrack + // optimization of pairs parse (emphasis, strikes). + this.cache = {}; + + // List of emphasis-like delimiters for current tag + this.delimiters = []; + + // Stack of delimiter lists for upper level tags + this._prev_delimiters = []; + + // backtick length => last seen position + this.backticks = {}; + this.backticksScanned = false; + + // Counter used to disable inline linkify-it execution + // inside and markdown links + this.linkLevel = 0; +} + +// Flush pending text +// +StateInline.prototype.pushPending = function () { + const token = new Token('text', '', 0); + token.content = this.pending; + token.level = this.pendingLevel; + this.tokens.push(token); + this.pending = ''; + return token; +}; + +// Push new token to "stream". +// If pending text exists - flush it as text token +// +StateInline.prototype.push = function (type, tag, nesting) { + if (this.pending) { + this.pushPending(); + } + const token = new Token(type, tag, nesting); + let token_meta = null; + if (nesting < 0) { + // closing tag + this.level--; + this.delimiters = this._prev_delimiters.pop(); + } + token.level = this.level; + if (nesting > 0) { + // opening tag + this.level++; + this._prev_delimiters.push(this.delimiters); + this.delimiters = []; + token_meta = { + delimiters: this.delimiters + }; + } + this.pendingLevel = this.level; + this.tokens.push(token); + this.tokens_meta.push(token_meta); + return token; +}; + +// Scan a sequence of emphasis-like markers, and determine whether +// it can start an emphasis sequence or end an emphasis sequence. +// +// - start - position to scan from (it should point at a valid marker); +// - canSplitWord - determine if these markers can be found inside a word +// +StateInline.prototype.scanDelims = function (start, canSplitWord) { + const max = this.posMax; + const marker = this.src.charCodeAt(start); + + // treat beginning of the line as a whitespace + const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20; + let pos = start; + while (pos < max && this.src.charCodeAt(pos) === marker) { + pos++; + } + const count = pos - start; + + // treat end of the line as a whitespace + const nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20; + const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); + const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); + const isLastWhiteSpace = isWhiteSpace(lastChar); + const isNextWhiteSpace = isWhiteSpace(nextChar); + const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar); + const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar); + const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar); + const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar); + return { + can_open, + can_close, + length: count + }; +}; + +// re-export Token class to use in block rules +StateInline.prototype.Token = Token; + +// Skip text characters for text token, place those to pending buffer +// and increment current pos + +// Rule to skip pure text +// '{}$%@~+=:' reserved for extentions + +// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ + +// !!!! Don't confuse with "Markdown ASCII Punctuation" chars +// http://spec.commonmark.org/0.15/#ascii-punctuation-character +function isTerminatorChar(ch) { + switch (ch) { + case 0x0A /* \n */: + case 0x21 /* ! */: + case 0x23 /* # */: + case 0x24 /* $ */: + case 0x25 /* % */: + case 0x26 /* & */: + case 0x2A /* * */: + case 0x2B /* + */: + case 0x2D /* - */: + case 0x3A /* : */: + case 0x3C /* < */: + case 0x3D /* = */: + case 0x3E /* > */: + case 0x40 /* @ */: + case 0x5B /* [ */: + case 0x5C /* \ */: + case 0x5D /* ] */: + case 0x5E /* ^ */: + case 0x5F /* _ */: + case 0x60 /* ` */: + case 0x7B /* { */: + case 0x7D /* } */: + case 0x7E /* ~ */: + return true; + default: + return false; + } +} +function text(state, silent) { + let pos = state.pos; + while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) { + pos++; + } + if (pos === state.pos) { + return false; + } + if (!silent) { + state.pending += state.src.slice(state.pos, pos); + } + state.pos = pos; + return true; +} + +// Alternative implementation, for memory. +// +// It costs 10% of performance, but allows extend terminators list, if place it +// to `ParserInline` property. Probably, will switch to it sometime, such +// flexibility required. + +/* +var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/; + +module.exports = function text(state, silent) { + var pos = state.pos, + idx = state.src.slice(pos).search(TERMINATOR_RE); + + // first char is terminator -> empty text + if (idx === 0) { return false; } + + // no terminator -> text till end of string + if (idx < 0) { + if (!silent) { state.pending += state.src.slice(pos); } + state.pos = state.src.length; + return true; + } + + if (!silent) { state.pending += state.src.slice(pos, pos + idx); } + + state.pos += idx; + + return true; +}; */ + +// Process links like https://example.org/ + +// RFC3986: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) +const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i; +function linkify(state, silent) { + if (!state.md.options.linkify) return false; + if (state.linkLevel > 0) return false; + const pos = state.pos; + const max = state.posMax; + if (pos + 3 > max) return false; + if (state.src.charCodeAt(pos) !== 0x3A /* : */) return false; + if (state.src.charCodeAt(pos + 1) !== 0x2F /* / */) return false; + if (state.src.charCodeAt(pos + 2) !== 0x2F /* / */) return false; + const match = state.pending.match(SCHEME_RE); + if (!match) return false; + const proto = match[1]; + const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length)); + if (!link) return false; + let url = link.url; + + // invalid link, but still detected by linkify somehow; + // need to check to prevent infinite loop below + if (url.length <= proto.length) return false; + + // disallow '*' at the end of the link (conflicts with emphasis) + url = url.replace(/\*+$/, ''); + const fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) return false; + if (!silent) { + state.pending = state.pending.slice(0, -proto.length); + const token_o = state.push('link_open', 'a', 1); + token_o.attrs = [['href', fullUrl]]; + token_o.markup = 'linkify'; + token_o.info = 'auto'; + const token_t = state.push('text', '', 0); + token_t.content = state.md.normalizeLinkText(url); + const token_c = state.push('link_close', 'a', -1); + token_c.markup = 'linkify'; + token_c.info = 'auto'; + } + state.pos += url.length - proto.length; + return true; +} + +// Proceess '\n' + +function newline(state, silent) { + let pos = state.pos; + if (state.src.charCodeAt(pos) !== 0x0A /* \n */) { + return false; + } + const pmax = state.pending.length - 1; + const max = state.posMax; + + // ' \n' -> hardbreak + // Lookup in pending chars is bad practice! Don't copy to other rules! + // Pending string is stored in concat mode, indexed lookups will cause + // convertion to flat mode. + if (!silent) { + if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) { + if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) { + // Find whitespaces tail of pending chars. + let ws = pmax - 1; + while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws--; + state.pending = state.pending.slice(0, ws); + state.push('hardbreak', 'br', 0); + } else { + state.pending = state.pending.slice(0, -1); + state.push('softbreak', 'br', 0); + } + } else { + state.push('softbreak', 'br', 0); + } + } + pos++; + + // skip heading spaces for next line + while (pos < max && isSpace(state.src.charCodeAt(pos))) { + pos++; + } + state.pos = pos; + return true; +} + +// Process escaped chars and hardbreaks + +const ESCAPED = []; +for (let i = 0; i < 256; i++) { + ESCAPED.push(0); +} +'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'.split('').forEach(function (ch) { + ESCAPED[ch.charCodeAt(0)] = 1; +}); +function escape(state, silent) { + let pos = state.pos; + const max = state.posMax; + if (state.src.charCodeAt(pos) !== 0x5C /* \ */) return false; + pos++; + + // '\' at the end of the inline block + if (pos >= max) return false; + let ch1 = state.src.charCodeAt(pos); + if (ch1 === 0x0A) { + if (!silent) { + state.push('hardbreak', 'br', 0); + } + pos++; + // skip leading whitespaces from next line + while (pos < max) { + ch1 = state.src.charCodeAt(pos); + if (!isSpace(ch1)) break; + pos++; + } + state.pos = pos; + return true; + } + let escapedStr = state.src[pos]; + if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) { + const ch2 = state.src.charCodeAt(pos + 1); + if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { + escapedStr += state.src[pos + 1]; + pos++; + } + } + const origStr = '\\' + escapedStr; + if (!silent) { + const token = state.push('text_special', '', 0); + if (ch1 < 256 && ESCAPED[ch1] !== 0) { + token.content = escapedStr; + } else { + token.content = origStr; + } + token.markup = origStr; + token.info = 'escape'; + } + state.pos = pos + 1; + return true; +} + +// Parse backticks + +function backtick(state, silent) { + let pos = state.pos; + const ch = state.src.charCodeAt(pos); + if (ch !== 0x60 /* ` */) { + return false; + } + const start = pos; + pos++; + const max = state.posMax; + + // scan marker length + while (pos < max && state.src.charCodeAt(pos) === 0x60 /* ` */) { + pos++; + } + const marker = state.src.slice(start, pos); + const openerLength = marker.length; + if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) { + if (!silent) state.pending += marker; + state.pos += openerLength; + return true; + } + let matchEnd = pos; + let matchStart; + + // Nothing found in the cache, scan until the end of the line (or until marker is found) + while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) { + matchEnd = matchStart + 1; + + // scan marker length + while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60 /* ` */) { + matchEnd++; + } + const closerLength = matchEnd - matchStart; + if (closerLength === openerLength) { + // Found matching closer length. + if (!silent) { + const token = state.push('code_inline', 'code', 0); + token.markup = marker; + token.content = state.src.slice(pos, matchStart).replace(/\n/g, ' ').replace(/^ (.+) $/, '$1'); + } + state.pos = matchEnd; + return true; + } + + // Some different length found, put it in cache as upper limit of where closer can be found + state.backticks[closerLength] = matchStart; + } + + // Scanned through the end, didn't find anything + state.backticksScanned = true; + if (!silent) state.pending += marker; + state.pos += openerLength; + return true; +} + +// ~~strike through~~ +// + +// Insert each marker as a separate text token, and add it to delimiter list +// +function strikethrough_tokenize(state, silent) { + const start = state.pos; + const marker = state.src.charCodeAt(start); + if (silent) { + return false; + } + if (marker !== 0x7E /* ~ */) { + return false; + } + const scanned = state.scanDelims(state.pos, true); + let len = scanned.length; + const ch = String.fromCharCode(marker); + if (len < 2) { + return false; + } + let token; + if (len % 2) { + token = state.push('text', '', 0); + token.content = ch; + len--; + } + for (let i = 0; i < len; i += 2) { + token = state.push('text', '', 0); + token.content = ch + ch; + state.delimiters.push({ + marker, + length: 0, + // disable "rule of 3" length checks meant for emphasis + token: state.tokens.length - 1, + end: -1, + open: scanned.can_open, + close: scanned.can_close + }); + } + state.pos += scanned.length; + return true; +} +function postProcess$1(state, delimiters) { + let token; + const loneMarkers = []; + const max = delimiters.length; + for (let i = 0; i < max; i++) { + const startDelim = delimiters[i]; + if (startDelim.marker !== 0x7E /* ~ */) { + continue; + } + if (startDelim.end === -1) { + continue; + } + const endDelim = delimiters[startDelim.end]; + token = state.tokens[startDelim.token]; + token.type = 's_open'; + token.tag = 's'; + token.nesting = 1; + token.markup = '~~'; + token.content = ''; + token = state.tokens[endDelim.token]; + token.type = 's_close'; + token.tag = 's'; + token.nesting = -1; + token.markup = '~~'; + token.content = ''; + if (state.tokens[endDelim.token - 1].type === 'text' && state.tokens[endDelim.token - 1].content === '~') { + loneMarkers.push(endDelim.token - 1); + } + } + + // If a marker sequence has an odd number of characters, it's splitted + // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the + // start of the sequence. + // + // So, we have to move all those markers after subsequent s_close tags. + // + while (loneMarkers.length) { + const i = loneMarkers.pop(); + let j = i + 1; + while (j < state.tokens.length && state.tokens[j].type === 's_close') { + j++; + } + j--; + if (i !== j) { + token = state.tokens[j]; + state.tokens[j] = state.tokens[i]; + state.tokens[i] = token; + } + } +} + +// Walk through delimiter list and replace text tokens with tags +// +function strikethrough_postProcess(state) { + const tokens_meta = state.tokens_meta; + const max = state.tokens_meta.length; + postProcess$1(state, state.delimiters); + for (let curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + postProcess$1(state, tokens_meta[curr].delimiters); + } + } +} +var r_strikethrough = { + tokenize: strikethrough_tokenize, + postProcess: strikethrough_postProcess +}; + +// Process *this* and _that_ +// + +// Insert each marker as a separate text token, and add it to delimiter list +// +function emphasis_tokenize(state, silent) { + const start = state.pos; + const marker = state.src.charCodeAt(start); + if (silent) { + return false; + } + if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { + return false; + } + const scanned = state.scanDelims(state.pos, marker === 0x2A); + for (let i = 0; i < scanned.length; i++) { + const token = state.push('text', '', 0); + token.content = String.fromCharCode(marker); + state.delimiters.push({ + // Char code of the starting marker (number). + // + marker, + // Total length of these series of delimiters. + // + length: scanned.length, + // A position of the token this delimiter corresponds to. + // + token: state.tokens.length - 1, + // If this delimiter is matched as a valid opener, `end` will be + // equal to its position, otherwise it's `-1`. + // + end: -1, + // Boolean flags that determine if this delimiter could open or close + // an emphasis. + // + open: scanned.can_open, + close: scanned.can_close + }); + } + state.pos += scanned.length; + return true; +} +function postProcess(state, delimiters) { + const max = delimiters.length; + for (let i = max - 1; i >= 0; i--) { + const startDelim = delimiters[i]; + if (startDelim.marker !== 0x5F /* _ */ && startDelim.marker !== 0x2A /* * */) { + continue; + } + + // Process only opening markers + if (startDelim.end === -1) { + continue; + } + const endDelim = delimiters[startDelim.end]; + + // If the previous delimiter has the same marker and is adjacent to this one, + // merge those into one strong delimiter. + // + // `whatever` -> `whatever` + // + const isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && + // check that first two markers match and adjacent + delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 && + // check that last two markers are adjacent (we can safely assume they match) + delimiters[startDelim.end + 1].token === endDelim.token + 1; + const ch = String.fromCharCode(startDelim.marker); + const token_o = state.tokens[startDelim.token]; + token_o.type = isStrong ? 'strong_open' : 'em_open'; + token_o.tag = isStrong ? 'strong' : 'em'; + token_o.nesting = 1; + token_o.markup = isStrong ? ch + ch : ch; + token_o.content = ''; + const token_c = state.tokens[endDelim.token]; + token_c.type = isStrong ? 'strong_close' : 'em_close'; + token_c.tag = isStrong ? 'strong' : 'em'; + token_c.nesting = -1; + token_c.markup = isStrong ? ch + ch : ch; + token_c.content = ''; + if (isStrong) { + state.tokens[delimiters[i - 1].token].content = ''; + state.tokens[delimiters[startDelim.end + 1].token].content = ''; + i--; + } + } +} + +// Walk through delimiter list and replace text tokens with tags +// +function emphasis_post_process(state) { + const tokens_meta = state.tokens_meta; + const max = state.tokens_meta.length; + postProcess(state, state.delimiters); + for (let curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + postProcess(state, tokens_meta[curr].delimiters); + } + } +} +var r_emphasis = { + tokenize: emphasis_tokenize, + postProcess: emphasis_post_process +}; + +// Process [link]( "stuff") + +function link(state, silent) { + let code, label, res, ref; + let href = ''; + let title = ''; + let start = state.pos; + let parseReference = true; + if (state.src.charCodeAt(state.pos) !== 0x5B /* [ */) { + return false; + } + const oldPos = state.pos; + const max = state.posMax; + const labelStart = state.pos + 1; + const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true); + + // parser failed to find ']', so it's not a valid link + if (labelEnd < 0) { + return false; + } + let pos = labelEnd + 1; + if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { + // + // Inline link + // + + // might have found a valid shortcut link, disable reference parsing + parseReference = false; + + // [link]( "title" ) + // ^^ skipping these spaces + pos++; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + if (pos >= max) { + return false; + } + + // [link]( "title" ) + // ^^^^^^ parsing link destination + start = pos; + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); + if (res.ok) { + href = state.md.normalizeLink(res.str); + if (state.md.validateLink(href)) { + pos = res.pos; + } else { + href = ''; + } + + // [link]( "title" ) + // ^^ skipping these spaces + start = pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + + // [link]( "title" ) + // ^^^^^^^ parsing link title + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + + // [link]( "title" ) + // ^^ skipping these spaces + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + } + } + if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { + // parsing a valid shortcut link failed, fallback to reference + parseReference = true; + } + pos++; + } + if (parseReference) { + // + // Link reference + // + if (typeof state.env.references === 'undefined') { + return false; + } + if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { + start = pos + 1; + pos = state.md.helpers.parseLinkLabel(state, pos); + if (pos >= 0) { + label = state.src.slice(start, pos++); + } else { + pos = labelEnd + 1; + } + } else { + pos = labelEnd + 1; + } + + // covers label === '' and label === undefined + // (collapsed reference link and shortcut reference link respectively) + if (!label) { + label = state.src.slice(labelStart, labelEnd); + } + ref = state.env.references[normalizeReference(label)]; + if (!ref) { + state.pos = oldPos; + return false; + } + href = ref.href; + title = ref.title; + } + + // + // We found the end of the link, and know for a fact it's a valid link; + // so all that's left to do is to call tokenizer. + // + if (!silent) { + state.pos = labelStart; + state.posMax = labelEnd; + const token_o = state.push('link_open', 'a', 1); + const attrs = [['href', href]]; + token_o.attrs = attrs; + if (title) { + attrs.push(['title', title]); + } + state.linkLevel++; + state.md.inline.tokenize(state); + state.linkLevel--; + state.push('link_close', 'a', -1); + } + state.pos = pos; + state.posMax = max; + return true; +} + +// Process ![image]( "title") + +function image(state, silent) { + let code, content, label, pos, ref, res, title, start; + let href = ''; + const oldPos = state.pos; + const max = state.posMax; + if (state.src.charCodeAt(state.pos) !== 0x21 /* ! */) { + return false; + } + if (state.src.charCodeAt(state.pos + 1) !== 0x5B /* [ */) { + return false; + } + const labelStart = state.pos + 2; + const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false); + + // parser failed to find ']', so it's not a valid link + if (labelEnd < 0) { + return false; + } + pos = labelEnd + 1; + if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { + // + // Inline link + // + + // [link]( "title" ) + // ^^ skipping these spaces + pos++; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + if (pos >= max) { + return false; + } + + // [link]( "title" ) + // ^^^^^^ parsing link destination + start = pos; + res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); + if (res.ok) { + href = state.md.normalizeLink(res.str); + if (state.md.validateLink(href)) { + pos = res.pos; + } else { + href = ''; + } + } + + // [link]( "title" ) + // ^^ skipping these spaces + start = pos; + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + + // [link]( "title" ) + // ^^^^^^^ parsing link title + res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); + if (pos < max && start !== pos && res.ok) { + title = res.str; + pos = res.pos; + + // [link]( "title" ) + // ^^ skipping these spaces + for (; pos < max; pos++) { + code = state.src.charCodeAt(pos); + if (!isSpace(code) && code !== 0x0A) { + break; + } + } + } else { + title = ''; + } + if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { + state.pos = oldPos; + return false; + } + pos++; + } else { + // + // Link reference + // + if (typeof state.env.references === 'undefined') { + return false; + } + if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { + start = pos + 1; + pos = state.md.helpers.parseLinkLabel(state, pos); + if (pos >= 0) { + label = state.src.slice(start, pos++); + } else { + pos = labelEnd + 1; + } + } else { + pos = labelEnd + 1; + } + + // covers label === '' and label === undefined + // (collapsed reference link and shortcut reference link respectively) + if (!label) { + label = state.src.slice(labelStart, labelEnd); + } + ref = state.env.references[normalizeReference(label)]; + if (!ref) { + state.pos = oldPos; + return false; + } + href = ref.href; + title = ref.title; + } + + // + // We found the end of the link, and know for a fact it's a valid link; + // so all that's left to do is to call tokenizer. + // + if (!silent) { + content = state.src.slice(labelStart, labelEnd); + const tokens = []; + state.md.inline.parse(content, state.md, state.env, tokens); + const token = state.push('image', 'img', 0); + const attrs = [['src', href], ['alt', '']]; + token.attrs = attrs; + token.children = tokens; + token.content = content; + if (title) { + attrs.push(['title', title]); + } + } + state.pos = pos; + state.posMax = max; + return true; +} + +// Process autolinks '' + +/* eslint max-len:0 */ +const EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/; +/* eslint-disable-next-line no-control-regex */ +const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/; +function autolink(state, silent) { + let pos = state.pos; + if (state.src.charCodeAt(pos) !== 0x3C /* < */) { + return false; + } + const start = state.pos; + const max = state.posMax; + for (;;) { + if (++pos >= max) return false; + const ch = state.src.charCodeAt(pos); + if (ch === 0x3C /* < */) return false; + if (ch === 0x3E /* > */) break; + } + const url = state.src.slice(start + 1, pos); + if (AUTOLINK_RE.test(url)) { + const fullUrl = state.md.normalizeLink(url); + if (!state.md.validateLink(fullUrl)) { + return false; + } + if (!silent) { + const token_o = state.push('link_open', 'a', 1); + token_o.attrs = [['href', fullUrl]]; + token_o.markup = 'autolink'; + token_o.info = 'auto'; + const token_t = state.push('text', '', 0); + token_t.content = state.md.normalizeLinkText(url); + const token_c = state.push('link_close', 'a', -1); + token_c.markup = 'autolink'; + token_c.info = 'auto'; + } + state.pos += url.length + 2; + return true; + } + if (EMAIL_RE.test(url)) { + const fullUrl = state.md.normalizeLink('mailto:' + url); + if (!state.md.validateLink(fullUrl)) { + return false; + } + if (!silent) { + const token_o = state.push('link_open', 'a', 1); + token_o.attrs = [['href', fullUrl]]; + token_o.markup = 'autolink'; + token_o.info = 'auto'; + const token_t = state.push('text', '', 0); + token_t.content = state.md.normalizeLinkText(url); + const token_c = state.push('link_close', 'a', -1); + token_c.markup = 'autolink'; + token_c.info = 'auto'; + } + state.pos += url.length + 2; + return true; + } + return false; +} + +// Process html tags + +function isLinkOpen(str) { + return /^\s]/i.test(str); +} +function isLinkClose(str) { + return /^<\/a\s*>/i.test(str); +} +function isLetter(ch) { + /* eslint no-bitwise:0 */ + const lc = ch | 0x20; // to lower case + return lc >= 0x61 /* a */ && lc <= 0x7a /* z */; +} + +function html_inline(state, silent) { + if (!state.md.options.html) { + return false; + } + + // Check start + const max = state.posMax; + const pos = state.pos; + if (state.src.charCodeAt(pos) !== 0x3C /* < */ || pos + 2 >= max) { + return false; + } + + // Quick fail on second char + const ch = state.src.charCodeAt(pos + 1); + if (ch !== 0x21 /* ! */ && ch !== 0x3F /* ? */ && ch !== 0x2F /* / */ && !isLetter(ch)) { + return false; + } + const match = state.src.slice(pos).match(HTML_TAG_RE); + if (!match) { + return false; + } + if (!silent) { + const token = state.push('html_inline', '', 0); + token.content = match[0]; + if (isLinkOpen(token.content)) state.linkLevel++; + if (isLinkClose(token.content)) state.linkLevel--; + } + state.pos += match[0].length; + return true; +} + +// Process html entity - {, ¯, ", ... + +const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i; +const NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i; +function entity(state, silent) { + const pos = state.pos; + const max = state.posMax; + if (state.src.charCodeAt(pos) !== 0x26 /* & */) return false; + if (pos + 1 >= max) return false; + const ch = state.src.charCodeAt(pos + 1); + if (ch === 0x23 /* # */) { + const match = state.src.slice(pos).match(DIGITAL_RE); + if (match) { + if (!silent) { + const code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10); + const token = state.push('text_special', '', 0); + token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD); + token.markup = match[0]; + token.info = 'entity'; + } + state.pos += match[0].length; + return true; + } + } else { + const match = state.src.slice(pos).match(NAMED_RE); + if (match) { + const decoded = entities.decodeHTML(match[0]); + if (decoded !== match[0]) { + if (!silent) { + const token = state.push('text_special', '', 0); + token.content = decoded; + token.markup = match[0]; + token.info = 'entity'; + } + state.pos += match[0].length; + return true; + } + } + } + return false; +} + +// For each opening emphasis-like marker find a matching closing one +// + +function processDelimiters(delimiters) { + const openersBottom = {}; + const max = delimiters.length; + if (!max) return; + + // headerIdx is the first delimiter of the current (where closer is) delimiter run + let headerIdx = 0; + let lastTokenIdx = -2; // needs any value lower than -1 + const jumps = []; + for (let closerIdx = 0; closerIdx < max; closerIdx++) { + const closer = delimiters[closerIdx]; + jumps.push(0); + + // markers belong to same delimiter run if: + // - they have adjacent tokens + // - AND markers are the same + // + if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) { + headerIdx = closerIdx; + } + lastTokenIdx = closer.token; + + // Length is only used for emphasis-specific "rule of 3", + // if it's not defined (in strikethrough or 3rd party plugins), + // we can default it to 0 to disable those checks. + // + closer.length = closer.length || 0; + if (!closer.close) continue; + + // Previously calculated lower bounds (previous fails) + // for each marker, each delimiter length modulo 3, + // and for whether this closer can be an opener; + // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460 + /* eslint-disable-next-line no-prototype-builtins */ + if (!openersBottom.hasOwnProperty(closer.marker)) { + openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]; + } + const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3]; + let openerIdx = headerIdx - jumps[headerIdx] - 1; + let newMinOpenerIdx = openerIdx; + for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) { + const opener = delimiters[openerIdx]; + if (opener.marker !== closer.marker) continue; + if (opener.open && opener.end < 0) { + let isOddMatch = false; + + // from spec: + // + // If one of the delimiters can both open and close emphasis, then the + // sum of the lengths of the delimiter runs containing the opening and + // closing delimiters must not be a multiple of 3 unless both lengths + // are multiples of 3. + // + if (opener.close || closer.open) { + if ((opener.length + closer.length) % 3 === 0) { + if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { + isOddMatch = true; + } + } + } + if (!isOddMatch) { + // If previous delimiter cannot be an opener, we can safely skip + // the entire sequence in future checks. This is required to make + // sure algorithm has linear complexity (see *_*_*_*_*_... case). + // + const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0; + jumps[closerIdx] = closerIdx - openerIdx + lastJump; + jumps[openerIdx] = lastJump; + closer.open = false; + opener.end = closerIdx; + opener.close = false; + newMinOpenerIdx = -1; + // treat next token as start of run, + // it optimizes skips in **<...>**a**<...>** pathological case + lastTokenIdx = -2; + break; + } + } + } + if (newMinOpenerIdx !== -1) { + // If match for this delimiter run failed, we want to set lower bound for + // future lookups. This is required to make sure algorithm has linear + // complexity. + // + // See details here: + // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442 + // + openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx; + } + } +} +function link_pairs(state) { + const tokens_meta = state.tokens_meta; + const max = state.tokens_meta.length; + processDelimiters(state.delimiters); + for (let curr = 0; curr < max; curr++) { + if (tokens_meta[curr] && tokens_meta[curr].delimiters) { + processDelimiters(tokens_meta[curr].delimiters); + } + } +} + +// Clean up tokens after emphasis and strikethrough postprocessing: +// merge adjacent text nodes into one and re-calculate all token levels +// +// This is necessary because initially emphasis delimiter markers (*, _, ~) +// are treated as their own separate text tokens. Then emphasis rule either +// leaves them as text (needed to merge with adjacent text) or turns them +// into opening/closing tags (which messes up levels inside). +// + +function fragments_join(state) { + let curr, last; + let level = 0; + const tokens = state.tokens; + const max = state.tokens.length; + for (curr = last = 0; curr < max; curr++) { + // re-calculate levels after emphasis/strikethrough turns some text nodes + // into opening/closing tags + if (tokens[curr].nesting < 0) level--; // closing tag + tokens[curr].level = level; + if (tokens[curr].nesting > 0) level++; // opening tag + + if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { + // collapse two adjacent text nodes + tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; + } else { + if (curr !== last) { + tokens[last] = tokens[curr]; + } + last++; + } + } + if (curr !== last) { + tokens.length = last; + } +} + +/** internal + * class ParserInline + * + * Tokenizes paragraph content. + **/ + +// Parser rules + +const _rules = [['text', text], ['linkify', linkify], ['newline', newline], ['escape', escape], ['backticks', backtick], ['strikethrough', r_strikethrough.tokenize], ['emphasis', r_emphasis.tokenize], ['link', link], ['image', image], ['autolink', autolink], ['html_inline', html_inline], ['entity', entity]]; + +// `rule2` ruleset was created specifically for emphasis/strikethrough +// post-processing and may be changed in the future. +// +// Don't use this for anything except pairs (plugins working with `balance_pairs`). +// +const _rules2 = [['balance_pairs', link_pairs], ['strikethrough', r_strikethrough.postProcess], ['emphasis', r_emphasis.postProcess], +// rules for pairs separate '**' into its own text tokens, which may be left unused, +// rule below merges unused segments back with the rest of the text +['fragments_join', fragments_join]]; + +/** + * new ParserInline() + **/ +function ParserInline() { + /** + * ParserInline#ruler -> Ruler + * + * [[Ruler]] instance. Keep configuration of inline rules. + **/ + this.ruler = new Ruler(); + for (let i = 0; i < _rules.length; i++) { + this.ruler.push(_rules[i][0], _rules[i][1]); + } + + /** + * ParserInline#ruler2 -> Ruler + * + * [[Ruler]] instance. Second ruler used for post-processing + * (e.g. in emphasis-like rules). + **/ + this.ruler2 = new Ruler(); + for (let i = 0; i < _rules2.length; i++) { + this.ruler2.push(_rules2[i][0], _rules2[i][1]); + } +} + +// Skip single token by running all rules in validation mode; +// returns `true` if any rule reported success +// +ParserInline.prototype.skipToken = function (state) { + const pos = state.pos; + const rules = this.ruler.getRules(''); + const len = rules.length; + const maxNesting = state.md.options.maxNesting; + const cache = state.cache; + if (typeof cache[pos] !== 'undefined') { + state.pos = cache[pos]; + return; + } + let ok = false; + if (state.level < maxNesting) { + for (let i = 0; i < len; i++) { + // Increment state.level and decrement it later to limit recursion. + // It's harmless to do here, because no tokens are created. But ideally, + // we'd need a separate private state variable for this purpose. + // + state.level++; + ok = rules[i](state, true); + state.level--; + if (ok) { + if (pos >= state.pos) { + throw new Error("inline rule didn't increment state.pos"); + } + break; + } + } + } else { + // Too much nesting, just skip until the end of the paragraph. + // + // NOTE: this will cause links to behave incorrectly in the following case, + // when an amount of `[` is exactly equal to `maxNesting + 1`: + // + // [[[[[[[[[[[[[[[[[[[[[foo]() + // + // TODO: remove this workaround when CM standard will allow nested links + // (we can replace it by preventing links from being parsed in + // validation mode) + // + state.pos = state.posMax; + } + if (!ok) { + state.pos++; + } + cache[pos] = state.pos; +}; + +// Generate tokens for input range +// +ParserInline.prototype.tokenize = function (state) { + const rules = this.ruler.getRules(''); + const len = rules.length; + const end = state.posMax; + const maxNesting = state.md.options.maxNesting; + while (state.pos < end) { + // Try all possible rules. + // On success, rule should: + // + // - update `state.pos` + // - update `state.tokens` + // - return true + const prevPos = state.pos; + let ok = false; + if (state.level < maxNesting) { + for (let i = 0; i < len; i++) { + ok = rules[i](state, false); + if (ok) { + if (prevPos >= state.pos) { + throw new Error("inline rule didn't increment state.pos"); + } + break; + } + } + } + if (ok) { + if (state.pos >= end) { + break; + } + continue; + } + state.pending += state.src[state.pos++]; + } + if (state.pending) { + state.pushPending(); + } +}; + +/** + * ParserInline.parse(str, md, env, outTokens) + * + * Process input string and push inline tokens into `outTokens` + **/ +ParserInline.prototype.parse = function (str, md, env, outTokens) { + const state = new this.State(str, md, env, outTokens); + this.tokenize(state); + const rules = this.ruler2.getRules(''); + const len = rules.length; + for (let i = 0; i < len; i++) { + rules[i](state); + } +}; +ParserInline.prototype.State = StateInline; + +// markdown-it default options + +var cfg_default = { + options: { + // Enable HTML tags in source + html: false, + // Use '/' to close single tags (
) + xhtmlOut: false, + // Convert '\n' in paragraphs into
+ breaks: false, + // CSS language prefix for fenced blocks + langPrefix: 'language-', + // autoconvert URL-like texts to links + linkify: false, + // Enable some language-neutral replacements + quotes beautification + typographer: false, + // Double + single quotes replacement pairs, when typographer enabled, + // and smartquotes on. Could be either a String or an Array. + // + // For example, you can use '«»„“' for Russian, '„“‚‘' for German, + // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). + quotes: '\u201c\u201d\u2018\u2019', + /* “”‘’ */ + + // Highlighter function. Should return escaped HTML, + // or '' if the source string is not changed and should be escaped externaly. + // If result starts with ) + xhtmlOut: false, + // Convert '\n' in paragraphs into
+ breaks: false, + // CSS language prefix for fenced blocks + langPrefix: 'language-', + // autoconvert URL-like texts to links + linkify: false, + // Enable some language-neutral replacements + quotes beautification + typographer: false, + // Double + single quotes replacement pairs, when typographer enabled, + // and smartquotes on. Could be either a String or an Array. + // + // For example, you can use '«»„“' for Russian, '„“‚‘' for German, + // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). + quotes: '\u201c\u201d\u2018\u2019', + /* “”‘’ */ + + // Highlighter function. Should return escaped HTML, + // or '' if the source string is not changed and should be escaped externaly. + // If result starts with ) + xhtmlOut: true, + // Convert '\n' in paragraphs into
+ breaks: false, + // CSS language prefix for fenced blocks + langPrefix: 'language-', + // autoconvert URL-like texts to links + linkify: false, + // Enable some language-neutral replacements + quotes beautification + typographer: false, + // Double + single quotes replacement pairs, when typographer enabled, + // and smartquotes on. Could be either a String or an Array. + // + // For example, you can use '«»„“' for Russian, '„“‚‘' for German, + // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). + quotes: '\u201c\u201d\u2018\u2019', + /* “”‘’ */ + + // Highlighter function. Should return escaped HTML, + // or '' if the source string is not changed and should be escaped externaly. + // If result starts with = 0) { + try { + parsed.hostname = punycode.toASCII(parsed.hostname); + } catch (er) {/**/} + } + } + return mdurl__namespace.encode(mdurl__namespace.format(parsed)); +} +function normalizeLinkText(url) { + const parsed = mdurl__namespace.parse(url, true); + if (parsed.hostname) { + // Encode hostnames in urls like: + // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` + // + // We don't encode unknown schemas, because it's likely that we encode + // something we shouldn't (e.g. `skype:name` treated as `skype:host`) + // + if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { + try { + parsed.hostname = punycode.toUnicode(parsed.hostname); + } catch (er) {/**/} + } + } + + // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720 + return mdurl__namespace.decode(mdurl__namespace.format(parsed), mdurl__namespace.decode.defaultChars + '%'); +} + +/** + * class MarkdownIt + * + * Main parser/renderer class. + * + * ##### Usage + * + * ```javascript + * // node.js, "classic" way: + * var MarkdownIt = require('markdown-it'), + * md = new MarkdownIt(); + * var result = md.render('# markdown-it rulezz!'); + * + * // node.js, the same, but with sugar: + * var md = require('markdown-it')(); + * var result = md.render('# markdown-it rulezz!'); + * + * // browser without AMD, added to "window" on script load + * // Note, there are no dash. + * var md = window.markdownit(); + * var result = md.render('# markdown-it rulezz!'); + * ``` + * + * Single line rendering, without paragraph wrap: + * + * ```javascript + * var md = require('markdown-it')(); + * var result = md.renderInline('__markdown-it__ rulezz!'); + * ``` + **/ + +/** + * new MarkdownIt([presetName, options]) + * - presetName (String): optional, `commonmark` / `zero` + * - options (Object) + * + * Creates parser instanse with given config. Can be called without `new`. + * + * ##### presetName + * + * MarkdownIt provides named presets as a convenience to quickly + * enable/disable active syntax rules and options for common use cases. + * + * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.mjs) - + * configures parser to strict [CommonMark](http://commonmark.org/) mode. + * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.mjs) - + * similar to GFM, used when no preset name given. Enables all available rules, + * but still without html, typographer & autolinker. + * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.mjs) - + * all rules disabled. Useful to quickly setup your config via `.enable()`. + * For example, when you need only `bold` and `italic` markup and nothing else. + * + * ##### options: + * + * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful! + * That's not safe! You may need external sanitizer to protect output from XSS. + * It's better to extend features via plugins, instead of enabling HTML. + * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags + * (`
`). This is needed only for full CommonMark compatibility. In real + * world you will need HTML output. + * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `
`. + * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks. + * Can be useful for external highlighters. + * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links. + * - __typographer__ - `false`. Set `true` to enable [some language-neutral + * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs) + + * quotes beautification (smartquotes). + * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement + * pairs, when typographer enabled and smartquotes on. For example, you can + * use `'«»„“'` for Russian, `'„“‚‘'` for German, and + * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp). + * - __highlight__ - `null`. Highlighter function for fenced code blocks. + * Highlighter `function (str, lang)` should return escaped HTML. It can also + * return empty string if the source was not changed and should be escaped + * externaly. If result starts with ` or ``): + * + * ```javascript + * var hljs = require('highlight.js') // https://highlightjs.org/ + * + * // Actual default values + * var md = require('markdown-it')({ + * highlight: function (str, lang) { + * if (lang && hljs.getLanguage(lang)) { + * try { + * return '
' +
+ *                hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
+ *                '
'; + * } catch (__) {} + * } + * + * return '
' + md.utils.escapeHtml(str) + '
'; + * } + * }); + * ``` + * + **/ +function MarkdownIt(presetName, options) { + if (!(this instanceof MarkdownIt)) { + return new MarkdownIt(presetName, options); + } + if (!options) { + if (!isString(presetName)) { + options = presetName || {}; + presetName = 'default'; + } + } + + /** + * MarkdownIt#inline -> ParserInline + * + * Instance of [[ParserInline]]. You may need it to add new rules when + * writing plugins. For simple rules control use [[MarkdownIt.disable]] and + * [[MarkdownIt.enable]]. + **/ + this.inline = new ParserInline(); + + /** + * MarkdownIt#block -> ParserBlock + * + * Instance of [[ParserBlock]]. You may need it to add new rules when + * writing plugins. For simple rules control use [[MarkdownIt.disable]] and + * [[MarkdownIt.enable]]. + **/ + this.block = new ParserBlock(); + + /** + * MarkdownIt#core -> Core + * + * Instance of [[Core]] chain executor. You may need it to add new rules when + * writing plugins. For simple rules control use [[MarkdownIt.disable]] and + * [[MarkdownIt.enable]]. + **/ + this.core = new Core(); + + /** + * MarkdownIt#renderer -> Renderer + * + * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering + * rules for new token types, generated by plugins. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')(); + * + * function myToken(tokens, idx, options, env, self) { + * //... + * return result; + * }; + * + * md.renderer.rules['my_token'] = myToken + * ``` + * + * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs). + **/ + this.renderer = new Renderer(); + + /** + * MarkdownIt#linkify -> LinkifyIt + * + * [linkify-it](https://github.com/markdown-it/linkify-it) instance. + * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs) + * rule. + **/ + this.linkify = new LinkifyIt(); + + /** + * MarkdownIt#validateLink(url) -> Boolean + * + * Link validation function. CommonMark allows too much in links. By default + * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas + * except some embedded image types. + * + * You can change this behaviour: + * + * ```javascript + * var md = require('markdown-it')(); + * // enable everything + * md.validateLink = function () { return true; } + * ``` + **/ + this.validateLink = validateLink; + + /** + * MarkdownIt#normalizeLink(url) -> String + * + * Function used to encode link url to a machine-readable format, + * which includes url-encoding, punycode, etc. + **/ + this.normalizeLink = normalizeLink; + + /** + * MarkdownIt#normalizeLinkText(url) -> String + * + * Function used to decode link url to a human-readable format` + **/ + this.normalizeLinkText = normalizeLinkText; + + // Expose utils & helpers for easy acces from plugins + + /** + * MarkdownIt#utils -> utils + * + * Assorted utility functions, useful to write plugins. See details + * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.mjs). + **/ + this.utils = utils; + + /** + * MarkdownIt#helpers -> helpers + * + * Link components parser functions, useful to write plugins. See details + * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers). + **/ + this.helpers = assign({}, helpers); + this.options = {}; + this.configure(presetName); + if (options) { + this.set(options); + } +} + +/** chainable + * MarkdownIt.set(options) + * + * Set parser options (in the same format as in constructor). Probably, you + * will never need it, but you can change options after constructor call. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')() + * .set({ html: true, breaks: true }) + * .set({ typographer, true }); + * ``` + * + * __Note:__ To achieve the best possible performance, don't modify a + * `markdown-it` instance options on the fly. If you need multiple configurations + * it's best to create multiple instances and initialize each with separate + * config. + **/ +MarkdownIt.prototype.set = function (options) { + assign(this.options, options); + return this; +}; + +/** chainable, internal + * MarkdownIt.configure(presets) + * + * Batch load of all options and compenent settings. This is internal method, + * and you probably will not need it. But if you will - see available presets + * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets) + * + * We strongly recommend to use presets instead of direct config loads. That + * will give better compatibility with next versions. + **/ +MarkdownIt.prototype.configure = function (presets) { + const self = this; + if (isString(presets)) { + const presetName = presets; + presets = config[presetName]; + if (!presets) { + throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); + } + } + if (!presets) { + throw new Error('Wrong `markdown-it` preset, can\'t be empty'); + } + if (presets.options) { + self.set(presets.options); + } + if (presets.components) { + Object.keys(presets.components).forEach(function (name) { + if (presets.components[name].rules) { + self[name].ruler.enableOnly(presets.components[name].rules); + } + if (presets.components[name].rules2) { + self[name].ruler2.enableOnly(presets.components[name].rules2); + } + }); + } + return this; +}; + +/** chainable + * MarkdownIt.enable(list, ignoreInvalid) + * - list (String|Array): rule name or list of rule names to enable + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * Enable list or rules. It will automatically find appropriate components, + * containing rules with given names. If rule not found, and `ignoreInvalid` + * not set - throws exception. + * + * ##### Example + * + * ```javascript + * var md = require('markdown-it')() + * .enable(['sub', 'sup']) + * .disable('smartquotes'); + * ``` + **/ +MarkdownIt.prototype.enable = function (list, ignoreInvalid) { + let result = []; + if (!Array.isArray(list)) { + list = [list]; + } + ['core', 'block', 'inline'].forEach(function (chain) { + result = result.concat(this[chain].ruler.enable(list, true)); + }, this); + result = result.concat(this.inline.ruler2.enable(list, true)); + const missed = list.filter(function (name) { + return result.indexOf(name) < 0; + }); + if (missed.length && !ignoreInvalid) { + throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed); + } + return this; +}; + +/** chainable + * MarkdownIt.disable(list, ignoreInvalid) + * - list (String|Array): rule name or list of rule names to disable. + * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. + * + * The same as [[MarkdownIt.enable]], but turn specified rules off. + **/ +MarkdownIt.prototype.disable = function (list, ignoreInvalid) { + let result = []; + if (!Array.isArray(list)) { + list = [list]; + } + ['core', 'block', 'inline'].forEach(function (chain) { + result = result.concat(this[chain].ruler.disable(list, true)); + }, this); + result = result.concat(this.inline.ruler2.disable(list, true)); + const missed = list.filter(function (name) { + return result.indexOf(name) < 0; + }); + if (missed.length && !ignoreInvalid) { + throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed); + } + return this; +}; + +/** chainable + * MarkdownIt.use(plugin, params) + * + * Load specified plugin with given params into current parser instance. + * It's just a sugar to call `plugin(md, params)` with curring. + * + * ##### Example + * + * ```javascript + * var iterator = require('markdown-it-for-inline'); + * var md = require('markdown-it')() + * .use(iterator, 'foo_replace', 'text', function (tokens, idx) { + * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); + * }); + * ``` + **/ +MarkdownIt.prototype.use = function (plugin /*, params, ... */) { + const args = [this].concat(Array.prototype.slice.call(arguments, 1)); + plugin.apply(plugin, args); + return this; +}; + +/** internal + * MarkdownIt.parse(src, env) -> Array + * - src (String): source string + * - env (Object): environment sandbox + * + * Parse input string and return list of block tokens (special token type + * "inline" will contain list of inline tokens). You should not call this + * method directly, until you write custom renderer (for example, to produce + * AST). + * + * `env` is used to pass data between "distributed" rules and return additional + * metadata like reference info, needed for the renderer. It also can be used to + * inject data in specific cases. Usually, you will be ok to pass `{}`, + * and then pass updated object to renderer. + **/ +MarkdownIt.prototype.parse = function (src, env) { + if (typeof src !== 'string') { + throw new Error('Input data should be a String'); + } + const state = new this.core.State(src, this, env); + this.core.process(state); + return state.tokens; +}; + +/** + * MarkdownIt.render(src [, env]) -> String + * - src (String): source string + * - env (Object): environment sandbox + * + * Render markdown string into html. It does all magic for you :). + * + * `env` can be used to inject additional metadata (`{}` by default). + * But you will not need it with high probability. See also comment + * in [[MarkdownIt.parse]]. + **/ +MarkdownIt.prototype.render = function (src, env) { + env = env || {}; + return this.renderer.render(this.parse(src, env), this.options, env); +}; + +/** internal + * MarkdownIt.parseInline(src, env) -> Array + * - src (String): source string + * - env (Object): environment sandbox + * + * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the + * block tokens list with the single `inline` element, containing parsed inline + * tokens in `children` property. Also updates `env` object. + **/ +MarkdownIt.prototype.parseInline = function (src, env) { + const state = new this.core.State(src, this, env); + state.inlineMode = true; + this.core.process(state); + return state.tokens; +}; + +/** + * MarkdownIt.renderInline(src [, env]) -> String + * - src (String): source string + * - env (Object): environment sandbox + * + * Similar to [[MarkdownIt.render]] but for single paragraph content. Result + * will NOT be wrapped into `

` tags. + **/ +MarkdownIt.prototype.renderInline = function (src, env) { + env = env || {}; + return this.renderer.render(this.parseInline(src, env), this.options, env); +}; +module.exports = MarkdownIt; + +/***/ }), + +/***/ "../node_modules/mdurl/build/index.cjs.js": +/*!************************************************!*\ + !*** ../node_modules/mdurl/build/index.cjs.js ***! + \************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +/* eslint-disable no-bitwise */ +const decodeCache = {}; +function getDecodeCache(exclude) { + let cache = decodeCache[exclude]; + if (cache) { + return cache; + } + cache = decodeCache[exclude] = []; + for (let i = 0; i < 128; i++) { + const ch = String.fromCharCode(i); + cache.push(ch); + } + for (let i = 0; i < exclude.length; i++) { + const ch = exclude.charCodeAt(i); + cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2); + } + return cache; +} + +// Decode percent-encoded string. +// +function decode(string, exclude) { + if (typeof exclude !== 'string') { + exclude = decode.defaultChars; + } + const cache = getDecodeCache(exclude); + return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) { + let result = ''; + for (let i = 0, l = seq.length; i < l; i += 3) { + const b1 = parseInt(seq.slice(i + 1, i + 3), 16); + if (b1 < 0x80) { + result += cache[b1]; + continue; + } + if ((b1 & 0xE0) === 0xC0 && i + 3 < l) { + // 110xxxxx 10xxxxxx + const b2 = parseInt(seq.slice(i + 4, i + 6), 16); + if ((b2 & 0xC0) === 0x80) { + const chr = b1 << 6 & 0x7C0 | b2 & 0x3F; + if (chr < 0x80) { + result += '\ufffd\ufffd'; + } else { + result += String.fromCharCode(chr); + } + i += 3; + continue; + } + } + if ((b1 & 0xF0) === 0xE0 && i + 6 < l) { + // 1110xxxx 10xxxxxx 10xxxxxx + const b2 = parseInt(seq.slice(i + 4, i + 6), 16); + const b3 = parseInt(seq.slice(i + 7, i + 9), 16); + if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) { + const chr = b1 << 12 & 0xF000 | b2 << 6 & 0xFC0 | b3 & 0x3F; + if (chr < 0x800 || chr >= 0xD800 && chr <= 0xDFFF) { + result += '\ufffd\ufffd\ufffd'; + } else { + result += String.fromCharCode(chr); + } + i += 6; + continue; + } + } + if ((b1 & 0xF8) === 0xF0 && i + 9 < l) { + // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx + const b2 = parseInt(seq.slice(i + 4, i + 6), 16); + const b3 = parseInt(seq.slice(i + 7, i + 9), 16); + const b4 = parseInt(seq.slice(i + 10, i + 12), 16); + if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) { + let chr = b1 << 18 & 0x1C0000 | b2 << 12 & 0x3F000 | b3 << 6 & 0xFC0 | b4 & 0x3F; + if (chr < 0x10000 || chr > 0x10FFFF) { + result += '\ufffd\ufffd\ufffd\ufffd'; + } else { + chr -= 0x10000; + result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF)); + } + i += 9; + continue; + } + } + result += '\ufffd'; + } + return result; + }); +} +decode.defaultChars = ';/?:@&=+$,#'; +decode.componentChars = ''; +const encodeCache = {}; + +// Create a lookup array where anything but characters in `chars` string +// and alphanumeric chars is percent-encoded. +// +function getEncodeCache(exclude) { + let cache = encodeCache[exclude]; + if (cache) { + return cache; + } + cache = encodeCache[exclude] = []; + for (let i = 0; i < 128; i++) { + const ch = String.fromCharCode(i); + if (/^[0-9a-z]$/i.test(ch)) { + // always allow unencoded alphanumeric characters + cache.push(ch); + } else { + cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2)); + } + } + for (let i = 0; i < exclude.length; i++) { + cache[exclude.charCodeAt(i)] = exclude[i]; + } + return cache; +} + +// Encode unsafe characters with percent-encoding, skipping already +// encoded sequences. +// +// - string - string to encode +// - exclude - list of characters to ignore (in addition to a-zA-Z0-9) +// - keepEscaped - don't encode '%' in a correct escape sequence (default: true) +// +function encode(string, exclude, keepEscaped) { + if (typeof exclude !== 'string') { + // encode(string, keepEscaped) + keepEscaped = exclude; + exclude = encode.defaultChars; + } + if (typeof keepEscaped === 'undefined') { + keepEscaped = true; + } + const cache = getEncodeCache(exclude); + let result = ''; + for (let i = 0, l = string.length; i < l; i++) { + const code = string.charCodeAt(i); + if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) { + if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { + result += string.slice(i, i + 3); + i += 2; + continue; + } + } + if (code < 128) { + result += cache[code]; + continue; + } + if (code >= 0xD800 && code <= 0xDFFF) { + if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) { + const nextCode = string.charCodeAt(i + 1); + if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { + result += encodeURIComponent(string[i] + string[i + 1]); + i++; + continue; + } + } + result += '%EF%BF%BD'; + continue; + } + result += encodeURIComponent(string[i]); + } + return result; +} +encode.defaultChars = ";/?:@&=+$,-_.!~*'()#"; +encode.componentChars = "-_.!~*'()"; +function format(url) { + let result = ''; + result += url.protocol || ''; + result += url.slashes ? '//' : ''; + result += url.auth ? url.auth + '@' : ''; + if (url.hostname && url.hostname.indexOf(':') !== -1) { + // ipv6 address + result += '[' + url.hostname + ']'; + } else { + result += url.hostname || ''; + } + result += url.port ? ':' + url.port : ''; + result += url.pathname || ''; + result += url.search || ''; + result += url.hash || ''; + return result; +} + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// +// Changes from joyent/node: +// +// 1. No leading slash in paths, +// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/` +// +// 2. Backslashes are not replaced with slashes, +// so `http:\\example.org\` is treated like a relative path +// +// 3. Trailing colon is treated like a part of the path, +// i.e. in `http://example.org:foo` pathname is `:foo` +// +// 4. Nothing is URL-encoded in the resulting object, +// (in joyent/node some chars in auth and paths are encoded) +// +// 5. `url.parse()` does not have `parseQueryString` argument +// +// 6. Removed extraneous result properties: `host`, `path`, `query`, etc., +// which can be constructed using other parts of the url. +// + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.pathname = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +const protocolPattern = /^([a-z0-9.+-]+:)/i; +const portPattern = /:[0-9]*$/; + +// Special case for a simple path URL +/* eslint-disable-next-line no-useless-escape */ +const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/; + +// RFC 2396: characters reserved for delimiting URLs. +// We actually just auto-escape these. +const delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t']; + +// RFC 2396: characters not allowed for various reasons. +const unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims); + +// Allowed by RFCs, but cause of XSS attacks. Always escape these. +const autoEscape = ['\''].concat(unwise); +// Characters that are never ever allowed in a hostname. +// Note that any invalid chars are also handled, but these +// are the ones that are *expected* to be seen, so we fast-path +// them. +const nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape); +const hostEndingChars = ['/', '?', '#']; +const hostnameMaxLen = 255; +const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/; +const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/; +// protocols that can allow "unsafe" and "unwise" chars. +// protocols that never have a hostname. +const hostlessProtocol = { + javascript: true, + 'javascript:': true +}; +// protocols that always contain a // bit. +const slashedProtocol = { + http: true, + https: true, + ftp: true, + gopher: true, + file: true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true +}; +function urlParse(url, slashesDenoteHost) { + if (url && url instanceof Url) return url; + const u = new Url(); + u.parse(url, slashesDenoteHost); + return u; +} +Url.prototype.parse = function (url, slashesDenoteHost) { + let lowerProto, hec, slashes; + let rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + const simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + } + return this; + } + } + let proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + lowerProto = proto.toLowerCase(); + this.protocol = proto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + /* eslint-disable-next-line no-useless-escape */ + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) { + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + let hostEnd = -1; + for (let i = 0; i < hostEndingChars.length; i++) { + hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + let auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = auth; + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (let i = 0; i < nonHostChars.length; i++) { + hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) { + hostEnd = rest.length; + } + if (rest[hostEnd - 1] === ':') { + hostEnd--; + } + const host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(host); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + const ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + const hostparts = this.hostname.split(/\./); + for (let i = 0, l = hostparts.length; i < l; i++) { + const part = hostparts[i]; + if (!part) { + continue; + } + if (!part.match(hostnamePartPattern)) { + let newpart = ''; + for (let j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + const validParts = hostparts.slice(0, i); + const notHost = hostparts.slice(i + 1); + const bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + } + } + + // chop off from the tail first. + const hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + const qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + rest = rest.slice(0, qm); + } + if (rest) { + this.pathname = rest; + } + if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { + this.pathname = ''; + } + return this; +}; +Url.prototype.parseHost = function (host) { + let port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) { + this.hostname = host; + } +}; +exports.decode = decode; +exports.encode = encode; +exports.format = format; +exports.parse = urlParse; + +/***/ }), + +/***/ "../node_modules/uc.micro/build/index.cjs.js": +/*!***************************************************!*\ + !*** ../node_modules/uc.micro/build/index.cjs.js ***! + \***************************************************/ +/***/ (function(__unused_webpack_module, exports) { + + + +var regex$5 = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var regex$4 = /[\0-\x1F\x7F-\x9F]/; +var regex$3 = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/; +var regex$2 = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/; +var regex$1 = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/; +var regex = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; +exports.Any = regex$5; +exports.Cc = regex$4; +exports.Cf = regex$3; +exports.P = regex$2; +exports.S = regex$1; +exports.Z = regex; + +/***/ }), + /***/ "./components/GraphiQL.tsx": /*!*********************************!*\ !*** ./components/GraphiQL.tsx ***! @@ -72235,11 +72914,23 @@ var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _react2 = __webpack_require__(/*! @graphiql/react */ "../../graphiql-react/dist/index.js"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /** + * Copyright (c) 2020 GraphQL Contributors. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ const majorVersion = parseInt(_react.default.version.slice(0, 2), 10); if (majorVersion < 16) { throw new Error(['GraphiQL 0.18.0 and after is not compatible with React 15 or below.', 'If you are using a CDN source (jsdelivr, unpkg, etc), follow this example:', 'https://github.com/graphql/graphiql/blob/master/examples/graphiql-cdn/index.html#L49'].join('\n')); } + +/** + * API docs for this live here: + * + * https://graphiql-test.netlify.app/typedoc/modules/graphiql.html#graphiqlprops + */ + /** * The top-level React component for GraphiQL, intended to encompass the entire * browser viewport. @@ -72248,6 +72939,7 @@ if (majorVersion < 16) { */ function GraphiQL(_ref) { + var _props$disableTabs; let { dangerouslyAssumeSchemaIsValid, defaultQuery, @@ -72309,7 +73001,8 @@ function GraphiQL(_ref) { validationRules: validationRules, variables: variables }, /*#__PURE__*/_react.default.createElement(GraphiQLInterface, _extends({ - showPersistHeadersSettings: shouldPersistHeaders !== false + showPersistHeadersSettings: shouldPersistHeaders !== false, + disableTabs: (_props$disableTabs = props.disableTabs) !== null && _props$disableTabs !== void 0 ? _props$disableTabs : false }, props))); } @@ -72543,7 +73236,7 @@ function GraphiQLInterface(props) { className: "graphiql-sessions" }, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-session-header" - }, /*#__PURE__*/_react.default.createElement(_react2.Tabs, { + }, props.disableTabs ? null : /*#__PURE__*/_react.default.createElement(_react2.Tabs, { values: editorContext.tabs, onReorder: handleReorder, "aria-label": "Select active operation" @@ -83529,16 +84222,6 @@ function _extends() { } module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; -/***/ }), - -/***/ "../../../node_modules/entities/lib/maps/entities.json": -/*!*************************************************************!*\ - !*** ../../../node_modules/entities/lib/maps/entities.json ***! - \*************************************************************/ -/***/ (function(module) { - -module.exports = JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}'); - /***/ }) /******/ }); diff --git a/netbox/project-static/dist/graphiql/index.umd.js b/netbox/project-static/dist/graphiql/index.umd.js index a30153f93..5089eab84 100644 --- a/netbox/project-static/dist/graphiql/index.umd.js +++ b/netbox/project-static/dist/graphiql/index.umd.js @@ -1 +1 @@ -(function(z,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("@graphiql/react"),require("react"),require("graphql")):typeof define=="function"&&define.amd?define(["exports","@graphiql/react","react","graphql"],W):(z=typeof globalThis<"u"?globalThis:z||self,W(z.GraphiQLPluginExplorer={},z.GraphiQL.React,z.React,z.GraphiQL.GraphQL))})(this,function(z,W,N,De){"use strict";function ve(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const s in i)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>i[s]})}}return t.default=i,Object.freeze(t)}const Te=ve(N),Ne=ve(De);function ge(i){return i&&Object.prototype.hasOwnProperty.call(i,"default")&&Object.keys(i).length===1?i.default:i}var re={},ie={};const Le=ge(Te),Me=ge(Ne);Object.defineProperty(ie,"__esModule",{value:!0});var je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},ye=function(){function i(t,s){var n=[],e=!0,l=!1,c=void 0;try{for(var f=t[Symbol.iterator](),u;!(e=(u=f.next()).done)&&(n.push(u.value),!(s&&n.length===s));e=!0);}catch(r){l=!0,c=r}finally{try{!e&&f.return&&f.return()}finally{if(l)throw c}}return n}return function(t,s){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return i(t,s);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=Object.assign||function(i){for(var t=1;t"u"?p=!0:typeof r.kind=="string"&&(h=!0)}catch{}var F=e.props.selection,d=e._getArgSelection();if(!d){console.error("missing arg selection when setting arg value");return}var b=Q(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in InputArgView.setArgValue",r);return}var C=void 0,_=void 0;r===null||typeof r>"u"?_=null:!r.target&&r.kind&&r.kind==="VariableDefinition"?(C=r,_=C.variable):typeof r.kind=="string"?_=r:r.target&&typeof r.target.value=="string"&&(C=r.target.value,_=ke(b,C));var A=e.props.modifyFields((F.fields||[]).map(function(D){var B=D===d,j=B?k({},D,{value:_}):D;return j}),o);return A},e._modifyChildFields=function(r){return e.props.modifyFields(e.props.selection.fields.map(function(o){return o.name.value===e.props.arg.name?k({},o,{value:{kind:"ObjectValue",fields:r}}):o}),!0)},n),w(e,l)}return P(t,[{key:"render",value:function(){var n=this.props,e=n.arg,l=n.parentField,c=this._getArgSelection();return a.createElement(Ee,{argValue:c?c.value:null,arg:e,parentField:l,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._modifyChildFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(a.PureComponent);function ue(i){if((0,v.isEnumType)(i))return{kind:"EnumValue",value:i.getValues()[0].name};switch(i.name){case"String":return{kind:"StringValue",value:""};case"Float":return{kind:"FloatValue",value:"1.5"};case"Int":return{kind:"IntValue",value:"10"};case"Boolean":return{kind:"BooleanValue",value:!1};default:return{kind:"StringValue",value:""}}}function Ce(i,t,s){return ue(s)}var We=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u"u"?p=!0:typeof r.kind=="string"&&(h=!0)}catch{}var F=e.props.selection,d=e._getArgSelection();if(!d&&!m){console.error("missing arg selection when setting arg value");return}var b=Q(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in ArgView._setArgValue");return}var C=void 0,_=void 0;return r===null||typeof r>"u"?_=null:r.target&&typeof r.target.value=="string"?(C=r.target.value,_=ke(b,C)):!r.target&&r.kind==="VariableDefinition"?(C=r,_=C.variable):typeof r.kind=="string"&&(_=r),e.props.modifyArguments((F.arguments||[]).map(function(A){return A===d?k({},A,{value:_}):A}),o)},e._setArgFields=function(r,o){var p=e.props.selection,m=e._getArgSelection();if(!m){console.error("missing arg selection when setting arg value");return}return e.props.modifyArguments((p.arguments||[]).map(function(h){return h===m?k({},h,{value:{kind:"ObjectValue",fields:r}}):h}),o)},n),w(e,l)}return P(t,[{key:"render",value:function(){var n=this.props,e=n.arg,l=n.parentField,c=this._getArgSelection();return a.createElement(Ee,{argValue:c?c.value:null,arg:e,parentField:l,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._setArgFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(a.PureComponent);function Qe(i){return i.ctrlKey&&i.key==="Enter"}function Ze(i){return i!=="FragmentDefinition"}var Ke=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u0?C=""+b+g:C=b;var _=c.type.toString(),A=(0,v.parseType)(_),D={kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:C}},type:A,directives:[]},B=function(x){return(n.props.definition.variableDefinitions||[]).find(function(T){return T.variable.name.value===x})},j=void 0,G={};if(typeof l<"u"&&l!==null){var U=(0,v.visit)(l,{Variable:function(x){var T=x.name.value,J=B(T);if(G[T]=G[T]+1||1,!!J)return J.defaultValue}}),K=D.type.kind==="NonNullType",M=K?k({},D,{type:D.type.type}):D;j=k({},M,{defaultValue:U})}else j=D;var $=Object.entries(G).filter(function(E){var x=ye(E,2);x[0];var T=x[1];return T<2}).map(function(E){var x=ye(E,2),T=x[0];return x[1],T});if(j){var X=n.props.setArgValue(j,!1);if(X){var ee=X.definitions.find(function(E){return E.operation&&E.name&&E.name.value&&n.props.definition.name&&n.props.definition.name.value?E.name.value===n.props.definition.name.value:!1}),y=[].concat(I(ee.variableDefinitions||[]),[j]).filter(function(E){return $.indexOf(E.variable.name.value)===-1}),S=k({},ee,{variableDefinitions:y}),O=X.definitions,V=O.map(function(E){return ee===E?S:E}),L=k({},X,{definitions:V});n.props.onCommit(L)}}},m=function(){if(!(!l||!l.name||!l.name.value)){var b=l.name.value,g=(n.props.definition.variableDefinitions||[]).find(function(M){return M.variable.name.value===b});if(g){var C=g.defaultValue,_=n.props.setArgValue(C,{commit:!1});if(_){var A=_.definitions.find(function(M){return M.name.value===n.props.definition.name.value});if(!A)return;var D=0;(0,v.visit)(A,{Variable:function($){$.name.value===b&&(D=D+1)}});var B=A.variableDefinitions||[];D<2&&(B=B.filter(function(M){return M.variable.name.value!==b}));var j=k({},A,{variableDefinitions:B}),G=_.definitions,U=G.map(function(M){return A===M?j:M}),K=k({},_,{definitions:U});n.props.onCommit(K)}}}},h=l&&l.kind==="Variable",F=this.state.displayArgActions?a.createElement("button",{type:"submit",className:"toolbar-button",title:h?"Remove the variable":"Extract the current value into a GraphQL variable",onClick:function(b){b.preventDefault(),b.stopPropagation(),h?m():p()},style:f.styles.actionButtonStyle},a.createElement("span",{style:{color:f.colors.variable}},"$")):null;return a.createElement("div",{style:{cursor:"pointer",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-arg-name":c.name,"data-arg-type":u.name,className:"graphiql-explorer-"+c.name},a.createElement("span",{style:{cursor:"pointer"},onClick:function(b){var g=!l;g?n.props.addArg(!0):n.props.removeArg(!0),n.setState({displayArgActions:g})}},(0,v.isInputObjectType)(u)?a.createElement("span",null,l?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):a.createElement(ae,{checked:!!l,styleConfig:this.props.styleConfig}),a.createElement("span",{style:{color:f.colors.attribute},title:c.description,onMouseEnter:function(){l!==null&&typeof l<"u"&&n.setState({displayArgActions:!0})},onMouseLeave:function(){return n.setState({displayArgActions:!1})}},c.name,Se(c)?"*":"",": ",F," ")," "),r||a.createElement("span",null)," ")}}]),t}(a.PureComponent),Je=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u0;C&&n.setState({displayFieldActions:!0})},onMouseLeave:function(){return n.setState({displayFieldActions:!1})}},(0,v.isObjectType)(o)?a.createElement("span",null,r?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):null,(0,v.isObjectType)(o)?null:a.createElement(ae,{checked:!!r,styleConfig:this.props.styleConfig}),a.createElement("span",{style:{color:u.colors.property},className:"graphiql-explorer-field-view"},l.name),this.state.displayFieldActions?a.createElement("button",{type:"submit",className:"toolbar-button",title:"Extract selections into a new reusable fragment",onClick:function(C){C.preventDefault(),C.stopPropagation();var _=o.name,A=_+"Fragment",D=(h||[]).filter(function(M){return M.name.value.startsWith(A)}).length;D>0&&(A=""+A+D);var B=r?r.selectionSet?r.selectionSet.selections:[]:[],j=[{kind:"FragmentSpread",name:{kind:"Name",value:A},directives:[]}],G={kind:"FragmentDefinition",name:{kind:"Name",value:A},typeCondition:{kind:"NamedType",name:{kind:"Name",value:o.name}},directives:[],selectionSet:{kind:"SelectionSet",selections:B}},U=n._modifyChildSelections(j,!1);if(U){var K=k({},U,{definitions:[].concat(I(U.definitions),[G])});n.props.onCommit(K)}else console.warn("Unable to complete extractFragment operation")},style:k({},u.styles.actionButtonStyle)},a.createElement("span",null,"…")):null),r&&p.length?a.createElement("div",{style:{marginLeft:16},className:"graphiql-explorer-graphql-arguments"},p.map(function(g){return a.createElement(We,{key:g.name,parentField:l,arg:g,selection:r,modifyArguments:n._setArguments,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})})):null);if(r&&((0,v.isObjectType)(o)||(0,v.isInterfaceType)(o)||(0,v.isUnionType)(o))){var d=(0,v.isUnionType)(o)?{}:o.getFields(),b=r?r.selectionSet?r.selectionSet.selections:[]:[];return a.createElement("div",{className:"graphiql-explorer-"+l.name},F,a.createElement("div",{style:{marginLeft:16}},h?h.map(function(g){var C=c.getType(g.typeCondition.name.value),_=g.name.value;return C?a.createElement(Ye,{key:_,fragment:g,selections:b,modifySelections:n._modifyChildSelections,schema:c,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit}):null}):null,Object.keys(d).sort().map(function(g){return a.createElement(t,{key:g,field:d[g],selections:b,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition,availableFragments:n.props.availableFragments})}),(0,v.isInterfaceType)(o)||(0,v.isUnionType)(o)?c.getPossibleTypes(o).map(function(g){return a.createElement(Je,{key:g.name,implementingType:g,selections:b,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})}):null))}return F}}]),t}(a.PureComponent);function Xe(i){try{return i.trim()?(0,v.parse)(i,{noLocation:!0}):null}catch(t){return new Error(t)}}var $e={kind:"OperationDefinition",operation:"query",variableDefinitions:[],name:{kind:"Name",value:"MyQuery"},directives:[],selectionSet:{kind:"SelectionSet",selections:[]}},le={kind:"Document",definitions:[$e]},Y=null;function et(i){if(Y&&Y[0]===i)return Y[1];var t=Xe(i);return t?t instanceof Error?Y?Y[1]:le:(Y=[i,t],t):le}var Oe={buttonStyle:{fontSize:"1.2em",padding:"0px",backgroundColor:"white",border:"none",margin:"5px 0px",height:"40px",width:"100%",display:"block",maxWidth:"none"},actionButtonStyle:{padding:"0px",backgroundColor:"white",border:"none",margin:"0px",maxWidth:"none",height:"15px",width:"15px",display:"inline-block",fontSize:"smaller"},explorerActionsStyle:{margin:"4px -8px -8px",paddingLeft:"8px",bottom:"0px",width:"100%",textAlign:"center",background:"none",borderTop:"none",borderBottom:"none"}},tt=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u"u"?"undefined":je(Z))==="object"&&typeof Z.commit<"u"?me=Z.commit:me=!0,H){var de=k({},d,{definitions:d.definitions.map(function(Ve){return Ve===y?H:Ve})});return me&&te(de),de}else return d},schema:l,getDefaultFieldNames:b,getDefaultScalarArgValue:g,makeDefaultArg:f,onRunOperation:function(){n.props.onRunOperation&&n.props.onRunOperation(O)},styleConfig:u,availableFragments:X})}),ee),K)}}]),t}(a.PureComponent);we.defaultProps={getDefaultFieldNames:be,getDefaultScalarArgValue:Ce};var rt=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u{f&&t(f),n()},[n,t]),[l,c]=W.useOperationsEditorState();return N.createElement(Fe,{schema:s,onRunOperation:e,explorerIsOpen:!0,colors:ot,arrowOpen:lt,arrowClosed:st,checkboxUnchecked:ut,checkboxChecked:pt,styles:ct,query:l,onEdit:c,...i})}function mt(i){return{title:"GraphiQL Explorer",icon:()=>N.createElement("svg",{height:"1em",strokeWidth:"1.5",viewBox:"0 0 24 24",fill:"none"},N.createElement("path",{d:"M18 6H20M22 6H20M20 6V4M20 6V8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),content:()=>N.createElement(ft,{...i})}}z.explorerPlugin=mt,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}); +(function(z,G){typeof exports=="object"&&typeof module<"u"?G(exports,require("@graphiql/react"),require("react"),require("graphql")):typeof define=="function"&&define.amd?define(["exports","@graphiql/react","react","graphql"],G):(z=typeof globalThis<"u"?globalThis:z||self,G(z.GraphiQLPluginExplorer={},z.GraphiQL.React,z.React,z.GraphiQL.GraphQL))})(this,function(z,G,N,De){"use strict";function ve(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const s in i)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>i[s]})}}return t.default=i,Object.freeze(t)}const Te=ve(N),Ne=ve(De);function ge(i){return i&&Object.prototype.hasOwnProperty.call(i,"default")&&Object.keys(i).length===1?i.default:i}var re={},ie={};const Le=ge(Te),Me=ge(Ne);Object.defineProperty(ie,"__esModule",{value:!0});var je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},ye=function(){function i(t,s){var n=[],e=!0,l=!1,c=void 0;try{for(var f=t[Symbol.iterator](),u;!(e=(u=f.next()).done)&&(n.push(u.value),!(s&&n.length===s));e=!0);}catch(r){l=!0,c=r}finally{try{!e&&f.return&&f.return()}finally{if(l)throw c}}return n}return function(t,s){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return i(t,s);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=Object.assign||function(i){for(var t=1;t"u"?p=!0:typeof r.kind=="string"&&(h=!0)}catch{}var F=e.props.selection,d=e._getArgSelection();if(!d){console.error("missing arg selection when setting arg value");return}var b=Q(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in InputArgView.setArgValue",r);return}var C=void 0,_=void 0;r===null||typeof r>"u"?_=null:!r.target&&r.kind&&r.kind==="VariableDefinition"?(C=r,_=C.variable):typeof r.kind=="string"?_=r:r.target&&typeof r.target.value=="string"&&(C=r.target.value,_=ke(b,C));var A=e.props.modifyFields((F.fields||[]).map(function(D){var B=D===d,j=B?k({},D,{value:_}):D;return j}),o);return A},e._modifyChildFields=function(r){return e.props.modifyFields(e.props.selection.fields.map(function(o){return o.name.value===e.props.arg.name?k({},o,{value:{kind:"ObjectValue",fields:r}}):o}),!0)},n),w(e,l)}return P(t,[{key:"render",value:function(){var n=this.props,e=n.arg,l=n.parentField,c=this._getArgSelection();return a.createElement(Ee,{argValue:c?c.value:null,arg:e,parentField:l,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._modifyChildFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(a.PureComponent);function ue(i){if((0,v.isEnumType)(i))return{kind:"EnumValue",value:i.getValues()[0].name};switch(i.name){case"String":return{kind:"StringValue",value:""};case"Float":return{kind:"FloatValue",value:"1.5"};case"Int":return{kind:"IntValue",value:"10"};case"Boolean":return{kind:"BooleanValue",value:!1};default:return{kind:"StringValue",value:""}}}function Ce(i,t,s){return ue(s)}var We=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u"u"?p=!0:typeof r.kind=="string"&&(h=!0)}catch{}var F=e.props.selection,d=e._getArgSelection();if(!d&&!m){console.error("missing arg selection when setting arg value");return}var b=Q(e.props.arg.type),g=(0,v.isLeafType)(b)||m||p||h;if(!g){console.warn("Unable to handle non leaf types in ArgView._setArgValue");return}var C=void 0,_=void 0;return r===null||typeof r>"u"?_=null:r.target&&typeof r.target.value=="string"?(C=r.target.value,_=ke(b,C)):!r.target&&r.kind==="VariableDefinition"?(C=r,_=C.variable):typeof r.kind=="string"&&(_=r),e.props.modifyArguments((F.arguments||[]).map(function(A){return A===d?k({},A,{value:_}):A}),o)},e._setArgFields=function(r,o){var p=e.props.selection,m=e._getArgSelection();if(!m){console.error("missing arg selection when setting arg value");return}return e.props.modifyArguments((p.arguments||[]).map(function(h){return h===m?k({},h,{value:{kind:"ObjectValue",fields:r}}):h}),o)},n),w(e,l)}return P(t,[{key:"render",value:function(){var n=this.props,e=n.arg,l=n.parentField,c=this._getArgSelection();return a.createElement(Ee,{argValue:c?c.value:null,arg:e,parentField:l,addArg:this._addArg,removeArg:this._removeArg,setArgFields:this._setArgFields,setArgValue:this._setArgValue,getDefaultScalarArgValue:this.props.getDefaultScalarArgValue,makeDefaultArg:this.props.makeDefaultArg,onRunOperation:this.props.onRunOperation,styleConfig:this.props.styleConfig,onCommit:this.props.onCommit,definition:this.props.definition})}}]),t}(a.PureComponent);function Qe(i){return i.ctrlKey&&i.key==="Enter"}function Ze(i){return i!=="FragmentDefinition"}var Ke=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u0?C=""+b+g:C=b;var _=c.type.toString(),A=(0,v.parseType)(_),D={kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:C}},type:A,directives:[]},B=function(x){return(n.props.definition.variableDefinitions||[]).find(function(T){return T.variable.name.value===x})},j=void 0,W={};if(typeof l<"u"&&l!==null){var U=(0,v.visit)(l,{Variable:function(x){var T=x.name.value,J=B(T);if(W[T]=W[T]+1||1,!!J)return J.defaultValue}}),K=D.type.kind==="NonNullType",M=K?k({},D,{type:D.type.type}):D;j=k({},M,{defaultValue:U})}else j=D;var $=Object.entries(W).filter(function(E){var x=ye(E,2);x[0];var T=x[1];return T<2}).map(function(E){var x=ye(E,2),T=x[0];return x[1],T});if(j){var X=n.props.setArgValue(j,!1);if(X){var ee=X.definitions.find(function(E){return E.operation&&E.name&&E.name.value&&n.props.definition.name&&n.props.definition.name.value?E.name.value===n.props.definition.name.value:!1}),y=[].concat(I(ee.variableDefinitions||[]),[j]).filter(function(E){return $.indexOf(E.variable.name.value)===-1}),S=k({},ee,{variableDefinitions:y}),O=X.definitions,V=O.map(function(E){return ee===E?S:E}),L=k({},X,{definitions:V});n.props.onCommit(L)}}},m=function(){if(!(!l||!l.name||!l.name.value)){var b=l.name.value,g=(n.props.definition.variableDefinitions||[]).find(function(M){return M.variable.name.value===b});if(g){var C=g.defaultValue,_=n.props.setArgValue(C,{commit:!1});if(_){var A=_.definitions.find(function(M){return M.name.value===n.props.definition.name.value});if(!A)return;var D=0;(0,v.visit)(A,{Variable:function($){$.name.value===b&&(D=D+1)}});var B=A.variableDefinitions||[];D<2&&(B=B.filter(function(M){return M.variable.name.value!==b}));var j=k({},A,{variableDefinitions:B}),W=_.definitions,U=W.map(function(M){return A===M?j:M}),K=k({},_,{definitions:U});n.props.onCommit(K)}}}},h=l&&l.kind==="Variable",F=this.state.displayArgActions?a.createElement("button",{type:"submit",className:"toolbar-button",title:h?"Remove the variable":"Extract the current value into a GraphQL variable",onClick:function(b){b.preventDefault(),b.stopPropagation(),h?m():p()},style:f.styles.actionButtonStyle},a.createElement("span",{style:{color:f.colors.variable}},"$")):null;return a.createElement("div",{style:{cursor:"pointer",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-arg-name":c.name,"data-arg-type":u.name,className:"graphiql-explorer-"+c.name},a.createElement("span",{style:{cursor:"pointer"},onClick:function(b){var g=!l;g?n.props.addArg(!0):n.props.removeArg(!0),n.setState({displayArgActions:g})}},(0,v.isInputObjectType)(u)?a.createElement("span",null,l?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):a.createElement(ae,{checked:!!l,styleConfig:this.props.styleConfig}),a.createElement("span",{style:{color:f.colors.attribute},title:c.description,onMouseEnter:function(){l!==null&&typeof l<"u"&&n.setState({displayArgActions:!0})},onMouseLeave:function(){return n.setState({displayArgActions:!1})}},c.name,Se(c)?"*":"",": ",F," ")," "),r||a.createElement("span",null)," ")}}]),t}(a.PureComponent),Je=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u0;C&&n.setState({displayFieldActions:!0})},onMouseLeave:function(){return n.setState({displayFieldActions:!1})}},(0,v.isObjectType)(o)?a.createElement("span",null,r?this.props.styleConfig.arrowOpen:this.props.styleConfig.arrowClosed):null,(0,v.isObjectType)(o)?null:a.createElement(ae,{checked:!!r,styleConfig:this.props.styleConfig}),a.createElement("span",{style:{color:u.colors.property},className:"graphiql-explorer-field-view"},l.name),this.state.displayFieldActions?a.createElement("button",{type:"submit",className:"toolbar-button",title:"Extract selections into a new reusable fragment",onClick:function(C){C.preventDefault(),C.stopPropagation();var _=o.name,A=_+"Fragment",D=(h||[]).filter(function(M){return M.name.value.startsWith(A)}).length;D>0&&(A=""+A+D);var B=r?r.selectionSet?r.selectionSet.selections:[]:[],j=[{kind:"FragmentSpread",name:{kind:"Name",value:A},directives:[]}],W={kind:"FragmentDefinition",name:{kind:"Name",value:A},typeCondition:{kind:"NamedType",name:{kind:"Name",value:o.name}},directives:[],selectionSet:{kind:"SelectionSet",selections:B}},U=n._modifyChildSelections(j,!1);if(U){var K=k({},U,{definitions:[].concat(I(U.definitions),[W])});n.props.onCommit(K)}else console.warn("Unable to complete extractFragment operation")},style:k({},u.styles.actionButtonStyle)},a.createElement("span",null,"…")):null),r&&p.length?a.createElement("div",{style:{marginLeft:16},className:"graphiql-explorer-graphql-arguments"},p.map(function(g){return a.createElement(We,{key:g.name,parentField:l,arg:g,selection:r,modifyArguments:n._setArguments,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})})):null);if(r&&((0,v.isObjectType)(o)||(0,v.isInterfaceType)(o)||(0,v.isUnionType)(o))){var d=(0,v.isUnionType)(o)?{}:o.getFields(),b=r?r.selectionSet?r.selectionSet.selections:[]:[];return a.createElement("div",{className:"graphiql-explorer-"+l.name},F,a.createElement("div",{style:{marginLeft:16}},h?h.map(function(g){var C=c.getType(g.typeCondition.name.value),_=g.name.value;return C?a.createElement(Ye,{key:_,fragment:g,selections:b,modifySelections:n._modifyChildSelections,schema:c,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit}):null}):null,Object.keys(d).sort().map(function(g){return a.createElement(t,{key:g,field:d[g],selections:b,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition,availableFragments:n.props.availableFragments})}),(0,v.isInterfaceType)(o)||(0,v.isUnionType)(o)?c.getPossibleTypes(o).map(function(g){return a.createElement(Je,{key:g.name,implementingType:g,selections:b,modifySelections:n._modifyChildSelections,schema:c,getDefaultFieldNames:f,getDefaultScalarArgValue:n.props.getDefaultScalarArgValue,makeDefaultArg:n.props.makeDefaultArg,onRunOperation:n.props.onRunOperation,styleConfig:n.props.styleConfig,onCommit:n.props.onCommit,definition:n.props.definition})}):null))}return F}}]),t}(a.PureComponent);function Xe(i){try{return i.trim()?(0,v.parse)(i,{noLocation:!0}):null}catch(t){return new Error(t)}}var $e={kind:"OperationDefinition",operation:"query",variableDefinitions:[],name:{kind:"Name",value:"MyQuery"},directives:[],selectionSet:{kind:"SelectionSet",selections:[]}},le={kind:"Document",definitions:[$e]},Y=null;function et(i){if(Y&&Y[0]===i)return Y[1];var t=Xe(i);return t?t instanceof Error?Y?Y[1]:le:(Y=[i,t],t):le}var Oe={buttonStyle:{fontSize:"1.2em",padding:"0px",backgroundColor:"white",border:"none",margin:"5px 0px",height:"40px",width:"100%",display:"block",maxWidth:"none"},actionButtonStyle:{padding:"0px",backgroundColor:"white",border:"none",margin:"0px",maxWidth:"none",height:"15px",width:"15px",display:"inline-block",fontSize:"smaller"},explorerActionsStyle:{margin:"4px -8px -8px",paddingLeft:"8px",bottom:"0px",width:"100%",textAlign:"center",background:"none",borderTop:"none",borderBottom:"none"}},tt=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u"u"?"undefined":je(Z))==="object"&&typeof Z.commit<"u"?me=Z.commit:me=!0,H){var de=k({},d,{definitions:d.definitions.map(function(Ve){return Ve===y?H:Ve})});return me&&te(de),de}else return d},schema:l,getDefaultFieldNames:b,getDefaultScalarArgValue:g,makeDefaultArg:f,onRunOperation:function(){n.props.onRunOperation&&n.props.onRunOperation(O)},styleConfig:u,availableFragments:X})}),ee),K)}}]),t}(a.PureComponent);we.defaultProps={getDefaultFieldNames:be,getDefaultScalarArgValue:Ce};var rt=function(i){R(t,i);function t(){var s,n,e,l;q(this,t);for(var c=arguments.length,f=Array(c),u=0;u{f&&t(f),n()},[n,t]),[l,c]=G.useOptimisticState(G.useOperationsEditorState());return N.createElement(Fe,{schema:s,onRunOperation:e,explorerIsOpen:!0,colors:ot,arrowOpen:lt,arrowClosed:st,checkboxUnchecked:ut,checkboxChecked:pt,styles:ct,query:l,onEdit:c,...i})}function mt(i){return{title:"GraphiQL Explorer",icon:()=>N.createElement("svg",{height:"1em",strokeWidth:"1.5",viewBox:"0 0 24 24",fill:"none"},N.createElement("path",{d:"M18 6H20M22 6H20M20 6V4M20 6V8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M21.4 20H2.6C2.26863 20 2 19.7314 2 19.4V11H21.4C21.7314 11 22 11.2686 22 11.6V19.4C22 19.7314 21.7314 20 21.4 20Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),content:()=>N.createElement(ft,{...i})}}z.explorerPlugin=mt,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}); diff --git a/netbox/project-static/dist/graphiql/react-dom.production.min.js b/netbox/project-static/dist/graphiql/react-dom.production.min.js index e8a0213d7..fb4e099c0 100644 --- a/netbox/project-static/dist/graphiql/react-dom.production.min.js +++ b/netbox/project-static/dist/graphiql/react-dom.production.min.js @@ -10,258 +10,258 @@ (function(){/* Modernizr 3.0.0pre (Custom Build) | MIT */ -'use strict';(function(Q,mb){"object"===typeof exports&&"undefined"!==typeof module?mb(exports,require("react")):"function"===typeof define&&define.amd?define(["exports","react"],mb):(Q=Q||self,mb(Q.ReactDOM={},Q.React))})(this,function(Q,mb){function n(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;cb}return!1}function Y(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}function $d(a,b,c,d){var e=R.hasOwnProperty(b)?R[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("")&&(k=k.replace("",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{ce=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?bc(a): -""}function gj(a){switch(a.tag){case 5:return bc(a.type);case 16:return bc("Lazy");case 13:return bc("Suspense");case 19:return bc("SuspenseList");case 0:case 2:case 15:return a=be(a.type,!1),a;case 11:return a=be(a.type.render,!1),a;case 1:return a=be(a.type,!0),a;default:return""}}function de(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case Bb:return"Fragment";case Cb:return"Portal";case ee:return"Profiler";case fe:return"StrictMode"; -case ge:return"Suspense";case he:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case gg:return(a.displayName||"Context")+".Consumer";case hg:return(a._context.displayName||"Context")+".Provider";case ie:var b=a.render;a=a.displayName;a||(a=b.displayName||b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case je:return b=a.displayName||null,null!==b?b:de(a.type)||"Memo";case Ta:b=a._payload;a=a._init;try{return de(a(b))}catch(c){}}return null}function hj(a){var b=a.type; +'use strict';(function(Q,zb){"object"===typeof exports&&"undefined"!==typeof module?zb(exports,require("react")):"function"===typeof define&&define.amd?define(["exports","react"],zb):(Q=Q||self,zb(Q.ReactDOM={},Q.React))})(this,function(Q,zb){function m(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;cb}return!1}function Y(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}function $d(a,b,c,d){var e=R.hasOwnProperty(b)?R[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("")&&(k=k.replace("",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{ce=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?bc(a): +""}function fj(a){switch(a.tag){case 5:return bc(a.type);case 16:return bc("Lazy");case 13:return bc("Suspense");case 19:return bc("SuspenseList");case 0:case 2:case 15:return a=be(a.type,!1),a;case 11:return a=be(a.type.render,!1),a;case 1:return a=be(a.type,!0),a;default:return""}}function de(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case Bb:return"Fragment";case Cb:return"Portal";case ee:return"Profiler";case fe:return"StrictMode"; +case ge:return"Suspense";case he:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case gg:return(a.displayName||"Context")+".Consumer";case hg:return(a._context.displayName||"Context")+".Provider";case ie:var b=a.render;a=a.displayName;a||(a=b.displayName||b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case je:return b=a.displayName||null,null!==b?b:de(a.type)||"Memo";case Ta:b=a._payload;a=a._init;try{return de(a(b))}catch(c){}}return null}function gj(a){var b=a.type; switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(b);case 8:return b===fe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler"; case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Ua(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}}function ig(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"=== -b)}function ij(a){var b=ig(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker= -null;delete a[b]}}}}function Pc(a){a._valueTracker||(a._valueTracker=ij(a))}function jg(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=ig(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Qc(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function ke(a,b){var c=b.checked;return E({},b,{defaultChecked:void 0,defaultValue:void 0, +b)}function hj(a){var b=ig(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker= +null;delete a[b]}}}}function Pc(a){a._valueTracker||(a._valueTracker=hj(a))}function jg(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=ig(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Qc(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function ke(a,b){var c=b.checked;return E({},b,{defaultChecked:void 0,defaultValue:void 0, value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function kg(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Ua(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function lg(a,b){b=b.checked;null!=b&&$d(a,"checked",b,!1)}function le(a,b){lg(a,b);var c=Ua(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!= c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?me(a,b.type,c):b.hasOwnProperty("defaultValue")&&me(a,b.type,Ua(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}function mg(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue; c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}function me(a,b,c){if("number"!==b||Qc(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}function Db(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e>>=0;return 0===a?32:31-(rj(a)/sj|0)|0}function hc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a& +if(c&&"function"!==typeof c)throw Error(m(231,b,typeof c));return c}function jj(a,b,c,d,e,f,g,h,k){gc=!1;Sc=null;kj.apply(lj,arguments)}function mj(a,b,c,d,e,f,g,h,k){jj.apply(this,arguments);if(gc){if(gc){var n=Sc;gc=!1;Sc=null}else throw Error(m(198));Tc||(Tc=!0,ue=n)}}function nb(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.flags&4098)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function zg(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate, +null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function Ag(a){if(nb(a)!==a)throw Error(m(188));}function nj(a){var b=a.alternate;if(!b){b=nb(a);if(null===b)throw Error(m(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return Ag(e),a;if(f===d)return Ag(e),b;f=f.sibling}throw Error(m(188));}if(c.return!==d.return)c=e,d=f; +else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(m(189));}}if(c.alternate!==d)throw Error(m(190));}if(3!==c.tag)throw Error(m(188));return c.stateNode.current===c?a:b}function Bg(a){a=nj(a);return null!==a?Cg(a):null}function Cg(a){if(5===a.tag||6===a.tag)return a;for(a=a.child;null!==a;){var b=Cg(a);if(null!==b)return b;a=a.sibling}return null} +function oj(a,b){if(Ca&&"function"===typeof Ca.onCommitFiberRoot)try{Ca.onCommitFiberRoot(Uc,a,void 0,128===(a.current.flags&128))}catch(c){}}function pj(a){a>>>=0;return 0===a?32:31-(qj(a)/rj|0)|0}function hc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a& 4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Vc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=hc(h):(f&=g,0!==f&&(d=hc(f)))}else g=c&~e,0!==g?d=hc(g):0!==f&&(d=hc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&& -(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a); -return b}function ic(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-ta(b);a[b]=c}function vj(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a); +return b}function ic(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-ta(b);a[b]=c}function uj(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=$g(c)}}function bh(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?bh(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function ch(){for(var a=window,b=Qc();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break; -b=Qc(a.document)}return b}function Ie(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}function Uj(a){var b=ch(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&bh(c.ownerDocument.documentElement,c)){if(null!==d&&Ie(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length); +b=Qc(a.document)}return b}function Ie(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}function Tj(a){var b=ch(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&bh(c.ownerDocument.documentElement,c)){if(null!==d&&Ie(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length); else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=ah(c,f);var g=ah(c,d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset), a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;cMb||(a.current=Se[Mb],Se[Mb]=null,Mb--)} -function y(a,b,c){Mb++;Se[Mb]=a.current;a.current=b}function Nb(a,b){var c=a.type.contextTypes;if(!c)return cb;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function ea(a){a=a.childContextTypes;return null!==a&&void 0!==a}function th(a,b,c){if(J.current!==cb)throw Error(n(168)); -y(J,b);y(S,c)}function uh(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(n(108,hj(a)||"Unknown",e));return E({},c,d)}function ld(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||cb;qb=J.current;y(J,a);y(S,S.current);return!0}function vh(a,b,c){var d=a.stateNode;if(!d)throw Error(n(169));c?(a=uh(a,b,qb),d.__reactInternalMemoizedMergedChildContext=a,w(S),w(J),y(J,a)):w(S); -y(S,c)}function wh(a){null===La?La=[a]:La.push(a)}function kk(a){md=!0;wh(a)}function db(){if(!Te&&null!==La){Te=!0;var a=0,b=z;try{var c=La;for(z=1;a>=g;e-=g;Ma=1<<32-ta(b)+e|c<q?(v=l,l=null):v=l.sibling;var A=r(e,l,h[q],k);if(null===A){null===l&&(l=v);break}a&&l&&null===A.alternate&&b(e,l);g=f(A,g,q);null===m?n=A:m.sibling=A;m=A;l=v}if(q===h.length)return c(e,l),D&&rb(e,q),n;if(null===l){for(;qv?(A=q,q=null):A=q.sibling;var x=r(e,q,t.value,k);if(null===x){null===q&&(q=A);break}a&&q&&null===x.alternate&&b(e,q);g=f(x,g,v);null===l?m=x:l.sibling=x;l=x;q=A}if(t.done)return c(e,q),D&&rb(e,v),m; -if(null===q){for(;!t.done;v++,t=h.next())t=u(e,t.value,k),null!==t&&(g=f(t,g,v),null===l?m=t:l.sibling=t,l=t);D&&rb(e,v);return m}for(q=d(e,q);!t.done;v++,t=h.next())t=p(q,e,v,t.value,k),null!==t&&(a&&null!==t.alternate&&q.delete(null===t.key?v:t.key),g=f(t,g,v),null===l?m=t:l.sibling=t,l=t);a&&q.forEach(function(a){return b(e,a)});D&&rb(e,v);return m}function w(a,d,f,h){"object"===typeof f&&null!==f&&f.type===Bb&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case xd:a:{for(var k= -f.key,m=d;null!==m;){if(m.key===k){k=f.type;if(k===Bb){if(7===m.tag){c(a,m.sibling);d=e(m,f.props.children);d.return=a;a=d;break a}}else if(m.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ta&&Kh(k)===m.type){c(a,m.sibling);d=e(m,f.props);d.ref=vc(a,m,f);d.return=a;a=d;break a}c(a,m);break}else b(a,m);m=m.sibling}f.type===Bb?(d=ub(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=wd(f.type,f.key,f.props,null,a.mode,h),h.ref=vc(a,d,f),h.return=a,a=h)}return g(a);case Cb:a:{for(m=f.key;null!== -d;){if(d.key===m)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=hf(f,a.mode,h);d.return=a;a=d}return g(a);case Ta:return m=f._init,w(a,d,m(f._payload),h)}if(cc(f))return x(a,d,f,h);if(ac(f))return F(a,d,f,h);vd(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d): -(c(a,d),d=gf(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return w}function vb(a){if(a===wc)throw Error(n(174));return a}function jf(a,b){y(xc,b);y(yc,a);y(Ea,wc);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:oe(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=oe(b,a)}w(Ea);y(Ea,b)}function Tb(a){w(Ea);w(yc);w(xc)}function Mh(a){vb(xc.current);var b=vb(Ea.current);var c=oe(b,a.type);b!==c&&(y(yc,a),y(Ea,c))}function kf(a){yc.current===a&& -(w(Ea),w(yc))}function yd(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}function lf(){for(var a=0;ac?c:4;a(!0);var d=uf.transition;uf.transition={};try{a(!1),b()}finally{z=c,uf.transition=d}}function di(){return sa().memoizedState}function rk(a,b, -c){var d=hb(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ei(a))fi(b,c);else if(c=Ch(a,b,c,d),null!==c){var e=Z();ya(c,a,d,e);gi(c,b,d)}}function pk(a,b,c){var d=hb(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ei(a))fi(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(ua(h,g)){var k=b.interleaved;null===k?(e.next=e,cf(b)): -(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(m){}finally{}c=Ch(a,b,e,d);null!==c&&(e=Z(),ya(c,a,d,e),gi(c,b,d))}}function ei(a){var b=a.alternate;return a===C||null!==b&&b===C}function fi(a,b){zc=Bd=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function gi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;xe(a,c)}}function Ub(a,b){try{var c="",d=b;do c+=gj(d),d=d.return;while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+ -"\n"+f.stack}return{value:a,source:b,stack:e,digest:null}}function vf(a,b,c){return{value:a,source:null,stack:null!=c?c:null,digest:null!=b?b:null}}function wf(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}function hi(a,b,c){c=Pa(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Ed||(Ed=!0,xf=d);wf(a,b)};return c}function ii(a,b,c){c=Pa(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)}; -c.callback=function(){wf(a,b)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){wf(a,b);"function"!==typeof d&&(null===ib?ib=new Set([this]):ib.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}function ji(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new sk;var e=new Set;d.set(b,e)}else e=d.get(b),void 0===e&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=tk.bind(null,a,b,c),b.then(a,a))}function ki(a){do{var b; -if(b=13===a.tag)b=a.memoizedState,b=null!==b?null!==b.dehydrated?!0:!1:!0;if(b)return a;a=a.return}while(null!==a);return null}function li(a,b,c,d,e){if(0===(a.mode&1))return a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:(b=Pa(-1,1),b.tag=2,eb(c,b,1))),c.lanes|=1),a;a.flags|=65536;a.lanes=e;return a}function aa(a,b,c,d){b.child=null===a?mi(b,null,c,d):Vb(b,a.child,c,d)}function ni(a,b,c,d,e){c=c.render;var f=b.ref;Sb(b,e);d=of(a,b,c,d,f, -e);c=pf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&c&&Ue(b);b.flags|=1;aa(a,b,d,e);return b.child}function oi(a,b,c,d,e){if(null===a){var f=c.type;if("function"===typeof f&&!yf(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,pi(a,b,f,d,e);a=wd(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:qc;if(c(g,d)&&a.ref=== -b.ref)return Qa(a,b,e)}b.flags|=1;a=gb(f,d);a.ref=b.ref;a.return=b;return b.child=a}function pi(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(qc(f,d)&&a.ref===b.ref)if(ha=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(ha=!0);else return b.lanes=a.lanes,Qa(a,b,e)}return zf(a,b,c,d,e)}function qi(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},y(Ga,ba),ba|=c; -else{if(0===(c&1073741824))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,y(Ga,ba),ba|=a,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null};d=null!==f?f.baseLanes:c;y(Ga,ba);ba|=d}else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,y(Ga,ba),ba|=d;aa(a,b,e,c);return b.child}function ri(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function zf(a, -b,c,d,e){var f=ea(c)?qb:J.current;f=Nb(b,f);Sb(b,e);c=of(a,b,c,d,f,e);d=pf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&d&&Ue(b);b.flags|=1;aa(a,b,c,e);return b.child}function si(a,b,c,d,e){if(ea(c)){var f=!0;ld(b)}else f=!1;Sb(b,e);if(null===b.stateNode)Fd(a,b),Hh(b,c,d),ff(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,m=c.contextType;"object"===typeof m&&null!==m?m=qa(m):(m=ea(c)?qb:J.current,m=Nb(b, -m));var l=c.getDerivedStateFromProps,n="function"===typeof l||"function"===typeof g.getSnapshotBeforeUpdate;n||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==m)&&Ih(b,g,d,m);fb=!1;var r=b.memoizedState;g.state=r;td(b,d,g,e);k=b.memoizedState;h!==d||r!==k||S.current||fb?("function"===typeof l&&(ef(b,c,l,d),k=b.memoizedState),(h=fb||Gh(b,c,h,d,r,k,m))?(n||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount|| -("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4194308)):("function"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=m,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;Dh(a,b);h=b.memoizedProps;m=b.type===b.elementType?h:xa(b.type,h);g.props= -m;n=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=qa(k):(k=ea(c)?qb:J.current,k=Nb(b,k));var p=c.getDerivedStateFromProps;(l="function"===typeof p||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==n||r!==k)&&Ih(b,g,d,k);fb=!1;r=b.memoizedState;g.state=r;td(b,d,g,e);var x=b.memoizedState;h!==n||r!==x||S.current||fb?("function"===typeof p&&(ef(b,c,p,d),x=b.memoizedState), -(m=fb||Gh(b,c,m,d,r,x,k)||!1)?(l||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,x,k),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|= -4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=k,d=m):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return Af(a,b,c,d,f,e)}function Af(a,b,c,d,e,f){ri(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&vh(b,c,!1), -Qa(a,b,f);d=b.stateNode;uk.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Vb(b,a.child,null,f),b.child=Vb(b,null,h,f)):aa(a,b,h,f);b.memoizedState=d.state;e&&vh(b,c,!0);return b.child}function ti(a){var b=a.stateNode;b.pendingContext?th(a,b.pendingContext,b.pendingContext!==b.context):b.context&&th(a,b.context,!1);jf(a,b.containerInfo)}function ui(a,b,c,d,e){Qb();Ye(e);b.flags|=256;aa(a,b,c,d);return b.child}function Bf(a){return{baseLanes:a, -cachePool:null,transitions:null}}function vi(a,b,c){var d=b.pendingProps,e=G.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;y(G,e&1);if(null===a){Xe(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:"$!"===a.data?b.lanes=8:b.lanes=1073741824,null;g=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,g={mode:"hidden",children:g},0===(d&1)&&null!== -f?(f.childLanes=0,f.pendingProps=g):f=Gd(g,d,0,null),a=ub(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=Bf(c),b.memoizedState=Cf,a):Df(b,g)}e=a.memoizedState;if(null!==e&&(h=e.dehydrated,null!==h))return vk(a,b,g,d,h,e,c);if(f){f=d.fallback;g=b.mode;e=a.child;h=e.sibling;var k={mode:"hidden",children:d.children};0===(g&1)&&b.child!==e?(d=b.child,d.childLanes=0,d.pendingProps=k,b.deletions=null):(d=gb(e,k),d.subtreeFlags=e.subtreeFlags&14680064);null!==h?f=gb(h,f):(f= -ub(f,g,c,null),f.flags|=2);f.return=b;d.return=b;d.sibling=f;b.child=d;d=f;f=b.child;g=a.child.memoizedState;g=null===g?Bf(c):{baseLanes:g.baseLanes|c,cachePool:null,transitions:g.transitions};f.memoizedState=g;f.childLanes=a.childLanes&~c;b.memoizedState=Cf;return d}f=a.child;a=f.sibling;d=gb(f,{mode:"visible",children:d.children});0===(b.mode&1)&&(d.lanes=c);d.return=b;d.sibling=null;null!==a&&(c=b.deletions,null===c?(b.deletions=[a],b.flags|=16):c.push(a));b.child=d;b.memoizedState=null;return d} -function Df(a,b,c){b=Gd({mode:"visible",children:b},a.mode,0,null);b.return=a;return a.child=b}function Hd(a,b,c,d){null!==d&&Ye(d);Vb(b,a.child,null,c);a=Df(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a}function vk(a,b,c,d,e,f,g){if(c){if(b.flags&256)return b.flags&=-257,d=vf(Error(n(422))),Hd(a,b,g,d);if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=Gd({mode:"visible",children:d.children},e,0,null);f=ub(f,e,g,null);f.flags|=2;d.return= -b;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&Vb(b,a.child,null,g);b.child.memoizedState=Bf(g);b.memoizedState=Cf;return f}if(0===(b.mode&1))return Hd(a,b,g,null);if("$!"===e.data){d=e.nextSibling&&e.nextSibling.dataset;if(d)var h=d.dgst;d=h;f=Error(n(419));d=vf(f,d,void 0);return Hd(a,b,g,d)}h=0!==(g&a.childLanes);if(ha||h){d=O;if(null!==d){switch(g&-g){case 4:e=2;break;case 16:e=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:e= -32;break;case 536870912:e=268435456;break;default:e=0}e=0!==(e&(d.suspendedLanes|g))?0:e;0!==e&&e!==f.retryLane&&(f.retryLane=e,Oa(a,e),ya(d,a,e,-1))}Ef();d=vf(Error(n(421)));return Hd(a,b,g,d)}if("$?"===e.data)return b.flags|=128,b.child=a.child,b=wk.bind(null,a),e._reactRetry=b,null;a=f.treeContext;fa=Ka(e.nextSibling);la=b;D=!0;wa=null;null!==a&&(na[oa++]=Ma,na[oa++]=Na,na[oa++]=sb,Ma=a.id,Na=a.overflow,sb=b);b=Df(b,d.children);b.flags|=4096;return b}function wi(a,b,c){a.lanes|=b;var d=a.alternate; -null!==d&&(d.lanes|=b);bf(a.return,b,c)}function Ff(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}function xi(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;aa(a,b,d.children,c);d=G.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&& -wi(a,c,b);else if(19===a.tag)wi(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}y(G,d);if(0===(b.mode&1))b.memoizedState=null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===yd(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Ff(b,!1,e,c,f);break;case "backwards":c= -null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===yd(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}Ff(b,!0,c,null,f);break;case "together":Ff(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Fd(a,b){0===(b.mode&1)&&null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2)}function Qa(a,b,c){null!==a&&(b.dependencies=a.dependencies);ra|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(n(153));if(null!== -b.child){a=b.child;c=gb(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=gb(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}function xk(a,b,c){switch(b.tag){case 3:ti(b);Qb();break;case 5:Mh(b);break;case 1:ea(b.type)&&ld(b);break;case 4:jf(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;y(rd,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return y(G,G.current& -1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return vi(a,b,c);y(G,G.current&1);a=Qa(a,b,c);return null!==a?a.sibling:null}y(G,G.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&128)){if(d)return xi(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);y(G,G.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,qi(a,b,c)}return Qa(a,b,c)}function Dc(a,b){if(!D)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!== +if(3===k||4===k)if(k=g.stateNode.containerInfo,k===e||8===k.nodeType&&k.parentNode===e)return;g=g.return}for(;null!==h;){g=ob(h);if(null===g)return;k=g.tag;if(5===k||6===k){d=f=g;continue a}h=h.parentNode}}d=d.return}wg(function(){var d=f,e=re(c),g=[];a:{var h=fh.get(a);if(void 0!==h){var k=He,m=a;switch(a){case "keypress":if(0===cd(c))break a;case "keydown":case "keyup":k=Vj;break;case "focusin":m="focus";k=Pe;break;case "focusout":m="blur";k=Pe;break;case "beforeblur":case "afterblur":k=Pe;break; +case "click":if(2===c.button)break a;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":k=ih;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":k=Wj;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":k=Xj;break;case jh:case kh:case lh:k=Yj;break;case mh:k=Zj;break;case "scroll":k=ak;break;case "wheel":k=bk;break;case "copy":case "cut":case "paste":k= +ck;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":k=nh}var l=0!==(b&4),p=!l&&"scroll"===a,w=l?null!==h?h+"Capture":null:h;l=[];for(var A=d,t;null!==A;){t=A;var M=t.stateNode;5===t.tag&&null!==M&&(t=M,null!==w&&(M=fc(A,w),null!=M&&l.push(tc(A,M,t))));if(p)break;A=A.return}0Mb||(a.current=Se[Mb],Se[Mb]=null,Mb--)} +function y(a,b,c){Mb++;Se[Mb]=a.current;a.current=b}function Nb(a,b){var c=a.type.contextTypes;if(!c)return cb;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function ea(a){a=a.childContextTypes;return null!==a&&void 0!==a}function th(a,b,c){if(J.current!==cb)throw Error(m(168)); +y(J,b);y(S,c)}function uh(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(m(108,gj(a)||"Unknown",e));return E({},c,d)}function ld(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||cb;pb=J.current;y(J,a);y(S,S.current);return!0}function vh(a,b,c){var d=a.stateNode;if(!d)throw Error(m(169));c?(a=uh(a,b,pb),d.__reactInternalMemoizedMergedChildContext=a,v(S),v(J),y(J,a)):v(S); +y(S,c)}function wh(a){null===La?La=[a]:La.push(a)}function jk(a){md=!0;wh(a)}function db(){if(!Te&&null!==La){Te=!0;var a=0,b=z;try{var c=La;for(z=1;a>=g;e-=g;Ma=1<<32-ta(b)+e|c<t?(q=l,l=null):q=l.sibling;var A=r(e,l,h[t],k);if(null===A){null===l&&(l=q);break}a&&l&&null===A.alternate&&b(e,l);g=f(A,g,t);null===m?n=A:m.sibling=A;m=A;l=q}if(t===h.length)return c(e,l),D&&qb(e,t),n;if(null===l){for(;t< +h.length;t++)l=u(e,h[t],k),null!==l&&(g=f(l,g,t),null===m?n=l:m.sibling=l,m=l);D&&qb(e,t);return n}for(l=d(e,l);tt?(A=q,q=null):A=q.sibling;var x=r(e,q,w.value,k);if(null===x){null===q&&(q=A);break}a&&q&&null===x.alternate&&b(e,q);g=f(x,g,t);null===l?n=x:l.sibling=x;l=x;q=A}if(w.done)return c(e,q),D&&qb(e,t),n;if(null===q){for(;!w.done;t++,w=h.next())w=u(e,w.value,k),null!==w&&(g=f(w,g,t),null===l?n=w:l.sibling=w,l=w);D&&qb(e,t);return n}for(q=d(e,q);!w.done;t++,w=h.next())w=p(q,e,t,w.value,k),null!==w&&(a&&null!==w.alternate&&q.delete(null===w.key?t:w.key),g=f(w,g,t),null===l?n=w:l.sibling= +w,l=w);a&&q.forEach(function(a){return b(e,a)});D&&qb(e,t);return n}function v(a,d,f,h){"object"===typeof f&&null!==f&&f.type===Bb&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case sd:a:{for(var k=f.key,n=d;null!==n;){if(n.key===k){k=f.type;if(k===Bb){if(7===n.tag){c(a,n.sibling);d=e(n,f.props.children);d.return=a;a=d;break a}}else if(n.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ta&&Ch(k)===n.type){c(a,n.sibling);d=e(n,f.props);d.ref=vc(a, +n,f);d.return=a;a=d;break a}c(a,n);break}else b(a,n);n=n.sibling}f.type===Bb?(d=sb(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=rd(f.type,f.key,f.props,null,a.mode,h),h.ref=vc(a,d,f),h.return=a,a=h)}return g(a);case Cb:a:{for(n=f.key;null!==d;){if(d.key===n)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=$e(f,a.mode,h);d.return=a; +a=d}return g(a);case Ta:return n=f._init,v(a,d,n(f._payload),h)}if(cc(f))return x(a,d,f,h);if(ac(f))return I(a,d,f,h);qd(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Ze(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return v}function af(){bf=Rb=td=null}function cf(a,b){b=ud.current;v(ud);a._currentValue=b}function df(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|= +b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}function Sb(a,b){td=a;bf=Rb=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(ha=!0),a.firstContext=null)}function qa(a){var b=a._currentValue;if(bf!==a)if(a={context:a,memoizedValue:b,next:null},null===Rb){if(null===td)throw Error(m(308));Rb=a;td.dependencies={lanes:0,firstContext:a}}else Rb=Rb.next=a;return b}function ef(a){null===tb?tb=[a]:tb.push(a)}function Eh(a,b,c,d){var e=b.interleaved; +null===e?(c.next=c,ef(b)):(c.next=e.next,e.next=c);b.interleaved=c;return Oa(a,d)}function Oa(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}function ff(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue= +{baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Pa(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}function fb(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(p&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return kk(a,c)}e=d.interleaved;null===e?(b.next=b,ef(d)):(b.next=e.next,e.next=b);d.interleaved=b;return Oa(a,c)}function vd(a,b,c){b= +b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;xe(a,c)}}function Gh(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f, +shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=b;c.lastBaseUpdate=b}function wd(a,b,c,d){var e=a.updateQueue;gb=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,n=k.next;k.next=null;null===g?f=n:g.next=n;g=k;var l=a.alternate;null!==l&&(l=l.updateQueue,h=l.lastBaseUpdate,h!==g&&(null===h?l.firstBaseUpdate=n:h.next=n,l.lastBaseUpdate=k))}if(null!==f){var m=e.baseState;g=0;l= +n=k=null;h=f;do{var r=h.lane,p=h.eventTime;if((d&r)===r){null!==l&&(l=l.next={eventTime:p,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,next:null});a:{var x=a,v=h;r=b;p=c;switch(v.tag){case 1:x=v.payload;if("function"===typeof x){m=x.call(p,m,r);break a}m=x;break a;case 3:x.flags=x.flags&-65537|128;case 0:x=v.payload;r="function"===typeof x?x.call(p,m,r):x;if(null===r||void 0===r)break a;m=E({},m,r);break a;case 2:gb=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,r=e.effects,null===r?e.effects= +[h]:r.push(h))}else p={eventTime:p,lane:r,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===l?(n=l=p,k=m):l=l.next=p,g|=r;h=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else r=h,h=r.next,r.next=null,e.lastBaseUpdate=r,e.shared.pending=null}while(1);null===l&&(k=m);e.baseState=k;e.firstBaseUpdate=n;e.lastBaseUpdate=l;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);ra|=g;a.lanes=g;a.memoizedState=m}}function Hh(a, +b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;bc?c:4;a(!0);var d=sf.transition;sf.transition= +{};try{a(!1),b()}finally{z=c,sf.transition=d}}function $h(){return sa().memoizedState}function qk(a,b,c){var d=hb(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ai(a))bi(b,c);else if(c=Eh(a,b,c,d),null!==c){var e=Z();xa(c,a,d,e);ci(c,b,d)}}function ok(a,b,c){var d=hb(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(ai(a))bi(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState, +h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(ua(h,g)){var k=b.interleaved;null===k?(e.next=e,ef(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(n){}finally{}c=Eh(a,b,e,d);null!==c&&(e=Z(),xa(c,a,d,e),ci(c,b,d))}}function ai(a){var b=a.alternate;return a===C||null!==b&&b===C}function bi(a,b){zc=Ad=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function ci(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;xe(a,c)}}function ya(a,b){if(a&& +a.defaultProps){b=E({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}function tf(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:E({},b,c);a.memoizedState=c;0===a.lanes&&(a.updateQueue.baseState=c)}function di(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!qc(c,d)||!qc(e,f):!0}function ei(a,b,c){var d=!1,e=cb;var f=b.contextType;"object"===typeof f&& +null!==f?f=qa(f):(e=ea(b)?pb:J.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Nb(a,e):cb);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Dd;a.stateNode=b;b._reactInternals=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}function fi(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&& +b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Dd.enqueueReplaceState(b,b.state,null)}function uf(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs={};ff(a);var f=b.contextType;"object"===typeof f&&null!==f?e.context=qa(f):(f=ea(b)?pb:J.current,e.context=Nb(a,f));e.state=a.memoizedState;f=b.getDerivedStateFromProps;"function"===typeof f&&(tf(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!== +typeof e.UNSAFE_componentWillMount&&"function"!==typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Dd.enqueueReplaceState(e,e.state,null),wd(a,c,e,d),e.state=a.memoizedState);"function"===typeof e.componentDidMount&&(a.flags|=4194308)}function Ub(a,b){try{var c="",d=b;do c+=fj(d),d=d.return;while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+ +"\n"+f.stack}return{value:a,source:b,stack:e,digest:null}}function vf(a,b,c){return{value:a,source:null,stack:null!=c?c:null,digest:null!=b?b:null}}function wf(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}function gi(a,b,c){c=Pa(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Ed||(Ed=!0,xf=d);wf(a,b)};return c}function hi(a,b,c){c=Pa(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)}; +c.callback=function(){wf(a,b)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){wf(a,b);"function"!==typeof d&&(null===ib?ib=new Set([this]):ib.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}function ii(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new rk;var e=new Set;d.set(b,e)}else e=d.get(b),void 0===e&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=sk.bind(null,a,b,c),b.then(a,a))}function ji(a){do{var b; +if(b=13===a.tag)b=a.memoizedState,b=null!==b?null!==b.dehydrated?!0:!1:!0;if(b)return a;a=a.return}while(null!==a);return null}function ki(a,b,c,d,e){if(0===(a.mode&1))return a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:(b=Pa(-1,1),b.tag=2,fb(c,b,1))),c.lanes|=1),a;a.flags|=65536;a.lanes=e;return a}function aa(a,b,c,d){b.child=null===a?li(b,null,c,d):Vb(b,a.child,c,d)}function mi(a,b,c,d,e){c=c.render;var f=b.ref;Sb(b,e);d=mf(a,b,c,d,f, +e);c=nf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&c&&Ue(b);b.flags|=1;aa(a,b,d,e);return b.child}function ni(a,b,c,d,e){if(null===a){var f=c.type;if("function"===typeof f&&!yf(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,oi(a,b,f,d,e);a=rd(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:qc;if(c(g,d)&&a.ref=== +b.ref)return Qa(a,b,e)}b.flags|=1;a=eb(f,d);a.ref=b.ref;a.return=b;return b.child=a}function oi(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(qc(f,d)&&a.ref===b.ref)if(ha=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(ha=!0);else return b.lanes=a.lanes,Qa(a,b,e)}return zf(a,b,c,d,e)}function pi(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},y(Ga,ba),ba|=c; +else{if(0===(c&1073741824))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,y(Ga,ba),ba|=a,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null};d=null!==f?f.baseLanes:c;y(Ga,ba);ba|=d}else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,y(Ga,ba),ba|=d;aa(a,b,e,c);return b.child}function qi(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function zf(a, +b,c,d,e){var f=ea(c)?pb:J.current;f=Nb(b,f);Sb(b,e);c=mf(a,b,c,d,f,e);d=nf();if(null!==a&&!ha)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Qa(a,b,e);D&&d&&Ue(b);b.flags|=1;aa(a,b,c,e);return b.child}function ri(a,b,c,d,e){if(ea(c)){var f=!0;ld(b)}else f=!1;Sb(b,e);if(null===b.stateNode)Fd(a,b),ei(b,c,d),uf(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,n=c.contextType;"object"===typeof n&&null!==n?n=qa(n):(n=ea(c)?pb:J.current,n=Nb(b, +n));var l=c.getDerivedStateFromProps,m="function"===typeof l||"function"===typeof g.getSnapshotBeforeUpdate;m||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==n)&&fi(b,g,d,n);gb=!1;var r=b.memoizedState;g.state=r;wd(b,d,g,e);k=b.memoizedState;h!==d||r!==k||S.current||gb?("function"===typeof l&&(tf(b,c,l,d),k=b.memoizedState),(h=gb||di(b,c,h,d,r,k,n))?(m||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount|| +("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4194308)):("function"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=n,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;Fh(a,b);h=b.memoizedProps;n=b.type===b.elementType?h:ya(b.type,h);g.props= +n;m=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=qa(k):(k=ea(c)?pb:J.current,k=Nb(b,k));var p=c.getDerivedStateFromProps;(l="function"===typeof p||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==m||r!==k)&&fi(b,g,d,k);gb=!1;r=b.memoizedState;g.state=r;wd(b,d,g,e);var x=b.memoizedState;h!==m||r!==x||S.current||gb?("function"===typeof p&&(tf(b,c,p,d),x=b.memoizedState), +(n=gb||di(b,c,n,d,r,x,k)||!1)?(l||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,x,k),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|= +4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=k,d=n):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return Af(a,b,c,d,f,e)}function Af(a,b,c,d,e,f){qi(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&vh(b,c,!1), +Qa(a,b,f);d=b.stateNode;tk.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Vb(b,a.child,null,f),b.child=Vb(b,null,h,f)):aa(a,b,h,f);b.memoizedState=d.state;e&&vh(b,c,!0);return b.child}function si(a){var b=a.stateNode;b.pendingContext?th(a,b.pendingContext,b.pendingContext!==b.context):b.context&&th(a,b.context,!1);gf(a,b.containerInfo)}function ti(a,b,c,d,e){Qb();Ye(e);b.flags|=256;aa(a,b,c,d);return b.child}function Bf(a){return{baseLanes:a, +cachePool:null,transitions:null}}function ui(a,b,c){var d=b.pendingProps,e=F.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;y(F,e&1);if(null===a){Xe(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:"$!"===a.data?b.lanes=8:b.lanes=1073741824,null;g=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,g={mode:"hidden",children:g},0===(d&1)&&null!== +f?(f.childLanes=0,f.pendingProps=g):f=Gd(g,d,0,null),a=sb(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=Bf(c),b.memoizedState=Cf,a):Df(b,g)}e=a.memoizedState;if(null!==e&&(h=e.dehydrated,null!==h))return uk(a,b,g,d,h,e,c);if(f){f=d.fallback;g=b.mode;e=a.child;h=e.sibling;var k={mode:"hidden",children:d.children};0===(g&1)&&b.child!==e?(d=b.child,d.childLanes=0,d.pendingProps=k,b.deletions=null):(d=eb(e,k),d.subtreeFlags=e.subtreeFlags&14680064);null!==h?f=eb(h,f):(f= +sb(f,g,c,null),f.flags|=2);f.return=b;d.return=b;d.sibling=f;b.child=d;d=f;f=b.child;g=a.child.memoizedState;g=null===g?Bf(c):{baseLanes:g.baseLanes|c,cachePool:null,transitions:g.transitions};f.memoizedState=g;f.childLanes=a.childLanes&~c;b.memoizedState=Cf;return d}f=a.child;a=f.sibling;d=eb(f,{mode:"visible",children:d.children});0===(b.mode&1)&&(d.lanes=c);d.return=b;d.sibling=null;null!==a&&(c=b.deletions,null===c?(b.deletions=[a],b.flags|=16):c.push(a));b.child=d;b.memoizedState=null;return d} +function Df(a,b,c){b=Gd({mode:"visible",children:b},a.mode,0,null);b.return=a;return a.child=b}function Hd(a,b,c,d){null!==d&&Ye(d);Vb(b,a.child,null,c);a=Df(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a}function uk(a,b,c,d,e,f,g){if(c){if(b.flags&256)return b.flags&=-257,d=vf(Error(m(422))),Hd(a,b,g,d);if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=Gd({mode:"visible",children:d.children},e,0,null);f=sb(f,e,g,null);f.flags|=2;d.return= +b;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&Vb(b,a.child,null,g);b.child.memoizedState=Bf(g);b.memoizedState=Cf;return f}if(0===(b.mode&1))return Hd(a,b,g,null);if("$!"===e.data){d=e.nextSibling&&e.nextSibling.dataset;if(d)var h=d.dgst;d=h;f=Error(m(419));d=vf(f,d,void 0);return Hd(a,b,g,d)}h=0!==(g&a.childLanes);if(ha||h){d=O;if(null!==d){switch(g&-g){case 4:e=2;break;case 16:e=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:e= +32;break;case 536870912:e=268435456;break;default:e=0}e=0!==(e&(d.suspendedLanes|g))?0:e;0!==e&&e!==f.retryLane&&(f.retryLane=e,Oa(a,e),xa(d,a,e,-1))}Ef();d=vf(Error(m(421)));return Hd(a,b,g,d)}if("$?"===e.data)return b.flags|=128,b.child=a.child,b=vk.bind(null,a),e._reactRetry=b,null;a=f.treeContext;fa=Ka(e.nextSibling);la=b;D=!0;wa=null;null!==a&&(na[oa++]=Ma,na[oa++]=Na,na[oa++]=rb,Ma=a.id,Na=a.overflow,rb=b);b=Df(b,d.children);b.flags|=4096;return b}function vi(a,b,c){a.lanes|=b;var d=a.alternate; +null!==d&&(d.lanes|=b);df(a.return,b,c)}function Ff(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}function wi(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;aa(a,b,d.children,c);d=F.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&& +vi(a,c,b);else if(19===a.tag)vi(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}y(F,d);if(0===(b.mode&1))b.memoizedState=null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===xd(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Ff(b,!1,e,c,f);break;case "backwards":c= +null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===xd(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}Ff(b,!0,c,null,f);break;case "together":Ff(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}function Fd(a,b){0===(b.mode&1)&&null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2)}function Qa(a,b,c){null!==a&&(b.dependencies=a.dependencies);ra|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(m(153));if(null!== +b.child){a=b.child;c=eb(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=eb(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}function wk(a,b,c){switch(b.tag){case 3:si(b);Qb();break;case 5:Ih(b);break;case 1:ea(b.type)&&ld(b);break;case 4:gf(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;y(ud,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return y(F,F.current& +1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return ui(a,b,c);y(F,F.current&1);a=Qa(a,b,c);return null!==a?a.sibling:null}y(F,F.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&128)){if(d)return wi(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);y(F,F.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,pi(a,b,c)}return Qa(a,b,c)}function Dc(a,b){if(!D)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!== b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}function W(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags&14680064,d|=e.flags&14680064,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes, -d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;a.subtreeFlags|=d;a.childLanes=c;return b}function yk(a,b,c){var d=b.pendingProps;Ve(b);switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(b),null;case 1:return ea(b.type)&&(w(S),w(J)),W(b),null;case 3:d=b.stateNode;Tb();w(S);w(J);lf();d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)pd(b)?b.flags|=4:null===a||a.memoizedState.isDehydrated&&0===(b.flags& -256)||(b.flags|=1024,null!==wa&&(Gf(wa),wa=null));yi(a,b);W(b);return null;case 5:kf(b);var e=vb(xc.current);c=b.type;if(null!==a&&null!=b.stateNode)zk(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(n(166));W(b);return null}a=vb(Ea.current);if(pd(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Da]=b;d[uc]=f;a=0!==(b.mode&1);switch(c){case "dialog":B("cancel",d);B("close",d);break;case "iframe":case "object":case "embed":B("load",d);break; +d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;a.subtreeFlags|=d;a.childLanes=c;return b}function xk(a,b,c){var d=b.pendingProps;Ve(b);switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(b),null;case 1:return ea(b.type)&&(v(S),v(J)),W(b),null;case 3:d=b.stateNode;Tb();v(S);v(J);jf();d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)pd(b)?b.flags|=4:null===a||a.memoizedState.isDehydrated&&0===(b.flags& +256)||(b.flags|=1024,null!==wa&&(Gf(wa),wa=null));xi(a,b);W(b);return null;case 5:hf(b);var e=ub(xc.current);c=b.type;if(null!==a&&null!=b.stateNode)yk(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(m(166));W(b);return null}a=ub(Ea.current);if(pd(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Da]=b;d[uc]=f;a=0!==(b.mode&1);switch(c){case "dialog":B("cancel",d);B("close",d);break;case "iframe":case "object":case "embed":B("load",d);break; case "video":case "audio":for(e=0;e\x3c/script>",a=a.removeChild(a.firstChild)):"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Da]=b;a[uc]=d;Ak(a,b,!1,!1);b.stateNode=a;a:{g=qe(c,d);switch(c){case "dialog":B("cancel",a);B("close",a);e=d;break;case "iframe":case "object":case "embed":B("load",a);e=d;break; +a&&(a=qg(c));"http://www.w3.org/1999/xhtml"===a?"script"===c?(a=g.createElement("div"),a.innerHTML=" {% django_htmx_script %} diff --git a/netbox/templates/base/layout.html b/netbox/templates/base/layout.html index d3124ea4a..397553446 100644 --- a/netbox/templates/base/layout.html +++ b/netbox/templates/base/layout.html @@ -2,6 +2,7 @@ {% extends 'base/base.html' %} {% load helpers %} {% load navigation %} +{% load plugins %} {% load static %} {% load i18n %} @@ -21,16 +22,23 @@ Blocks:

{# Top menu #} -